[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Is better to identify keywords in the lexer or later on?
I am having difficulty in producing a grammar were I don't want certain
keywords using as identifiers (e.g. variable or function names). I was
wondering if its a better practice to keep the grammar simple and detect
these keywords later in the semantic analyzer for example or somehow do
it in the grammar?
For example, in C/C++, I don't want to see a variables name called
'int'.
Stephen