-
Notifications
You must be signed in to change notification settings - Fork 3
/
Parser.hpp
46 lines (35 loc) · 907 Bytes
/
Parser.hpp
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
#ifndef SoftWire_Parser_hpp
#define SoftWire_Parser_hpp
#include "InstructionSet.hpp"
namespace SoftWire
{
class TokenList;
class Instruction;
class Token;
class Synthesizer;
class InstructionSet;
class Parser
{
public:
Parser(TokenList &tokenList, Synthesizer &synthesizer, const InstructionSet &instructionSet);
~Parser();
const Encoding &parseLine();
const char *skipLine() const;
private:
TokenList &tokenList;
Synthesizer &synthesizer;
const InstructionSet &instructionSet;
Instruction *instruction;
void parseLabel();
void parseMnemonic();
void parseSpecifier();
void parseFirstOperand();
void parseSecondOperand();
void parseThirdOperand();
OperandIMM parseImmediate();
OperandSTR parseLiteral();
OperandREG parseRegister();
OperandMEM parseMemoryReference();
};
}
#endif // SoftWire_Parser_hpp