I'm using Irony framework and I have:
IdentifierTerminal variable = new IdentifierTerminal("variable");
a terminal for identifying an entry terminal.
This variable terminal can hold any string, except for a predefined list of reserved strings. This identifier does not start or any with quotes or double quotes.
I want something like:
IdentifierTerminal variable = any contiguos string EXCEPT "event", "delegate";
How can I enforce this rule for this terminal?
Have you declared your keywords explicitly? If not, this page: https://en.wikibooks.org/wiki/Irony_-_Language_Implementation_Kit/Grammar/Terminals#Keywords will show you how. It seems that you don't need to explicitly say that an identifier cannot be a keyword, as the parser is able to figure this out. I found the following quote
source: http://www.codeproject.com/Articles/22650/Irony-NET-Compiler-Construction-Kit