[antlr-interest] (no subject)
win at wincent.com
Fri Apr 20 07:49:44 PDT 2007
El 20/4/2007, a las 16:06, craig at palantir.co.za escribió:
> When I run with
> test, testing, testagain
> It is not ignoring the whitespace? Should $channel=HIDDEN not do
> the trick here?
Are you running under the ANTLRWorks interpreter by any chance?
I am very new to ANTLR myself, but one thing I've discovered is that
running things under the ANTLRWorks "Interpreter" tab is not the same
as running them under the debugger or from a compiled tool.
Things like setting the channel don't work in the interpreter,
presumably because nothing is actually compiled before the
interpreter starts; as such any actions you define that set channels
or do anything else will have no effect. This is why your rules fail
to work when you have whitespace in your input.
But if you run them under the debugger, your grammar is actually
compiled before running, and your actions will indeed be invoked.
More information about the antlr-interest