-
Notifications
You must be signed in to change notification settings - Fork 0
/
ASTCompoundNode.h
43 lines (34 loc) · 1.09 KB
/
ASTCompoundNode.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
/*
* File: ASTCompoundNode.h
* Author: claire
*
* Created on October 6, 2013, 2:42 PM
*/
#ifndef ASTCOMPOUNDNODE_H
#define ASTCOMPOUNDNODE_H
#include "ASTNode.h"
#include "ASTDeclarationNode.h"
#include "ASTStatementNode.h"
/*The ASTCompoundNode represents compound statements within the code. It is a
* subclass of the ASTStatementNode and contains an override of the
* print statement. It has a an ASTDeclarationNodeChild representing the first
* declaration (if any), and an ASTStatementNode child representing the first
* statement in the list of statements.
*/
class ASTCompoundNode : public virtual ASTStatementNode{
public:
ASTCompoundNode();
ASTCompoundNode(const ASTCompoundNode& orig);
ASTCompoundNode& operator= (const ASTCompoundNode &rhs);
virtual ~ASTCompoundNode();
virtual void semAnalyze();
virtual void scopeAnalyze();
virtual void printNode(int indent, ostream * output);
virtual string genQuadruples();
bool returnAnalyze();
int prevDisplacement;
ASTDeclarationNode * dec;
ASTStatementNode * statement;
private:
};
#endif /* ASTCOMPOUNDNODE_H */