ExprFactory
ExprFactory mirrors the cel-go construction seams for AST values.
Methods
Section titled “Methods”accuIdent()
Section titled “accuIdent()”accuIdent(
id):Expr
AccuIdent creates an Expr value representing an accumulator identifier within a comprehension.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”accuIdentName()
Section titled “accuIdentName()”accuIdentName():
string
AccuIdentName reports the accumulator variable name to be used within a comprehension.
Returns
Section titled “Returns”string
call()
Section titled “call()”call(
id,fn, …args):Expr
Call creates an Expr value representing a global function call.
Parameters
Section titled “Parameters”number
string
…Expr[]
Returns
Section titled “Returns”comprehension()
Section titled “comprehension()”comprehension(
id,iterRange,iterVar,accuVar,accuInit,loopCondition,loopStep,result):Expr
Comprehension creates an Expr value representing a one-variable comprehension over a value range.
Parameters
Section titled “Parameters”number
iterRange
Section titled “iterRange”iterVar
Section titled “iterVar”string
accuVar
Section titled “accuVar”string
accuInit
Section titled “accuInit”loopCondition
Section titled “loopCondition”loopStep
Section titled “loopStep”result
Section titled “result”Returns
Section titled “Returns”comprehensionTwoVar()
Section titled “comprehensionTwoVar()”comprehensionTwoVar(
id,iterRange,iterVar,iterVar2,accuVar,accuInit,loopCondition,loopStep,result):Expr
ComprehensionTwoVar creates an Expr value representing a two-variable comprehension over a value range.
Parameters
Section titled “Parameters”number
iterRange
Section titled “iterRange”iterVar
Section titled “iterVar”string
iterVar2
Section titled “iterVar2”string
accuVar
Section titled “accuVar”string
accuInit
Section titled “accuInit”loopCondition
Section titled “loopCondition”loopStep
Section titled “loopStep”result
Section titled “result”Returns
Section titled “Returns”copyEntryExpr()
Section titled “copyEntryExpr()”copyEntryExpr(
entry):EntryExpr
CopyEntryExpr creates a deep copy of the input EntryExpr value.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”copyExpr()
Section titled “copyExpr()”copyExpr(
expr):Expr
CopyExpr creates a deep copy of the input Expr value.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”ident()
Section titled “ident()”ident(
id,name):Expr
Ident creates an Expr value representing an identifier.
Parameters
Section titled “Parameters”number
string
Returns
Section titled “Returns”list()
Section titled “list()”list(
id,elems,optionalIndices):Expr
List creates an Expr value representing a list literal expression with optional indices.
Optional indices will typically be empty unless CEL optional types are enabled.
Parameters
Section titled “Parameters”number
Expr[]
optionalIndices
Section titled “optionalIndices”number[]
Returns
Section titled “Returns”literal()
Section titled “literal()”literal(
id,value):Expr
Literal creates an Expr value representing a literal value, such as a string or integer.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”map(
id,entries):Expr
Map creates an Expr value representing a map literal expression.
Parameters
Section titled “Parameters”number
entries
Section titled “entries”Returns
Section titled “Returns”mapEntry()
Section titled “mapEntry()”mapEntry(
id,key,value,optional):EntryExpr
MapEntry creates a MapEntry with a given key, value, and a flag indicating whether the key is optionally set.
Parameters
Section titled “Parameters”number
optional
Section titled “optional”boolean
Returns
Section titled “Returns”memberCall()
Section titled “memberCall()”memberCall(
id,fn,receiver, …args):Expr
MemberCall creates an Expr value representing a member function call.
Parameters
Section titled “Parameters”number
string
receiver
Section titled “receiver”…Expr[]
Returns
Section titled “Returns”presenceTest()
Section titled “presenceTest()”presenceTest(
id,operand,field):Expr
PresenceTest creates an Expr representing a field presence test on an operand expression.
Parameters
Section titled “Parameters”number
operand
Section titled “operand”string
Returns
Section titled “Returns”select()
Section titled “select()”select(
id,operand,field):Expr
Select creates an Expr representing a field selection on an operand expression.
Parameters
Section titled “Parameters”number
operand
Section titled “operand”string
Returns
Section titled “Returns”struct()
Section titled “struct()”struct(
id,typeName,fields):Expr
Struct creates an Expr value representing a struct literal with a given type name and a set of field initializers.
Parameters
Section titled “Parameters”number
typeName
Section titled “typeName”string
fields
Section titled “fields”Returns
Section titled “Returns”structField()
Section titled “structField()”structField(
id,field,value,optional):EntryExpr
StructField creates a StructField with a given field name, value, and a flag indicating whether the field is optionally set.
Parameters
Section titled “Parameters”number
string
optional
Section titled “optional”boolean
Returns
Section titled “Returns”unspecified()
Section titled “unspecified()”unspecified(
id):Expr
Unspecified creates an empty expression node.
Parameters
Section titled “Parameters”number