-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdriver.hpp
41 lines (28 loc) · 806 Bytes
/
driver.hpp
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
34
35
36
37
38
39
40
41
#ifndef _DRIVER_HPP_
#define _DRIVER_HPP_
#include <vector>
#include "raft_scanner.hpp"
#include "raft_parser.tab.hh"
#include "NodeAbstract.hpp"
#include "DefaultVisitor.hpp"
class Data;
namespace Raft{
class Driver{
public:
Driver( Data &d );
virtual ~Driver();
void parse( const char *filename );
void parse( std::istringstream &iss );
void set_root( Node::NodeAbstract *node );
void RegisterVisitor( Visitor::DefaultVisitor *visitor );
void InvokeVisitors();
private:
void parse_error( int errorcode, int retval );
Raft::Parser *parser;
Raft::Scanner *scanner;
Raft::Data &data;
Node::NodeAbstract *root;
std::vector< Visitor::DefaultVisitor* > visitor_list;
};
} /* end namespace Raft */
#endif /* END _DRIVER_HPP_ */