ast

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: 14 Imported by: 2

Documentation

Overview

Package ast contains the abstract syntax tree for relapse. This ast is represented using a protocol buffer structure which means that it can be parsed and then serialized to protocol buffers or json.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthRelapse = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowRelapse   = fmt.Errorf("proto: integer overflow")
)

Functions

func BuiltInFunctionName

func BuiltInFunctionName(symbol string) string

BuiltInFunctionName returns the full function name for the given builtin symbol. The function returns an empty string when the symbol is not a known builtin symbol.

func FunctionNameToBuiltIn

func FunctionNameToBuiltIn(symbol string) func(*Expr) *Expr

FunctionNameToBuiltIn returns the builtin constructor for a given function name. If a symbol does not exist, nil is returned.

func HasNot

func HasNot(g *Grammar) bool

func Strip

func Strip(slit string, sub string) []byte

Strip is a parser utility function that removes all versions of the given sub string from the slit string and also removes possible surrounding parentheses.

func ToFloat64

func ToFloat64(tok []byte) *float64

ToFloat64 is a parser utility function that returns a pointer to a parsed an float64 or panics.

func ToInt64

func ToInt64(tok []byte) *int64

ToInt64 is a parser utility function that returns a pointer to a parsed an int64 or panics.

func ToString

func ToString(s1 string) string

ToString unquotes a quoted string or returns the original string.

func ToUint64

func ToUint64(tok []byte) *uint64

ToUint64 is a parser utility function that returns a pointer to a parsed an uint64 or panics.

Types

type And

type And struct {
	OpenParen    *Keyword `protobuf:"bytes,1,opt,name=OpenParen" json:"OpenParen,omitempty"`
	LeftPattern  *Pattern `protobuf:"bytes,2,opt,name=LeftPattern" json:"LeftPattern,omitempty"`
	Ampersand    *Keyword `protobuf:"bytes,3,opt,name=Ampersand" json:"Ampersand,omitempty"`
	RightPattern *Pattern `protobuf:"bytes,4,opt,name=RightPattern" json:"RightPattern,omitempty"`
	CloseParen   *Keyword `protobuf:"bytes,5,opt,name=CloseParen" json:"CloseParen,omitempty"`
}

And is the ast node for the And pattern.

func (*And) Descriptor

func (*And) Descriptor() ([]byte, []int)

func (*And) GetAmpersand

func (m *And) GetAmpersand() *Keyword

func (*And) GetCloseParen

func (m *And) GetCloseParen() *Keyword

func (*And) GetLeftPattern

func (m *And) GetLeftPattern() *Pattern

func (*And) GetOpenParen

func (m *And) GetOpenParen() *Keyword

func (*And) GetRightPattern

func (m *And) GetRightPattern() *Pattern

func (*And) Marshal

func (m *And) Marshal() (dAtA []byte, err error)

func (*And) MarshalTo

func (m *And) MarshalTo(dAtA []byte) (int, error)

func (*And) ProtoMessage

func (*And) ProtoMessage()

func (*And) Reset

func (m *And) Reset()

func (*And) Size

func (m *And) Size() (n int)

func (*And) String

func (this *And) String() string

String returns the relapse string representation of the And instance.

func (*And) Unmarshal

func (m *And) Unmarshal(dAtA []byte) error

func (*And) Walk

func (this *And) Walk(v Visitor)

Walk visits the And pattern and its child patterns.

func (*And) XXX_DiscardUnknown

func (m *And) XXX_DiscardUnknown()

func (*And) XXX_Marshal

func (m *And) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*And) XXX_Merge

func (dst *And) XXX_Merge(src proto.Message)

func (*And) XXX_Size

func (m *And) XXX_Size() int

func (*And) XXX_Unmarshal

func (m *And) XXX_Unmarshal(b []byte) error

type AnyName

type AnyName struct {
	Underscore *Keyword `protobuf:"bytes,1,opt,name=Underscore" json:"Underscore,omitempty"`
}

AnyName is a name expression that represents any name.

func (*AnyName) Descriptor

func (*AnyName) Descriptor() ([]byte, []int)

func (*AnyName) GetUnderscore

func (m *AnyName) GetUnderscore() *Keyword

func (*AnyName) Marshal

func (m *AnyName) Marshal() (dAtA []byte, err error)

func (*AnyName) MarshalTo

func (m *AnyName) MarshalTo(dAtA []byte) (int, error)

func (*AnyName) ProtoMessage

func (*AnyName) ProtoMessage()

func (*AnyName) Reset

func (m *AnyName) Reset()

func (*AnyName) Size

func (m *AnyName) Size() (n int)

func (*AnyName) String

func (this *AnyName) String() string

String returns the relapse string representation of the AnyName instance.

func (*AnyName) Unmarshal

func (m *AnyName) Unmarshal(dAtA []byte) error

func (*AnyName) Walk

func (this *AnyName) Walk(v Visitor)

Walk visits AnyName.

func (*AnyName) XXX_DiscardUnknown

func (m *AnyName) XXX_DiscardUnknown()

func (*AnyName) XXX_Marshal

func (m *AnyName) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AnyName) XXX_Merge

func (dst *AnyName) XXX_Merge(src proto.Message)

func (*AnyName) XXX_Size

func (m *AnyName) XXX_Size() int

func (*AnyName) XXX_Unmarshal

func (m *AnyName) XXX_Unmarshal(b []byte) error

type AnyNameExcept

type AnyNameExcept struct {
	Exclamation *Keyword  `protobuf:"bytes,1,opt,name=Exclamation" json:"Exclamation,omitempty"`
	OpenParen   *Keyword  `protobuf:"bytes,2,opt,name=OpenParen" json:"OpenParen,omitempty"`
	Except      *NameExpr `protobuf:"bytes,3,opt,name=Except" json:"Except,omitempty"`
	CloseParen  *Keyword  `protobuf:"bytes,4,opt,name=CloseParen" json:"CloseParen,omitempty"`
}

AnyNameExpr is a name expression that represents any name except the specified name expression.

func (*AnyNameExcept) Descriptor

func (*AnyNameExcept) Descriptor() ([]byte, []int)

func (*AnyNameExcept) GetCloseParen

func (m *AnyNameExcept) GetCloseParen() *Keyword

func (*AnyNameExcept) GetExcept

func (m *AnyNameExcept) GetExcept() *NameExpr

func (*AnyNameExcept) GetExclamation

func (m *AnyNameExcept) GetExclamation() *Keyword

func (*AnyNameExcept) GetOpenParen

func (m *AnyNameExcept) GetOpenParen() *Keyword

func (*AnyNameExcept) Marshal

func (m *AnyNameExcept) Marshal() (dAtA []byte, err error)

func (*AnyNameExcept) MarshalTo

func (m *AnyNameExcept) MarshalTo(dAtA []byte) (int, error)

func (*AnyNameExcept) ProtoMessage

func (*AnyNameExcept) ProtoMessage()

func (*AnyNameExcept) Reset

func (m *AnyNameExcept) Reset()

func (*AnyNameExcept) Size

func (m *AnyNameExcept) Size() (n int)

func (*AnyNameExcept) String

func (this *AnyNameExcept) String() string

String returns the relapse string representation of the AnyNameExcept instance.

func (*AnyNameExcept) Unmarshal

func (m *AnyNameExcept) Unmarshal(dAtA []byte) error

func (*AnyNameExcept) Walk

func (this *AnyNameExcept) Walk(v Visitor)

Walk visits AnyNameExcept and its NameExpr.

func (*AnyNameExcept) XXX_DiscardUnknown

func (m *AnyNameExcept) XXX_DiscardUnknown()

func (*AnyNameExcept) XXX_Marshal

func (m *AnyNameExcept) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AnyNameExcept) XXX_Merge

func (dst *AnyNameExcept) XXX_Merge(src proto.Message)

func (*AnyNameExcept) XXX_Size

func (m *AnyNameExcept) XXX_Size() int

func (*AnyNameExcept) XXX_Unmarshal

func (m *AnyNameExcept) XXX_Unmarshal(b []byte) error

type BuiltIn

type BuiltIn struct {
	Symbol *Keyword `protobuf:"bytes,1,opt,name=Symbol" json:"Symbol,omitempty"`
	Expr   *Expr    `protobuf:"bytes,2,opt,name=Expr" json:"Expr,omitempty"`
}

BuiltIn is an expression that represents a builtin function. This is represented by a symbol and an expression.

func (*BuiltIn) Descriptor

func (*BuiltIn) Descriptor() ([]byte, []int)

func (*BuiltIn) GetExpr

func (m *BuiltIn) GetExpr() *Expr

func (*BuiltIn) GetSymbol

func (m *BuiltIn) GetSymbol() *Keyword

func (*BuiltIn) Marshal

func (m *BuiltIn) Marshal() (dAtA []byte, err error)

func (*BuiltIn) MarshalTo

func (m *BuiltIn) MarshalTo(dAtA []byte) (int, error)

func (*BuiltIn) ProtoMessage

func (*BuiltIn) ProtoMessage()

func (*BuiltIn) Reset

func (m *BuiltIn) Reset()

func (*BuiltIn) Size

func (m *BuiltIn) Size() (n int)

func (*BuiltIn) String

func (this *BuiltIn) String() string

String returns the relapse string representation of the BuiltIn instance.

func (*BuiltIn) Unmarshal

func (m *BuiltIn) Unmarshal(dAtA []byte) error

func (*BuiltIn) Walk

func (this *BuiltIn) Walk(v Visitor)

Walk visits BuiltIn and its Expr.

func (*BuiltIn) XXX_DiscardUnknown

func (m *BuiltIn) XXX_DiscardUnknown()

func (*BuiltIn) XXX_Marshal

func (m *BuiltIn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BuiltIn) XXX_Merge

func (dst *BuiltIn) XXX_Merge(src proto.Message)

func (*BuiltIn) XXX_Size

func (m *BuiltIn) XXX_Size() int

func (*BuiltIn) XXX_Unmarshal

func (m *BuiltIn) XXX_Unmarshal(b []byte) error

type Comment

type Comment string

Comment represents a relapse comment as a string

func (Comment) GetContent

func (this Comment) GetContent() string

GetContent returns the content of the comment excluding the // or /* */

