-
Notifications
You must be signed in to change notification settings - Fork 2
/
Helper.cpp
56 lines (43 loc) · 1.04 KB
/
Helper.cpp
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include<bits/stdc++.h>
using namespace std;
#include "SymbolTable.h"
#include "SymbolInfo.h"
#include "ScopeTable.h"
#include "Helper.h"
Helper::Helper(){
text= "";
HelperType="";
code="";
tempVar="";
stk_offset="";
};
Helper::Helper(string text,vector<SymbolInfo*>v)
{
this->text = text;
this->v = v;
}
void Helper::setText(string text){this->text = text;}
void Helper::setCode(string code){this->code = code;}
void Helper::setHelperType(string HelperType){this->HelperType = HelperType;}
void Helper::setVector(vector<SymbolInfo*>v){this->v = v;}
void Helper::print()
{
cout<<"Text : "<<text<<endl;
cout<<"Vector Size : "<<v.size()<<endl;
cout<<"Vector : "<<endl;
for(auto s:v)
{
cout<<s->key<<" , "<<s->val<<endl;
}
}
// int main()
// {
// SymbolInfo* s1 = new SymbolInfo("a","bcd");
// SymbolInfo* s2 = new SymbolInfo("a2","bcd2");
// vector<SymbolInfo*>v;
// v.push_back(s1);
// v.push_back(s2);
// Helper h("dummy",v);
// h.print();
// return 0;
// }