Skip to content

VariableExpression

class VariableExpression

Expression node representing a variable.

DEFINITION
class VariableExpression;

constructor VariableExpression

DEFINITION
VariableExpression ( const Location & location,
Symbol  symbol );
PARAMETERDESCRIPTION
location

The location of the expression.

symbol

The name of the variable.

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 variableconst

Get the name of the variable.

DEFINITION
Symbol  variable ( ) const;
RETURNSDESCRIPTION
Symbol

The name of the variable.