Documentation
¶
Index ¶
- Constants
- Variables
- func MatchModeString(mode int) string
- func RegisterNativeCall(name string, f NativeCallFunc)
- type AnalysisContext
- type AnalysisContextOption
- type Config
- type GlobEx
- type IterContext
- type NativeCallFunc
- type Option
- type RecursiveConfigItem
- type RecursiveConfigKey
- type ResultCapturedCallback
- type SFFrame
- type SFFrameResult
- type SFI
- type SFVMOpCode
- type SyntaxFlowVirtualMachine
- func (s *SyntaxFlowVirtualMachine) Compile(text string) (frame *SFFrame, ret error)
- func (s *SyntaxFlowVirtualMachine) Debug(i ...bool) *SyntaxFlowVirtualMachine
- func (s *SyntaxFlowVirtualMachine) Feed(i ValueOperator) ([]*SFFrameResult, error)
- func (s *SyntaxFlowVirtualMachine) ForEachFrame(h func(frame *SFFrame))
- func (s *SyntaxFlowVirtualMachine) Show()
- func (s *SyntaxFlowVirtualMachine) Snapshot() *omap.OrderedMap[string, ValueOperator]
- type SyntaxFlowVisitor
- func (v *SyntaxFlowVisitor) CreateFrame(vars *omap.OrderedMap[string, ValueOperator]) *SFFrame
- func (y *SyntaxFlowVisitor) EmitAddDescription(key string, value string)
- func (y *SyntaxFlowVisitor) EmitAlert(ref string)
- func (y *SyntaxFlowVisitor) EmitCheckParam(ref string, then string, elseString string)
- func (y *SyntaxFlowVisitor) EmitCheckStackTop()
- func (v *SyntaxFlowVisitor) EmitCompareOpcode(i []string)
- func (v *SyntaxFlowVisitor) EmitCompareString(i []string, mode int)
- func (v *SyntaxFlowVisitor) EmitCondition()
- func (v *SyntaxFlowVisitor) EmitCreateIterator() *IterContext
- func (v *SyntaxFlowVisitor) EmitDuplicate()
- func (y *SyntaxFlowVisitor) EmitEnterStatement()
- func (v *SyntaxFlowVisitor) EmitEqual(i any)
- func (y *SyntaxFlowVisitor) EmitExitStatement()
- func (y *SyntaxFlowVisitor) EmitFilterExprEnter() *SFI
- func (y *SyntaxFlowVisitor) EmitFilterExprExit(c *SFI)
- func (v *SyntaxFlowVisitor) EmitGetBottomUsers(config ...*RecursiveConfigItem)
- func (v *SyntaxFlowVisitor) EmitGetCall()
- func (v *SyntaxFlowVisitor) EmitGetDefs()
- func (v *SyntaxFlowVisitor) EmitGetTopDefs(config ...*RecursiveConfigItem)
- func (v *SyntaxFlowVisitor) EmitGetUsers()
- func (v *SyntaxFlowVisitor) EmitIterEnd(i *IterContext)
- func (y *SyntaxFlowVisitor) EmitListIndex(i int)
- func (y *SyntaxFlowVisitor) EmitMergeRef(i string)
- func (y *SyntaxFlowVisitor) EmitNativaCall(i string, results ...any)
- func (y *SyntaxFlowVisitor) EmitNewRef(i string)
- func (v *SyntaxFlowVisitor) EmitNextIterator(i *IterContext)
- func (y *SyntaxFlowVisitor) EmitOperator(i string)
- func (v *SyntaxFlowVisitor) EmitPass()
- func (y *SyntaxFlowVisitor) EmitPop()
- func (v *SyntaxFlowVisitor) EmitPushAllCallArgs()
- func (v *SyntaxFlowVisitor) EmitPushCallArgs(i int)
- func (v *SyntaxFlowVisitor) EmitPushGlob(i string)
- func (v *SyntaxFlowVisitor) EmitPushLiteral(i any)
- func (v *SyntaxFlowVisitor) EmitRecursiveSearchExact(mod int, i string) *SFI
- func (v *SyntaxFlowVisitor) EmitRecursiveSearchGlob(mod int, i string) *SFI
- func (v *SyntaxFlowVisitor) EmitRecursiveSearchRegexp(mod int, i string) *SFI
- func (y *SyntaxFlowVisitor) EmitRegexpMatch(i string)
- func (y *SyntaxFlowVisitor) EmitRemoveRef(i string)
- func (v *SyntaxFlowVisitor) EmitSearchExact(mod int, i string) *SFI
- func (v *SyntaxFlowVisitor) EmitSearchGlob(mod int, i string) *SFI
- func (v *SyntaxFlowVisitor) EmitSearchRegexp(mod int, i string) *SFI
- func (y *SyntaxFlowVisitor) EmitUpdate(i string)
- func (y *SyntaxFlowVisitor) FormatStringOrGlob(text string) (string, bool)
- func (v *SyntaxFlowVisitor) Show()
- func (y *SyntaxFlowVisitor) VisitActualParam(i sf.IActualParamContext) error
- func (y *SyntaxFlowVisitor) VisitAlertStatement(raw sf.IAlertStatementContext)
- func (y *SyntaxFlowVisitor) VisitChainFilter(raw sf.IChainFilterContext) interface{}
- func (y *SyntaxFlowVisitor) VisitCheckStatement(raw sf.ICheckStatementContext) interface{}
- func (y *SyntaxFlowVisitor) VisitConditionExpression(raw sf.IConditionExpressionContext) any
- func (y *SyntaxFlowVisitor) VisitDescriptionStatement(raw sf.IDescriptionStatementContext) interface{}
- func (y *SyntaxFlowVisitor) VisitFilterExpr(raw sf.IFilterExprContext) error
- func (y *SyntaxFlowVisitor) VisitFilterItem(raw sf.IFilterItemContext) error
- func (y *SyntaxFlowVisitor) VisitFilterItemFirst(raw sf.IFilterItemFirstContext) error
- func (y *SyntaxFlowVisitor) VisitFilterStatement(raw sf.IFilterStatementContext)
- func (y *SyntaxFlowVisitor) VisitFlow(raw sf.IFlowContext)
- func (y *SyntaxFlowVisitor) VisitNameFilter(isMember bool, i sf.INameFilterContext) error
- func (y *SyntaxFlowVisitor) VisitNumberLiteral(raw sf.INumberLiteralContext) int
- func (v *SyntaxFlowVisitor) VisitRecursiveConfig(i *sf.ConfigContext) []*RecursiveConfigItem
- func (y *SyntaxFlowVisitor) VisitRecursiveNameFilter(recursive bool, isMember bool, i sf.INameFilterContext) error
- func (y *SyntaxFlowVisitor) VisitRefVariable(raw sf.IRefVariableContext) string
- func (y *SyntaxFlowVisitor) VisitStatement(raw sf.IStatementContext)
- func (y *SyntaxFlowVisitor) VisitStringLiteral(raw sf.IStringLiteralContext) (string, bool)
- func (y *SyntaxFlowVisitor) VisitStringLiteralWithoutStarGroup(raw sf.IStringLiteralWithoutStarGroupContext) []string
- type ValueList
- func (v *ValueList) AppendPredecessor(value ValueOperator, opts ...AnalysisContextOption) error
- func (v *ValueList) ExactMatch(mod int, s string) (bool, ValueOperator, error)
- func (v *ValueList) ForEach(h func(i any))
- func (v *ValueList) GetAllCallActualParams() (ValueOperator, error)
- func (v *ValueList) GetCallActualParams(i int) (ValueOperator, error)
- func (v *ValueList) GetCalled() (ValueOperator, error)
- func (v *ValueList) GetFields() (ValueOperator, error)
- func (v *ValueList) GetOpcode() string
- func (v *ValueList) GetSyntaxFlowBottomUse(config ...*RecursiveConfigItem) (ValueOperator, error)
- func (v *ValueList) GetSyntaxFlowDef() (ValueOperator, error)
- func (v *ValueList) GetSyntaxFlowTopDef(config ...*RecursiveConfigItem) (ValueOperator, error)
- func (v *ValueList) GetSyntaxFlowUse() (ValueOperator, error)
- func (v *ValueList) GlobMatch(mod int, s ssa.Glob) (bool, ValueOperator, error)
- func (v *ValueList) IsList() bool
- func (v *ValueList) IsMap() bool
- func (v *ValueList) ListIndex(i int) (ValueOperator, error)
- func (v *ValueList) Merge(values ...ValueOperator) (ValueOperator, error)
- func (v *ValueList) Recursive(f func(operator ValueOperator) error) error
- func (v *ValueList) RegexpMatch(mod int, regexp *regexp.Regexp) (bool, ValueOperator, error)
- func (v *ValueList) Remove(values ...ValueOperator) (ValueOperator, error)
- func (v *ValueList) String() string
- type ValueOperator
Constants ¶
View Source
const ( CompareStringAnyMode int = 0 CompareStringHaveMode = 1 )
View Source
const ( RecursiveConfig_NULL RecursiveConfigKey = "" RecursiveConfig_Depth = "depth" RecursiveConfig_DepthMin = "depth_min" RecursiveConfig_DepthMax = "depth_max" RecursiveConfig_Exclude = "exclude" RecursiveConfig_Until = "until" )
View Source
const ( NameMatch int = 1 KeyMatch = 1 << 1 BothMatch = NameMatch | KeyMatch )
type MatchMode int
Variables ¶
View Source
var CriticalError = utils.Error("CriticalError(BUG)")
Functions ¶
func MatchModeString ¶
func RegisterNativeCall ¶
func RegisterNativeCall(name string, f NativeCallFunc)
Types ¶
type AnalysisContext ¶
func NewDefaultAnalysisContext ¶
func NewDefaultAnalysisContext() *AnalysisContext
type AnalysisContextOption ¶
type AnalysisContextOption func(*AnalysisContext)
func WithAnalysisContext_Label ¶
func WithAnalysisContext_Label(label string) AnalysisContextOption
func WithAnalysisContext_Step ¶
func WithAnalysisContext_Step(step int) AnalysisContextOption
type IterContext ¶
type IterContext struct {
// contains filtered or unexported fields
}
type NativeCallFunc ¶
type NativeCallFunc func(v ValueOperator, frame *SFFrame) (bool, ValueOperator, error)
func GetNativeCall ¶
func GetNativeCall(name string) (NativeCallFunc, error)
type Option ¶ added in v1.3.3
type Option func(*Config)
func WithEnableDebug ¶ added in v1.3.3
func WithFailFast ¶
func WithInitialContextVars ¶ added in v1.3.3
func WithInitialContextVars(o *omap.OrderedMap[string, ValueOperator]) Option
func WithResultCaptured ¶ added in v1.3.3
func WithResultCaptured(c ResultCapturedCallback) Option
func WithStrictMatch ¶
type RecursiveConfigItem ¶ added in v1.3.3
type RecursiveConfigItem struct { Key RecursiveConfigKey Value string SyntaxFlowRule bool }
type RecursiveConfigKey ¶ added in v1.3.3
type RecursiveConfigKey string
func FormatRecursiveConfigKey ¶ added in v1.3.3
func FormatRecursiveConfigKey(i string) RecursiveConfigKey
type ResultCapturedCallback ¶ added in v1.3.3
type ResultCapturedCallback func(name string, results ValueOperator) error
type SFFrame ¶
func NewSFFrame ¶
func NewSFFrame(vars *omap.OrderedMap[string, ValueOperator], text string, codes []*SFI) *SFFrame
func (*SFFrame) Feed ¶
func (frame *SFFrame) Feed(i ValueOperator) (*SFFrameResult, error)
func (*SFFrame) GetSymbolTable ¶
func (s *SFFrame) GetSymbolTable() *omap.OrderedMap[string, ValueOperator]
type SFFrameResult ¶
type SFFrameResult struct { // base info Rule string // additional info Description *omap.OrderedMap[string, string] CheckParams []string Errors []string // value SymbolTable *omap.OrderedMap[string, ValueOperator] AlertSymbolTable map[string]ValueOperator }
func NewSFResult ¶
func NewSFResult(rule string) *SFFrameResult
func (*SFFrameResult) Copy ¶
func (s *SFFrameResult) Copy() *SFFrameResult
func (*SFFrameResult) Show ¶
func (s *SFFrameResult) Show()
func (*SFFrameResult) String ¶
func (s *SFFrameResult) String() string
type SFI ¶
type SFI struct { OpCode SFVMOpCode UnaryInt int UnaryStr string Desc string Values []string SyntaxFlowConfig []*RecursiveConfigItem // contains filtered or unexported fields }
func (*SFI) IsIterOpcode ¶
func (*SFI) ValueByIndex ¶
type SFVMOpCode ¶
type SFVMOpCode int
const ( OpPass SFVMOpCode = iota // enter/exit statement OpEnterStatement OpExitStatement // duplicate the top of stack OpDuplicate // OpPushSearchExact can push data from origin OpPushSearchExact OpPushSearchGlob OpPushSearchRegexp // OpRecursive... can fetch origin value (not program) push data from origin OpRecursiveSearchExact OpRecursiveSearchGlob OpRecursiveSearchRegexp // handle function call OpGetCall OpGetCallArgs OpGetAllCallArgs // use def chain OpGetUsers OpGetBottomUsers OpGetDefs OpGetTopDefs // ListOperation OpListIndex // => variable OpNewRef OpUpdateRef // OpPushNumber and OpPushString and OpPushBool can push literal into stack OpPushNumber OpPushString OpPushBool OpPop // Condition // use the []bool && []Value of stack top, push result into stack OpCondition OpCompareOpcode OpCompareString /* Binary Operator Fetch TWO in STACK, calc result, push result into stack */ OpEq OpNotEq OpGt OpGtEq OpLt OpLtEq OpLogicAnd OpLogicOr OpLogicBang /* Unary Operator: Fetch ONE in STACK, calc result, push result into stack */ OpReMatch OpGlobMatch OpNot OpAlert // echo variable // OpCheckParams check the params in vm context // if not match, record error // matched, use 'then expr' (if exists) OpCheckParams // OpAddDescription add description to current context OpAddDescription // OpCreateIter will create iterator for current context // the context contains origin values(list) and channel for elements OpCreateIter // OpIterNext will get next value from iterator // if the channel from iter context has a next element, push into stack and execute filter // if not, exit OpIterNext OpIterEnd OpCheckStackTop // check the top of stack, if empty, push input into stack // OpFilterExprEnter will assert the top of stack, make sure a input OpFilterExprEnter OpFilterExprExit OpMergeRef OpRemoveRef OpNativeCall )
type SyntaxFlowVirtualMachine ¶
type SyntaxFlowVirtualMachine struct {
// contains filtered or unexported fields
}
func NewSyntaxFlowVirtualMachine ¶
func NewSyntaxFlowVirtualMachine(opts ...Option) *SyntaxFlowVirtualMachine
func (*SyntaxFlowVirtualMachine) Compile ¶
func (s *SyntaxFlowVirtualMachine) Compile(text string) (frame *SFFrame, ret error)
func (*SyntaxFlowVirtualMachine) Debug ¶
func (s *SyntaxFlowVirtualMachine) Debug(i ...bool) *SyntaxFlowVirtualMachine
func (*SyntaxFlowVirtualMachine) Feed ¶
func (s *SyntaxFlowVirtualMachine) Feed(i ValueOperator) ([]*SFFrameResult, error)
func (*SyntaxFlowVirtualMachine) ForEachFrame ¶ added in v1.3.3
func (s *SyntaxFlowVirtualMachine) ForEachFrame(h func(frame *SFFrame))
func (*SyntaxFlowVirtualMachine) Show ¶ added in v1.3.3
func (s *SyntaxFlowVirtualMachine) Show()
func (*SyntaxFlowVirtualMachine) Snapshot ¶
func (s *SyntaxFlowVirtualMachine) Snapshot() *omap.OrderedMap[string, ValueOperator]
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, ValueOperator]) *SFFrame
func (*SyntaxFlowVisitor) EmitAddDescription ¶
func (y *SyntaxFlowVisitor) EmitAddDescription(key string, value string)
func (*SyntaxFlowVisitor) EmitAlert ¶
func (y *SyntaxFlowVisitor) EmitAlert(ref string)
func (*SyntaxFlowVisitor) EmitCheckParam ¶
func (y *SyntaxFlowVisitor) EmitCheckParam(ref string, then string, elseString string)
func (*SyntaxFlowVisitor) EmitCheckStackTop ¶
func (y *SyntaxFlowVisitor) EmitCheckStackTop()
func (*SyntaxFlowVisitor) EmitCompareOpcode ¶
func (v *SyntaxFlowVisitor) EmitCompareOpcode(i []string)
func (*SyntaxFlowVisitor) EmitCompareString ¶
func (v *SyntaxFlowVisitor) EmitCompareString(i []string, mode int)
func (*SyntaxFlowVisitor) EmitCondition ¶
func (v *SyntaxFlowVisitor) EmitCondition()
func (*SyntaxFlowVisitor) EmitCreateIterator ¶
func (v *SyntaxFlowVisitor) EmitCreateIterator() *IterContext
func (*SyntaxFlowVisitor) EmitDuplicate ¶ added in v1.3.3
func (v *SyntaxFlowVisitor) EmitDuplicate()
func (*SyntaxFlowVisitor) EmitEnterStatement ¶ added in v1.3.3
func (y *SyntaxFlowVisitor) EmitEnterStatement()
func (*SyntaxFlowVisitor) EmitEqual ¶
func (v *SyntaxFlowVisitor) EmitEqual(i any)
func (*SyntaxFlowVisitor) EmitExitStatement ¶ added in v1.3.3
func (y *SyntaxFlowVisitor) EmitExitStatement()
func (*SyntaxFlowVisitor) EmitFilterExprEnter ¶
func (y *SyntaxFlowVisitor) EmitFilterExprEnter() *SFI
func (*SyntaxFlowVisitor) EmitFilterExprExit ¶
func (y *SyntaxFlowVisitor) EmitFilterExprExit(c *SFI)
func (*SyntaxFlowVisitor) EmitGetBottomUsers ¶ added in v1.3.3
func (v *SyntaxFlowVisitor) EmitGetBottomUsers(config ...*RecursiveConfigItem)
func (*SyntaxFlowVisitor) EmitGetCall ¶ added in v1.3.3
func (v *SyntaxFlowVisitor) EmitGetCall()
func (*SyntaxFlowVisitor) EmitGetDefs ¶ added in v1.3.3
func (v *SyntaxFlowVisitor) EmitGetDefs()
func (*SyntaxFlowVisitor) EmitGetTopDefs ¶ added in v1.3.3
func (v *SyntaxFlowVisitor) EmitGetTopDefs(config ...*RecursiveConfigItem)
func (*SyntaxFlowVisitor) EmitGetUsers ¶ added in v1.3.3
func (v *SyntaxFlowVisitor) EmitGetUsers()
func (*SyntaxFlowVisitor) EmitIterEnd ¶
func (v *SyntaxFlowVisitor) EmitIterEnd(i *IterContext)
func (*SyntaxFlowVisitor) EmitListIndex ¶ added in v1.3.3
func (y *SyntaxFlowVisitor) EmitListIndex(i int)
func (*SyntaxFlowVisitor) EmitMergeRef ¶
func (y *SyntaxFlowVisitor) EmitMergeRef(i string)
func (*SyntaxFlowVisitor) EmitNativaCall ¶
func (y *SyntaxFlowVisitor) EmitNativaCall(i string, results ...any)
func (*SyntaxFlowVisitor) EmitNewRef ¶
func (y *SyntaxFlowVisitor) EmitNewRef(i string)
func (*SyntaxFlowVisitor) EmitNextIterator ¶
func (v *SyntaxFlowVisitor) EmitNextIterator(i *IterContext)
func (*SyntaxFlowVisitor) EmitOperator ¶
func (y *SyntaxFlowVisitor) EmitOperator(i string)
func (*SyntaxFlowVisitor) EmitPass ¶ added in v1.3.3
func (v *SyntaxFlowVisitor) EmitPass()
func (*SyntaxFlowVisitor) EmitPop ¶
func (y *SyntaxFlowVisitor) EmitPop()
func (*SyntaxFlowVisitor) EmitPushAllCallArgs ¶ added in v1.3.3
func (v *SyntaxFlowVisitor) EmitPushAllCallArgs()
func (*SyntaxFlowVisitor) EmitPushCallArgs ¶ added in v1.3.3
func (v *SyntaxFlowVisitor) EmitPushCallArgs(i int)
func (*SyntaxFlowVisitor) EmitPushGlob ¶
func (v *SyntaxFlowVisitor) EmitPushGlob(i string)
func (*SyntaxFlowVisitor) EmitPushLiteral ¶
func (v *SyntaxFlowVisitor) EmitPushLiteral(i any)
func (*SyntaxFlowVisitor) EmitRecursiveSearchExact ¶
func (v *SyntaxFlowVisitor) EmitRecursiveSearchExact(mod int, i string) *SFI
func (*SyntaxFlowVisitor) EmitRecursiveSearchGlob ¶
func (v *SyntaxFlowVisitor) EmitRecursiveSearchGlob(mod int, i string) *SFI
func (*SyntaxFlowVisitor) EmitRecursiveSearchRegexp ¶
func (v *SyntaxFlowVisitor) EmitRecursiveSearchRegexp(mod int, i string) *SFI
func (*SyntaxFlowVisitor) EmitRegexpMatch ¶
func (y *SyntaxFlowVisitor) EmitRegexpMatch(i string)
func (*SyntaxFlowVisitor) EmitRemoveRef ¶
func (y *SyntaxFlowVisitor) EmitRemoveRef(i string)
func (*SyntaxFlowVisitor) EmitSearchExact ¶ added in v1.3.3
func (v *SyntaxFlowVisitor) EmitSearchExact(mod int, i string) *SFI
func (*SyntaxFlowVisitor) EmitSearchGlob ¶ added in v1.3.3
func (v *SyntaxFlowVisitor) EmitSearchGlob(mod int, i string) *SFI
func (*SyntaxFlowVisitor) EmitSearchRegexp ¶ added in v1.3.3
func (v *SyntaxFlowVisitor) EmitSearchRegexp(mod int, i string) *SFI
func (*SyntaxFlowVisitor) EmitUpdate ¶
func (y *SyntaxFlowVisitor) EmitUpdate(i string)
func (*SyntaxFlowVisitor) FormatStringOrGlob ¶
func (y *SyntaxFlowVisitor) FormatStringOrGlob(text string) (string, bool)
func (*SyntaxFlowVisitor) Show ¶
func (v *SyntaxFlowVisitor) Show()
func (*SyntaxFlowVisitor) VisitActualParam ¶ added in v1.3.3
func (y *SyntaxFlowVisitor) VisitActualParam(i sf.IActualParamContext) error
func (*SyntaxFlowVisitor) VisitAlertStatement ¶
func (y *SyntaxFlowVisitor) VisitAlertStatement(raw sf.IAlertStatementContext)
func (*SyntaxFlowVisitor) VisitChainFilter ¶
func (y *SyntaxFlowVisitor) VisitChainFilter(raw sf.IChainFilterContext) interface{}
func (*SyntaxFlowVisitor) VisitCheckStatement ¶
func (y *SyntaxFlowVisitor) VisitCheckStatement(raw sf.ICheckStatementContext) interface{}
func (*SyntaxFlowVisitor) VisitConditionExpression ¶
func (y *SyntaxFlowVisitor) VisitConditionExpression(raw sf.IConditionExpressionContext) any
func (*SyntaxFlowVisitor) VisitDescriptionStatement ¶
func (y *SyntaxFlowVisitor) VisitDescriptionStatement(raw sf.IDescriptionStatementContext) interface{}
func (*SyntaxFlowVisitor) VisitFilterExpr ¶
func (y *SyntaxFlowVisitor) VisitFilterExpr(raw sf.IFilterExprContext) error
func (*SyntaxFlowVisitor) VisitFilterItem ¶
func (y *SyntaxFlowVisitor) VisitFilterItem(raw sf.IFilterItemContext) error
func (*SyntaxFlowVisitor) VisitFilterItemFirst ¶
func (y *SyntaxFlowVisitor) VisitFilterItemFirst(raw sf.IFilterItemFirstContext) error
func (*SyntaxFlowVisitor) VisitFilterStatement ¶
func (y *SyntaxFlowVisitor) VisitFilterStatement(raw sf.IFilterStatementContext)
func (*SyntaxFlowVisitor) VisitFlow ¶
func (y *SyntaxFlowVisitor) VisitFlow(raw sf.IFlowContext)
func (*SyntaxFlowVisitor) VisitNameFilter ¶ added in v1.3.3
func (y *SyntaxFlowVisitor) VisitNameFilter(isMember bool, i sf.INameFilterContext) error
func (*SyntaxFlowVisitor) VisitNumberLiteral ¶
func (y *SyntaxFlowVisitor) VisitNumberLiteral(raw sf.INumberLiteralContext) int
func (*SyntaxFlowVisitor) VisitRecursiveConfig ¶ added in v1.3.3
func (v *SyntaxFlowVisitor) VisitRecursiveConfig(i *sf.ConfigContext) []*RecursiveConfigItem
func (*SyntaxFlowVisitor) VisitRecursiveNameFilter ¶
func (y *SyntaxFlowVisitor) VisitRecursiveNameFilter(recursive bool, isMember bool, i sf.INameFilterContext) error
func (*SyntaxFlowVisitor) VisitRefVariable ¶
func (y *SyntaxFlowVisitor) VisitRefVariable(raw sf.IRefVariableContext) string
func (*SyntaxFlowVisitor) VisitStatement ¶
func (y *SyntaxFlowVisitor) VisitStatement(raw sf.IStatementContext)
func (*SyntaxFlowVisitor) VisitStringLiteral ¶
func (y *SyntaxFlowVisitor) VisitStringLiteral(raw sf.IStringLiteralContext) (string, bool)
func (*SyntaxFlowVisitor) VisitStringLiteralWithoutStarGroup ¶
func (y *SyntaxFlowVisitor) VisitStringLiteralWithoutStarGroup(raw sf.IStringLiteralWithoutStarGroupContext) []string
type ValueList ¶ added in v1.3.3
type ValueList struct {
// contains filtered or unexported fields
}
func (*ValueList) AppendPredecessor ¶
func (v *ValueList) AppendPredecessor(value ValueOperator, opts ...AnalysisContextOption) error
func (*ValueList) ExactMatch ¶ added in v1.3.3
func (*ValueList) GetAllCallActualParams ¶ added in v1.3.3
func (v *ValueList) GetAllCallActualParams() (ValueOperator, error)
func (*ValueList) GetCallActualParams ¶ added in v1.3.3
func (v *ValueList) GetCallActualParams(i int) (ValueOperator, error)
func (*ValueList) GetCalled ¶ added in v1.3.3
func (v *ValueList) GetCalled() (ValueOperator, error)
func (*ValueList) GetFields ¶
func (v *ValueList) GetFields() (ValueOperator, error)
func (*ValueList) GetSyntaxFlowBottomUse ¶ added in v1.3.3
func (v *ValueList) GetSyntaxFlowBottomUse(config ...*RecursiveConfigItem) (ValueOperator, error)
func (*ValueList) GetSyntaxFlowDef ¶ added in v1.3.3
func (v *ValueList) GetSyntaxFlowDef() (ValueOperator, error)
func (*ValueList) GetSyntaxFlowTopDef ¶ added in v1.3.3
func (v *ValueList) GetSyntaxFlowTopDef(config ...*RecursiveConfigItem) (ValueOperator, error)
func (*ValueList) GetSyntaxFlowUse ¶ added in v1.3.3
func (v *ValueList) GetSyntaxFlowUse() (ValueOperator, error)
func (*ValueList) ListIndex ¶ added in v1.3.3
func (v *ValueList) ListIndex(i int) (ValueOperator, error)
func (*ValueList) Merge ¶
func (v *ValueList) Merge(values ...ValueOperator) (ValueOperator, error)
func (*ValueList) Recursive ¶ added in v1.3.3
func (v *ValueList) Recursive(f func(operator ValueOperator) error) error
func (*ValueList) RegexpMatch ¶ added in v1.3.3
func (*ValueList) Remove ¶
func (v *ValueList) Remove(values ...ValueOperator) (ValueOperator, error)
type ValueOperator ¶ added in v1.3.3
type ValueOperator interface { String() string IsMap() bool IsList() bool GetOpcode() string // Recursive will execute with handler for every list or map Recursive(func(ValueOperator) error) error // ExactMatch return ops, for OpPushSearchExact ExactMatch(int, string) (bool, ValueOperator, error) // GlobMatch return opts, for OpPushSearchGlob GlobMatch(int, ssa.Glob) (bool, ValueOperator, error) // RegexpMatch for OpPushSearchRegexp RegexpMatch(int, *regexp.Regexp) (bool, ValueOperator, error) // GetCallActualParams for OpGetCallArgs GetCalled() (ValueOperator, error) GetCallActualParams(int) (ValueOperator, error) GetAllCallActualParams() (ValueOperator, error) GetFields() (ValueOperator, error) // GetTopDef and GetBottomUse is for OpBottomUse // use and def GetSyntaxFlowUse() (ValueOperator, error) GetSyntaxFlowDef() (ValueOperator, error) // top and bottom GetSyntaxFlowTopDef(...*RecursiveConfigItem) (ValueOperator, error) GetSyntaxFlowBottomUse(...*RecursiveConfigItem) (ValueOperator, error) // ListIndex for OpListIndex, like a[1] a must be list... ListIndex(i int) (ValueOperator, error) Merge(...ValueOperator) (ValueOperator, error) Remove(...ValueOperator) (ValueOperator, error) AppendPredecessor(ValueOperator, ...AnalysisContextOption) error }
func AutoValue ¶ added in v1.3.3
func AutoValue(i any) ValueOperator
func MergeValues ¶ added in v1.3.3
func MergeValues(values ...ValueOperator) ValueOperator
func NewEmptyValues ¶
func NewEmptyValues() ValueOperator
func NewValues ¶ added in v1.3.3
func NewValues(values []ValueOperator) ValueOperator
Click to show internal directories.
Click to hide internal directories.