This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: $$ in parse.y question(c++)


On 6 Jan 2001, Andreas Schwab wrote:
> "Dave Raggett" <dave_raggett@hotmail.com> writes:
>|> In parse.y(gcc/cp/parse.y),I find such code:
>|> expr_no_commas:
>|> | expr_no_commas '+' expr_no_commas
>|> 		{ $$ = build_x_binary_op ($2, $$, $3); }
>|>
>|> why not { $$ = build_x_binary_op ($2, $1, $3); }??
> Because Bison implicitly prepends "$$ = $1" to every action.

This is not really, well, intuitive, is it?

Dave, would you be willing to submit a patch to clean this up?

Gerald
-- 
Gerald "Jerry" pfeifer@dbai.tuwien.ac.at http://www.dbai.tuwien.ac.at/~pfeifer/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]