2018-02-04 21:35:46 +02:00
2018-01-13 01:58:59 +02:00
2018-02-03 20:13:11 +02:00
2018-02-04 20:55:45 +02:00
2018-02-03 20:13:11 +02:00
2018-01-12 08:23:58 +02:00
2018-01-29 16:11:45 +02:00
2018-01-11 20:49:00 +02:00
2018-02-04 21:35:46 +02:00
2018-01-17 19:01:28 +02:00
2018-01-05 13:22:38 +02:00
2018-01-05 19:49:29 +02:00
2018-01-05 19:37:08 +02:00
2018-01-05 19:23:10 +02:00
2018-01-02 14:37:19 +02:00
2018-02-04 21:35:46 +02:00
2018-01-26 15:24:56 +02:00
2018-02-04 21:35:46 +02:00

PHP-Parser

Go Report Card Exago Exago

A Parser for PHP written in Go inspired by Nikic PHP Parser

Features:

  • Fully support PHP7 syntax (PHP5 in future)
  • Abstract syntax tree representation
  • Traversing AST

Example

package main

import (
	"bytes"

	"github.com/z7zmey/php-parser/php5"
	"github.com/z7zmey/php-parser/visitor"
)

func main() {
	src := bytes.NewBufferString(`<? echo "Hello world";`)
	nodes, comments, positions := php5.Parse(src, "example.php")

	visitor := visitor.Dumper{
		Indent:    "",
		Comments:  comments,
		Positions: positions,
	}
	nodes.Walk(visitor)
}

Roadmap

  • Lexer
  • PHP 7 syntax analyzer (completely)
  • AST nodes
  • AST visitor
  • AST dumper
  • node position
  • handling comments
  • Tests
  • Error handling
  • Stabilize api
  • Documentation
  • PHP 5 syntax analyzer
  • Code flow graph
  • Pretty printer
Description
No description provided
Readme 13 MiB
Languages
Go 92.7%
Yacc 6%
Ragel 1.3%