Categorygithub.com/stephens2424/php
repository
0.0.0-20221016015411-47ce07ac712d
Repository: https://github.com/stephens2424/php.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# README

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

FeatureStatus
Lexer and Parsermostly complete. there are probably a few gaps still
Scopingcomplete for simple cases. probably some gaps still, most notably that conditional definitions are treated as if they are always defined
Code search and symbol lookupbasic idea implemented, many many details missing
Code formattingbasic idea implemented, formatting needs to narrow down to PSR-2
Transpilation to Gobasic idea implemented, need follow through with more node types
Type inferencingnot begun
Dead code analysisbasic idea implemented, but only for some types of code. Also, this suffers from the same caveats as scoping

Project Components

DirectoryDescription
php/ast(abstract syntax tree) describes the nodes in PHP as parsed by the parser
php/ast/printerprints an ast back to source code
php/cmda tool used to debug the parser
php/lexerreads a stream of tokens from source code
php/parserthe core parser
php/passestools and packages related to modifying or analyzing PHP code (heavily a work in progress)
php/passes/togotranspiler
php/passes/deadcodedead code analyzer
php/querytools and packages related to analyzing and finding things in PHP code (heavily a work in progress)
php/testdatasimple examples of PHP that must parse with no errors for tests to pass
php/tokendescribes the tokens read by the lexer