-
Notifications
You must be signed in to change notification settings - Fork 0
/
GraphDrawer.h
42 lines (32 loc) · 932 Bytes
/
GraphDrawer.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
//
// Created by tmpark on 2/2/16.
//
#ifndef ADV_COMPILER_GRAPHDRAWER_H
#define ADV_COMPILER_GRAPHDRAWER_H
#include <fstream>
#include <iostream>
#include "Helper.h"
using namespace std;
class GraphDrawer {
public:
GraphDrawer(){};
~GraphDrawer(){
_graphDrawer = 0;
}
static GraphDrawer* instance();
RC createFile(const string &fileName);
RC openFile(const std::string &fileName);
RC destroyFile(const string &fileName);
RC closeFile();
void writePreliminary(GRAPHTYPE graphType, string functionName);
void writeNodeStart(int blockNum,string blockName);
void writeCode(string codeString);
void writeCodeForCond();
void writeNodeEnd();
void writeEdge(int sourceNum, int targetNum, EDGETYPE edgeType, GRAPHTYPE graphType);
void writeEnd();
private:
static GraphDrawer *_graphDrawer;
std::fstream fileStream;
};
#endif //ADV_COMPILER_GRAPHDRAWER_H