Documentation
¶
Index ¶
- func ExecuteBoolResult(op1, op2 *Value, opcode SFVMOpCode) (bool, error)
- type SFFrame
- type SFI
- type SFVMOpCode
- type SyntaxFlowVirtualMachine
- type SyntaxFlowVisitor
- func (v *SyntaxFlowVisitor) CreateFrame(vars *omap.OrderedMap[string, any]) *SFFrame
- func (y *SyntaxFlowVisitor) EmitCheckStackTop()
- func (v *SyntaxFlowVisitor) EmitDirection(i string)
- func (v *SyntaxFlowVisitor) EmitEqual(i any)
- func (y *SyntaxFlowVisitor) EmitFetchIndex(i int)
- func (v *SyntaxFlowVisitor) EmitField(i string)
- func (y *SyntaxFlowVisitor) EmitFlatDone(i int)
- func (y *SyntaxFlowVisitor) EmitFlatStart(i int)
- func (y *SyntaxFlowVisitor) EmitMapBuildDone(refs ...string)
- func (y *SyntaxFlowVisitor) EmitMapBuildStart()
- func (y *SyntaxFlowVisitor) EmitNewRef(i string)
- func (y *SyntaxFlowVisitor) EmitOperator(i string)
- func (y *SyntaxFlowVisitor) EmitPop()
- func (v *SyntaxFlowVisitor) EmitPushGlob(i string)
- func (v *SyntaxFlowVisitor) EmitPushIndex(i int)
- func (v *SyntaxFlowVisitor) EmitPushLiteral(i any)
- func (v *SyntaxFlowVisitor) EmitRef(i string)
- func (y *SyntaxFlowVisitor) EmitRegexpMatch(i string)
- func (y *SyntaxFlowVisitor) EmitRestoreFlatContext()
- func (y *SyntaxFlowVisitor) EmitRestoreMapContext()
- func (v *SyntaxFlowVisitor) EmitSearch(i string)
- func (v *SyntaxFlowVisitor) EmitTypeCast(i string)
- func (y *SyntaxFlowVisitor) EmitUpdate(i string)
- func (y *SyntaxFlowVisitor) EmitWithdraw()
- func (y *SyntaxFlowVisitor) FormatStringOrGlob(text string) (string, bool)
- func (v *SyntaxFlowVisitor) Show()
- func (y *SyntaxFlowVisitor) VisitChainFilter(raw sf.IChainFilterContext) interface{}
- func (y *SyntaxFlowVisitor) VisitConditionExpression(raw sf.IConditionExpressionContext) interface{}
- func (y *SyntaxFlowVisitor) VisitExistedRef(raw sf.IExistedRefContext) interface{}
- func (y *SyntaxFlowVisitor) VisitFilterExpr(raw sf.IFilterExprContext) interface{}
- func (y *SyntaxFlowVisitor) VisitFilterFieldMember(raw sf.IFilterFieldMemberContext) interface{}
- func (y *SyntaxFlowVisitor) VisitFilterStatement(raw sf.IFilterStatementContext) interface{}
- func (y *SyntaxFlowVisitor) VisitFilters(raw sf.IFiltersContext) interface{}
- func (y *SyntaxFlowVisitor) VisitFlow(raw sf.IFlowContext) interface{}
- func (y *SyntaxFlowVisitor) VisitNumberLiteral(raw sf.INumberLiteralContext) int
- func (y *SyntaxFlowVisitor) VisitRefVariable(raw sf.IRefVariableContext) string
- func (y *SyntaxFlowVisitor) VisitStringLiteral(raw sf.IStringLiteralContext) (string, bool)
- type Value
- func (v *Value) AsBool() bool
- func (v *Value) AsInt() int
- func (v *Value) AsMap() *omap.OrderedMap[string, any]
- func (v *Value) AsString() string
- func (op1 *Value) Exec(i SFVMOpCode, op2 *Value) (*Value, error)
- func (v *Value) IsMap() bool
- func (v *Value) Value() any
- func (v *Value) VerboseString() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecuteBoolResult ¶
func ExecuteBoolResult(op1, op2 *Value, opcode SFVMOpCode) (bool, error)
Types ¶
type SFFrame ¶
func NewSFFrame ¶
func (*SFFrame) GetSymbolTable ¶
func (s *SFFrame) GetSymbolTable() *omap.OrderedMap[string, any]
type SFI ¶
type SFI struct { OpCode SFVMOpCode UnaryInt int UnaryStr string Desc string Values []string }
type SFVMOpCode ¶
type SFVMOpCode int
const ( OpPass SFVMOpCode = iota // OpPushNumber and OpPushString and OpPushBool can push literal into stack OpPushNumber OpPushString OpPushBool OpPop OpWithdraw // OpPushMatch can push data from origin OpPushMatch // OpPushIndex can push data from index OpPushIndex // OpPushRef can push reference into stack OpPushRef // OpNewRef can create new symbol reference OpNewRef OpUpdateRef // OpFetchField OpFetchIndex OpSetDirection OpFlatStart OpFlatDone OpRestoreFlatContext OpMapStart OpMapDone OpRestoreMapContext OpTypeCast /* Binary Operator Fetch TWO in STACK, calc result, push result into stack */ OpEq OpNotEq OpGt OpGtEq OpLt OpLtEq OpLogicAnd OpLogicOr /* Unary Operator: Fetch ONE in STACK, calc result, push result into stack */ OpReMatch OpGlobMatch OpNot OpCheckStackTop )
type SyntaxFlowVirtualMachine ¶
type SyntaxFlowVirtualMachine struct {
// contains filtered or unexported fields
}
func NewSyntaxFlowVirtualMachine ¶
func NewSyntaxFlowVirtualMachine() *SyntaxFlowVirtualMachine
func (*SyntaxFlowVirtualMachine) Compile ¶
func (s *SyntaxFlowVirtualMachine) Compile(text string) (ret error)
func (*SyntaxFlowVirtualMachine) Debug ¶
func (s *SyntaxFlowVirtualMachine) Debug(i ...bool) *SyntaxFlowVirtualMachine
func (*SyntaxFlowVirtualMachine) Feed ¶
func (s *SyntaxFlowVirtualMachine) Feed(i *omap.OrderedMap[string, any]) *omap.OrderedMap[string, any]
type SyntaxFlowVisitor ¶
type SyntaxFlowVisitor struct {
// contains filtered or unexported fields
}
func NewSyntaxFlowVisitor ¶
func NewSyntaxFlowVisitor() *SyntaxFlowVisitor
func (*SyntaxFlowVisitor) CreateFrame ¶
func (v *SyntaxFlowVisitor) CreateFrame(vars *omap.OrderedMap[string, any]) *SFFrame
func (*SyntaxFlowVisitor) EmitCheckStackTop ¶
func (y *SyntaxFlowVisitor) EmitCheckStackTop()
func (*SyntaxFlowVisitor) EmitDirection ¶
func (v *SyntaxFlowVisitor) EmitDirection(i string)
func (*SyntaxFlowVisitor) EmitEqual ¶
func (v *SyntaxFlowVisitor) EmitEqual(i any)
func (*SyntaxFlowVisitor) EmitFetchIndex ¶
func (y *SyntaxFlowVisitor) EmitFetchIndex(i int)
func (*SyntaxFlowVisitor) EmitField ¶
func (v *SyntaxFlowVisitor) EmitField(i string)
func (*SyntaxFlowVisitor) EmitFlatDone ¶
func (y *SyntaxFlowVisitor) EmitFlatDone(i int)
func (*SyntaxFlowVisitor) EmitFlatStart ¶
func (y *SyntaxFlowVisitor) EmitFlatStart(i int)
func (*SyntaxFlowVisitor) EmitMapBuildDone ¶
func (y *SyntaxFlowVisitor) EmitMapBuildDone(refs ...string)
func (*SyntaxFlowVisitor) EmitMapBuildStart ¶
func (y *SyntaxFlowVisitor) EmitMapBuildStart()
func (*SyntaxFlowVisitor) EmitNewRef ¶
func (y *SyntaxFlowVisitor) EmitNewRef(i string)
func (*SyntaxFlowVisitor) EmitOperator ¶
func (y *SyntaxFlowVisitor) EmitOperator(i string)
func (*SyntaxFlowVisitor) EmitPop ¶
func (y *SyntaxFlowVisitor) EmitPop()
func (*SyntaxFlowVisitor) EmitPushGlob ¶
func (v *SyntaxFlowVisitor) EmitPushGlob(i string)
func (*SyntaxFlowVisitor) EmitPushIndex ¶
func (v *SyntaxFlowVisitor) EmitPushIndex(i int)
func (*SyntaxFlowVisitor) EmitPushLiteral ¶
func (v *SyntaxFlowVisitor) EmitPushLiteral(i any)
func (*SyntaxFlowVisitor) EmitRef ¶
func (v *SyntaxFlowVisitor) EmitRef(i string)
func (*SyntaxFlowVisitor) EmitRegexpMatch ¶
func (y *SyntaxFlowVisitor) EmitRegexpMatch(i string)
func (*SyntaxFlowVisitor) EmitRestoreFlatContext ¶
func (y *SyntaxFlowVisitor) EmitRestoreFlatContext()
func (*SyntaxFlowVisitor) EmitRestoreMapContext ¶
func (y *SyntaxFlowVisitor) EmitRestoreMapContext()
func (*SyntaxFlowVisitor) EmitSearch ¶
func (v *SyntaxFlowVisitor) EmitSearch(i string)
func (*SyntaxFlowVisitor) EmitTypeCast ¶
func (v *SyntaxFlowVisitor) EmitTypeCast(i string)
func (*SyntaxFlowVisitor) EmitUpdate ¶
func (y *SyntaxFlowVisitor) EmitUpdate(i string)
func (*SyntaxFlowVisitor) EmitWithdraw ¶
func (y *SyntaxFlowVisitor) EmitWithdraw()
func (*SyntaxFlowVisitor) FormatStringOrGlob ¶
func (y *SyntaxFlowVisitor) FormatStringOrGlob(text string) (string, bool)
func (*SyntaxFlowVisitor) Show ¶
func (v *SyntaxFlowVisitor) Show()
func (*SyntaxFlowVisitor) VisitChainFilter ¶
func (y *SyntaxFlowVisitor) VisitChainFilter(raw sf.IChainFilterContext) interface{}
func (*SyntaxFlowVisitor) VisitConditionExpression ¶
func (y *SyntaxFlowVisitor) VisitConditionExpression(raw sf.IConditionExpressionContext) interface{}
func (*SyntaxFlowVisitor) VisitExistedRef ¶
func (y *SyntaxFlowVisitor) VisitExistedRef(raw sf.IExistedRefContext) interface{}
func (*SyntaxFlowVisitor) VisitFilterExpr ¶
func (y *SyntaxFlowVisitor) VisitFilterExpr(raw sf.IFilterExprContext) interface{}
func (*SyntaxFlowVisitor) VisitFilterFieldMember ¶
func (y *SyntaxFlowVisitor) VisitFilterFieldMember(raw sf.IFilterFieldMemberContext) interface{}
func (*SyntaxFlowVisitor) VisitFilterStatement ¶
func (y *SyntaxFlowVisitor) VisitFilterStatement(raw sf.IFilterStatementContext) interface{}
func (*SyntaxFlowVisitor) VisitFilters ¶
func (y *SyntaxFlowVisitor) VisitFilters(raw sf.IFiltersContext) interface{}
func (*SyntaxFlowVisitor) VisitFlow ¶
func (y *SyntaxFlowVisitor) VisitFlow(raw sf.IFlowContext) interface{}
func (*SyntaxFlowVisitor) VisitNumberLiteral ¶
func (y *SyntaxFlowVisitor) VisitNumberLiteral(raw sf.INumberLiteralContext) int
func (*SyntaxFlowVisitor) VisitRefVariable ¶
func (y *SyntaxFlowVisitor) VisitRefVariable(raw sf.IRefVariableContext) string
func (*SyntaxFlowVisitor) VisitStringLiteral ¶
func (y *SyntaxFlowVisitor) VisitStringLiteral(raw sf.IStringLiteralContext) (string, bool)
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
func (*Value) VerboseString ¶
Click to show internal directories.
Click to hide internal directories.