/* * File: MStatement.h * Author: rick * * Created on November 19, 2008, 1:14 AM */ #ifndef _MSTATEMENT_H #define _MSTATEMENT_H #include "MOperator.h" #include "MOperand.h" #include "Symbol.h" #include using namespace std; class MStatement { public: // Constructors/destructor /* No operators */ MStatement(MOperator op, const char *comment = NULL); /* One operator */ MStatement(MOperator op, MOperand *opnd1, const char *comment = NULL); /* Two operators */ MStatement(MOperator op, MOperand *opnd1, MOperand *opnd2, const char * comment = NULL); /* Tree operators */ MStatement(MOperator op, MOperand *opnd1, MOperand *opnd2, MOperand *opnd3, const char *comment = NULL); ~MStatement(); // Get/Set operator MOperator GetOperator() const; void SetOperator(MOperator op); // Get operand 1 MOperand *GetOperand1() const; void SetOperand1(MOperand *operand); // Get/Set operand 2 MOperand *GetOperand2() const; void SetOperand2(MOperand *operand); // Get/Set operand 3 MOperand *GetOperand3() const; void SetOperand3(MOperand *operand); // Dump void Dump(FILE *file, int indent); // Comment handler void SetComment(const char *value); const char *GetComment() const; string GetLabel() const; void SetLabel(string value); private: MOperator moperator; MOperand *operand1; MOperand *operand2; MOperand *operand3; const char *comment; string label; }; #endif /* _MSTATEMENT_H */