[antlr-interest] Grammar Perplexity in v3.0

Terence Parr parrt at cs.usfca.edu
Sun Nov 12 08:38:31 PST 2006


On Nov 12, 2006, at 8:10 AM, Randall R Schulz wrote:

> Hi,
>
> I'm having a very perplexing problem with a grammar I'm developing for
> ANTLR v3.0. Since this is my first foray in ANTLR and since version  
> 3.0
> is still in beta, I'm uncertain whether the problem is with my
> understanding or the software.
>
> Before I try to create an excerpt of the grammar to post here, I  
> thought
> I'd describe the problem roughly and ask for general suggestions on
> what might be the problem. If that doesn't yield any progress, I'll
> make a longer, more detailed post.
>
>
> So here's the thing. My grammar, as usual, has both lexical rules and
> grammar productions (sorry if I'm using the wrong terminology).
>
> When I compile the grammar, I get this diagnostic:
>
> ANTLR Parser Generator   Early Access Version 3.0b4 (??, 2006)
> 1989-2006
> TSTPv3209.g:1099:1: The following token definitions are unreachable:
> AtomicWord,FileName,SingleQuoted

Most likely you need "fragment" in front of some rules (the ones that  
are only used by other lexical rules).

Ter


More information about the antlr-interest mailing list