kubernetes/vendor/github.com/google/cel-go/common/ast/navigable.go

type NavigableExpr

// NavigateAST converts an AST to a NavigableExpr
func NavigateAST(ast *AST) NavigableExpr {}

// NavigateExpr creates a NavigableExpr whose type information is backed by the input AST.
//
// If the expression is already a NavigableExpr, the parent and depth information will be
// propagated on the new NavigableExpr value; otherwise, the expr value will be treated
// as though it is the root of the expression graph with a depth of 0.
func NavigateExpr(ast *AST, expr Expr) NavigableExpr {}

type ExprMatcher

// ConstantValueMatcher returns an ExprMatcher which will return true if the input NavigableExpr
// is comprised of all constant values, such as a simple literal or even list and map literal.
func ConstantValueMatcher() ExprMatcher {}

// KindMatcher returns an ExprMatcher which will return true if the input NavigableExpr.Kind() matches
// the specified `kind`.
func KindMatcher(kind ExprKind) ExprMatcher {}

// FunctionMatcher returns an ExprMatcher which will match NavigableExpr nodes of CallKind type whose
// function name is equal to `funcName`.
func FunctionMatcher(funcName string) ExprMatcher {}

// AllMatcher returns true for all descendants of a NavigableExpr, effectively flattening them into a list.
//
// Such a result would work well with subsequent MatchList calls.
func AllMatcher() ExprMatcher {}

// MatchDescendants takes a NavigableExpr and ExprMatcher and produces a list of NavigableExpr values
// matching the input criteria in post-order (bottom up).
func MatchDescendants(expr NavigableExpr, matcher ExprMatcher) []NavigableExpr {}

// MatchSubset applies an ExprMatcher to a list of NavigableExpr values and their descendants, producing a
// subset of NavigableExpr values which match.
func MatchSubset(exprs []NavigableExpr, matcher ExprMatcher) []NavigableExpr {}

type Visitor

type baseVisitor

// VisitExpr visits the Expr if the internal expr visitor has been configured.
func (v *baseVisitor) VisitExpr(e Expr) {}

// VisitEntryExpr visits the entry if the internal expr entry visitor has been configured.
func (v *baseVisitor) VisitEntryExpr(e EntryExpr) {}

// NewExprVisitor creates a visitor which only visits expression nodes.
func NewExprVisitor(v func(Expr)) Visitor {}

// PostOrderVisit walks the expression graph and calls the visitor in post-order (bottom-up).
func PostOrderVisit(expr Expr, visitor Visitor) {}

// PreOrderVisit walks the expression graph and calls the visitor in pre-order (top-down).
func PreOrderVisit(expr Expr, visitor Visitor) {}

type visitOrder

const preOrder

const postOrder

// TODO: consider exposing a way to configure a limit for the max visit depth.
// It's possible that we could want to configure this on the NewExprVisitor()
// and through MatchDescendents() / MaxID().
func visit(expr Expr, visitor Visitor, order visitOrder, depth, maxDepth int) {}

func matchIsConstantValue(e NavigableExpr) bool {}

func newNavigableExpr(ast *AST, parent NavigableExpr, expr Expr, depth int) NavigableExpr {}

type navigableExprImpl

func (nav *navigableExprImpl) Parent() (NavigableExpr, bool) {}

func (nav *navigableExprImpl) ID() int64 {}

func (nav *navigableExprImpl) Kind() ExprKind {}

func (nav *navigableExprImpl) Type() *types.Type {}

func (nav *navigableExprImpl) Children() []NavigableExpr {}

func (nav *navigableExprImpl) Depth() int {}

func (nav *navigableExprImpl) AsCall() CallExpr {}

func (nav *navigableExprImpl) AsComprehension() ComprehensionExpr {}

func (nav *navigableExprImpl) AsIdent() string {}

func (nav *navigableExprImpl) AsList() ListExpr {}

func (nav *navigableExprImpl) AsLiteral() ref.Val {}

func (nav *navigableExprImpl) AsMap() MapExpr {}

func (nav *navigableExprImpl) AsSelect() SelectExpr {}

func (nav *navigableExprImpl) AsStruct() StructExpr {}

func (nav *navigableExprImpl) createChild(e Expr) NavigableExpr {}

func (nav *navigableExprImpl) isExpr() {}

type navigableCallImpl

func (call navigableCallImpl) FunctionName() string {}

func (call navigableCallImpl) IsMemberFunction() bool {}

func (call navigableCallImpl) Target() Expr {}

func (call navigableCallImpl) Args() []Expr {}

type navigableComprehensionImpl

func (comp navigableComprehensionImpl) IterRange() Expr {}

func (comp navigableComprehensionImpl) IterVar() string {}

func (comp navigableComprehensionImpl) AccuVar() string {}

func (comp navigableComprehensionImpl) AccuInit() Expr {}

func (comp navigableComprehensionImpl) LoopCondition() Expr {}

func (comp navigableComprehensionImpl) LoopStep() Expr {}

func (comp navigableComprehensionImpl) Result() Expr {}

type navigableListImpl

func (l navigableListImpl) Elements() []Expr {}

func (l navigableListImpl) IsOptional(index int32) bool {}

func (l navigableListImpl) OptionalIndices() []int32 {}

func (l navigableListImpl) Size() int {}

type navigableMapImpl

func (m navigableMapImpl) Entries() []EntryExpr {}

func (m navigableMapImpl) Size() int {}

type navigableEntryImpl

func (e navigableEntryImpl) Kind() EntryExprKind {}

func (e navigableEntryImpl) Key() Expr {}

func (e navigableEntryImpl) Value() Expr {}

func (e navigableEntryImpl) IsOptional() bool {}

func (e navigableEntryImpl) renumberIDs(IDGenerator) {}

func (e navigableEntryImpl) isEntryExpr() {}

type navigableSelectImpl

func (sel navigableSelectImpl) FieldName() string {}

func (sel navigableSelectImpl) IsTestOnly() bool {}

func (sel navigableSelectImpl) Operand() Expr {}

type navigableStructImpl

func (s navigableStructImpl) TypeName() string {}

func (s navigableStructImpl) Fields() []EntryExpr {}

type navigableFieldImpl

func (f navigableFieldImpl) Kind() EntryExprKind {}

func (f navigableFieldImpl) Name() string {}

func (f navigableFieldImpl) Value() Expr {}

func (f navigableFieldImpl) IsOptional() bool {}

func (f navigableFieldImpl) renumberIDs(IDGenerator) {}

func (f navigableFieldImpl) isEntryExpr() {}

func getChildFactory(expr Expr) childFactory {}

type childFactory

func noopFactory(*navigableExprImpl) []NavigableExpr {}

func selectFactory(nav *navigableExprImpl) []NavigableExpr {}

func callArgFactory(nav *navigableExprImpl) []NavigableExpr {}

func listElemFactory(nav *navigableExprImpl) []NavigableExpr {}

func structEntryFactory(nav *navigableExprImpl) []NavigableExpr {}

func mapEntryFactory(nav *navigableExprImpl) []NavigableExpr {}

func comprehensionFactory(nav *navigableExprImpl) []NavigableExpr {}