Skip to content

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 );
PARAMETERDESCRIPTION
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;
PARAMETERDESCRIPTION
objects

method createstatic

Create a function expression.

DEFINITION
static Expression  create ( const Location & location,
Symbol  name,
const std::vector< Expression > & arguments );
PARAMETERDESCRIPTION
location

The location of the expression in the source code.

name

The name of the function.

arguments

The arguments to the function.

RETURNSDESCRIPTION
Expression

The created expression.

method evaluatedconstvirtual

DEFINITION
virtual std::optional< Expression >  evaluated ( const EvaluationContext & context ) const;
PARAMETERDESCRIPTION
context
RETURNSDESCRIPTION
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;
PARAMETERDESCRIPTION
stream

The stream to serialize to.

method setupstatic

Set up tokenizer for parsing function expressions.

DEFINITION
static void  setup ( FileTokenizer & tokenizer );
PARAMETERDESCRIPTION
tokenizer

The tokenizer to set up.