FillExpression
class FillExpression
Expression representing a sequence of repeated values: .fill(count, value).
constructor FillExpression
Create a fill expression.
| FillExpression | ( | const Location & location, | |
| Expression count, | |||
| Expression value | ); |
| PARAMETER | DESCRIPTION |
|---|---|
location |
The location of the expression in the source code. |
count |
The expression representing the number of repetitions. |
value |
The expression representing the value to repeat. |
method createstatic
Create an expression representing a FillExpression from arguments.
This may not create a FillExpression if the expression can be simplified.
| static Expression create | ( | const Location & location, | |
| const std::vector< Expression > & arguments | ); |
| PARAMETER | DESCRIPTION |
|---|---|
location |
The location of the expression in the source code. |
arguments |
The arguments of the expression. Must contain exactly two expressions: the count and the value. |
| RETURNS | DESCRIPTION |
|---|---|
Expression |
The created expression. |
| THROWS | DESCRIPTION |
|---|---|
LocationException |
If the number of arguments is not exactly two or the first argument is not an unsigned integer expression. |
method createstatic
Create an expression representing a FillExpression.
This may not create a FillExpression if the expression can be simplified.
| static Expression create | ( | const Location & location, | |
| const Expression & count, | |||
| const Expression & value | ); |
| PARAMETER | DESCRIPTION |
|---|---|
location |
The location of the expression in the source code. |
count |
The expression representing the number of repetitions. |
value |
The expression representing the value to repeat. |
| RETURNS | DESCRIPTION |
|---|---|
Expression |
The created expression. |
| THROWS | DESCRIPTION |
|---|---|
LocationException |
If the first argument is not an unsigned integer expression. |
method evaluatedconstvirtual
| virtual std::optional< Expression > evaluated | ( | const EvaluationContext & context | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
context |
| RETURNS | DESCRIPTION |
|---|---|
std::optional< Expression > |
method serialize_subconstvirtual
Serialize the expression to a stream.
This method must be implemented by derived classes.
| virtual void serialize_sub | ( | std::ostream & stream | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
stream |
The stream to serialize to. |