2013-05-20 19:34:15 -04:00
|
|
|
#ifndef SYMBOL_H
|
|
|
|
|
#define SYMBOL_H
|
|
|
|
|
|
|
|
|
|
#ifndef NULL
|
|
|
|
|
#define NULL 0
|
|
|
|
|
#endif
|
|
|
|
|
|
2013-05-30 19:49:19 -04:00
|
|
|
#include "NodeTree.h"
|
|
|
|
|
|
2013-05-20 19:34:15 -04:00
|
|
|
#include <vector>
|
|
|
|
|
#include <string>
|
|
|
|
|
|
2013-06-27 23:45:38 -04:00
|
|
|
//Circular references
|
2013-07-28 19:45:08 -04:00
|
|
|
//class NodeTree;
|
2013-06-27 23:45:38 -04:00
|
|
|
|
2013-05-20 19:34:15 -04:00
|
|
|
class Symbol {
|
|
|
|
|
public:
|
|
|
|
|
Symbol(std::string name, bool isTerminal);
|
2013-07-01 22:45:33 -04:00
|
|
|
Symbol(std::string name, bool isTerminal, std::string value);
|
2013-07-28 19:45:08 -04:00
|
|
|
Symbol(std::string name, bool isTerminal, NodeTree<Symbol*>* tree);
|
2013-05-20 19:34:15 -04:00
|
|
|
~Symbol();
|
2013-05-23 01:35:54 -04:00
|
|
|
bool const operator==(const Symbol &other);
|
2013-06-27 23:45:38 -04:00
|
|
|
std::string getName();
|
2013-05-20 19:34:15 -04:00
|
|
|
std::string toString();
|
2013-05-30 19:49:19 -04:00
|
|
|
Symbol* clone();
|
2013-07-28 19:45:08 -04:00
|
|
|
void setSubTree(NodeTree<Symbol*>* tree);
|
|
|
|
|
NodeTree<Symbol*>* getSubTree();
|
2013-05-30 19:49:19 -04:00
|
|
|
bool isTerminal();
|
2013-05-20 19:34:15 -04:00
|
|
|
private:
|
|
|
|
|
std::string name;
|
2013-06-27 23:45:38 -04:00
|
|
|
std::string value;
|
2013-05-30 19:49:19 -04:00
|
|
|
bool terminal;
|
2013-07-28 19:45:08 -04:00
|
|
|
NodeTree<Symbol*>* subTree;
|
2013-05-20 19:34:15 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|