Versions in this module Expand all Collapse all v0 v0.0.5 Feb 13, 2024 v0.0.4 Feb 7, 2024 Changes in this version + func CheckAllFunctionsWereTested() error + func GetProgListing(prog Prog, level int) string + func GetSubExpr(expr string, preds int) (retStr string) + func NewCtxFromCurrent(goctx gocontext.Context, mach *Machine, pe []*sdcpb.PathElem, ...) *context + func NewCtxFromMach(mach *Machine, ctxNode xutils.XpathNode) *context + func RegisterCustomFunctions(customFunctionInfoTbl []CustomFunctionInfo) + func SetDebugLogger(logger *log.Logger) + func TypeIsBool(d Datum) (bool, string) + func TypeIsLiteral(d Datum) (bool, string) + func TypeIsNodeset(d Datum) (bool, string) + func TypeIsNumber(d Datum) (bool, string) + func TypeIsObject(d Datum) (bool, string) + type CommonLex struct + func NewCommonLex(line []byte, progBldr *ProgBuilder, mapFn PfxMapFn) CommonLex + func (lexer *CommonLex) AllowCustomFns() *CommonLex + func (lexer *CommonLex) CreateProgram(expr string) (prog []Inst, err error) + func (lexer *CommonLex) GetError() error + func (lexer *CommonLex) GetLine() []byte + func (lexer *CommonLex) GetMapFn() PfxMapFn + func (lexer *CommonLex) GetProgBldr() *ProgBuilder + func (lexer *CommonLex) Parse() + func (lexer *CommonLex) SetError(err error) + func (lexer *CommonLex) SetUserFnChecker(userFnChecker UserCustomFunctionCheckerFn) + func (x *CommonLex) ConstructToken(c rune, tokenMatcher tokenMatcherFn, tokenName string) bytes.Buffer + func (x *CommonLex) Error(s string) + func (x *CommonLex) IsNameChar(c rune) bool + func (x *CommonLex) IsNameStartChar(c rune) bool + func (x *CommonLex) LexAsterisk() (int, TokVal) + func (x *CommonLex) LexColon() (int, TokVal) + func (x *CommonLex) LexDot(c rune) (int, TokVal) + func (x *CommonLex) LexLiteral(quote rune) (int, TokVal) + func (x *CommonLex) LexName(c rune) (int, TokVal) + func (x *CommonLex) LexNum(c rune) (int, TokVal) + func (x *CommonLex) LexPunctuation(c rune) (int, TokVal) + func (x *CommonLex) LexRelationalOperator(c rune) (int, TokVal) + func (x *CommonLex) LexSlash() (int, TokVal) + func (x *CommonLex) Next() rune + func (x *CommonLex) NextNonWhitespace() rune + func (x *CommonLex) NextNonWhitespaceStringIs(expr string) bool + func (x *CommonLex) SaveTokenType(tokenType int) + type CustomFn func([]Datum) Datum + type CustomFunctionInfo struct + Args []DatumTypeChecker + DefaultRetVal Datum + FnPtr CustomFn + Name string + RetType DatumTypeChecker + type Datum interface + Boolean func(context string) bool + Literal func(context string) string + Nodeset func(context string) []xutils.XpathNode + Number func(context string) float64 + func NewBoolDatum(boolVal bool) Datum + func NewInvalidDatum() Datum + func NewLiteralDatum(lit string) Datum + func NewNodesetDatum(nodes []xutils.XpathNode) Datum + func NewNumDatum(val float64) Datum + type DatumTypeChecker func(d Datum) (bool, string) + type Inst struct + func (i Inst) String() string + type Machine struct + func NewMachine(expr string, prog []Inst, name string) *Machine + func NewMachineWithLocation(expr, location string, prog []Inst, name string) *Machine + func (mach *Machine) AllowedValues(ctxNode xutils.XpathNode, debug bool) ([]string, error) + func (mach *Machine) GetExpr() string + func (mach *Machine) GetLocation() string + func (mach *Machine) PrintMachine() string + type MustValidationClient interface + GetSchema func(ctx gocontext.Context, path *sdcpb.Path) (*sdcpb.GetSchemaResponse, error) + GetValue func(ctx gocontext.Context, candidateName string, path *sdcpb.Path) (*sdcpb.TypedValue, error) + type Path struct + Elems []*PathElem + func (p *Path) Pop() *PathElem + func (p *Path) PopAll() + func (p *Path) Push(pe *PathElem) + func (p *Path) String() string + type PathElem struct + Key map[string]string + Name string + func (pe *PathElem) String() string + type PathElemStack struct + func (ps *PathElemStack) Get() []*sdcpb.PathElem + func (ps *PathElemStack) Len() int + func (ps *PathElemStack) Pop() []*sdcpb.PathElem + func (ps *PathElemStack) Push(p []*sdcpb.PathElem) + type PfxMapFn func(prefix string) (namespace string, err error) + type Prog []Inst + type ProgBuilder struct + func NewProgBuilder(refExpr string) *ProgBuilder + func (progBldr *ProgBuilder) Add(ctx *context) + func (progBldr *ProgBuilder) And(ctx *context) + func (progBldr *ProgBuilder) CodeBltin(sym *Symbol, numArgs int) + func (progBldr *ProgBuilder) CodeEvalLocPathExists() + func (progBldr *ProgBuilder) CodeFn(fn instFunc, fnName string) + func (progBldr *ProgBuilder) CodeLiteral(lit string) + func (progBldr *ProgBuilder) CodeNameTest(name xml.Name) + func (progBldr *ProgBuilder) CodeNum(num float64) + func (progBldr *ProgBuilder) CodePathOper(elem int) + func (progBldr *ProgBuilder) CodePredEnd() + func (progBldr *ProgBuilder) CodePredEndIgnore() + func (progBldr *ProgBuilder) CodePredStart() + func (progBldr *ProgBuilder) CodePredStartIgnore() + func (progBldr *ProgBuilder) CodeSubMachine(fn instFunc, fnName, subMachine string) + func (progBldr *ProgBuilder) CurrentFix() + func (progBldr *ProgBuilder) Div(ctx *context) + func (progBldr *ProgBuilder) Eq(ctx *context) + func (progBldr *ProgBuilder) EvalLocPath(ctx *context) + func (progBldr *ProgBuilder) EvalLocPathExists(ctx *context) + func (progBldr *ProgBuilder) FilterExprEnd(ctx *context) + func (progBldr *ProgBuilder) Ge(ctx *context) + func (progBldr *ProgBuilder) GetMainProg() (prog Prog, err error) + func (progBldr *ProgBuilder) Gt(ctx *context) + func (progBldr *ProgBuilder) LRefEquals(ctx *context) + func (progBldr *ProgBuilder) LRefPredEnd(ctx *context) + func (progBldr *ProgBuilder) Le(ctx *context) + func (progBldr *ProgBuilder) Lt(ctx *context) + func (progBldr *ProgBuilder) Mod(ctx *context) + func (progBldr *ProgBuilder) Mul(ctx *context) + func (progBldr *ProgBuilder) Ne(ctx *context) + func (progBldr *ProgBuilder) Negate(ctx *context) + func (progBldr *ProgBuilder) NewPathStackFromActual() instFunc + func (progBldr *ProgBuilder) Or(ctx *context) + func (progBldr *ProgBuilder) PushBool(b bool) + func (progBldr *ProgBuilder) PushNotFound() + func (progBldr *ProgBuilder) Store(ctx *context) + func (progBldr *ProgBuilder) StorePathEval(ctx *context) + func (progBldr *ProgBuilder) Sub(ctx *context) + func (progBldr *ProgBuilder) Union(ctx *context) + func (progBldr *ProgBuilder) UnsupportedName(tokenType int, token string) + type ProgStack []Prog + func (ps *ProgStack) Pop() Prog + func (ps *ProgStack) Push(p Prog) + func (ps *ProgStack) Update(i Inst) + func (ps ProgStack) Count() int + func (ps ProgStack) Peek() Prog + type Result struct + func NewResult() *Result + func (res *Result) GetBoolResult() (bool, error) + func (res *Result) GetDebugOutput() string + func (res *Result) GetError() error + func (res *Result) GetLiteralResult() (string, error) + func (res *Result) GetNodeSetResult() ([]xutils.XpathNode, error) + func (res *Result) GetNonWarnings() []xutils.Warning + func (res *Result) GetNumResult() (float64, error) + func (res *Result) GetWarnings() []xutils.Warning + func (res *Result) IsNumber() bool + func (res *Result) PrintResult() string + type Symbol struct + func LookupXpathFunction(name string, customFnsAllowed bool, userFnCheckFn UserCustomFunctionCheckerFn) (*Symbol, bool) + func NewCustomFnSym(name string, fn CustomFn, argTypeCheckers []DatumTypeChecker, ...) *Symbol + func NewDummyFnSym(name string) *Symbol + func NewFnSym(name string, fn bltinFn, argTypeCheckers []DatumTypeChecker, ...) *Symbol + func (sym *Symbol) GetName() string + type TokVal interface + func LexCommon(x XpathLexer) (tokType int, tokVal TokVal) + type UserCustomFunctionCheckerFn func(name string) (*Symbol, bool) + type XpathLexer interface + GetError func() error + GetLine func() []byte + GetProgBldr func() *ProgBuilder + IsNameChar func(c rune) bool + IsNameStartChar func(c rune) bool + LexAsterisk func() (int, TokVal) + LexColon func() (int, TokVal) + LexDot func(c rune) (int, TokVal) + LexLiteral func(quote rune) (int, TokVal) + LexName func(c rune) (int, TokVal) + LexNum func(c rune) (int, TokVal) + LexPunctuation func(c rune) (int, TokVal) + LexRelationalOperator func(c rune) (int, TokVal) + LexSlash func() (int, TokVal) + MapTokenValToCommon func(tokenType int) int + Next func() rune + Parse func() + SaveTokenType func(tokenType int) + SetError func(err error) + type XpathPlugin interface + Lookup func(name string) (plugin.Symbol, error) + Name func() string