-
Notifications
You must be signed in to change notification settings - Fork 3
/
nfa_state.h
45 lines (33 loc) · 849 Bytes
/
nfa_state.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
#ifndef LEXGEN_NFASTATE_H
#define LEXGEN_NFASTATE_H
#include <iostream>
#include <vector>
#include <unordered_map>
#include "regular_expression.h"
#include "nfa_state.h"
using namespace std;
class NFAState {
public:
virtual ~NFAState()=default;
explicit NFAState();
void add_neighbour(string input, NFAState* neighbour);
// Getters for member variables of instance.
int getId() const;
const vector < pair<string , NFAState *>> &getNeighbours() const;
private:
int id;
vector < pair<string , NFAState *> > neighbours;
};
class NFANormalState:public NFAState{
};
class NFAAcceptanceState:public NFAState{
public:
string get_token();
void set_priority(int priority);
int get_priority();
void set_token(string token);
private:
int priority;
string token;
};
#endif //LEXGEN_NFASTATE_H