Giter Club home page Giter Club logo

php's Introduction

php

Archived: This project only supported PHP 5, and never matured beyond a basic parser and AST visualizer. Since I lost interest, it has fallen into disrepair, beyond the more conventional bugs.


Parser for PHP written in Go

See this post for an introduction.

Build Status GoDoc

Test console:

console

Project Status

This project is under heavy development, though some pieces are more or less stable. Listed here are components that in progress or are ideas for future development

Feature Status
Lexer and Parser mostly complete. there are probably a few gaps still
Scoping complete for simple cases. probably some gaps still, most notably that conditional definitions are treated as if they are always defined
Code search and symbol lookup basic idea implemented, many many details missing
Code formatting basic idea implemented, formatting needs to narrow down to PSR-2
Transpilation to Go basic idea implemented, need follow through with more node types
Type inferencing not begun
Dead code analysis basic idea implemented, but only for some types of code. Also, this suffers from the same caveats as scoping

Project Components

Directory Description
php/ast (abstract syntax tree) describes the nodes in PHP as parsed by the parser
php/ast/printer prints an ast back to source code
php/cmd a tool used to debug the parser
php/lexer reads a stream of tokens from source code
php/parser the core parser
php/passes tools and packages related to modifying or analyzing PHP code (heavily a work in progress)
php/passes/togo transpiler
php/passes/deadcode dead code analyzer
php/query tools and packages related to analyzing and finding things in PHP code (heavily a work in progress)
php/testdata simple examples of PHP that must parse with no errors for tests to pass
php/token describes the tokens read by the lexer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.