Documentation ¶
Overview ¶
Code generated by go generate; do not edit.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Parser *grammar.Parser[*Node, token_type]
)
Functions ¶
This section is empty.
Types ¶
type Node ¶ added in v0.1.3
type Node struct {
Parent, FirstChild, NextSibling, LastChild, PrevSibling *Node
Type NodeType
Data string
}
Node is a node in a ast.
func NewNode ¶ added in v0.1.3
NewNode creates a new node with the given data.
Parameters:
- n_type: The type of the node.
- data: The data of the node.
Returns:
- *Node: A pointer to the newly created node. It is never nil.
func (*Node) AddChildren ¶ added in v0.1.3
AddChildren implements the ast.Noder interface.
type NodeIterator ¶ added in v0.1.3
type NodeIterator struct {
// contains filtered or unexported fields
}
NodeIterator is a pull-based iterator that iterates over the children of a Node.
func (*NodeIterator) Consume ¶ added in v0.1.3
func (iter *NodeIterator) Consume() (ast.Noder, error)
Consume implements the ast.Iterater interface.
func (*NodeIterator) Restart ¶ added in v0.1.3
func (iter *NodeIterator) Restart()
Restart implements the ast.Iterater interface.
Click to show internal directories.
Click to hide internal directories.