This repository has been archived by the owner on Mar 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SymbolInfo.h
66 lines (56 loc) · 1.75 KB
/
SymbolInfo.h
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
57
58
59
60
61
62
63
64
65
66
// Created by rng70
#ifndef COMPILER_SYMBOLINFO_H
#define COMPILER_SYMBOLINFO_H
class SymbolInfo {
std::string name;
std::string type;
SymbolInfo *nextPointer;
public:
ExtraSymbolInfo extraSymbolInfo;
SymbolInfo() {
this->name = "";
this->type = "";
this->nextPointer = 0;
extraSymbolInfo.indexOfArray = "";
extraSymbolInfo.sizeOfArray = "";
extraSymbolInfo.typeOfID = "";
extraSymbolInfo.typeOfVar = "";
extraSymbolInfo.isFunction = false;
extraSymbolInfo.isFunctionDefined = false;
extraSymbolInfo.isFunctionDeclared = false;
extraSymbolInfo.returnTypeOfFunction = "";
}
SymbolInfo(std::string symbolName, std::string symbolType, SymbolInfo *pointer = 0) {
this->name = symbolName;
this->type = symbolType;
this->nextPointer = 0;
extraSymbolInfo.indexOfArray = "";
extraSymbolInfo.sizeOfArray = "";
extraSymbolInfo.typeOfID = "";
extraSymbolInfo.typeOfVar = "";
extraSymbolInfo.isFunction = false;
extraSymbolInfo.isFunctionDefined = false;
extraSymbolInfo.isFunctionDeclared = false;
extraSymbolInfo.returnTypeOfFunction = "";
this->nextPointer = pointer;
}
void setName(std::string symbolName) {
this->name = symbolName;
}
void setType(std::string symbolType) {
this->type = symbolType;
}
void setNextPointer(SymbolInfo *nextChainingPointer) {
this->nextPointer = nextChainingPointer;
}
std::string getName() {
return this->name;
}
std::string getType() {
return this->type;
}
SymbolInfo *getNextPointer() {
return this->nextPointer;
}
};
#endif //COMPILER_SYMBOLINFO_H