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

34 lines
593 B
Go

package token
type TokenInterface interface {
GetValue() string
GetStartLine() int
GetEndLine() int
}
type Token struct {
Value string
StartLine int
EndLine int
StartPos int
EndPos int
}
func NewToken(value []byte, startLine int, endLine int, startPos int, endPos int) Token {
return Token{string(value), startLine, endLine, startPos, endPos}
}
func (t Token) String() string {
return string(t.Value)
}
func (t Token) GetValue() string {
return t.Value
}
func (t Token) GetStartLine() int {
return t.StartLine
}
func (t Token) GetEndLine() int {
return t.EndLine
}