diff options
author | Marius Kintel <kintel@sim.no> | 2010-03-02 18:22:31 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2010-10-31 00:42:34 (GMT) |
commit | 393c5a19fedfa4f97ca939fbcf52c2ccab1cde6a (patch) | |
tree | fbcb75d32e8763aac3f0ad28528936a0ec11930b /src/state.h | |
parent | 746159d1838e895e80725cdc892f7bef85feb1af (diff) |
Committed current version of visitor refactoring
Diffstat (limited to 'src/state.h')
-rw-r--r-- | src/state.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/state.h b/src/state.h new file mode 100644 index 0000000..7ac8e9f --- /dev/null +++ b/src/state.h @@ -0,0 +1,28 @@ +#ifndef STATE_H_ +#define STATE_H_ + +class State +{ +public: + State(const class AbstractNode *parent) + : parentnode(parent), isprefix(false), ispostfix(false), numchildren(0) { } + virtual ~State() {} + + void setPrefix(bool on) { this->isprefix = on; } + void setPostfix(bool on) { this->ispostfix = on; } + void setNumChildren(unsigned int numc) { this->numchildren = numc; } + void setParent(const AbstractNode *parent) { this->parentnode = parent; } + + bool isPrefix() const { return this->isprefix; } + bool isPostfix() const { return this->ispostfix; } + unsigned int numChildren() const { return this->numchildren; } + const AbstractNode *parent() const { return this->parentnode; } + +private: + const AbstractNode * parentnode; + bool isprefix; + bool ispostfix; + unsigned int numchildren; +}; + +#endif |