type Concat

type Concat struct {
	OpenBracket  *Keyword `protobuf:"bytes,2,opt,name=OpenBracket" json:"OpenBracket,omitempty"`
	LeftPattern  *Pattern `protobuf:"bytes,3,opt,name=LeftPattern" json:"LeftPattern,omitempty"`
	Comma        *Keyword `protobuf:"bytes,4,opt,name=Comma" json:"Comma,omitempty"`
	RightPattern *Pattern `protobuf:"bytes,5,opt,name=RightPattern" json:"RightPattern,omitempty"`
	ExtraComma   *Keyword `protobuf:"bytes,6,opt,name=ExtraComma" json:"ExtraComma,omitempty"`
	CloseBracket *Keyword `protobuf:"bytes,7,opt,name=CloseBracket" json:"CloseBracket,omitempty"`
}

Concat is the ast node for the Concat pattern.

func (*Concat) Descriptor

func (*Concat) Descriptor() ([]byte, []int)

func (*Concat) GetCloseBracket

func (m *Concat) GetCloseBracket() *Keyword

func (*Concat) GetComma

func (m *Concat) GetComma() *Keyword

func (*Concat) GetExtraComma

func (m *Concat) GetExtraComma() *Keyword

func (*Concat) GetLeftPattern

func (m *Concat) GetLeftPattern() *Pattern

func (*Concat) GetOpenBracket

func (m *Concat) GetOpenBracket() *Keyword

func (*Concat) GetRightPattern

func (m *Concat) GetRightPattern() *Pattern

func (*Concat) Marshal

func (m *Concat) Marshal() (dAtA []byte, err error)

func (*Concat) MarshalTo

func (m *Concat) MarshalTo(dAtA []byte) (int, error)

func (*Concat) ProtoMessage

func (*Concat) ProtoMessage()

func (*Concat) Reset

func (m *Concat) Reset()

func (*Concat) Size

func (m *Concat) Size() (n int)

func (*Concat) String

func (this *Concat) String() string

String returns the relapse string representation of the Concat instance.

func (*Concat) Unmarshal

func (m *Concat) Unmarshal(dAtA []byte) error

func (*Concat) Walk

func (this *Concat) Walk(v Visitor)

Walk visits the Concat pattern and its child patterns.

func (*Concat) XXX_DiscardUnknown

func (m *Concat) XXX_DiscardUnknown()

func (*Concat) XXX_Marshal

func (m *Concat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Concat) XXX_Merge

func (dst *Concat) XXX_Merge(src proto.Message)

func (*Concat) XXX_Size

func (m *Concat) XXX_Size() int

func (*Concat) XXX_Unmarshal

func (m *Concat) XXX_Unmarshal(b []byte) error

type Contains

type Contains struct {
	Dot     *Keyword `protobuf:"bytes,1,opt,name=Dot" json:"Dot,omitempty"`
	Pattern *Pattern `protobuf:"bytes,2,opt,name=Pattern" json:"Pattern,omitempty"`
}

Contains is the ast node for the Contains pattern.

func (*Contains) Descriptor

func (*Contains) Descriptor() ([]byte, []int)

func (*Contains) GetDot

func (m *Contains) GetDot() *Keyword

func (*Contains) GetPattern

func (m *Contains) GetPattern() *Pattern

func (*Contains) Marshal

func (m *Contains) Marshal() (dAtA []byte, err error)

func (*Contains) MarshalTo

func (m *Contains) MarshalTo(dAtA []byte) (int, error)

func (*Contains) ProtoMessage

func (*Contains) ProtoMessage()

func (*Contains) Reset

func (m *Contains) Reset()

func (*Contains) Size

func (m *Contains) Size() (n int)

func (*Contains) String

func (this *Contains) String() string

String returns the relapse string representation of the Contains instance.

func (*Contains) Unmarshal

func (m *Contains) Unmarshal(dAtA []byte) error

func (*Contains) Walk

func (this *Contains) Walk(v Visitor)

Walk visits the Contains pattern and its pattern.

func (*Contains) XXX_DiscardUnknown

func (m *Contains) XXX_DiscardUnknown()

func (*Contains) XXX_Marshal

func (m *Contains) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Contains) XXX_Merge

func (dst *Contains) XXX_Merge(src proto.Message)

func (*Contains) XXX_Size

func (m *Contains) XXX_Size() int

func (*Contains) XXX_Unmarshal

func (m *Contains) XXX_Unmarshal(b []byte) error

type Empty

type Empty struct {
	Empty *Keyword `protobuf:"bytes,1,opt,name=Empty" json:"Empty,omitempty"`
}

Empty is the ast node for the Empty pattern.

func (*Empty) Descriptor

func (*Empty) Descriptor() ([]byte, []int)

func (*Empty) GetEmpty

func (m *Empty) GetEmpty() *Keyword

func (*Empty) Marshal

func (m *Empty) Marshal() (dAtA []byte, err error)

func (*Empty) MarshalTo

func (m *Empty) MarshalTo(dAtA []byte) (int, error)

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) Size

func (m *Empty) Size() (n int)

func (*Empty) String

func (this *Empty) String() string

String returns the relapse string representation of the Empty instance.

func (*Empty) Unmarshal

func (m *Empty) Unmarshal(dAtA []byte) error

func (*Empty) Walk

func (this *Empty) Walk(v Visitor)

Walk visits the Empty pattern.

func (*Empty) XXX_DiscardUnknown

func (m *Empty) XXX_DiscardUnknown()

func (*Empty) XXX_Marshal

func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Empty) XXX_Merge

func (dst *Empty) XXX_Merge(src proto.Message)

func (*Empty) XXX_Size

func (m *Empty) XXX_Size() int

func (*Empty) XXX_Unmarshal

func (m *Empty) XXX_Unmarshal(b []byte) error

type Expr

type Expr struct {
	RightArrow *Keyword  `protobuf:"bytes,1,opt,name=RightArrow" json:"RightArrow,omitempty"`
	Comma      *Keyword  `protobuf:"bytes,2,opt,name=Comma" json:"Comma,omitempty"`
	Terminal   *Terminal `protobuf:"bytes,3,opt,name=Terminal" json:"Terminal,omitempty"`
	List       *List     `protobuf:"bytes,4,opt,name=List" json:"List,omitempty"`
	Function   *Function `protobuf:"bytes,5,opt,name=Function" json:"Function,omitempty"`
	BuiltIn    *BuiltIn  `protobuf:"bytes,6,opt,name=BuiltIn" json:"BuiltIn,omitempty"`
}

Expr is a union of all possible expression types, terminal, list, function and builtin function.

func NewBoolList

func NewBoolList(elems ...*Expr) *Expr

NewBoolList returns a list of expressions, each of type bool.

[]bool{elems}

func NewBoolVar

func NewBoolVar() *Expr

NewBoolVar returns a new variable expression of type bool

$bool

func NewBytesConst

func NewBytesConst(buf []byte) *Expr

NewBytesConst returns a new terminal expression containing the given bytes value.

[]byte(fmt.Sprintf("%#v", buf))

func NewBytesList

func NewBytesList(elems ...*Expr) *Expr

NewBytesList returns a list of expressions, each of type []byte.

[][]byte{elems}

func NewBytesVar

func NewBytesVar() *Expr

NewBytesVar returns a new variable expression of type []byte

$[]byte

func NewDoubleConst

func NewDoubleConst(d float64) *Expr

NewDoubleConst returns a new terminal expression containing the given double value.

double(d)

func NewDoubleList

func NewDoubleList(elems ...*Expr) *Expr

NewDoubleList returns a list of expressions, each of type double.

[]double{elems}

func NewDoubleVar

func NewDoubleVar() *Expr

NewDoubleVar returns a new variable expression of type double

$double

func NewEqual

func NewEqual(e *Expr) *Expr

NewEqual returns an builtin equal expression.

== e

func NewFalse

func NewFalse() *Expr

NewFalse returns a new terminal expression containing a false value.

false

func NewFunction

func NewFunction(name string, params ...*Expr) *Expr

NewFunction returns a function expression given a name and a list of parameters.

->name(param1, param2, ...)

This function should be the top level function and not a nested function. If the parameters don't have populated Comma fields, this function will add them. If a parameter has a populared RightArrow field, the contents of the RightArrow field is thrown away.

func NewGreaterEqual

func NewGreaterEqual(e *Expr) *Expr

NewGreaterEqual returns an builtin greater than or equal expression.

>= e

func NewGreaterThan

func NewGreaterThan(e *Expr) *Expr

NewGreaterThan returns an builtin greater than expression.

> e

func NewHasElem

func NewHasElem(e *Expr) *Expr

NewHasElem returns an builtin contains expression.

*= e

func NewHasPrefix

func NewHasPrefix(e *Expr) *Expr

NewHasPrefix returns an builtin has prefix expression.

^= e

func NewHasSuffix

func NewHasSuffix(e *Expr) *Expr

NewHasSuffix returns an builtin has suffix expression.

$= e

func NewIntConst

func NewIntConst(i int64) *Expr

NewIntConst returns a new terminal expression containing the given int value.

int(i)

func NewIntList

func NewIntList(elems ...*Expr) *Expr

NewIntList returns a list of expressions, each of type int.

[]int{elems}

func NewIntVar

func NewIntVar() *Expr

NewIntVar returns a new variable expression of type int

$int

func NewLessEqual

func NewLessEqual(e *Expr) *Expr

NewLessEqual returns an builtin less than or equal expression.

<= e

func NewLessThan

func NewLessThan(e *Expr) *Expr

NewLessThan returns an builtin less than expression.

< e

func NewList

func NewList(typ types.Type, elems ...*Expr) *Expr

NewList returns a typed list of expressions.

[]typ{elems}

func NewNestedFunction

func NewNestedFunction(name string, params ...*Expr) *Expr

NewNestedFunction returns a function expression given a name and a list of parameters.

name(param1, param2, ...)

If the parameters don't have populated Comma fields, this function will add them. If a parameter has a populared RightArrow field, the contents of the RightArrow field is thrown away.

func NewNotEqual

func NewNotEqual(e *Expr) *Expr

NewNotEqual returns an builtin not equal expression.

!= e

func NewRegex

func NewRegex(e *Expr) *Expr

