-
Notifications
You must be signed in to change notification settings - Fork 0
/
parser.hxx
26 lines (22 loc) · 792 Bytes
/
parser.hxx
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
#ifndef parser_hxx
#define parser_hxx
#include <memory>
#include <exception>
#include "tokeniser.hxx"
#include "instruction.hxx"
#include "APInt.hxx"
class parser {
public:
parser(std::shared_ptr<tokeniser> tokeniser);
~parser() = default;
bool TryGetNextInstruction(std::shared_ptr<instruction>& instruction);
private:
std::shared_ptr<tokeniser> m_tokeniser;
bool parseStackInstructions(std::shared_ptr<instruction>& instruction);
bool parseArithmeticInstructions(std::shared_ptr<instruction>& instruction );
bool parseHeapInstructions(std::shared_ptr<instruction>& instruction);
bool parseControlInstructions(std::shared_ptr<instruction>& instruction);
bool parseIOInstructions(std::shared_ptr<instruction>& instruction);
bool ParseNumber(APInt& num);
};
#endif