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

org.antlr.v4.test.runtime.templates.LeftRecursion.PrefixOpWithActionAndLabel.stg Maven / Gradle / Ivy

There is a newer version: 4.9.0
Show newest version
TestType() ::= "Parser"

Options ::= [
	"Debug": false
]

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

Rule() ::= "s"

grammar(grammarName) ::= <<
grammar ;
s : e {} ;
e returns [String result]
    :   ID '=' e1=e    {$result = "(" + $ID.text + "=" + $e1.result + ")";}
    |   ID             {$result = $ID.text;}
    |   e1=e '+' e2=e  {$result = "(" + $e1.result + "+" + $e2.result + ")";}
    ;
ID : 'a'..'z'+ ;
INT : '0'..'9'+ ;
WS : (' '|'\n') -> skip ;
>>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy