update with initial syntaxer implementation

This commit is contained in:
2026-10-04 14:13:14 +03:00
parent 79642d3fd1
commit f00ed50d32
8 changed files with 188 additions and 10 deletions
+22 -3
View File
@@ -66,6 +66,11 @@ public:
}
} v;
Token(void)
{
}
Token(std::string s)
: v(s)
{
@@ -168,9 +173,23 @@ public:
};
class TreeNode {
std::shared_ptr<Token> l; // left hand
std::shared_ptr<Token> o; // operation
std::shared_ptr<Token> r; // right hand
public:
TreeNode *l; // left hand
TreeNode *r; // right hand
Token o; // operator
~TreeNode()
{
if (l != nullptr)
{
delete l;
}
if (r != nullptr)
{
delete r;
}
}
};
}