Mailing List Archive

byacc peculiarity (was Interfacing with C structure, enums, etc.)
Re: byacc peculiarity (was Interfacing with C structure, enums, etc.) [ In reply to ]
Also -- I noticed in certain contexts $$, $1, $2 etc.. are interpreted as $$ $1
$2.. etc... and in others they are intrepreted as '$yyval and $yyvs[$yyvsp-0]
and $yyvs[$yyvsp-1] respectively...

To access the magic $1, just use "$1".
Look at this:

if ($1 =~ /foo(.*bar)/) { # $1 -> $yyvs[$yyvsp-0] or thelike
$$ = "$1"; # $$ -> $yyval or thelike
} # $1 is the magic $1

Ulrich Pfeifer
--
@J = split //,"J!k Phau^eHeens%rarrot&\ncl t ";
for(0..24){print @J[$_*7%($#J+1)]}
Re: byacc peculiarity (was Interfacing with C structure, enums, etc.) [ In reply to ]
Also -- I noticed in certain contexts $$, $1, $2 etc.. are interpreted as $$ $1
$2.. etc... and in others they are intrepreted as '$yyval and $yyvs[$yyvsp-0]
and $yyvs[$yyvsp-1] respectively...

To access the magic $1, just use "$1".
Look at this:

if ($1 =~ /foo(.*bar)/) { # $1 -> $yyvs[$yyvsp-0] or thelike
$$ = "$1"; # $$ -> $yyval or thelike
} # $1 is the magic $1

Ulrich Pfeifer
--
@J = split //,"J!k Phau^eHeens%rarrot&\ncl t ";
for(0..24){print @J[$_*7%($#J+1)]}