[antlr-interest] Semantic predicates that aren't & hoisting

John D. Mitchell johnm-antlr at non.net
Thu Mar 10 08:56:15 PST 2005


>>>>> "David" == David Jung <jungdl at ornl.gov> writes:
[...]

> expressionList : '{' expr ( ';' expr )* '}' ;

> The important rule for this discussion being expressionList.  So, a valid
> expr can be "5" or "{5; 7; 8}" or "{ { 2; 3; }; <-- notice this ';' 5; }
> "

Make the exprList rule a bit more complicated and have it explicitly
understand the recursive nesting of the exprLists.

I'm not sure why you don't require the semi-colon after the last item in
the exprList but changing that would make the grammar cleaner.

Take care,
	John


More information about the antlr-interest mailing list