Home » PHP » PHP_Parser
A PHP Grammar Parser
This package is unmaintained.
Download latest release 0.2.2 (archived versions might be outdated)
License: PHP License
Description
PHP_Parser is a source code analysis tool based around a real Parser
generated by PHP_ParserGenerator. The parser uses the same EBNF source that PHP
uses to parse itself, modified for Lemon parser format, and it therefore as robust
as PHP itself.
This version has full support for parsing out every re-usable element
in PHP as of PHP 6:
- classes
- abstract classes
- inheritance, implements
- interfaces
- methods
- any thrown or caught exception
- static variables declared
- global and superglobal ($_GET) variables used
and declared
- any class names used in any context
- any functions called
- any $this->var or class::$var
- any $this->method or class::method() or class::$method()
- variables
- constants
- functions (same information as methods minus $this->/self::/parent:: information)
- defines
- global variables (with help of PHP_Parser_DocblockParser)
- superglobal variables used in global code
- include statements
The output can be customized to return an array, return
objects of user-specified classes, and can also be
customized to publish each element as it is parsed, allowing
hooks into parsing to catch information.
Maintainers
- Greg Beaver (cellog) — lead, active
- Alan Knowles (alan_k) — developer, inactive
Dependencies
Required
- PHP (>= 5.1.0)
- PEAR Installer (>= 1.4.3)
Optional
Releases
- 0.2.2 (alpha, 2010-10-25)
Release notes
License: PHP License
Automatically built QA release
Bug #17671 The PHP_Parser_CoreyyToken bad __toString method - jespino - 0.2.1 (alpha, 2007-06-17)
Release notes
License: PHP License
* fix Bug #11174: Parser.php installed to root of PEAR directory [cellog]
- 0.2.0 (alpha, 2007-03-05)
Release notes
License: PHP License
Third development release.
**All backwards compatibility is broken**
Now that PHP_ParserGenerator exists, this can be used as a
way to generate specific parsers. This parser is customized for
usage in meta-data extraction, and requires PHP 5.0.0 or newer - 0.1 (devel, 2003-10-22)
Release notes
License: PHP License
Initial development release. Not even alpha yet.
This release is only to show people the beginnings of the project. Tons of
things will change internally.
Bugs
| ID | Status | Type | Version | Date | Summary |
|---|---|---|---|---|---|
| #4148 | Closed | Bug | 2005-04-14 | debug statement in Parser/Core.php | |
| #4305 | Closed | Bug | 2005-05-08 | PHP5 tokens not handled | |
| #5115 | Closed | Bug | 2005-08-16 | Visibility modifiers in method declaration throws parse error | |
| #5461 | Closed | Bug | 2005-09-19 | Warning on Tokenizer.php line 453 with PHP 5.1RC1 | |
| #11174 | Closed | Bug | 0.2.0 | 2007-05-29 | Parser.php installed to root of PEAR directory |
| #11316 | Open | Req | 0.2.0 | 2007-06-14 | 'doc' will set null when an doc-comment placed before the declaretion |
| #13092 | Verified | Bug | 0.2.1 | 2008-02-09 | $lastcom undefined in Core.y line 1085 |
| #13224 | Closed | Bug | 0.2.1 | 2008-02-26 | Bad XML Tags in Tutorial Source |
| #13998 | Open | Bug | 0.2.1 | 2008-05-27 | Parser tries to parse pass '__halt_compiler()' directive |
| #14881 | Duplicate | Bug | CVS | 2008-10-26 | Notice: Undefined variable: lastcom |
| #17671 | Closed | Bug | SVN | 2010-08-08 | The PHP_Parser_CoreyyToken bad __toString method |
| #19980 | Open | Bug | 2013-06-17 | missing deps |