39 lines
741 B
C++
39 lines
741 B
C++
#ifndef BLANG_BINARYOPERATOREXPR_H
|
|
#define BLANG_BINARYOPERATOREXPR_H
|
|
|
|
#include "Expr.hpp"
|
|
|
|
class BinaryOperatorExpr: public Expr
|
|
{
|
|
public:
|
|
enum Opcode {
|
|
#define BINARY_OPERATION(Name, Spelling) BO_##Name,
|
|
#include "OperationKinds.def"
|
|
};
|
|
|
|
BinaryOperatorExpr(Expr *lhs, Expr *rhs, Opcode opc);
|
|
|
|
Expr *getLHS () const;
|
|
void setLHS (Expr *E);
|
|
|
|
Expr *getRHS () const;
|
|
void setRHS (Expr *E);
|
|
|
|
Opcode getOpcode() const;
|
|
void setOpcode (Opcode O);
|
|
std::string getOpcodeStr() const;
|
|
|
|
static std::string getOpcodeStr(Opcode opc) const;
|
|
|
|
private:
|
|
Opcode _opc;
|
|
enum ExprIdentifier
|
|
{
|
|
LHS, RHS
|
|
};
|
|
std::map<ExprIdentifier, Expr*> _subExprs;
|
|
};
|
|
|
|
|
|
#endif //BLANG_BINARYOPERATOREXPR_H
|