On Sat, Apr 24, 2010 at 1:05 PM, Rick Mann <[email protected]> wrote:
> > 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. > Okay, but you showed a grammar where you did not use your float-rule, but mentioned you had problems with that rule. Could you post the grammar you're actually having problems with? > > > 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 > If you haven't changed anything about the order, then itmust be correct. Bart. 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.
