add doc.go
This commit is contained in:
parent
8420ab93ec
commit
3c726379c2
36
doc.go
Normal file
36
doc.go
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
## Features:
|
||||||
|
|
||||||
|
Fully support PHP5 and PHP7 syntax
|
||||||
|
Abstract syntax tree representation
|
||||||
|
Traversing AST
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
go get github.com/z7zmey/php-parser
|
||||||
|
|
||||||
|
Example
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
|
||||||
|
"github.com/z7zmey/php-parser/php7"
|
||||||
|
"github.com/z7zmey/php-parser/visitor"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
src := bytes.NewBufferString(`<? echo "Hello world";`)
|
||||||
|
nodes, comments, positions := php7.Parse(src, "example.php")
|
||||||
|
|
||||||
|
visitor := visitor.Dumper{
|
||||||
|
Indent: "",
|
||||||
|
Comments: comments,
|
||||||
|
Positions: positions,
|
||||||
|
}
|
||||||
|
nodes.Walk(visitor)
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
package main // import "github.com/z7zmey/php-parser"
|
Loading…
Reference in New Issue
Block a user