2017 © Pedro Peláez
 

library php-lenient-parser

A PHP parser written in PHP, handles partial/illegal input

image

tsufeki/php-lenient-parser

A PHP parser written in PHP, handles partial/illegal input

  • Friday, May 4, 2018
  • by tsufeki
  • Repository
  • 2 Watchers
  • 0 Stars
  • 328 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 25 % Grown

The README.md

PHP Lenient Parser

This is a PHP 7 parser written in PHP. It handles some partial and illegal code, producing best-effort partial syntax tree. Its purpose is to simplify static code analysis and manipulation., (*1)

It's error reporting is not complete though, i.e. it may silently accept illegal PHP input., (*2)

As this is just a parser replacement for PHP Parser, go there for actual documentation., (*3)

Installation

The preferred installation method is composer:, (*4)

php composer.phar require tsufeki/php-lenient-parser

Usage

Use the factory to get an instance of parser:, (*5)

$parser = (new LenientParserFactory())->create();

Or provide your own lexer and options (no options are supported at the moment though):, (*6)

$parser = (new LenientParserFactory())->create(LenientParserFactory::ONLY_PHP7, $lexer, $options);

Created parser is a drop-in replacement for php-parser., (*7)

Do not instantiate LenientParser directly, use the factory., (*8)

Info

At the moment parsing of PHP 5 is not supported, only PHP 7., (*9)

Internally, the parser is implemented as a Pratt parser (also called "Top down operator precedence parser")., (*10)

License

Same as php-parser, BSD - see LICENCE., (*11)

Test suite and CLI script (below bin/, test/ and test_old/) are borrowed from php-parser and modified., (*12)

The Versions

04/05 2018

dev-master

9999999-dev

A PHP parser written in PHP, handles partial/illegal input

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Avatar tsufeki

parser php

04/05 2018

0.1.2

0.1.2.0

A PHP parser written in PHP, handles partial/illegal input

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Avatar tsufeki

parser php

31/01 2018

0.1.1

0.1.1.0

A PHP parser written in PHP, handles partial/illegal input

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Avatar tsufeki

parser php

11/05 2017

0.1.0

0.1.0.0

A PHP parser written in PHP, handles partial/illegal input

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Avatar tsufeki

parser php