combinator

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2018 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Overview

Package combinator provides a user friendly way of constructing a relapse abstract syntax tree.

TODO: Review this API of this package, especially the Array methods.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllOf

func AllOf(patterns ...*ast.Pattern) *ast.Pattern

AllOf represents an intersection of patterns.

func And

func And(left, right *ast.Expr) *ast.Expr

func Any

func Any() *ast.Pattern

Any represents a zero or more of anything pattern.

func AnyOf

func AnyOf(patterns ...*ast.Pattern) *ast.Pattern

AnyOf represents a union of patterns.

func BoolConst

func BoolConst(b bool) *ast.Expr

func BoolVar

func BoolVar() *ast.Expr

func BoolsConst

func BoolsConst(is []bool) *ast.Expr

func BytesConst

func BytesConst(b []byte) *ast.Expr

func BytesVar

func BytesVar() *ast.Expr

func Contains

func Contains(left, right *ast.Expr) *ast.Expr

func DoubleConst

func DoubleConst(d float64) *ast.Expr

func DoubleVar

func DoubleVar() *ast.Expr

func DoublesConst

func DoublesConst(is []float64) *ast.Expr

func Elem

func Elem(index int, child *ast.Pattern, children ...*ast.Pattern) *ast.Pattern

Elem repesents an ordered list of patterns in an specific array element.

func Eq

func Eq(left, right *ast.Expr) *ast.Expr

func EqualFold

func EqualFold(s, t *ast.Expr) *ast.Expr

func Eval

func Eval(name string) *ast.Pattern

Eval represents the evaluation of a reference name.

func GE

func GE(left, right *ast.Expr) *ast.Expr

func GT

func GT(left, right *ast.Expr) *ast.Expr

func HasPrefix

func HasPrefix(a, b *ast.Expr) *ast.Expr

func HasSuffix

func HasSuffix(a, b *ast.Expr) *ast.Expr

func In

func In(name string, child *ast.Pattern, children ...*ast.Pattern) *ast.Pattern

In represents an ordered list of patterns in a field.

func InAny

func InAny(child *ast.Pattern, children ...*ast.Pattern) *ast.Pattern

InAny represents an ordered list of patterns in any field or index.

func InAnyExcept

func InAnyExcept(name string, child *ast.Pattern, children ...*ast.Pattern) *ast.Pattern

InAnyExcept represents an ordered list of patterns in any field except the specified one.

func InAnyOf

func InAnyOf(names []string, child *ast.Pattern, children ...*ast.Pattern) *ast.Pattern

InAnyOf represents an ordered list of patterns in any of the specified fields.

func InAnyOrder

func InAnyOrder(child *ast.Pattern, children ...*ast.Pattern) *ast.Pattern

InAnyOrder represents interleaved patterns.

func InAnyPath

func InAnyPath(child *ast.Pattern, children ...*ast.Pattern) *ast.Pattern

InAnyPath represents an ordered list of patterns in any path.

func InOrder

func InOrder(child *ast.Pattern, children ...*ast.Pattern) *ast.Pattern

InOrder represents an ordered list of patterns.

func InPath

func InPath(name string, child *ast.Pattern, children ...*ast.Pattern) *ast.Pattern

InPath represents an ordered list of patterns in a field path.

func IntConst

func IntConst(i int64) *ast.Expr

func IntVar

func IntVar() *ast.Expr

func IntsConst

func IntsConst(is []int64) *ast.Expr

func LE

func LE(left, right *ast.Expr) *ast.Expr

func LT

func LT(left, right *ast.Expr) *ast.Expr

func Length

func Length(e *ast.Expr) *ast.Expr

func ListOfBytesConst

func ListOfBytesConst(is [][]byte) *ast.Expr

func Many

func Many(p *ast.Pattern) *ast.Pattern

Many represents zero or more of the input pattern.

func Maybe

func Maybe(p *ast.Pattern) *ast.Pattern

Maybe represents an optional pattern.

func None

func None() *ast.Pattern

None represents no possible match.

func Not

func Not(e *ast.Expr) *ast.Expr

func OppositeOf

func OppositeOf(p *ast.Pattern) *ast.Pattern

OppositeOf represents a compliment of a pattern.

func Or

func Or(left, right *ast.Expr) *ast.Expr

func Regex

func Regex(expr, input *ast.Expr) *ast.Expr

func StringConst

func StringConst(s string) *ast.Expr

func StringVar

func StringVar() *ast.Expr

func StringsConst

func StringsConst(is []string) *ast.Expr

func Type

func Type(expr *ast.Expr) *ast.Expr

func UintConst

func UintConst(u uint64) *ast.Expr

func UintVar

func UintVar() *ast.Expr

func UintsConst

func UintsConst(is []uint64) *ast.Expr

func Value

func Value(expr *ast.Expr) *ast.Pattern

Value represents a field value.

Types

type G

type G map[string]*ast.Pattern

G represents the relapse Grammar. This consists of a "main" map key with the main pattern value and any other references.

func (G) Grammar

func (g G) Grammar() *ast.Grammar

Grammar returns G as a proper relapse.Grammar

Jump to

Keyboard shortcuts

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