@mike-lischke/antlr-tgen
Version:
A generator for antlr-ng runtime test cases
29 lines (22 loc) • 416 B
Plain Text
[notes]
This is a regression test for antlr/antlr4#195 "label 'label' type
mismatch with previous definition: TOKEN_LABEL!=RULE_LABEL"
https://github.com/antlr/antlr4/issues/195
[type]
Parser
[grammar]
grammar T;
start : a* EOF;
a
: label=subrule {<writeln("$label.text")>} #One
| label='y' {<writeln("$label.text")>} #Two
;
subrule : 'x';
WS : (' '|'\n') -> skip ;
[start]
start
[input]
xy
[output]
x
y