mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-13 00:08:26 -05:00
Move common expression classes to simple parsing setup
This commit is contained in:
35
src/Parser/Parsing/Simple/Expression/SimpleExpressionValue.h
Normal file
35
src/Parser/Parsing/Simple/Expression/SimpleExpressionValue.h
Normal 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;
|
||||
};
|
Reference in New Issue
Block a user