token.go 272 B

12345678910111213141516171819202122
  1. package ast
  2. import (
  3. "fmt"
  4. )
  5. type Position struct {
  6. Source string
  7. Line int
  8. Column int
  9. }
  10. type Token struct {
  11. Type int
  12. Name string
  13. Str string
  14. Pos Position
  15. }
  16. func (self *Token) String() string {
  17. return fmt.Sprintf("<type:%v, str:%v>", self.Name, self.Str)
  18. }