On Apr 24, 2010, at 01:34:08, Bart Kiers wrote:
> On Sat, Apr 24, 2010 at 4:25 AM, Rick Mann <[email protected]> wrote:
> float returns [float val]
> : { $val = Float.parseFloat($FLOAT.text); }
> ;
>
> Note that you never use your 'float' rule.
Yeah, I go back and forth, trying to make it work.
> INT : '0'..'9'+
> ;
>
> FLOAT
> : ('0'..'9')+ '.' ('0'..'9')* EXPONENT?
> | '.' ('0'..'9')+ EXPONENT?
> | ('0'..'9')+ EXPONENT
> ;
>
> Try placing FLOAT before INT in your grammar.
That's straight from the ANTLRWorks grammar creation wizard. Is it incorrect?
--
Rick
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en.