-
Notifications
You must be signed in to change notification settings - Fork 0
/
ASTIfNode.h
42 lines (33 loc) · 962 Bytes
/
ASTIfNode.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
/*
* File: ASTIfNode.h
* Author: daniel
*
* Created on October 8, 2013, 1:35 AM
*/
#ifndef ASTIFNODE_H
#define ASTIFNODE_H
#include "ASTExpressionNode.h"
#include "ASTStatementNode.h"
/*ASTIfNode represents if statement. It is a subclass of ASTStatementNode and
* overrides the SATNode print statement. It keeps track of:
* -the expression within the if statement
* -the statement within the if clause
* -the statement within the else clause
*/
class ASTIfNode : public ASTStatementNode {
public:
ASTIfNode();
ASTIfNode(const ASTIfNode& orig);
ASTIfNode& operator= (const ASTIfNode &rhs);
virtual ~ASTIfNode();
void semAnalyze();
void scopeAnalyze();
void typeAnalyze();
void printNode(int indent, ostream * output);
bool returnAnalyze();
string genQuadruples();
ASTExpressionNode * exp;
ASTStatementNode * statement, *elseStatement;
private:
};
#endif /* ASTIFNODE_H */