This project has moved. For the latest updates, please go here.

How can I disallow keywords and constants from Identifiers?

Nov 18, 2012 at 8:17 AM

Is it possible to do this so I don't need to check after parsing?  I want to be able to make sure that they don't say true = false  or  int this = 10.  I would like to do it in parsing, so that if I add new Terminals I don't need to worry about adding them anywhere else.  The alternative that I am using is checking if a hash table contains it and putting all the keywords or constants are in it.  The reason I don't like this is that I am adding new ones frequently and I forget to add them to the hash table.

Nov 18, 2012 at 11:23 PM

mark them as Reserved words, using MarkReservedWords method.