lib/ParserGenerator/PHP/ParserGenerator/Data.php
function emit_code($out, PHP_ParserGenerator_Rule $rp, &$lineno)
    {
        $linecnt = 0;
        
        /* Generate code to do the reduce action */
        if ($rp->code) {
            $this->tplt_linedir($out, $rp->line, $this->filename);
            fwrite($out, "    function yy_r$rp->index(){" . $rp->code);
            $linecnt += count(explode("\n", $rp->code)) - 1;
            $lineno += 3 + $linecnt;
            fwrite($out, "    }\n");
            $this->tplt_linedir($out, $lineno, $this->outname);
        } /* End if( rp->code ) */
    }
function emit_code($out, PHP_ParserGenerator_Rule $rp, &$lineno)
    {
        $linecnt = 0;
        
        /* Generate code to do the reduce action */
        if ($rp->code) {
            $this->tplt_linedir($out, $rp->line, $this->filename);
            fwrite($out, "    function yy_r$rp->index(){" . $rp->code);
            $linecnt += count(explode("\n", $rp->code)) - 1;
            $lineno += 3 + $linecnt;
            fwrite($out, "    }\n");
            $this->tplt_linedir($out, $lineno, $this->outname);
        } /* End if( rp->code ) */
    }
function emit_code ( $ out , PHP_ParserGenerator_Rule $ rp , & $ lineno ) { $ linecnt = 0 ; /* Generate code to do the reduce action */ if ( $ rp -> code ) { $ this -> tplt_linedir ( $ out , $ rp -> line , $ this -> filename ) ; fwrite ( $ out , "    function yy_r$rp->index(){" . $ rp -> code ) ; $ linecnt += count ( explode ( "\n" , $ rp -> code ) ) - 1 ; $ lineno += 3 + $ linecnt ; fwrite ( $ out , "    }\n" ) ; $ this -> tplt_linedir ( $ out , $ lineno , $ this -> outname ) ; } /* End if( rp->code ) */ }
Generate code which executes when the rule "rp" is reduced.  Write
the code to "out".  Make sure lineno stays up-to-date.
Generate code which executes when the rule rp is reduced . Write the code to out . Make sure lineno stays up - to - date .