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

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

There is a newer version: 4.9.0
Show newest version
/**
 * In this case, we're passing a parameter into a rule that uses that
 * information to predict the alternatives. This is the special case
 * where we know exactly which context we are in. The context stack
 * is empty and we have not dipped into the outer context to make a decision.
 */

TestType() ::= "Parser"

Options ::= [
	"Debug": false
]

Grammar ::= [
	"T": {}
]

Input() ::= "a b"

Rule() ::= "s"

Output() ::= <<
alt 2
alt 1<\n>
>>

Errors() ::= ""

grammar(grammarName) ::= <<
grammar ;
@members {}
s : a[2] a[1];
a[int i]
  : {}? ID {}
  | {}? ID {}
  ;
ID : 'a'..'z'+ ;
INT : '0'..'9'+;
WS : (' '|'\n') -> skip ;
>>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy