[antlr-interest] Tokenising for context specific reserved words

Jim Idle jimi at temporal-wave.com
Thu Jul 17 19:24:32 PDT 2008


On Thu, 2008-07-17 at 18:18 -0700, Roshan James wrote:
> Thank you for your responses. I am biased against using semantics
> predicates for the reason that I want to keep out the target language
> as much as possible from the parser that generates the AST. 
> 
> Are there any other approaches other than Jims? 
> 
> The downside I see to this approach is that one always needs to keep a
> global list of keywords under the 'id' production. This becomes a bit
> of a nightmare for maintenance.

Well, one way or another you have to identify the keywords, so I am not
sure that either solution is better or worse than anything else for
that. Also, unless you are adding keywords to your language every two
minutes, I wouldn't worry about it too much ;-) Just keep as many
regression tests as you can.

Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080717/02d4e094/attachment.html 


More information about the antlr-interest mailing list