All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.antlr.v4.test.runtime.templates.SemPredEvalParser.PredicateDependentOnArg2.stg Maven / Gradle / Ivy

There is a newer version: 4.9.0
Show newest version
/**
 * 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