Hi Jeremy,

This is not an answer but my thoughts after reading it.

It looks like the first option originally had some other text with it that
was removed and the second option was valid as originally written.

If it was me, I would try and find earlier versions from either antlr 2.x
or something or see if something turns up at ANTLR repository on github.

Eric

On Wed, Nov 16, 2011 at 10:08 AM, Jeremy Long <jeremy.l...@gmail.com> wrote:

> I am still fairly new to antlr and when looking at the 1.6 Java grammar I
> noticed the following statement rule:
>
> statement
>    :   block
>
>    |   ('assert'
>        )
>        expression (':' expression)? ';'
>    |   'assert'  expression (':' expression)? ';'
>    |   'if' parExpression statement ('else' statement)?
>    |   forstatement
>    |   'while' parExpression statement
>    |   'do' statement 'while' parExpression ';'
>    |   trystatement
>    |   'switch' parExpression '{' switchBlockStatementGroups '}'
>    |   'synchronized' parExpression block
>    |   'return' (expression )? ';'
>    |   'throw' expression ';'
>    |   'break'
>            (IDENTIFIER
>            )? ';'
>    |   'continue'
>            (IDENTIFIER
>            )? ';'
>    |   expression  ';'
>    |   IDENTIFIER ':' statement
>    |   ';'
>    ;
>
>
> My question is about the two lines for assert:
>    |   ('assert'
>        )
>        expression (':' expression)? ';'
>    |   'assert'  expression (':' expression)? ';'
> To me those look identicle - am I missing something? Is there some nuance
> to the parens that I don't understand?
>
> Thanks,
>
> jeremy
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe:
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>

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 il-antlr-inter...@googlegroups.com.
To unsubscribe from this group, send email to 
il-antlr-interest+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to