{
|
|
"name": "c",
|
|
"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": "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"
|
|
}
|
|
]
|
|
},
|
|
"_compound_statement_item": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "declaration"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "type_definition"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_empty_declaration"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "preproc_if_in_compound_statement"
|
|
},
|
|
"named": true,
|
|
"value": "preproc_if"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "preproc_ifdef_in_compound_statement"
|
|
},
|
|
"named": true,
|
|
"value": "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": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string_literal"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "system_lib_string"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"preproc_def": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "#[ \t]*define"
|
|
},
|
|
"named": false,
|
|
"value": "#define"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "[ \\t]+"
|
|
},
|
|
{
|
|
"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": "SYMBOL",
|
|
"name": "identifier"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "preproc_params"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "preproc_arg"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "\n"
|
|
}
|
|
]
|
|
},
|
|
"preproc_params": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"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": "SYMBOL",
|
|
"name": "preproc_directive"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "[ \\t]+"
|
|
},
|
|
{
|
|
"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": "SYMBOL",
|
|
"name": "preproc_arg"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_top_level_item"
|
|
}
|
|
},
|
|
{
|
|
"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_if_in_compound_statement": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "#[ \t]*if"
|
|
},
|
|
"named": false,
|
|
"value": "#if"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "preproc_arg"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_compound_statement_item"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "preproc_else_in_compound_statement"
|
|
},
|
|
"named": true,
|
|
"value": "preproc_else"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "preproc_elif_in_compound_statement"
|
|
},
|
|
"named": true,
|
|
"value": "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": "SYMBOL",
|
|
"name": "identifier"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_top_level_item"
|
|
}
|
|
},
|
|
{
|
|
"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_in_compound_statement": {
|
|
"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": "SYMBOL",
|
|
"name": "identifier"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_compound_statement_item"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "preproc_else_in_compound_statement"
|
|
},
|
|
"named": true,
|
|
"value": "preproc_else"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "preproc_elif_in_compound_statement"
|
|
},
|
|
"named": true,
|
|
"value": "preproc_elif"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "#[ \t]*endif"
|
|
},
|
|
"named": false,
|
|
"value": "#endif"
|
|
}
|
|
]
|
|
},
|
|
"preproc_elif": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "#[ \t]*elif"
|
|
},
|
|
"named": false,
|
|
"value": "#elif"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "preproc_arg"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_top_level_item"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "preproc_elif"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "preproc_else"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"preproc_elif_in_compound_statement": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "#[ \t]*elif"
|
|
},
|
|
"named": false,
|
|
"value": "#elif"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "preproc_arg"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_compound_statement_item"
|
|
}
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "preproc_elif_in_compound_statement"
|
|
},
|
|
"named": true,
|
|
"value": "preproc_elif"
|
|
},
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "preproc_else_in_compound_statement"
|
|
},
|
|
"named": true,
|
|
"value": "preproc_else"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"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_else_in_compound_statement": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "ALIAS",
|
|
"content": {
|
|
"type": "PATTERN",
|
|
"value": "#[ \t]*else"
|
|
},
|
|
"named": false,
|
|
"value": "#else"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "_compound_statement_item"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"preproc_directive": {
|
|
"type": "PATTERN",
|
|
"value": "#[ \\t]*[a-zA-Z]\\w*"
|
|
},
|
|
"preproc_arg": {
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "PREC",
|
|
"value": -1,
|
|
"content": {
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "."
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "\\\n"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"function_definition": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_declaration_specifiers"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_declarator"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "compound_statement"
|
|
}
|
|
]
|
|
},
|
|
"declaration": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_declaration_specifiers"
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_declarator"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "init_declarator"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
},
|
|
{
|
|
"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": "SYMBOL",
|
|
"name": "_type_specifier"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_type_declarator"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ";"
|
|
}
|
|
]
|
|
},
|
|
"_declaration_specifiers": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "storage_class_specifier"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "type_qualifier"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_type_specifier"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "storage_class_specifier"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "type_qualifier"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"linkage_specification": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "extern"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string_literal"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "function_definition"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "declaration"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "declaration_list"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"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": "pointer_declarator"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "function_declarator"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "array_declarator"
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_declarator"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
}
|
|
]
|
|
},
|
|
"_field_declarator": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"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": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_field_declarator"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_field_identifier"
|
|
}
|
|
]
|
|
},
|
|
"_type_declarator": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"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": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_type_declarator"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"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": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_abstract_declarator"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"pointer_declarator": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 0,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "*"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_declarator"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"pointer_field_declarator": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 0,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "*"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_field_declarator"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"pointer_type_declarator": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 0,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "*"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_type_declarator"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"abstract_pointer_declarator": {
|
|
"type": "PREC_RIGHT",
|
|
"value": 0,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "*"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_abstract_declarator"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"function_declarator": {
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_declarator"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "parameter_list"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"function_field_declarator": {
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_field_declarator"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "parameter_list"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"function_type_declarator": {
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_type_declarator"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "parameter_list"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"abstract_function_declarator": {
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_abstract_declarator"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "parameter_list"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"array_declarator": {
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_declarator"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "["
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_declaration_specifiers"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "]"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"array_field_declarator": {
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_field_declarator"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "["
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_declaration_specifiers"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "]"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"array_type_declarator": {
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_type_declarator"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "["
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_declaration_specifiers"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "]"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"abstract_array_declarator": {
|
|
"type": "PREC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_abstract_declarator"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "["
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_declaration_specifiers"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "]"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"init_declarator": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_declarator"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "="
|
|
},
|
|
{
|
|
"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": "_compound_statement_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": "restrict"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "volatile"
|
|
}
|
|
]
|
|
},
|
|
"_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": "unsigned"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "long"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "short"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"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": "SYMBOL",
|
|
"name": "_type_identifier"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "enumerator_list"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"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": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_type_identifier"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "field_declaration_list"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "field_declaration_list"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"union_specifier": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "union"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_type_identifier"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "field_declaration_list"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "field_declaration_list"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"field_declaration_list": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "{"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "field_declaration"
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "}"
|
|
}
|
|
]
|
|
},
|
|
"field_declaration": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_declaration_specifiers"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_field_declarator"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_field_declarator"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ":"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ";"
|
|
}
|
|
]
|
|
},
|
|
"enumerator": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "="
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"parameter_list": {
|
|
"type": "PREC_DYNAMIC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "parameter_declaration"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "..."
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "parameter_declaration"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "..."
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"parameter_declaration": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_declaration_specifiers"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_declarator"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_abstract_declarator"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"_statement": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"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": "case_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": "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": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_statement"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "else"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_statement"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"switch_statement": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "switch"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_statement"
|
|
}
|
|
]
|
|
},
|
|
"case_statement": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "case"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "default"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ":"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_statement"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "declaration"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "type_definition"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"while_statement": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "while"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_statement"
|
|
}
|
|
]
|
|
},
|
|
"do_statement": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "do"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_statement"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "while"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
}
|
|
]
|
|
},
|
|
"for_statement": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "for"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "declaration"
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ";"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"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": ")"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_statement"
|
|
}
|
|
]
|
|
},
|
|
"return_statement": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "return"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_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": "SYMBOL",
|
|
"name": "_statement_identifier"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ";"
|
|
}
|
|
]
|
|
},
|
|
"_expression": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "conditional_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "assignment_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "logical_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "bitwise_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "equality_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "relational_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "shift_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "math_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": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ","
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "comma_expression"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"conditional_expression": {
|
|
"type": "PREC_RIGHT",
|
|
"value": -2,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "?"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ":"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"assignment_expression": {
|
|
"type": "PREC_RIGHT",
|
|
"value": -1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"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": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"pointer_expression": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 13,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "*"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 13,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "&"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"logical_expression": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "||"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 2,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "&&"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 13,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "!"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"bitwise_expression": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 3,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "|"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 4,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "^"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 5,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "&"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 13,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "~"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"equality_expression": {
|
|
"type": "PREC_LEFT",
|
|
"value": 6,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "=="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "!="
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"relational_expression": {
|
|
"type": "PREC_LEFT",
|
|
"value": 7,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "<"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ">"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "<="
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ">="
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"shift_expression": {
|
|
"type": "PREC_LEFT",
|
|
"value": 9,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "<<"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ">>"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"math_expression": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 10,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "+"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 10,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "-"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 11,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "*"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 11,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "/"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_LEFT",
|
|
"value": 11,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "%"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_RIGHT",
|
|
"value": 13,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "-"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_RIGHT",
|
|
"value": 13,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "+"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_RIGHT",
|
|
"value": 13,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "--"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "++"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "PREC_RIGHT",
|
|
"value": 13,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "++"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "--"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"cast_expression": {
|
|
"type": "PREC",
|
|
"value": 12,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "type_descriptor"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"type_descriptor": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "type_qualifier"
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_type_specifier"
|
|
},
|
|
{
|
|
"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": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "type_descriptor"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"subscript_expression": {
|
|
"type": "PREC",
|
|
"value": 16,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "["
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "]"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"call_expression": {
|
|
"type": "PREC",
|
|
"value": 14,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "argument_list"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"argument_list": {
|
|
"type": "PREC_DYNAMIC",
|
|
"value": 1,
|
|
"content": {
|
|
"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": "SYMBOL",
|
|
"name": "_expression"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "."
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "->"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "_field_identifier"
|
|
}
|
|
]
|
|
},
|
|
"compound_literal_expression": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "type_descriptor"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
},
|
|
{
|
|
"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": "REPEAT1",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "subscript_designator"
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "field_designator"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "="
|
|
},
|
|
{
|
|
"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": "\\d+(\\.\\d+)?"
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "\\d+u"
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "0x"
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "[0-9a-fA-f]+"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "0b"
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "[01]+"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "u"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "l"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "U"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "L"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"char_literal": {
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "'"
|
|
},
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "\\"
|
|
},
|
|
{
|
|
"type": "BLANK"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "[^']"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "\\"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "'"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "'"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"concatenated_string": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "string_literal"
|
|
},
|
|
{
|
|
"type": "REPEAT1",
|
|
"content": {
|
|
"type": "SYMBOL",
|
|
"name": "string_literal"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"string_literal": {
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "\""
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "[^\\\\\"\\n]"
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "\\\\."
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "\""
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"system_lib_string": {
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "<"
|
|
},
|
|
{
|
|
"type": "REPEAT",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "[^>]"
|
|
},
|
|
{
|
|
"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": "_declaration_specifiers"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ";"
|
|
}
|
|
]
|
|
},
|
|
"macro_type_specifier": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "("
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "type_descriptor"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": ")"
|
|
}
|
|
]
|
|
},
|
|
"comment": {
|
|
"type": "TOKEN",
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "//"
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": ".*"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{
|
|
"type": "STRING",
|
|
"value": "/*"
|
|
},
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "[^*]*\\*+([^\\/*][^*]*\\*+)*"
|
|
},
|
|
{
|
|
"type": "STRING",
|
|
"value": "/"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"extras": [
|
|
{
|
|
"type": "PATTERN",
|
|
"value": "\\s"
|
|
},
|
|
{
|
|
"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"
|
|
]
|
|
],
|
|
"externals": [],
|
|
"inline": [
|
|
"_statement",
|
|
"_top_level_item",
|
|
"_compound_statement_item",
|
|
"_type_identifier",
|
|
"_field_identifier",
|
|
"_statement_identifier"
|
|
],
|
|
"PREC": {
|
|
"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
|
|
}
|
|
}
|