-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathASTNode.h
58 lines (46 loc) · 1.07 KB
/
ASTNode.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* File: ASTNode.h
* Author: claire
*
* Created on October 6, 2013, 11:47 AM
*/
#ifndef ASTNODE_H
#define ASTNODE_H
#include <iostream>
#include <string>
#include <sstream>
#include "Scanner.h"
#include "Quadruple.h"
class ScopeTable;
class SemanticAnalyzer;
using namespace std;
class ASTNode {
public:
ASTNode();
ASTNode(const ASTNode& orig);
ASTNode& operator= (const ASTNode& rhs);
virtual ~ASTNode();
virtual void semAnalyze();
virtual void scopeAnalyze();
virtual void typeAnalyze();
virtual void printNode(int indent, ostream * output) = 0;
virtual string genQuadruples();
static string getTemp();
static string getLabel();
bool isGlobalDec;
ASTNode * next;
int lineNumber;
ostream * output;
static Scanner * lookup;
static SemanticAnalyzer * sa;
static bool init;
static vector <Quadruple> vec; // How to initialize??
static int tempCounter;
static int labelCounter;
static int curLevel;
static int curDisplacement;
protected:
void printIndented(string text, int indent);
private:
};
#endif /* ASTNODE_H */