Meena Vinod wrote:
Invoke the lexer separately by asking for the first token. This will cause the tokens to be gathered (the lexer will run to completion). Then check if it issued any errors (you should probably override the error reporting mechanism) and stop if it did. However, you should code your lexer such that it does not give errors, at least not from the runtime. See lots of past posts about this on this list. Ideally, you want your process to go as far as it can without giving up such that your end user receives as much information as possible about what is wrong before having to run your parser again. See: http://www.antlr.org/wiki/display/ANTLR3/Lexer+grammar+for+floating+point%2C+dot%2C+range%2C+time+specs For some concrete examples. 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
