[antlr-interest] Two Problems left in ASN.1 grammar

v_vivekg v_vivekg at yahoo.com
Thu Jun 5 21:05:41 PDT 2003


Hello Ter/Rick

There are exactly two problems left in my ASN.1 grammar for which I
need your help for solving them.

1) There is error reported if an identifier(upper or lower case)
matches with a keyword for eg

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. EG

| (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.


Waiting for your replies.

Regards
Vivek





 

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




More information about the antlr-interest mailing list