-
Notifications
You must be signed in to change notification settings - Fork 0
/
ASTVariableDeclarationNode.h
44 lines (35 loc) · 1.13 KB
/
ASTVariableDeclarationNode.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
/*
* File: ASTVariableNode.h
* Author: claire
*
* Created on October 6, 2013, 2:46 PM
*/
#ifndef ASTVARIABLEDECLARATIONNODE_H
#define ASTVARIABLEDECLARATIONNODE_H
#include <string>
#include "ASTDeclarationNode.h"
#include "ASTExpressionNode.h"
using namespace std;
/*ASTVariableDeclarationNode represents variable declarations. It is a subclass
* of ASTDeclarationNode and a superclass to AStParamNode. It overrides the print
* method.
* It contains the array information that may be associated with a delcartion.
* -if its an array or not
* -what the array expression is
*/
class ASTVariableDeclarationNode : public ASTDeclarationNode{
public:
ASTVariableDeclarationNode();
ASTVariableDeclarationNode(const ASTVariableDeclarationNode& orig);
ASTVariableDeclarationNode& operator= (const ASTVariableDeclarationNode &rhs);
virtual ~ASTVariableDeclarationNode();
virtual void semAnalyze();
virtual void scopeAnalyze();
virtual void printNode(int indent, ostream * output);
int level;
int displacement;
bool isArray;
ASTExpressionNode * arrayExp;
private:
};
#endif /* ASTVARIABLEDECLARATIONNODE_H */