Files
kraken/include/Symbol.h

38 lines
838 B
C
Raw Normal View History

2013-05-20 19:34:15 -04:00
#ifndef SYMBOL_H
#define SYMBOL_H
#ifndef NULL
#define NULL ((void*)0)
2013-05-20 19:34:15 -04:00
#endif
#include "NodeTree.h"
2013-05-20 19:34:15 -04:00
#include <vector>
#include <string>
class Symbol {
public:
Symbol();
2013-05-20 19:34:15 -04:00
Symbol(std::string name, bool isTerminal);
Symbol(std::string name, bool isTerminal, std::string value);
Symbol(std::string name, bool isTerminal, NodeTree<Symbol>* tree);
2013-05-20 19:34:15 -04:00
~Symbol();
bool const operator==(const Symbol &other)const;
bool const operator!=(const Symbol &other)const;
bool const operator<(const Symbol &other)const;
std::string getName() const;
2013-10-16 01:43:18 -04:00
std::string getValue() const;
std::string toString() const;
Symbol clone();
void setSubTree(NodeTree<Symbol>* tree);
NodeTree<Symbol>* getSubTree();
bool isTerminal();
2013-05-20 19:34:15 -04:00
private:
std::string name;
std::string value;
bool terminal;
NodeTree<Symbol>* subTree;
2013-05-20 19:34:15 -04:00
};
#endif