Keyword mandatory and optional parts

May 22, 2014 at 9:22 AM
I need to add a keyword to the mandatory and optional parts
Example:
variable
where var - mandatory part
iable - optional part.
In this example the words
var
vari
varia
variab
variabl
variable

are correct.

Can you explain how i do this?
Coordinator
May 22, 2014 at 10:37 PM
that's a really strange arrangement you have...
do you use identifier? if yes, then you can use 'var' only as a keyword in grammar. The other variations are initially scanned as identifiers; hook to Identifier.ValdiateToken event, in the event handler check the identifier (token text), and if it is varia??-like, change the Token.Term to be 'var' keyword