Greetings!
I have a short answer, but also have many worries and doubts regarding
your grammar also...
First the short answer:
Put the PARAM rule as the last lexer rule.
ANTLR lexers are greedy, the rule matching the longest input sequence
wins. But when 2 rules match exactly the same input sequence, then the
lexer rule appearing first in the grammar file wins.
And now my worries:
how should the input sequence `format_one:format_one: ` be interpreted
by your lexer? is it 2 FORMAT_ONE tokens and a blank or is it 1 PARAM
token and a blank?
my question begins to get to the issue of punctuation characters as
operators.
should the `:` be considered a post-fix operator indicating a keyword,
and thus excluded from consumption by PARAM?
and do you have other operators? + * % ....whatever that need to be
excluded from the PARAM rule?
how should the input `one+"two"+three` be interpreted? 5 tokens or 3?
Hope this helps...
-jbb
> --
> You received this message because you are subscribed to the Google
> Groups "antlr-discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
antlr-discussi...@googlegroups.com
> <mailto:
antlr-discussi...@googlegroups.com>.
> For more options, visit
https://groups.google.com/d/optout.