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

alternative keywords/symbols

Jul 18, 2010 at 1:42 PM

My question is, what is the best way to specify a grammar for a language where there are alternative symbols.

For example, I want to support a query statement in this form:


but also have this be valid so that queries can be shorter:

"SELECT D a,b,c ON R"

Jul 22, 2010 at 7:29 PM
Sorry for the delay, was hoping somebody would jump in.. :) Well, there's no magic, just declare intermediate non-terminals for keywords: var dim = new NonTerminal("Dim"); dim.Rule = ToTerm("DIMENSIONS") | "D"; and use this "dim" term in your expressions.