-
Notifications
You must be signed in to change notification settings - Fork 0
/
ASTReturnNode.h
39 lines (32 loc) · 921 Bytes
/
ASTReturnNode.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
/*
* File: ASTReturnNode.h
* Author: claire
*
* Created on October 9, 2013, 12:09 AM
*/
#ifndef ASTRETURNNODE_H
#define ASTRETURNNODE_H
#include "ASTStatementNode.h"
#include "ASTExpressionNode.h"
#include "ASTFunctionNode.h"
/*ASTReturnNode represents return statements within the code. It is a subclass of
* ASTStatementNode and overrides the print statement. It contains a pointer to
* the option expression.
*/
class ASTReturnNode : public ASTStatementNode{
public:
ASTReturnNode();
ASTReturnNode(const ASTReturnNode& orig);
ASTReturnNode& operator = (const ASTReturnNode &rhs);
virtual ~ASTReturnNode();
void semAnalyze();
void scopeAnalyze();
void printNode(int indent, ostream * output);
string genQuadruples();
ASTExpressionNode * expression;
ASTFunctionNode * funcScope;
private:
bool returnAnalyze();
void returnAnalyzeType();
};
#endif /* ASTRETURNNODE_H */