-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscope.cpp
More file actions
38 lines (27 loc) · 879 Bytes
/
scope.cpp
File metadata and controls
38 lines (27 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "scope.h"
using namespace std;
Scope::Scope(const int depth) : depth(depth) {
}
Scope::~Scope() = default;
const int Scope::getDepth() const {
return depth;
}
vector<string> *Scope::getVariableNames() const {
return variableNames;
}
void Scope::setVariableNames(vector<string> *variableNames) {
Scope::variableNames = variableNames;
}
vector<string> *Scope::getThrowAwayVariableNames() const {
return throwAwayVariableNames;
}
void Scope::setThrowAwayVariableNames(vector<string> *throwAwayVariableNames) {
Scope::throwAwayVariableNames = throwAwayVariableNames;
}
const std::string Scope::toString() const {
string output = to_string(depth) + "\n";
for (unsigned int i = 0; i < variableNames->size(); i++) {
output += "--- " + variableNames->at(i) + ": " + throwAwayVariableNames->at(i) + "\n";
}
return output;
}