InRangeExpression
class InRangeExpression
Expression representing a check if a value is in a certain range.
constructor InRangeExpression
Create an in-range expression.
| InRangeExpression | ( | const Location & location, | |
| const Expression & lower_bound, | |||
| const Expression & upper_bound, | |||
| const Expression & argument | ); |
| PARAMETER | DESCRIPTION |
|---|---|
location |
The location of the expression in the source code. |
lower_bound |
The lower bound of the range. |
upper_bound |
The upper bound of the range. |
argument |
The value to check. |
method collect_objectsconstvirtual
| virtual void collect_objects | ( | std::unordered_set< Object * > & objects | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
objects |
method createstatic
Create an in-range expression from a list of arguments.
| 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 list of arguments. |
| RETURNS | DESCRIPTION |
|---|---|
Expression |
The created expression. |
method createstatic
Create an in-range expression from its components.
| static Expression create | ( | const Location & location, | |
| const Expression & lower_bound, | |||
| const Expression & upper_bound, | |||
| const Expression & argument | ); |
| PARAMETER | DESCRIPTION |
|---|---|
location |
The location of the expression in the source code. |
lower_bound |
The lower bound of the range. |
upper_bound |
The upper bound of the range. |
argument |
The value to check. |
| RETURNS | DESCRIPTION |
|---|---|
Expression |
The created expression. |
method evaluatedconstvirtual
| virtual std::optional< Expression > evaluated | ( | const EvaluationContext & context | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
context |
| RETURNS | DESCRIPTION |
|---|---|
std::optional< Expression > |
method maximum_valueconstvirtual
Get the maximum possible value of the expression if it can be determined.
| virtual std::optional< Value > maximum_value | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
std::optional< Value > |
The maximum possible value of the expression. |
method minimum_valueconstvirtual
Get the minimum possible value of the expression if it can be determined.
| virtual std::optional< Value > minimum_value | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
std::optional< Value > |
The minimum possible value of the 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. |
method typeconstvirtual
Get the type of the expression's value if it can be determined.
| virtual std::optional< Value::Type > type | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
std::optional< Value::Type > |
The type of the expression's value. |