tree-sitter-mips
Version:
A syntax parser for the MIPS Instruction Set Architecture.
2,032 lines (2,031 loc) • 71.7 kB
JSON
{
"$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": "_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": "SYMBOL",
"name": "instruction"
},
{
"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"
}
]
}
},
"_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": "_numeric_directive"
},
{
"type": "SYMBOL",
"name": "_string_directive"
},
{
"type": "SYMBOL",
"name": "_control_directive"
}
]
}
]
},
"_macro_directive": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "mnemonic",
"content": {
"type": "SYMBOL",
"name": "macro_mnemonic"
}
},
{
"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"
}
]
}
]
},
"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"
}
]
}
]
}
}
]
}
},
"_numeric_directive": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "mnemonic",
"content": {
"type": "SYMBOL",
"name": "numeric_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": "numeric_operands"
}
}
]
},
{
"type": "SYMBOL",
"name": "_whitespace"
},
{
"type": "SYMBOL",
"name": "_block_comment"
}
]
},
{
"type": "BLANK"
}
]
}
]
},
{
"type": "FIELD",
"name": "mnemonic",
"content": {
"type": "SYMBOL",
"name": "numeric_mnemonic"
}
}
]
},
"numeric_mnemonic": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": ".byte"
},
{
"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": ".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"
},
{
"type": "STRING",
"value": ".skip"
},
{
"type": "STRING",
"value": ".space"
},
{
"type": "STRING",
"value": ".float"
},
{
"type": "STRING",
"value": ".double"
},
{
"type": "STRING",
"value": ".single"
}
]
},
"numeric_operands": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_expression"
},
{
"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": "_expression"
}
]
}
},
{
"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"
}
]
}
]
},
"_string_directive": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "mnemonic",
"content": {
"type": "SYMBOL",
"name": "string_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": "string_operands"
}
}
]
},
{
"type": "SYMBOL",
"name": "_whitespace"
},
{
"type": "SYMBOL",
"name": "_block_comment"
}
]
},
{
"type": "BLANK"
}
]
}
]
},
"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"
}
]
},
"string_operands": {
"type": "PREC_RIGHT",
"value": 0,
"content": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "string"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "REPEAT1",
"content": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "_block_comment"
},
{
"type": "SYMBOL",
"name": "_multiline_operand_separator_no_comment"
},
{
"type": "SYMBOL",
"name": "_multiline_operand_separator_with_comment_node"
}
]
}
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "string"
}
]
}
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "macro_variable"
},
{
"type": "SYMBOL",
"name": "address"
}
]
}
]
}
},
"_string_operand": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "string"
},
{
"type": "SYMBOL",
"name": "macro_variable"
},
{
"type": "SYMBOL",
"name": "address"
}
]
},
"_control_directive": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "mnemonic",
"content": {
"type": "SYMBOL",
"name": "control_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": "control_operands"
}
}
]
},
{
"type": "SYMBOL",
"name": "_whitespace"
},
{
"type": "SYMBOL",
"name": "_block_comment"
}
]
},
{
"type": "BLANK"
}
]
}
]
},
"control_mnemonic": {
"type": "PREC",
"value": -1,
"content": {
"type": "PATTERN",
"value": "\\.[a-z0-9_]+"
}
},
"control_operands": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_control_operand"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_control_operand_separator"
},
{
"type": "SYMBOL",
"name": "_control_operand"
}
]
}
}
]
},
"_control_operand": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_expression"
},
{
"type": "SYMBOL",
"name": "string"
},
{
"type": "SYMBOL",
"name": "elf_type_tag"
},
{
"type": "SYMBOL",
"name": "option_flag"
}
]
},
"_control_operand_separator": {
"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"
}
]
},
"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]"
}
},
"instruction": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "opcode",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "opcode"
},
{
"type": "SYMBOL",
"name": "macro_variable"
}
]
}
},
{
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_call_expression"
},
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_whitespace"
},
{
"type": "SYMBOL",
"name": "_block_comment"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "FIELD",
"name": "operands",
"content": {
"type": "SYMBOL",
"name": "operands"
}
},
{
"type": "SYMBOL",
"name": "_call_expression"
}
]
},
{
"type": "BLANK"
}
]
}
]
}
]
},
{
"type": "BLANK"
}
]
}
]
},
"opcode": {
"type": "TOKEN",
"content": {
"type": "PATTERN",
"value": "[a-zA-Z_][a-zA-Z0-9_.]*"
}
},
"operands": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "operand",
"content": {
"type": "SYMBOL",
"name": "_operand"
}
},
{
"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": "FIELD",
"name": "operand",
"content": {
"type": "SYMBOL",
"name": "_operand"
}
}
]
}
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_operand_separator"
},
{
"type": "BLANK"
}
]
}
]
},
"_operand": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_expression"
},
{
"type": "SYMBOL",
"name": "string"
}
]
},
"_call_expression": {
"type": "PREC",
"value": 20,
"content": {
"type": "SEQ",
"members": [
{
"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",