aboutsummaryrefslogtreecommitdiff
path: root/include/parser/ast_node.hpp
diff options
context:
space:
mode:
authorCori Barker <coribarker2@gmail.com>2026-02-22 22:24:27 +0000
committerCori Barker <coribarker2@gmail.com>2026-02-22 22:24:27 +0000
commit5c1f937a7eb7a9cc9cd86cb69b3263f41f24408f (patch)
tree46154166a56f9a074c5b75dbb1a1b9560908b8f1 /include/parser/ast_node.hpp
parent2cfc45ff22cd9b6166de3cf963aceede21b358aa (diff)
Partially completed lots of changes, refactoring most of the files
Diffstat (limited to 'include/parser/ast_node.hpp')
-rw-r--r--include/parser/ast_node.hpp70
1 files changed, 0 insertions, 70 deletions
diff --git a/include/parser/ast_node.hpp b/include/parser/ast_node.hpp
deleted file mode 100644
index 6539cf6..0000000
--- a/include/parser/ast_node.hpp
+++ /dev/null
@@ -1,70 +0,0 @@
-#ifndef AST_NODE_H
-#define AST_NODE_H
-
-#include "node_type.hpp"
-
-#include <string>
-#include <vector>
-#include <memory>
-
-class ASTNode {
-public:
- int line;
- int column;
-
- virtual ~ASTNode() = default;
-};
-
-class Program : public ASTNode {
-public:
- std::vector<std::unique_ptr<ASTNode>> declarations;
-};
-
-class Declaration : public ASTNode {
-public:
- std::string type;
- std::string var_name;
- std::unique_ptr<ASTNode> value;
-
- Declaration(std::string type, std::string var_name, std::unique_ptr<ASTNode> value = nullptr) : type(type), var_name(var_name), value(std::move(value)) {}
-};
-
-class Assignment : public ASTNode {
-public:
- std::string variable_name;
- std::unique_ptr<ASTNode> value;
-
- Assignment(std::string var, std::unique_ptr<ASTNode> val) : variable_name(var), value(std::move(val)) {}
-};
-
-class NumberLiteral : public ASTNode {
-public:
- double value;
-
- NumberLiteral(double val) : value(val) {}
-};
-
-class StringLiteral : public ASTNode {
-public:
- std::string value;
-
- StringLiteral(std::string val) : value(val) {}
-};
-
-class Identifier : public ASTNode {
-public:
- std::string name;
-
- Identifier(std::string name) : name(name) {}
-};
-
-class BinaryOp : public ASTNode {
-public:
- std::unique_ptr<ASTNode> left;
- std::string value;
- std::unique_ptr<ASTNode> right;
-
- BinaryOp(std::unique_ptr<ASTNode> left, std::string value, std::unique_ptr<ASTNode> right) : left(std::move(left)), value(std::move(value)), right(std::move(right)) {}
-};
-
-#endif