/* * File: AssemblerCode.h * Author: rick * * Created on November 19, 2008, 1:20 AM */ #ifndef _ASSEMBLERCODE_H #define _ASSEMBLERCODE_H #include #include #include "MStatement.h" using namespace std; // This class stores a linear list of assember statements and provides // operations to modify that list. class AssemblerCode { public: // Constructor/destructor AssemblerCode(); ~AssemblerCode(); // Returns the number of statements unsigned int GetStatementCount() const; // Gets the i-th statement MStatement *GetStatement(unsigned int i); // Appends a statement void AppendStatement(MStatement *stmt); // Inserts a statement before the i-th statement void InsertStatement(MStatement *stmt, unsigned int i); // Removes the i-th statement void RemoveStatement(unsigned int i); // Dump void Dump(FILE *file); private: vector statements; string MOperandToString(MOperand *operand); const char *MRegisterTypeToString(MRegisterType op); }; #endif /* _ASSEMBLERCODE_H */