Checking of assembly input for operand type correctness.
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
#ifndef HARPTOOL_ASM_TOKENS
|
||||
#define HARPTOOL_ASM_TOKENS
|
||||
|
||||
namespace HarpTools {
|
||||
enum AsmTokens {
|
||||
ASM_T_DIR_DEF = 1, ASM_T_DIR_PERM, ASM_T_DIR_BYTE, ASM_T_DIR_WORD,
|
||||
@@ -9,3 +12,5 @@ namespace HarpTools {
|
||||
ASM_T_REG_FP, ASM_T_LIT, ASM_T_SYM, ASM_T_PEXP
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
|
||||
#include "types.h"
|
||||
#include "archdef.h"
|
||||
#include "instruction.h"
|
||||
#include "enc.h"
|
||||
#include "asm-tokens.h"
|
||||
|
||||
namespace Harp {
|
||||
class Decoder;
|
||||
@@ -174,6 +176,10 @@ namespace Harp {
|
||||
virtual Obj *read(std::istream &input);
|
||||
private:
|
||||
Size wordSize, nRegs;
|
||||
|
||||
// Operand type sequences indexed by argument class
|
||||
enum ArgType {AT_END, AT_REG, AT_PREG, AT_LIT};
|
||||
static ArgType operandtype_table[][4]; // ArgClass -> ArgType[arg_idx]
|
||||
};
|
||||
|
||||
class HOFReader : public ObjReader {
|
||||
|
||||
Reference in New Issue
Block a user