Skip to content

NavigableExpr

NavigableExpr augments an expression with parent, child, and type metadata.

asCall(): CallExpr | undefined

AsCall adapts the expr into a CallExpr.

CallExpr | undefined

Expr.asCall


asComprehension(): ComprehensionExpr | undefined

AsComprehension adapts the expr into a ComprehensionExpr.

ComprehensionExpr | undefined

Expr.asComprehension


asIdent(): string | undefined

AsIdent adapts the expr into an identifier string.

string | undefined

Expr.asIdent


asList(): ListExpr | undefined

AsList adapts the expr into a ListExpr.

ListExpr | undefined

Expr.asList


asLiteral(): ConstantValue | undefined

AsLiteral adapts the expr into a literal constant value.

ConstantValue | undefined

Expr.asLiteral


asMap(): MapExpr | undefined

AsMap adapts the expr into a MapExpr.

MapExpr | undefined

Expr.asMap


asSelect(): SelectExpr | undefined

AsSelect adapts the expr into a SelectExpr.

SelectExpr | undefined

Expr.asSelect


asStruct(): StructExpr | undefined

AsStruct adapts the expr into a StructExpr.

StructExpr | undefined

Expr.asStruct


children(): NavigableExpr[]

Children returns a list of child expression nodes.

NavigableExpr[]

Expr.children


depth(): number

Depth indicates the depth in the expression tree.

The root expression has depth 0.

number


id(): number

Id of the expression as it appears in the AST.

number

Expr.id


kind(): ExprKind

Kind of the expression node. See ExprKind for the valid enum values.

ExprKind

Expr.kind


parent(): [NavigableExpr | undefined, boolean]

Parent returns the parent expression node, if one exists.

[NavigableExpr | undefined, boolean]


renumberIds(generator): void

RenumberIds performs an in-place update of the expression and all of its descendant numeric ids.

IdGenerator

void

Expr.renumberIds


setKindCase(other?): void

SetKindCase replaces the contents of the current expression with the contents of the other.

This method should only be used during AST rewrites using temporary Expr values.

Expr

void

Expr.setKindCase


toProto(): Expr

ToProto converts the expression to protobuf form.

Expr

Expr.toProto


type(): Type | undefined

Type of the expression.

If the expression is type-checked, the type-check metadata is returned.

Type | undefined