定制 tsufeki/php-lenient-parser 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tsufeki/php-lenient-parser

Composer 安装命令:

composer require tsufeki/php-lenient-parser

包简介

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

关键字:

README 文档

README

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.

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

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

Installation

The preferred installation method is composer:

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

Usage

Use the factory to get an instance of parser:

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

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

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

Created parser is a drop-in replacement for php-parser.

Do not instantiate LenientParser directly, use the factory.

Info

At the moment parsing of PHP 5 is not supported, only PHP 7.

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

License

Same as php-parser, BSD - see LICENCE.

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

统计信息

  • 总下载量: 2.18k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 3
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2016-06-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固