At 03:12 9/04/2009, Indhu Bharathi wrote:
>INT_FLOAT_PATTERN
>     :    (NUMBER DOT NUMBER LETTER ) => NUMBER DOT NUMBER LETTER
>         { $type=PATTERN; }
>
>     |    ( NUMBER DOT NUMBER ) =>  NUMBER DOT NUMBER
>         { $type=FLOAT_LIT; }
>
>     |    (NUMBER) => NUMBER
>         { $type=INT_LIT; }
>
>     ;

I'm not sure why that isn't working, but you might want to 
left-factor it a bit more than you have:

INT_FLOAT_PATTERN /* or you could just make this INT_LIT */
   : NUMBER { $type = INT_LIT; }
     ( (DOT NUMBER) => DOT NUMBER { $type = FLOAT_LIT; }
       (LETTER { $type = PATTERN; })?
     )?
   ;

This should be more efficient (because it will only do the 
lookahead-backtracking once), and hopefully it'll actually work 
(though I haven't tested it).


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
-~----------~----~----~----~------~----~------~--~---

Reply via email to