If I remove the TEXT token definition and the reference in the Item production, the remaining grammar does properly match the first line and I get a parse error at the new line character (as expected). Why does the introduction of my TEXT token override those previously-matching tokens, even though it is listed last in the %tokens% section?
The text "ON" could match both these tokens, but for me ON matches,
not VARNAME. I suggest you cut your example down into a very simple
grammar (like the above).
On 28/02/2011 4:37 PM, Drew Vogel wrote:
If I have two regex tokens A and B and A is a subset
of B, how do I disambiguate them such that A will always be tried
before B? The order they appear in the %tokens% section does not
seem to affect this and I did not see an example of this in the
The parser I am trying to construct is for a template-like
language with commands embedded in text. Thus I have a "text"
token regex <<.+>> to match everything not otherwise
matched as a command, but I only want to match it after all
other token regex patterns have been tried.