From 404826e78a56e15e20d3938aed80945295921745 Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Sat, 22 Jun 2024 16:45:04 -0600 Subject: Add parser --- src/substraction.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/substraction.cpp (limited to 'src/substraction.cpp') diff --git a/src/substraction.cpp b/src/substraction.cpp new file mode 100644 index 0000000..ba995b5 --- /dev/null +++ b/src/substraction.cpp @@ -0,0 +1,10 @@ +#include "include/substraction.hpp" +#include "include/syntax_tree.hpp" + + +Substraction::Substraction(SyntaxTree *left, SyntaxTree *right) + : SyntaxTree{left, right} {} + +float Substraction::eval() const { + return left->eval() - right->eval(); +} -- cgit v1.2.3