Documentation ¶
Index ¶
- Constants
- Variables
- func DeserializeTreeNodePattern(ctx *core.Context, it *jsoniter.Iterator, pattern core.Pattern, try bool) (_ core.Pattern, finalErr error)
- type Tree
- func (t *Tree) Equal(ctx *core.Context, other core.Value, alreadyCompared map[uintptr]uintptr, ...) bool
- func (t *Tree) GetGoMethod(name string) (*core.GoFunction, bool)
- func (t *Tree) IsMutable() bool
- func (t *Tree) IsSharable(originState *core.GlobalState) (bool, string)
- func (t *Tree) IsShared() bool
- func (t *Tree) Iterator(ctx *core.Context, config core.IteratorConfiguration) core.Iterator
- func (t *Tree) PrettyPrint(w *bufio.Writer, config *core.PrettyPrintConfig, depth int, ...)
- func (t *Tree) Prop(ctx *core.Context, name string) core.Value
- func (*Tree) PropertyNames(ctx *core.Context) []string
- func (*Tree) SetProp(ctx *core.Context, name string, value core.Value) error
- func (t *Tree) Share(originState *core.GlobalState)
- func (t *Tree) SmartLock(state *core.GlobalState)
- func (t *Tree) SmartUnlock(state *core.GlobalState)
- func (t *Tree) ToSymbolicValue(ctx *core.Context, encountered map[uintptr]symbolic.Value) (symbolic.Value, error)
- type TreeIterator
- func (it *TreeIterator) Equal(ctx *core.Context, other core.Value, alreadyCompared map[uintptr]uintptr, ...) bool
- func (it TreeIterator) HasNext(ctx *core.Context) bool
- func (it *TreeIterator) IsMutable() bool
- func (it *TreeIterator) Iterator(ctx *core.Context, config core.IteratorConfiguration) core.Iterator
- func (it *TreeIterator) Key(ctx *core.Context) core.Value
- func (it *TreeIterator) Next(ctx *core.Context) bool
- func (it *TreeIterator) PrettyPrint(w *bufio.Writer, config *core.PrettyPrintConfig, depth int, ...)
- func (it *TreeIterator) ToSymbolicValue(ctx *core.Context, encountered map[uintptr]symbolic.Value) (symbolic.Value, error)
- func (it *TreeIterator) Value(ctx *core.Context) core.Value
- type TreeNode
- func (n *TreeNode) AddChild(ctx *core.Context, childData core.Value)
- func (n *TreeNode) Equal(ctx *core.Context, other core.Value, alreadyCompared map[uintptr]uintptr, ...) bool
- func (n *TreeNode) GetGoMethod(name string) (*core.GoFunction, bool)
- func (n TreeNode) IsMutable() bool
- func (n *TreeNode) IsSharable(originState *core.GlobalState) (bool, string)
- func (n *TreeNode) IsShared() bool
- func (node *TreeNode) Iterator(ctx *core.Context, config core.IteratorConfiguration) core.Iterator
- func (n TreeNode) PrettyPrint(w *bufio.Writer, config *core.PrettyPrintConfig, depth int, ...)
- func (n *TreeNode) Prop(ctx *core.Context, name string) core.Value
- func (*TreeNode) PropertyNames(ctx *core.Context) []string
- func (*TreeNode) SetProp(ctx *core.Context, name string, value core.Value) error
- func (n *TreeNode) Share(originState *core.GlobalState)
- func (n *TreeNode) SmartLock(state *core.GlobalState)
- func (n *TreeNode) SmartUnlock(state *core.GlobalState)
- func (n *TreeNode) ToSymbolicValue(ctx *core.Context, encountered map[uintptr]symbolic.Value) (symbolic.Value, error)
- type TreeNodePattern
- func (p *TreeNodePattern) Equal(ctx *core.Context, other core.Value, alreadyCompared map[uintptr]uintptr, ...) bool
- func (p *TreeNodePattern) IsMutable() bool
- func (patt *TreeNodePattern) Iterator(ctx *core.Context, config core.IteratorConfiguration) core.Iterator
- func (n *TreeNodePattern) PrettyPrint(w *bufio.Writer, config *core.PrettyPrintConfig, depth int, ...)
- func (patt *TreeNodePattern) Random(ctx *core.Context, options ...core.Option) core.Value
- func (patt *TreeNodePattern) StringPattern() (core.StringPattern, bool)
- func (patt *TreeNodePattern) Test(ctx *core.Context, v core.Value) bool
- func (p *TreeNodePattern) ToSymbolicValue(ctx *core.Context, encountered map[uintptr]symbolic.Value) (symbolic.Value, error)
- func (p *TreeNodePattern) WriteJSONRepresentation(ctx *core.Context, w *jsoniter.Stream, config core.JSONSerializationConfig, ...) error
Constants ¶
View Source
const (
SERIALIZED_TREE_NODE_PATTERN_VALUE_KEY = "value"
)
Variables ¶
View Source
var ( TREE_PATTERN = &core.TypePattern{ Type: reflect.TypeOf(&Tree{}), Name: "tree", SymbolicValue: &coll_symbolic.Tree{}, } TREE_NODE_PATTERN = &core.TypePattern{ Type: reflect.TypeOf(TreeNode{}), Name: "tree.node", SymbolicValue: &coll_symbolic.TreeNode{}, CallImpl: func(typePattern *core.TypePattern, values []core.Serializable) (core.Pattern, error) { var valuePattern core.Pattern for _, val := range values { switch v := val.(type) { case core.Pattern: if valuePattern != nil { return nil, commonfmt.FmtErrArgumentProvidedAtLeastTwice("value pattern") } valuePattern = v default: if valuePattern == nil { valuePattern = core.NewExactValuePattern(v) continue } return nil, core.FmtErrInvalidArgument(v) } } return &TreeNodePattern{ valuePattern: valuePattern, }, nil }, SymbolicCallImpl: func(ctx *symbolic.Context, values []symbolic.Value) (symbolic.Pattern, error) { return coll_symbolic.NewTreeNodePattern(symbolic.ANY_PATTERN) }, } TREE_NODE_PATTERN_PATTERN = &core.TypePattern{ Type: reflect.TypeOf(&TreeNodePattern{}), Name: "tree.node-pattern", SymbolicValue: coll_symbolic.ANY_TREE_NODE_PATTERN, } )
Functions ¶
Types ¶
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
func (*Tree) GetGoMethod ¶
func (t *Tree) GetGoMethod(name string) (*core.GoFunction, bool)
func (*Tree) IsSharable ¶
func (t *Tree) IsSharable(originState *core.GlobalState) (bool, string)
func (*Tree) PrettyPrint ¶
func (*Tree) Share ¶
func (t *Tree) Share(originState *core.GlobalState)
func (*Tree) SmartLock ¶
func (t *Tree) SmartLock(state *core.GlobalState)
func (*Tree) SmartUnlock ¶
func (t *Tree) SmartUnlock(state *core.GlobalState)
type TreeIterator ¶
type TreeIterator struct {
// contains filtered or unexported fields
}
func (*TreeIterator) IsMutable ¶
func (it *TreeIterator) IsMutable() bool
func (*TreeIterator) Iterator ¶
func (it *TreeIterator) Iterator(ctx *core.Context, config core.IteratorConfiguration) core.Iterator
func (*TreeIterator) PrettyPrint ¶
func (it *TreeIterator) PrettyPrint(w *bufio.Writer, config *core.PrettyPrintConfig, depth int, parentIndentCount int)
func (*TreeIterator) ToSymbolicValue ¶
type TreeNode ¶
type TreeNode struct {
// contains filtered or unexported fields
}
TODO: store tree nodes in a pool
func (*TreeNode) GetGoMethod ¶
func (n *TreeNode) GetGoMethod(name string) (*core.GoFunction, bool)
func (*TreeNode) IsSharable ¶
func (n *TreeNode) IsSharable(originState *core.GlobalState) (bool, string)
func (TreeNode) PrettyPrint ¶
func (*TreeNode) Share ¶
func (n *TreeNode) Share(originState *core.GlobalState)
func (*TreeNode) SmartLock ¶
func (n *TreeNode) SmartLock(state *core.GlobalState)
func (*TreeNode) SmartUnlock ¶
func (n *TreeNode) SmartUnlock(state *core.GlobalState)
type TreeNodePattern ¶
type TreeNodePattern struct { core.NotCallablePatternMixin // contains filtered or unexported fields }
func NewTreeNodePattern ¶
func NewTreeNodePattern(valuePattern core.Pattern) *TreeNodePattern
func (*TreeNodePattern) IsMutable ¶
func (p *TreeNodePattern) IsMutable() bool
func (*TreeNodePattern) Iterator ¶
func (patt *TreeNodePattern) Iterator(ctx *core.Context, config core.IteratorConfiguration) core.Iterator
func (*TreeNodePattern) PrettyPrint ¶
func (n *TreeNodePattern) PrettyPrint(w *bufio.Writer, config *core.PrettyPrintConfig, depth int, parentIndentCount int)
func (*TreeNodePattern) StringPattern ¶
func (patt *TreeNodePattern) StringPattern() (core.StringPattern, bool)
func (*TreeNodePattern) ToSymbolicValue ¶
func (*TreeNodePattern) WriteJSONRepresentation ¶
func (p *TreeNodePattern) WriteJSONRepresentation(ctx *core.Context, w *jsoniter.Stream, config core.JSONSerializationConfig, depth int) error
Click to show internal directories.
Click to hide internal directories.