{
"$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/grammar.schema.json",
"name": "mips",
"rules": {
"program": {
"type": "SEQ",
"members": [
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "_statement"
}
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "directive"
},
{
"type": "SYMBOL",
"name": "instruction"
},
{
"type": "SYMBOL",
"name": "call_statement"
},
{
"type": "SYMBOL",
"name": "_label"
}
]
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_line_comment"
},
{
"type": "BLANK"
}
]
}
]
},
"_statement": {
"type": "PREC",
"value": 1,
"content": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": ";"
},
{
"type": "STRING",
"value": "\r"
},
{
"type": "STRING",
"value": "\n"
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "directive"
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": ";"
},
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_line_comment"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_statement_separator_no_comment"
},
{
"type": "SYMBOL",
"name": "_statement_separator_with_comment_node"
}
]
}
]
}
]
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "instruction"
},
{
"type": "SYMBOL",
"name": "call_statement"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": ";"
},
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_line_comment"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_statement_separator_no_comment"
},
{
"type": "SYMBOL",
"name": "_statement_separator_with_comment_node"
}
]
}
]
}
]
}
]
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_line_comment"
},
{
"type": "PATTERN",
"value": "\\r?\\n"
}
]
},
{
"type": "SYMBOL",
"name": "_label"
},
{
"type": "PREC",
"value": -10,
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "string"
},
{
"type": "SYMBOL",
"name": "char"
},
{
"type": "SYMBOL",
"name": "octal"
},
{
"type": "SYMBOL",
"name": "binary"
},
{
"type": "SYMBOL",
"name": "decimal"
},
{
"type": "SYMBOL",
"name": "hexadecimal"
},
{
"type": "SYMBOL",
"name": "float"
},
{
"type": "SYMBOL",
"name": "register"
}
]
}
}
]
}
},
"_whitespace": {
"type": "PATTERN",
"value": "[ \\t]+"
},
"_line_comment": {
"type": "ALIAS",
"content": {
"type": "TOKEN",
"content": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "#"
},
{
"type": "STRING",
"value": "//"
}
]
},
{
"type": "PATTERN",
"value": "(?:[^\\\\\\n]|\\\\\\r?\\n|\\\\.)*"
}
]
}
},
"named": true,
"value": "comment"
},
"_block_comment": {
"type": "ALIAS",
"content": {
"type": "IMMEDIATE_TOKEN",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "/*"
},
{
"type": "PATTERN",
"value": "(?:[^*]|\\*[^/])*"
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "*"
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "*/"
}
]
}
},
"named": true,
"value": "comment"
},
"_extra_block_comment": {
"type": "ALIAS",
"content": {
"type": "IMMEDIATE_TOKEN",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "/*"
},
{
"type": "PATTERN",
"value": "(?:[^*]|\\*[^/])*"
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "*"
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "*/"
}
]
}
},
"named": true,
"value": "comment"
},
"_statement_separator_with_comment_node": {
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "_statement_separator_with_comment"
},
"named": true,
"value": "comment"
},
"_multiline_operand_separator_with_comment_node": {
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "_multiline_operand_separator_with_comment"
},
"named": true,
"value": "comment"
},
"directive": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_macro_directive"
},
{
"type": "SYMBOL",
"name": "_directive"
}
]
}
]
},
"_macro_directive": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "mnemonic",
"content": {
"type": "SYMBOL",
"name": "macro_mnemonic"
}
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "PATTERN",
"value": "[ \\t]+"
},
{
"type": "SYMBOL",
"name": "_block_comment"
}
]
},
{
"type": "FIELD",
"name": "name",
"content": {
"type": "SYMBOL",
"name": "macro_name"
}
},
{
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_whitespace"
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "("
},
{
"type": "CHOICE",
"members": [
{
"type": "FIELD",
"name": "parameters",
"content": {
"type": "SYMBOL",
"name": "macro_parameters"
}
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": ")"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_whitespace"
},
{
"type": "CHOICE",
"members": [
{
"type": "FIELD",
"name": "parameters",
"content": {
"type": "SYMBOL",
"name": "macro_parameters"
}
},
{
"type": "BLANK"
}
]
}
]
}
]
},
{
"type": "BLANK"
}
]
}
]
},
{
"type": "BLANK"
}
]
}
]
},
"macro_mnemonic": {
"type": "STRING",
"value": ".macro"
},
"macro_parameters": {
"type": "PREC_LEFT",
"value": 0,
"content": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "macro_parameter"
},
{
"type": "REPEAT",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_whitespace"
},
{
"type": "SYMBOL",
"name": "macro_parameter"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_whitespace"
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": ","
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_whitespace"
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "macro_parameter"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_block_comment"
},
{
"type": "SYMBOL",
"name": "macro_parameter"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_line_comment"
},
{
"type": "SYMBOL",
"name": "macro_parameter"
}
]
},
{
"type": "SYMBOL",
"name": "_block_comment"
},
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_whitespace"
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "_line_comment"
}
]
}
]
}
}
]
}
},
"_directive": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "mnemonic",
"content": {
"type": "SYMBOL",
"name": "_directive_mnemonic"
}
},
{
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_whitespace"
},
{
"type": "SYMBOL",
"name": "_block_comment"
}
]
},
{
"type": "FIELD",
"name": "operands",
"content": {
"type": "SYMBOL",
"name": "directive_operands"
}
}
]
},
{
"type": "SYMBOL",
"name": "_whitespace"
},
{
"type": "SYMBOL",
"name": "_block_comment"
}
]
},
{
"type": "BLANK"
}
]
}
]
},
{
"type": "FIELD",
"name": "mnemonic",
"content": {
"type": "SYMBOL",
"name": "_directive_mnemonic"
}
}
]
},
"_directive_mnemonic": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "integer_mnemonic"
},
{
"type": "SYMBOL",
"name": "float_mnemonic"
},
{
"type": "SYMBOL",
"name": "control_mnemonic"
},
{
"type": "SYMBOL",
"name": "string_mnemonic"
}
]
},
"integer_mnemonic": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": ".byte"
},
{
"type": "STRING",
"value": ".octa"
},
{
"type": "STRING",
"value": ".2byte"
},
{
"type": "STRING",
"value": ".short"
},
{
"type": "STRING",
"value": ".half"
},
{
"type": "STRING",
"value": ".hword"
},
{
"type": "STRING",
"value": ".4byte"
},
{
"type": "STRING",
"value": ".word"
},
{
"type": "STRING",
"value": ".int"
},
{
"type": "STRING",
"value": ".8byte"
},
{
"type": "STRING",
"value": ".dword"
},
{
"type": "STRING",
"value": ".long"
},
{
"type": "STRING",
"value": ".quad"
},
{
"type": "STRING",
"value": ".comm"
},
{
"type": "STRING",
"value": ".lcomm"
},
{
"type": "STRING",
"value": ".fill"
},
{
"type": "STRING",
"value": ".skip"
},
{
"type": "STRING",
"value": ".space"
},
{
"type": "STRING",
"value": ".null"
},
{
"type": "STRING",
"value": ".zero"
},
{
"type": "STRING",
"value": ".align"
},
{
"type": "STRING",
"value": ".balign"
},
{
"type": "STRING",
"value": ".p2align"
},
{
"type": "STRING",
"value": ".sleb128"
},
{
"type": "STRING",
"value": ".uleb128"
},
{
"type": "STRING",
"value": ".dtprelword"
},
{
"type": "STRING",
"value": ".dtpreldword"
}
]
},
"float_mnemonic": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": ".float"
},
{
"type": "STRING",
"value": ".double"
},
{
"type": "STRING",
"value": ".single"
}
]
},
"string_mnemonic": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": ".asciz"
},
{
"type": "STRING",
"value": ".ascii"
},
{
"type": "STRING",
"value": ".asciiz"
},
{
"type": "STRING",
"value": ".string"
},
{
"type": "STRING",
"value": ".stringz"
}
]
},
"control_mnemonic": {
"type": "PREC",
"value": -1,
"content": {
"type": "PATTERN",
"value": "\\.[a-z0-9_]+"
}
},
"directive_operands": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_directive_operand"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_multiline_operand_separator_no_comment"
},
{
"type": "SYMBOL",
"name": "_multiline_operand_separator_with_comment_node"
}
]
},
{
"type": "BLANK"
}
]
}
]
},
{
"type": "SYMBOL",
"name": "_operand_separator"
},
{
"type": "SYMBOL",
"name": "_multiline_operand_separator_no_comment"
},
{
"type": "SYMBOL",
"name": "_multiline_operand_separator_with_comment_node"
}
]
},
{
"type": "SYMBOL",
"name": "_directive_operand"
}
]
}
},
{
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "REPEAT",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_multiline_operand_separator_no_comment"
},
{
"type": "SYMBOL",
"name": "_multiline_operand_separator_with_comment_node"
}
]
}
}
]
},
{
"type": "BLANK"
}
]
}
]
},
"_directive_operand": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_expression"
},
{
"type": "SYMBOL",
"name": "elf_type_tag"
},
{
"type": "SYMBOL",
"name": "option_flag"
}
]
},
"instruction": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "mnemonic",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "instruction_mnemonic"
},
{
"type": "SYMBOL",
"name": "macro_variable"
}
]
}
},
{
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_whitespace"
},
{
"type": "SYMBOL",
"name": "_block_comment"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "FIELD",
"name": "operands",
"content": {
"type": "SYMBOL",
"name": "operands"
}
},
{
"type": "BLANK"
}
]
}
]
}
]
},
{
"type": "BLANK"
}
]
}
]
},
"instruction_mnemonic": {
"type": "TOKEN",
"content": {
"type": "PATTERN",
"value": "[a-zA-Z_][a-zA-Z0-9_.]*"
}
},
"operands": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_expression"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "_operand_separator"
},
{
"type": "SYMBOL",
"name": "_multiline_operand_separator_with_comment_node"
}
]
},
{
"type": "SYMBOL",
"name": "_expression"
}
]
}
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_operand_separator"
},
{
"type": "BLANK"
}
]
}
]
},
"parenthesized_expression": {
"type": "PREC",
"value": 20,
"content": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "FIELD",
"name": "head",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "("
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_block_comment"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "FIELD",
"name": "arguments",
"content": {
"type": "SYMBOL",
"name": "operands"
}
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": ")"
}
]
}
},
"call_statement": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "name",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "symbol"
},
{
"type": "SYMBOL",
"name": "macro_variable"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "instruction_mnemonic"
},
"named": true,
"value": "symbol"
}
]
}
},
{
"type": "STRING",
"value": "("
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_block_comment"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "FIELD",
"name": "operands",
"content": {
"type": "SYMBOL",
"name": "operands"
}
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": ")"
}
]
},
"_expression": {
"type": "SYMBOL",
"name": "_wrapped_assignment_expression"
},
"_assignment_expression": {
"type": "PREC",
"value": 13,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_wrapped_assignment_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "SYMBOL",
"name": "assignment_operator"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_wrapped_logical_or_expression"
}
}
]
}
},
"assignment_operator": {
"type": "TOKEN",
"content": {
"type": "STRING",
"value": "="
}
},
"_wrapped_assignment_expression": {
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "_assignment_expression"
},
"named": true,
"value": "binary_expression"
},
{
"type": "SYMBOL",
"name": "_wrapped_logical_or_expression"
}
]
},
"_logical_or_expression": {
"type": "PREC",
"value": 1,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_wrapped_logical_or_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "SYMBOL",
"name": "logical_or_operator"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_wrapped_logical_and_expression"
}
}
]
}
},
"logical_or_operator": {
"type": "TOKEN",
"content": {
"type": "STRING",
"value": "||"
}
},
"_wrapped_logical_or_expression": {
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "_logical_or_expression"
},
"named": true,
"value": "binary_expression"
},
{
"type": "SYMBOL",
"name": "_wrapped_logical_and_expression"
}
]
},
"_logical_and_expression": {
"type": "PREC",
"value": 2,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_wrapped_logical_and_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "SYMBOL",
"name": "logical_and_operator"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_wrapped_bitwise_or_expression"
}
}
]
}
},
"logical_and_operator": {
"type": "TOKEN",
"content": {
"type": "STRING",
"value": "&&"
}
},
"_wrapped_logical_and_expression": {
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "_logical_and_expression"
},
"named": true,
"value": "binary_expression"
},
{
"type": "SYMBOL",
"name": "_wrapped_bitwise_or_expression"
}
]
},
"_bitwise_or_expression": {
"type": "PREC",
"value": 3,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_wrapped_bitwise_or_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "SYMBOL",
"name": "bitwise_or_operator"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_wrapped_bitwise_xor_expression"
}
}
]
}
},
"bitwise_or_operator": {
"type": "TOKEN",
"content": {
"type": "STRING",
"value": "|"
}
},
"_wrapped_bitwise_or_expression": {
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "_bitwise_or_expression"
},
"named": true,
"value": "binary_expression"
},
{
"type": "SYMBOL",
"name": "_wrapped_bitwise_xor_expression"
}
]
},
"_bitwise_xor_expression": {
"type": "PREC",
"value": 4,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_wrapped_bitwise_xor_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "SYMBOL",
"name": "bitwise_xor_operator"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_wrapped_bitwise_and_expression"
}
}
]
}
},
"bitwise_xor_operator": {
"type": "TOKEN",
"content": {
"type": "STRING",
"value": "^"
}
},
"_wrapped_bitwise_xor_expression": {
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "_bitwise_xor_expression"
},
"named": true,
"value": "binary_expression"
},
{
"type": "SYMBOL",
"name": "_wrapped_bitwise_and_expression"
}
]
},
"_bitwise_and_expression": {
"type": "PREC",
"value": 5,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_wrapped_bitwise_and_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "SYMBOL",
"name": "bitwise_and_operator"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_wrapped_equality_expression"
}
}
]
}
},
"bitwise_and_operator": {
"type": "TOKEN",
"content": {
"type": "STRING",
"value": "&"
}
},
"_wrapped_bitwise_and_expression": {
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "_bitwise_and_expression"
},
"named": true,
"value": "binary_expression"
},
{
"type": "SYMBOL",
"name": "_wrapped_equality_expression"
}
]
},
"_equality_expression": {
"type": "PREC",
"value": 6,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_wrapped_equality_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "SYMBOL",
"name": "equality_operator"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_wrapped_relational_expression"
}
}
]
}
},
"equality_operator": {
"type": "TOKEN",
"content": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "=="
},
{
"type": "STRING",
"value": "!="
}
]
}
},
"_wrapped_equality_expression": {
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "_equality_expression"
},
"named": true,
"value": "binary_expression"
},
{
"type": "SYMBOL",
"name": "_wrapped_relational_expression"
}
]
},
"_relational_expression": {
"type": "PREC",
"value": 7,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_wrapped_relational_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "SYMBOL",
"name": "relational_operator"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_wrapped_shift_expression"
}
}
]
}
},
"relational_operator": {
"type": "TOKEN",
"content": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "<"
},
{
"type": "STRING",
"value": ">"
},
{
"type": "STRING",
"value": "<="
},
{
"type": "STRING",
"value": ">="
}
]
}
},
"_wrapped_relational_expression": {
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "_relational_expression"
},
"named": true,
"value": "binary_expression"
},
{
"type": "SYMBOL",
"name": "_wrapped_shift_expression"
}
]
},
"_shift_expression": {
"type": "PREC",
"value": 8,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_wrapped_shift_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "SYMBOL",
"name": "shift_operator"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_wrapped_additive_expression"
}
}
]
}
},
"shift_operator": {
"type": "TOKEN",
"content": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "<<"
},
{
"type": "STRING",
"value": ">>"
}
]
}
},
"_wrapped_shift_expression": {
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "_shift_expression"
},
"named": true,
"value": "binary_expression"
},
{
"type": "SYMBOL",
"name": "_wrapped_additive_expression"
}
]
},
"_additive_expression": {
"type": "PREC",
"value": 9,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_wrapped_additive_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "SYMBOL",
"name": "additive_operator"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_wrapped_multiplicative_expression"
}
}
]
}
},
"additive_operator": {
"type": "TOKEN",
"content": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "+"
},
{
"type": "STRING",
"value": "-"
}
]
}
},
"_wrapped_additive_expression": {
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "_additive_expression"
},
"named": true,
"value": "binary_expression"
},
{
"type": "SYMBOL",
"name": "_wrapped_multiplicative_expression"
}
]
},
"_multiplicative_expression": {
"type": "PREC",
"value": 11,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_wrapped_multiplicative_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "SYMBOL",
"name": "multiplicative_operator"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_simple_expression"
}
}
]
}
},
"multiplicative_operator": {
"type": "CHOICE",
"members": [
{
"type": "TOKEN",
"content": {
"type": "STRING",
"value": "*"
}
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "_modulo_operator"
},
"named": false,
"value": "%"
},
{
"type": "TOKEN",
"content": {
"type": "STRING",
"value": "/"
}
}
]
},
"_modulo_operator": {
"type": "STRING",
"value": "%"
},
"_wrapped_multiplicative_expression": {
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "_multiplicative_expression"
},
"named": true,
"value": "binary_expression"
},
{
"type": "SYMBOL",
"name": "_simple_expression"
}
]
},
"_simple_expression": {
"type": "PREC_DYNAMIC",
"value": 1,
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "unary_expression"
},
{
"type": "SYMBOL",
"name": "parenthesized_expression"
},
{
"type": "SYMBOL",
"name": "macro_variable"
},
{
"type": "SYMBOL",
"name": "register"
},
{
"type": "SYMBOL",
"name": "symbol"
},
{
"type": "SYMBOL",
"name": "numeric_label_reference"
},
{
"type": "SYMBOL",
"name": "char"
},
{
"type": "SYMBOL",
"name": "string_concatenation"
},
{
"type": "SYMBOL",
"name": "string"
},
{
"type": "SYMBOL",
"name": "octal"
},
{
"type": "SYMBOL",
"name": "binary"
},
{
"type": "SYMBOL",
"name": "decimal"
},
{
"type": "SYMBOL",
"name": "hexadecimal"
},
{
"type": "SYMBOL",
"name": "float"
}
]
}
},
"unary_expression": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "unary_minus_operator"
},
{
"type": "SYMBOL",
"name": "bitwise_not_operator"
},
{
"type": "SYMBOL",
"name": "logical_not_operator"
}
]
}
},
{
"type": "FIELD",
"name": "argument",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
},
"unary_minus_operator": {
"type": "TOKEN",
"content": {
"type": "STRING",
"value": "-"
}
},
"bitwise_not_operator": {
"type": "TOKEN",
"content": {
"type": "STRING",
"value": "~"
}
},
"logical_not_operator": {
"type": "TOKEN",
"content": {
"type": "STRING",
"value": "!"
}
},
"octal": {
"type": "PATTERN",
"value": "-?0o?[0-7]*"
},
"binary": {
"type": "PATTERN",
"value": "-?0[bB][01]+"
},
"decimal": {
"type": "PREC",
"value": -1,
"content": {
"type": "PATTERN",
"value": "-?\\d+"
}
},
"hexadecimal": {
"type": "PATTERN",
"value": "-?0[xX][0-9a-fA-F]+"
},
"float": {
"type": "TOKEN",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "PATTERN",
"value": "-?\\d+\\.\\d*"
},
{
"type": "PATTERN",
"value": "-?\\d*\\.\\d+"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "PATTERN",
"value": "[eE][+-]?\\d+"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "f"
},
{
"type": "STRING",
"value": "d"
}
]
},
{
"type": "BLANK"
}
]
}
]
},
{
"type": "PATTERN",
"value": "-?\\d+[eE][+-]?\\d+f?"
}
]
}
},
"elf_type_tag": {
"type": "PREC",
"value": -5,
"content": {
"type": "PATTERN",
"value": "@[a-z]+"
}
},
"option_flag": {
"type": "PREC",
"value": -5,
"content": {
"type": "PATTERN",
"value": "\\+[a-z]"
}
},
"char": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "'"
},
{
"type": "CHOICE",
"members": [
{
"type": "PATTERN",
"value": "\\\\."
},
{
"type": "PATTERN",
"value": "[^'\\\\]"
}
]
},
{
"type": "STRING",
"value": "'"
}
]
},
"string": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "\""
},
{
"type": "REPEAT",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_escape_sequence"
},
{
"type": "SYMBOL",
"name": "string_macro_variable"
},
{
"type": "PATTERN",
"value": "[^\"\\\\]"
}
]
}
},
{
"type": "STRING",
"value": "\""
}
]
},
"_escape_sequence": {
"type": "TOKEN",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "\\"
},
{
"type": "CHOICE",
"members": [
{
"type": "PATTERN",
"value": "[abfnrtv\\\\'\"?]"
},
{
"type": "PATTERN",
"value": "[0-7]{1,3}"
},
{
"type": "PATTERN",
"value": "x[0-9a-fA-F]{2}"
},
{
"type": "PATTERN",
"value": "u[0-9a-fA-F]{4}"
},
{
"type": "PATTERN",
"value": "U[0-9a-fA-F]{8}"
}
]
}
]
}
},
"string_concatenation": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "string"
},
{
"type": "SYMBOL",
"name": "macro_variable"
}
]
},
{
"type": "REPEAT1",
"content": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "string"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "macro_variable"
},
{
"type": "BLANK"
}
]
}
]
}
}
]
},
"register": {
"type": "TOKEN",
"content": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "$"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "zero"
},
{
"type": "STRING",
"value": "at"
},
{
"type": "STRING",
"value": "gp"
},
{
"type": "STRING",
"value": "sp"
},
{
"type": "STRING",
"value": "fp"
},
{
"type": "STRING",
"value": "ra"
},
{
"type": "PATTERN",
"value": "[vV][0-1]"
},
{
"type": "PATTERN",
"value": "[kK][0-1]"
},
{
"type": "PATTERN",
"value": "[cC][0-3]"
},
{
"type": "STRING",
"value": "tp"
},
{
"type": "PATTERN",
"value": "f[ts](?:[0-9]|1[01])"
},
{
"type": "PATTERN",
"value": "fa[0-7]"
},
{
"type": "PATTERN",
"value": "[aA][0-7]"
},
{
"type": "PATTERN",
"value": "[sS](?:[0-9]|1[01])"
},
{
"type": "PATTERN",
"value": "[tT][0-9]"
},
{
"type": "PATTERN",
"value": "[frxFRX]?(?:[0-9]|[12][0-9]|30|31)"
}
]
}
]
}
},
"macro_variable": {
"type": "TOKEN",
"content": {
"type": "CHOICE",
"members": [
{
"type": "PATTERN",
"value": "[%][0-9a-zA-Z_$\\\\@]+(\\\\\\(\\)[0-9a-zA-Z_%$\\\\@]*)?"
},
{
"type": "PATTERN",
"value": "[$][0-9a-zA-Z_%\\\\@]+(\\\\\\(\\)[0-9a-zA-Z_%$\\\\@]*)?"
},
{
"type": "PATTERN",
"value": "[\\\\][0-9a-zA-Z_$%@]+(\\\\\\(\\)[0-9a-zA-Z_%$@]*)?"
},
{
"type": "PATTERN",
"value": "[0-9a-zA-Z_$\\\\%@]+[\\\\][0-9a-zA-Z_$%@]+(\\\\\\(\\)[0-9a-zA-Z_%$@]*)?"
}
]
}
},
"string_macro_variable": {
"type": "TOKEN",
"content": {
"type": "PATTERN",
"value": "\\\\[0-9a-zA-Z_$%]+(\\\\\\(\\))?"
}
},
"macro_name": {
"type": "TOKEN",
"content": {
"type": "PATTERN",
"value": "[a-zA-Z_][a-zA-Z0-9_$]*"
}
},
"macro_parameter": {
"type": "PREC_RIGHT",
"value": 0,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "name",
"content": {
"type": "SYMBOL",
"name": "macro_parameter_name"
}
},
{
"type": "CHOICE",
"members": [
{
"type": "FIELD",
"name": "qualifier",
"content": {
"type": "SYMBOL",
"name": "macro_parameter_qualifier"
}
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "="
},
{
"type": "FIELD",
"name": "value",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
},
{
"type": "BLANK"
}
]
}
]
}
},
"macro_parameter_name": {
"type": "TOKEN",
"content": {
"type": "PATTERN",
"value": "[%$\\\\]?[0-9a-zA-Z_$%\\\\]+"
}
},
"macro_parameter_qualifier": {
"type": "TOKEN",
"content": {
"type": "STRING",
"value": ":req"
}
},
"symbol": {
"type": "PREC",
"value": -1,
"content": {
"type": "PATTERN",
"value": "[a-zA-Z_.][a-zA-Z0-9_.$@]*"
}
},
"_label": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "label"
},
{
"type": "SYMBOL",
"name": "macro_label"
},
{
"type": "SYMBOL",
"name": "numeric_label"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_whitespace"
},
{
"type": "BLANK"
}
]
}
]
},
"label": {
"type": "TOKEN",
"content": {
"type": "PREC",
"value": 2,
"content": {
"type": "PATTERN",
"value": "[a-zA-Z0-9_.][a-zA-Z0-9_.$]*[ \\t]*:"
}
}
},
"macro_label": {
"type": "TOKEN",
"content": {
"type": "PATTERN",
"value": "[%$\\\\][0-9a-zA-Z_$\\\\]+(\\\\\\(\\)[0-9a-zA-Z_%$]*)?[ \\t]*:"
}
},
"numeric_label": {
"type": "TOKEN",
"content": {
"type": "PREC",
"value": 3,
"content": {
"type": "PATTERN",
"value": "[0-9][ \\t]*:"
}
}
},
"numeric_label_reference": {
"type": "TOKEN",
"content": {
"type": "PATTERN",
"value": "[0-9][fb]"
}
}
},
"extras": [
{
"type": "PATTERN",
"value": "[ \\t]|\\\\\\r?\\n"
},
{
"type": "SYMBOL",
"name": "_extra_block_comment"
},
{
"type": "SYMBOL",
"name": "_operator_space"
}
],
"conflicts": [],
"precedences": [],
"externals": [
{
"type": "SYMBOL",
"name": "_operand_separator"
},
{
"type": "SYMBOL",
"name": "_operator_space"
},
{
"type": "SYMBOL",
"name": "_statement_separator_no_comment"
},
{
"type": "SYMBOL",
"name": "_multiline_operand_separator_no_comment"
},
{
"type": "SYMBOL",
"name": "_statement_separator_with_comment"
},
{
"type": "SYMBOL",
"name": "_multiline_operand_separator_with_comment"
}
],
"inline": [
"_whitespace",
"_expression",
"_statement_separator_with_comment_node",
"_multiline_operand_separator_with_comment_node"
],
"supertypes": []
}