Skip to content

DefinedExpression

class DefinedExpression

Represents a defined expression, which checks if a preprocessor constant is defined: .defined(USE_FEATURE).

DEFINITION
class DefinedExpression;

constructor DefinedExpression

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

method createstatic

DEFINITION
static Expression  create ( const Location & location,
const std::vector< Expression > & arguments );
PARAMETERDESCRIPTION
location
arguments
RETURNSDESCRIPTION
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 typeconstvirtual

Get the type of the expression's value if it can be determined.

DEFINITION
virtual std::optional< Value::Type >  type ( ) const;
RETURNSDESCRIPTION
std::optional< Value::Type >

The type of the expression's value.