Such things are excluded semantically not syntactically. Basically as many rules as possible should be tested semantically rather than syntactically as the error messages that ensue are generally very much better. You get "chained assignments are not allowed" vs Syntax error at '=' for instance.
Jim > -----Original Message----- > From: [email protected] [mailto:antlr-interest- > [email protected]] On Behalf Of Damien Urruty > Sent: Tuesday, March 23, 2010 7:25 AM > To: [email protected] > Subject: Re: [antlr-interest] Parse assignments and method calls > > > On Tue, Mar 23, 2010 at 2:56 PM, Damien Urruty > <[email protected]>wrote: > > It's the Java Grammar 1.6 by Yang Jiang, but every grammar that I have > encountered works the same way, the ones on the wiki, and Sun's one : a > left-hand side variable can be a expression like 2+3... > > Hello > I have been working on the Java grammar,... > > What is "the Java grammar" here? A ANTLR grammar you found on the net, > or on > one of ANTLR's wiki pages[1]? If so, you might want to tell which one > (there's more than one on the wiki). Or do you mean the grammar from > the > JLS[2]? > > Regards, > > Bart. > > [1] http://www.antlr.org/grammar/list[2] > http://java.sun.com/docs/books/jls/second_edition/html/syntax.doc.html > > > > _________________________________________________________________ > Consultez gratuitement vos emails Orange, Gmail, Free, ... directement > dans HOTMAIL ! > http://www.windowslive.fr/hotmail/agregation/ > > 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 [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.
