neovim-config/tree-sitter-c/src/grammar.json
2022-08-07 15:46:45 +05:30

6629 lines
153 KiB
JSON
Vendored

{
"name": "c",
"word": "identifier",
"rules": {
"translation_unit": {
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "_top_level_item"
}
},
"_top_level_item": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "function_definition"
},
{
"type": "SYMBOL",
"name": "linkage_specification"
},
{
"type": "SYMBOL",
"name": "declaration"
},
{
"type": "SYMBOL",
"name": "_statement"
},
{
"type": "SYMBOL",
"name": "attributed_statement"
},
{
"type": "SYMBOL",
"name": "type_definition"
},
{
"type": "SYMBOL",
"name": "_empty_declaration"
},
{
"type": "SYMBOL",
"name": "preproc_if"
},
{
"type": "SYMBOL",
"name": "preproc_ifdef"
},
{
"type": "SYMBOL",
"name": "preproc_include"
},
{
"type": "SYMBOL",
"name": "preproc_def"
},
{
"type": "SYMBOL",
"name": "preproc_function_def"
},
{
"type": "SYMBOL",
"name": "preproc_call"
}
]
},
"preproc_include": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "#[ \t]*include"
},
"named": false,
"value": "#include"
},
{
"type": "FIELD",
"name": "path",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "string_literal"
},
{
"type": "SYMBOL",
"name": "system_lib_string"
},
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "preproc_call_expression"
},
"named": true,
"value": "call_expression"
}
]
}
},
{
"type": "STRING",
"value": "\n"
}
]
},
"preproc_def": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "#[ \t]*define"
},
"named": false,
"value": "#define"
},
{
"type": "FIELD",
"name": "name",
"content": {
"type": "SYMBOL",
"name": "identifier"
}
},
{
"type": "FIELD",
"name": "value",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "preproc_arg"
},
{
"type": "BLANK"
}
]
}
},
{
"type": "STRING",
"value": "\n"
}
]
},
"preproc_function_def": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "#[ \t]*define"
},
"named": false,
"value": "#define"
},
{
"type": "FIELD",
"name": "name",
"content": {
"type": "SYMBOL",
"name": "identifier"
}
},
{
"type": "FIELD",
"name": "parameters",
"content": {
"type": "SYMBOL",
"name": "preproc_params"
}
},
{
"type": "FIELD",
"name": "value",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "preproc_arg"
},
{
"type": "BLANK"
}
]
}
},
{
"type": "STRING",
"value": "\n"
}
]
},
"preproc_params": {
"type": "SEQ",
"members": [
{
"type": "IMMEDIATE_TOKEN",
"content": {
"type": "STRING",
"value": "("
}
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "STRING",
"value": "..."
}
]
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "STRING",
"value": "..."
}
]
}
]
}
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": ")"
}
]
},
"preproc_call": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "directive",
"content": {
"type": "SYMBOL",
"name": "preproc_directive"
}
},
{
"type": "FIELD",
"name": "argument",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "preproc_arg"
},
{
"type": "BLANK"
}
]
}
},
{
"type": "STRING",
"value": "\n"
}
]
},
"preproc_if": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "#[ \t]*if"
},
"named": false,
"value": "#if"
},
{
"type": "FIELD",
"name": "condition",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
},
{
"type": "STRING",
"value": "\n"
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "_top_level_item"
}
},
{
"type": "FIELD",
"name": "alternative",
"content": {
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "preproc_else"
},
{
"type": "SYMBOL",
"name": "preproc_elif"
}
]
},
{
"type": "BLANK"
}
]
}
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "#[ \t]*endif"
},
"named": false,
"value": "#endif"
}
]
},
"preproc_ifdef": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "#[ \t]*ifdef"
},
"named": false,
"value": "#ifdef"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "#[ \t]*ifndef"
},
"named": false,
"value": "#ifndef"
}
]
},
{
"type": "FIELD",
"name": "name",
"content": {
"type": "SYMBOL",
"name": "identifier"
}
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "_top_level_item"
}
},
{
"type": "FIELD",
"name": "alternative",
"content": {
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "preproc_else"
},
{
"type": "SYMBOL",
"name": "preproc_elif"
}
]
},
{
"type": "BLANK"
}
]
}
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "#[ \t]*endif"
},
"named": false,
"value": "#endif"
}
]
},
"preproc_else": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "#[ \t]*else"
},
"named": false,
"value": "#else"
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "_top_level_item"
}
}
]
},
"preproc_elif": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "#[ \t]*elif"
},
"named": false,
"value": "#elif"
},
{
"type": "FIELD",
"name": "condition",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
},
{
"type": "STRING",
"value": "\n"
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "_top_level_item"
}
},
{
"type": "FIELD",
"name": "alternative",
"content": {
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "preproc_else"
},
{
"type": "SYMBOL",
"name": "preproc_elif"
}
]
},
{
"type": "BLANK"
}
]
}
}
]
},
"preproc_if_in_field_declaration_list": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "#[ \t]*if"
},
"named": false,
"value": "#if"
},
{
"type": "FIELD",
"name": "condition",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
},
{
"type": "STRING",
"value": "\n"
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "_field_declaration_list_item"
}
},
{
"type": "FIELD",
"name": "alternative",
"content": {
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "preproc_else_in_field_declaration_list"
},
"named": true,
"value": "preproc_else"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "preproc_elif_in_field_declaration_list"
},
"named": true,
"value": "preproc_elif"
}
]
},
{
"type": "BLANK"
}
]
}
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "#[ \t]*endif"
},
"named": false,
"value": "#endif"
}
]
},
"preproc_ifdef_in_field_declaration_list": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "#[ \t]*ifdef"
},
"named": false,
"value": "#ifdef"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "#[ \t]*ifndef"
},
"named": false,
"value": "#ifndef"
}
]
},
{
"type": "FIELD",
"name": "name",
"content": {
"type": "SYMBOL",
"name": "identifier"
}
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "_field_declaration_list_item"
}
},
{
"type": "FIELD",
"name": "alternative",
"content": {
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "preproc_else_in_field_declaration_list"
},
"named": true,
"value": "preproc_else"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "preproc_elif_in_field_declaration_list"
},
"named": true,
"value": "preproc_elif"
}
]
},
{
"type": "BLANK"
}
]
}
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "#[ \t]*endif"
},
"named": false,
"value": "#endif"
}
]
},
"preproc_else_in_field_declaration_list": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "#[ \t]*else"
},
"named": false,
"value": "#else"
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "_field_declaration_list_item"
}
}
]
},
"preproc_elif_in_field_declaration_list": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "#[ \t]*elif"
},
"named": false,
"value": "#elif"
},
{
"type": "FIELD",
"name": "condition",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
},
{
"type": "STRING",
"value": "\n"
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "_field_declaration_list_item"
}
},
{
"type": "FIELD",
"name": "alternative",
"content": {
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "preproc_else_in_field_declaration_list"
},
"named": true,
"value": "preproc_else"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "preproc_elif_in_field_declaration_list"
},
"named": true,
"value": "preproc_elif"
}
]
},
{
"type": "BLANK"
}
]
}
}
]
},
"preproc_directive": {
"type": "PATTERN",
"value": "#[ \\t]*[a-zA-Z]\\w*"
},
"preproc_arg": {
"type": "TOKEN",
"content": {
"type": "PREC",
"value": -1,
"content": {
"type": "REPEAT1",
"content": {
"type": "PATTERN",
"value": ".|\\\\\\r?\\n"
}
}
}
},
"_preproc_expression": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "preproc_call_expression"
},
"named": true,
"value": "call_expression"
},
{
"type": "SYMBOL",
"name": "number_literal"
},
{
"type": "SYMBOL",
"name": "char_literal"
},
{
"type": "SYMBOL",
"name": "preproc_defined"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "preproc_unary_expression"
},
"named": true,
"value": "unary_expression"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "preproc_binary_expression"
},
"named": true,
"value": "binary_expression"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "preproc_parenthesized_expression"
},
"named": true,
"value": "parenthesized_expression"
}
]
},
"preproc_parenthesized_expression": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "("
},
{
"type": "SYMBOL",
"name": "_preproc_expression"
},
{
"type": "STRING",
"value": ")"
}
]
},
"preproc_defined": {
"type": "CHOICE",
"members": [
{
"type": "PREC",
"value": 14,
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "defined"
},
{
"type": "STRING",
"value": "("
},
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "STRING",
"value": ")"
}
]
}
},
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "defined"
},
{
"type": "SYMBOL",
"name": "identifier"
}
]
}
]
},
"preproc_unary_expression": {
"type": "PREC_LEFT",
"value": 13,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "!"
},
{
"type": "STRING",
"value": "~"
},
{
"type": "STRING",
"value": "-"
},
{
"type": "STRING",
"value": "+"
}
]
}
},
{
"type": "FIELD",
"name": "argument",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
}
]
}
},
"preproc_call_expression": {
"type": "PREC",
"value": 14,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "function",
"content": {
"type": "SYMBOL",
"name": "identifier"
}
},
{
"type": "FIELD",
"name": "arguments",
"content": {
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "preproc_argument_list"
},
"named": true,
"value": "argument_list"
}
}
]
}
},
"preproc_argument_list": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "("
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_preproc_expression"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "_preproc_expression"
}
]
}
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": ")"
}
]
},
"preproc_binary_expression": {
"type": "CHOICE",
"members": [
{
"type": "PREC_LEFT",
"value": 10,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "+"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 10,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "-"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 11,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "*"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 11,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "/"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 11,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "%"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 1,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "||"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 2,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "&&"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 3,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "|"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 4,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "^"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 5,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "&"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 6,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "=="
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 6,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "!="
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 7,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": ">"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 7,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": ">="
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 7,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "<="
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 7,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "<"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 9,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "<<"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 9,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": ">>"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_preproc_expression"
}
}
]
}
}
]
},
"function_definition": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "ms_call_modifier"
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "_declaration_specifiers"
},
{
"type": "FIELD",
"name": "declarator",
"content": {
"type": "SYMBOL",
"name": "_declarator"
}
},
{
"type": "FIELD",
"name": "body",
"content": {
"type": "SYMBOL",
"name": "compound_statement"
}
}
]
},
"declaration": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_declaration_specifiers"
},
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "declarator",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_declarator"
},
{
"type": "SYMBOL",
"name": "init_declarator"
}
]
}
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "FIELD",
"name": "declarator",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_declarator"
},
{
"type": "SYMBOL",
"name": "init_declarator"
}
]
}
}
]
}
}
]
},
{
"type": "STRING",
"value": ";"
}
]
},
"type_definition": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "typedef"
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "type_qualifier"
}
},
{
"type": "FIELD",
"name": "type",
"content": {
"type": "SYMBOL",
"name": "_type_specifier"
}
},
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "declarator",
"content": {
"type": "SYMBOL",
"name": "_type_declarator"
}
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "FIELD",
"name": "declarator",
"content": {
"type": "SYMBOL",
"name": "_type_declarator"
}
}
]
}
}
]
},
{
"type": "STRING",
"value": ";"
}
]
},
"_declaration_modifiers": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "storage_class_specifier"
},
{
"type": "SYMBOL",
"name": "type_qualifier"
},
{
"type": "SYMBOL",
"name": "attribute_specifier"
},
{
"type": "SYMBOL",
"name": "attribute_declaration"
},
{
"type": "SYMBOL",
"name": "ms_declspec_modifier"
}
]
},
"_declaration_specifiers": {
"type": "SEQ",
"members": [
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "_declaration_modifiers"
}
},
{
"type": "FIELD",
"name": "type",
"content": {
"type": "SYMBOL",
"name": "_type_specifier"
}
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "_declaration_modifiers"
}
}
]
},
"linkage_specification": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "extern"
},
{
"type": "FIELD",
"name": "value",
"content": {
"type": "SYMBOL",
"name": "string_literal"
}
},
{
"type": "FIELD",
"name": "body",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "function_definition"
},
{
"type": "SYMBOL",
"name": "declaration"
},
{
"type": "SYMBOL",
"name": "declaration_list"
}
]
}
}
]
},
"attribute_specifier": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "__attribute__"
},
{
"type": "STRING",
"value": "("
},
{
"type": "SYMBOL",
"name": "argument_list"
},
{
"type": "STRING",
"value": ")"
}
]
},
"attribute": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "prefix",
"content": {
"type": "SYMBOL",
"name": "identifier"
}
},
{
"type": "STRING",
"value": "::"
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "FIELD",
"name": "name",
"content": {
"type": "SYMBOL",
"name": "identifier"
}
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "argument_list"
},
{
"type": "BLANK"
}
]
}
]
},
"attribute_declaration": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "[["
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "attribute"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "attribute"
}
]
}
}
]
},
{
"type": "STRING",
"value": "]]"
}
]
},
"ms_declspec_modifier": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "__declspec"
},
{
"type": "STRING",
"value": "("
},
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "STRING",
"value": ")"
}
]
},
"ms_based_modifier": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "__based"
},
{
"type": "SYMBOL",
"name": "argument_list"
}
]
},
"ms_call_modifier": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "__cdecl"
},
{
"type": "STRING",
"value": "__clrcall"
},
{
"type": "STRING",
"value": "__stdcall"
},
{
"type": "STRING",
"value": "__fastcall"
},
{
"type": "STRING",
"value": "__thiscall"
},
{
"type": "STRING",
"value": "__vectorcall"
}
]
},
"ms_restrict_modifier": {
"type": "STRING",
"value": "__restrict"
},
"ms_unsigned_ptr_modifier": {
"type": "STRING",
"value": "__uptr"
},
"ms_signed_ptr_modifier": {
"type": "STRING",
"value": "__sptr"
},
"ms_unaligned_ptr_modifier": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "_unaligned"
},
{
"type": "STRING",
"value": "__unaligned"
}
]
},
"ms_pointer_modifier": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "ms_unaligned_ptr_modifier"
},
{
"type": "SYMBOL",
"name": "ms_restrict_modifier"
},
{
"type": "SYMBOL",
"name": "ms_unsigned_ptr_modifier"
},
{
"type": "SYMBOL",
"name": "ms_signed_ptr_modifier"
}
]
},
"declaration_list": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "{"
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "_top_level_item"
}
},
{
"type": "STRING",
"value": "}"
}
]
},
"_declarator": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "attributed_declarator"
},
{
"type": "SYMBOL",
"name": "pointer_declarator"
},
{
"type": "SYMBOL",
"name": "function_declarator"
},
{
"type": "SYMBOL",
"name": "array_declarator"
},
{
"type": "SYMBOL",
"name": "parenthesized_declarator"
},
{
"type": "SYMBOL",
"name": "identifier"
}
]
},
"_field_declarator": {
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "attributed_field_declarator"
},
"named": true,
"value": "attributed_declarator"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "pointer_field_declarator"
},
"named": true,
"value": "pointer_declarator"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "function_field_declarator"
},
"named": true,
"value": "function_declarator"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "array_field_declarator"
},
"named": true,
"value": "array_declarator"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "parenthesized_field_declarator"
},
"named": true,
"value": "parenthesized_declarator"
},
{
"type": "SYMBOL",
"name": "_field_identifier"
}
]
},
"_type_declarator": {
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "attributed_type_declarator"
},
"named": true,
"value": "attributed_declarator"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "pointer_type_declarator"
},
"named": true,
"value": "pointer_declarator"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "function_type_declarator"
},
"named": true,
"value": "function_declarator"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "array_type_declarator"
},
"named": true,
"value": "array_declarator"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "parenthesized_type_declarator"
},
"named": true,
"value": "parenthesized_declarator"
},
{
"type": "SYMBOL",
"name": "_type_identifier"
}
]
},
"_abstract_declarator": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "abstract_pointer_declarator"
},
{
"type": "SYMBOL",
"name": "abstract_function_declarator"
},
{
"type": "SYMBOL",
"name": "abstract_array_declarator"
},
{
"type": "SYMBOL",
"name": "abstract_parenthesized_declarator"
}
]
},
"parenthesized_declarator": {
"type": "PREC_DYNAMIC",
"value": -10,
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "("
},
{
"type": "SYMBOL",
"name": "_declarator"
},
{
"type": "STRING",
"value": ")"
}
]
}
},
"parenthesized_field_declarator": {
"type": "PREC_DYNAMIC",
"value": -10,
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "("
},
{
"type": "SYMBOL",
"name": "_field_declarator"
},
{
"type": "STRING",
"value": ")"
}
]
}
},
"parenthesized_type_declarator": {
"type": "PREC_DYNAMIC",
"value": -10,
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "("
},
{
"type": "SYMBOL",
"name": "_type_declarator"
},
{
"type": "STRING",
"value": ")"
}
]
}
},
"abstract_parenthesized_declarator": {
"type": "PREC",
"value": 1,
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "("
},
{
"type": "SYMBOL",
"name": "_abstract_declarator"
},
{
"type": "STRING",
"value": ")"
}
]
}
},
"attributed_declarator": {
"type": "PREC_RIGHT",
"value": 0,
"content": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_declarator"
},
{
"type": "REPEAT1",
"content": {
"type": "SYMBOL",
"name": "attribute_declaration"
}
}
]
}
},
"attributed_field_declarator": {
"type": "PREC_RIGHT",
"value": 0,
"content": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_field_declarator"
},
{
"type": "REPEAT1",
"content": {
"type": "SYMBOL",
"name": "attribute_declaration"
}
}
]
}
},
"attributed_type_declarator": {
"type": "PREC_RIGHT",
"value": 0,
"content": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_type_declarator"
},
{
"type": "REPEAT1",
"content": {
"type": "SYMBOL",
"name": "attribute_declaration"
}
}
]
}
},
"pointer_declarator": {
"type": "PREC_DYNAMIC",
"value": 1,
"content": {
"type": "PREC_RIGHT",
"value": 0,
"content": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "ms_based_modifier"
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "*"
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "ms_pointer_modifier"
}
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "type_qualifier"
}
},
{
"type": "FIELD",
"name": "declarator",
"content": {
"type": "SYMBOL",
"name": "_declarator"
}
}
]
}
}
},
"pointer_field_declarator": {
"type": "PREC_DYNAMIC",
"value": 1,
"content": {
"type": "PREC_RIGHT",
"value": 0,
"content": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "ms_based_modifier"
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "*"
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "ms_pointer_modifier"
}
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "type_qualifier"
}
},
{
"type": "FIELD",
"name": "declarator",
"content": {
"type": "SYMBOL",
"name": "_field_declarator"
}
}
]
}
}
},
"pointer_type_declarator": {
"type": "PREC_DYNAMIC",
"value": 1,
"content": {
"type": "PREC_RIGHT",
"value": 0,
"content": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "ms_based_modifier"
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "*"
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "ms_pointer_modifier"
}
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "type_qualifier"
}
},
{
"type": "FIELD",
"name": "declarator",
"content": {
"type": "SYMBOL",
"name": "_type_declarator"
}
}
]
}
}
},
"abstract_pointer_declarator": {
"type": "PREC_DYNAMIC",
"value": 1,
"content": {
"type": "PREC_RIGHT",
"value": 0,
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "*"
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "type_qualifier"
}
},
{
"type": "FIELD",
"name": "declarator",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_abstract_declarator"
},
{
"type": "BLANK"
}
]
}
}
]
}
}
},
"function_declarator": {
"type": "PREC",
"value": 1,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "declarator",
"content": {
"type": "SYMBOL",
"name": "_declarator"
}
},
{
"type": "FIELD",
"name": "parameters",
"content": {
"type": "SYMBOL",
"name": "parameter_list"
}
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "attribute_specifier"
}
}
]
}
},
"function_field_declarator": {
"type": "PREC",
"value": 1,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "declarator",
"content": {
"type": "SYMBOL",
"name": "_field_declarator"
}
},
{
"type": "FIELD",
"name": "parameters",
"content": {
"type": "SYMBOL",
"name": "parameter_list"
}
}
]
}
},
"function_type_declarator": {
"type": "PREC",
"value": 1,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "declarator",
"content": {
"type": "SYMBOL",
"name": "_type_declarator"
}
},
{
"type": "FIELD",
"name": "parameters",
"content": {
"type": "SYMBOL",
"name": "parameter_list"
}
}
]
}
},
"abstract_function_declarator": {
"type": "PREC",
"value": 1,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "declarator",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_abstract_declarator"
},
{
"type": "BLANK"
}
]
}
},
{
"type": "FIELD",
"name": "parameters",
"content": {
"type": "SYMBOL",
"name": "parameter_list"
}
}
]
}
},
"array_declarator": {
"type": "PREC",
"value": 1,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "declarator",
"content": {
"type": "SYMBOL",
"name": "_declarator"
}
},
{
"type": "STRING",
"value": "["
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "type_qualifier"
}
},
{
"type": "FIELD",
"name": "size",
"content": {
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_expression"
},
{
"type": "STRING",
"value": "*"
}
]
},
{
"type": "BLANK"
}
]
}
},
{
"type": "STRING",
"value": "]"
}
]
}
},
"array_field_declarator": {
"type": "PREC",
"value": 1,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "declarator",
"content": {
"type": "SYMBOL",
"name": "_field_declarator"
}
},
{
"type": "STRING",
"value": "["
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "type_qualifier"
}
},
{
"type": "FIELD",
"name": "size",
"content": {
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_expression"
},
{
"type": "STRING",
"value": "*"
}
]
},
{
"type": "BLANK"
}
]
}
},
{
"type": "STRING",
"value": "]"
}
]
}
},
"array_type_declarator": {
"type": "PREC",
"value": 1,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "declarator",
"content": {
"type": "SYMBOL",
"name": "_type_declarator"
}
},
{
"type": "STRING",
"value": "["
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "type_qualifier"
}
},
{
"type": "FIELD",
"name": "size",
"content": {
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_expression"
},
{
"type": "STRING",
"value": "*"
}
]
},
{
"type": "BLANK"
}
]
}
},
{
"type": "STRING",
"value": "]"
}
]
}
},
"abstract_array_declarator": {
"type": "PREC",
"value": 1,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "declarator",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_abstract_declarator"
},
{
"type": "BLANK"
}
]
}
},
{
"type": "STRING",
"value": "["
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "type_qualifier"
}
},
{
"type": "FIELD",
"name": "size",
"content": {
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_expression"
},
{
"type": "STRING",
"value": "*"
}
]
},
{
"type": "BLANK"
}
]
}
},
{
"type": "STRING",
"value": "]"
}
]
}
},
"init_declarator": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "declarator",
"content": {
"type": "SYMBOL",
"name": "_declarator"
}
},
{
"type": "STRING",
"value": "="
},
{
"type": "FIELD",
"name": "value",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "initializer_list"
},
{
"type": "SYMBOL",
"name": "_expression"
}
]
}
}
]
},
"compound_statement": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "{"
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "_top_level_item"
}
},
{
"type": "STRING",
"value": "}"
}
]
},
"storage_class_specifier": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "extern"
},
{
"type": "STRING",
"value": "static"
},
{
"type": "STRING",
"value": "auto"
},
{
"type": "STRING",
"value": "register"
},
{
"type": "STRING",
"value": "inline"
}
]
},
"type_qualifier": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "const"
},
{
"type": "STRING",
"value": "volatile"
},
{
"type": "STRING",
"value": "restrict"
},
{
"type": "STRING",
"value": "_Atomic"
}
]
},
"_type_specifier": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "struct_specifier"
},
{
"type": "SYMBOL",
"name": "union_specifier"
},
{
"type": "SYMBOL",
"name": "enum_specifier"
},
{
"type": "SYMBOL",
"name": "macro_type_specifier"
},
{
"type": "SYMBOL",
"name": "sized_type_specifier"
},
{
"type": "SYMBOL",
"name": "primitive_type"
},
{
"type": "SYMBOL",
"name": "_type_identifier"
}
]
},
"sized_type_specifier": {
"type": "SEQ",
"members": [
{
"type": "REPEAT1",
"content": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "signed"
},
{
"type": "STRING",
"value": "unsigned"
},
{
"type": "STRING",
"value": "long"
},
{
"type": "STRING",
"value": "short"
}
]
}
},
{
"type": "FIELD",
"name": "type",
"content": {
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "PREC_DYNAMIC",
"value": -1,
"content": {
"type": "SYMBOL",
"name": "_type_identifier"
}
},
{
"type": "SYMBOL",
"name": "primitive_type"
}
]
},
{
"type": "BLANK"
}
]
}
}
]
},
"primitive_type": {
"type": "TOKEN",
"content": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "bool"
},
{
"type": "STRING",
"value": "char"
},
{
"type": "STRING",
"value": "int"
},
{
"type": "STRING",
"value": "float"
},
{
"type": "STRING",
"value": "double"
},
{
"type": "STRING",
"value": "void"
},
{
"type": "STRING",
"value": "size_t"
},
{
"type": "STRING",
"value": "ssize_t"
},
{
"type": "STRING",
"value": "intptr_t"
},
{
"type": "STRING",
"value": "uintptr_t"
},
{
"type": "STRING",
"value": "charptr_t"
},
{
"type": "STRING",
"value": "int8_t"
},
{
"type": "STRING",
"value": "int16_t"
},
{
"type": "STRING",
"value": "int32_t"
},
{
"type": "STRING",
"value": "int64_t"
},
{
"type": "STRING",
"value": "uint8_t"
},
{
"type": "STRING",
"value": "uint16_t"
},
{
"type": "STRING",
"value": "uint32_t"
},
{
"type": "STRING",
"value": "uint64_t"
},
{
"type": "STRING",
"value": "char8_t"
},
{
"type": "STRING",
"value": "char16_t"
},
{
"type": "STRING",
"value": "char32_t"
},
{
"type": "STRING",
"value": "char64_t"
}
]
}
},
"enum_specifier": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "enum"
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "name",
"content": {
"type": "SYMBOL",
"name": "_type_identifier"
}
},
{
"type": "FIELD",
"name": "body",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "enumerator_list"
},
{
"type": "BLANK"
}
]
}
}
]
},
{
"type": "FIELD",
"name": "body",
"content": {
"type": "SYMBOL",
"name": "enumerator_list"
}
}
]
}
]
},
"enumerator_list": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "{"
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "enumerator"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "enumerator"
}
]
}
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "}"
}
]
},
"struct_specifier": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "struct"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "ms_declspec_modifier"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "name",
"content": {
"type": "SYMBOL",
"name": "_type_identifier"
}
},
{
"type": "FIELD",
"name": "body",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "field_declaration_list"
},
{
"type": "BLANK"
}
]
}
}
]
},
{
"type": "FIELD",
"name": "body",
"content": {
"type": "SYMBOL",
"name": "field_declaration_list"
}
}
]
}
]
},
"union_specifier": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "union"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "ms_declspec_modifier"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "name",
"content": {
"type": "SYMBOL",
"name": "_type_identifier"
}
},
{
"type": "FIELD",
"name": "body",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "field_declaration_list"
},
{
"type": "BLANK"
}
]
}
}
]
},
{
"type": "FIELD",
"name": "body",
"content": {
"type": "SYMBOL",
"name": "field_declaration_list"
}
}
]
}
]
},
"field_declaration_list": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "{"
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "_field_declaration_list_item"
}
},
{
"type": "STRING",
"value": "}"
}
]
},
"_field_declaration_list_item": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "field_declaration"
},
{
"type": "SYMBOL",
"name": "preproc_def"
},
{
"type": "SYMBOL",
"name": "preproc_function_def"
},
{
"type": "SYMBOL",
"name": "preproc_call"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "preproc_if_in_field_declaration_list"
},
"named": true,
"value": "preproc_if"
},
{
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "preproc_ifdef_in_field_declaration_list"
},
"named": true,
"value": "preproc_ifdef"
}
]
},
"field_declaration": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_declaration_specifiers"
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "declarator",
"content": {
"type": "SYMBOL",
"name": "_field_declarator"
}
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "FIELD",
"name": "declarator",
"content": {
"type": "SYMBOL",
"name": "_field_declarator"
}
}
]
}
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "bitfield_clause"
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": ";"
}
]
},
"bitfield_clause": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ":"
},
{
"type": "SYMBOL",
"name": "_expression"
}
]
},
"enumerator": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "name",
"content": {
"type": "SYMBOL",
"name": "identifier"
}
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "="
},
{
"type": "FIELD",
"name": "value",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
},
{
"type": "BLANK"
}
]
}
]
},
"variadic_parameter": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "..."
}
]
},
"parameter_list": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "("
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "parameter_declaration"
},
{
"type": "SYMBOL",
"name": "variadic_parameter"
}
]
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "parameter_declaration"
},
{
"type": "SYMBOL",
"name": "variadic_parameter"
}
]
}
]
}
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": ")"
}
]
},
"parameter_declaration": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_declaration_specifiers"
},
{
"type": "CHOICE",
"members": [
{
"type": "FIELD",
"name": "declarator",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_declarator"
},
{
"type": "SYMBOL",
"name": "_abstract_declarator"
}
]
}
},
{
"type": "BLANK"
}
]
}
]
},
"attributed_statement": {
"type": "SEQ",
"members": [
{
"type": "REPEAT1",
"content": {
"type": "SYMBOL",
"name": "attribute_declaration"
}
},
{
"type": "SYMBOL",
"name": "_statement"
}
]
},
"_statement": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "case_statement"
},
{
"type": "SYMBOL",
"name": "_non_case_statement"
}
]
},
"_non_case_statement": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "attributed_statement"
},
{
"type": "SYMBOL",
"name": "labeled_statement"
},
{
"type": "SYMBOL",
"name": "compound_statement"
},
{
"type": "SYMBOL",
"name": "expression_statement"
},
{
"type": "SYMBOL",
"name": "if_statement"
},
{
"type": "SYMBOL",
"name": "switch_statement"
},
{
"type": "SYMBOL",
"name": "do_statement"
},
{
"type": "SYMBOL",
"name": "while_statement"
},
{
"type": "SYMBOL",
"name": "for_statement"
},
{
"type": "SYMBOL",
"name": "return_statement"
},
{
"type": "SYMBOL",
"name": "break_statement"
},
{
"type": "SYMBOL",
"name": "continue_statement"
},
{
"type": "SYMBOL",
"name": "goto_statement"
}
]
},
"labeled_statement": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "label",
"content": {
"type": "SYMBOL",
"name": "_statement_identifier"
}
},
{
"type": "STRING",
"value": ":"
},
{
"type": "SYMBOL",
"name": "_statement"
}
]
},
"expression_statement": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_expression"
},
{
"type": "SYMBOL",
"name": "comma_expression"
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": ";"
}
]
},
"if_statement": {
"type": "PREC_RIGHT",
"value": 0,
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "if"
},
{
"type": "FIELD",
"name": "condition",
"content": {
"type": "SYMBOL",
"name": "parenthesized_expression"
}
},
{
"type": "FIELD",
"name": "consequence",
"content": {
"type": "SYMBOL",
"name": "_statement"
}
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "else"
},
{
"type": "FIELD",
"name": "alternative",
"content": {
"type": "SYMBOL",
"name": "_statement"
}
}
]
},
{
"type": "BLANK"
}
]
}
]
}
},
"switch_statement": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "switch"
},
{
"type": "FIELD",
"name": "condition",
"content": {
"type": "SYMBOL",
"name": "parenthesized_expression"
}
},
{
"type": "FIELD",
"name": "body",
"content": {
"type": "SYMBOL",
"name": "compound_statement"
}
}
]
},
"case_statement": {
"type": "PREC_RIGHT",
"value": 0,
"content": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "case"
},
{
"type": "FIELD",
"name": "value",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
},
{
"type": "STRING",
"value": "default"
}
]
},
{
"type": "STRING",
"value": ":"
},
{
"type": "REPEAT",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_non_case_statement"
},
{
"type": "SYMBOL",
"name": "declaration"
},
{
"type": "SYMBOL",
"name": "type_definition"
}
]
}
}
]
}
},
"while_statement": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "while"
},
{
"type": "FIELD",
"name": "condition",
"content": {
"type": "SYMBOL",
"name": "parenthesized_expression"
}
},
{
"type": "FIELD",
"name": "body",
"content": {
"type": "SYMBOL",
"name": "_statement"
}
}
]
},
"do_statement": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "do"
},
{
"type": "FIELD",
"name": "body",
"content": {
"type": "SYMBOL",
"name": "_statement"
}
},
{
"type": "STRING",
"value": "while"
},
{
"type": "FIELD",
"name": "condition",
"content": {
"type": "SYMBOL",
"name": "parenthesized_expression"
}
},
{
"type": "STRING",
"value": ";"
}
]
},
"for_statement": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "for"
},
{
"type": "STRING",
"value": "("
},
{
"type": "CHOICE",
"members": [
{
"type": "FIELD",
"name": "initializer",
"content": {
"type": "SYMBOL",
"name": "declaration"
}
},
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "initializer",
"content": {
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_expression"
},
{
"type": "SYMBOL",
"name": "comma_expression"
}
]
},
{
"type": "BLANK"
}
]
}
},
{
"type": "STRING",
"value": ";"
}
]
}
]
},
{
"type": "FIELD",
"name": "condition",
"content": {
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_expression"
},
{
"type": "SYMBOL",
"name": "comma_expression"
}
]
},
{
"type": "BLANK"
}
]
}
},
{
"type": "STRING",
"value": ";"
},
{
"type": "FIELD",
"name": "update",
"content": {
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_expression"
},
{
"type": "SYMBOL",
"name": "comma_expression"
}
]
},
{
"type": "BLANK"
}
]
}
},
{
"type": "STRING",
"value": ")"
},
{
"type": "FIELD",
"name": "body",
"content": {
"type": "SYMBOL",
"name": "_statement"
}
}
]
},
"return_statement": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "return"
},
{
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_expression"
},
{
"type": "SYMBOL",
"name": "comma_expression"
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": ";"
}
]
},
"break_statement": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "break"
},
{
"type": "STRING",
"value": ";"
}
]
},
"continue_statement": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "continue"
},
{
"type": "STRING",
"value": ";"
}
]
},
"goto_statement": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "goto"
},
{
"type": "FIELD",
"name": "label",
"content": {
"type": "SYMBOL",
"name": "_statement_identifier"
}
},
{
"type": "STRING",
"value": ";"
}
]
},
"_expression": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "conditional_expression"
},
{
"type": "SYMBOL",
"name": "assignment_expression"
},
{
"type": "SYMBOL",
"name": "binary_expression"
},
{
"type": "SYMBOL",
"name": "unary_expression"
},
{
"type": "SYMBOL",
"name": "update_expression"
},
{
"type": "SYMBOL",
"name": "cast_expression"
},
{
"type": "SYMBOL",
"name": "pointer_expression"
},
{
"type": "SYMBOL",
"name": "sizeof_expression"
},
{
"type": "SYMBOL",
"name": "subscript_expression"
},
{
"type": "SYMBOL",
"name": "call_expression"
},
{
"type": "SYMBOL",
"name": "field_expression"
},
{
"type": "SYMBOL",
"name": "compound_literal_expression"
},
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "SYMBOL",
"name": "number_literal"
},
{
"type": "SYMBOL",
"name": "string_literal"
},
{
"type": "SYMBOL",
"name": "true"
},
{
"type": "SYMBOL",
"name": "false"
},
{
"type": "SYMBOL",
"name": "null"
},
{
"type": "SYMBOL",
"name": "concatenated_string"
},
{
"type": "SYMBOL",
"name": "char_literal"
},
{
"type": "SYMBOL",
"name": "parenthesized_expression"
}
]
},
"comma_expression": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "STRING",
"value": ","
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_expression"
},
{
"type": "SYMBOL",
"name": "comma_expression"
}
]
}
}
]
},
"conditional_expression": {
"type": "PREC_RIGHT",
"value": -2,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "condition",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "STRING",
"value": "?"
},
{
"type": "FIELD",
"name": "consequence",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "STRING",
"value": ":"
},
{
"type": "FIELD",
"name": "alternative",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
"_assignment_left_expression": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "SYMBOL",
"name": "call_expression"
},
{
"type": "SYMBOL",
"name": "field_expression"
},
{
"type": "SYMBOL",
"name": "pointer_expression"
},
{
"type": "SYMBOL",
"name": "subscript_expression"
},
{
"type": "SYMBOL",
"name": "parenthesized_expression"
}
]
},
"assignment_expression": {
"type": "PREC_RIGHT",
"value": -1,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_assignment_left_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "="
},
{
"type": "STRING",
"value": "*="
},
{
"type": "STRING",
"value": "/="
},
{
"type": "STRING",
"value": "%="
},
{
"type": "STRING",
"value": "+="
},
{
"type": "STRING",
"value": "-="
},
{
"type": "STRING",
"value": "<<="
},
{
"type": "STRING",
"value": ">>="
},
{
"type": "STRING",
"value": "&="
},
{
"type": "STRING",
"value": "^="
},
{
"type": "STRING",
"value": "|="
}
]
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
"pointer_expression": {
"type": "PREC_LEFT",
"value": 12,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "*"
},
{
"type": "STRING",
"value": "&"
}
]
}
},
{
"type": "FIELD",
"name": "argument",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
"unary_expression": {
"type": "PREC_LEFT",
"value": 13,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "!"
},
{
"type": "STRING",
"value": "~"
},
{
"type": "STRING",
"value": "-"
},
{
"type": "STRING",
"value": "+"
}
]
}
},
{
"type": "FIELD",
"name": "argument",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
"binary_expression": {
"type": "CHOICE",
"members": [
{
"type": "PREC_LEFT",
"value": 10,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "+"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 10,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "-"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 11,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "*"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 11,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "/"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 11,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "%"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 1,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "||"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 2,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "&&"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 3,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "|"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 4,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "^"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 5,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "&"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 6,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "=="
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 6,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "!="
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 7,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": ">"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 7,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": ">="
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 7,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "<="
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 7,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "<"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 9,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": "<<"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
{
"type": "PREC_LEFT",
"value": 9,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "left",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "STRING",
"value": ">>"
}
},
{
"type": "FIELD",
"name": "right",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
}
]
},
"update_expression": {
"type": "PREC_RIGHT",
"value": 13,
"content": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "--"
},
{
"type": "STRING",
"value": "++"
}
]
}
},
{
"type": "FIELD",
"name": "argument",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "argument",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "--"
},
{
"type": "STRING",
"value": "++"
}
]
}
}
]
}
]
}
},
"cast_expression": {
"type": "PREC",
"value": 12,
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "("
},
{
"type": "FIELD",
"name": "type",
"content": {
"type": "SYMBOL",
"name": "type_descriptor"
}
},
{
"type": "STRING",
"value": ")"
},
{
"type": "FIELD",
"name": "value",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
}
]
}
},
"type_descriptor": {
"type": "SEQ",
"members": [
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "type_qualifier"
}
},
{
"type": "FIELD",
"name": "type",
"content": {
"type": "SYMBOL",
"name": "_type_specifier"
}
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "type_qualifier"
}
},
{
"type": "FIELD",
"name": "declarator",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_abstract_declarator"
},
{
"type": "BLANK"
}
]
}
}
]
},
"sizeof_expression": {
"type": "PREC",
"value": 8,
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "sizeof"
},
{
"type": "CHOICE",
"members": [
{
"type": "FIELD",
"name": "value",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "("
},
{
"type": "FIELD",
"name": "type",
"content": {
"type": "SYMBOL",
"name": "type_descriptor"
}
},
{
"type": "STRING",
"value": ")"
}
]
}
]
}
]
}
},
"subscript_expression": {
"type": "PREC",
"value": 16,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "argument",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "STRING",
"value": "["
},
{
"type": "FIELD",
"name": "index",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "STRING",
"value": "]"
}
]
}
},
"call_expression": {
"type": "PREC",
"value": 14,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "function",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "arguments",
"content": {
"type": "SYMBOL",
"name": "argument_list"
}
}
]
}
},
"argument_list": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "("
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_expression"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "_expression"
}
]
}
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": ")"
}
]
},
"field_expression": {
"type": "SEQ",
"members": [
{
"type": "PREC",
"value": 15,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "argument",
"content": {
"type": "SYMBOL",
"name": "_expression"
}
},
{
"type": "FIELD",
"name": "operator",
"content": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "."
},
{
"type": "STRING",
"value": "->"
}
]
}
}
]
}
},
{
"type": "FIELD",
"name": "field",
"content": {
"type": "SYMBOL",
"name": "_field_identifier"
}
}
]
},
"compound_literal_expression": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "("
},
{
"type": "FIELD",
"name": "type",
"content": {
"type": "SYMBOL",
"name": "type_descriptor"
}
},
{
"type": "STRING",
"value": ")"
},
{
"type": "FIELD",
"name": "value",
"content": {
"type": "SYMBOL",
"name": "initializer_list"
}
}
]
},
"parenthesized_expression": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "("
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_expression"
},
{
"type": "SYMBOL",
"name": "comma_expression"
}
]
},
{
"type": "STRING",
"value": ")"
}
]
},
"initializer_list": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "{"
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "initializer_pair"
},
{
"type": "SYMBOL",
"name": "_expression"
},
{
"type": "SYMBOL",
"name": "initializer_list"
}
]
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "initializer_pair"
},
{
"type": "SYMBOL",
"name": "_expression"
},
{
"type": "SYMBOL",
"name": "initializer_list"
}
]
}
]
}
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "}"
}
]
},
"initializer_pair": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "designator",
"content": {
"type": "REPEAT1",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "subscript_designator"
},
{
"type": "SYMBOL",
"name": "field_designator"
}
]
}
}
},
{
"type": "STRING",
"value": "="
},
{
"type": "FIELD",
"name": "value",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_expression"
},
{
"type": "SYMBOL",
"name": "initializer_list"
}
]
}
}
]
},
"subscript_designator": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "["
},
{
"type": "SYMBOL",
"name": "_expression"
},
{
"type": "STRING",
"value": "]"
}
]
},
"field_designator": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "."
},
{
"type": "SYMBOL",
"name": "_field_identifier"
}
]
},
"number_literal": {
"type": "TOKEN",
"content": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "PATTERN",
"value": "[-\\+]"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "0x"
},
{
"type": "STRING",
"value": "0b"
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "REPEAT1",
"content": {
"type": "PATTERN",
"value": "[0-9]"
}
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "'"
},
{
"type": "REPEAT1",
"content": {
"type": "PATTERN",
"value": "[0-9]"
}
}
]
}
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "0b"
},
{
"type": "SEQ",
"members": [
{
"type": "REPEAT1",
"content": {
"type": "PATTERN",
"value": "[0-9]"
}
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "'"
},
{
"type": "REPEAT1",
"content": {
"type": "PATTERN",
"value": "[0-9]"
}
}
]
}
}
]
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "0x"
},
{
"type": "SEQ",
"members": [
{
"type": "REPEAT1",
"content": {
"type": "PATTERN",
"value": "[0-9a-fA-F]"
}
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "'"
},
{
"type": "REPEAT1",
"content": {
"type": "PATTERN",
"value": "[0-9a-fA-F]"
}
}
]
}
}
]
}
]
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "."
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "REPEAT1",
"content": {
"type": "PATTERN",
"value": "[0-9a-fA-F]"
}
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "'"
},
{
"type": "REPEAT1",
"content": {
"type": "PATTERN",
"value": "[0-9a-fA-F]"
}
}
]
}
}
]
},
{
"type": "BLANK"
}
]
}
]
},
{
"type": "BLANK"
}
]
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "."
},
{
"type": "SEQ",
"members": [
{
"type": "REPEAT1",
"content": {
"type": "PATTERN",
"value": "[0-9]"
}
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "'"
},
{
"type": "REPEAT1",
"content": {
"type": "PATTERN",
"value": "[0-9]"
}
}
]
}
}
]
}
]
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "PATTERN",
"value": "[eEpP]"
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "PATTERN",
"value": "[-\\+]"
},
{
"type": "BLANK"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "REPEAT1",
"content": {
"type": "PATTERN",
"value": "[0-9a-fA-F]"
}
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "'"
},
{
"type": "REPEAT1",
"content": {
"type": "PATTERN",
"value": "[0-9a-fA-F]"
}
}
]
}
}
]
}
]
},
{
"type": "BLANK"
}
]
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "REPEAT",
"content": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "u"
},
{
"type": "STRING",
"value": "l"
},
{
"type": "STRING",
"value": "U"
},
{
"type": "STRING",
"value": "L"
},
{
"type": "STRING",
"value": "f"
},
{
"type": "STRING",
"value": "F"
}
]
}
}
]
}
},
"char_literal": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "L'"
},
{
"type": "STRING",
"value": "u'"
},
{
"type": "STRING",
"value": "U'"
},
{
"type": "STRING",
"value": "u8'"
},
{
"type": "STRING",
"value": "'"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "escape_sequence"
},
{
"type": "IMMEDIATE_TOKEN",
"content": {
"type": "PATTERN",
"value": "[^\\n']"
}
}
]
},
{
"type": "STRING",
"value": "'"
}
]
},
"concatenated_string": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "string_literal"
},
{
"type": "REPEAT1",
"content": {
"type": "SYMBOL",
"name": "string_literal"
}
}
]
},
"string_literal": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "L\""
},
{
"type": "STRING",
"value": "u\""
},
{
"type": "STRING",
"value": "U\""
},
{
"type": "STRING",
"value": "u8\""
},
{
"type": "STRING",
"value": "\""
}
]
},
{
"type": "REPEAT",
"content": {
"type": "CHOICE",
"members": [
{
"type": "IMMEDIATE_TOKEN",
"content": {
"type": "PREC",
"value": 1,
"content": {
"type": "PATTERN",
"value": "[^\\\\\"\\n]+"
}
}
},
{
"type": "SYMBOL",
"name": "escape_sequence"
}
]
}
},
{
"type": "STRING",
"value": "\""
}
]
},
"escape_sequence": {
"type": "TOKEN",
"content": {
"type": "PREC",
"value": 1,
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "\\"
},
{
"type": "CHOICE",
"members": [
{
"type": "PATTERN",
"value": "[^xuU]"
},
{
"type": "PATTERN",
"value": "\\d{2,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}"
}
]
}
]
}
}
},
"system_lib_string": {
"type": "TOKEN",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "<"
},
{
"type": "REPEAT",
"content": {
"type": "CHOICE",
"members": [
{
"type": "PATTERN",
"value": "[^>\\n]"
},
{
"type": "STRING",
"value": "\\>"
}
]
}
},
{
"type": "STRING",
"value": ">"
}
]
}
},
"true": {
"type": "TOKEN",
"content": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "TRUE"
},
{
"type": "STRING",
"value": "true"
}
]
}
},
"false": {
"type": "TOKEN",
"content": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "FALSE"
},
{
"type": "STRING",
"value": "false"
}
]
}
},
"null": {
"type": "STRING",
"value": "NULL"
},
"identifier": {
"type": "PATTERN",
"value": "[a-zA-Z_]\\w*"
},
"_type_identifier": {
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "identifier"
},
"named": true,
"value": "type_identifier"
},
"_field_identifier": {
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "identifier"
},
"named": true,
"value": "field_identifier"
},
"_statement_identifier": {
"type": "ALIAS",
"content": {
"type": "SYMBOL",
"name": "identifier"
},
"named": true,
"value": "statement_identifier"
},
"_empty_declaration": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_type_specifier"
},
{
"type": "STRING",
"value": ";"
}
]
},
"macro_type_specifier": {
"type": "PREC_DYNAMIC",
"value": -1,
"content": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "name",
"content": {
"type": "SYMBOL",
"name": "identifier"
}
},
{
"type": "STRING",
"value": "("
},
{
"type": "FIELD",
"name": "type",
"content": {
"type": "SYMBOL",
"name": "type_descriptor"
}
},
{
"type": "STRING",
"value": ")"
}
]
}
},
"comment": {
"type": "TOKEN",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "//"
},
{
"type": "PATTERN",
"value": "(\\\\(.|\\r?\\n)|[^\\\\\\n])*"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "/*"
},
{
"type": "PATTERN",
"value": "[^*]*\\*+([^/*][^*]*\\*+)*"
},
{
"type": "STRING",
"value": "/"
}
]
}
]
}
}
},
"extras": [
{
"type": "PATTERN",
"value": "\\s|\\\\\\r?\\n"
},
{
"type": "SYMBOL",
"name": "comment"
}
],
"conflicts": [
[
"_type_specifier",
"_declarator"
],
[
"_type_specifier",
"_declarator",
"macro_type_specifier"
],
[
"_type_specifier",
"_expression"
],
[
"_type_specifier",
"_expression",
"macro_type_specifier"
],
[
"_type_specifier",
"macro_type_specifier"
],
[
"sized_type_specifier"
],
[
"attributed_statement"
],
[
"_declaration_modifiers",
"attributed_statement"
]
],
"precedences": [],
"externals": [],
"inline": [
"_statement",
"_top_level_item",
"_type_identifier",
"_field_identifier",
"_statement_identifier",
"_non_case_statement",
"_assignment_left_expression"
],
"supertypes": [
"_expression",
"_statement",
"_type_specifier",
"_declarator",
"_field_declarator",
"_type_declarator",
"_abstract_declarator"
],
"PREC": {
"PAREN_DECLARATOR": -10,
"ASSIGNMENT": -1,
"CONDITIONAL": -2,
"DEFAULT": 0,
"LOGICAL_OR": 1,
"LOGICAL_AND": 2,
"INCLUSIVE_OR": 3,
"EXCLUSIVE_OR": 4,
"BITWISE_AND": 5,
"EQUAL": 6,
"RELATIONAL": 7,
"SIZEOF": 8,
"SHIFT": 9,
"ADD": 10,
"MULTIPLY": 11,
"CAST": 12,
"UNARY": 13,
"CALL": 14,
"FIELD": 15,
"SUBSCRIPT": 16
}
}