Fork off code for part 11 of compiler series.

This commit is contained in:
2020-04-09 23:48:53 -07:00
parent 2e0318347c
commit 682e0d3e1c
39 changed files with 2873 additions and 0 deletions

21
11/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 "??";
}