aboutsummaryrefslogtreecommitdiff
path: root/src/tree.h
diff options
context:
space:
mode:
authorAdrian Kummerländer2013-09-26 20:41:37 +0200
committerAdrian Kummerländer2013-09-26 20:41:37 +0200
commita0f0c005a39ddaf693c7de84d6ab1c380a93dca2 (patch)
tree53b6c57a9226b2cc67bd577cca169ace199483a0 /src/tree.h
parentb765b57739463d0aa3b833a70e0ea87bca68e82e (diff)
downloadSimpleParser-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.h12
1 files changed, 7 insertions, 5 deletions
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<std::unique_ptr<Node>> node_collection_;
+ Node* root_node_;
+ std::string term_;
};
}