Expr
extends Message
in package
An abstract representation of a common expression.
Expressions are abstractly represented as a collection of identifiers,
select statements, function calls, literals, and comprehensions. All
operators with the exception of the '.' operator are modelled as function
calls. This makes it easy to represent new operators into the existing AST.
All references within expressions must resolve to a [Decl][google.api.expr.v1beta1.Decl] provided at
type-check for an expression to be valid. A reference may either be a bare
identifier name or a qualified identifier google.api.name. References
may either refer to a value or a function declaration.
For example, the expression google.api.name.startsWith('expr') references
the declaration google.api.name within a [Expr.Select][google.api.expr.v1beta1.Expr.Select] expression, and
the function declaration startsWith.
Generated from protobuf message google.api.expr.v1beta1.Expr
Table of Contents
Properties
- $expr_kind : mixed
- $id : mixed
- Required. An id assigned to this node by the parser which is unique in a given expression tree. This is used to associate type information and other attributes to a node in the parse tree.
Methods
- __construct() : mixed
- Constructor.
- getCallExpr() : Call|null
- A call expression, including calls to predefined functions and operators.
- getComprehensionExpr() : Comprehension|null
- A comprehension expression.
- getExprKind() : string
- getId() : int
- Required. An id assigned to this node by the parser which is unique in a given expression tree. This is used to associate type information and other attributes to a node in the parse tree.
- getIdentExpr() : Ident|null
- An identifier expression.
- getListExpr() : CreateList|null
- A list creation expression.
- getLiteralExpr() : Literal|null
- A literal expression.
- getSelectExpr() : Select|null
- A field selection expression, e.g. `request.auth`.
- getStructExpr() : CreateStruct|null
- A map or object creation expression.
- hasCallExpr() : mixed
- hasComprehensionExpr() : mixed
- hasIdentExpr() : mixed
- hasListExpr() : mixed
- hasLiteralExpr() : mixed
- hasSelectExpr() : mixed
- hasStructExpr() : mixed
- setCallExpr() : $this
- A call expression, including calls to predefined functions and operators.
- setComprehensionExpr() : $this
- A comprehension expression.
- setId() : $this
- Required. An id assigned to this node by the parser which is unique in a given expression tree. This is used to associate type information and other attributes to a node in the parse tree.
- setIdentExpr() : $this
- An identifier expression.
- setListExpr() : $this
- A list creation expression.
- setLiteralExpr() : $this
- A literal expression.
- setSelectExpr() : $this
- A field selection expression, e.g. `request.auth`.
- setStructExpr() : $this
- A map or object creation expression.
Properties
$expr_kind
protected
mixed
$expr_kind
$id
Required. An id assigned to this node by the parser which is unique in a given expression tree. This is used to associate type information and other attributes to a node in the parse tree.
protected
mixed
$id
= 0
Generated from protobuf field int32 id = 2 [json_name = "id"];
Methods
__construct()
Constructor.
public
__construct([array<string|int, mixed> $data = NULL ]) : mixed
Parameters
- $data : array<string|int, mixed> = NULL
-
{ Optional. Data for populating the Message object.
@type int $id Required. An id assigned to this node by the parser which is unique in a given expression tree. This is used to associate type information and other attributes to a node in the parse tree. @type \Google\Api\Expr\V1beta1\Literal $literal_expr A literal expression. @type \Google\Api\Expr\V1beta1\Expr\Ident $ident_expr An identifier expression. @type \Google\Api\Expr\V1beta1\Expr\Select $select_expr A field selection expression, e.g. `request.auth`. @type \Google\Api\Expr\V1beta1\Expr\Call $call_expr A call expression, including calls to predefined functions and operators. @type \Google\Api\Expr\V1beta1\Expr\CreateList $list_expr A list creation expression. @type \Google\Api\Expr\V1beta1\Expr\CreateStruct $struct_expr A map or object creation expression. @type \Google\Api\Expr\V1beta1\Expr\Comprehension $comprehension_expr A comprehension expression.}
getCallExpr()
A call expression, including calls to predefined functions and operators.
public
getCallExpr() : Call|null
Generated from protobuf field .google.api.expr.v1beta1.Expr.Call call_expr = 6 [json_name = "callExpr"];
Return values
Call|nullgetComprehensionExpr()
A comprehension expression.
public
getComprehensionExpr() : Comprehension|null
Generated from protobuf field .google.api.expr.v1beta1.Expr.Comprehension comprehension_expr = 9 [json_name = "comprehensionExpr"];
Return values
Comprehension|nullgetExprKind()
public
getExprKind() : string
Return values
stringgetId()
Required. An id assigned to this node by the parser which is unique in a given expression tree. This is used to associate type information and other attributes to a node in the parse tree.
public
getId() : int
Generated from protobuf field int32 id = 2 [json_name = "id"];
Return values
intgetIdentExpr()
An identifier expression.
public
getIdentExpr() : Ident|null
Generated from protobuf field .google.api.expr.v1beta1.Expr.Ident ident_expr = 4 [json_name = "identExpr"];
Return values
Ident|nullgetListExpr()
A list creation expression.
public
getListExpr() : CreateList|null
Generated from protobuf field .google.api.expr.v1beta1.Expr.CreateList list_expr = 7 [json_name = "listExpr"];
Return values
CreateList|nullgetLiteralExpr()
A literal expression.
public
getLiteralExpr() : Literal|null
Generated from protobuf field .google.api.expr.v1beta1.Literal literal_expr = 3 [json_name = "literalExpr"];
Return values
Literal|nullgetSelectExpr()
A field selection expression, e.g. `request.auth`.
public
getSelectExpr() : Select|null
Generated from protobuf field .google.api.expr.v1beta1.Expr.Select select_expr = 5 [json_name = "selectExpr"];
Return values
Select|nullgetStructExpr()
A map or object creation expression.
public
getStructExpr() : CreateStruct|null
Generated from protobuf field .google.api.expr.v1beta1.Expr.CreateStruct struct_expr = 8 [json_name = "structExpr"];
Return values
CreateStruct|nullhasCallExpr()
public
hasCallExpr() : mixed
hasComprehensionExpr()
public
hasComprehensionExpr() : mixed
hasIdentExpr()
public
hasIdentExpr() : mixed
hasListExpr()
public
hasListExpr() : mixed
hasLiteralExpr()
public
hasLiteralExpr() : mixed
hasSelectExpr()
public
hasSelectExpr() : mixed
hasStructExpr()
public
hasStructExpr() : mixed
setCallExpr()
A call expression, including calls to predefined functions and operators.
public
setCallExpr(Call $var) : $this
Generated from protobuf field .google.api.expr.v1beta1.Expr.Call call_expr = 6 [json_name = "callExpr"];
Parameters
- $var : Call
Return values
$thissetComprehensionExpr()
A comprehension expression.
public
setComprehensionExpr(Comprehension $var) : $this
Generated from protobuf field .google.api.expr.v1beta1.Expr.Comprehension comprehension_expr = 9 [json_name = "comprehensionExpr"];
Parameters
- $var : Comprehension
Return values
$thissetId()
Required. An id assigned to this node by the parser which is unique in a given expression tree. This is used to associate type information and other attributes to a node in the parse tree.
public
setId(int $var) : $this
Generated from protobuf field int32 id = 2 [json_name = "id"];
Parameters
- $var : int
Return values
$thissetIdentExpr()
An identifier expression.
public
setIdentExpr(Ident $var) : $this
Generated from protobuf field .google.api.expr.v1beta1.Expr.Ident ident_expr = 4 [json_name = "identExpr"];
Parameters
- $var : Ident
Return values
$thissetListExpr()
A list creation expression.
public
setListExpr(CreateList $var) : $this
Generated from protobuf field .google.api.expr.v1beta1.Expr.CreateList list_expr = 7 [json_name = "listExpr"];
Parameters
- $var : CreateList
Return values
$thissetLiteralExpr()
A literal expression.
public
setLiteralExpr(Literal $var) : $this
Generated from protobuf field .google.api.expr.v1beta1.Literal literal_expr = 3 [json_name = "literalExpr"];
Parameters
- $var : Literal
Return values
$thissetSelectExpr()
A field selection expression, e.g. `request.auth`.
public
setSelectExpr(Select $var) : $this
Generated from protobuf field .google.api.expr.v1beta1.Expr.Select select_expr = 5 [json_name = "selectExpr"];
Parameters
- $var : Select
Return values
$thissetStructExpr()
A map or object creation expression.
public
setStructExpr(CreateStruct $var) : $this
Generated from protobuf field .google.api.expr.v1beta1.Expr.CreateStruct struct_expr = 8 [json_name = "structExpr"];
Parameters
- $var : CreateStruct