[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: %prec using undefined token
From: |
Florian Krohm |
Subject: |
Re: %prec using undefined token |
Date: |
Thu, 7 Jan 2010 10:29:56 -0500 |
User-agent: |
KMail/1.12.2 (Linux/2.6.31-16-generic; KDE/4.3.2; i686; ; ) |
On Monday 04 January 2010 12:55:49 pm Joel E. Denny wrote:
> On Wed, 30 Dec 2009, Florian Krohm wrote:
>
> > It'd be helpful for debugging grammars to have a warning that is triggered
> > when a name is referred to that is not explicitly declared as non/terminal.
> > That's less cumbersome than digging through the report file.
> > Perhaps something to consider for the next version.
>
> According to POSIX, putting an identifier in a %token, %left, %right, or
> %nonassoc is sufficient to declare it as a token. (Our master branch also
> has %precedence.) Otherwise, it's a nonterminal and it's an error not to
> put it on the LHS of a grammar rule. I interpret that last part to mean
> that (1) putting it on the LHS of a grammar rule declares it to be a
> nonterminal, and (2) an error must be reported if it's never declared as a
> token or nonterminal. After the patches I just applied, I believe Bison
> now implements all of that fully.
>
Right you are. Please disregard my comment above.
Florian