<?xml version="1.0"?>
<?xml-stylesheet
href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"
?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel rdf:about="http://pear.php.net/bugs/search.php">
    <title>PEAR Bug Search Results</title>
    <link>http://pear.php.net/bugs/search.php?cmd=display&amp;package_name%5B0%5D=PHP_ParserGenerator</link>
    <description>Search Results</description>
    <dc:language>en-us</dc:language>
    <dc:creator>pear-webmaster@lists.php.net</dc:creator>
    <dc:publisher>pear-webmaster@lists.php.net</dc:publisher>
    <admin:generatorAgent rdf:resource="http://pear.php.net/bugs"/>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    <items>
     <rdf:Seq>
      <rdf:li rdf:resource="http://pear.php.net/bug/18263" />
      <rdf:li rdf:resource="http://pear.php.net/bug/17841" />
      <rdf:li rdf:resource="http://pear.php.net/bug/17710" />
      <rdf:li rdf:resource="http://pear.php.net/bug/11647" />

     </rdf:Seq>
    </items>
  </channel>

  <image rdf:about="http://pear.php.net/gifs/pearsmall.gif">
    <title>PEAR Bugs</title>
    <url>http://pear.php.net/gifs/pearsmall.gif</url>
    <link>http://pear.php.net/bugs</link>
  </image>

    <item rdf:about="http://pear.php.net/bug/18263">
      <title>PHP_ParserGenerator: Bug 18263 [Open] Infinite loop on syntax error when using recursive grammar rules</title>
      <link>http://pear.php.net/bugs/18263</link>
      <content:encoded><![CDATA[<pre>PHP_ParserGenerator Bug
Reported by wkampmann
2011-02-11T18:40:05+00:00
PHP: Irrelevant OS:  Package Version: 0.1.7

Description:
------------
When using recursive grammar rules like the expression rules in 
the provided grammar excerpt, the generated parser enters an 
infinite loop if a syntax error is made within the recursive 
elements.

This is due to the functions yy_is_expected_token and 
yy_get_expected_tokens as shown in code excerpts (1) and (2). 

Test script:
---------------
========= GRAMMAR EXCERPT =========

expr(A) ::= LPAREN expr_0(B) RPAREN.
expr(A) ::= expr_0(B).

expr_0(A) ::= expr_1(B) AND expr_1(C). 
expr_0(A) ::= expr_1(B) OR expr_1(C). 
expr_0(A) ::= expr_1(B).

expr_1(A) ::= expr_2(B) LESS_THAN_EQ expr_2(C).
expr_1(A) ::= expr_2(B) GREATER_THAN_EQ expr_2(C). 
expr_1(A) ::= expr_2(B) LESS_THAN expr_2(C).
expr_1(A) ::= expr_2(B) GREATER_THAN expr_2(C).
expr_1(A) ::= expr_2(B) EQ expr_2(C).
expr_1(A) ::= expr_2(B).

expr_2(A) ::= expr_3(B) PLUS expr_3(C).
expr_2(A) ::= expr_3(B) MINUS expr_3(C).
expr_2(A) ::= expr_3(B).

expr_3(A) ::= expr_4(B) MUL expr_4(C). 
expr_3(A) ::= expr_4(B) DIV expr_4(C). 
expr_3(A) ::= expr_4(B).

expr_4(A) ::= NOT expr_5(B). 
expr_4(A) ::= MINUS expr_5(B).
expr_4(A) ::= PLUS expr_5(B).
expr_4(A) ::= expr_5(B).

expr_5(A) ::= variable(B).
expr_5(A) ::= expr(B). // &lt;&lt; RECURSION 


========= GENERATED PARSER CODE (1) =========

function yy_get_expected_tokens (..) {
	
	[...]
	
	do {
            $yyact = $this-&gt;yy_find_shift_action($token);
            if ($yyact &gt;= self::YYNSTATE &amp;&amp; $yyact &lt; self::YYNSTATE + self::YYNRULE) {
                
				// reduce action
				$done = 0;	// &lt;&lt;&lt;&lt; RESETS $done, SHOULD BE OUTSIDE OUTER DO LOOP 
				
                do {
                    if ($done++ == 100) {	// &lt;&lt;&lt;&lt; NEVER REACHES 100 AS A RESULT
                        $this-&gt;yyidx = $yyidx;
                        $this-&gt;yystack = $stack;
                        // too much recursion prevents proper detection
                        // so give up
                        return array_unique($expected);
                    }
					
					[...]
					
                    if ($nextstate &lt; self::YYNSTATE) {
                        // we need to shift a non-terminal
                        $this-&gt;yyidx++;
                        $x = new MQLParseryyStackEntry;
                        $x-&gt;stateno = $nextstate;
                        $x-&gt;major = self::$yyRuleInfo[$yyruleno]['lhs'];
                        $this-&gt;yystack[$this-&gt;yyidx] = $x;
						
                        continue 2;  // &lt;&lt;&lt;&lt; JUMPS TO OUTER DO LOOP
                    } 
					
					[...]			
				}
				
				[...]
			}
		
			[...]
			
}

========= GENERATED PARSER CODE (2) =========

function yy_is_expected_token($token) {

	[...]
	
	do {
		$yyact = $this-&gt;yy_find_shift_action($token);
		if ($yyact &gt;= self::YYNSTATE &amp;&amp; $yyact &lt; self::YYNSTATE + self::YYNRULE) {
		
			// reduce action
			$done = 0; 	// &lt;&lt;&lt;&lt; RESETS $done, SHOULD BE OUTSIDE OUTER DO LOOP 
			
			do {
				if ($done++ == 100) { // &lt;&lt;&lt;&lt; NEVER REACHES 100 AS A RESULT
					$this-&gt;yyidx = $yyidx;
					$this-&gt;yystack = $stack;
					// too much recursion prevents proper detection
					// so give up
					return true;	// &lt;&lt;&lt;&lt; SHOULD RETURN FALSE
				}
				
				[...]
				
				if ($nextstate &lt; self::YYNSTATE) {
					// we need to shift a non-terminal
					$this-&gt;yyidx++;
					$x = new MQLParseryyStackEntry;
					$x-&gt;stateno = $nextstate;
					$x-&gt;major = self::$yyRuleInfo[$yyruleno]['lhs'];
					$this-&gt;yystack[$this-&gt;yyidx] = $x;
					
					continue 2;  // &lt;&lt;&lt;&lt; JUMPS TO OUTER DO LOOP
				}
				
			} while (true);
		}
		break;
		
	} while (true);
	
	$this-&gt;yyidx = $yyidx;
	$this-&gt;yystack = $stack;
	return true;
}

Expected result:
----------------
The parser should report a syntax error. 

Actual result:
--------------
Infinite loop.</pre>]]></content:encoded>
      <description><![CDATA[<pre>PHP_ParserGenerator Bug
Reported by wkampmann
2011-02-11T18:40:05+00:00
PHP: Irrelevant OS:  Package Version: 0.1.7

Description:
------------
When using recursive grammar rules like the expression rules in 
the provided grammar excerpt, the generated parser enters an 
infinite loop if a syntax error is made within the recursive 
elements.

This is due to the functions yy_is_expected_token and 
yy_get_expected_tokens as shown in code excerpts (1) and (2). 

Test script:
---------------
========= GRAMMAR EXCERPT =========

expr(A) ::= LPAREN expr_0(B) RPAREN.
expr(A) ::= expr_0(B).

expr_0(A) ::= expr_1(B) AND expr_1(C). 
expr_0(A) ::= expr_1(B) OR expr_1(C). 
expr_0(A) ::= expr_1(B).

expr_1(A) ::= expr_2(B) LESS_THAN_EQ expr_2(C).
expr_1(A) ::= expr_2(B) GREATER_THAN_EQ expr_2(C). 
expr_1(A) ::= expr_2(B) LESS_THAN expr_2(C).
expr_1(A) ::= expr_2(B) GREATER_THAN expr_2(C).
expr_1(A) ::= expr_2(B) EQ expr_2(C).
expr_1(A) ::= expr_2(B).

expr_2(A) ::= expr_3(B) PLUS expr_3(C).
expr_2(A) ::= expr_3(B) MINUS expr_3(C).
expr_2(A) ::= expr_3(B).

expr_3(A) ::= expr_4(B) MUL expr_4(C). 
expr_3(A) ::= expr_4(B) DIV expr_4(C). 
expr_3(A) ::= expr_4(B).

expr_4(A) ::= NOT expr_5(B). 
expr_4(A) ::= MINUS expr_5(B).
expr_4(A) ::= PLUS expr_5(B).
expr_4(A) ::= expr_5(B).

expr_5(A) ::= variable(B).
expr_5(A) ::= expr(B). // &lt;&lt; RECURSION 


========= GENERATED PARSER CODE (1) =========

function yy_get_expected_tokens (..) {
	
	[...]
	
	do {
            $yyact = $this-&gt;yy_find_shift_action($token);
            if ($yyact &gt;= self::YYNSTATE &amp;&amp; $yyact &lt; self::YYNSTATE + self::YYNRULE) {
                
				// reduce action
				$done = 0;	// &lt;&lt;&lt;&lt; RESETS $done, SHOULD BE OUTSIDE OUTER DO LOOP 
				
                do {
                    if ($done++ == 100) {	// &lt;&lt;&lt;&lt; NEVER REACHES 100 AS A RESULT
                        $this-&gt;yyidx = $yyidx;
                        $this-&gt;yystack = $stack;
                        // too much recursion prevents proper detection
                        // so give up
                        return array_unique($expected);
                    }
					
					[...]
					
                    if ($nextstate &lt; self::YYNSTATE) {
                        // we need to shift a non-terminal
                        $this-&gt;yyidx++;
                        $x = new MQLParseryyStackEntry;
                        $x-&gt;stateno = $nextstate;
                        $x-&gt;major = self::$yyRuleInfo[$yyruleno]['lhs'];
                        $this-&gt;yystack[$this-&gt;yyidx] = $x;
						
                        continue 2;  // &lt;&lt;&lt;&lt; JUMPS TO OUTER DO LOOP
                    } 
					
					[...]			
				}
				
				[...]
			}
		
			[...]
			
}

========= GENERATED PARSER CODE (2) =========

function yy_is_expected_token($token) {

	[...]
	
	do {
		$yyact = $this-&gt;yy_find_shift_action($token);
		if ($yyact &gt;= self::YYNSTATE &amp;&amp; $yyact &lt; self::YYNSTATE + self::YYNRULE) {
		
			// reduce action
			$done = 0; 	// &lt;&lt;&lt;&lt; RESETS $done, SHOULD BE OUTSIDE OUTER DO LOOP 
			
			do {
				if ($done++ == 100) { // &lt;&lt;&lt;&lt; NEVER REACHES 100 AS A RESULT
					$this-&gt;yyidx = $yyidx;
					$this-&gt;yystack = $stack;
					// too much recursion prevents proper detection
					// so give up
					return true;	// &lt;&lt;&lt;&lt; SHOULD RETURN FALSE
				}
				
				[...]
				
				if ($nextstate &lt; self::YYNSTATE) {
					// we need to shift a non-terminal
					$this-&gt;yyidx++;
					$x = new MQLParseryyStackEntry;
					$x-&gt;stateno = $nextstate;
					$x-&gt;major = self::$yyRuleInfo[$yyruleno]['lhs'];
					$this-&gt;yystack[$this-&gt;yyidx] = $x;
					
					continue 2;  // &lt;&lt;&lt;&lt; JUMPS TO OUTER DO LOOP
				}
				
			} while (true);
		}
		break;
		
	} while (true);
	
	$this-&gt;yyidx = $yyidx;
	$this-&gt;yystack = $stack;
	return true;
}

Expected result:
----------------
The parser should report a syntax error. 

Actual result:
--------------
Infinite loop.</pre>]]></description>
      <dc:date>2011-02-11T18:40:05+00:00</dc:date>
      <dc:creator>wkampmann &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>PHP_ParserGenerator Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/17841">
      <title>PHP_ParserGenerator: Bug 17841 [Open] Bugs in PHP-grammar</title>
      <link>http://pear.php.net/bugs/17841</link>
      <content:encoded><![CDATA[<pre>PHP_ParserGenerator Bug
Reported by hrniels
2010-09-03T03:08:02+00:00
PHP: 5.3.2 OS: Linux Package Version: 0.1.6

Description:
------------
Hi!

I'm using this parser-generator for parsing PHP-code. I based my parser on the grammars PHP.y and PHP_Parser.y. During my development I found a few bugs in the grammar:
  for-statement: COLON -&gt; SEMI
  switch-statement: inner_statement_list was missing
  unset: LPAREN -&gt; RPAREN
  &quot;static_scalar ::= PLUS static_scalar&quot; was missing
  &quot;static_scalar ::= MINUS static_scalar&quot; was missing

Hope this helps!

Best regards,
Nils</pre>]]></content:encoded>
      <description><![CDATA[<pre>PHP_ParserGenerator Bug
Reported by hrniels
2010-09-03T03:08:02+00:00
PHP: 5.3.2 OS: Linux Package Version: 0.1.6

Description:
------------
Hi!

I'm using this parser-generator for parsing PHP-code. I based my parser on the grammars PHP.y and PHP_Parser.y. During my development I found a few bugs in the grammar:
  for-statement: COLON -&gt; SEMI
  switch-statement: inner_statement_list was missing
  unset: LPAREN -&gt; RPAREN
  &quot;static_scalar ::= PLUS static_scalar&quot; was missing
  &quot;static_scalar ::= MINUS static_scalar&quot; was missing

Hope this helps!

Best regards,
Nils</pre>]]></description>
      <dc:date>2010-09-03T03:08:02+00:00</dc:date>
      <dc:creator>nils &amp;#x61;&amp;#116; script-solution &amp;#x64;&amp;#111;&amp;#x74; de</dc:creator>
      <dc:subject>PHP_ParserGenerator Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/17710">
      <title>PHP_ParserGenerator: Feature/Change Request 17710 [Open] Reduce the PHPCS errors and warnings</title>
      <link>http://pear.php.net/bugs/17710</link>
      <content:encoded><![CDATA[<pre>PHP_ParserGenerator Feature/Change Request
Reported by jespino
2010-08-16T22:32:55+00:00
PHP: 5.3.2 OS:  Package Version: SVN

Description:
------------
Reduce the PHPCS errors and warnings</pre>]]></content:encoded>
      <description><![CDATA[<pre>PHP_ParserGenerator Feature/Change Request
Reported by jespino
2010-08-16T22:32:55+00:00
PHP: 5.3.2 OS:  Package Version: SVN

Description:
------------
Reduce the PHPCS errors and warnings</pre>]]></description>
      <dc:date>2010-08-16T22:32:55+00:00</dc:date>
      <dc:creator>jespinog &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>PHP_ParserGenerator Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/11647">
      <title>PHP_ParserGenerator: Bug 11647 [Assigned] substitution of @X works incorrectly</title>
      <link>http://pear.php.net/bugs/11647</link>
      <content:encoded><![CDATA[<pre>PHP_ParserGenerator Bug
Reported by r0vert
2007-07-19T19:24:21+00:00
PHP: Irrelevant OS:  Package Version: CVS

Description:
------------
If using @X for the code of a rule it should be use the token number instead of the token value.


Test script:
---------------
match ::= TYPE(A) TEXT(T). { doSomething(@X, T) }

Expected result:
----------------
doSomething($this-&gt;yystack[$this-&gt;yyidx + -1]-&gt;major, $this-&gt;yystack[$this-&gt;yyidx + 0]-&gt;minor)

Actual result:
--------------
doSomething($this-&gt;yystack[$this-&gt;yyidx + -1]-&gt;minor, $this-&gt;yystack[$this-&gt;yyidx + 0]-&gt;minor)</pre>]]></content:encoded>
      <description><![CDATA[<pre>PHP_ParserGenerator Bug
Reported by r0vert
2007-07-19T19:24:21+00:00
PHP: Irrelevant OS:  Package Version: CVS

Description:
------------
If using @X for the code of a rule it should be use the token number instead of the token value.


Test script:
---------------
match ::= TYPE(A) TEXT(T). { doSomething(@X, T) }

Expected result:
----------------
doSomething($this-&gt;yystack[$this-&gt;yyidx + -1]-&gt;major, $this-&gt;yystack[$this-&gt;yyidx + 0]-&gt;minor)

Actual result:
--------------
doSomething($this-&gt;yystack[$this-&gt;yyidx + -1]-&gt;minor, $this-&gt;yystack[$this-&gt;yyidx + 0]-&gt;minor)</pre>]]></description>
      <dc:date>2007-08-20T14:08:16+00:00</dc:date>
      <dc:creator>rovert &amp;#x61;&amp;#116; wowway &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>PHP_ParserGenerator Bug</dc:subject>
    </item>
</rdf:RDF>
