parser

package
v0.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InsertCommand

func InsertCommand(an Node, funcName string) error

Types

type Document

type Document struct {
	// contains filtered or unexported fields
}

func Parse

func Parse(name string, text string) (*Document, error)

func (Document) String

func (t Document) String() string

func (Document) Type

func (t Document) Type() NodeType

func (Document) Walk

func (t Document) Walk(walker Walker)

type Node

type Node interface {
	String() string
	Type() NodeType
	SetVal(v string)
	TreeNode
}

type NodeType

type NodeType int
const (
	RootNode NodeType = 1 + iota
	TextNode
	ActionNode
	CommandNode
	FieldNode
	IdentifierNode
)

type Nodes

type Nodes []Node

type ParseState

type ParseState int

type Parser

type Parser interface {
	Parse(token lexer.Token) (Node, ParseState, error)
}

type TreeNode

type TreeNode interface {
	AppendChild(node TreeNode)
	Children() []TreeNode
}

type WalkState

type WalkState int
const (
	WalkIn WalkState = 1 << iota
	WalkOut
)

type WalkStatus

type WalkStatus int
const (
	WalkStop WalkStatus = iota + 1
	WalkContinue
)

type Walker

type Walker func(n Node, ws WalkState) WalkStatus

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL