-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathASTExpressionNode.h
43 lines (33 loc) · 1.1 KB
/
ASTExpressionNode.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: ASTExpressionNode.h
* Author: claire
*
* Created on October 6, 2013, 2:42 PM
*/
#ifndef ASTEXPRESSIONNODE_H
#define ASTEXPRESSIONNODE_H
#include "ASTNode.h"
class ASTLiteralNode;
/*ASTExpressionNode represents general expressions within the language. It is a
* subclass of ASTNode and an superclass to ASTBinaryNode, ASTUnaryNode ASTLiteralNode,
* ASTVariableNode and ASTFunctionCallNode. It overrides the print method.
* The "type" is a place holder for the type the expression returns
* (e.g. int+int is of type int). this will be used later during semantic
* analysis.
*/
class ASTExpressionNode :public virtual ASTNode {
public:
ASTExpressionNode();
ASTExpressionNode(const ASTExpressionNode& orig);
ASTExpressionNode& operator= (const ASTExpressionNode &rhs);
virtual ~ASTExpressionNode();
virtual void semAnalyze() = 0;
virtual void semAnalyze(bool restrictIdents) = 0;
virtual void scopeAnalyze() = 0;
virtual ASTLiteralNode * calc();
virtual void printNode(int indent, ostream * output) = 0;
int type;
int value;
private:
};
#endif /* ASTEXPRESSIONNODE_H */