Hi,
I have defined a simple if/else if/else rule (below):
ifExpr : 'if' LRND ifCond=rightExpr RRND ifBlock=block
('else if' LRND elifCond+=rightExpr RRND elifBlock+=block)*
('else' elseBlock=block)?
this throws the following error:
mismatched character '{' expecting 'i'
extraneous input '}' expecting 'return '
I can solve it by changing 'else if' to 'elif' - as clearly 'else if' and
'else' are confusing the lexer/parser.
However, I was hoping to have the easer-to-read 'else if'.
Can someone suggest how I can accomplish that?
I tried the syntactic predicate ('else if')=> - but that did not work.
Thank you!
--
View this message in context:
http://antlr.1301665.n2.nabble.com/if-else-if-else-vs-if-elif-else-tp5491890p5491890.html
Sent from the ANTLR mailing list archive at Nabble.com.
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en.