[antlr-interest] Grammar Perplexity in v3.0 (More)

Terence Parr parrt at cs.usfca.edu
Sun Nov 12 09:08:19 PST 2006


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

> Terence,
>
> On Sunday 12 November 2006 08:46, Terence Parr wrote:
>> On Nov 12, 2006, at 8:44 AM, Randall R Schulz wrote:
>>> plainTerm
>>>
>>>     :    AtomicWord ( '(' arguments ')' ) ?
>>>
>>> AtomicWord
>>>
>>>     :   LowerWord
>>>
>>>     ;
>>
>> These rules are a problem.  AtomicWord is unreachable as both rules
>> can match it's input.  You will never see it in the parser.
>
> I'm afraid I don't get it. Which "both" are you referring to? Atomic
> word is a basic symbol token.

oh, plainTerm is a parser rule...sorry...  yeah that part is ok then.

Hmm....the rules look ok.  What is your entire input to the rule  
plainTerm?  Have you run AW to see what that parser rule accepts?   
What tokens are 4 and 6?  Have you stepped through with a debugger?

Ter


More information about the antlr-interest mailing list