android_mt6572_jiabo/external/antlr/antlr-3.4/runtime/Python/tests/t030specialStates.g
2025-09-05 16:56:03 +08:00

26 lines
379 B
Text

grammar t030specialStates;
options {
language = Python;
}
@init {
self.cond = True
}
@members {
def recover(self, input, re):
# no error recovery yet, just crash!
raise re
}
r
: ( {self.cond}? NAME
| {not self.cond}? NAME WS+ NAME
)
( WS+ NAME )?
EOF
;
NAME: ('a'..'z') ('a'..'z' | '0'..'9')+;
NUMBER: ('0'..'9')+;
WS: ' '+;