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
