awesome-repositories.com
博客
awesome-repositories.com

通过 AI 驱动的搜索,发现最优秀的开源仓库。

探索精选搜索开源替代品自托管软件博客网站地图
项目关于排名机制媒体报道MCP 服务器
法律隐私政策服务条款
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
nikic avatar

nikic/PHP-Parser

0
View on GitHub↗
17,437 星标·1,123 分支·PHP·BSD-3-Clause·7 次浏览

PHP Parser

PHP-Parser is a tool that converts PHP source code into an abstract syntax tree for static analysis and programmatic manipulation. It functions as a parser, a code generator, and a static analysis framework.

The project enables the programmatic construction of abstract syntax tree nodes through a fluent interface and provides the ability to transform these trees back into formatted source code. It includes a serializer that exports abstract syntax trees to JSON format and reconstructs them from strings.

The toolset covers several capability areas, including namespace resolution, constant expression evaluation, and the traversal or modification of tree nodes using visitor patterns. These features support a range of language tooling tasks such as automated refactoring, code transformation, and the enforcement of coding standards.

Features

  • PHP AST Parsers - Converts PHP source code into an abstract syntax tree to enable static analysis and programmatic manipulation of the code structure.
  • Static Code Analysis - Provides a comprehensive framework for analyzing PHP source code to detect bugs and enforce standards.
  • Recursive Descent Parsers - Uses a recursive descent parsing strategy to translate PHP tokens into a structured abstract syntax tree.
  • AST Structure Modification - Allows for identifying, altering, or removing nodes within the AST using visitor patterns.
  • AST to Source Conversion - Transforms an abstract syntax tree back into formatted PHP source code.
  • PHP Development Tools - Provides the fundamental building blocks for creating PHP linters, formatters, and other language tools.
  • Lexical Tokenizers - Processes source text through a lexer that emits a sequential stream of tokens for the parser.
  • PHP Code Generators - Constructs AST nodes and transforms them back into formatted PHP source code.
  • PHP Parsers - Converts PHP source code into an abstract syntax tree for static analysis and manipulation.
  • Symbol Resolution - Analyzes the abstract syntax tree to determine the fully qualified names of classes, functions, and constants.
  • Abstract Syntax Tree Specifications - Provides a standardized internal representation of PHP source code as a hierarchy of linguistic construct nodes.
  • Visitor Patterns - Decouples tree structure from analysis logic using a visitor-based traversal pattern.
  • JSON Serialization Libraries - Converts PHP abstract syntax tree objects to and from JSON format.
  • AST Node Generation - Provides utilities for the programmatic creation of structurally valid AST nodes.
  • JSON Serialization - Serializes abstract syntax trees into JSON format and reconstructs them back into tree structures.
  • Compile-Time Expression Evaluation - Computes the final values of constant expressions and initializers during the analysis phase.
  • Fluent Interface Patterns - Implements a fluent interface for the programmatic construction of complex abstract syntax tree structures.
  • Refactoring Automation - Automates structural changes by searching and replacing specific patterns within the PHP AST.
  • Source Code Transformation Engines - Enables automated modification of PHP code by transforming it through an AST.
  • Source Code Generators - Programmatically creates valid PHP files by building an abstract syntax tree.
  • Abstract Syntax Tree Tools - Provides utilities for serializing and manipulating PHP abstract syntax trees.
  • Fault-Tolerant Parsing - Converts source code into an abstract syntax tree with support for partial trees when encountering invalid syntax.
  • Static Expression Evaluation - Computes the values of constant and property initializers within the code during the analysis phase.
  • Code Analysis and Refactoring - Parses source code into an abstract syntax tree.
  • Static Analysis Tools - PHP parser written in PHP.

Star 历史

nikic/php-parser 的 Star 历史图表nikic/php-parser 的 Star 历史图表

AI 搜索

探索更多 awesome 仓库

用简单的语言描述您的需求 —— AI 将根据相关性为您从数千个精选开源项目中进行排序。

Start searching with AI

