blog-static/code/compiler/11/binop.cpp
Danila Fedorin d7846e0b32
Some checks failed
continuous-integration/drone/push Build is failing
Fork off code for part 11 of compiler series.
2020-04-09 23:48:53 -07:00

22 lines
445 B
C++

#include "binop.hpp"
std::string op_name(binop op) {
switch(op) {
case PLUS: return "+";
case MINUS: return "-";
case TIMES: return "*";
case DIVIDE: return "/";
}
return "??";
}
std::string op_action(binop op) {
switch(op) {
case PLUS: return "plus";
case MINUS: return "minus";
case TIMES: return "times";
case DIVIDE: return "divide";
}
return "??";
}