-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.cpp
More file actions
83 lines (33 loc) · 1.37 KB
/
test.cpp
File metadata and controls
83 lines (33 loc) · 1.37 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#include <iostream>
#include <memory>
#include "ast.h"
using namespace std;
int main() {
for (int i = 0; i < 10000; i++) {
Node* n = new Node();
string* s = new string("1234");
if (n->s != nullptr) cout << 1 <<endl;
}
}
//int main() {
// BaseAST* returnAST = new ReturnStmtAST();
// auto stmt = new StmtAST();
// stmt->returnStmt = unique_ptr<ReturnStmtAST>(returnAST);
// stmt->sType = RETURN;
// BlockItemListAST* blockItemList = new BlockItemListAST();
// blockItemList->list.push_back(unique_ptr<BaseAST>(stmt));
// BlockAST* blockAst = new BlockAST();
// blockAst->blockItemList = unique_ptr<BaseAST>(blockItemList);
// FuncDefAST* funcDefAst = new FuncDefAST();
// funcDefAst->blockAst = unique_ptr<BaseAST>(blockAst);
// FuncTypeAST* funcTypeAst = new FuncTypeAST();
// funcTypeAst->voidType = unique_ptr<BaseAST>(new VoidTypeAST());
// funcDefAst->funcType = unique_ptr<BaseAST>(funcTypeAst);
// funcDefAst->funcFParamList = nullptr;
// funcDefAst->id = std::make_unique<string>("main");
// DeclDefAST* declDefAst = new DeclDefAST();
// declDefAst->funcDef = unique_ptr<BaseAST>(funcDefAst);
// CompUnitAST* compUnitAst = new CompUnitAST();
// compUnitAst->declDefList.push_back(unique_ptr<BaseAST>(declDefAst));
// compUnitAst->accept(printer);
//}