57 lines
1.2 KiB
JSON
57 lines
1.2 KiB
JSON
{
|
|
"name": "external_tokens",
|
|
|
|
"externals": [
|
|
{"type": "SYMBOL", "name": "_percent_string"},
|
|
{"type": "SYMBOL", "name": "_percent_string_start"},
|
|
{"type": "SYMBOL", "name": "_percent_string_end"}
|
|
],
|
|
|
|
"extras": [
|
|
{"type": "PATTERN", "value": "\\s"}
|
|
],
|
|
|
|
"rules": {
|
|
"expression": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{"type": "SYMBOL", "name": "string"},
|
|
{"type": "SYMBOL", "name": "sum"},
|
|
{"type": "SYMBOL", "name": "identifier"}
|
|
]
|
|
},
|
|
|
|
"sum": {
|
|
"type": "PREC_LEFT",
|
|
"value": 0,
|
|
"content": {
|
|
"type": "SEQ",
|
|
"members": [
|
|
{"type": "SYMBOL", "name": "expression"},
|
|
{"type": "STRING", "value": "+"},
|
|
{"type": "SYMBOL", "name": "expression"}
|
|
]
|
|
}
|
|
},
|
|
|
|
"string": {
|
|
"type": "CHOICE",
|
|
"members": [
|
|
{"type": "SYMBOL", "name": "_percent_string"},
|
|
{
|
|
"type": "SEQ",
|
|
"members": [
|
|
{"type": "SYMBOL", "name": "_percent_string_start"},
|
|
{"type": "SYMBOL", "name": "expression"},
|
|
{"type": "SYMBOL", "name": "_percent_string_end"}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
|
|
"identifier": {
|
|
"type": "PATTERN",
|
|
"value": "[a-z]+"
|
|
}
|
|
}
|
|
}
|