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

org.antlr.v4.test.runtime.templates.ParserExec.PredicatedIfIfElse.stg Maven / Gradle / Ivy

There is a newer version: 4.9.0
Show newest version
/**
 * This test is meant to test the expected solution to antlr/antlr4#42.
 * https://github.com/antlr/antlr4/issues/42
 */

TestType() ::= "Parser"

Options ::= [
	"Debug": true
]

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

Input() ::= "if x if x a else b"

Rule() ::= "s"

Output() ::= ""

Errors() ::= ""

grammar(grammarName) ::= <<
grammar ;
s : stmt EOF ;
stmt : ifStmt | ID;
ifStmt : 'if' ID stmt ('else' stmt | { Parser.ELSE})> }?);
ELSE : 'else';
ID : [a-zA-Z]+;
WS : [ \\n\\t]+ -> skip;
>>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy