[antlr-interest] How to Resolve these problems

v_vivekg v_vivekg at yahoo.com
Tue Jun 10 00:20:08 PDT 2003


Hi,

I have two problems which need to be resolved.

1) There is error reported if an identifier(upper or lower case)
matches with a keyword e.g. 

symbol returns [String s]
{s="";}
: (up:UPPER { s = up.getText();}
| lid:LOWER { s = lid.getText();})
;

If this rule matches UPPER or LOWER with a keyword then there is an
error 'unexpected Token '.

2) Not everything is consumed by inverting a rule, e.g.

| (UPPER "MACRO" ASSIGN_OP BEGIN_KW (~(WS))* END_KW)=> UPPER "MACRO"
ASSIGN_OP BEGIN_KW (~(WS))* END_KW

WS is white space skipping ' ' and new lines.The above rule fails when
a double quotes followed by some character is encountered(eg at "{" it
says expecting '"' found '{'), I think it problem with a character set.


Kindly help to resolve these problems.


 

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




More information about the antlr-interest mailing list