-
Notifications
You must be signed in to change notification settings - Fork 5
/
mpw_parser.h
59 lines (40 loc) · 1.03 KB
/
mpw_parser.h
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef __mpw_parser__
#define __mpw_parser__
#include <string>
#include <memory>
#include "environment.h"
#include "fdset.h"
#include "phase1.h"
#include "phase2.h"
class mpw_parser {
public:
mpw_parser(Environment &e, fdmask fds = fdmask(), bool interactive = false);
mpw_parser(Environment &e, bool interactive) : mpw_parser(e, fdmask(), interactive)
{}
~mpw_parser();
void parse(const void *begin, const void *end);
void parse(const std::string &s) {
parse(s.data(), s.data() + s.size());
}
void parse(const void *begin, size_t length) {
parse(begin, (const char *)begin + length);
}
void reset();
void abort();
void finish();
bool continuation() const;
private:
mpw_parser& operator=(const mpw_parser &) = delete;
mpw_parser& operator=(mpw_parser &&) = delete;
mpw_parser(const mpw_parser &) = delete;
mpw_parser(mpw_parser &&) = delete;
void execute();
Environment &_env;
fdmask _fds;
bool _interactive = false;
bool _abort = false;
phase1 _p1;
phase2 _p2;
std::unique_ptr<class phase3> _p3;
};
#endif