ast

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2016 License: MIT Imports: 4 Imported by: 42

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Insert

func Insert(parent *Node, children ...*Node)

Types

type Kind

type Kind int
const (
	KindNothing Kind = iota
	KindPattern
	KindList
	KindRange
	KindText
	KindAny
	KindSuper
	KindSingle
	KindAnyOf
)

type Lexer

type Lexer interface {
	Next() lexer.Token
}

type List

type List struct {
	Not   bool
	Chars string
}

type Node

type Node struct {
	Parent   *Node
	Children []*Node
	Value    interface{}
	Kind     Kind
}

func NewNode

func NewNode(k Kind, v interface{}, ch ...*Node) *Node

func Parse

func Parse(lexer Lexer) (*Node, error)

func (*Node) Equal

func (a *Node) Equal(b *Node) bool

type Range

type Range struct {
	Not    bool
	Lo, Hi rune
}

type Text

type Text struct {
	Text string
}

Jump to

Keyboard shortcuts

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