class SourceInfo extends Message

Source information collected at parse time.

Generated from protobuf message google.api.expr.v1alpha1.SourceInfo

Methods

__construct(array $data = NULL)

Constructor.

string
getSyntaxVersion()

The syntax version of the source, e.g. cel1.

$this
setSyntaxVersion(string $var)

The syntax version of the source, e.g. cel1.

string
getLocation()

The location name. All position information attached to an expression is relative to this location.

$this
setLocation(string $var)

The location name. All position information attached to an expression is relative to this location.

RepeatedField
getLineOffsets()

Monotonically increasing list of character offsets where newlines appear.

$this
setLineOffsets(int[]|RepeatedField $var)

Monotonically increasing list of character offsets where newlines appear.

MapField
getPositions()

A map from the parse node id (e.g. Expr.id) to the character offset within source.

$this
setPositions(array|MapField $var)

A map from the parse node id (e.g. Expr.id) to the character offset within source.

MapField
getMacroCalls()

A map from the parse node id where a macro replacement was made to the call Expr that resulted in a macro expansion.

$this
setMacroCalls(array|MapField $var)

A map from the parse node id where a macro replacement was made to the call Expr that resulted in a macro expansion.

Details

at line 93
__construct(array $data = NULL)

Constructor.

Parameters

array $data { Optional. Data for populating the Message object.

@type string $syntax_version
      The syntax version of the source, e.g. `cel1`.
@type string $location
      The location name. All position information attached to an expression is
      relative to this location.
      The location could be a file, UI element, or similar. For example,
      `acme/app/AnvilPolicy.cel`.
@type int[]|\Google\Protobuf\Internal\RepeatedField $line_offsets
      Monotonically increasing list of character offsets where newlines appear.
      The line number of a given position is the index `i` where for a given
      `id` the `line_offsets[i] < id_positions[id] < line_offsets[i+1]`. The
      column may be derivd from `id_positions[id] - line_offsets[i]`.
@type array|\Google\Protobuf\Internal\MapField $positions
      A map from the parse node id (e.g. `Expr.id`) to the character offset
      within source.
@type array|\Google\Protobuf\Internal\MapField $macro_calls
      A map from the parse node id where a macro replacement was made to the
      call `Expr` that resulted in a macro expansion.
      For example, `has(value.field)` is a function call that is replaced by a
      `test_only` field selection in the AST. Likewise, the call
      `list.exists(e, e > 10)` translates to a comprehension expression. The key
      in the map corresponds to the expression id of the expanded macro, and the
      value is the call `Expr` that was replaced.

}

at line 104
string getSyntaxVersion()

The syntax version of the source, e.g. cel1.

Generated from protobuf field string syntax_version = 1;

Return Value

string

at line 116
$this setSyntaxVersion(string $var)

The syntax version of the source, e.g. cel1.

Generated from protobuf field string syntax_version = 1;

Parameters

string $var

Return Value

$this

at line 133
string getLocation()

The location name. All position information attached to an expression is relative to this location.

The location could be a file, UI element, or similar. For example, acme/app/AnvilPolicy.cel.

Generated from protobuf field string location = 2;

Return Value

string

at line 148
$this setLocation(string $var)

The location name. All position information attached to an expression is relative to this location.

The location could be a file, UI element, or similar. For example, acme/app/AnvilPolicy.cel.

Generated from protobuf field string location = 2;

Parameters

string $var

Return Value

$this

at line 165
RepeatedField getLineOffsets()

Monotonically increasing list of character offsets where newlines appear.

The line number of a given position is the index i where for a given id the line_offsets[i] < id_positions[id] < line_offsets[i+1]. The column may be derivd from id_positions[id] - line_offsets[i].

Generated from protobuf field repeated int32 line_offsets = 3;

Return Value

RepeatedField

at line 180
$this setLineOffsets(int[]|RepeatedField $var)

Monotonically increasing list of character offsets where newlines appear.

The line number of a given position is the index i where for a given id the line_offsets[i] < id_positions[id] < line_offsets[i+1]. The column may be derivd from id_positions[id] - line_offsets[i].

Generated from protobuf field repeated int32 line_offsets = 3;

Parameters

int[]|RepeatedField $var

Return Value

$this

at line 195
MapField getPositions()

A map from the parse node id (e.g. Expr.id) to the character offset within source.

Generated from protobuf field map<int64, int32> positions = 4;

Return Value

MapField

at line 208
$this setPositions(array|MapField $var)

A map from the parse node id (e.g. Expr.id) to the character offset within source.

Generated from protobuf field map<int64, int32> positions = 4;

Parameters

array|MapField $var

Return Value

$this

at line 228
MapField getMacroCalls()

A map from the parse node id where a macro replacement was made to the call Expr that resulted in a macro expansion.

For example, has(value.field) is a function call that is replaced by a test_only field selection in the AST. Likewise, the call list.exists(e, e > 10) translates to a comprehension expression. The key in the map corresponds to the expression id of the expanded macro, and the value is the call Expr that was replaced.

Generated from protobuf field map<int64, .google.api.expr.v1alpha1.Expr> macro_calls = 5;

Return Value

MapField

at line 246
$this setMacroCalls(array|MapField $var)

A map from the parse node id where a macro replacement was made to the call Expr that resulted in a macro expansion.

For example, has(value.field) is a function call that is replaced by a test_only field selection in the AST. Likewise, the call list.exists(e, e > 10) translates to a comprehension expression. The key in the map corresponds to the expression id of the expanded macro, and the value is the call Expr that was replaced.

Generated from protobuf field map<int64, .google.api.expr.v1alpha1.Expr> macro_calls = 5;

Parameters

array|MapField $var

Return Value

$this