#ifndef BINOP_H #define BINOP_H #include #include "types.h" namespace types { enum class BinOp { Assignment, Add, Sub, LessThan, GreaterThan, }; int operator_precedence(BinOp& op); std::string format_operator(BinOp& op); struct BinopDefinition { std::shared_ptr lhs; BinOp op; std::shared_ptr rhs; llvm::Value* (*codegen)(codegen::Builder& builder, llvm::Value* lhs, llvm::Value* rhs); std::shared_ptr(*result)(BinopDefinition& def, std::shared_ptr lhs, std::shared_ptr rhs); }; std::vector create_binops(); std::optional find_binop( std::vector& binops, std::shared_ptr lhs, BinOp op, std::shared_ptr rhs); } #endif