-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathArithmeticTac.hpp
36 lines (30 loc) · 1 KB
/
ArithmeticTac.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef ARITHMETIC_TAC_HPP
#define ARITHMETIC_TAC_HPP
#include "Tac.hpp"
class AddTac : public Tac {
public:
AddTac(const std::string &result_, const Operand &y_, const Operand &z_)
: Tac(result_, y_, "+", z_){};
void generateBytecode(BytecodeMethodBlock &block) override;
};
class SubtractTac : public Tac {
public:
SubtractTac(const std::string &result_, const Operand &y_,
const Operand &z_)
: Tac(result_, y_, "-", z_){};
void generateBytecode(BytecodeMethodBlock &block) override;
};
class MultiplyTac : public Tac {
public:
MultiplyTac(const std::string &result_, const Operand &y_,
const Operand &z_)
: Tac(result_, y_, "*", z_){};
void generateBytecode(BytecodeMethodBlock &block) override;
};
class DivideTac : public Tac {
public:
DivideTac(const std::string &result_, const Operand &y_, const Operand &z_)
: Tac(result_, y_, "/", z_){};
void generateBytecode(BytecodeMethodBlock &block) override;
};
#endif