parse

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrBadSubstitution represents a substitution parsing error.
	ErrBadSubstitution = errors.New("bad substitution")

	// ErrMissingClosingBrace represents a missing closing brace "}" error.
	ErrMissingClosingBrace = errors.New("missing closing brace")

	// ErrParseVariableName represents the error when unable to parse a
	// variable name within a substitution.
	ErrParseVariableName = errors.New("unable to parse variable name")

	// ErrParseFuncSubstitution represents the error when unable to parse the
	// substitution within a function parameter.
	ErrParseFuncSubstitution = errors.New("unable to parse substitution within function")

	// ErrParseDefaultFunction represent the error when unable to parse a
	// default function.
	ErrParseDefaultFunction = errors.New("unable to parse default function")
)

Functions

This section is empty.

Types

type FuncNode

type FuncNode struct {
	Param string
	Name  string
	Args  []Node
}

FuncNode represents a string function.

type ListNode

type ListNode struct {
	Nodes []Node
}

ListNode represents a list of nodes.

type Node

type Node interface {
	// contains filtered or unexported methods
}

Node is an element in the parse tree.

type TextNode

type TextNode struct {
	Value string
}

TextNode represents a string of text.

type Tree

type Tree struct {
	Root Node
	// contains filtered or unexported fields
}

Tree is the representation of a single parsed SQL statement.

func Parse

func Parse(buf string) (*Tree, error)

Parse parses the string and returns a Tree.

func (*Tree) Parse

func (t *Tree) Parse(buf string) (tree *Tree, err error)

Parse parses the string buffer to construct an ast representation for expansion.

Jump to

Keyboard shortcuts

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