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/parser.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/parser.h')
-rw-r--r-- | src/parser.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/parser.h b/src/parser.h index 677717a..a27d1c0 100644 --- a/src/parser.h +++ b/src/parser.h @@ -8,13 +8,12 @@ namespace SimpleParser { -double calculate(std::string); -std::string exportTree(std::string); +double calculate(std::string term) { + return Tree(term).solve(); +} -namespace { - int8_t getPriority(char); - std::vector<std::string> lexer(std::string); - Node* buildTree(Tree*, std::string); +std::string exportTree(std::string term) { + return Tree(term).print(); } } |