-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathASTStatementNode.cpp
62 lines (44 loc) · 1.09 KB
/
ASTStatementNode.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
57
58
59
60
61
62
/*
* File: ASTStatementNode.cpp
* Author: claire
*
* Created on October 6, 2013, 2:43 PM
*/
#include "ASTStatementNode.h"
ASTStatementNode::ASTStatementNode() : ASTNode() {
}
ASTStatementNode::ASTStatementNode(const ASTStatementNode& orig) : ASTNode(orig){
}
ASTStatementNode& ASTStatementNode::operator= (const ASTStatementNode &rhs)
{
ASTNode::operator=(rhs);
// return the existing object
return *this;
}
ASTStatementNode::~ASTStatementNode() {
}
void ASTStatementNode::semAnalyze(){
if(init || !this->isGlobalDec){
this->scopeAnalyze();
if(init)
return;
}
if(this->next != NULL)
this->next->semAnalyze();
//this->typeAnalyze();
}
void ASTStatementNode::scopeAnalyze(){
}
bool ASTStatementNode::returnAnalyze() {
if(next != NULL) {
return dynamic_cast<ASTStatementNode *>(next)->returnAnalyze();
}
return false;
}
void ASTStatementNode::printNode(int indent, ostream * output) {
this->output = output;
printIndented("statement", indent);
if(next != NULL) {
next->printNode(indent, output);
}
}