aboutsummaryrefslogtreecommitdiff
path: root/include/cps/AST.h
diff options
context:
space:
mode:
author_ov4 <hausemasterstream@gmail.com>2026-02-02 09:02:39 +0000
committer_ov4 <hausemasterstream@gmail.com>2026-02-02 09:02:39 +0000
commit09e128ce98de793d22669255897e4b4816d0e53e (patch)
tree7afcbeb1e245641b60cfa68dcf0915e019975d24 /include/cps/AST.h
parent419420770c4545ea4010047ef2153004d4700eed (diff)
Added logical operators
Diffstat (limited to 'include/cps/AST.h')
-rw-r--r--include/cps/AST.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/cps/AST.h b/include/cps/AST.h
index 588f5eb..de57024 100644
--- a/include/cps/AST.h
+++ b/include/cps/AST.h
@@ -51,6 +51,16 @@ public:
int getLine() const { return Line; }
};
+class UnaryExprAST : public ExprAST {
+ int Op;
+ std::unique_ptr<ExprAST> Operand;
+public:
+ UnaryExprAST(int Op, std::unique_ptr<ExprAST> Operand)
+ : Op(Op), Operand(std::move(Operand)) {}
+ int getOp() const { return Op; }
+ ExprAST *getOperand() const { return Operand.get(); }
+};
+
class BinaryExprAST : public ExprAST {
int Op;
std::unique_ptr<ExprAST> LHS, RHS;