
org.antlr.v4.test.runtime.templates.ParserExec.LabelAliasingAcrossLabeledAlternatives.stg Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of runtime-testsuite Show documentation
Show all versions of runtime-testsuite Show documentation
A collection of tests for ANTLR 4 Runtime libraries.
/**
* 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
*/
TestType() ::= "Parser"
Options ::= [
"Debug": false
]
Grammar ::= [
"T": {}
]
Input() ::= "xy"
Rule() ::= "start"
Output() ::= <<
x
y<\n>
>>
Errors() ::= ""
grammar(grammarName) ::= <<
grammar ;
start : a* EOF;
a
: label=subrule {} #One
| label='y' {} #Two
;
subrule : 'x';
WS : (' '|'\n') -> skip ;
>>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy