This project has moved and is read-only. For the latest updates, please go here.

how to allow a space in an identifier in an expression

Jan 15, 2014 at 11:30 AM
Edited Jan 15, 2014 at 3:21 PM

I would like to modify the expression grammar that comes with irony.
I would like to allow the use of spaces within any identifier.
I naively tried to allow a space by including a space in the AllChars property.
But parsing an expression like
3 * Brazil coffee ... 
detects two identifiers (Brazil and coffee) and a syntax error in between:

Syntax error, expected: operator, ), ., [, :, ,

Would there be a possibility to allow one or more spaces in an identifier?


Jan 16, 2014 at 12:28 AM
I think the easiest way is to write custom identifier terminal that skips spaces until special symbol; maybe subclass IdentifierTerminal or just copy/modify it.
Marked as answer by lalbatros on 1/15/2014 at 11:26 PM
Jan 16, 2014 at 7:26 AM