Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 1.92 KB

README.md

File metadata and controls

38 lines (28 loc) · 1.92 KB

php

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 these pieces are quite useable and haven't seen more than minor changes for a while. They do have notable gaps, though (e.g. namespaces)
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
Scoping not begun
Type inferencing not begun
Dead code analysis not begun

Project Components

  • php: the core parser
  • 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/passes: tools and packages related to modifying or analyzing PHP code (heavily a work in progress)
  • php/query: tools and packages related to analyzing and finding things in PHP code (heavily a work in progress)
  • php/testfiles: simple examples of PHP that must parse with no errors for tests to pass
  • php/token: describes the tokens read by the lexer