org.antlr.v4.test.runtime.templates.FullContextParsing.AmbiguityNoLoop.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() ::= "a@"
Rule() ::= "prog"
Output() ::= <<
alt 1<\n>
>>
Errors() ::= <<
line 1:1 reportAttemptingFullContext d=0 (prog), input='a@'
line 1:2 reportAmbiguity d=0 (prog): ambigAlts={1, 2}, input='a@'
line 1:1 reportAttemptingFullContext d=1 (expr), input='a@'
line 1:2 reportContextSensitivity d=1 (expr), input='a@'<\n>
>>
grammar(grammarName) ::= <<
grammar ;
prog
@init {}
: expr expr {}
| expr
;
expr: '@'
| ID '@'
| ID
;
ID : [a-z]+ ;
WS : [ \r\n\t]+ -> skip ;
>>
© 2015 - 2024 Weber Informatics LLC | Privacy Policy