update with initial syntaxer implementation
This commit is contained in:
+22
-3
@@ -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;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user