tree-sitter-gas
Описание
GNU Assembler grammar for Tree-sitter
Языки
- C89,2%
- C++5,9%
- JavaScript2,7%
- Rust1,3%
- Assembly0,3%
- Scheme0,3%
- Остальные0,3%
3 года назад
22 дня назад
22 дня назад
22 дня назад
22 дня назад
3 года назад
3 года назад
22 дня назад
3 года назад
22 дня назад
3 года назад
3 года назад
3 года назад
22 дня назад
22 дня назад
22 дня назад
README.md
GNU Assembler (x86/x86-64) grammar for Tree-sitter
A Tree-sitter grammar for GNU Assembler (GAS) targeting x86 and x86-64 architectures. Supports both AT&T and Intel syntax styles.
Features
Supported Syntax Styles
- AT&T Syntax: Full support with
register prefix (recommended)% - Intel Syntax: Full support with
directive and square bracket memory addressing.intel_syntax
Comment Styles
- Line comments#- C-style block comments/* */- C++ style comments (in//files with preprocessor).S- Statement separator (also acts as line terminator);
Directives
- All standard GNU as directives (
,.global,.section, etc.).ascii - Intel syntax directive:
with.intel_syntax/noprefixoptionsprefix
Memory Addressing
- AT&T:
andoffset(%base, %index, scale)%segment:offset - Intel:
with size directives ([base + index*scale + offset],byte ptr,word ptr,dword ptr, etc.)qword ptr
Installation for Helix Editor
Add to your :~/.config/helix/languages.toml
Then run:
Recommendations
For best results:
- Use AT&T syntax with
register prefix for reliable parsing% - Intel syntax without
prefix is supported but may have edge cases with symbol names%
Testing
Run tests with:
Examples
AT&T Syntax (x86-64)
Intel Syntax
Related Projects
For ARM/ARM64 assembly, see tree-sitter-arm.