NewRegex returns an builtin regular expression.

~= e

func NewStringConst

func NewStringConst(s string) *Expr

NewStringConst returns a new terminal expression containing the given string value.

"s"
`s`

func NewStringList

func NewStringList(elems ...*Expr) *Expr

NewStringList returns a list of expressions, each of type string.

[]string{elems}

func NewStringVar

func NewStringVar() *Expr

NewStringVar returns a new variable expression of type string

$string

func NewTrue

func NewTrue() *Expr

NewTrue returns a new terminal expression containing a true value.

true

func NewType

func NewType(e *Expr) *Expr

NewType returns an builtin type expression.

:: e

func NewUintConst

func NewUintConst(i uint64) *Expr

NewUintConst returns a new terminal expression containing the given uint value.

uint(i)

func NewUintList

func NewUintList(elems ...*Expr) *Expr

NewUintList returns a list of expressions, each of type uint.

[]uint{elems}

func NewUintVar

func NewUintVar() *Expr

NewUintVar returns a new variable expression of type uint

$uint

func NewVar

func NewVar(typ types.Type) *Expr

NewVar return a variable expression given a type.

$typ

func SetExprComma

func SetExprComma(e interface{}, c interface{}) *Expr

SetExpComma is a parser utility function that takes an expression and a comma Keyword and places the comma inside the returned Expr.

func SetRightArrow

func SetRightArrow(expr interface{}, rightArrow interface{}) *Expr

SetRightArrow is a parser utitliy function that takes an Expression and a RightArrow and places the RightArrow inside the returned Expression.

func (*Expr) Clone

func (this *Expr) Clone() *Expr

Clone returns a copy of the Expr struct

func (*Expr) Descriptor

func (*Expr) Descriptor() ([]byte, []int)

func (*Expr) GetBuiltIn

func (m *Expr) GetBuiltIn() *BuiltIn

func (*Expr) GetComma

func (m *Expr) GetComma() *Keyword

func (*Expr) GetFunction

func (m *Expr) GetFunction() *Function

func (*Expr) GetList

func (m *Expr) GetList() *List

func (*Expr) GetRightArrow

func (m *Expr) GetRightArrow() *Keyword

func (*Expr) GetTerminal

func (m *Expr) GetTerminal() *Terminal

func (*Expr) GoString

func (this *Expr) GoString() string

GoString returns a go string representing the Expr

func (*Expr) HasVar

func (this *Expr) HasVar() bool

HasVar returns whether there exists a variable somewhere in the expression tree. This function is executed recursively.

func (*Expr) Marshal

func (m *Expr) Marshal() (dAtA []byte, err error)

func (*Expr) MarshalTo

func (m *Expr) MarshalTo(dAtA []byte) (int, error)

func (*Expr) ProtoMessage

func (*Expr) ProtoMessage()

func (*Expr) Reset

func (m *Expr) Reset()

func (*Expr) Size

func (m *Expr) Size() (n int)

func (*Expr) String

func (this *Expr) String() string

String returns the relapse string representation of the Expr instance.

func (*Expr) Unmarshal

func (m *Expr) Unmarshal(dAtA []byte) error

func (*Expr) Walk

func (this *Expr) Walk(v Visitor)

Walk visits every possible field that is not nil and not of type Keyword or Space.

func (*Expr) XXX_DiscardUnknown

func (m *Expr) XXX_DiscardUnknown()

func (*Expr) XXX_Marshal

func (m *Expr) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Expr) XXX_Merge

func (dst *Expr) XXX_Merge(src proto.Message)

func (*Expr) XXX_Size

func (m *Expr) XXX_Size() int

func (*Expr) XXX_Unmarshal

func (m *Expr) XXX_Unmarshal(b []byte) error

type Function

type Function struct {
	Before     *Space   `protobuf:"bytes,1,opt,name=Before" json:"Before,omitempty"`
	Name       string   `protobuf:"bytes,2,opt,name=Name" json:"Name"`
	OpenParen  *Keyword `protobuf:"bytes,3,opt,name=OpenParen" json:"OpenParen,omitempty"`
	Params     []*Expr  `protobuf:"bytes,4,rep,name=Params" json:"Params,omitempty"`
	CloseParen *Keyword `protobuf:"bytes,5,opt,name=CloseParen" json:"CloseParen,omitempty"`
}

Function is an expression that represents a function expression, which contains a function name and a list parameters.

func (*Function) Descriptor

func (*Function) Descriptor() ([]byte, []int)

func (*Function) GetBefore

func (m *Function) GetBefore() *Space

func (*Function) GetCloseParen

func (m *Function) GetCloseParen() *Keyword

func (*Function) GetName

func (m *Function) GetName() string

func (*Function) GetOpenParen

func (m *Function) GetOpenParen() *Keyword

func (*Function) GetParams

func (m *Function) GetParams() []*Expr

func (*Function) HasVar

func (this *Function) HasVar() bool

HasVar returns whether there exists a varaible somewhere in the function parameters. This function is executed recursively.

func (*Function) Marshal

func (m *Function) Marshal() (dAtA []byte, err error)

func (*Function) MarshalTo

func (m *Function) MarshalTo(dAtA []byte) (int, error)

func (*Function) ProtoMessage

func (*Function) ProtoMessage()

func (*Function) Reset

func (m *Function) Reset()

func (*Function) Size

func (m *Function) Size() (n int)

func (*Function) String

func (this *Function) String() string

String returns the relapse string representation of the Function instance.

func (*Function) Unmarshal

func (m *Function) Unmarshal(dAtA []byte) error

func (*Function) Walk

func (this *Function) Walk(v Visitor)

Walk visits Function and every parameter.

func (*Function) XXX_DiscardUnknown

func (m *Function) XXX_DiscardUnknown()

func (*Function) XXX_Marshal

func (m *Function) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Function) XXX_Merge

func (dst *Function) XXX_Merge(src proto.Message)

func (*Function) XXX_Size

func (m *Function) XXX_Size() int

func (*Function) XXX_Unmarshal

func (m *Function) XXX_Unmarshal(b []byte) error

type Grammar

type Grammar struct {
	TopPattern   *Pattern       `protobuf:"bytes,1,opt,name=TopPattern" json:"TopPattern,omitempty"`
	PatternDecls []*PatternDecl `protobuf:"bytes,2,rep,name=PatternDecls" json:"PatternDecls,omitempty"`
	After        *Space         `protobuf:"bytes,3,opt,name=After" json:"After,omitempty"`
}

Grammar is the ast node representing the whole grammar.

func NewGrammar

func NewGrammar(m map[string]*Pattern) *Grammar

NewGrammar converts a refenence lookup map into a Grammar.

func (*Grammar) AddRef

func (this *Grammar) AddRef(name string, p *Pattern) *Grammar

AddRef adds a Reference to a Grammar.

func (*Grammar) Clone

func (this *Grammar) Clone() *Grammar

Clone returns a copy of the Grammar struct

func (*Grammar) Descriptor

func (*Grammar) Descriptor() ([]byte, []int)

func (*Grammar) Equal

func (this *Grammar) Equal(that *Grammar) bool

func (*Grammar) Format

func (this *Grammar) Format()

Format formats the spacing in the Grammar.

func (*Grammar) GetAfter

func (m *Grammar) GetAfter() *Space

func (*Grammar) GetPatternDecls

func (m *Grammar) GetPatternDecls() []*PatternDecl

func (*Grammar) GetTopPattern

func (m *Grammar) GetTopPattern() *Pattern

func (*Grammar) GoString

func (this *Grammar) GoString() string

GoString returns a go string representing the Grammar

func (*Grammar) Marshal

func (m *Grammar) Marshal() (dAtA []byte, err error)

func (*Grammar) MarshalTo

func (m *Grammar) MarshalTo(dAtA []byte) (int, error)

func (*Grammar) ProtoMessage

func (*Grammar) ProtoMessage()

func (*Grammar) Reset

func (m *Grammar) Reset()

func (*Grammar) Size

func (m *Grammar) Size() (n int)

func (*Grammar) String

func (this *Grammar) String() string

String returns the relapse string representation of the Grammar instance.

func (*Grammar) Unmarshal

func (m *Grammar) Unmarshal(dAtA []byte) error

func (*Grammar) Walk

func (this *Grammar) Walk(v Visitor)

Walk visits the Grammar instance and all its possible child pattern and all its pattern declarations.

func (*Grammar) XXX_DiscardUnknown

func (m *Grammar) XXX_DiscardUnknown()

func (*Grammar) XXX_Marshal

func (m *Grammar) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Grammar) XXX_Merge

func (dst *Grammar) XXX_Merge(src proto.Message)

func (*Grammar) XXX_Size

func (m *Grammar) XXX_Size() int

func (*Grammar) XXX_Unmarshal

func (m *Grammar) XXX_Unmarshal(b []byte) error

type Interleave

type Interleave struct {
	OpenCurly      *Keyword `protobuf:"bytes,2,opt,name=OpenCurly" json:"OpenCurly,omitempty"`
	LeftPattern    *Pattern `protobuf:"bytes,3,opt,name=LeftPattern" json:"LeftPattern,omitempty"`
	SemiColon      *Keyword `protobuf:"bytes,4,opt,name=SemiColon" json:"SemiColon,omitempty"`
	RightPattern   *Pattern `protobuf:"bytes,5,opt,name=RightPattern" json:"RightPattern,omitempty"`
	ExtraSemiColon *Keyword `protobuf:"bytes,6,opt,name=ExtraSemiColon" json:"ExtraSemiColon,omitempty"`
	CloseCurly     *Keyword `protobuf:"bytes,7,opt,name=CloseCurly" json:"CloseCurly,omitempty"`
}

Interleave is the ast node for the Interleave pattern.

func (*Interleave) Descriptor

func (*Interleave) Descriptor() ([]byte, []int)

func (*Interleave) GetCloseCurly

func (m *Interleave) GetCloseCurly() *Keyword

func (*Interleave) GetExtraSemiColon

func (m *Interleave) GetExtraSemiColon() *Keyword

func (*Interleave) GetLeftPattern

func (m *Interleave) GetLeftPattern() *Pattern

func (*Interleave) GetOpenCurly

func (m *Interleave) GetOpenCurly() *Keyword

