mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-10 23:08:05 -05:00
Move common expression classes to simple parsing setup
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
|
||||
#include "CommonMenuTypes.h"
|
||||
#include "EventHandler/CommonEventHandlerSet.h"
|
||||
#include "Expression/ICommonExpression.h"
|
||||
#include "Parsing/Simple/Expression/ISimpleExpression.h"
|
||||
|
||||
namespace menu
|
||||
{
|
||||
@ -82,11 +82,11 @@ namespace menu
|
||||
class ColorExpressions
|
||||
{
|
||||
public:
|
||||
std::unique_ptr<ICommonExpression> m_r_exp;
|
||||
std::unique_ptr<ICommonExpression> m_g_exp;
|
||||
std::unique_ptr<ICommonExpression> m_b_exp;
|
||||
std::unique_ptr<ICommonExpression> m_a_exp;
|
||||
std::unique_ptr<ICommonExpression> m_rgb_exp;
|
||||
std::unique_ptr<ISimpleExpression> m_r_exp;
|
||||
std::unique_ptr<ISimpleExpression> m_g_exp;
|
||||
std::unique_ptr<ISimpleExpression> m_b_exp;
|
||||
std::unique_ptr<ISimpleExpression> m_a_exp;
|
||||
std::unique_ptr<ISimpleExpression> m_rgb_exp;
|
||||
};
|
||||
|
||||
std::string m_name;
|
||||
@ -133,14 +133,14 @@ namespace menu
|
||||
int m_fx_decay_start_time;
|
||||
int m_fx_decay_duration;
|
||||
|
||||
std::unique_ptr<ICommonExpression> m_visible_expression;
|
||||
std::unique_ptr<ICommonExpression> m_disabled_expression;
|
||||
std::unique_ptr<ICommonExpression> m_text_expression;
|
||||
std::unique_ptr<ICommonExpression> m_material_expression;
|
||||
std::unique_ptr<ICommonExpression> m_rect_x_exp;
|
||||
std::unique_ptr<ICommonExpression> m_rect_y_exp;
|
||||
std::unique_ptr<ICommonExpression> m_rect_w_exp;
|
||||
std::unique_ptr<ICommonExpression> m_rect_h_exp;
|
||||
std::unique_ptr<ISimpleExpression> m_visible_expression;
|
||||
std::unique_ptr<ISimpleExpression> m_disabled_expression;
|
||||
std::unique_ptr<ISimpleExpression> m_text_expression;
|
||||
std::unique_ptr<ISimpleExpression> m_material_expression;
|
||||
std::unique_ptr<ISimpleExpression> m_rect_x_exp;
|
||||
std::unique_ptr<ISimpleExpression> m_rect_y_exp;
|
||||
std::unique_ptr<ISimpleExpression> m_rect_w_exp;
|
||||
std::unique_ptr<ISimpleExpression> m_rect_h_exp;
|
||||
ColorExpressions m_forecolor_expressions;
|
||||
ColorExpressions m_glowcolor_expressions;
|
||||
ColorExpressions m_backcolor_expressions;
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "CommonItemDef.h"
|
||||
#include "CommonMenuTypes.h"
|
||||
#include "EventHandler/CommonEventHandlerSet.h"
|
||||
#include "Expression/ICommonExpression.h"
|
||||
#include "Parsing/Simple/Expression/ISimpleExpression.h"
|
||||
|
||||
namespace menu
|
||||
{
|
||||
@ -34,13 +34,13 @@ namespace menu
|
||||
double m_fade_in_amount;
|
||||
double m_blur_radius;
|
||||
std::string m_allowed_binding;
|
||||
std::unique_ptr<ICommonExpression> m_visible_expression;
|
||||
std::unique_ptr<ICommonExpression> m_rect_x_exp;
|
||||
std::unique_ptr<ICommonExpression> m_rect_y_exp;
|
||||
std::unique_ptr<ICommonExpression> m_rect_w_exp;
|
||||
std::unique_ptr<ICommonExpression> m_rect_h_exp;
|
||||
std::unique_ptr<ICommonExpression> m_open_sound_exp;
|
||||
std::unique_ptr<ICommonExpression> m_close_sound_exp;
|
||||
std::unique_ptr<ISimpleExpression> m_visible_expression;
|
||||
std::unique_ptr<ISimpleExpression> m_rect_x_exp;
|
||||
std::unique_ptr<ISimpleExpression> m_rect_y_exp;
|
||||
std::unique_ptr<ISimpleExpression> m_rect_w_exp;
|
||||
std::unique_ptr<ISimpleExpression> m_rect_h_exp;
|
||||
std::unique_ptr<ISimpleExpression> m_open_sound_exp;
|
||||
std::unique_ptr<ISimpleExpression> m_close_sound_exp;
|
||||
std::unique_ptr<CommonEventHandlerSet> m_on_open;
|
||||
std::unique_ptr<CommonEventHandlerSet> m_on_close;
|
||||
std::unique_ptr<CommonEventHandlerSet> m_on_request_close;
|
||||
|
@ -5,7 +5,7 @@ using namespace menu;
|
||||
CommonEventHandlerCondition::CommonEventHandlerCondition()
|
||||
= default;
|
||||
|
||||
CommonEventHandlerCondition::CommonEventHandlerCondition(std::unique_ptr<ICommonExpression> condition, std::unique_ptr<CommonEventHandlerSet> conditionElements,
|
||||
CommonEventHandlerCondition::CommonEventHandlerCondition(std::unique_ptr<ISimpleExpression> condition, std::unique_ptr<CommonEventHandlerSet> conditionElements,
|
||||
std::unique_ptr<CommonEventHandlerSet> elseElements)
|
||||
: m_condition(std::move(condition)),
|
||||
m_condition_elements(std::move(conditionElements)),
|
||||
|
@ -4,19 +4,19 @@
|
||||
|
||||
#include "CommonEventHandlerSet.h"
|
||||
#include "ICommonEventHandlerElement.h"
|
||||
#include "Parsing/Menu/Domain/Expression/ICommonExpression.h"
|
||||
#include "Parsing/Simple/Expression/ISimpleExpression.h"
|
||||
|
||||
namespace menu
|
||||
{
|
||||
class CommonEventHandlerCondition final : public ICommonEventHandlerElement
|
||||
{
|
||||
public:
|
||||
std::unique_ptr<ICommonExpression> m_condition;
|
||||
std::unique_ptr<ISimpleExpression> m_condition;
|
||||
std::unique_ptr<CommonEventHandlerSet> m_condition_elements;
|
||||
std::unique_ptr<CommonEventHandlerSet> m_else_elements;
|
||||
|
||||
CommonEventHandlerCondition();
|
||||
CommonEventHandlerCondition(std::unique_ptr<ICommonExpression> condition, std::unique_ptr<CommonEventHandlerSet> conditionElements,
|
||||
CommonEventHandlerCondition(std::unique_ptr<ISimpleExpression> condition, std::unique_ptr<CommonEventHandlerSet> conditionElements,
|
||||
std::unique_ptr<CommonEventHandlerSet> elseElements);
|
||||
|
||||
_NODISCARD CommonEventHandlerElementType GetType() const override;
|
||||
|
@ -7,7 +7,7 @@ CommonEventHandlerSetLocalVar::CommonEventHandlerSetLocalVar()
|
||||
{
|
||||
}
|
||||
|
||||
CommonEventHandlerSetLocalVar::CommonEventHandlerSetLocalVar(SetLocalVarType type, std::string varName, std::unique_ptr<ICommonExpression> value)
|
||||
CommonEventHandlerSetLocalVar::CommonEventHandlerSetLocalVar(SetLocalVarType type, std::string varName, std::unique_ptr<ISimpleExpression> value)
|
||||
: m_type(type),
|
||||
m_var_name(std::move(varName)),
|
||||
m_value(std::move(value))
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "ICommonEventHandlerElement.h"
|
||||
#include "Parsing/Menu/Domain/Expression/ICommonExpression.h"
|
||||
#include "Parsing/Simple/Expression/ISimpleExpression.h"
|
||||
|
||||
namespace menu
|
||||
{
|
||||
@ -21,10 +21,10 @@ namespace menu
|
||||
public:
|
||||
SetLocalVarType m_type;
|
||||
std::string m_var_name;
|
||||
std::unique_ptr<ICommonExpression> m_value;
|
||||
std::unique_ptr<ISimpleExpression> m_value;
|
||||
|
||||
CommonEventHandlerSetLocalVar();
|
||||
CommonEventHandlerSetLocalVar(SetLocalVarType type, std::string varName, std::unique_ptr<ICommonExpression> value);
|
||||
CommonEventHandlerSetLocalVar(SetLocalVarType type, std::string varName, std::unique_ptr<ISimpleExpression> value);
|
||||
|
||||
_NODISCARD CommonEventHandlerElementType GetType() const override;
|
||||
};
|
||||
|
@ -1,439 +0,0 @@
|
||||
#include "CommonExpressionBinaryOperation.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
using namespace menu;
|
||||
|
||||
CommonExpressionBinaryOperationType::CommonExpressionBinaryOperationType(std::string syntax, const OperationPrecedence precedence, evaluation_function_t evaluationFunction)
|
||||
: m_syntax(std::move(syntax)),
|
||||
m_precedence(precedence),
|
||||
m_evaluation_function(std::move(evaluationFunction))
|
||||
{
|
||||
}
|
||||
|
||||
const CommonExpressionBinaryOperationType CommonExpressionBinaryOperationType::OPERATION_ADD(
|
||||
"+",
|
||||
OperationPrecedence::ADDITION_SUBTRACTION,
|
||||
[](const CommonExpressionValue& operand1, const CommonExpressionValue& operand2) -> CommonExpressionValue
|
||||
{
|
||||
if (operand1.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
{
|
||||
if (operand2.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
return CommonExpressionValue(operand1.m_double_value + operand2.m_double_value);
|
||||
if (operand2.m_type == CommonExpressionValue::Type::INT)
|
||||
return CommonExpressionValue(operand1.m_double_value + static_cast<double>(operand2.m_int_value));
|
||||
if (operand2.m_type == CommonExpressionValue::Type::STRING)
|
||||
return CommonExpressionValue(std::to_string(operand1.m_double_value) + *operand2.m_string_value);
|
||||
}
|
||||
else if (operand1.m_type == CommonExpressionValue::Type::INT)
|
||||
{
|
||||
if (operand2.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
return CommonExpressionValue(static_cast<double>(operand1.m_int_value) + operand2.m_double_value);
|
||||
if (operand2.m_type == CommonExpressionValue::Type::INT)
|
||||
return CommonExpressionValue(operand1.m_int_value + operand2.m_int_value);
|
||||
if (operand2.m_type == CommonExpressionValue::Type::STRING)
|
||||
return CommonExpressionValue(std::to_string(operand1.m_int_value) + *operand2.m_string_value);
|
||||
}
|
||||
else if (operand1.m_type == CommonExpressionValue::Type::STRING)
|
||||
{
|
||||
if (operand2.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
return CommonExpressionValue(*operand1.m_string_value + std::to_string(operand2.m_double_value));
|
||||
if (operand2.m_type == CommonExpressionValue::Type::INT)
|
||||
return CommonExpressionValue(*operand1.m_string_value + std::to_string(operand2.m_int_value));
|
||||
if (operand2.m_type == CommonExpressionValue::Type::STRING)
|
||||
return CommonExpressionValue(*operand1.m_string_value + *operand2.m_string_value);
|
||||
}
|
||||
|
||||
return CommonExpressionValue(0);
|
||||
}
|
||||
);
|
||||
|
||||
const CommonExpressionBinaryOperationType CommonExpressionBinaryOperationType::OPERATION_SUBTRACT(
|
||||
"-",
|
||||
OperationPrecedence::ADDITION_SUBTRACTION,
|
||||
[](const CommonExpressionValue& operand1, const CommonExpressionValue& operand2) -> CommonExpressionValue
|
||||
{
|
||||
if (operand1.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
{
|
||||
if (operand2.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
return CommonExpressionValue(operand1.m_double_value - operand2.m_double_value);
|
||||
if (operand2.m_type == CommonExpressionValue::Type::INT)
|
||||
return CommonExpressionValue(operand1.m_double_value - static_cast<double>(operand2.m_int_value));
|
||||
}
|
||||
else if (operand1.m_type == CommonExpressionValue::Type::INT)
|
||||
{
|
||||
if (operand2.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
return CommonExpressionValue(static_cast<double>(operand1.m_int_value) - operand2.m_double_value);
|
||||
if (operand2.m_type == CommonExpressionValue::Type::INT)
|
||||
return CommonExpressionValue(operand1.m_int_value - operand2.m_int_value);
|
||||
}
|
||||
|
||||
return CommonExpressionValue(0);
|
||||
}
|
||||
);
|
||||
|
||||
const CommonExpressionBinaryOperationType CommonExpressionBinaryOperationType::OPERATION_MULTIPLY(
|
||||
"*",
|
||||
OperationPrecedence::MULTIPLICATION_DIVISION_REMAINDER,
|
||||
[](const CommonExpressionValue& operand1, const CommonExpressionValue& operand2) -> CommonExpressionValue
|
||||
{
|
||||
if (operand1.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
{
|
||||
if (operand2.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
return CommonExpressionValue(operand1.m_double_value * operand2.m_double_value);
|
||||
if (operand2.m_type == CommonExpressionValue::Type::INT)
|
||||
return CommonExpressionValue(operand1.m_double_value * static_cast<double>(operand2.m_int_value));
|
||||
}
|
||||
else if (operand1.m_type == CommonExpressionValue::Type::INT)
|
||||
{
|
||||
if (operand2.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
return CommonExpressionValue(static_cast<double>(operand1.m_int_value) * operand2.m_double_value);
|
||||
if (operand2.m_type == CommonExpressionValue::Type::INT)
|
||||
return CommonExpressionValue(operand1.m_int_value * operand2.m_int_value);
|
||||
}
|
||||
|
||||
return CommonExpressionValue(0);
|
||||
}
|
||||
);
|
||||
|
||||
const CommonExpressionBinaryOperationType CommonExpressionBinaryOperationType::OPERATION_DIVIDE(
|
||||
"/",
|
||||
OperationPrecedence::MULTIPLICATION_DIVISION_REMAINDER,
|
||||
[](const CommonExpressionValue& operand1, const CommonExpressionValue& operand2) -> CommonExpressionValue
|
||||
{
|
||||
if (operand1.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
{
|
||||
if (operand2.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
return CommonExpressionValue(operand1.m_double_value / operand2.m_double_value);
|
||||
if (operand2.m_type == CommonExpressionValue::Type::INT)
|
||||
return CommonExpressionValue(operand1.m_double_value / static_cast<double>(operand2.m_int_value));
|
||||
}
|
||||
else if (operand1.m_type == CommonExpressionValue::Type::INT)
|
||||
{
|
||||
if (operand2.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
return CommonExpressionValue(static_cast<double>(operand1.m_int_value) / operand2.m_double_value);
|
||||
if (operand2.m_type == CommonExpressionValue::Type::INT)
|
||||
return CommonExpressionValue(operand1.m_int_value / operand2.m_int_value);
|
||||
}
|
||||
|
||||
return CommonExpressionValue(0);
|
||||
}
|
||||
);
|
||||
|
||||
const CommonExpressionBinaryOperationType CommonExpressionBinaryOperationType::OPERATION_REMAINDER(
|
||||
"%",
|
||||
OperationPrecedence::MULTIPLICATION_DIVISION_REMAINDER,
|
||||
[](const CommonExpressionValue& operand1, const CommonExpressionValue& operand2) -> CommonExpressionValue
|
||||
{
|
||||
if (operand1.m_type == CommonExpressionValue::Type::INT && operand2.m_type == CommonExpressionValue::Type::INT)
|
||||
return CommonExpressionValue(operand1.m_int_value % operand2.m_int_value);
|
||||
|
||||
return CommonExpressionValue(0);
|
||||
}
|
||||
);
|
||||
|
||||
const CommonExpressionBinaryOperationType CommonExpressionBinaryOperationType::OPERATION_BITWISE_AND(
|
||||
"&",
|
||||
OperationPrecedence::BITWISE_AND,
|
||||
[](const CommonExpressionValue& operand1, const CommonExpressionValue& operand2) -> CommonExpressionValue
|
||||
{
|
||||
if (operand1.m_type == CommonExpressionValue::Type::INT && operand2.m_type == CommonExpressionValue::Type::INT)
|
||||
return CommonExpressionValue(operand1.m_int_value & operand2.m_int_value);
|
||||
|
||||
return CommonExpressionValue(0);
|
||||
}
|
||||
);
|
||||
|
||||
const CommonExpressionBinaryOperationType CommonExpressionBinaryOperationType::OPERATION_BITWISE_OR(
|
||||
"|",
|
||||
OperationPrecedence::BITWISE_OR,
|
||||
[](const CommonExpressionValue& operand1, const CommonExpressionValue& operand2) -> CommonExpressionValue
|
||||
{
|
||||
if (operand1.m_type == CommonExpressionValue::Type::INT && operand2.m_type == CommonExpressionValue::Type::INT)
|
||||
return CommonExpressionValue(operand1.m_int_value | operand2.m_int_value);
|
||||
|
||||
return CommonExpressionValue(0);
|
||||
}
|
||||
);
|
||||
|
||||
const CommonExpressionBinaryOperationType CommonExpressionBinaryOperationType::OPERATION_SHIFT_LEFT(
|
||||
"<<",
|
||||
OperationPrecedence::BITWISE_SHIFT,
|
||||
[](const CommonExpressionValue& operand1, const CommonExpressionValue& operand2) -> CommonExpressionValue
|
||||
{
|
||||
if (operand1.m_type == CommonExpressionValue::Type::INT && operand2.m_type == CommonExpressionValue::Type::INT)
|
||||
return CommonExpressionValue(operand1.m_int_value << operand2.m_int_value);
|
||||
|
||||
return CommonExpressionValue(0);
|
||||
}
|
||||
);
|
||||
|
||||
const CommonExpressionBinaryOperationType CommonExpressionBinaryOperationType::OPERATION_SHIFT_RIGHT(
|
||||
">>",
|
||||
OperationPrecedence::BITWISE_SHIFT,
|
||||
[](const CommonExpressionValue& operand1, const CommonExpressionValue& operand2) -> CommonExpressionValue
|
||||
{
|
||||
if (operand1.m_type == CommonExpressionValue::Type::INT && operand2.m_type == CommonExpressionValue::Type::INT)
|
||||
return CommonExpressionValue(operand1.m_int_value >> operand2.m_int_value);
|
||||
|
||||
return CommonExpressionValue(0);
|
||||
}
|
||||
);
|
||||
|
||||
const CommonExpressionBinaryOperationType CommonExpressionBinaryOperationType::OPERATION_GREATER_THAN(
|
||||
">",
|
||||
OperationPrecedence::RELATIONAL_GREATER_LESS_THAN,
|
||||
[](const CommonExpressionValue& operand1, const CommonExpressionValue& operand2) -> CommonExpressionValue
|
||||
{
|
||||
if (operand1.m_type == CommonExpressionValue::Type::STRING || operand2.m_type == CommonExpressionValue::Type::STRING)
|
||||
return CommonExpressionValue(operand1.IsTruthy() > operand2.IsTruthy());
|
||||
|
||||
if (operand1.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
{
|
||||
if (operand2.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
return CommonExpressionValue(operand1.m_double_value > operand2.m_double_value);
|
||||
if (operand2.m_type == CommonExpressionValue::Type::INT)
|
||||
return CommonExpressionValue(operand1.m_double_value > operand2.m_int_value);
|
||||
}
|
||||
else if (operand1.m_type == CommonExpressionValue::Type::INT)
|
||||
{
|
||||
if (operand2.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
return CommonExpressionValue(operand1.m_int_value > operand2.m_double_value);
|
||||
if (operand2.m_type == CommonExpressionValue::Type::INT)
|
||||
return CommonExpressionValue(operand1.m_int_value > operand2.m_int_value);
|
||||
}
|
||||
|
||||
return CommonExpressionValue(0);
|
||||
}
|
||||
);
|
||||
|
||||
const CommonExpressionBinaryOperationType CommonExpressionBinaryOperationType::OPERATION_GREATER_EQUAL_THAN(
|
||||
">=",
|
||||
OperationPrecedence::RELATIONAL_GREATER_LESS_THAN,
|
||||
[](const CommonExpressionValue& operand1, const CommonExpressionValue& operand2) -> CommonExpressionValue
|
||||
{
|
||||
if (operand1.m_type == CommonExpressionValue::Type::STRING || operand2.m_type == CommonExpressionValue::Type::STRING)
|
||||
return CommonExpressionValue(operand1.IsTruthy() >= operand2.IsTruthy());
|
||||
|
||||
if (operand1.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
{
|
||||
if (operand2.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
return CommonExpressionValue(operand1.m_double_value >= operand2.m_double_value);
|
||||
if (operand2.m_type == CommonExpressionValue::Type::INT)
|
||||
return CommonExpressionValue(operand1.m_double_value >= operand2.m_int_value);
|
||||
}
|
||||
else if (operand1.m_type == CommonExpressionValue::Type::INT)
|
||||
{
|
||||
if (operand2.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
return CommonExpressionValue(operand1.m_int_value >= operand2.m_double_value);
|
||||
if (operand2.m_type == CommonExpressionValue::Type::INT)
|
||||
return CommonExpressionValue(operand1.m_int_value >= operand2.m_int_value);
|
||||
}
|
||||
|
||||
return CommonExpressionValue(0);
|
||||
}
|
||||
);
|
||||
|
||||
const CommonExpressionBinaryOperationType CommonExpressionBinaryOperationType::OPERATION_LESS_THAN(
|
||||
"<",
|
||||
OperationPrecedence::RELATIONAL_GREATER_LESS_THAN,
|
||||
[](const CommonExpressionValue& operand1, const CommonExpressionValue& operand2) -> CommonExpressionValue
|
||||
{
|
||||
if (operand1.m_type == CommonExpressionValue::Type::STRING || operand2.m_type == CommonExpressionValue::Type::STRING)
|
||||
return CommonExpressionValue(operand1.IsTruthy() < operand2.IsTruthy());
|
||||
|
||||
if (operand1.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
{
|
||||
if (operand2.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
return CommonExpressionValue(operand1.m_double_value < operand2.m_double_value);
|
||||
if (operand2.m_type == CommonExpressionValue::Type::INT)
|
||||
return CommonExpressionValue(operand1.m_double_value < operand2.m_int_value);
|
||||
}
|
||||
else if (operand1.m_type == CommonExpressionValue::Type::INT)
|
||||
{
|
||||
if (operand2.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
return CommonExpressionValue(operand1.m_int_value < operand2.m_double_value);
|
||||
if (operand2.m_type == CommonExpressionValue::Type::INT)
|
||||
return CommonExpressionValue(operand1.m_int_value < operand2.m_int_value);
|
||||
}
|
||||
|
||||
return CommonExpressionValue(0);
|
||||
}
|
||||
);
|
||||
|
||||
const CommonExpressionBinaryOperationType CommonExpressionBinaryOperationType::OPERATION_LESS_EQUAL_THAN(
|
||||
"<=",
|
||||
OperationPrecedence::RELATIONAL_GREATER_LESS_THAN,
|
||||
[](const CommonExpressionValue& operand1, const CommonExpressionValue& operand2) -> CommonExpressionValue
|
||||
{
|
||||
if (operand1.m_type == CommonExpressionValue::Type::STRING || operand2.m_type == CommonExpressionValue::Type::STRING)
|
||||
return CommonExpressionValue(operand1.IsTruthy() <= operand2.IsTruthy());
|
||||
|
||||
if (operand1.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
{
|
||||
if (operand2.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
return CommonExpressionValue(operand1.m_double_value <= operand2.m_double_value);
|
||||
if (operand2.m_type == CommonExpressionValue::Type::INT)
|
||||
return CommonExpressionValue(operand1.m_double_value <= operand2.m_int_value);
|
||||
}
|
||||
else if (operand1.m_type == CommonExpressionValue::Type::INT)
|
||||
{
|
||||
if (operand2.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
return CommonExpressionValue(operand1.m_int_value <= operand2.m_double_value);
|
||||
if (operand2.m_type == CommonExpressionValue::Type::INT)
|
||||
return CommonExpressionValue(operand1.m_int_value <= operand2.m_int_value);
|
||||
}
|
||||
|
||||
return CommonExpressionValue(0);
|
||||
}
|
||||
);
|
||||
|
||||
const CommonExpressionBinaryOperationType CommonExpressionBinaryOperationType::OPERATION_EQUALS(
|
||||
"==",
|
||||
OperationPrecedence::RELATIONAL_EQUALS,
|
||||
[](const CommonExpressionValue& operand1, const CommonExpressionValue& operand2) -> CommonExpressionValue
|
||||
{
|
||||
if (operand1.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
{
|
||||
if (operand2.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
return CommonExpressionValue(std::fpclassify(operand1.m_double_value - operand2.m_double_value) == FP_ZERO);
|
||||
if (operand2.m_type == CommonExpressionValue::Type::INT)
|
||||
return CommonExpressionValue(std::fpclassify(operand1.m_double_value - static_cast<double>(operand2.m_int_value)) == FP_ZERO);
|
||||
|
||||
return CommonExpressionValue(0);
|
||||
}
|
||||
|
||||
if (operand1.m_type == CommonExpressionValue::Type::INT)
|
||||
{
|
||||
if (operand2.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
return CommonExpressionValue(std::fpclassify(operand1.m_double_value - operand2.m_double_value) == FP_ZERO);
|
||||
if (operand2.m_type == CommonExpressionValue::Type::INT)
|
||||
return CommonExpressionValue(operand1.m_int_value == operand2.m_int_value);
|
||||
|
||||
return CommonExpressionValue(0);
|
||||
}
|
||||
|
||||
if (operand1.m_type == CommonExpressionValue::Type::STRING)
|
||||
{
|
||||
if (operand2.m_type == CommonExpressionValue::Type::STRING)
|
||||
return CommonExpressionValue(*operand1.m_string_value == *operand2.m_string_value);
|
||||
|
||||
return CommonExpressionValue(0);
|
||||
}
|
||||
|
||||
return CommonExpressionValue(0);
|
||||
}
|
||||
);
|
||||
|
||||
const CommonExpressionBinaryOperationType CommonExpressionBinaryOperationType::OPERATION_NOT_EQUAL(
|
||||
"!=",
|
||||
OperationPrecedence::RELATIONAL_EQUALS,
|
||||
[](const CommonExpressionValue& operand1, const CommonExpressionValue& operand2) -> CommonExpressionValue
|
||||
{
|
||||
if (operand1.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
{
|
||||
if (operand2.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
return CommonExpressionValue(std::fpclassify(operand1.m_double_value - operand2.m_double_value) != FP_ZERO);
|
||||
if (operand2.m_type == CommonExpressionValue::Type::INT)
|
||||
return CommonExpressionValue(std::fpclassify(operand1.m_double_value - static_cast<double>(operand2.m_int_value)) != FP_ZERO);
|
||||
|
||||
return CommonExpressionValue(0);
|
||||
}
|
||||
|
||||
if (operand1.m_type == CommonExpressionValue::Type::INT)
|
||||
{
|
||||
if (operand2.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
return CommonExpressionValue(std::fpclassify(operand1.m_double_value - operand2.m_double_value) != FP_ZERO);
|
||||
if (operand2.m_type == CommonExpressionValue::Type::INT)
|
||||
return CommonExpressionValue(operand1.m_int_value != operand2.m_int_value);
|
||||
|
||||
return CommonExpressionValue(0);
|
||||
}
|
||||
|
||||
if (operand1.m_type == CommonExpressionValue::Type::STRING)
|
||||
{
|
||||
if (operand2.m_type == CommonExpressionValue::Type::STRING)
|
||||
return CommonExpressionValue(*operand1.m_string_value != *operand2.m_string_value);
|
||||
|
||||
return CommonExpressionValue(0);
|
||||
}
|
||||
|
||||
return CommonExpressionValue(0);
|
||||
}
|
||||
);
|
||||
|
||||
const CommonExpressionBinaryOperationType CommonExpressionBinaryOperationType::OPERATION_AND(
|
||||
"&&",
|
||||
OperationPrecedence::LOGICAL_AND,
|
||||
[](const CommonExpressionValue& operand1, const CommonExpressionValue& operand2) -> CommonExpressionValue
|
||||
{
|
||||
if (operand1.IsTruthy())
|
||||
return operand2;
|
||||
return operand1;
|
||||
}
|
||||
);
|
||||
|
||||
const CommonExpressionBinaryOperationType CommonExpressionBinaryOperationType::OPERATION_OR(
|
||||
"||",
|
||||
OperationPrecedence::LOGICAL_OR,
|
||||
[](const CommonExpressionValue& operand1, const CommonExpressionValue& operand2) -> CommonExpressionValue
|
||||
{
|
||||
if (operand1.IsTruthy())
|
||||
return operand1;
|
||||
return operand2;
|
||||
}
|
||||
);
|
||||
|
||||
const CommonExpressionBinaryOperationType* const CommonExpressionBinaryOperationType::ALL_OPERATION_TYPES[static_cast<int>(BinaryOperationId::COUNT)]
|
||||
{
|
||||
&OPERATION_ADD,
|
||||
&OPERATION_SUBTRACT,
|
||||
&OPERATION_MULTIPLY,
|
||||
&OPERATION_DIVIDE,
|
||||
&OPERATION_REMAINDER,
|
||||
&OPERATION_BITWISE_AND,
|
||||
&OPERATION_BITWISE_OR,
|
||||
&OPERATION_SHIFT_LEFT,
|
||||
&OPERATION_SHIFT_RIGHT,
|
||||
&OPERATION_GREATER_THAN,
|
||||
&OPERATION_GREATER_EQUAL_THAN,
|
||||
&OPERATION_LESS_THAN,
|
||||
&OPERATION_LESS_EQUAL_THAN,
|
||||
&OPERATION_EQUALS,
|
||||
&OPERATION_NOT_EQUAL,
|
||||
&OPERATION_AND,
|
||||
&OPERATION_OR
|
||||
};
|
||||
|
||||
CommonExpressionBinaryOperation::CommonExpressionBinaryOperation(const CommonExpressionBinaryOperationType* operationType, std::unique_ptr<ICommonExpression> operand1,
|
||||
std::unique_ptr<ICommonExpression> operand2)
|
||||
: m_operation_type(operationType),
|
||||
m_operand1(std::move(operand1)),
|
||||
m_operand2(std::move(operand2))
|
||||
{
|
||||
}
|
||||
|
||||
bool CommonExpressionBinaryOperation::Operand1NeedsParenthesis() const
|
||||
{
|
||||
const auto* operation = dynamic_cast<const CommonExpressionBinaryOperation*>(m_operand1.get());
|
||||
return operation && operation->m_operation_type->m_precedence > m_operation_type->m_precedence;
|
||||
}
|
||||
|
||||
bool CommonExpressionBinaryOperation::Operand2NeedsParenthesis() const
|
||||
{
|
||||
const auto* operation = dynamic_cast<const CommonExpressionBinaryOperation*>(m_operand2.get());
|
||||
return operation && operation->m_operation_type->m_precedence > m_operation_type->m_precedence;
|
||||
}
|
||||
|
||||
bool CommonExpressionBinaryOperation::IsStatic()
|
||||
{
|
||||
assert(m_operand1 && m_operand2);
|
||||
|
||||
return m_operand1->IsStatic() && m_operand2->IsStatic();
|
||||
}
|
||||
|
||||
CommonExpressionValue CommonExpressionBinaryOperation::Evaluate()
|
||||
{
|
||||
return m_operation_type->m_evaluation_function(m_operand1->Evaluate(), m_operand2->Evaluate());
|
||||
}
|
@ -1,100 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <functional>
|
||||
|
||||
#include "ICommonExpression.h"
|
||||
#include "CommonExpressionValue.h"
|
||||
|
||||
namespace menu
|
||||
{
|
||||
// https://en.cppreference.com/w/cpp/language/operator_precedence
|
||||
enum class OperationPrecedence
|
||||
{
|
||||
MULTIPLICATION_DIVISION_REMAINDER = 1,
|
||||
ADDITION_SUBTRACTION = 2,
|
||||
BITWISE_SHIFT = 3,
|
||||
RELATIONAL_GREATER_LESS_THAN = 4,
|
||||
RELATIONAL_EQUALS = 5,
|
||||
BITWISE_AND = 6,
|
||||
BITWISE_OR = 8,
|
||||
LOGICAL_AND = 9,
|
||||
LOGICAL_OR = 10
|
||||
};
|
||||
|
||||
enum class BinaryOperationId
|
||||
{
|
||||
ADD,
|
||||
SUBTRACT,
|
||||
MULTIPLY,
|
||||
DIVIDE,
|
||||
REMAINDER,
|
||||
BITWISE_AND,
|
||||
BITWISE_OR,
|
||||
SHIFT_LEFT,
|
||||
SHIFT_RIGHT,
|
||||
GREATER_THAN,
|
||||
GREATER_EQUAL_THAN,
|
||||
LESS_THAN,
|
||||
LESS_EQUAL_THAN,
|
||||
EQUALS,
|
||||
NOT_EQUAL,
|
||||
AND,
|
||||
OR,
|
||||
|
||||
COUNT
|
||||
};
|
||||
|
||||
class CommonExpressionBinaryOperationType
|
||||
{
|
||||
public:
|
||||
using evaluation_function_t = std::function<CommonExpressionValue(const CommonExpressionValue& operand1, const CommonExpressionValue& operand2)>;
|
||||
|
||||
std::string m_syntax;
|
||||
OperationPrecedence m_precedence;
|
||||
evaluation_function_t m_evaluation_function;
|
||||
|
||||
private:
|
||||
CommonExpressionBinaryOperationType(std::string syntax, OperationPrecedence precedence, evaluation_function_t evaluationFunction);
|
||||
|
||||
public:
|
||||
static const CommonExpressionBinaryOperationType OPERATION_ADD;
|
||||
static const CommonExpressionBinaryOperationType OPERATION_SUBTRACT;
|
||||
static const CommonExpressionBinaryOperationType OPERATION_MULTIPLY;
|
||||
static const CommonExpressionBinaryOperationType OPERATION_DIVIDE;
|
||||
static const CommonExpressionBinaryOperationType OPERATION_REMAINDER;
|
||||
static const CommonExpressionBinaryOperationType OPERATION_BITWISE_AND;
|
||||
static const CommonExpressionBinaryOperationType OPERATION_BITWISE_OR;
|
||||
static const CommonExpressionBinaryOperationType OPERATION_SHIFT_LEFT;
|
||||
static const CommonExpressionBinaryOperationType OPERATION_SHIFT_RIGHT;
|
||||
static const CommonExpressionBinaryOperationType OPERATION_GREATER_THAN;
|
||||
static const CommonExpressionBinaryOperationType OPERATION_GREATER_EQUAL_THAN;
|
||||
static const CommonExpressionBinaryOperationType OPERATION_LESS_THAN;
|
||||
static const CommonExpressionBinaryOperationType OPERATION_LESS_EQUAL_THAN;
|
||||
static const CommonExpressionBinaryOperationType OPERATION_EQUALS;
|
||||
static const CommonExpressionBinaryOperationType OPERATION_NOT_EQUAL;
|
||||
static const CommonExpressionBinaryOperationType OPERATION_AND;
|
||||
static const CommonExpressionBinaryOperationType OPERATION_OR;
|
||||
|
||||
static const CommonExpressionBinaryOperationType* const ALL_OPERATION_TYPES[static_cast<int>(BinaryOperationId::COUNT)];
|
||||
};
|
||||
|
||||
class CommonExpressionBinaryOperation final : public ICommonExpression
|
||||
{
|
||||
public:
|
||||
const CommonExpressionBinaryOperationType* m_operation_type;
|
||||
std::unique_ptr<ICommonExpression> m_operand1;
|
||||
std::unique_ptr<ICommonExpression> m_operand2;
|
||||
|
||||
CommonExpressionBinaryOperation(const CommonExpressionBinaryOperationType* operationType,
|
||||
std::unique_ptr<ICommonExpression> operand1,
|
||||
std::unique_ptr<ICommonExpression> operand2);
|
||||
|
||||
_NODISCARD bool Operand1NeedsParenthesis() const;
|
||||
_NODISCARD bool Operand2NeedsParenthesis() const;
|
||||
|
||||
bool IsStatic() override;
|
||||
CommonExpressionValue Evaluate() override;
|
||||
};
|
||||
}
|
@ -12,7 +12,7 @@ bool CommonExpressionFunctionCall::IsStatic()
|
||||
return false;
|
||||
}
|
||||
|
||||
CommonExpressionValue CommonExpressionFunctionCall::Evaluate()
|
||||
SimpleExpressionValue CommonExpressionFunctionCall::Evaluate()
|
||||
{
|
||||
return CommonExpressionValue(0);
|
||||
return SimpleExpressionValue(0);
|
||||
}
|
||||
|
@ -1,19 +1,19 @@
|
||||
#pragma once
|
||||
#include <vector>
|
||||
|
||||
#include "ICommonExpression.h"
|
||||
#include "Parsing/Simple/Expression/ISimpleExpression.h"
|
||||
|
||||
namespace menu
|
||||
{
|
||||
class CommonExpressionFunctionCall final : public ICommonExpression
|
||||
class CommonExpressionFunctionCall final : public ISimpleExpression
|
||||
{
|
||||
public:
|
||||
std::string m_function_name;
|
||||
std::vector<std::unique_ptr<ICommonExpression>> m_args;
|
||||
std::vector<std::unique_ptr<ISimpleExpression>> m_args;
|
||||
|
||||
explicit CommonExpressionFunctionCall(std::string functionName);
|
||||
|
||||
bool IsStatic() override;
|
||||
CommonExpressionValue Evaluate() override;
|
||||
SimpleExpressionValue Evaluate() override;
|
||||
};
|
||||
}
|
||||
|
@ -1,75 +0,0 @@
|
||||
#include "CommonExpressionUnaryOperation.h"
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "CommonExpressionBinaryOperation.h"
|
||||
|
||||
using namespace menu;
|
||||
|
||||
CommonExpressionUnaryOperationType::CommonExpressionUnaryOperationType(std::string syntax, evaluation_function_t evaluationFunction)
|
||||
: m_syntax(std::move(syntax)),
|
||||
m_evaluation_function(std::move(evaluationFunction))
|
||||
{
|
||||
}
|
||||
|
||||
const CommonExpressionUnaryOperationType CommonExpressionUnaryOperationType::OPERATION_NOT(
|
||||
"!",
|
||||
[](const CommonExpressionValue& operand) -> CommonExpressionValue
|
||||
{
|
||||
return CommonExpressionValue(!operand.IsTruthy());
|
||||
}
|
||||
);
|
||||
|
||||
const CommonExpressionUnaryOperationType CommonExpressionUnaryOperationType::OPERATION_BITWISE_NOT(
|
||||
"~",
|
||||
[](const CommonExpressionValue& operand) -> CommonExpressionValue
|
||||
{
|
||||
if(operand.m_type == CommonExpressionValue::Type::INT)
|
||||
return CommonExpressionValue(~operand.m_int_value);
|
||||
|
||||
return CommonExpressionValue(0);
|
||||
}
|
||||
);
|
||||
|
||||
const CommonExpressionUnaryOperationType CommonExpressionUnaryOperationType::OPERATION_NEGATIVE(
|
||||
"-",
|
||||
[](const CommonExpressionValue& operand) -> CommonExpressionValue
|
||||
{
|
||||
if(operand.m_type == CommonExpressionValue::Type::INT)
|
||||
return CommonExpressionValue(-operand.m_int_value);
|
||||
if (operand.m_type == CommonExpressionValue::Type::DOUBLE)
|
||||
return CommonExpressionValue(-operand.m_double_value);
|
||||
|
||||
return CommonExpressionValue(0);
|
||||
}
|
||||
);
|
||||
|
||||
const CommonExpressionUnaryOperationType* const CommonExpressionUnaryOperationType::ALL_OPERATION_TYPES[static_cast<int>(UnaryOperationId::COUNT)]
|
||||
{
|
||||
&OPERATION_NOT,
|
||||
&OPERATION_BITWISE_NOT,
|
||||
&OPERATION_NEGATIVE,
|
||||
};
|
||||
|
||||
CommonExpressionUnaryOperation::CommonExpressionUnaryOperation(const CommonExpressionUnaryOperationType* operationType, std::unique_ptr<ICommonExpression> operand)
|
||||
: m_operation_type(operationType),
|
||||
m_operand(std::move(operand))
|
||||
{
|
||||
}
|
||||
|
||||
bool CommonExpressionUnaryOperation::OperandNeedsParenthesis() const
|
||||
{
|
||||
return dynamic_cast<const CommonExpressionBinaryOperation*>(m_operand.get()) != nullptr;
|
||||
}
|
||||
|
||||
bool CommonExpressionUnaryOperation::IsStatic()
|
||||
{
|
||||
assert(m_operand);
|
||||
|
||||
return m_operand->IsStatic();
|
||||
}
|
||||
|
||||
CommonExpressionValue CommonExpressionUnaryOperation::Evaluate()
|
||||
{
|
||||
return m_operation_type->m_evaluation_function(m_operand->Evaluate());
|
||||
}
|
@ -1,53 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <functional>
|
||||
|
||||
#include "ICommonExpression.h"
|
||||
#include "CommonExpressionValue.h"
|
||||
|
||||
namespace menu
|
||||
{
|
||||
enum class UnaryOperationId
|
||||
{
|
||||
NOT,
|
||||
BITWISE_NOT,
|
||||
NEGATIVE,
|
||||
|
||||
COUNT
|
||||
};
|
||||
|
||||
class CommonExpressionUnaryOperationType
|
||||
{
|
||||
public:
|
||||
using evaluation_function_t = std::function<CommonExpressionValue(const CommonExpressionValue& operand)>;
|
||||
|
||||
std::string m_syntax;
|
||||
evaluation_function_t m_evaluation_function;
|
||||
|
||||
private:
|
||||
CommonExpressionUnaryOperationType(std::string syntax, evaluation_function_t evaluationFunction);
|
||||
|
||||
public:
|
||||
static const CommonExpressionUnaryOperationType OPERATION_NOT;
|
||||
static const CommonExpressionUnaryOperationType OPERATION_BITWISE_NOT;
|
||||
static const CommonExpressionUnaryOperationType OPERATION_NEGATIVE;
|
||||
|
||||
static const CommonExpressionUnaryOperationType* const ALL_OPERATION_TYPES[static_cast<int>(UnaryOperationId::COUNT)];
|
||||
};
|
||||
|
||||
class CommonExpressionUnaryOperation final : public ICommonExpression
|
||||
{
|
||||
public:
|
||||
const CommonExpressionUnaryOperationType* m_operation_type;
|
||||
std::unique_ptr<ICommonExpression> m_operand;
|
||||
|
||||
CommonExpressionUnaryOperation(const CommonExpressionUnaryOperationType* operationType, std::unique_ptr<ICommonExpression> operand);
|
||||
|
||||
_NODISCARD bool OperandNeedsParenthesis() const;
|
||||
|
||||
bool IsStatic() override;
|
||||
CommonExpressionValue Evaluate() override;
|
||||
};
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
#include "CommonExpressionValue.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
using namespace menu;
|
||||
|
||||
CommonExpressionValue::CommonExpressionValue(std::string stringValue)
|
||||
: m_type(Type::STRING),
|
||||
m_string_value(std::make_shared<std::string>(std::move(stringValue)))
|
||||
{
|
||||
m_double_value = 0;
|
||||
m_int_value = 0;
|
||||
}
|
||||
|
||||
CommonExpressionValue::CommonExpressionValue(const double doubleValue)
|
||||
: m_type(Type::DOUBLE)
|
||||
{
|
||||
m_int_value = 0;
|
||||
m_double_value = doubleValue;
|
||||
}
|
||||
|
||||
CommonExpressionValue::CommonExpressionValue(const int intValue)
|
||||
: m_type(Type::INT)
|
||||
{
|
||||
m_double_value = 0;
|
||||
m_int_value = intValue;
|
||||
}
|
||||
|
||||
bool CommonExpressionValue::IsStatic()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
CommonExpressionValue CommonExpressionValue::Evaluate()
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool CommonExpressionValue::IsTruthy() const
|
||||
{
|
||||
if (m_type == Type::DOUBLE)
|
||||
return std::fpclassify(m_double_value) != FP_ZERO;
|
||||
if (m_type == Type::INT)
|
||||
return m_int_value != 0;
|
||||
if (m_type == Type::STRING)
|
||||
return m_string_value && !m_string_value->empty();
|
||||
return false;
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "ICommonExpression.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
|
||||
namespace menu
|
||||
{
|
||||
class ICommonExpression;
|
||||
class CommonExpressionValue final : public ICommonExpression
|
||||
{
|
||||
public:
|
||||
enum class Type
|
||||
{
|
||||
STRING,
|
||||
DOUBLE,
|
||||
INT
|
||||
};
|
||||
|
||||
Type m_type;
|
||||
std::shared_ptr<std::string> m_string_value;
|
||||
union
|
||||
{
|
||||
double m_double_value;
|
||||
int m_int_value;
|
||||
};
|
||||
|
||||
explicit CommonExpressionValue(std::string stringValue);
|
||||
explicit CommonExpressionValue(double doubleValue);
|
||||
explicit CommonExpressionValue(int intValue);
|
||||
|
||||
bool IsStatic() override;
|
||||
CommonExpressionValue Evaluate() override;
|
||||
_NODISCARD bool IsTruthy() const;
|
||||
};
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
namespace menu
|
||||
{
|
||||
class CommonExpressionValue;
|
||||
class ICommonExpression
|
||||
{
|
||||
protected:
|
||||
ICommonExpression() = default;
|
||||
public:
|
||||
virtual ~ICommonExpression() = default;
|
||||
ICommonExpression(const ICommonExpression& other) = default;
|
||||
ICommonExpression(ICommonExpression&& other) noexcept = default;
|
||||
ICommonExpression& operator=(const ICommonExpression& other) = default;
|
||||
ICommonExpression& operator=(ICommonExpression&& other) noexcept = default;
|
||||
|
||||
virtual bool IsStatic() = 0;
|
||||
virtual CommonExpressionValue Evaluate() = 0;
|
||||
};
|
||||
}
|
||||
|
||||
// Include CommonExpressionValue after definition to avoid "base class not defined"
|
||||
#include "CommonExpressionValue.h"
|
Reference in New Issue
Block a user