org.antlr.v4.test.runtime.templates.SemPredEvalParser.2UnpredicatedAltsAndOneOrthogonalAlt.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.
TestType() ::= "Parser"
Options ::= [
"Debug": true
]
Grammar ::= [
"T": {}
]
Input() ::= "34; x; y"
Rule() ::= "s"
Output() ::= <<
alt 1
alt 2
alt 2<\n>
>>
Errors() ::= <<
line 1:4 reportAttemptingFullContext d=0 (a), input='x'
line 1:4 reportAmbiguity d=0 (a): ambigAlts={2, 3}, input='x'
line 1:7 reportAttemptingFullContext d=0 (a), input='y'
line 1:7 reportAmbiguity d=0 (a): ambigAlts={2, 3}, input='y'<\n>
>>
grammar(grammarName) ::= <<
grammar ;
s : {} a ';' a ';' a;
a : INT {}
| ID {} // must pick this one for ID since pred is false
| ID {}
| {}? ID {}
;
ID : 'a'..'z'+ ;
INT : '0'..'9'+;
WS : (' '|'\n') -> skip ;
>>
© 2015 - 2024 Weber Informatics LLC | Privacy Policy