lib/ParserGenerator/PHP/ParserGenerator/Data.php
private function tplt_xfer($name, $in, $out, &$lineno)
    {
        while (($line = fgets($in, 1024)) && ($line[0] != '%' || $line[1] != '%')) {
            $lineno++;
            $iStart = 0;
            if ($name) {
                for ($i = 0; $i < strlen($line); $i++) {
                    if ($line[$i] == 'P' && substr($line, $i, 5) == "Parse"
                          && ($i === 0 || preg_match('/[^a-zA-Z]/', $line[$i - 1]))) {
                        if ($i > $iStart) {
                            fwrite($out, substr($line, $iStart, $i - $iStart));
                        }
                        fwrite($out, $name);
                        $i += 4;
                        $iStart = $i + 1;
                    }
                }
            }
            fwrite($out, substr($line, $iStart));
        }
    }
private function tplt_xfer($name, $in, $out, &$lineno)
    {
        while (($line = fgets($in, 1024)) && ($line[0] != '%' || $line[1] != '%')) {
            $lineno++;
            $iStart = 0;
            if ($name) {
                for ($i = 0; $i < strlen($line); $i++) {
                    if ($line[$i] == 'P' && substr($line, $i, 5) == "Parse"
                          && ($i === 0 || preg_match('/[^a-zA-Z]/', $line[$i - 1]))) {
                        if ($i > $iStart) {
                            fwrite($out, substr($line, $iStart, $i - $iStart));
                        }
                        fwrite($out, $name);
                        $i += 4;
                        $iStart = $i + 1;
                    }
                }
            }
            fwrite($out, substr($line, $iStart));
        }
    }
private function tplt_xfer ( $ name , $ in , $ out , & $ lineno ) { while ( ( $ line = fgets ( $ in , 1024 ) ) && ( $ line [ 0 ] != '%' || $ line [ 1 ] != '%' ) ) { $ lineno ++ ; $ iStart = 0 ; if ( $ name ) { for ( $ i = 0 ; $ i < strlen ( $ line ) ; $ i ++ ) { if ( $ line [ $ i ] == 'P' && substr ( $ line , $ i , 5 ) == "Parse" && ( $ i === 0 || preg_match ( '/[^a-zA-Z]/' , $ line [ $ i - 1 ] ) ) ) { if ( $ i > $ iStart ) { fwrite ( $ out , substr ( $ line , $ iStart , $ i - $ iStart ) ) ; } fwrite ( $ out , $ name ) ; $ i += 4 ; $ iStart = $ i + 1 ; } } } fwrite ( $ out , substr ( $ line , $ iStart ) ) ; } }
The first function transfers data from "in" to "out" until
a line is seen which begins with "%%".  The line number is
tracked.

if name!=0, then any word that begin with "Parse" is changed to
begin with *name instead.
The first function transfers data from in to out until a line is seen which begins with %% . The line number is tracked .