From 6d8610c0fbf7e75d57ee19c150f8222613d1eef7 Mon Sep 17 00:00:00 2001 From: Kristian Rumberg Date: Sun, 22 Jun 2008 17:49:15 +0200 Subject: [PATCH] cosmetic changes --- src/BinExpr.cpp | 10 +++------- src/Number.cpp | 1 - src/Number.hpp | 2 -- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/BinExpr.cpp b/src/BinExpr.cpp index 95bad6c..4aff719 100644 --- a/src/BinExpr.cpp +++ b/src/BinExpr.cpp @@ -18,30 +18,26 @@ #include BinExpr::BinExpr(Expr* a1, Expr* a2): m_a1(a1), m_a2(a2) {} - AddExpr::AddExpr(Expr* n1, Expr* n2) : BinExpr(n1, n2) {} +SubExpr::SubExpr(Expr* n1, Expr* n2) : BinExpr(n1, n2) {} +MulExpr::MulExpr(Expr* n1, Expr* n2) : BinExpr(n1, n2) {} +DivExpr::DivExpr(Expr* n1, Expr* n2) : BinExpr(n1, n2) {} Number AddExpr::eval() const { return left()->eval() + right()->eval(); } -SubExpr::SubExpr(Expr* n1, Expr* n2) : BinExpr(n1, n2) {} - Number SubExpr::eval() const { return left()->eval() - right()->eval(); } -MulExpr::MulExpr(Expr* n1, Expr* n2) : BinExpr(n1, n2) {} - Number MulExpr::eval() const { return left()->eval() * right()->eval(); } -DivExpr::DivExpr(Expr* n1, Expr* n2) : BinExpr(n1, n2) {} - Number DivExpr::eval() const { return left()->eval() / right()->eval(); diff --git a/src/Number.cpp b/src/Number.cpp index 70882e1..2c9aac8 100644 --- a/src/Number.cpp +++ b/src/Number.cpp @@ -33,7 +33,6 @@ Number::Number(double val) } #define GET_NUMBER_VAL(n) (((n).m_type == T_INTEGER)? (n).m_val.l : (n).m_val.d) - #define PERFORM_OPERATION(op) ( GET_NUMBER_VAL(*this) op GET_NUMBER_VAL(n) ) Number Number::operator+(const Number& n) const { diff --git a/src/Number.hpp b/src/Number.hpp index 5c51c83..bc37147 100644 --- a/src/Number.hpp +++ b/src/Number.hpp @@ -28,8 +28,6 @@ class Number : public Expr public: Number(long val); Number(double val); - double toDouble() const; - long toInteger() const; Number operator+(const Number& n) const; Number operator-(const Number& n) const; Number operator*(const Number& n) const; -- 2.11.4.GIT