[antlr-interest] What is the difference between grammars?!

Ostrov, Alexei (GMIT-TASS) Alexei_Ostrov at ml.com
Tue Jan 15 14:56:52 PST 2008


One:	
DIGIT		: 	'0'..'9';
DOUBLE 	:	(DIGIT)+ ('.' (DIGIT)+)? ('e' ('-'|'+')?( DIGIT)+ )? ;
num	:	DOUBLE | COLUMN;


Another one:
DOUBLE 	:	('0'..'9')+ ('.' ('0'..'9')+)? ('e'
('-'|'+')?('0'..'9')+ )? ;
num	:	DOUBLE | COLUMN;


The first one does not accept 4 as num, the second one does. 

That is if I check the parse trees either in AntlrWorks or via generated
code (CSharp). Using Antlr build antlr-2008-01-10.16  

What am I missing!? Did I stumble into a bug? 

Alexei Ostrov
Desk A0513, 11th floor, 222 Broadway, NY, NY10038
212.670.1784
917.520.0205
--------------------------------------------------------

This message w/attachments (message) may be privileged, confidential or proprietary, and if you are not an intended recipient, please notify the sender, do not use or share it and delete it. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Merrill Lynch. Subject to applicable law, Merrill Lynch may monitor, review and retain e-communications (EC) traveling through its networks/systems. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or error-free. This message is subject to terms available at the following link: http://www.ml.com/e-communications_terms/. By messaging with Merrill Lynch you consent to the foregoing.
--------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080115/b9cce34a/attachment.html 


More information about the antlr-interest mailing list