func (*Interleave) GetRightPattern

func (m *Interleave) GetRightPattern() *Pattern

func (*Interleave) GetSemiColon

func (m *Interleave) GetSemiColon() *Keyword

func (*Interleave) Marshal

func (m *Interleave) Marshal() (dAtA []byte, err error)

func (*Interleave) MarshalTo

func (m *Interleave) MarshalTo(dAtA []byte) (int, error)

func (*Interleave) ProtoMessage

func (*Interleave) ProtoMessage()

func (*Interleave) Reset

func (m *Interleave) Reset()

func (*Interleave) Size

func (m *Interleave) Size() (n int)

func (*Interleave) String

func (this *Interleave) String() string

String returns the relapse string representation of the Interleave instance.

func (*Interleave) Unmarshal

func (m *Interleave) Unmarshal(dAtA []byte) error

func (*Interleave) Walk

func (this *Interleave) Walk(v Visitor)

Walk visits the Interleave pattern and its child patterns.

func (*Interleave) XXX_DiscardUnknown

func (m *Interleave) XXX_DiscardUnknown()

func (*Interleave) XXX_Marshal

func (m *Interleave) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Interleave) XXX_Merge

func (dst *Interleave) XXX_Merge(src proto.Message)

func (*Interleave) XXX_Size

func (m *Interleave) XXX_Size() int

func (*Interleave) XXX_Unmarshal

func (m *Interleave) XXX_Unmarshal(b []byte) error

type Keyword

type Keyword struct {
	Before *Space `protobuf:"bytes,1,opt,name=Before" json:"Before,omitempty"`
	Value  string `protobuf:"bytes,2,opt,name=Value" json:"Value"`
}

Keyword represents any possible keyword.

func NewKeyword

func NewKeyword(space interface{}, v interface{}) *Keyword

NewKeyword is a parser utility function that returns a Keyword given a space and a token.

func (*Keyword) Descriptor

func (*Keyword) Descriptor() ([]byte, []int)

func (*Keyword) GetBefore

func (m *Keyword) GetBefore() *Space

func (*Keyword) GetValue

func (m *Keyword) GetValue() string

func (*Keyword) Marshal

func (m *Keyword) Marshal() (dAtA []byte, err error)

func (*Keyword) MarshalTo

func (m *Keyword) MarshalTo(dAtA []byte) (int, error)

func (*Keyword) ProtoMessage

func (*Keyword) ProtoMessage()

func (*Keyword) Reset

func (m *Keyword) Reset()

func (*Keyword) Size

func (m *Keyword) Size() (n int)

func (*Keyword) String

func (this *Keyword) String() string

String returns the relapse string representation of the Keyword instance.

func (*Keyword) Unmarshal

func (m *Keyword) Unmarshal(dAtA []byte) error

func (*Keyword) XXX_DiscardUnknown

func (m *Keyword) XXX_DiscardUnknown()

func (*Keyword) XXX_Marshal

func (m *Keyword) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Keyword) XXX_Merge

func (dst *Keyword) XXX_Merge(src proto.Message)

func (*Keyword) XXX_Size

func (m *Keyword) XXX_Size() int

func (*Keyword) XXX_Unmarshal

func (m *Keyword) XXX_Unmarshal(b []byte) error

type LeafNode

type LeafNode struct {
	Expr *Expr `protobuf:"bytes,1,opt,name=Expr" json:"Expr,omitempty"`
}

LeafNode is the ast node for the LeafNode pattern.

func (*LeafNode) Descriptor

func (*LeafNode) Descriptor() ([]byte, []int)

func (*LeafNode) GetExpr

func (m *LeafNode) GetExpr() *Expr

func (*LeafNode) Marshal

func (m *LeafNode) Marshal() (dAtA []byte, err error)

func (*LeafNode) MarshalTo

func (m *LeafNode) MarshalTo(dAtA []byte) (int, error)

func (*LeafNode) ProtoMessage

func (*LeafNode) ProtoMessage()

func (*LeafNode) Reset

func (m *LeafNode) Reset()

func (*LeafNode) Size

func (m *LeafNode) Size() (n int)

func (*LeafNode) String

func (this *LeafNode) String() string

String returns the relapse string representation of the LeafNode instance.

func (*LeafNode) Unmarshal

func (m *LeafNode) Unmarshal(dAtA []byte) error

func (*LeafNode) Walk

func (this *LeafNode) Walk(v Visitor)

Walk visits the LeafNode pattern.

func (*LeafNode) XXX_DiscardUnknown

func (m *LeafNode) XXX_DiscardUnknown()

func (*LeafNode) XXX_Marshal

func (m *LeafNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LeafNode) XXX_Merge

func (dst *LeafNode) XXX_Merge(src proto.Message)

func (*LeafNode) XXX_Size

func (m *LeafNode) XXX_Size() int

func (*LeafNode) XXX_Unmarshal

func (m *LeafNode) XXX_Unmarshal(b []byte) error

type List

type List struct {
	Before     *Space     `protobuf:"bytes,1,opt,name=Before" json:"Before,omitempty"`
	Type       types.Type `protobuf:"varint,2,opt,name=Type,enum=types.Type" json:"Type"`
	OpenCurly  *Keyword   `protobuf:"bytes,3,opt,name=OpenCurly" json:"OpenCurly,omitempty"`
	Elems      []*Expr    `protobuf:"bytes,4,rep,name=Elems" json:"Elems,omitempty"`
	CloseCurly *Keyword   `protobuf:"bytes,5,opt,name=CloseCurly" json:"CloseCurly,omitempty"`
}

List is an expression that represents a typed list of expressions.

func (*List) Descriptor

func (*List) Descriptor() ([]byte, []int)

func (*List) GetBefore

func (m *List) GetBefore() *Space

func (*List) GetCloseCurly

func (m *List) GetCloseCurly() *Keyword

func (*List) GetElems

func (m *List) GetElems() []*Expr

func (*List) GetOpenCurly

func (m *List) GetOpenCurly() *Keyword

func (*List) GetType

func (m *List) GetType() types.Type

func (*List) HasVar

func (this *List) HasVar() bool

HasVar returns whether there exists a variable somewhere in the typed list. This function is executed recursively.

func (*List) Marshal

func (m *List) Marshal() (dAtA []byte, err error)

func (*List) MarshalTo

func (m *List) MarshalTo(dAtA []byte) (int, error)

func (*List) ProtoMessage

func (*List) ProtoMessage()

func (*List) Reset

func (m *List) Reset()

func (*List) Size

func (m *List) Size() (n int)

func (*List) String

func (this *List) String() string

String returns the relapse string representation of the List instance.

func (*List) Unmarshal

func (m *List) Unmarshal(dAtA []byte) error

func (*List) Walk

func (this *List) Walk(v Visitor)

Walk visits List and each element in the list.

func (*List) XXX_DiscardUnknown

func (m *List) XXX_DiscardUnknown()

func (*List) XXX_Marshal

func (m *List) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*List) XXX_Merge

func (dst *List) XXX_Merge(src proto.Message)

func (*List) XXX_Size

func (m *List) XXX_Size() int

func (*List) XXX_Unmarshal

func (m *List) XXX_Unmarshal(b []byte) error

type Name

type Name struct {
	Before      *Space   `protobuf:"bytes,1,opt,name=Before" json:"Before,omitempty"`
	DoubleValue *float64 `protobuf:"fixed64,3,opt,name=DoubleValue" json:"DoubleValue,omitempty"`
	IntValue    *int64   `protobuf:"varint,5,opt,name=IntValue" json:"IntValue,omitempty"`
	UintValue   *uint64  `protobuf:"varint,6,opt,name=UintValue" json:"UintValue,omitempty"`
	BoolValue   *bool    `protobuf:"varint,8,opt,name=BoolValue" json:"BoolValue,omitempty"`
	StringValue *string  `protobuf:"bytes,9,opt,name=StringValue" json:"StringValue,omitempty"`
	BytesValue  []byte   `protobuf:"bytes,10,opt,name=BytesValue" json:"BytesValue,omitempty"`
}

Name is a name expression and represents a union of all possible name type values.

func (*Name) Descriptor

func (*Name) Descriptor() ([]byte, []int)

func (*Name) GetBefore

func (m *Name) GetBefore() *Space

func (*Name) GetBoolValue

func (m *Name) GetBoolValue() bool

func (*Name) GetBytesValue

func (m *Name) GetBytesValue() []byte

func (*Name) GetDoubleValue

func (m *Name) GetDoubleValue() float64

func (*Name) GetIntValue

func (m *Name) GetIntValue() int64

func (*Name) GetStringValue

func (m *Name) GetStringValue() string

func (*Name) GetUintValue

func (m *Name) GetUintValue() uint64

func (*Name) Marshal

func (m *Name) Marshal() (dAtA []byte, err error)

func (*Name) MarshalTo

func (m *Name) MarshalTo(dAtA []byte) (int, error)

func (*Name) ProtoMessage

func (*Name) ProtoMessage()

func (*Name) Reset

func (m *Name) Reset()

func (*Name) Size

func (m *Name) Size() (n int)

func (*Name) String

func (this *Name) String() string

String returns the relapse string representation of the Name instance.

func (*Name) Unmarshal

func (m *Name) Unmarshal(dAtA []byte) error

func (*Name) Walk

func (this *Name) Walk(v Visitor)

Walk visits Name.

func (*Name) XXX_DiscardUnknown

func (m *Name) XXX_DiscardUnknown()

func (*Name) XXX_Marshal

func (m *Name) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Name) XXX_Merge

func (dst *Name) XXX_Merge(src proto.Message)

func (*Name) XXX_Size

func (m *Name) XXX_Size() int

func (*Name) XXX_Unmarshal

func (m *Name) XXX_Unmarshal(b []byte) error

type NameChoice

type NameChoice struct {
	OpenParen  *Keyword  `protobuf:"bytes,1,opt,name=OpenParen" json:"OpenParen,omitempty"`
	Left       *NameExpr `protobuf:"bytes,2,opt,name=Left" json:"Left,omitempty"`
	Pipe       *Keyword  `protobuf:"bytes,3,opt,name=Pipe" json:"Pipe,omitempty"`
	Right      *NameExpr `protobuf:"bytes,4,opt,name=Right" json:"Right,omitempty"`
	CloseParen *Keyword  `protobuf:"bytes,5,opt,name=CloseParen" json:"CloseParen,omitempty"`
}

