[antlr-interest] Keywords in grammar

Jim Idle jimi at temporal-wave.com
Tue Oct 19 12:58:16 PDT 2010


Look for the general pattern then use a runtime supplied hashtable to see if
the pattern is a keyword, if it is, then set the $type accordingly.

jim

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Dagi.Troegner at dlr.de
> Sent: Tuesday, October 19, 2010 2:49 AM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] Keywords in grammar
> 
> Hi everyone,
> 
> I would like to create a grammar that looks for specific keywords. The
> problem is that the keywords may differ in different applications.
> So is there a possibility to provide the grammar with some external
> variables containing the keywords?
> And a rule in the grammar then compares a specific token in the input
> file, if it is one the provided keywords?
> 
> Thanks,
> Dagi
> 
> 
> ********************************************************
> 
> 
> 
> Dagi Troegner
> 
> Deutsches Zentrum fuer Luft- und Raumfahrt (DLR)
> 
> Institut fuer Flugfuehrung
> 
> Abteilung Lotsenassistenz
> 
> Lilienthalplatz 7
> 
> D-38108  Braunschweig
> 
> Telefon: (49) 531 / 295-2189
> 
> Fax: (49) 531 / 295-2180
> 
> Email: Dagi.Troegner at dlr.de<mailto:Dagi.Troegner at dlr.de>
> 
> __/|__
> 
> /_/_/_/
> 
>    |/ DLR
> 
> ********************************************************
> 
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
> email-address



More information about the antlr-interest mailing list