From 9db4e054627eb30b4e5a7333405c423df5a8d490 Mon Sep 17 00:00:00 2001 From: Adrian Kummerländer Date: Tue, 4 Mar 2014 17:02:24 +0100 Subject: Did some refactoring to improve readability * now using range for-loops during Tree printing * inroduced popNode helper method which helps to simplify the Tree construction implementation --- src/nodes.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/nodes.h') diff --git a/src/nodes.h b/src/nodes.h index 170b88f..2581a2d 100644 --- a/src/nodes.h +++ b/src/nodes.h @@ -20,9 +20,9 @@ class Node { virtual ~Node() {}; virtual double solve() = 0; - virtual NodeType getType() = 0; + virtual NodeType type() = 0; virtual std::string print() = 0; - + Node* leftChild; Node* rightChild; }; @@ -32,10 +32,10 @@ class OperatorNode: public Node { explicit OperatorNode(TokenType); virtual double solve(); - virtual NodeType getType(); + virtual NodeType type(); virtual std::string print(); - TokenType getToken(); + TokenType token(); private: TokenType operator_; @@ -46,7 +46,7 @@ class OperandNode: public Node { explicit OperandNode(double); virtual double solve(); - virtual NodeType getType(); + virtual NodeType type(); virtual std::string print(); private: @@ -58,7 +58,7 @@ class ConstantNode: public Node { explicit ConstantNode(std::string, const ConstantMap*); virtual double solve(); - virtual NodeType getType(); + virtual NodeType type(); virtual std::string print(); private: -- cgit v1.2.3