Documentation
¶
Index ¶
- Constants
- func AssertEqualNodes(t *testing.T, v, u Node) bool
- func ForEach(iter Iter, fn func(node BaseNode))
- func PtrAssign(output, input interface{})
- type BaseNode
- type Foo
- type Func
- type Iter
- type Node
- type NodeDiff
- type NonTerminal
- func (t *NonTerminal) Add(child ...BaseNode)
- func (t *NonTerminal) AddAndCount(child BaseNode, dest *int)
- func (t *NonTerminal) AddAndSet(child BaseNode, dest *BaseNode)
- func (t *NonTerminal) AllChildren() []BaseNode
- func (t *NonTerminal) AtIndex(ofType reflect.Type, tag Tag, index int) BaseNode
- func (t *NonTerminal) Count() int
- func (t *NonTerminal) Iter(ofType reflect.Type, tag Tag) Iter
- func (t *NonTerminal) Tag() Tag
- type Parser
- type Scanner
- func (r Scanner) Context() string
- func (r *Scanner) Eat(i int, eaten *Scanner) *Scanner
- func (r *Scanner) EatRegexp(re *regexp.Regexp, match *Scanner, captures []Scanner) (n int, ok bool)
- func (r *Scanner) EatString(s string, eaten *Scanner) bool
- func (r Scanner) Format(state fmt.State, c rune)
- func (r Scanner) Offset() int
- func (r Scanner) Skip(i int) *Scanner
- func (r Scanner) Slice(a, b int) *Scanner
- func (r Scanner) String() string
- func (r Scanner) StripSource() Scanner
- type Tag
- type Terminal
Constants ¶
View Source
const NoTag = Tag("")
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Node ¶
type Node struct {
Tag string `json:"tag"`
Extra interface{} `json:"extra"`
Children []interface{} `json:"nodes"`
}
func (Node) GetScanner ¶
type NodeDiff ¶
func NewNodeDiff ¶
type NonTerminal ¶
type NonTerminal struct {
// contains filtered or unexported fields
}
func (*NonTerminal) Add ¶
func (t *NonTerminal) Add(child ...BaseNode)
func (*NonTerminal) AddAndCount ¶
func (t *NonTerminal) AddAndCount(child BaseNode, dest *int)
func (*NonTerminal) AddAndSet ¶
func (t *NonTerminal) AddAndSet(child BaseNode, dest *BaseNode)
func (*NonTerminal) AllChildren ¶
func (t *NonTerminal) AllChildren() []BaseNode
func (*NonTerminal) Count ¶
func (t *NonTerminal) Count() int
func (*NonTerminal) Tag ¶
func (t *NonTerminal) Tag() Tag
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
func NewBareScanner ¶ added in v0.2.0
func NewScanner ¶
func NewScannerAt ¶
func (*Scanner) EatRegexp ¶
EatRegexp eats the text matching a regexp, populating match (if != nil) with the whole match and captures (if != nil) with any captured groups. Returns n as the number of captures set and ok iff a match was found.
func (Scanner) StripSource ¶ added in v0.4.0
Click to show internal directories.
Click to hide internal directories.