awesome-repositories.com
Blog
awesome-repositories.com

Découvrez les meilleurs dépôts open-source grâce à notre recherche par IA.

ExplorerRecherches sélectionnéesOpen-source alternativesSelf-hosted softwareBlogPlan du site
ProjetÀ proposHow we rankPresseServeur MCP
Mentions légalesConfidentialitéConditions d'utilisation
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
nikic avatar

nikic/PHP-Parser

0
View on GitHub↗
17,437 stars·1,123 forks·PHP·BSD-3-Clause·4 vues

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.

Historique des stars

Graphique de l'historique des stars pour nikic/php-parserGraphique de l'historique des stars pour nikic/php-parser

Recherche par IA

Explorez plus de dépôts awesome

Décrivez vos besoins en langage naturel — l'IA classe des milliers de projets open source sélectionnés par pertinence.

Start searching with AI

Frequently asked questions

What does nikic/php-parser do?

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.

What are the main features of nikic/php-parser?

The main features of nikic/php-parser are: PHP AST Parsers, Static Code Analysis, Recursive Descent Parsers, AST Structure Modification, AST to Source Conversion, PHP Development Tools, Lexical Tokenizers, PHP Code Generators.

What are some open-source alternatives to nikic/php-parser?

Open-source alternatives to nikic/php-parser include: 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…

Alternatives open source à PHP Parser

Projets open source similaires, classés selon le nombre de fonctionnalités partagées avec PHP Parser.
  • facebook/jscodeshiftAvatar de facebook

    facebook/jscodeshift

    9,952Voir sur 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
    Voir sur GitHub↗9,952
  • apple/swift-syntaxAvatar de apple

    apple/swift-syntax

    3,671Voir sur 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
    Voir sur GitHub↗3,671
  • jquery/esprimaAvatar de jquery

    jquery/esprima

    7,139Voir sur 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
    Voir sur GitHub↗7,139
  • theseer/tokenizerAvatar de theseer

    theseer/tokenizer

    5,194Voir sur 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
    Voir sur GitHub↗5,194
  • Voir les 30 alternatives à PHP Parser→