php-parser/node/node.go
2018-01-05 13:01:52 +02:00

26 lines
424 B
Go

package node
import "fmt"
type Node interface {
Positioner
Attributes() map[string]interface{}
Walk(v Visitor)
}
type Positioner interface {
Position() *Position
SetPosition(p *Position) Node
}
type Position struct {
StartLine int
EndLine int
StartPos int
EndPos int
}
func (p Position) String() string {
return fmt.Sprintf("Pos{Line: %d-%d Pos: %d-%d}", p.StartLine, p.EndLine, p.StartPos, p.EndPos)
}