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. However,
that additional pre-build step is somehow annoying me. Further, I would
need to generate rules of the form
statementKeyword : Keyword1 | Keyword2 | ... | KeywordN;
I would like to have (or implement) a rule of the form
statementKeyword : Keyword1 .. KeywordN;
as it is possible in the lexer, but it seems impossible in the parser.
This would avoid an extra generation step for the grammar.
Can I subclass the parser and override the statementKeyword method to
perform a lookup in my existing keywords list ?
Or are there any better ideas ?
Best Regards
Lars von Wedel
_________________________________________
Bayer Technology Services GmbH
BTS-PT-PD-ES
Leverkusen, E 41
Phone: +49 214 30 56456
Fax: +49 214 30 62677
E-mail: [EMAIL PROTECTED]
Web: www.bayertechnology.com
Geschäftsführer: Achim Noack
Aufsichtsratsvorsitzender: Dr. Wolfgang Plischke
Sitz der Gesellschaft: Leverkusen | Eintragung: Amtsgericht Köln, HRB
49896
--~--~---------~--~----~------------~-------~--~----~
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