-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathASTAssignmentNode.h
50 lines (40 loc) · 1.2 KB
/
ASTAssignmentNode.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
/*
* File: ASTAssignmentNode.h
* Author: daniel
*
* Created on October 8, 2013, 1:19 AM
*/
#ifndef ASTASSIGNMENTNODE_H
#define ASTASSIGNMENTNODE_H
#include <string>
#include "ASTExpressionNode.h"
#include "ASTStatementNode.h"
#include "ASTDeclarationNode.h"
using namespace std;
/*The ASTAssignmentNode represents assignment operations within the program. It
* is a subclass of the ASTStatementNode. It contains an override of the
* print statement. This node keeps track of:
* -if it is an array or not
* -the id of what is being assigned to
* -pointer to the expression that is contained in the array portion
* -pointer to the operand expression
*
*/
class ASTAssignmentNode : public ASTStatementNode {
public:
ASTAssignmentNode();
ASTAssignmentNode(const ASTAssignmentNode& orig);
ASTAssignmentNode& operator= (const ASTAssignmentNode &rhs);
virtual ~ASTAssignmentNode();
void semAnalyze();
void scopeAnalyze();
void typeAnalyze();
void printNode(int indent, ostream * output);
string genQuadruples();
bool isArray;
int id;
ASTDeclarationNode * left;
ASTExpressionNode * exp, *arrayExp;
private:
};
#endif /* ASTASSIGNMENTNODE_H */