#include "MOperator.h" #include "MStatement.h" #include using namespace std; MStatement::MStatement(MOperator op, const char *comment) { MStatement::SetOperator(op); MStatement::SetOperand1(NULL); MStatement::SetOperand2(NULL); MStatement::SetOperand3(NULL); MStatement::SetComment(comment); } MStatement::MStatement(MOperator op, MOperand *opnd1, const char *comment) { MStatement::SetOperator(op); MStatement::SetOperand1(opnd1); MStatement::SetOperand2(NULL); MStatement::SetOperand3(NULL); MStatement::SetComment(comment); } MStatement::MStatement(MOperator op, MOperand *opnd1, MOperand *opnd2, const char *comment) { MStatement::SetOperator(op); MStatement::SetOperand1(opnd1); MStatement::SetOperand2(opnd2); MStatement::SetOperand3(NULL); MStatement::SetComment(comment); } MStatement::MStatement(MOperator op, MOperand *opnd1, MOperand *opnd2, MOperand *opnd3, const char *comment) { MStatement::SetOperator(op); MStatement::SetOperand1(opnd1); MStatement::SetOperand2(opnd2); MStatement::SetOperand3(opnd3); MStatement::SetComment(comment); } MStatement::~MStatement() { delete comment; } MOperator MStatement::GetOperator() const { return moperator; } void MStatement::SetOperator(MOperator op) { moperator = op; } MOperand *MStatement::GetOperand1() const { return operand1; } void MStatement::SetOperand1(MOperand *operand) { operand1 = operand; } MOperand *MStatement::GetOperand2() const { return operand2; } void MStatement::SetOperand2(MOperand *operand) { operand2 = operand; } MOperand *MStatement::GetOperand3() const { return operand3; } void MStatement::SetOperand3(MOperand *operand) { operand3 = operand; } void MStatement::Dump(FILE *file, int indent) { //XXX: Dump operand, operators # Comment } const char *MStatement::GetComment() const { return (comment); } void MStatement::SetComment(const char *value) { comment = value; } string MStatement::GetLabel() const { return label; } void MStatement::SetLabel(string value) { label = value; }