NameChoice is a name expression that represents a choice between two possible name expressions.

func (*NameChoice) Descriptor

func (*NameChoice) Descriptor() ([]byte, []int)

func (*NameChoice) GetCloseParen

func (m *NameChoice) GetCloseParen() *Keyword

func (*NameChoice) GetLeft

func (m *NameChoice) GetLeft() *NameExpr

func (*NameChoice) GetOpenParen

func (m *NameChoice) GetOpenParen() *Keyword

func (*NameChoice) GetPipe

func (m *NameChoice) GetPipe() *Keyword

func (*NameChoice) GetRight

func (m *NameChoice) GetRight() *NameExpr

func (*NameChoice) Marshal

func (m *NameChoice) Marshal() (dAtA []byte, err error)

func (*NameChoice) MarshalTo

func (m *NameChoice) MarshalTo(dAtA []byte) (int, error)

func (*NameChoice) ProtoMessage

func (*NameChoice) ProtoMessage()

func (*NameChoice) Reset

func (m *NameChoice) Reset()

func (*NameChoice) Size

func (m *NameChoice) Size() (n int)

func (*NameChoice) String

func (this *NameChoice) String() string

String returns the relapse string representation of the NameChoice instance.

func (*NameChoice) Unmarshal

func (m *NameChoice) Unmarshal(dAtA []byte) error

func (*NameChoice) Walk

func (this *NameChoice) Walk(v Visitor)

Walk visits NameChoice and its NameExpr types.

func (*NameChoice) XXX_DiscardUnknown

func (m *NameChoice) XXX_DiscardUnknown()

func (*NameChoice) XXX_Marshal

func (m *NameChoice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*NameChoice) XXX_Merge

func (dst *NameChoice) XXX_Merge(src proto.Message)

func (*NameChoice) XXX_Size

func (m *NameChoice) XXX_Size() int

func (*NameChoice) XXX_Unmarshal

func (m *NameChoice) XXX_Unmarshal(b []byte) error

type NameExpr

type NameExpr struct {
	Name          *Name          `protobuf:"bytes,1,opt,name=Name" json:"Name,omitempty"`
	AnyName       *AnyName       `protobuf:"bytes,2,opt,name=AnyName" json:"AnyName,omitempty"`
	AnyNameExcept *AnyNameExcept `protobuf:"bytes,3,opt,name=AnyNameExcept" json:"AnyNameExcept,omitempty"`
	NameChoice    *NameChoice    `protobuf:"bytes,4,opt,name=NameChoice" json:"NameChoice,omitempty"`
}

NameExpr is a special type of expression for field names that contains a union of all the possible name expressions.

func NewAnyName

func NewAnyName() *NameExpr

NewAnyName returns a name expression that represents the any name expression.

_

func NewAnyNameExcept

func NewAnyNameExcept(name *NameExpr) *NameExpr

NewAnyNameExcept returns a name expression that represents any name except the given name expression.

!(name)

func NewBoolName

func NewBoolName(name bool) *NameExpr

NewBoolName returns a name expression containing the given bool value.

bool(name)

func NewBytesName

func NewBytesName(name []byte) *NameExpr

NewBytesName returns a name expression containing the given []byte value.

[]byte(name)

func NewDoubleName

func NewDoubleName(name float64) *NameExpr

NewDoubleName returns a name expression containing the given double value.

double(name)

func NewIntName

func NewIntName(name int64) *NameExpr

NewIntName returns a name expression containing the given int value.

int(name)

func NewNameChoice

func NewNameChoice(names ...*NameExpr) *NameExpr

NewNameChoice returns a name expression which represents of choice of the list of given name expressions. If the number of names provided is:

0, nil is returned;

1, the input name is returned;

2, the ored names is returned;

(names[0] | names[1])

> 2, the left curried ored names is returned.

(names[0] | (names[1] | (...)))

func NewSDTName

func NewSDTName(space *Space, term *Terminal) *NameExpr

NewSDTName is a parser utility function that returns a NameExpr given a white space and a terminal value expression.

func NewStringName

func NewStringName(name string) *NameExpr

NewStringName returns a name expression containing the given string value.

string(name)

func NewUintName

func NewUintName(name uint64) *NameExpr

NewUintName returns a name expression containing the given uint value.

uint(name)

func (*NameExpr) Compare

func (this *NameExpr) Compare(that *NameExpr) int

func (*NameExpr) Descriptor

func (*NameExpr) Descriptor() ([]byte, []int)

func (*NameExpr) Equal

func (this *NameExpr) Equal(that *NameExpr) bool

func (*NameExpr) GetAnyName

func (m *NameExpr) GetAnyName() *AnyName

func (*NameExpr) GetAnyNameExcept

func (m *NameExpr) GetAnyNameExcept() *AnyNameExcept

func (*NameExpr) GetName

func (m *NameExpr) GetName() *Name

func (*NameExpr) GetNameChoice

func (m *NameExpr) GetNameChoice() *NameChoice

func (*NameExpr) GetValue

func (this *NameExpr) GetValue() interface{}

func (*NameExpr) Marshal

func (m *NameExpr) Marshal() (dAtA []byte, err error)

func (*NameExpr) MarshalTo

func (m *NameExpr) MarshalTo(dAtA []byte) (int, error)

func (*NameExpr) ProtoMessage

func (*NameExpr) ProtoMessage()

func (*NameExpr) Reset

func (m *NameExpr) Reset()

func (*NameExpr) SetValue

func (this *NameExpr) SetValue(value interface{}) bool

func (*NameExpr) Size

func (m *NameExpr) Size() (n int)

func (*NameExpr) String

func (this *NameExpr) String() string

String returns the relapse string representation of the NameExpr instance.

func (*NameExpr) Unmarshal

func (m *NameExpr) Unmarshal(dAtA []byte) error

func (*NameExpr) Walk

func (this *NameExpr) Walk(v Visitor)

Walk visits every possible field that is not nil and not of type Keyword or Space.

func (*NameExpr) XXX_DiscardUnknown

func (m *NameExpr) XXX_DiscardUnknown()

func (*NameExpr) XXX_Marshal

func (m *NameExpr) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*NameExpr) XXX_Merge

func (dst *NameExpr) XXX_Merge(src proto.Message)

func (*NameExpr) XXX_Size

func (m *NameExpr) XXX_Size() int

func (*NameExpr) XXX_Unmarshal

func (m *NameExpr) XXX_Unmarshal(b []byte) error

type Not

type Not struct {
	Exclamation *Keyword `protobuf:"bytes,1,opt,name=Exclamation" json:"Exclamation,omitempty"`
	OpenParen   *Keyword `protobuf:"bytes,2,opt,name=OpenParen" json:"OpenParen,omitempty"`
	Pattern     *Pattern `protobuf:"bytes,3,opt,name=Pattern" json:"Pattern,omitempty"`
	CloseParen  *Keyword `protobuf:"bytes,4,opt,name=CloseParen" json:"CloseParen,omitempty"`
}

Not is the ast node for the Not pattern.

func (*Not) Descriptor

func (*Not) Descriptor() ([]byte, []int)

func (*Not) GetCloseParen

func (m *Not) GetCloseParen() *Keyword

func (*Not) GetExclamation

func (m *Not) GetExclamation() *Keyword

func (*Not) GetOpenParen

func (m *Not) GetOpenParen() *Keyword

func (*Not) GetPattern

func (m *Not) GetPattern() *Pattern

func (*Not) Marshal

func (m *Not) Marshal() (dAtA []byte, err error)

func (*Not) MarshalTo

func (m *Not) MarshalTo(dAtA []byte) (int, error)

func (*Not) ProtoMessage

func (*Not) ProtoMessage()

func (*Not) Reset

func (m *Not) Reset()

func (*Not) Size

func (m *Not) Size() (n int)

func (*Not) String

func (this *Not) String() string

String returns the relapse string representation of the Not instance.

func (*Not) Unmarshal

func (m *Not) Unmarshal(dAtA []byte) error

func (*Not) Walk

func (this *Not) Walk(v Visitor)

Walk visits the Not pattern and its pattern.

func (*Not) XXX_DiscardUnknown

func (m *Not) XXX_DiscardUnknown()

func (*Not) XXX_Marshal

func (m *Not) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Not) XXX_Merge

func (dst *Not) XXX_Merge(src proto.Message)

func (*Not) XXX_Size

func (m *Not) XXX_Size() int

func (*Not) XXX_Unmarshal

func (m *Not) XXX_Unmarshal(b []byte) error

type Optional

type Optional struct {
	OpenParen    *Keyword `protobuf:"bytes,1,opt,name=OpenParen" json:"OpenParen,omitempty"`
	Pattern      *Pattern `protobuf:"bytes,2,opt,name=Pattern" json:"Pattern,omitempty"`
	CloseParen   *Keyword `protobuf:"bytes,3,opt,name=CloseParen" json:"CloseParen,omitempty"`
	QuestionMark *Keyword `protobuf:"bytes,4,opt,name=QuestionMark" json:"QuestionMark,omitempty"`
}

Optional is the ast node for the Optional pattern.

func (*Optional) Descriptor

func (*Optional) Descriptor() ([]byte, []int)

func (*Optional) GetCloseParen

func (m *Optional) GetCloseParen() *Keyword

func (*Optional) GetOpenParen

func (m *Optional) GetOpenParen() *Keyword

func (*Optional) GetPattern

func (m *Optional) GetPattern() *Pattern

func (*Optional) GetQuestionMark

func (m *Optional) GetQuestionMark() *Keyword

func (*Optional) Marshal

func (m *Optional) Marshal() (dAtA []byte, err error)

func (*Optional) MarshalTo

func (m *Optional) MarshalTo(dAtA []byte) (int, error)

func (*Optional) ProtoMessage

func (*Optional) ProtoMessage()

func (*Optional) Reset

func (m *Optional) Reset()

func (*Optional) Size

func (m *Optional) Size() (n int)

func (*Optional) String

func (this *Optional) String() string

String returns the relapse string representation of the Optional instance.

func (*Optional) Unmarshal

func (m *Optional) Unmarshal(dAtA []byte) error

func (*Optional) Walk

func (this *Optional) Walk(v Visitor)

Walk visits the Optional pattern and its pattern.

func (*Optional) XXX_DiscardUnknown

func (m *Optional) XXX_DiscardUnknown()

func (*Optional) XXX_Marshal

func (m *Optional) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Optional) XXX_Merge

func (dst *Optional) XXX_Merge(src proto.Message)

func (*Optional) XXX_Size

func (m *Optional) XXX_Size() int

func (*Optional) XXX_Unmarshal

func (m *Optional) XXX_Unmarshal(b []byte) error

type Or

type Or struct {
	OpenParen    *Keyword `protobuf:"bytes,1,opt,name=OpenParen" json:"OpenParen,omitempty"`
	LeftPattern  *Pattern `protobuf:"bytes,2,opt,name=LeftPattern" json:"LeftPattern,omitempty"`
	Pipe         *Keyword `protobuf:"bytes,3,opt,name=Pipe" json:"Pipe,omitempty"`
	RightPattern *Pattern `protobuf:"bytes,4,opt,name=RightPattern" json:"RightPattern,omitempty"`
	CloseParen   *Keyword `protobuf:"bytes,5,opt,name=CloseParen" json:"CloseParen,omitempty"`
}

Or is the ast node for the Or pattern.

func (*Or) Descriptor

func (*Or) Descriptor() ([]byte, []int)

func (*Or) GetCloseParen

func (m *Or) GetCloseParen() *Keyword

func (*Or) GetLeftPattern

func (m *Or) GetLeftPattern() *Pattern

func (*Or) GetOpenParen

func (m *Or) GetOpenParen() *Keyword

func (*Or) GetPipe

func (m *Or) GetPipe() *Keyword

func (*Or) GetRightPattern

func (m *Or) GetRightPattern() *Pattern

func (*Or) Marshal

func (m *Or) Marshal() (dAtA []byte, err error)

func (*Or) MarshalTo

func (m *Or) MarshalTo(dAtA []byte) (int, error)

func (*Or) ProtoMessage

func (*Or) ProtoMessage()

func (*Or) Reset

func (m *Or) Reset()

func (*Or) Size

func (m *Or) Size() (n int)

func (*Or) String

func (this *Or) String() string

String returns the relapse string representation of the Or instance.

func (*Or) Unmarshal

func (m *Or) Unmarshal(dAtA []byte) error

func (*Or) Walk

func (this *Or) Walk(v Visitor)

Walk visits the Or pattern and its child patterns.

func (*Or) XXX_DiscardUnknown

func (m *Or) XXX_DiscardUnknown()

func (*Or) XXX_Marshal

func (m *Or) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Or) XXX_Merge

func (dst *Or) XXX_Merge(src proto.Message)

func (*Or) XXX_Size

func (m *Or) XXX_Size() int

func (*Or) XXX_Unmarshal

func (m *Or) XXX_Unmarshal(b []byte) error

type Pattern

type Pattern struct {
	Empty      *Empty      `protobuf:"bytes,1,opt,name=Empty" json:"Empty,omitempty"`
	TreeNode   *TreeNode   `protobuf:"bytes,3,opt,name=TreeNode" json:"TreeNode,omitempty"`
	LeafNode   *LeafNode   `protobuf:"bytes,4,opt,name=LeafNode" json:"LeafNode,omitempty"`
	Concat     *Concat     `protobuf:"bytes,5,opt,name=Concat" json:"Concat,omitempty"`
	Or         *Or         `protobuf:"bytes,6,opt,name=Or" json:"Or,omitempty"`
	And        *And        `protobuf:"bytes,7,opt,name=And" json:"And,omitempty"`
	ZeroOrMore *ZeroOrMore `protobuf:"bytes,8,opt,name=ZeroOrMore" json:"ZeroOrMore,omitempty"`
	Reference  *Reference  `protobuf:"bytes,9,opt,name=Reference" json:"Reference,omitempty"`
	Not        *Not        `protobuf:"bytes,10,opt,name=Not" json:"Not,omitempty"`
	ZAny       *ZAny       `protobuf:"bytes,11,opt,name=ZAny" json:"ZAny,omitempty"`
	Contains   *Contains   `protobuf:"bytes,12,opt,name=Contains" json:"Contains,omitempty"`
	Optional   *Optional   `protobuf:"bytes,13,opt,name=Optional" json:"Optional,omitempty"`
	Interleave *Interleave `protobuf:"bytes,14,opt,name=Interleave" json:"Interleave,omitempty"`
}

Pattern is the ast node for the union of all possible patterns.

func NewAnd

func NewAnd(patterns ...*Pattern) *Pattern

NewAnd returns a new And pattern. If the number of patterns provided is:

0, nil is returned;

1, the input pattern is returned;

2, the anded pattern is returned;

(pattern[0] & pattern[1])

> 2, the left curried anded pattern is returned.

(pattern[0] & (pattern[1] & (...)))

func NewConcat

func NewConcat(patterns ...*Pattern) *Pattern

NewConcat returns a new Concat pattern. If the number of patterns provided is:

0, nil is returned;

1, the input pattern is returned;

2, the concatenated pattern is returned;

[pattern[0], pattern[1]]

> 2, the left curried concatenated pattern is returned.

[pattern[0], [pattern[1], [...]]]

func NewContains

func NewContains(pattern *Pattern) *Pattern

NewContains returns a new Contains pattern.

.pattern

func NewEmpty

func NewEmpty() *Pattern

NewEmpty returns a new empty pattern.

<empty>

func NewInterleave

func NewInterleave(patterns ...*Pattern) *Pattern

NewInterleave returns a new Interleave pattern. If the number of patterns provided is:

0, nil is returned;

1, the input pattern is returned;

2, the interleaved pattern is returned;

{pattern[0]; pattern[1]}

> 2, the left curried interleaved pattern is returned.

{pattern[0]; {pattern[1]; {...}}}

func NewLeafNode

func NewLeafNode(e *Expr) *Pattern

NewLeafNode returns a new LeafNode pattern.

func NewNot

func NewNot(pattern *Pattern) *Pattern

NewNot returns a new Not pattern.

!(pattern)

func NewOptional

func NewOptional(pattern *Pattern) *Pattern

NewOptional returns a new Optional pattern.

(pattern)?

func NewOr

func NewOr(patterns ...*Pattern) *Pattern

NewOr returns a new Or pattern. If the number of patterns provided is:

0, nil is returned;

1, the input pattern is returned;

2, the ored pattern is returned;

(pattern[0] | pattern[1])

> 2, the left curried ored pattern is returned.

(pattern[0] | (pattern[1] | (...)))

func NewReference

func NewReference(name string) *Pattern

NewReference returns a new Reference pattern.

@name

func NewTreeNode

func NewTreeNode(name *NameExpr, pattern *Pattern) *Pattern

NewTreeNode returns a new TreeNode pattern. Depending on what is appropriate the relapse string could be one of the following:

name: pattern
name pattern

func NewZAny

func NewZAny() *Pattern

NewZAny returns a new ZAny pattern.

*

func NewZeroOrMore

func NewZeroOrMore(pattern *Pattern) *Pattern

NewZeroOrMore returns a new ZeroOrMore pattern.

(pattern)*

func (*Pattern) Clone

func (this *Pattern) Clone() *Pattern

Clone returns a copy of the Pattern struct

func (*Pattern) Compare

func (this *Pattern) Compare(that *Pattern) int

func (*Pattern) Descriptor

func (*Pattern) Descriptor() ([]byte, []int)

func (*Pattern) Equal

func (this *Pattern) Equal(that *Pattern) bool

func (*Pattern) Format

func (this *Pattern) Format()

Format formats the spacing in the Pattern.

func (*Pattern) GetAnd

func (m *Pattern) GetAnd() *And

func (*Pattern) GetConcat

func (m *Pattern) GetConcat() *Concat

func (*Pattern) GetContains

func (m *Pattern) GetContains() *Contains

func (*Pattern) GetEmpty

func (m *Pattern) GetEmpty() *Empty

func (*Pattern) GetInterleave

func (m *Pattern) GetInterleave() *Interleave

func (*Pattern) GetLeafNode

func (m *Pattern) GetLeafNode() *LeafNode

func (*Pattern) GetNot

func (m *Pattern) GetNot() *Not

func (*Pattern) GetOptional

func (m *Pattern) GetOptional() *Optional

func (*Pattern) GetOr

func (m *Pattern) GetOr() *Or

func (*Pattern) GetReference

func (m *Pattern) GetReference() *Reference

func (*Pattern) GetTreeNode

func (m *Pattern) GetTreeNode() *TreeNode

func (*Pattern) GetValue

func (this *Pattern) GetValue() interface{}

func (*Pattern) GetZAny

func (m *Pattern) GetZAny() *ZAny

func (*Pattern) GetZeroOrMore

func (m *Pattern) GetZeroOrMore() *ZeroOrMore

func (*Pattern) GoString

func (this *Pattern) GoString() string

GoString returns a go string representing the Pattern

func (*Pattern) Grammar

func (this *Pattern) Grammar() *Grammar

Grammar turns one Pattern into a Grammar.

func (*Pattern) Hash

func (p *Pattern) Hash() uint64

func (*Pattern) Marshal

func (m *Pattern) Marshal() (dAtA []byte, err error)

func (*Pattern) MarshalTo

func (m *Pattern) MarshalTo(dAtA []byte) (int, error)

func (*Pattern) ProtoMessage

func (*Pattern) ProtoMessage()

func (*Pattern) Reset

func (m *Pattern) Reset()

func (*Pattern) SetValue

func (this *Pattern) SetValue(value interface{}) bool

func (*Pattern) Size

func (m *Pattern) Size() (n int)

func (*Pattern) String

func (this *Pattern) String() string

String returns the relapse string representation of the Pattern instance.

func (*Pattern) Unmarshal

func (m *Pattern) Unmarshal(dAtA []byte) error

func (*Pattern) Walk

func (this *Pattern) Walk(v Visitor)

Walk visits the Pattern instance, its non nil patterns.

func (*Pattern) XXX_DiscardUnknown

