Checking of assembly input for operand type correctness.

This commit is contained in:
cdkersey
2015-09-29 13:23:57 -06:00
parent 7a2ce3ee37
commit 4840bf3ebd
4 changed files with 45 additions and 4 deletions

View File

@@ -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 {