Home » PHP » PHP_LexerGenerator
translate lexer files in lex2php format into a PHP 5 lexer
This package is unmaintained.
Download latest release 0.4.0 (archived versions might be outdated)
License: New BSD License
Description
Translate a lexer file with a format similar to re2c (http://re2c.org)
into a PHP 5 lexer for use with a parser.
Unlike re2c (as of re2c version 0.11), generated lexers are state-aware
out of the box.
Generated lexers are very efficient, more than twice as efficient as other
alternatives like csLex (written in C#) because they utilize PHP's
built-in Perl-compatible regular expressions to lex for tokens.
Now in version 0.3.0+, with processing instruction %longestmatch, generated
lexers will always pick the longest string to match, rather than the first.
Generated lexers are slightly slower, but match behavior of legacy lexers like
flex, lex, re2c.
Maintainers
- Greg Beaver (cellog) — lead, active
Dependencies
Required
- PHP (>= 5.1.0)
- PEAR Installer (>= 1.4.3)
Releases
- 0.4.0 (alpha, 2010-10-25)
Release notes
License: New BSD License
QA release
Request #11914 Single line comments
Request #11917 Faster regexp matching with \G instead of substr()
Bug #11919 Missing spaces in exception messages
Bug #12144 Integrated patch + unit test
Bug #12638 Undefined offset: 0 in PHP/LexerGenerator/Parser.php on line 390
Request #11912 Case-insensitive literal strings - 0.3.4 (alpha, 2007-08-18)
Release notes
License: New BSD License
- fix Bug #11808: yymore broken
- 0.3.3 (alpha, 2007-06-17)
Release notes
License: New BSD License
- fix Bug #11132: calls to substr_count had args in wrong order [urkle]
- 0.3.1 (alpha, 2006-12-15)
- 0.3.0 (alpha, 2006-10-12)
Release notes
License: New BSD License
- fix Bug #9006: wrong replacements for plex script (Hartmut Holzgraefe)
- fix Bug #9007: yymore does not honor return value "true" to change state
- implement Request #8879: lexer not picking longest match - 0.2.3 (alpha, 2006-10-02)
- 0.2.2 (alpha, 2006-08-30)
Release notes
License: New BSD License
- fix Bug #8259: Strange regex generated
- fix Bug #8593: if no statename "const 1=1" inserted - 0.2.1 (alpha, 2006-07-18)
Release notes
License: New BSD License
- allow underscore in subpattern names
- fix documentation for class
- fix bug in regex parsing where backreferences could not have a multiplier
like +, *, or {0,1}
- disallow (?R), this can't work in a multi-regex lexer generator, unfortunately
Bugs
| ID | Status | Type | Version | Date | Summary |
|---|---|---|---|---|---|
| #8259 | Closed | Bug | 0.2.1 | 2006-07-20 | Strange regex generated |
| #8593 | Closed | Bug | 0.2.1 | 2006-08-30 | if no statename "const 1=1" inserted |
| #8618 | Closed | Bug | 0.2.2 | 2006-09-02 | null causes regex to break |
| #8619 | Duplicate | Bug | 0.2.2 | 2006-09-02 | octal detected as backref |
| #8879 | Closed | Req | CVS | 2006-10-06 | lexer not picking longest match |
| #9006 | Closed | Bug | 0.2.3 | 2006-10-12 | wrong replacements for plex script |
| #9007 | Closed | Bug | 0.2.3 | 2006-10-12 | yymore does not honor return value "true" to change state |
| #9211 | Closed | Bug | 0.3.0 | 2006-11-01 | Typos |
| #9230 | Closed | Bug | 0.3.0 | 2006-11-03 | Escape sequences |
| #9231 | Closed | Bug | 0.3.0 | 2006-11-03 | Non-greedy regex extension |
| #9892 | Closed | Bug | CVS | 2007-01-20 | dirname(__FILE__) should not be used for include/require |
| #11132 | Closed | Bug | 0.3.1 | 2007-05-24 | calls to substr_count had args in wrong order |
| #11808 | Closed | Bug | 0.3.3 | 2007-08-09 | yymore broken |
| #11912 | Closed | Req | 0.3.4 | 2007-08-28 | Case-insensitive literal strings |
| #11914 | Closed | Req | 0.3.4 | 2007-08-28 | Single line comments |
| #11916 | Closed | Bug | 0.3.4 | 2007-08-28 | Missing placeholder strings |
| #11917 | Closed | Req | 0.3.4 | 2007-08-28 | Faster regexp matching with \G instead of substr() |
| #11919 | Closed | Bug | 0.3.4 | 2007-08-28 | Missing spaces in exception messages |
| #12144 | Closed | Bug | CVS | 2007-09-29 | Integrated patch + unit test |
| #12564 | Open | Bug | CVS | 2007-12-01 | Unicode support incomplete |
| #12638 | Closed | Bug | 0.3.4 | 2007-12-07 | Undefined offset: 0 in PHP/LexerGenerator/Parser.php on line 390 |
| #13221 | Open | Req | 0.3.4 and CVS | 2008-02-26 | Unescaped hyphen can't be used to express itself in character classes |
| #13222 | Closed | Bug | 0.3.4 | 2008-02-26 | Incorrect enclosing quotes for rules with %matchlongest 1 |
| #13252 | Open | Req | 0.3.4 | 2008-02-28 | Possibility to reuse a rule. |
| #13253 | Bogus | Req | 0.3.4 | 2008-02-28 | Allow use of digits in regexp names. |
| #14731 | Open | Bug | 0.3.4 | 2008-10-02 | $ in regex is interpreted as an reference to variable |
| #16944 | Open | Bug | 0.3.4 | 2009-12-26 | Bug in regexp lookahead |
| #18454 | Open | Bug | 0.4.0 | 2011-04-18 | single quote is not escaped properly in yy_global_pattern |
| #19002 | Closed | Bug | SVN | 2011-11-14 | remove error_reporting (for PEAR QA team) |