From a0f0c005a39ddaf693c7de84d6ab1c380a93dca2 Mon Sep 17 00:00:00 2001 From: Adrian Kummerländer Date: Thu, 26 Sep 2013 20:41:37 +0200 Subject: Code restructuring of tree and parsing logic * Enabled tree to generate itself ** Main work is now done during tree construction * Moved lexer and getPriority utility functions into separate compilation unit --- src/tree.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/tree.h') diff --git a/src/tree.h b/src/tree.h index da611c7..5beec87 100644 --- a/src/tree.h +++ b/src/tree.h @@ -11,17 +11,19 @@ namespace SimpleParser { class Tree { public: - void setRoot(Node*); + Tree(std::string); + double solve(); + std::string print(); + private: Node* addOperand(Node**, double); Node* addOperator(Node**, char); + Node* buildTree(std::string); - std::string print(std::string); - - private: - Node* root_node_; std::vector> node_collection_; + Node* root_node_; + std::string term_; }; } -- cgit v1.2.3