aboutsummaryrefslogtreecommitdiff
path: root/include/cps/AST.h
diff options
context:
space:
mode:
authorov-4 <hausemasterstream@gmail.com>2026-01-29 10:41:27 +0000
committerov-4 <hausemasterstream@gmail.com>2026-01-29 10:41:27 +0000
commitf1fedc36ec54578be4983d2fc6abee999dbc51c2 (patch)
tree959fae06a583e96a219527b7032609f435f9108b /include/cps/AST.h
parentc2a3cecc1ab2d3f27dcea40a6f0f353b0306d66a (diff)
Added binary operations +-*/
Diffstat (limited to 'include/cps/AST.h')
-rw-r--r--include/cps/AST.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/cps/AST.h b/include/cps/AST.h
index 5b28e8a..4d72040 100644
--- a/include/cps/AST.h
+++ b/include/cps/AST.h
@@ -60,4 +60,16 @@ public:
ExprAST *getExpr() const { return Expr.get(); }
};
+class BinaryExprAST : public ExprAST {
+ char Op; // '+', '-', '*', '/'
+ std::unique_ptr<ExprAST> LHS, RHS;
+public:
+ BinaryExprAST(char Op, std::unique_ptr<ExprAST> LHS, std::unique_ptr<ExprAST> RHS)
+ : Op(Op), LHS(std::move(LHS)), RHS(std::move(RHS)) {}
+
+ char getOp() const { return Op; }
+ ExprAST *getLHS() const { return LHS.get(); }
+ ExprAST *getRHS() const { return RHS.get(); }
+};
+
} // namespace cps