-
Notifications
You must be signed in to change notification settings - Fork 2
/
lemon_base.h
36 lines (27 loc) · 894 Bytes
/
lemon_base.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
#ifndef __lemon_base_h__
#define __lemon_base_h__
#include <cstdio>
template<class TokenType>
class lemon_base {
public:
typedef TokenType token_type;
virtual ~lemon_base() = default;
//virtual typename std::enable_if<std::is_move_constructible<TokenType>::value, void>::type
virtual void parse(int yymajor, TokenType &&yyminor) = 0;
virtual void trace(FILE *, const char *) {}
virtual bool will_accept() const = 0;
virtual int fallback(int iToken) const = 0;
virtual void reset() {}
protected:
virtual void parse_accept() {}
virtual void parse_failure() {}
virtual void stack_overflow() {}
virtual void syntax_error(int yymajor, TokenType &yyminor) {}
lemon_base() {}
private:
lemon_base(const lemon_base &) = delete;
lemon_base(lemon_base &&) = delete;
lemon_base &operator=(const lemon_base &) = delete;
lemon_base &operator=(lemon_base &&) = delete;
};
#endif