-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathProgram.h
More file actions
47 lines (36 loc) · 791 Bytes
/
Program.h
File metadata and controls
47 lines (36 loc) · 791 Bytes
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
#ifndef _PROGRAM_H_
#define _PROGRAM_H_
#include <vector>
#include <string>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <algorithm> // std::reverse
#include <sstream>
#include <exception>
#include <regex>
#include "Instruction.h"
#include "Tag.h"
using namespace std;
class Program{
vector<Instruction*> instructions_;
vector<Tag*> tags_;
string fileName_;
public:
Program(string);
~Program();
Instruction* getInstruction(unsigned line);
void reset(string);
bool reachHalt(unsigned);
void show();
int getLineByTag(string);
string getFileName ();
private:
void load(string);
void setTags(string);
string readFile(string);
void parseInstructions(string);
bool existsTag(string);
string getTagFromString(string);
};
#endif