class Expr extends Message

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

Properties

protected $expr_kind

Methods

__construct(array $data = NULL)

Constructor.

int
getId()

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.

$this
setId(int $var)

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.

getLiteralExpr()

A literal expression.

$this
setLiteralExpr(Literal $var)

A literal expression.

getIdentExpr()

An identifier expression.

$this
setIdentExpr(Ident $var)

An identifier expression.

getSelectExpr()

A field selection expression, e.g. request.auth.

$this
setSelectExpr(Select $var)

A field selection expression, e.g. request.auth.

getCallExpr()

A call expression, including calls to predefined functions and operators.

$this
setCallExpr(Call $var)

A call expression, including calls to predefined functions and operators.

getListExpr()

A list creation expression.

$this
setListExpr(CreateList $var)

A list creation expression.

getStructExpr()

A map or object creation expression.

$this
setStructExpr(CreateStruct $var)

A map or object creation expression.

getComprehensionExpr()

A comprehension expression.

$this
setComprehensionExpr(Comprehension $var)

A comprehension expression.

string
getExprKind()

No description

Details

at line 65
__construct(array $data = NULL)

Constructor.

Parameters

array $data { 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.

}

at line 78
int getId()

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.

Generated from protobuf field int32 id = 2;

Return Value

int

at line 92
$this setId(int $var)

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.

Generated from protobuf field int32 id = 2;

Parameters

int $var

Return Value

$this

at line 106
Literal getLiteralExpr()

A literal expression.

Generated from protobuf field .google.api.expr.v1beta1.Literal literal_expr = 3;

Return Value

Literal

at line 118
$this setLiteralExpr(Literal $var)

A literal expression.

Generated from protobuf field .google.api.expr.v1beta1.Literal literal_expr = 3;

Parameters

Literal $var

Return Value

$this

at line 132
Ident getIdentExpr()

An identifier expression.

Generated from protobuf field .google.api.expr.v1beta1.Expr.Ident ident_expr = 4;

Return Value

Ident

at line 144
$this setIdentExpr(Ident $var)

An identifier expression.

Generated from protobuf field .google.api.expr.v1beta1.Expr.Ident ident_expr = 4;

Parameters

Ident $var

Return Value

$this

at line 158
Select getSelectExpr()

A field selection expression, e.g. request.auth.

Generated from protobuf field .google.api.expr.v1beta1.Expr.Select select_expr = 5;

Return Value

Select

at line 170
$this setSelectExpr(Select $var)

A field selection expression, e.g. request.auth.

Generated from protobuf field .google.api.expr.v1beta1.Expr.Select select_expr = 5;

Parameters

Select $var

Return Value

$this

at line 184
Call getCallExpr()

A call expression, including calls to predefined functions and operators.

Generated from protobuf field .google.api.expr.v1beta1.Expr.Call call_expr = 6;

Return Value

Call

at line 196
$this setCallExpr(Call $var)

A call expression, including calls to predefined functions and operators.

Generated from protobuf field .google.api.expr.v1beta1.Expr.Call call_expr = 6;

Parameters

Call $var

Return Value

$this

at line 210
CreateList getListExpr()

A list creation expression.

Generated from protobuf field .google.api.expr.v1beta1.Expr.CreateList list_expr = 7;

Return Value

CreateList

at line 222
$this setListExpr(CreateList $var)

A list creation expression.

Generated from protobuf field .google.api.expr.v1beta1.Expr.CreateList list_expr = 7;

Parameters

CreateList $var

Return Value

$this

at line 236
CreateStruct getStructExpr()

A map or object creation expression.

Generated from protobuf field .google.api.expr.v1beta1.Expr.CreateStruct struct_expr = 8;

Return Value

CreateStruct

at line 248
$this setStructExpr(CreateStruct $var)

A map or object creation expression.

Generated from protobuf field .google.api.expr.v1beta1.Expr.CreateStruct struct_expr = 8;

Parameters

CreateStruct $var

Return Value

$this

at line 262
Comprehension getComprehensionExpr()

A comprehension expression.

Generated from protobuf field .google.api.expr.v1beta1.Expr.Comprehension comprehension_expr = 9;

Return Value

Comprehension

at line 274
$this setComprehensionExpr(Comprehension $var)

A comprehension expression.

Generated from protobuf field .google.api.expr.v1beta1.Expr.Comprehension comprehension_expr = 9;

Parameters

Comprehension $var

Return Value

$this

at line 285
string getExprKind()

Return Value

string