aboutsummaryrefslogtreecommitdiff
path: root/src/tree.h
blob: 68a31c18cc1394a2b4d99020046b58cb72b5a0eb (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
#ifndef PARSER_SRC_NODE_H_
#define PARSER_SRC_NODE_H_

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

#include "nodes.h"

namespace SimpleParser {

class Tree {
	public:
		Tree(std::string);

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

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

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

}

#endif  // PARSER_SRC_NODE_H_