[antlr-interest] Where is the problem??

rmsanjivp <rmsanjivp at yahoo.com> rmsanjivp at yahoo.com
Wed Jan 29 21:45:59 PST 2003


Hi! 

Consider the following grammar

topLevel : expr;

expr : mult_expr ( (PLUS | MINUS) mult_expr)*;

mult_expr : primary_expr ((MULT | DIV) primary_expr)*;

primary_expr: ID | (LPAREN ID RPAREN);


FOr this simple grammar if I give input as (1+2)) then even though 
it is a case of unmatched paranthesis there is no exception 
generated. The problem is that RPAREN is coming as a valid expected 
token in one of the rule. Could you please tell me if there is a bug 
somethere??

Thanks,
Sanjiv


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list