$$ in parse.y question(c++)
Mike Stump
mrs@windriver.com
Mon Jan 8 18:24:00 GMT 2001
> Date: Tue, 9 Jan 2001 02:39:52 +0100 (CET)
> From: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
> To: Andreas Schwab <schwab@suse.de>
> cc: Dave Raggett <dave_raggett@hotmail.com>, <gcc@gcc.gnu.org>
> 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?
grep '\$\$' *.y */*.y | sed 's/\$\$.* = / = /' | grep '\$\$'
will find the lines that probably need editing. :-)
More information about the Gcc
mailing list