bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FYI: default %destructor/%printer for error, $undefined, $accept


From: Joel E. Denny
Subject: Re: FYI: default %destructor/%printer for error, $undefined, $accept
Date: Tue, 22 Aug 2006 01:44:12 -0400 (EDT)

On Mon, 21 Aug 2006, Joel E. Denny wrote:

> So, the error token becomes a nonterminal and its RHS is the sequence of 
> discarded symbols?

Despite what POSIX says, it occurs to me that the error token bears little 
resemblance to a token... even in Yacc.  It's constructed in the parser 
not the scanner.  The Open Group actually states that the scanner 
shouldn't return error.  It seems that it's more a like a nonterminal that 
reduces sequences of erroneous symbols... and now we want to add semantic 
actions.

In any case, I'm thinking the default %destructor and %printer should only 
be used for error if the user writes explicit error rules (where error is 
the LHS).  That will be backward compatible with the current 
implementation, in which applying the default %destructor/%printer to 
error normally wouldn't make much sense.

Joel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]