[antlr-interest] ANTLRworks vs. Stand-Alone Parser

Thomas Brandon tbrandonau at gmail.com
Tue Jun 26 06:38:07 PDT 2007


On 6/26/07, Randall R Schulz <rschulz at sonic.net> wrote:
> Hi,
>
> I have a grammar, that's working (though far from complete). It's does
> not appear to be parsing the inputs the way I intend, so I wanted to
> look at the parse tree in the ANTLRworks Interpreter pane. The problem
> is that input that is parsed successfully when I run the parser on its
> own (outside ANTLRworks) just gives a one or two derivations (depending
> on which non-terminal I choose as the start symbol) and then
> NoViableAltException. I've tried several non-terminals that should be
> suitable for deriving the input I supplied but the result is always the
> same.
>
> Am I doing something wrong? Why the discrepancy between the parser when
> executed on its own and when executed within ANTLRworks? I do not use
> any options when invoking ANTLR on the command line, nor do I have any
> set in the ANTLRworks General Preferences tab.
>
> As before, this is the stand-alone ANTLRworks application, not the IDEA
> plug-in. ANTLRworks was not running when the most recent change to the
> grammar file was made and it is displaying the latest version of the
> grammar.
>
> Does ANLTRworks cache its compiled parser classes somewhere? If so,
> where? Must I manually clear that cache (if any)?
>
>
> Randall Schulz
>
The ANTLRWorks interpreter does not execute actions, including
predicates. So if your grammar uses predicates or actions which alter
the lexing\parsing behaviour it will not work in the ANTLRWorks
interpreter.
The ANTLRWorks debugger does do actions properly and should be
identical to running externally (apart from classpath issues which may
necessitate external debugging).

Tom.


More information about the antlr-interest mailing list