FunctionExpression
class FunctionExpression
Expression representing a function call: function_name(arg1, arg2, ...).
DEFINITION
class FunctionExpression;
constructor FunctionExpression
Create a function expression.
DEFINITION
| FunctionExpression | ( | const Location & location, | |
| Symbol name, | |||
| std::vector< Expression > arguments | ); |
| PARAMETER | DESCRIPTION |
|---|---|
location |
The location of the expression in the source code. |
name |
The name of the function. |
arguments |
The arguments to the function. |
method collect_objectsconstvirtual
DEFINITION
| virtual void collect_objects | ( | std::unordered_set< Object * > & objects | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
objects |
method createstatic
Create a function expression.
DEFINITION
| static Expression create | ( | const Location & location, | |
| Symbol name, | |||
| const std::vector< Expression > & arguments | ); |
| PARAMETER | DESCRIPTION |
|---|---|
location |
The location of the expression in the source code. |
name |
The name of the function. |
arguments |
The arguments to the function. |
| RETURNS | DESCRIPTION |
|---|---|
Expression |
The created expression. |
method evaluatedconstvirtual
DEFINITION
| 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.
DEFINITION
| virtual void serialize_sub | ( | std::ostream & stream | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
stream |
The stream to serialize to. |
method setupstatic
Set up tokenizer for parsing function expressions.
DEFINITION
| static void setup | ( | FileTokenizer & tokenizer | ); |
| PARAMETER | DESCRIPTION |
|---|---|
tokenizer |
The tokenizer to set up. |