Move common expression classes to simple parsing setup

This commit is contained in:
Jan
2021-11-22 21:47:05 +01:00
parent 5baa311025
commit 4f2a8454a6
28 changed files with 843 additions and 861 deletions

View File

@ -0,0 +1,35 @@
#pragma once
#include <memory>
#include <string>
#include "ISimpleExpression.h"
#include "Utils/ClassUtils.h"
class ISimpleExpression;
class SimpleExpressionValue final : public ISimpleExpression
{
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 SimpleExpressionValue(std::string stringValue);
explicit SimpleExpressionValue(double doubleValue);
explicit SimpleExpressionValue(int intValue);
bool IsStatic() override;
SimpleExpressionValue Evaluate() override;
_NODISCARD bool IsTruthy() const;
};