On Tue, 2008-12-02 at 12:07 +0100, [EMAIL PROTECTED] wrote: > > Hello, > > I have successfully implemented an ANTLR grammar for a small part of > the input language for a tool I am about to reengineer. However, I am > a bit unsure how to scale my current state to the full input language > which has several hundred keywords. > > Luckily, all keywords are already available in a machine readable form > and it would be easy to generate a .tokens file from that source.
Why don't you just generate the lexer rules and the statementKeyword rule instead of the .tokens file? Assuming that you are not changing the language every week, then it is a one off operation and far simpler than trying to override the generated code (which you will then have to mess with every time ANTLR changes). You can then import the generated lexer and parser rules. > Can I subclass the parser and override the statementKeyword method to > perform a lookup in my existing keywords list ? > 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:8080/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address
