PHP Port : Problem in generated file #120

Open
hguenot opened this Issue Oct 17, 2012 · 0 comments

1 participant

@hguenot

Hi,

I'm using PHP port of Jison to build PHP parser and It works well... but there is a little error in generated Parser class in "parse" method (I think same thing appens in JS parser but I'm not sure). The first occurence of :

$errStr = "Parse error on line " . ($yylineno + 1) . ":\n" . $this->showPosition() . "\nExpecting " . implode(", ", $expected) . ", got '" . $this->terminals_[$symbol] . "'";

references variable $yylineno but it is not defined before.
I think It misses something like :

$yyval = (object)array();
$yyloc = $this->yyloc;

// prevent PHP Error on $yylineno
$yylineno = $this->yylineno;

But I don't find how to add it in generator....

If all PHP errors are set ini php.ini, the parsing failed because $yylineno is not defined.

Thank for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment