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 ¶
- Variables
- func BuiltInFunctionName(symbol string) string
- func FunctionNameToBuiltIn(symbol string) func(*Expr) *Expr
- func HasNot(g *Grammar) bool
- func Strip(slit string, sub string) []byte
- func ToFloat64(tok []byte) *float64
- func ToInt64(tok []byte) *int64
- func ToString(s1 string) string
- func ToUint64(tok []byte) *uint64
- type And
- func (*And) Descriptor() ([]byte, []int)
- func (m *And) GetAmpersand() *Keyword
- func (m *And) GetCloseParen() *Keyword
- func (m *And) GetLeftPattern() *Pattern
- func (m *And) GetOpenParen() *Keyword
- func (m *And) GetRightPattern() *Pattern
- func (m *And) Marshal() (dAtA []byte, err error)
- func (m *And) MarshalTo(dAtA []byte) (int, error)
- func (*And) ProtoMessage()
- func (m *And) Reset()
- func (m *And) Size() (n int)
- func (this *And) String() string
- func (m *And) Unmarshal(dAtA []byte) error
- func (this *And) Walk(v Visitor)
- func (m *And) XXX_DiscardUnknown()
- func (m *And) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *And) XXX_Merge(src proto.Message)
- func (m *And) XXX_Size() int
- func (m *And) XXX_Unmarshal(b []byte) error
- type AnyName
- func (*AnyName) Descriptor() ([]byte, []int)
- func (m *AnyName) GetUnderscore() *Keyword
- func (m *AnyName) Marshal() (dAtA []byte, err error)
- func (m *AnyName) MarshalTo(dAtA []byte) (int, error)
- func (*AnyName) ProtoMessage()
- func (m *AnyName) Reset()
- func (m *AnyName) Size() (n int)
- func (this *AnyName) String() string
- func (m *AnyName) Unmarshal(dAtA []byte) error
- func (this *AnyName) Walk(v Visitor)
- func (m *AnyName) XXX_DiscardUnknown()
- func (m *AnyName) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *AnyName) XXX_Merge(src proto.Message)
- func (m *AnyName) XXX_Size() int
- func (m *AnyName) XXX_Unmarshal(b []byte) error
- type AnyNameExcept
- func (*AnyNameExcept) Descriptor() ([]byte, []int)
- func (m *AnyNameExcept) GetCloseParen() *Keyword
- func (m *AnyNameExcept) GetExcept() *NameExpr
- func (m *AnyNameExcept) GetExclamation() *Keyword
- func (m *AnyNameExcept) GetOpenParen() *Keyword
- func (m *AnyNameExcept) Marshal() (dAtA []byte, err error)
- func (m *AnyNameExcept) MarshalTo(dAtA []byte) (int, error)
- func (*AnyNameExcept) ProtoMessage()
- func (m *AnyNameExcept) Reset()
- func (m *AnyNameExcept) Size() (n int)
- func (this *AnyNameExcept) String() string
- func (m *AnyNameExcept) Unmarshal(dAtA []byte) error
- func (this *AnyNameExcept) Walk(v Visitor)
- func (m *AnyNameExcept) XXX_DiscardUnknown()
- func (m *AnyNameExcept) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *AnyNameExcept) XXX_Merge(src proto.Message)
- func (m *AnyNameExcept) XXX_Size() int
- func (m *AnyNameExcept) XXX_Unmarshal(b []byte) error
- type BuiltIn
- func (*BuiltIn) Descriptor() ([]byte, []int)
- func (m *BuiltIn) GetExpr() *Expr
- func (m *BuiltIn) GetSymbol() *Keyword
- func (m *BuiltIn) Marshal() (dAtA []byte, err error)
- func (m *BuiltIn) MarshalTo(dAtA []byte) (int, error)
- func (*BuiltIn) ProtoMessage()
- func (m *BuiltIn) Reset()
- func (m *BuiltIn) Size() (n int)
- func (this *BuiltIn) String() string
- func (m *BuiltIn) Unmarshal(dAtA []byte) error
- func (this *BuiltIn) Walk(v Visitor)
- func (m *BuiltIn) XXX_DiscardUnknown()
- func (m *BuiltIn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *BuiltIn) XXX_Merge(src proto.Message)
- func (m *BuiltIn) XXX_Size() int
- func (m *BuiltIn) XXX_Unmarshal(b []byte) error
- type Comment
- type Concat
- func (*Concat) Descriptor() ([]byte, []int)
- func (m *Concat) GetCloseBracket() *Keyword
- func (m *Concat) GetComma() *Keyword
- func (m *Concat) GetExtraComma() *Keyword
- func (m *Concat) GetLeftPattern() *Pattern
- func (m *Concat) GetOpenBracket() *Keyword
- func (m *Concat) GetRightPattern() *Pattern
- func (m *Concat) Marshal() (dAtA []byte, err error)
- func (m *Concat) MarshalTo(dAtA []byte) (int, error)
- func (*Concat) ProtoMessage()
- func (m *Concat) Reset()
- func (m *Concat) Size() (n int)
- func (this *Concat) String() string
- func (m *Concat) Unmarshal(dAtA []byte) error
- func (this *Concat) Walk(v Visitor)
- func (m *Concat) XXX_DiscardUnknown()
- func (m *Concat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Concat) XXX_Merge(src proto.Message)
- func (m *Concat) XXX_Size() int
- func (m *Concat) XXX_Unmarshal(b []byte) error
- type Contains
- func (*Contains) Descriptor() ([]byte, []int)
- func (m *Contains) GetDot() *Keyword
- func (m *Contains) GetPattern() *Pattern
- func (m *Contains) Marshal() (dAtA []byte, err error)
- func (m *Contains) MarshalTo(dAtA []byte) (int, error)
- func (*Contains) ProtoMessage()
- func (m *Contains) Reset()
- func (m *Contains) Size() (n int)
- func (this *Contains) String() string
- func (m *Contains) Unmarshal(dAtA []byte) error
- func (this *Contains) Walk(v Visitor)
- func (m *Contains) XXX_DiscardUnknown()
- func (m *Contains) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Contains) XXX_Merge(src proto.Message)
- func (m *Contains) XXX_Size() int
- func (m *Contains) XXX_Unmarshal(b []byte) error
- type Empty
- func (*Empty) Descriptor() ([]byte, []int)
- func (m *Empty) GetEmpty() *Keyword
- func (m *Empty) Marshal() (dAtA []byte, err error)
- func (m *Empty) MarshalTo(dAtA []byte) (int, error)
- func (*Empty) ProtoMessage()
- func (m *Empty) Reset()
- func (m *Empty) Size() (n int)
- func (this *Empty) String() string
- func (m *Empty) Unmarshal(dAtA []byte) error
- func (this *Empty) Walk(v Visitor)
- func (m *Empty) XXX_DiscardUnknown()
- func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Empty) XXX_Merge(src proto.Message)
- func (m *Empty) XXX_Size() int
- func (m *Empty) XXX_Unmarshal(b []byte) error
- type Expr
- func NewBoolList(elems ...*Expr) *Expr
- func NewBoolVar() *Expr
- func NewBytesConst(buf []byte) *Expr
- func NewBytesList(elems ...*Expr) *Expr
- func NewBytesVar() *Expr
- func NewDoubleConst(d float64) *Expr
- func NewDoubleList(elems ...*Expr) *Expr
- func NewDoubleVar() *Expr
- func NewEqual(e *Expr) *Expr
- func NewFalse() *Expr
- func NewFunction(name string, params ...*Expr) *Expr
- func NewGreaterEqual(e *Expr) *Expr
- func NewGreaterThan(e *Expr) *Expr
- func NewHasElem(e *Expr) *Expr
- func NewHasPrefix(e *Expr) *Expr
- func NewHasSuffix(e *Expr) *Expr
- func NewIntConst(i int64) *Expr
- func NewIntList(elems ...*Expr) *Expr
- func NewIntVar() *Expr
- func NewLessEqual(e *Expr) *Expr
- func NewLessThan(e *Expr) *Expr
- func NewList(typ types.Type, elems ...*Expr) *Expr
- func NewNestedFunction(name string, params ...*Expr) *Expr
- func NewNotEqual(e *Expr) *Expr
- func NewRegex(e *Expr) *Expr
- func NewStringConst(s string) *Expr
- func NewStringList(elems ...*Expr) *Expr
- func NewStringVar() *Expr
- func NewTrue() *Expr
- func NewType(e *Expr) *Expr
- func NewUintConst(i uint64) *Expr
- func NewUintList(elems ...*Expr) *Expr
- func NewUintVar() *Expr
- func NewVar(typ types.Type) *Expr
- func SetExprComma(e interface{}, c interface{}) *Expr
- func SetRightArrow(expr interface{}, rightArrow interface{}) *Expr
- func (this *Expr) Clone() *Expr
- func (*Expr) Descriptor() ([]byte, []int)
- func (m *Expr) GetBuiltIn() *BuiltIn
- func (m *Expr) GetComma() *Keyword
- func (m *Expr) GetFunction() *Function
- func (m *Expr) GetList() *List
- func (m *Expr) GetRightArrow() *Keyword
- func (m *Expr) GetTerminal() *Terminal
- func (this *Expr) GoString() string
- func (this *Expr) HasVar() bool
- func (m *Expr) Marshal() (dAtA []byte, err error)
- func (m *Expr) MarshalTo(dAtA []byte) (int, error)
- func (*Expr) ProtoMessage()
- func (m *Expr) Reset()
- func (m *Expr) Size() (n int)
- func (this *Expr) String() string
- func (m *Expr) Unmarshal(dAtA []byte) error
- func (this *Expr) Walk(v Visitor)
- func (m *Expr) XXX_DiscardUnknown()
- func (m *Expr) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Expr) XXX_Merge(src proto.Message)
- func (m *Expr) XXX_Size() int
- func (m *Expr) XXX_Unmarshal(b []byte) error
- type Function
- func (*Function) Descriptor() ([]byte, []int)
- func (m *Function) GetBefore() *Space
- func (m *Function) GetCloseParen() *Keyword
- func (m *Function) GetName() string
- func (m *Function) GetOpenParen() *Keyword
- func (m *Function) GetParams() []*Expr
- func (this *Function) HasVar() bool
- func (m *Function) Marshal() (dAtA []byte, err error)
- func (m *Function) MarshalTo(dAtA []byte) (int, error)
- func (*Function) ProtoMessage()
- func (m *Function) Reset()
- func (m *Function) Size() (n int)
- func (this *Function) String() string
- func (m *Function) Unmarshal(dAtA []byte) error
- func (this *Function) Walk(v Visitor)
- func (m *Function) XXX_DiscardUnknown()
- func (m *Function) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Function) XXX_Merge(src proto.Message)
- func (m *Function) XXX_Size() int
- func (m *Function) XXX_Unmarshal(b []byte) error
- type Grammar
- func (this *Grammar) AddRef(name string, p *Pattern) *Grammar
- func (this *Grammar) Clone() *Grammar
- func (*Grammar) Descriptor() ([]byte, []int)
- func (this *Grammar) Equal(that *Grammar) bool
- func (this *Grammar) Format()
- func (m *Grammar) GetAfter() *Space
- func (m *Grammar) GetPatternDecls() []*PatternDecl
- func (m *Grammar) GetTopPattern() *Pattern
- func (this *Grammar) GoString() string
- func (m *Grammar) Marshal() (dAtA []byte, err error)
- func (m *Grammar) MarshalTo(dAtA []byte) (int, error)
- func (*Grammar) ProtoMessage()
- func (m *Grammar) Reset()
- func (m *Grammar) Size() (n int)
- func (this *Grammar) String() string
- func (m *Grammar) Unmarshal(dAtA []byte) error
- func (this *Grammar) Walk(v Visitor)
- func (m *Grammar) XXX_DiscardUnknown()
- func (m *Grammar) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Grammar) XXX_Merge(src proto.Message)
- func (m *Grammar) XXX_Size() int
- func (m *Grammar) XXX_Unmarshal(b []byte) error
- type Interleave
- func (*Interleave) Descriptor() ([]byte, []int)
- func (m *Interleave) GetCloseCurly() *Keyword
- func (m *Interleave) GetExtraSemiColon() *Keyword
- func (m *Interleave) GetLeftPattern() *Pattern
- func (m *Interleave) GetOpenCurly() *Keyword
- func (m *Interleave) GetRightPattern() *Pattern
- func (m *Interleave) GetSemiColon() *Keyword
- func (m *Interleave) Marshal() (dAtA []byte, err error)
- func (m *Interleave) MarshalTo(dAtA []byte) (int, error)
- func (*Interleave) ProtoMessage()
- func (m *Interleave) Reset()
- func (m *Interleave) Size() (n int)
- func (this *Interleave) String() string
- func (m *Interleave) Unmarshal(dAtA []byte) error
- func (this *Interleave) Walk(v Visitor)
- func (m *Interleave) XXX_DiscardUnknown()
- func (m *Interleave) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Interleave) XXX_Merge(src proto.Message)
- func (m *Interleave) XXX_Size() int
- func (m *Interleave) XXX_Unmarshal(b []byte) error
- type Keyword
- func (*Keyword) Descriptor() ([]byte, []int)
- func (m *Keyword) GetBefore() *Space
- func (m *Keyword) GetValue() string
- func (m *Keyword) Marshal() (dAtA []byte, err error)
- func (m *Keyword) MarshalTo(dAtA []byte) (int, error)
- func (*Keyword) ProtoMessage()
- func (m *Keyword) Reset()
- func (m *Keyword) Size() (n int)
- func (this *Keyword) String() string
- func (m *Keyword) Unmarshal(dAtA []byte) error
- func (m *Keyword) XXX_DiscardUnknown()
- func (m *Keyword) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Keyword) XXX_Merge(src proto.Message)
- func (m *Keyword) XXX_Size() int
- func (m *Keyword) XXX_Unmarshal(b []byte) error
- type LeafNode
- func (*LeafNode) Descriptor() ([]byte, []int)
- func (m *LeafNode) GetExpr() *Expr
- func (m *LeafNode) Marshal() (dAtA []byte, err error)
- func (m *LeafNode) MarshalTo(dAtA []byte) (int, error)
- func (*LeafNode) ProtoMessage()
- func (m *LeafNode) Reset()
- func (m *LeafNode) Size() (n int)
- func (this *LeafNode) String() string
- func (m *LeafNode) Unmarshal(dAtA []byte) error
- func (this *LeafNode) Walk(v Visitor)
- func (m *LeafNode) XXX_DiscardUnknown()
- func (m *LeafNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *LeafNode) XXX_Merge(src proto.Message)
- func (m *LeafNode) XXX_Size() int
- func (m *LeafNode) XXX_Unmarshal(b []byte) error
- type List
- func (*List) Descriptor() ([]byte, []int)
- func (m *List) GetBefore() *Space
- func (m *List) GetCloseCurly() *Keyword
- func (m *List) GetElems() []*Expr
- func (m *List) GetOpenCurly() *Keyword
- func (m *List) GetType() types.Type
- func (this *List) HasVar() bool
- func (m *List) Marshal() (dAtA []byte, err error)
- func (m *List) MarshalTo(dAtA []byte) (int, error)
- func (*List) ProtoMessage()
- func (m *List) Reset()
- func (m *List) Size() (n int)
- func (this *List) String() string
- func (m *List) Unmarshal(dAtA []byte) error
- func (this *List) Walk(v Visitor)
- func (m *List) XXX_DiscardUnknown()
- func (m *List) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *List) XXX_Merge(src proto.Message)
- func (m *List) XXX_Size() int
- func (m *List) XXX_Unmarshal(b []byte) error
- type Name
- func (*Name) Descriptor() ([]byte, []int)
- func (m *Name) GetBefore() *Space
- func (m *Name) GetBoolValue() bool
- func (m *Name) GetBytesValue() []byte
- func (m *Name) GetDoubleValue() float64
- func (m *Name) GetIntValue() int64
- func (m *Name) GetStringValue() string
- func (m *Name) GetUintValue() uint64
- func (m *Name) Marshal() (dAtA []byte, err error)
- func (m *Name) MarshalTo(dAtA []byte) (int, error)
- func (*Name) ProtoMessage()
- func (m *Name) Reset()
- func (m *Name) Size() (n int)
- func (this *Name) String() string
- func (m *Name) Unmarshal(dAtA []byte) error
- func (this *Name) Walk(v Visitor)
- func (m *Name) XXX_DiscardUnknown()
- func (m *Name) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Name) XXX_Merge(src proto.Message)
- func (m *Name) XXX_Size() int
- func (m *Name) XXX_Unmarshal(b []byte) error
- type NameChoice
- func (*NameChoice) Descriptor() ([]byte, []int)
- func (m *NameChoice) GetCloseParen() *Keyword
- func (m *NameChoice) GetLeft() *NameExpr
- func (m *NameChoice) GetOpenParen() *Keyword
- func (m *NameChoice) GetPipe() *Keyword
- func (m *NameChoice) GetRight() *NameExpr
- func (m *NameChoice) Marshal() (dAtA []byte, err error)
- func (m *NameChoice) MarshalTo(dAtA []byte) (int, error)
- func (*NameChoice) ProtoMessage()
- func (m *NameChoice) Reset()
- func (m *NameChoice) Size() (n int)
- func (this *NameChoice) String() string
- func (m *NameChoice) Unmarshal(dAtA []byte) error
- func (this *NameChoice) Walk(v Visitor)
- func (m *NameChoice) XXX_DiscardUnknown()
- func (m *NameChoice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *NameChoice) XXX_Merge(src proto.Message)
- func (m *NameChoice) XXX_Size() int
- func (m *NameChoice) XXX_Unmarshal(b []byte) error
- type NameExpr
- func NewAnyName() *NameExpr
- func NewAnyNameExcept(name *NameExpr) *NameExpr
- func NewBoolName(name bool) *NameExpr
- func NewBytesName(name []byte) *NameExpr
- func NewDoubleName(name float64) *NameExpr
- func NewIntName(name int64) *NameExpr
- func NewNameChoice(names ...*NameExpr) *NameExpr
- func NewSDTName(space *Space, term *Terminal) *NameExpr
- func NewStringName(name string) *NameExpr
- func NewUintName(name uint64) *NameExpr
- func (this *NameExpr) Compare(that *NameExpr) int
- func (*NameExpr) Descriptor() ([]byte, []int)
- func (this *NameExpr) Equal(that *NameExpr) bool
- func (m *NameExpr) GetAnyName() *AnyName
- func (m *NameExpr) GetAnyNameExcept() *AnyNameExcept
- func (m *NameExpr) GetName() *Name
- func (m *NameExpr) GetNameChoice() *NameChoice
- func (this *NameExpr) GetValue() interface{}
- func (m *NameExpr) Marshal() (dAtA []byte, err error)
- func (m *NameExpr) MarshalTo(dAtA []byte) (int, error)
- func (*NameExpr) ProtoMessage()
- func (m *NameExpr) Reset()
- func (this *NameExpr) SetValue(value interface{}) bool
- func (m *NameExpr) Size() (n int)
- func (this *NameExpr) String() string
- func (m *NameExpr) Unmarshal(dAtA []byte) error
- func (this *NameExpr) Walk(v Visitor)
- func (m *NameExpr) XXX_DiscardUnknown()
- func (m *NameExpr) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *NameExpr) XXX_Merge(src proto.Message)
- func (m *NameExpr) XXX_Size() int
- func (m *NameExpr) XXX_Unmarshal(b []byte) error
- type Not
- func (*Not) Descriptor() ([]byte, []int)
- func (m *Not) GetCloseParen() *Keyword
- func (m *Not) GetExclamation() *Keyword
- func (m *Not) GetOpenParen() *Keyword
- func (m *Not) GetPattern() *Pattern
- func (m *Not) Marshal() (dAtA []byte, err error)
- func (m *Not) MarshalTo(dAtA []byte) (int, error)
- func (*Not) ProtoMessage()
- func (m *Not) Reset()
- func (m *Not) Size() (n int)
- func (this *Not) String() string
- func (m *Not) Unmarshal(dAtA []byte) error
- func (this *Not) Walk(v Visitor)
- func (m *Not) XXX_DiscardUnknown()
- func (m *Not) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Not) XXX_Merge(src proto.Message)
- func (m *Not) XXX_Size() int
- func (m *Not) XXX_Unmarshal(b []byte) error
- type Optional
- func (*Optional) Descriptor() ([]byte, []int)
- func (m *Optional) GetCloseParen() *Keyword
- func (m *Optional) GetOpenParen() *Keyword
- func (m *Optional) GetPattern() *Pattern
- func (m *Optional) GetQuestionMark() *Keyword
- func (m *Optional) Marshal() (dAtA []byte, err error)
- func (m *Optional) MarshalTo(dAtA []byte) (int, error)
- func (*Optional) ProtoMessage()
- func (m *Optional) Reset()
- func (m *Optional) Size() (n int)
- func (this *Optional) String() string
- func (m *Optional) Unmarshal(dAtA []byte) error
- func (this *Optional) Walk(v Visitor)
- func (m *Optional) XXX_DiscardUnknown()
- func (m *Optional) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Optional) XXX_Merge(src proto.Message)
- func (m *Optional) XXX_Size() int
- func (m *Optional) XXX_Unmarshal(b []byte) error
- type Or
- func (*Or) Descriptor() ([]byte, []int)
- func (m *Or) GetCloseParen() *Keyword
- func (m *Or) GetLeftPattern() *Pattern
- func (m *Or) GetOpenParen() *Keyword
- func (m *Or) GetPipe() *Keyword
- func (m *Or) GetRightPattern() *Pattern
- func (m *Or) Marshal() (dAtA []byte, err error)
- func (m *Or) MarshalTo(dAtA []byte) (int, error)
- func (*Or) ProtoMessage()
- func (m *Or) Reset()
- func (m *Or) Size() (n int)
- func (this *Or) String() string
- func (m *Or) Unmarshal(dAtA []byte) error
- func (this *Or) Walk(v Visitor)
- func (m *Or) XXX_DiscardUnknown()
- func (m *Or) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Or) XXX_Merge(src proto.Message)
- func (m *Or) XXX_Size() int
- func (m *Or) XXX_Unmarshal(b []byte) error
- type Pattern
- func NewAnd(patterns ...*Pattern) *Pattern
- func NewConcat(patterns ...*Pattern) *Pattern
- func NewContains(pattern *Pattern) *Pattern
- func NewEmpty() *Pattern
- func NewInterleave(patterns ...*Pattern) *Pattern
- func NewLeafNode(e *Expr) *Pattern
- func NewNot(pattern *Pattern) *Pattern
- func NewOptional(pattern *Pattern) *Pattern
- func NewOr(patterns ...*Pattern) *Pattern
- func NewReference(name string) *Pattern
- func NewTreeNode(name *NameExpr, pattern *Pattern) *Pattern
- func NewZAny() *Pattern
- func NewZeroOrMore(pattern *Pattern) *Pattern
- func (this *Pattern) Clone() *Pattern
- func (this *Pattern) Compare(that *Pattern) int
- func (*Pattern) Descriptor() ([]byte, []int)
- func (this *Pattern) Equal(that *Pattern) bool
- func (this *Pattern) Format()
- func (m *Pattern) GetAnd() *And
- func (m *Pattern) GetConcat() *Concat
- func (m *Pattern) GetContains() *Contains
- func (m *Pattern) GetEmpty() *Empty
- func (m *Pattern) GetInterleave() *Interleave
- func (m *Pattern) GetLeafNode() *LeafNode
- func (m *Pattern) GetNot() *Not
- func (m *Pattern) GetOptional() *Optional
- func (m *Pattern) GetOr() *Or
- func (m *Pattern) GetReference() *Reference
- func (m *Pattern) GetTreeNode() *TreeNode
- func (this *Pattern) GetValue() interface{}
- func (m *Pattern) GetZAny() *ZAny
- func (m *Pattern) GetZeroOrMore() *ZeroOrMore
- func (this *Pattern) GoString() string
- func (this *Pattern) Grammar() *Grammar
- func (p *Pattern) Hash() uint64
- func (m *Pattern) Marshal() (dAtA []byte, err error)
- func (m *Pattern) MarshalTo(dAtA []byte) (int, error)
- func (*Pattern) ProtoMessage()
- func (m *Pattern) Reset()
- func (this *Pattern) SetValue(value interface{}) bool
- func (m *Pattern) Size() (n int)
- func (this *Pattern) String() string
- func (m *Pattern) Unmarshal(dAtA []byte) error
- func (this *Pattern) Walk(v Visitor)
- func (m *Pattern) XXX_DiscardUnknown()
- func (m *Pattern) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Pattern) XXX_Merge(src proto.Message)
- func (m *Pattern) XXX_Size() int
- func (m *Pattern) XXX_Unmarshal(b []byte) error
- type PatternDecl
- func (*PatternDecl) Descriptor() ([]byte, []int)
- func (m *PatternDecl) GetBefore() *Space
- func (m *PatternDecl) GetEq() *Keyword
- func (m *PatternDecl) GetHash() *Keyword
- func (m *PatternDecl) GetName() string
- func (m *PatternDecl) GetPattern() *Pattern
- func (m *PatternDecl) Marshal() (dAtA []byte, err error)
- func (m *PatternDecl) MarshalTo(dAtA []byte) (int, error)
- func (*PatternDecl) ProtoMessage()
- func (m *PatternDecl) Reset()
- func (m *PatternDecl) Size() (n int)
- func (this *PatternDecl) String() string
- func (m *PatternDecl) Unmarshal(dAtA []byte) error
- func (this *PatternDecl) Walk(v Visitor)
- func (m *PatternDecl) XXX_DiscardUnknown()
- func (m *PatternDecl) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *PatternDecl) XXX_Merge(src proto.Message)
- func (m *PatternDecl) XXX_Size() int
- func (m *PatternDecl) XXX_Unmarshal(b []byte) error
- type RefLookup
- type Reference
- func (*Reference) Descriptor() ([]byte, []int)
- func (m *Reference) GetAt() *Keyword
- func (m *Reference) GetName() string
- func (m *Reference) Marshal() (dAtA []byte, err error)
- func (m *Reference) MarshalTo(dAtA []byte) (int, error)
- func (*Reference) ProtoMessage()
- func (m *Reference) Reset()
- func (m *Reference) Size() (n int)
- func (this *Reference) String() string
- func (m *Reference) Unmarshal(dAtA []byte) error
- func (this *Reference) Walk(v Visitor)
- func (m *Reference) XXX_DiscardUnknown()
- func (m *Reference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Reference) XXX_Merge(src proto.Message)
- func (m *Reference) XXX_Size() int
- func (m *Reference) XXX_Unmarshal(b []byte) error
- type Space
- func (*Space) Descriptor() ([]byte, []int)
- func (this *Space) Format()
- func (this *Space) GetAttachedComment() Comment
- func (this *Space) GetComments() []Comment
- func (m *Space) GetSpace() []string
- func (this *Space) HasAttachedComment() bool
- func (this *Space) HasComment() bool
- func (m *Space) Marshal() (dAtA []byte, err error)
- func (m *Space) MarshalTo(dAtA []byte) (int, error)
- func (*Space) ProtoMessage()
- func (m *Space) Reset()
- func (m *Space) Size() (n int)
- func (this *Space) String() string
- func (m *Space) Unmarshal(dAtA []byte) error
- func (m *Space) XXX_DiscardUnknown()
- func (m *Space) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Space) XXX_Merge(src proto.Message)
- func (m *Space) XXX_Size() int
- func (m *Space) XXX_Unmarshal(b []byte) error
- type Terminal
- func NewBoolTerminal(v interface{}) *Terminal
- func NewBytesTerminal(stringLit string) (*Terminal, error)
- func NewDoubleTerminal(slit string) (*Terminal, error)
- func NewIntTerminal(slit string) (*Terminal, error)
- func NewStringTerminal(slit string) (*Terminal, error)
- func NewUintTerminal(slit string) (*Terminal, error)
- func NewVariableTerminal(typ types.Type) (*Terminal, error)
- func SetTerminalSpace(term interface{}, s interface{}) *Terminal
- func (this *Terminal) Compare(that *Terminal) int
- func (*Terminal) Descriptor() ([]byte, []int)
- func (this *Terminal) Equal(that *Terminal) bool
- func (m *Terminal) GetBefore() *Space
- func (m *Terminal) GetBoolValue() bool
- func (m *Terminal) GetBytesValue() []byte
- func (m *Terminal) GetDoubleValue() float64
- func (m *Terminal) GetIntValue() int64
- func (m *Terminal) GetLiteral() string
- func (m *Terminal) GetStringValue() string
- func (m *Terminal) GetUintValue() uint64
- func (m *Terminal) GetVariable() *Variable
- func (m *Terminal) Marshal() (dAtA []byte, err error)
- func (m *Terminal) MarshalTo(dAtA []byte) (int, error)
- func (*Terminal) ProtoMessage()
- func (m *Terminal) Reset()
- func (m *Terminal) Size() (n int)
- func (this *Terminal) String() string
- func (m *Terminal) Unmarshal(dAtA []byte) error
- func (this *Terminal) Walk(v Visitor)
- func (m *Terminal) XXX_DiscardUnknown()
- func (m *Terminal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Terminal) XXX_Merge(src proto.Message)
- func (m *Terminal) XXX_Size() int
- func (m *Terminal) XXX_Unmarshal(b []byte) error
- type TreeNode
- func (*TreeNode) Descriptor() ([]byte, []int)
- func (m *TreeNode) GetColon() *Keyword
- func (m *TreeNode) GetName() *NameExpr
- func (m *TreeNode) GetPattern() *Pattern
- func (m *TreeNode) Marshal() (dAtA []byte, err error)
- func (m *TreeNode) MarshalTo(dAtA []byte) (int, error)
- func (*TreeNode) ProtoMessage()
- func (m *TreeNode) Reset()
- func (m *TreeNode) Size() (n int)
- func (this *TreeNode) String() string
- func (m *TreeNode) Unmarshal(dAtA []byte) error
- func (this *TreeNode) Walk(v Visitor)
- func (m *TreeNode) XXX_DiscardUnknown()
- func (m *TreeNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *TreeNode) XXX_Merge(src proto.Message)
- func (m *TreeNode) XXX_Size() int
- func (m *TreeNode) XXX_Unmarshal(b []byte) error
- type Variable
- func (*Variable) Descriptor() ([]byte, []int)
- func (m *Variable) GetType() types.Type
- func (m *Variable) Marshal() (dAtA []byte, err error)
- func (m *Variable) MarshalTo(dAtA []byte) (int, error)
- func (*Variable) ProtoMessage()
- func (m *Variable) Reset()
- func (m *Variable) Size() (n int)
- func (this *Variable) String() string
- func (m *Variable) Unmarshal(dAtA []byte) error
- func (this *Variable) Walk(v Visitor)
- func (m *Variable) XXX_DiscardUnknown()
- func (m *Variable) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Variable) XXX_Merge(src proto.Message)
- func (m *Variable) XXX_Size() int
- func (m *Variable) XXX_Unmarshal(b []byte) error
- type Visitor
- type ZAny
- func (*ZAny) Descriptor() ([]byte, []int)
- func (m *ZAny) GetStar() *Keyword
- func (m *ZAny) Marshal() (dAtA []byte, err error)
- func (m *ZAny) MarshalTo(dAtA []byte) (int, error)
- func (*ZAny) ProtoMessage()
- func (m *ZAny) Reset()
- func (m *ZAny) Size() (n int)
- func (this *ZAny) String() string
- func (m *ZAny) Unmarshal(dAtA []byte) error
- func (this *ZAny) Walk(v Visitor)
- func (m *ZAny) XXX_DiscardUnknown()
- func (m *ZAny) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *ZAny) XXX_Merge(src proto.Message)
- func (m *ZAny) XXX_Size() int
- func (m *ZAny) XXX_Unmarshal(b []byte) error
- type ZeroOrMore
- func (*ZeroOrMore) Descriptor() ([]byte, []int)
- func (m *ZeroOrMore) GetCloseParen() *Keyword
- func (m *ZeroOrMore) GetOpenParen() *Keyword
- func (m *ZeroOrMore) GetPattern() *Pattern
- func (m *ZeroOrMore) GetStar() *Keyword
- func (m *ZeroOrMore) Marshal() (dAtA []byte, err error)
- func (m *ZeroOrMore) MarshalTo(dAtA []byte) (int, error)
- func (*ZeroOrMore) ProtoMessage()
- func (m *ZeroOrMore) Reset()
- func (m *ZeroOrMore) Size() (n int)
- func (this *ZeroOrMore) String() string
- func (m *ZeroOrMore) Unmarshal(dAtA []byte) error
- func (this *ZeroOrMore) Walk(v Visitor)
- func (m *ZeroOrMore) XXX_DiscardUnknown()
- func (m *ZeroOrMore) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *ZeroOrMore) XXX_Merge(src proto.Message)
- func (m *ZeroOrMore) XXX_Size() int
- func (m *ZeroOrMore) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthRelapse = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowRelapse = fmt.Errorf("proto: integer overflow") )
Functions ¶
func BuiltInFunctionName ¶
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 ¶
FunctionNameToBuiltIn returns the builtin constructor for a given function name. If a symbol does not exist, nil is returned.
func Strip ¶
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 ¶
ToFloat64 is a parser utility function that returns a pointer to a parsed an float64 or panics.
func ToInt64 ¶
ToInt64 is a parser utility function that returns a pointer to a parsed an int64 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) GetAmpersand ¶
func (*And) GetCloseParen ¶
func (*And) GetLeftPattern ¶
func (*And) GetOpenParen ¶
func (*And) GetRightPattern ¶
func (*And) ProtoMessage ¶
func (*And) ProtoMessage()
func (*And) XXX_DiscardUnknown ¶
func (m *And) XXX_DiscardUnknown()
func (*And) XXX_Unmarshal ¶
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) GetUnderscore ¶
func (*AnyName) ProtoMessage ¶
func (*AnyName) ProtoMessage()
func (*AnyName) XXX_DiscardUnknown ¶
func (m *AnyName) XXX_DiscardUnknown()
func (*AnyName) XXX_Marshal ¶
func (*AnyName) XXX_Unmarshal ¶
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) 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) ProtoMessage ¶
func (*BuiltIn) ProtoMessage()
func (*BuiltIn) XXX_DiscardUnknown ¶
func (m *BuiltIn) XXX_DiscardUnknown()
func (*BuiltIn) XXX_Marshal ¶
func (*BuiltIn) XXX_Unmarshal ¶
type Comment ¶
type Comment string
Comment represents a relapse comment as a string
func (Comment) GetContent ¶
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) GetCloseBracket ¶
func (*Concat) GetExtraComma ¶
func (*Concat) GetLeftPattern ¶
func (*Concat) GetOpenBracket ¶
func (*Concat) GetRightPattern ¶
func (*Concat) ProtoMessage ¶
func (*Concat) ProtoMessage()
func (*Concat) XXX_DiscardUnknown ¶
func (m *Concat) XXX_DiscardUnknown()
func (*Concat) XXX_Marshal ¶
func (*Concat) XXX_Unmarshal ¶
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) GetPattern ¶
func (*Contains) ProtoMessage ¶
func (*Contains) ProtoMessage()
func (*Contains) String ¶
String returns the relapse string representation of the Contains instance.
func (*Contains) XXX_DiscardUnknown ¶
func (m *Contains) XXX_DiscardUnknown()
func (*Contains) XXX_Marshal ¶
func (*Contains) XXX_Unmarshal ¶
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) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) XXX_DiscardUnknown ¶
func (m *Empty) XXX_DiscardUnknown()
func (*Empty) XXX_Marshal ¶
func (*Empty) XXX_Unmarshal ¶
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 NewBoolVar ¶
func NewBoolVar() *Expr
NewBoolVar returns a new variable expression of type bool
$bool
func NewBytesConst ¶
NewBytesConst returns a new terminal expression containing the given bytes value.
[]byte(fmt.Sprintf("%#v", buf))
func NewBytesList ¶
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 ¶
NewDoubleConst returns a new terminal expression containing the given double value.
double(d)
func NewDoubleList ¶
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 NewFalse ¶
func NewFalse() *Expr
NewFalse returns a new terminal expression containing a false value.
false
func NewFunction ¶
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 NewIntConst ¶
NewIntConst returns a new terminal expression containing the given int value.
int(i)
func NewIntVar ¶
func NewIntVar() *Expr
NewIntVar returns a new variable expression of type int
$int
func NewNestedFunction ¶
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 NewStringConst ¶
NewStringConst returns a new terminal expression containing the given string value.
"s" `s`
func NewStringList ¶
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 NewUintConst ¶
NewUintConst returns a new terminal expression containing the given uint value.
uint(i)
func NewUintVar ¶
func NewUintVar() *Expr
NewUintVar returns a new variable expression of type uint
$uint
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) Descriptor ¶
func (*Expr) GetBuiltIn ¶
func (*Expr) GetFunction ¶
func (*Expr) GetRightArrow ¶
func (*Expr) GetTerminal ¶
func (*Expr) HasVar ¶
HasVar returns whether there exists a variable somewhere in the expression tree. This function is executed recursively.
func (*Expr) ProtoMessage ¶
func (*Expr) ProtoMessage()
func (*Expr) Walk ¶
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_Unmarshal ¶
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) GetCloseParen ¶
func (*Function) GetOpenParen ¶
func (*Function) HasVar ¶
HasVar returns whether there exists a varaible somewhere in the function parameters. This function is executed recursively.
func (*Function) ProtoMessage ¶
func (*Function) ProtoMessage()
func (*Function) String ¶
String returns the relapse string representation of the Function instance.
func (*Function) XXX_DiscardUnknown ¶
func (m *Function) XXX_DiscardUnknown()
func (*Function) XXX_Marshal ¶
func (*Function) XXX_Unmarshal ¶
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 ¶
NewGrammar converts a refenence lookup map into a Grammar.
func (*Grammar) Descriptor ¶
func (*Grammar) GetPatternDecls ¶
func (m *Grammar) GetPatternDecls() []*PatternDecl
func (*Grammar) GetTopPattern ¶
func (*Grammar) ProtoMessage ¶
func (*Grammar) ProtoMessage()
func (*Grammar) Walk ¶
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 (*Grammar) XXX_Unmarshal ¶
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) 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) ProtoMessage ¶
func (*Keyword) ProtoMessage()
func (*Keyword) XXX_DiscardUnknown ¶
func (m *Keyword) XXX_DiscardUnknown()
func (*Keyword) XXX_Marshal ¶
func (*Keyword) XXX_Unmarshal ¶
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) ProtoMessage ¶
func (*LeafNode) ProtoMessage()
func (*LeafNode) String ¶
String returns the relapse string representation of the LeafNode instance.
func (*LeafNode) XXX_DiscardUnknown ¶
func (m *LeafNode) XXX_DiscardUnknown()
func (*LeafNode) XXX_Marshal ¶
func (*LeafNode) XXX_Unmarshal ¶
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) GetCloseCurly ¶
func (*List) GetOpenCurly ¶
func (*List) HasVar ¶
HasVar returns whether there exists a variable somewhere in the typed list. This function is executed recursively.
func (*List) ProtoMessage ¶
func (*List) ProtoMessage()
func (*List) XXX_DiscardUnknown ¶
func (m *List) XXX_DiscardUnknown()
func (*List) XXX_Unmarshal ¶
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) GetBoolValue ¶
func (*Name) GetBytesValue ¶
func (*Name) GetDoubleValue ¶
func (*Name) GetIntValue ¶
func (*Name) GetStringValue ¶
func (*Name) GetUintValue ¶
func (*Name) ProtoMessage ¶
func (*Name) ProtoMessage()
func (*Name) XXX_DiscardUnknown ¶
func (m *Name) XXX_DiscardUnknown()
func (*Name) XXX_Unmarshal ¶
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) 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 ¶
NewAnyNameExcept returns a name expression that represents any name except the given name expression.
!(name)
func NewBoolName ¶
NewBoolName returns a name expression containing the given bool value.
bool(name)
func NewBytesName ¶
NewBytesName returns a name expression containing the given []byte value.
[]byte(name)
func NewDoubleName ¶
NewDoubleName returns a name expression containing the given double value.
double(name)
func NewNameChoice ¶
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 ¶
NewSDTName is a parser utility function that returns a NameExpr given a white space and a terminal value expression.
func NewStringName ¶
NewStringName returns a name expression containing the given string value.
string(name)
func NewUintName ¶
NewUintName returns a name expression containing the given uint value.
uint(name)
func (*NameExpr) Descriptor ¶
func (*NameExpr) GetAnyName ¶
func (*NameExpr) GetAnyNameExcept ¶
func (m *NameExpr) GetAnyNameExcept() *AnyNameExcept
func (*NameExpr) GetNameChoice ¶
func (m *NameExpr) GetNameChoice() *NameChoice
func (*NameExpr) ProtoMessage ¶
func (*NameExpr) ProtoMessage()
func (*NameExpr) String ¶
String returns the relapse string representation of the NameExpr instance.
func (*NameExpr) Walk ¶
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 (*NameExpr) XXX_Unmarshal ¶
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) GetCloseParen ¶
func (*Not) GetExclamation ¶
func (*Not) GetOpenParen ¶
func (*Not) GetPattern ¶
func (*Not) ProtoMessage ¶
func (*Not) ProtoMessage()
func (*Not) XXX_DiscardUnknown ¶
func (m *Not) XXX_DiscardUnknown()
func (*Not) XXX_Unmarshal ¶
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) GetCloseParen ¶
func (*Optional) GetOpenParen ¶
func (*Optional) GetPattern ¶
func (*Optional) GetQuestionMark ¶
func (*Optional) ProtoMessage ¶
func (*Optional) ProtoMessage()
func (*Optional) String ¶
String returns the relapse string representation of the Optional instance.
func (*Optional) XXX_DiscardUnknown ¶
func (m *Optional) XXX_DiscardUnknown()
func (*Optional) XXX_Marshal ¶
func (*Optional) XXX_Unmarshal ¶
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) GetCloseParen ¶
func (*Or) GetLeftPattern ¶
func (*Or) GetOpenParen ¶
func (*Or) GetRightPattern ¶
func (*Or) ProtoMessage ¶
func (*Or) ProtoMessage()
func (*Or) XXX_DiscardUnknown ¶
func (m *Or) XXX_DiscardUnknown()
func (*Or) XXX_Unmarshal ¶
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 ¶
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 ¶
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 NewInterleave ¶
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 NewOr ¶
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 NewTreeNode ¶
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 (*Pattern) Descriptor ¶
func (*Pattern) GetContains ¶
func (*Pattern) GetInterleave ¶
func (m *Pattern) GetInterleave() *Interleave
func (*Pattern) GetLeafNode ¶
func (*Pattern) GetOptional ¶
func (*Pattern) GetReference ¶
func (*Pattern) GetTreeNode ¶
func (*Pattern) GetZeroOrMore ¶
func (m *Pattern) GetZeroOrMore() *ZeroOrMore
func (*Pattern) ProtoMessage ¶
func (*Pattern) ProtoMessage()
func (*Pattern) XXX_DiscardUnknown ¶
func (m *Pattern) XXX_DiscardUnknown()
func (*Pattern) XXX_Marshal ¶
func (*Pattern) XXX_Unmarshal ¶
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) 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 ¶
RefLookup represents a relapse grammar as a map of references.
func NewRefLookup ¶
NewRefLookup converts a grammar into a reference lookup map.
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) ProtoMessage ¶
func (*Reference) ProtoMessage()
func (*Reference) String ¶
String returns the relapse string representation of the Reference instance.
func (*Reference) XXX_DiscardUnknown ¶
func (m *Reference) XXX_DiscardUnknown()
func (*Reference) XXX_Marshal ¶
func (*Reference) XXX_Unmarshal ¶
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 ¶
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) GetAttachedComment ¶
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 ¶
GetComments returns a list of comments contained in the white space.
func (*Space) HasAttachedComment ¶
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 ¶
HasComment returns whether the white space contains a comment.
func (*Space) ProtoMessage ¶
func (*Space) ProtoMessage()
func (*Space) XXX_DiscardUnknown ¶
func (m *Space) XXX_DiscardUnknown()
func (*Space) XXX_Marshal ¶
func (*Space) XXX_Unmarshal ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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) Descriptor ¶
func (*Terminal) GetBoolValue ¶
func (*Terminal) GetBytesValue ¶
func (*Terminal) GetDoubleValue ¶
func (*Terminal) GetIntValue ¶
func (*Terminal) GetLiteral ¶
func (*Terminal) GetStringValue ¶
func (*Terminal) GetUintValue ¶
func (*Terminal) GetVariable ¶
func (*Terminal) ProtoMessage ¶
func (*Terminal) ProtoMessage()
func (*Terminal) String ¶
String returns the relapse string representation of the Terminal instance.
func (*Terminal) XXX_DiscardUnknown ¶
func (m *Terminal) XXX_DiscardUnknown()
func (*Terminal) XXX_Marshal ¶
func (*Terminal) XXX_Unmarshal ¶
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) GetPattern ¶
func (*TreeNode) ProtoMessage ¶
func (*TreeNode) ProtoMessage()
func (*TreeNode) String ¶
String returns the relapse string representation of the TreeNode instance.
func (*TreeNode) XXX_DiscardUnknown ¶
func (m *TreeNode) XXX_DiscardUnknown()
func (*TreeNode) XXX_Marshal ¶
func (*TreeNode) XXX_Unmarshal ¶
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) ProtoMessage ¶
func (*Variable) ProtoMessage()
func (*Variable) String ¶
String returns the relapse string representation of the Variable instance.
func (*Variable) XXX_DiscardUnknown ¶
func (m *Variable) XXX_DiscardUnknown()
func (*Variable) XXX_Marshal ¶
func (*Variable) XXX_Unmarshal ¶
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) ProtoMessage ¶
func (*ZAny) ProtoMessage()
func (*ZAny) XXX_DiscardUnknown ¶
func (m *ZAny) XXX_DiscardUnknown()
func (*ZAny) XXX_Unmarshal ¶
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) 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