[antlr-interest] Using the ANTLRworks Debugger

Randall R Schulz rschulz at sonic.net
Sun Nov 19 11:40:30 PST 2006


Terence,

On Sunday 19 November 2006 10:48, Terence Parr wrote:
> On Nov 19, 2006, at 9:44 AM, Randall R Schulz wrote:
> > Hi,
> >
> > When I attempt to launch the debugger in ANTLRworks (stand-alone,
> > versino 1.0b6) I always get this after submitting the input:
> >
> > Grammar compilation phase:
> >
> > [09:36:26] warning(208): /dar/tau/src/tau/tstp/TSTP.g:1090:1: The
> > following token definitions are unreachable: SingleQuoted
> > [09:36:28] Note: /dar/tau/src/tau/tstp/TSTPParser.java uses
> > unchecked or unsafe operations.
> > [09:36:28] Note: Recompile with -Xlint:unchecked for details.
>
> Hiyo Randall!
>
> This means that you have two lexer rules that match same thing and
> SingleQuoted is after the other so it gets tossed out.

Well, that's not really true. No other lexer rule matches what 
SingleQuoted does, since SingleQuoted starts with a single-quote (') 
only and no other rule allows a single quote as its first character. So 
how could there be a conflict?


> It generates no code hence the compile errors.

The stand-alone / command-line parser generates code just fine from this 
ANTLR grammar. And it parses the stuff it should parse (so far my test 
corpus doesn't use this construct, so it's irrelevant for now).

And in fact when I remove the SingleQuoted rule and the references to 
it, silencing the spurious error about its being unreachable, the same 
thing happens when I try to debug in ANTLRworks.


> Ter


Randall Schulz


More information about the antlr-interest mailing list