Hi, Any clue why this doesn't work? I'm still clueless.
- Indhu Indhu Bharathi wrote: > I was working in a big grammar and stumbled on a problem with > predicates. I've simplified the problem as much as possible and here it is: > > When I give the input "1.", I expect the tokens <INT_LIT, DOT>. But what > I get is "No viable alternative at character 'EOF'. I'm not able to > understand why this happens. Any pointers? > > grammar Test; > > r : INT_LIT DOT+ > ; > > 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; } > > ; > > DOT : '.' > ; > > fragment PATTERN > : ; > > fragment FLOAT_LIT > : ; > > fragment INT_LIT > : ; > > > fragment > NUMBER : ('0'..'9')+ > ; > > fragment > LETTER : 'a'..'z' > ; > > > Thanks, Indhu > > > List: http://www.antlr.org/mailman/listinfo/antlr-interest > Unsubscribe: > http://www.antlr.org/mailman/options/antlr-interest/your-email-address > > 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 il-antlr-interest@googlegroups.com To unsubscribe from this group, send email to il-antlr-interest+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en -~----------~----~----~----~------~----~------~--~---