[antlr-interest] How to make this work ??

v_vivekg <v_vivekg at yahoo.com> v_vivekg at yahoo.com
Wed Dec 18 00:49:42 PST 2002


Hi all,

I have binary and hex digits defined as follows :

protected
BDIG		: ('0'|'1') ;
protected
HDIG		:	(options {warnWhenFollowAmbig = false;} :('0'..'9') )
			|	('A'..'F')
			|	('a'..'f')
			;

and Binary String and Hex String defined as follows in the lexer

B_STRING : "'"   (BDIG)+  "'B"  ;
H_STRING : "'"   (HDIG)+  "'H"  ;

Now the problem is that this definition is not able to
parse the string of type '01010111'H . The code goes into
binary string parsing and gives error that 'B was expected
but 'H was found instead.
I tried with semantic and syntatic predicates with lot of
options but unable to make this work.

Kindly help on how this simple thing can be made to work.










 

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



More information about the antlr-interest mailing list