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

org.antlr.v4.test.runtime.templates.BaseContext.LeftRecursiveWithAltLabelAliasingAndElementLabels.stg Maven / Gradle / Ivy

The newest version!
TestType() ::= "Parser"

Options ::= [
	"Debug": false
]

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

Input() ::= "3 a"

Rule() ::= "input"

Output() ::= ""

Errors() ::= ""

grammar(grammarName) ::= <<
grammar ;

input
	:	e=expression e=expressionNoNumber EOF
	;

expression
	:	i=ID # alt1
	|	i=NUMBER # alt1
	|	left=expression op='+' right=expression # alt2
	;

expressionNoNumber
options { baseContext = expression; }
	:	i=ID # alt1
	|	left=expressionNoNumber op='+' right=expressionNoNumber # alt2
	;

ID : 'a'..'z'+;
NUMBER : [0-9]+;
WS : (' '|'\n') -> skip;
>>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy