-
Notifications
You must be signed in to change notification settings - Fork 0
/
ASTFunctionNode.h
41 lines (33 loc) · 992 Bytes
/
ASTFunctionNode.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
/*
* File: ASTFunctionNode.h
* Author: claire
*
* Created on October 6, 2013, 2:47 PM
*/
#ifndef ASTFUNCTIONNODE_H
#define ASTFUNCTIONNODE_H
#include "ASTDeclarationNode.h"
#include "ASTParamNode.h"
#include "ASTCompoundNode.h"
/*ASTfunctionNode is a subclass of ASTDeclarationNode and represents function
* declarations in the language. It keeps track of :
* -a list of parameters required by the function
* -a list of compound statements within the function
*/
class ASTFunctionNode : public ASTDeclarationNode{
public:
ASTFunctionNode();
ASTFunctionNode(const ASTFunctionNode& orig);
ASTFunctionNode& operator= (const ASTFunctionNode &rhs);
virtual ~ASTFunctionNode();
void semAnalyze();
void scopeAnalyze();
void printNode(int indent, ostream * output);
string genQuadruples();
int getParamCount();
ASTParamNode * param;
ASTCompoundNode * compound;
private:
void returnAnalyze();
};
#endif /* ASTFUNCTIONNODE_H */