NodeTree now also has a link to the Symbol it represents.

This commit is contained in:
Nathan Braswell
2013-06-27 23:45:38 -04:00
parent 6a2977d12a
commit c2520ec2c4
6 changed files with 37 additions and 18 deletions

View File

@@ -10,12 +10,16 @@
#include <vector>
#include <string>
//Circular references
class NodeTree;
class Symbol {
public:
Symbol(std::string name, bool isTerminal);
Symbol(std::string name, bool isTerminal, NodeTree* tree);
~Symbol();
bool const operator==(const Symbol &other);
std::string getName();
std::string toString();
Symbol* clone();
void setSubTree(NodeTree* tree);
@@ -23,6 +27,7 @@ class Symbol {
bool isTerminal();
private:
std::string name;
std::string value;
bool terminal;
NodeTree* subTree;