PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » PHP » PHP_ParserGenerator

translate grammar files in Lemon Parser Generator format into a PHP 5 parser

This package is unmaintained.

Download latest release 0.1.7 (archived versions might be outdated)

License: New BSD License

Description

Translate a grammar file in the lemon parser generator format
into a PHP 5-based parser

There are a few PHP-specific changes to the lemon parser generator.

- %extra_argument is removed, as class constructor can be used to
pass in extra information
- %token_type and company are irrelevant in PHP, and so are removed
- %declare_class is added to define the parser class name and any
implements/extends information
- %include_class is added to allow insertion of extra class information
such as constants, a class constructor, etc.

Other changes make the parser more robust, and also make reporting
syntax errors simpler. Detection of expected tokens eliminates some
problematic edge cases where an unexpected token could cause the parser
to simply accept input.

Otherwise, the file format is identical to the Lemon parser generator

Maintainers

Dependencies

Required

Releases

Bugs

IDStatusTypeVersionDateSummary
#9345ClosedBugCVS2006-11-15help output broken
#9346ClosedBugCVS2006-11-15lots of PHP warnings instead of syntax error
#9893BogusBugCVS2007-01-20dirname(__FILE__) should not be used for include/require
#10245ClosedBug0.1.42007-03-02if multiple RHS identifiers are the same, no error
#10260ClosedBug0.1.42007-03-04exception instead of helpful error message
#10685ClosedBug0.1.52007-04-11fatal error when calling "phplemon --help"
#11361ClosedReq0.1.52007-06-19better help message
#11645ClosedBugCVS2007-07-19unused rhs labels undetected
#11647AssignedBugCVS2007-07-19substitution of @X works incorrectly
#12652ClosedBug0.1.52007-12-10Generated ParseryyToken class has broken __toString()
#12730ClosedBug0.1.52007-12-19Generated Parser destructor *can* loop forever
#13416ClosedReqCVS2008-03-17Provide an option to choose the parser template file
#14781ClosedBug0.1.52008-10-12Will not show options
#16703ClosedBug0.1.52009-10-15terminals starting with Z letter cause problems
#17193ClosedBug0.1.52010-03-04Forgot $this-> on ParserGenerator.php:265
#17374No FeedbackBug2010-05-06yy_get_expected_tokens() returns incomplete list
#17375No FeedbackBug0.1.62010-05-06yy_get_expected_tokens() destroys state
#17381ClosedBug0.1.62010-05-07infinite loop in __destruct of generated parser
#17382ClosedBug0.1.62010-05-07Empty action causes undefined function
#17710OpenReqSVN2010-08-16Reduce the PHPCS errors and warnings
#17825ClosedBugSVN2010-08-26patch: Code-style fixes
#17841OpenBug0.1.62010-09-02Bugs in PHP-grammar
#18263OpenBug0.1.72011-02-11Infinite loop on syntax error when using recursive grammar rules