ValueExpression
class ValueExpression
Expression node representing a Value.
constructor ValueExpression
Create a value expression.
| ValueExpression | ( | const Location & location, | |
| Value value | ); |
| PARAMETER | DESCRIPTION |
|---|---|
location |
The location of the expression. |
value |
The value of the expression. |
constructor ValueExpression
Create a value expression with an unsigned integer value.
| ValueExpression | ( | const Location & location, | |
| uint64_t value | ); |
| PARAMETER | DESCRIPTION |
|---|---|
location |
The location of the expression. |
value |
The unsigned integer value of the expression. |
constructor ValueExpression
Create a value expression from a token.
| ValueExpression | ( | const Token & token | ); |
| PARAMETER | DESCRIPTION |
|---|---|
token |
The token to create the expression from. |
| THROWS | DESCRIPTION |
|---|---|
Exception |
if the token is not a value or string token. |
method evaluatedconstvirtual
| virtual std::optional< Expression > evaluated | ( | const EvaluationContext & context | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
context |
| RETURNS | DESCRIPTION |
|---|---|
std::optional< Expression > |
method has_valueconstvirtual
Check if the expression has already been fully evaluated and has a value.
| virtual bool has_value | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
bool |
|
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. |
method valueconstvirtual
Get the value of the expression if it has one.
| virtual std::optional< Value > value | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
std::optional< Value > |
The value of the expression. |