Make progress on compiler posts

This commit is contained in:
2019-10-26 20:30:29 -07:00
parent 6dd52ac182
commit dbc09f7ff0
26 changed files with 1403 additions and 0 deletions

21
07/binop.cpp Normal file
View File

@@ -0,0 +1,21 @@
#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 "??";
}