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


Reply via email to