73 lines
1.4 KiB
JSON
73 lines
1.4 KiB
JSON
{
|
|
"name": "dynamic_precedence",
|
|
|
|
"conflicts": [
|
|
["expression", "type"]
|
|
],
|
|
|
|
"extras": [
|
|
{"type": "PATTERN", "value": "\\s"}
|
|
],
|
|
|
|
"rules": {
|
|
"program": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{"type": "SYMBOL", "name": "declaration"},
|
|
{"type": "SYMBOL", "name": "expression"}
|
|
]
|
|
},
|
|
|
|
"expression": {
|
|
"type": "PREC_LEFT",
|
|
"value": 0,
|
|
"content": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{"type": "SYMBOL", "name": "expression"},
|
|
{"type": "STRING", "value": "*"},
|
|
{"type": "SYMBOL", "name": "expression"}
|
|
]
|
|
},
|
|
{
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
|
|
"declaration": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{"type": "SYMBOL", "name": "type"},
|
|
{"type": "SYMBOL", "name": "declarator"}
|
|
]
|
|
},
|
|
|
|
"declarator": {
|
|
"type": "PREC_DYNAMIC",
|
|
"value": 1,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{"type": "STRING", "value": "*"},
|
|
{"type": "SYMBOL", "name": "identifier"}
|
|
]
|
|
}
|
|
},
|
|
|
|
"type": {
|
|
"type": "SYMBOL",
|
|
"name": "identifier"
|
|
},
|
|
|
|
"identifier": {
|
|
"type": "PATTERN",
|
|
"value": "[a-zA-Z]+"
|
|
}
|
|
}
|
|
}
|