PHP Parser 的开源替代方案

相似的开源项目,按与 PHP Parser 的功能重合度排序。
  • facebook/jscodeshiftfacebook 的头像

    facebook/jscodeshift

    9,952在 GitHub 上查看↗

    jscodeshift is a JavaScript AST transformation toolkit and codemod engine designed for large-scale code refactoring and structural migrations. It provides a set of utilities to parse source code into abstract syntax trees, programmatically modify those trees, and convert them back into source text. The tool distinguishes itself by preserving original source formatting and stylistic properties during the transformation process. It utilizes a builder for generating structurally valid AST nodes and integrates interchangeable parsing engines to support different language standards and experimenta

    JavaScript
    在 GitHub 上查看↗9,952
  • apple/swift-syntaxapple 的头像

    apple/swift-syntax

    3,671在 GitHub 上查看↗

    swift-syntax is a library for parsing, manipulating, and generating Swift source code. It provides a source-accurate abstract syntax tree representation of Swift code, acting as a parser, transformer, and code generator. The project serves as the infrastructure for Swift macro development, enabling the expansion and transformation of source code during compilation. It is used to build compiler tooling for static analysis, formatting, and automated refactoring. The system covers a broad range of source analysis capabilities, including the ability to convert source code into structured trees f

    Swift
    在 GitHub 上查看↗3,671
  • jquery/esprimajquery 的头像

    jquery/esprima

    7,139在 GitHub 上查看↗

    Esprima is a JavaScript parser that converts source code into a structured abstract syntax tree. It implements a specification-driven grammar to ensure compliance with ECMAScript standards, enabling the programmatic analysis and transformation of JavaScript programs. The project provides capabilities for lexical tokenization to break source code into individual symbols and static syntax validation to verify that scripts are well-formed without executing the code. Its functional surface covers JavaScript static analysis, lexical analysis, and the generation of abstract syntax trees.

    TypeScript
    在 GitHub 上查看↗7,139
  • theseer/tokenizertheseer 的头像

    theseer/tokenizer

    5,194在 GitHub 上查看↗

    This library is a PHP source code tokenizer and static analysis tool that converts raw PHP code into discrete tokens and structured XML representations. It functions as a serializer that transforms token streams into a machine-readable format for programmatic analysis and source tree manipulation. The project uses stream-based XML serialization and fragment-based buffer writing to maintain low memory overhead when processing large files. It allows for custom XML namespace configuration to ensure schema compatibility and avoid naming collisions during the transformation process. The toolkit c

    PHPphptokenizerxml
    在 GitHub 上查看↗5,194
查看 PHP Parser 的所有 30 个替代方案→

常见问题解答

nikic/php-parser 是做什么的?

PHP-Parser is a tool that converts PHP source code into an abstract syntax tree for static analysis and programmatic manipulation. It functions as a parser, a code generator, and a static analysis framework.

nikic/php-parser 的主要功能有哪些?

nikic/php-parser 的主要功能包括:PHP AST Parsers, Static Code Analysis, Recursive Descent Parsers, AST Structure Modification, AST to Source Conversion, PHP Development Tools, Lexical Tokenizers, PHP Code Generators。

nikic/php-parser 有哪些开源替代品?

nikic/php-parser 的开源替代品包括: facebook/jscodeshift — jscodeshift is a JavaScript AST transformation toolkit and codemod engine designed for large-scale code refactoring… apple/swift-syntax — swift-syntax is a library for parsing, manipulating, and generating Swift source code. It provides a source-accurate… jquery/esprima — Esprima is a JavaScript parser that converts source code into a structured abstract syntax tree. It implements a… theseer/tokenizer — This library is a PHP source code tokenizer and static analysis tool that converts raw PHP code into discrete tokens… rectorphp/rector — Rector is an automated PHP refactoring and modernization tool designed to upgrade language versions and modernize… phpdocumentor/reflectiondocblock — ReflectionDocBlock is a PHP docblock parser and doc-comment metadata extractor. It functions as a reflection wrapper…