Skip to content

Commit ead2eb2

Browse files
committed
Add survey of other PHP parser libraries
PHP-PEG (packrat memo overhead), Hoa\Compiler (grammar interpreter), Phlexy (lexer-only). None likely to beat the optimized parser.
1 parent 85476a7 commit ead2eb2

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

  • experiments/other-php-parser-libs
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Other PHP parser libraries: PHP-PEG, Hoa\Compiler, Phlexy (literature)
2+
3+
**Status:** literature/reasoning, not benchmarked. No code.
4+
5+
**Assessment:**
6+
- PEG/packrat parsers in PHP (e.g. PHP-PEG) carry memo-store overhead that makes
7+
them slower than a tuned hand-written recursive descent.
8+
- `Hoa\Compiler` is itself a `.pp`-grammar interpreter — the same architecture as
9+
this parser — and slower in practice (it's LL(k), not packrat).
10+
- `Phlexy` (nikic) is lexer-only, and the lexer isn't the bottleneck.
11+
12+
**Verdict:** none of these is likely to beat the current optimized parser; not worth
13+
adopting.

0 commit comments

Comments
 (0)