This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: $$ in parse.y question(c++)
- To: "Dave Raggett" <dave_raggett at hotmail dot com>
- Subject: Re: $$ in parse.y question(c++)
- From: Andreas Schwab <schwab at suse dot de>
- Date: 06 Jan 2001 22:22:00 +0100
- Cc: gcc at gcc dot gnu dot org
- References: <F333GykBbKP7Ie8tlMa000115dd@hotmail.com>
"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.
Andreas.
--
Andreas Schwab "And now for something
SuSE Labs completely different."
Andreas.Schwab@suse.de
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg