diff options
Diffstat (limited to 'src/MemoryData.cpp')
| -rw-r--r-- | src/MemoryData.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/MemoryData.cpp b/src/MemoryData.cpp index 34e2877..fa7f024 100644 --- a/src/MemoryData.cpp +++ b/src/MemoryData.cpp @@ -7,6 +7,10 @@ MemoryData::Type MemoryData::get_type() const { MemoryData::MemoryData() : type(TNone) {} +MemoryData* MemoryData::clone() { + return new MemoryData(*this); +} + Name::Name() : value() { this->type = TName; } @@ -15,10 +19,22 @@ Name::Name(string& str) : value(str) { this->type = TName; } +MemoryData* Name::clone() { + return new Name(*this); +} + Int::Int(int num) : value(num) { this->type = TInt; } +MemoryData* Int::clone() { + return new Int(*this); +} + Function::Function(list<string> argNames, int scopeStart, int scopeEnd) : argumentNames(argNames), scopeStart(scopeStart), scopeEnd(scopeEnd) { this->type = TFunc; } + +MemoryData* Function::clone() { + return new Function(*this); +} |
