2024-06-25 18:59:15 +02:00
|
|
|
/// AUTOGENERATED COPYRIGHT HEADER START
|
|
|
|
|
// Copyright (C) 2017-2024 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
|
|
|
|
|
// AUTOGENERATED COPYRIGHT HEADER END
|
2017-11-13 02:16:17 +01:00
|
|
|
#pragma once
|
2024-06-06 13:37:13 +02:00
|
|
|
#include "ast.hpp"
|
|
|
|
|
#include "value.hpp"
|
2017-11-13 02:16:17 +01:00
|
|
|
|
2024-06-06 14:04:34 +02:00
|
|
|
namespace blitz {
|
2024-06-25 18:59:15 +02:00
|
|
|
namespace ast {
|
|
|
|
|
enum class expression_operator : int8_t {
|
2024-06-06 13:37:13 +02:00
|
|
|
Add, /*+*/
|
|
|
|
|
Subtract, /*-*/
|
|
|
|
|
Multiply, /***/
|
|
|
|
|
Divide, /*/*/
|
|
|
|
|
Invert, /*~*/
|
|
|
|
|
Power, /*^*/
|
|
|
|
|
Equal, /*=*/
|
|
|
|
|
};
|
2017-11-13 02:16:17 +01:00
|
|
|
|
2024-06-25 18:59:15 +02:00
|
|
|
class arithmetic_expression : public expression {
|
2024-06-06 13:37:13 +02:00
|
|
|
public:
|
2024-06-25 18:59:15 +02:00
|
|
|
arithmetic_expression(expression_operator op, std::unique_ptr<expression> left, std::unique_ptr<expression> right);
|
|
|
|
|
virtual ~arithmetic_expression();
|
2017-11-13 02:16:17 +01:00
|
|
|
|
2024-06-06 13:37:13 +02:00
|
|
|
private:
|
2024-06-25 18:59:15 +02:00
|
|
|
expression_operator m_operator;
|
|
|
|
|
std::unique_ptr<expression> m_left, m_right;
|
2024-06-06 13:37:13 +02:00
|
|
|
};
|
|
|
|
|
}
|
2017-11-13 02:16:17 +01:00
|
|
|
}
|