Lukasz Guminski wrote:
Thank you, but it doesn't work. LT(k) returns a character. I am sending you my grammar and the output I got. Well, you have LETTER as a non fragment rule, so you are always going to get this instead of ALPHANUM. You should be getting an ambiguity warning too I suspect and you block_name rule should be ID: fragment LETTER : ('a'..'z'|'A'..'Z'); fragment ALPHANUM : (LETTER|'0'..'9'); ID : LETTER ALPHANUM* ; Also, do you need the SPACE token? It will be a lot easier in the parser if you hide that and regardless, if the user has 2 spaces not one, then all your calculations will be out anyway. You should probably hide the insignificant_char token too. I think that you need to be doing this a different way really. You could easily do this in the lexer. Perhaps you should practice a bit on simpler problems before diving in to this one? I think you are suffering from not understanding the lexer/parser fundamentals yet. Jim --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~--- |
List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
