ast

package
v0.0.0-...-dcc2aae Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	Type  Type
	Token *token.Token
	Min   int
	Max   int

	Children []*Node
}

func NewNode

func NewNode(nodeType Type, min, max int) *Node

func NewNodeWithDefault

func NewNodeWithDefault(nodeType Type) *Node

func (*Node) AddChildren

func (n *Node) AddChildren(next *Node)

func (*Node) GetChildren

func (n *Node) GetChildren() [][]*Node

func (*Node) GetFirstSet

func (n *Node) GetFirstSet() []token.Type

func (*Node) GetFollowSet

func (n *Node) GetFollowSet() []token.Type

func (*Node) IsTerminal

func (n *Node) IsTerminal() bool

func (*Node) MayEpsilon

func (n *Node) MayEpsilon() bool

func (*Node) PrintChildren

func (n *Node) PrintChildren()

func (*Node) RemoveLastChild

func (n *Node) RemoveLastChild()

func (*Node) SetRepeatTime

func (n *Node) SetRepeatTime(min, max int)

func (*Node) SetToken

func (n *Node) SetToken(t *token.Token)

type Type

type Type int
const (
	// non-terminal
	Root Type = iota
	SelectStatement
	SimpleSelectStatement
	ColumnList
	TableName
	WhereClause
	ColumnIdentifier
	OtherColumns
	ColumnWithAlias
	ColumnExpression
	AliasName
	ColumnName
	OtherExpression
	ExpressionOperator
	LiteralExpression
	Literal
	OtherLiteral
	ColumnComparison
	OtherColumnName
	OtherColumnComparison
	WhereOperator
	ComparisonOperator
	StatementTerminator
	Epsilon
	// terminal
	SelectKeyword
	FromKeyword
	AsKeyword
	WhereKeyword
	AndKeyword
	OrKeyword
	Identifier
	StringLiteral
	NumberLiteral
	SemicolonOperator
	CommaOperator
	PlusOperator
	MinusOperator
	GreaterOrEqualOperator
	GreaterThanOperator
	LessOrEqualOperator
	LessThanOperator
	EqualOperator
	NotEqual1Operator
	NotEqual2Operator
	End
)

func (Type) GetTokenType

func (t Type) GetTokenType() token.Type

func (Type) IsTerminal

func (t Type) IsTerminal() bool

func (Type) String

func (t Type) String() string

Jump to

Keyboard shortcuts

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