func (m *Pattern) XXX_DiscardUnknown()

func (*Pattern) XXX_Marshal

func (m *Pattern) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Pattern) XXX_Merge

func (dst *Pattern) XXX_Merge(src proto.Message)

func (*Pattern) XXX_Size

func (m *Pattern) XXX_Size() int

func (*Pattern) XXX_Unmarshal

func (m *Pattern) XXX_Unmarshal(b []byte) error

type PatternDecl

type PatternDecl struct {
	Hash    *Keyword `protobuf:"bytes,1,opt,name=Hash" json:"Hash,omitempty"`
	Before  *Space   `protobuf:"bytes,2,opt,name=Before" json:"Before,omitempty"`
	Name    string   `protobuf:"bytes,3,opt,name=Name" json:"Name"`
	Eq      *Keyword `protobuf:"bytes,4,opt,name=Eq" json:"Eq,omitempty"`
	Pattern *Pattern `protobuf:"bytes,5,opt,name=Pattern" json:"Pattern,omitempty"`
}

PatternDecl is the ast node for the declaration of a pattern.

func NewPatternDecl

func NewPatternDecl(name string, pattern *Pattern) *PatternDecl

NewPatternDecl creates a new pattern declaration.

#name = pattern

func (*PatternDecl) Descriptor

func (*PatternDecl) Descriptor() ([]byte, []int)

func (*PatternDecl) GetBefore

func (m *PatternDecl) GetBefore() *Space

func (*PatternDecl) GetEq

func (m *PatternDecl) GetEq() *Keyword

func (*PatternDecl) GetHash

func (m *PatternDecl) GetHash() *Keyword

func (*PatternDecl) GetName

func (m *PatternDecl) GetName() string

func (*PatternDecl) GetPattern

func (m *PatternDecl) GetPattern() *Pattern

func (*PatternDecl) Marshal

func (m *PatternDecl) Marshal() (dAtA []byte, err error)

func (*PatternDecl) MarshalTo

func (m *PatternDecl) MarshalTo(dAtA []byte) (int, error)

func (*PatternDecl) ProtoMessage

func (*PatternDecl) ProtoMessage()

func (*PatternDecl) Reset

func (m *PatternDecl) Reset()

func (*PatternDecl) Size

func (m *PatternDecl) Size() (n int)

func (*PatternDecl) String

func (this *PatternDecl) String() string

String returns the relapse string representation of the PatternDecl instance.

func (*PatternDecl) Unmarshal

func (m *PatternDecl) Unmarshal(dAtA []byte) error

func (*PatternDecl) Walk

func (this *PatternDecl) Walk(v Visitor)

Walk visits the PatternDecl instance and its child pattern.

func (*PatternDecl) XXX_DiscardUnknown

func (m *PatternDecl) XXX_DiscardUnknown()

func (*PatternDecl) XXX_Marshal

func (m *PatternDecl) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PatternDecl) XXX_Merge

func (dst *PatternDecl) XXX_Merge(src proto.Message)

func (*PatternDecl) XXX_Size

func (m *PatternDecl) XXX_Size() int

func (*PatternDecl) XXX_Unmarshal

func (m *PatternDecl) XXX_Unmarshal(b []byte) error

type RefLookup

type RefLookup map[string]*Pattern

RefLookup represents a relapse grammar as a map of references.

func NewRefLookup

func NewRefLookup(g *Grammar) RefLookup

NewRefLookup converts a grammar into a reference lookup map.

func (RefLookup) Clone

func (this RefLookup) Clone() RefLookup

Clone returns a copy of the RefLookup map

func (RefLookup) GoString

func (this RefLookup) GoString() string

GoString returns a go string representing the RefLookup

type Reference

type Reference struct {
	At   *Keyword `protobuf:"bytes,1,opt,name=At" json:"At,omitempty"`
	Name string   `protobuf:"bytes,2,opt,name=Name" json:"Name"`
}

Reference is the ast node for the Reference pattern.

func (*Reference) Descriptor

func (*Reference) Descriptor() ([]byte, []int)

func (*Reference) GetAt

func (m *Reference) GetAt() *Keyword

func (*Reference) GetName

func (m *Reference) GetName() string

func (*Reference) Marshal

func (m *Reference) Marshal() (dAtA []byte, err error)

func (*Reference) MarshalTo

func (m *Reference) MarshalTo(dAtA []byte) (int, error)

func (*Reference) ProtoMessage

func (*Reference) ProtoMessage()

func (*Reference) Reset

func (m *Reference) Reset()

func (*Reference) Size

func (m *Reference) Size() (n int)

func (*Reference) String

func (this *Reference) String() string

String returns the relapse string representation of the Reference instance.

func (*Reference) Unmarshal

func (m *Reference) Unmarshal(dAtA []byte) error

func (*Reference) Walk

func (this *Reference) Walk(v Visitor)

Walk visits the Reference pattern.

func (*Reference) XXX_DiscardUnknown

func (m *Reference) XXX_DiscardUnknown()

func (*Reference) XXX_Marshal

func (m *Reference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Reference) XXX_Merge

func (dst *Reference) XXX_Merge(src proto.Message)

func (*Reference) XXX_Size

func (m *Reference) XXX_Size() int

func (*Reference) XXX_Unmarshal

func (m *Reference) XXX_Unmarshal(b []byte) error

type Space

type Space struct {
	Space []string `protobuf:"bytes,1,rep,name=Space" json:"Space,omitempty"`
}

Space represents a comment or white space.

func AppendSpace

func AppendSpace(ss interface{}, s string) *Space

NewAppendSpace is a parser utility function that returns a Space by append the given string to the given Space's Space field, which is a list of strings.

func NewSpace

func NewSpace(s interface{}) *Space

NewSpace is a parser utility function that returns a Space given a token

func (*Space) Descriptor

func (*Space) Descriptor() ([]byte, []int)

func (*Space) Format

func (this *Space) Format()

func (*Space) GetAttachedComment

func (this *Space) GetAttachedComment() Comment

GetAttachedComment returns the last comment in the whitespace that does not have a newline at the end of the comment. If there is a newline at the end of the comment, this function returns an empty Comment.

func (*Space) GetComments

func (this *Space) GetComments() []Comment

GetComments returns a list of comments contained in the white space.

func (*Space) GetSpace

func (m *Space) GetSpace() []string

func (*Space) HasAttachedComment

func (this *Space) HasAttachedComment() bool

HasAttachedComment returns whether the white space has any attached comments. An attached comment is one that does not contain a newline at the end of the white space.

func (*Space) HasComment

func (this *Space) HasComment() bool

HasComment returns whether the white space contains a comment.

func (*Space) Marshal

func (m *Space) Marshal() (dAtA []byte, err error)

func (*Space) MarshalTo

func (m *Space) MarshalTo(dAtA []byte) (int, error)

func (*Space) ProtoMessage

func (*Space) ProtoMessage()

func (*Space) Reset

func (m *Space) Reset()

func (*Space) Size

func (m *Space) Size() (n int)

func (*Space) String

func (this *Space) String() string

String returns the relapse string representation of the Space instance.

func (*Space) Unmarshal

func (m *Space) Unmarshal(dAtA []byte) error

func (*Space) XXX_DiscardUnknown

func (m *Space) XXX_DiscardUnknown()

func (*Space) XXX_Marshal

func (m *Space) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Space) XXX_Merge

func (dst *Space) XXX_Merge(src proto.Message)

func (*Space) XXX_Size

func (m *Space) XXX_Size() int

func (*Space) XXX_Unmarshal

func (m *Space) XXX_Unmarshal(b []byte) error

type Terminal

type Terminal struct {
	Before      *Space    `protobuf:"bytes,1,opt,name=Before" json:"Before,omitempty"`
	Literal     string    `protobuf:"bytes,2,opt,name=Literal" json:"Literal"`
	DoubleValue *float64  `protobuf:"fixed64,3,opt,name=DoubleValue" json:"DoubleValue,omitempty"`
	IntValue    *int64    `protobuf:"varint,5,opt,name=IntValue" json:"IntValue,omitempty"`
	UintValue   *uint64   `protobuf:"varint,6,opt,name=UintValue" json:"UintValue,omitempty"`
	BoolValue   *bool     `protobuf:"varint,8,opt,name=BoolValue" json:"BoolValue,omitempty"`
	StringValue *string   `protobuf:"bytes,9,opt,name=StringValue" json:"StringValue,omitempty"`
	BytesValue  []byte    `protobuf:"bytes,10,opt,name=BytesValue" json:"BytesValue,omitempty"`
	Variable    *Variable `protobuf:"bytes,50,opt,name=Variable" json:"Variable,omitempty"`
}

Terminal is an expression that represents a literal value or variable.

func NewBoolTerminal

func NewBoolTerminal(v interface{}) *Terminal

NewBoolTerminal is a parser utility function that returns a Terminal of type bool given a bool.

func NewBytesTerminal

func NewBytesTerminal(stringLit string) (*Terminal, error)

NewBytesTerminal is a parser utility function that parses the []byte value out of the input string and returns a Terminal of type []byte.

func NewDoubleTerminal

func NewDoubleTerminal(slit string) (*Terminal, error)

NewDoubleTerminal is a parser utility function that parses the double value out of the input string and returns a Terminal of type double.

func NewIntTerminal

func NewIntTerminal(slit string) (*Terminal, error)

NewIntTerminal is a parser utility function that parses the int value out of the input string and returns a Terminal of type int.

func NewStringTerminal

func NewStringTerminal(slit string) (*Terminal, error)

NewStringTerminal is a parser utility function that returns a Terminal of type string given a string literal. The input string is also unquoted.

func NewUintTerminal

func NewUintTerminal(slit string) (*Terminal, error)

NewUintTerminal is a parser utility function that parses the uint value out of the input string and returns a Terminal of type uint.

func NewVariableTerminal

func NewVariableTerminal(typ types.Type) (*Terminal, error)

NewVariableTerminal is a parser utility function that returns a Terminal given a type.

func SetTerminalSpace

func SetTerminalSpace(term interface{}, s interface{}) *Terminal

SetTerminalSpace is a parser utility function that takes a Terminal and a Space and places the Space inside the returned Terminal.

func (*Terminal) Compare

func (this *Terminal) Compare(that *Terminal) int

