aboutsummaryrefslogtreecommitdiff
path: root/src/tree.h
blob: 9dfc4a3ba4964818d780ad9312cb9f957daf4fcc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef PARSER_SRC_NODE_H_
#define PARSER_SRC_NODE_H_

#include <memory>
#include <string>
#include <vector>

#include "nodes.h"

namespace SimpleParser {

class Tree {
	public:
		explicit Tree(std::string);
		Tree(std::string, const ConstantMap*);

		double solve();
		std::string print();

	private:
		template <class NType, typename... Args>
		Node* addNode(Node**, Args&&... args);
		Node* buildTree(std::string);

		std::string term_;
		Node* root_node_;
		std::vector<std::unique_ptr<Node>> node_collection_;
		const ConstantMap* constants_;
};

}

#endif  // PARSER_SRC_NODE_H_