-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSymbolList.cpp
More file actions
19 lines (17 loc) · 763 Bytes
/
SymbolList.cpp
File metadata and controls
19 lines (17 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <list>
#include <string>
#include <fstream>
#include "SymbolList.h"
using namespace std;
void SymbolList::writeSymbolListFile(string path) {
ofstream file;
file.open(path, ios::out);
list<SymbolItem>::iterator plist;
string str;
file << "name " << "type " << "attribute " << "storageType " << "addr " << "level " << "line " << endl;
for (plist = symbolList.begin(); plist != symbolList.end(); plist++) {
str = (*plist).name + " " + to_string((*plist).type) + " " + to_string((*plist).attribute) + " " + to_string((*plist).storageType) + " " + to_string((*plist).addr) + " " + to_string((*plist).level) + " " + to_string((*plist).line);
file << str << endl;
}
file.close();
}