func (*Terminal) Descriptor

func (*Terminal) Descriptor() ([]byte, []int)

func (*Terminal) Equal

func (this *Terminal) Equal(that *Terminal) bool

func (*Terminal) GetBefore

func (m *Terminal) GetBefore() *Space

func (*Terminal) GetBoolValue

func (m *Terminal) GetBoolValue() bool

func (*Terminal) GetBytesValue

func (m *Terminal) GetBytesValue() []byte

func (*Terminal) GetDoubleValue

func (m *Terminal) GetDoubleValue() float64

func (*Terminal) GetIntValue

func (m *Terminal) GetIntValue() int64

func (*Terminal) GetLiteral

func (m *Terminal) GetLiteral() string

func (*Terminal) GetStringValue

func (m *Terminal) GetStringValue() string

func (*Terminal) GetUintValue

func (m *Terminal) GetUintValue() uint64

func (*Terminal) GetVariable

func (m *Terminal) GetVariable() *Variable

func (*Terminal) Marshal

func (m *Terminal) Marshal() (dAtA []byte, err error)

func (*Terminal) MarshalTo

func (m *Terminal) MarshalTo(dAtA []byte) (int, error)

func (*Terminal) ProtoMessage

func (*Terminal) ProtoMessage()

func (*Terminal) Reset

func (m *Terminal) Reset()

func (*Terminal) Size

func (m *Terminal) Size() (n int)

func (*Terminal) String

func (this *Terminal) String() string

String returns the relapse string representation of the Terminal instance.

func (*Terminal) Unmarshal

func (m *Terminal) Unmarshal(dAtA []byte) error

func (*Terminal) Walk

func (this *Terminal) Walk(v Visitor)

Walk visits Terminal and its possible Variable.

func (*Terminal) XXX_DiscardUnknown

func (m *Terminal) XXX_DiscardUnknown()

func (*Terminal) XXX_Marshal

func (m *Terminal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Terminal) XXX_Merge

func (dst *Terminal) XXX_Merge(src proto.Message)

func (*Terminal) XXX_Size

func (m *Terminal) XXX_Size() int

func (*Terminal) XXX_Unmarshal

func (m *Terminal) XXX_Unmarshal(b []byte) error

type TreeNode

type TreeNode struct {
	Name    *NameExpr `protobuf:"bytes,1,opt,name=Name" json:"Name,omitempty"`
	Colon   *Keyword  `protobuf:"bytes,2,opt,name=Colon" json:"Colon,omitempty"`
	Pattern *Pattern  `protobuf:"bytes,3,opt,name=Pattern" json:"Pattern,omitempty"`
}

TreeNode is the ast node for the TreeNode pattern.

func (*TreeNode) Descriptor

func (*TreeNode) Descriptor() ([]byte, []int)

func (*TreeNode) GetColon

func (m *TreeNode) GetColon() *Keyword

func (*TreeNode) GetName

func (m *TreeNode) GetName() *NameExpr

func (*TreeNode) GetPattern

func (m *TreeNode) GetPattern() *Pattern

func (*TreeNode) Marshal

func (m *TreeNode) Marshal() (dAtA []byte, err error)

func (*TreeNode) MarshalTo

func (m *TreeNode) MarshalTo(dAtA []byte) (int, error)

func (*TreeNode) ProtoMessage

func (*TreeNode) ProtoMessage()

func (*TreeNode) Reset

func (m *TreeNode) Reset()

func (*TreeNode) Size

func (m *TreeNode) Size() (n int)

func (*TreeNode) String

func (this *TreeNode) String() string

String returns the relapse string representation of the TreeNode instance.

func (*TreeNode) Unmarshal

func (m *TreeNode) Unmarshal(dAtA []byte) error

func (*TreeNode) Walk

func (this *TreeNode) Walk(v Visitor)

Walk visits the TreeNode pattern, its name and its pattern.

func (*TreeNode) XXX_DiscardUnknown

func (m *TreeNode) XXX_DiscardUnknown()

func (*TreeNode) XXX_Marshal

func (m *TreeNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TreeNode) XXX_Merge

func (dst *TreeNode) XXX_Merge(src proto.Message)

func (*TreeNode) XXX_Size

func (m *TreeNode) XXX_Size() int

func (*TreeNode) XXX_Unmarshal

func (m *TreeNode) XXX_Unmarshal(b []byte) error

type Variable

type Variable struct {
	Type types.Type `protobuf:"varint,2,opt,name=Type,enum=types.Type" json:"Type"`
}

Variable is a terminal.

func (*Variable) Descriptor

func (*Variable) Descriptor() ([]byte, []int)

func (*Variable) GetType

func (m *Variable) GetType() types.Type

func (*Variable) Marshal

func (m *Variable) Marshal() (dAtA []byte, err error)

func (*Variable) MarshalTo

func (m *Variable) MarshalTo(dAtA []byte) (int, error)

func (*Variable) ProtoMessage

func (*Variable) ProtoMessage()

func (*Variable) Reset

func (m *Variable) Reset()

func (*Variable) Size

func (m *Variable) Size() (n int)

func (*Variable) String

func (this *Variable) String() string

String returns the relapse string representation of the Variable instance.

func (*Variable) Unmarshal

func (m *Variable) Unmarshal(dAtA []byte) error

func (*Variable) Walk

func (this *Variable) Walk(v Visitor)

Walk visits Variable.

func (*Variable) XXX_DiscardUnknown

func (m *Variable) XXX_DiscardUnknown()

func (*Variable) XXX_Marshal

func (m *Variable) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Variable) XXX_Merge

func (dst *Variable) XXX_Merge(src proto.Message)

func (*Variable) XXX_Size

func (m *Variable) XXX_Size() int

func (*Variable) XXX_Unmarshal

func (m *Variable) XXX_Unmarshal(b []byte) error

type Visitor

type Visitor interface {
	//Visit takes in an ast type and should return another type that implementes the Visitor interface.
	Visit(node interface{}) interface{}
}

Visitor is used to do a top down walk through the expression tree using the Walk methods.

type ZAny

type ZAny struct {
	Star *Keyword `protobuf:"bytes,1,opt,name=Star" json:"Star,omitempty"`
}

ZAny is the ast node for the ZAny pattern.

func (*ZAny) Descriptor

func (*ZAny) Descriptor() ([]byte, []int)

func (*ZAny) GetStar

func (m *ZAny) GetStar() *Keyword

func (*ZAny) Marshal

func (m *ZAny) Marshal() (dAtA []byte, err error)

func (*ZAny) MarshalTo

func (m *ZAny) MarshalTo(dAtA []byte) (int, error)

func (*ZAny) ProtoMessage

func (*ZAny) ProtoMessage()

func (*ZAny) Reset

func (m *ZAny) Reset()

func (*ZAny) Size

func (m *ZAny) Size() (n int)

func (*ZAny) String

func (this *ZAny) String() string

String returns the relapse string representation of the ZAny instance.

func (*ZAny) Unmarshal

func (m *ZAny) Unmarshal(dAtA []byte) error

func (*ZAny) Walk

func (this *ZAny) Walk(v Visitor)

Walk visits the ZAny pattern.

func (*ZAny) XXX_DiscardUnknown

func (m *ZAny) XXX_DiscardUnknown()

func (*ZAny) XXX_Marshal

func (m *ZAny) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ZAny) XXX_Merge

func (dst *ZAny) XXX_Merge(src proto.Message)

func (*ZAny) XXX_Size

func (m *ZAny) XXX_Size() int

func (*ZAny) XXX_Unmarshal

func (m *ZAny) XXX_Unmarshal(b []byte) error

type ZeroOrMore

type ZeroOrMore struct {
	OpenParen  *Keyword `protobuf:"bytes,1,opt,name=OpenParen" json:"OpenParen,omitempty"`
	Pattern    *Pattern `protobuf:"bytes,2,opt,name=Pattern" json:"Pattern,omitempty"`
	CloseParen *Keyword `protobuf:"bytes,3,opt,name=CloseParen" json:"CloseParen,omitempty"`
	Star       *Keyword `protobuf:"bytes,4,opt,name=Star" json:"Star,omitempty"`
}

ZeroOrMore is the ast node for the ZeroOrMore pattern.

func (*ZeroOrMore) Descriptor

func (*ZeroOrMore) Descriptor() ([]byte, []int)

func (*ZeroOrMore) GetCloseParen

func (m *ZeroOrMore) GetCloseParen() *Keyword

func (*ZeroOrMore) GetOpenParen

func (m *ZeroOrMore) GetOpenParen() *Keyword

func (*ZeroOrMore) GetPattern

func (m *ZeroOrMore) GetPattern() *Pattern

func (*ZeroOrMore) GetStar

func (m *ZeroOrMore) GetStar() *Keyword

func (*ZeroOrMore) Marshal

func (m *ZeroOrMore) Marshal() (dAtA []byte, err error)

func (*ZeroOrMore) MarshalTo

func (m *ZeroOrMore) MarshalTo(dAtA []byte) (int, error)

func (*ZeroOrMore) ProtoMessage

func (*ZeroOrMore) ProtoMessage()

func (*ZeroOrMore) Reset

func (m *ZeroOrMore) Reset()

func (*ZeroOrMore) Size

func (m *ZeroOrMore) Size() (n int)

func (*ZeroOrMore) String

func (this *ZeroOrMore) String() string

String returns the relapse string representation of the ZeroOrMore instance.

func (*ZeroOrMore) Unmarshal

func (m *ZeroOrMore) Unmarshal(dAtA []byte) error

func (*ZeroOrMore) Walk

func (this *ZeroOrMore) Walk(v Visitor)

Walk visits the ZeroOrMore pattern and its pattern.

func (*ZeroOrMore) XXX_DiscardUnknown

func (m *ZeroOrMore) XXX_DiscardUnknown()

func (*ZeroOrMore) XXX_Marshal

func (m *ZeroOrMore) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ZeroOrMore) XXX_Merge

func (dst *ZeroOrMore) XXX_Merge(src proto.Message)

func (*ZeroOrMore) XXX_Size

func (m *ZeroOrMore) XXX_Size() int

func (*ZeroOrMore) XXX_Unmarshal

func (m *ZeroOrMore) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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