[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: %prec using undefined token
From: |
Joel E. Denny |
Subject: |
Re: %prec using undefined token |
Date: |
Mon, 4 Jan 2010 12:55:49 -0500 (EST) |
User-agent: |
Alpine 1.00 (DEB 882 2007-12-20) |
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.
Maybe I don't know what you mean. Do you have an example where a new
warning would be helpful?