-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes.go
More file actions
31 lines (27 loc) · 684 Bytes
/
types.go
File metadata and controls
31 lines (27 loc) · 684 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package thrifter
import "text/scanner"
type NodeCommonField struct {
Parent Node
Next Node
Prev Node
StartToken *Token
EndToken *Token
}
type Token struct {
Type token
Raw string // tokens raw value, e.g. comments contain prefix, like // or /* or #; strings contain ' or "
Value string // tokens transformed value
Next *Token
Prev *Token
Pos scanner.Position
}
type Node interface {
// recursively output current node and its children
String() string
// recursively parse current node and its children
parse(p *Parser) error
// get node value
NodeValue() interface{}
// get node type, value specified from each node
NodeType() string
}