diff options
author | Adrian Kummerländer | 2013-09-26 20:41:37 +0200 |
---|---|---|
committer | Adrian Kummerländer | 2013-09-26 20:41:37 +0200 |
commit | a0f0c005a39ddaf693c7de84d6ab1c380a93dca2 (patch) | |
tree | 53b6c57a9226b2cc67bd577cca169ace199483a0 /src/tree.h | |
parent | b765b57739463d0aa3b833a70e0ea87bca68e82e (diff) | |
download | SimpleParser-a0f0c005a39ddaf693c7de84d6ab1c380a93dca2.tar SimpleParser-a0f0c005a39ddaf693c7de84d6ab1c380a93dca2.tar.gz SimpleParser-a0f0c005a39ddaf693c7de84d6ab1c380a93dca2.tar.bz2 SimpleParser-a0f0c005a39ddaf693c7de84d6ab1c380a93dca2.tar.lz SimpleParser-a0f0c005a39ddaf693c7de84d6ab1c380a93dca2.tar.xz SimpleParser-a0f0c005a39ddaf693c7de84d6ab1c380a93dca2.tar.zst SimpleParser-a0f0c005a39ddaf693c7de84d6ab1c380a93dca2.zip |
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
Diffstat (limited to 'src/tree.h')
-rw-r--r-- | src/tree.h | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -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<std::unique_ptr<Node>> node_collection_; + Node* root_node_; + std::string term_; }; } |