30 open-source projects similar to nikic/php-parser, ranked by how many features they have in common. Compare stars, activity and what each one does to find the best PHP Parser alternative.
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
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.
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
Rector is an automated PHP refactoring and modernization tool designed to upgrade language versions and modernize syntax using predefined rules. It functions as a static analysis engine that inspects code structures and types to identify refactoring targets without executing the code. The project provides a framework for defining custom transformation logic to automate project-specific changes. It distinguishes itself by offering specialized capabilities for migrating legacy or custom frameworks to modern alternatives and converting docblock annotations into native language attributes. The s
ReflectionDocBlock is a PHP docblock parser and doc-comment metadata extractor. It functions as a reflection wrapper that extends the standard PHP Reflection API to convert raw documentation blocks into structured objects. The library provides tools for PHP documentation parsing and reflection tooling. It enables the extraction of structured metadata and annotations from reflection objects or raw doc-comment strings to support automated API documentation and static code analysis.
JavaParser is a library that parses Java source code up to version 12 into an Abstract Syntax Tree (AST), enabling programmatic analysis, transformation, and generation of Java code. It serves as a parser, code analyzer, code generator, comment parser, and symbol resolver, providing a unified toolkit for working with Java source at the AST level. The library distinguishes itself through several integrated capabilities that go beyond basic parsing. It includes a symbol resolution engine that resolves type and symbol references across files for accurate semantic analysis, and an error-recovery
Credo is a static analysis tool and linter for Elixir. It functions as a code quality analyzer that scans source code to identify stylistic inconsistencies, common mistakes, and potential security vulnerabilities. The tool provides a customizable framework for defining and testing specialized rules to enforce project-specific coding standards. It identifies complex code fragments and duplication to highlight opportunities for refactoring and simplification. Its capabilities cover automated code reviews, the enforcement of Elixir coding standards, and real-time developer feedback through edit
GrumPHP is a Git commit validator and PHP code quality orchestrator. It functions as a Git hook manager that automates the installation and execution of script triggers to enforce code quality standards within PHP projects. The tool prevents non-compliant code from being committed by running a suite of validation and linting tasks during the Git workflow. It integrates automated quality checks directly into the local development environment to maintain project standards. The system manages pre-commit testing workflows by executing quality tests and automating Git hooks. It uses a task-based
google-java-format is a Java code formatter and style enforcement tool. It reformats Java source code to adhere to a standardized style guide, ensuring consistent layout and indentation across entire projects or individual files. The project functions as a build pipeline linting tool for continuous integration workflows and as an IDE formatting plugin to replace native editor formatting. It can be embedded as a formatting library within code generation software to ensure machine-written output remains human-readable. The tool provides capabilities for reorganizing source code indentation and
PHP_CodeSniffer is a static analysis tool, coding standard linter, and command-line validator for PHP. It scans files and directories to detect and report formatting errors and language-specific coding violations without executing the code. The project functions as an automated code formatter capable of correcting detected style and formatting violations to bring source code into compliance with defined standards. It uses token-based lexical analysis to match code patterns against rule sets, ensuring consistency across a codebase. The tool provides comprehensive capabilities for recursive fi
JSHint is a JavaScript static analysis tool and linter designed to detect errors and enforce coding standards. It functions as a syntax validator that scans source code to identify potential logic problems and programming mistakes before the code is executed. The tool provides a command line interface for analyzing files and directories. It supports the export of analysis results into standardized formats such as Checkstyle for integration with external build tools. Analysis is managed through a system of linting rule management and environment global configuration. This includes the ability
ESTree is a formal schema and set of object interfaces used to represent JavaScript source code as a standardized abstract syntax tree. It serves as a common tree format and parser standard to ensure interoperability between different JavaScript parsers and transformation tools. The specification provides a consistent way to model language constructs, including statements, expressions, and module declarations. It includes detailed representations for modern language features such as classes, private identifiers, and short-circuiting logic like nullish coalescing and optional chaining. The pr
This project is a C language interpreter and a practical implementation of a programming language. It parses and executes C source code directly, removing the requirement for a separate compilation step. The interpreter is designed for self-hosting, meaning it is capable of interpreting its own source code to demonstrate recursive language processing and execution. The system covers the primary stages of language processing, including lexical analysis, recursive descent parsing, and tree-walk interpretation using an abstract syntax tree. It manages memory and scope through a dynamic symbol t
Bhai-lang is a TypeScript-based toy programming language and custom syntax interpreter. It functions as an educational language implementation designed to demonstrate core concepts of variable management, conditional logic, and execution flow. The project provides a custom command line interface and an interactive code playground for writing and testing scripts. It serves as a framework for programming language prototyping, allowing for the definition of custom syntax and execution logic. The system covers the full interpreter pipeline, including lexical analysis, recursive descent parsing,
Acorn is a JavaScript parser that converts source text into a structured abstract syntax tree. It follows the ESTree specification to produce a standardized JSON tree format, enabling consistent analysis of code structure and language versions. The project features a plugin-based grammar extension system that allows the base parser to be extended with custom rules for experimental or non-standard language features. It also includes syntax error recovery, which inserts placeholder nodes into the tree when encountering invalid code to allow parsing to continue. The toolset covers static analys
RuboCop is a static code analyzer and linter for Ruby. It functions as a static analysis tool designed to detect potential bugs, identify style violations, and improve overall code quality in Ruby projects. The project provides an automated code formatter that rewrites source code to align with established community standards. It also implements a language server protocol to surface linting and formatting errors directly within text editors. Its capabilities cover automated code linting and the analysis of Ruby code style to ensure consistency across a project. These functions are driven by
pycparser is a C99 parser library that converts C source code into an abstract syntax tree consisting of Python objects. It functions as an abstract syntax tree generator, transforming preprocessed C code into a structured hierarchy for programmatic analysis and transformation. The library integrates with a C preprocessor to handle directives before parsing. It also features a stub header parser, which uses minimal mock headers to allow the parsing of C code without requiring a full system C library installation. The project provides tools for static code analysis, C program analysis, and so
ts-morph is a TypeScript AST manipulation library and a high-level wrapper for the TypeScript compiler API. It provides a programmatic interface for analyzing, modifying, and generating TypeScript source code, serving as a tool for automated code refactoring and source code generation. The library simplifies the process of navigating and inspecting project structures by offering an object-oriented abstraction over the underlying compiler API. It allows for the programmatic transformation of existing codebases to automate structural updates and bulk code migrations. Its capabilities cover sta
Checkstyle is a Java static analysis tool and linter designed to identify and enforce coding standards and best practices. It functions as a code quality auditor and Javadoc validation tool, checking source code against configurable rulesets to ensure structural and stylistic consistency. The project allows for the creation of custom linting rules by extending a core API to inspect the abstract syntax tree. It further enables specialized validation through the use of XPath expressions to query the syntax tree for specific code patterns and violations. Capability areas include the enforcement
Pylint is a static code analysis tool for Python that checks source code for errors, coding standard violations, and code smells without executing the program. It parses code into an abstract syntax tree and walks the tree to detect issues, enforces configurable style rules and naming conventions, and identifies duplicate code blocks by comparing tokenised source sequences. The tool also includes an inference engine that deduces variable types by simulating code paths, enabling deeper analysis even in untyped code. What distinguishes Pylint is its plugin-based checker architecture, which allo
This project is a regular expression lexer library and lexical analysis engine used to break input strings into typed token streams. It serves as a foundational component for constructing compilers or interpreters by identifying and categorizing substrings into discrete tokens. The library provides a token stream navigator featuring a cursor-based interface. This allows for sequential traversal of tokenized input and non-destructive lookahead, enabling the inspection of future tokens without advancing the internal position pointer. It includes specific support for recursive descent parsing t
Recast is a JavaScript AST parser and printer designed for automated code refactoring. It converts source code into abstract syntax trees that can be modified and then printed back into source code. The project focuses on formatting-preserving transformations, storing original whitespace and indentation metadata within syntax tree nodes to reconstruct code without losing its original layout. It also generates character-level source maps to maintain precise correspondences between original input and transformed output. The toolkit includes utilities for syntax tree manipulation using a visito
UglifyJS2 is a suite of tools designed for parsing, beautifying, mangling, and minifying JavaScript code. It functions by converting source code into an abstract syntax tree to enable programmatic analysis and transformation, and it includes a dedicated generator for creating associated source maps. The project optimizes web production builds by compressing script logic and removing unreachable code. It utilizes name mangling to shorten variable and property names and implements a beautifier to reconstruct compressed scripts into a human-readable layout. The toolset covers broad capability a
JavaPoet is a source code generator and metaprogramming utility for the Java language. It functions as an abstract syntax tree construction library that allows developers to model classes, methods, and fields as objects before emitting them as source code. The library distinguishes itself through automatic import management and code formatting. It tracks referenced types to generate required import statements and handles line wrapping, semicolon placement, and indentation to ensure generated files remain readable. The tool covers a broad range of generation capabilities, including the defini
go-tools is a collection of utilities for Go static analysis and memory layout optimization. It provides a toolset designed to analyze source code to detect bugs and dead code, alongside specialized tools for optimizing how structs are arranged in memory. The project includes a memory alignment visualizer to display physical memory layouts and padding, as well as a struct layout optimizer that reorders fields to minimize memory padding. Additionally, it provides a boilerplate generator to automate the creation of registration and test files required for developing custom Go analyzers. The to
Flake8 is a Python style checker and static analysis tool that identifies programmatic errors and violations of coding standards in source files. It serves as a linting wrapper that aggregates multiple checkers into a single interface, functioning as a pluggable framework for Python code analysis. The tool incorporates a cyclomatic complexity analyzer to measure the logical complexity of functions and identify code that requires refactoring. It is designed for extensibility, allowing the integration of custom plugins and rules through defined entry points. The system provides capabilities fo
NullAway is a Java static analysis tool and build-time detector designed to identify null pointer risks. It functions as a nullability checker that uses annotations to verify that references are not null before they are dereferenced, preventing runtime crashes. The analyzer implements the JSpecify standard to ensure consistent nullability annotations across different Java libraries. It distinguishes itself through the use of a service provider interface to model the nullability behavior of third-party libraries that lack source annotations and by providing specialized support for Lombok-gener
This is a static analysis linter and code quality tool for Go. It analyzes source code to identify common coding errors, style mistakes, and inconsistencies with language conventions. The tool is designed for integration with text editors and integrated development environments, exporting linting results in formats that support quickfix menus. Its capabilities include Go static analysis and source code quality assurance across files and packages. The system utilizes a static analysis pipeline and rule-based pattern matching to identify structural patterns that violate predefined coding stand
This project is a static analysis engine and type checker designed for PHP codebases. It evaluates source code structure and type annotations to identify potential bugs, type mismatches, and logic errors without executing the application. By parsing code into an abstract syntax tree and applying a rule-based validation framework, it enforces code quality and safety standards across a project. What distinguishes this tool is its sophisticated type inference engine, which models dynamic language features, magic methods, and conditional types to maintain accuracy even in unconventional code. It
This project is a comprehensive manual and educational resource focused on the Babel compiler. It serves as a documentation guide and handbook for understanding the inner workings of JavaScript compilation, specifically regarding the transformation of source code. The material provides a technical walkthrough for developing custom plugins and extensions. It covers the process of creating tailored transformations to modify how JavaScript is parsed and generated. The content encompasses the broader JavaScript compilation workflow, focusing on abstract syntax tree manipulation, code generation,