org.antlr.v4.test.runtime.templates.SemPredEvalParser.PredicateDependentOnArg2.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.
/**
* In this case, we have to ensure that the predicates are not tested
* during the closure after recognizing the 1st ID. The closure will
* fall off the end of 'a' 1st time and reach into the a[1] rule
* invocation. It should not execute predicates because it does not know
* what the parameter is. The context stack will not be empty and so
* they should be ignored. It will not affect recognition, however. We
* are really making sure the ATN simulation doesn't crash with context
* object issues when it encounters preds during FOLLOW.
*/
TestType() ::= "Parser"
Options ::= [
"Debug": false
]
Grammar ::= [
"T": {}
]
Input() ::= "a b"
Rule() ::= "s"
Output() ::= <<
>>
Errors() ::= ""
grammar(grammarName) ::= <<
grammar ;
@parser::members {}
s : a[2] a[1];
a[ i]
: {}? ID
| {}? ID
;
ID : 'a'..'z'+ ;
INT : '0'..'9'+;
WS : (' '|'\n') -> skip ;
>>
© 2015 - 2024 Weber Informatics LLC | Privacy Policy