bison-patches
[Top][All Lists]
Advanced

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

Re: %print


From: Zack Weinberg
Subject: Re: %print
Date: Fri, 30 Aug 2002 22:49:00 -0700
User-agent: Mutt/1.4i

On Wed, Jun 19, 2002 at 09:52:30AM +0200, Akim Demaille wrote:
> Zack> I'm pretty sure that a lot of bison's internal tables could
> Zack> become smaller and/or unnecessary with this feature.
> 
> I'm not sure I understand your point here.  It is not very costly to
> have a 256 items table to tell what chars are and are not valid
> tokens.  I don't believe there is much to be gained with this, do you?
> That's the only place where you will find some cost to related to this
> (yytranslate).  Removing this, in addition, seems to be quite
> dangerous.

Suppose yylex() makes an ironclad guarantee that it will return a
specific set of token codes and *only* those token codes.  The size of
that set is less than 256.  If bison could use those codes directly to
index its state transition tables, I believe it would be both faster
and smaller (since some of the tables could be 'char' instead of
'short', and a number of internal checks would be unnecessary).

zw





reply via email to

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