[antlr-interest] How to Resolve these problems

mzukowski at yci.com mzukowski at yci.com
Tue Jun 10 08:13:25 PDT 2003


You don't have enough information here for us to help you.  Sample input and
all the rules which are used would be helpful.

Also try running antlr.Tool with -traceParser and -traceLexer to get a
better idea of what is going on.

Monty

-----Original Message-----
From: v_vivekg [mailto:v_vivekg at yahoo.com] 
Sent: Tuesday, June 10, 2003 12:20 AM
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] How to Resolve these problems


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/ 


 

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




More information about the antlr-interest mailing list