-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathline_analizer.h
41 lines (32 loc) · 919 Bytes
/
line_analizer.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
#ifndef LINE_ANALIZER_H
#define LINE_ANALIZER_H
#include <iostream>
class Assembler;
class LineAnalizer {
public:
LineAnalizer(Assembler* a): my_asm(a) {}
void set(std::string& l);
bool isLabel() { return is_label; }
bool isInstr() { return is_instr; }
bool isDirec() { return is_direc; }
std::string* getLabel() { return label; }
std::string* getInstr() { return instr; }
std::string* getDirec() { return direc; }
//int getSize(); //mozda ce da se prebaci u drugu klasu
void izvestaj();
private:
Assembler* my_asm = nullptr;
int cntr = 0;
std::string* line = nullptr;
std::string* label = nullptr;
std::string* instr = nullptr;
std::string* direc = nullptr;
bool is_label = false;
bool is_instr = false;
bool is_direc = false;
bool checkDirec(std::string& word);
//bool checkInstr(std::string& word);
bool checkLabel(std::string& word);
void reset();
};
#endif // !LINE_ANALIZER_H