Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.1.7

Bug #16703 terminals starting with Z letter cause problems
Submitted: 2009-10-15 22:57 UTC
From: taras Assigned: taras
Status: Closed Package: PHP_ParserGenerator (version 0.1.5)
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    

 [2009-10-15 22:57 UTC] taras (Taras Kostyk)
Description: ------------ Terminals starting with Z letter are not created and could block creation of other terminals. Result could be: Fatal error: Uncaught exception 'Exception' with message 'state has no actions associated' in E:\xampp\php\PEAR\PHP\ParserGenerator\Data.php:669 Stack trace: #0 E:\xampp\php\PEAR\PHP\ParserGenerator.php(502): PHP_ParserGenerator_Data->FindActions() or while testing parser together with lexer generated by PHP_LexerGenerator , some constants could not be seen (constants representing not created terminals): ------------------------------- Parsing ------------------------------- Fatal error: Undefined class constant ... Logical error is in line 474 in file ParserGenerator.php for($i = 1; ord($lem->symbols[$i]->name[0]) < ord ('Z'); $i++); should be: for($i = 1; ord($lem->symbols[$i]->name[0]) <= ord ('Z'); $i++); Test script: --------------- grammar in file .y /* The common stuff */ start(res) ::= expr. expr ::= A. expr ::= Z. expr ::= B. expr ::= C. expr ::= D. Expected result: ---------------- should create in parser class constants const TP_A = 1; const TP_Z = 1; const TP_B = 1; const TP_C = 1; const TP_D = 1; Actual result: -------------- creates parser class with such constants: const TP_A = 1;


 [2009-10-15 23:02 UTC] taras (Taras Kostyk)
sorry, line number is 472 not 474
 [2010-08-08 20:59 UTC] jespino (Jesús Espino)
-Status: Open +Status: Closed -Assigned To: +Assigned To: jespino
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. I applied the solution proposed by the reporter.
 [2010-08-14 18:14 UTC] jespino (Jesús Espino)
-Assigned To: jespino +Assigned To: taras