bison-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] master: lalr1.cc: get rid of yyparse's yystate.


From: Akim Demaille
Subject: Re: [PATCH] master: lalr1.cc: get rid of yyparse's yystate.
Date: Wed, 19 Aug 2009 10:51:36 +0200


Le 16 août 09 à 07:36, Akim Demaille a écrit :

        * data/lalr1.cc (yy_lr_goto_state_): New.

These functions really improve the readability of the parsers, and I doubt that nowadays there's any penalty to pay to function calls that would make these changes inadequate for C parsers.

These functions also help making the meaning of the variables clearer. I don't like yyparse's yyn for instance, which is used for many different purpose, as a temporary variable. It can probably be removed using small auxiliary functions.

There are many improvements in lalr1.cc that one day we should backport to yacc.c. In my opinion, the most significant improvement is the introduction of a genuine type for symbols (kind, value, location), and the fusion of the three stacks.





reply via email to

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