-
Notifications
You must be signed in to change notification settings - Fork 7
/
fa.h
37 lines (30 loc) · 754 Bytes
/
fa.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
#ifndef CLEX_FA_H
#define CLEX_FA_H
#include <stdbool.h>
#include <stdlib.h>
typedef struct clexNode clexNode;
typedef struct clexTransition {
char fromValue;
char toValue;
clexNode *to;
} clexTransition;
typedef struct clexNode {
bool isStart;
bool isFinish;
clexTransition **transitions;
} clexNode;
typedef struct clexReLexerState {
const char *lexerContent;
size_t lexerPosition;
clexNode *lastBeforeParanEntry;
clexNode *beforeParanEntry;
clexNode *paranEntry;
bool inPipe;
bool pipeSeen;
bool inBackslash;
char **getFinishNodeSeen;
} clexReLexerState;
clexNode *clexNfaFromRe(const char *re, clexReLexerState *state);
bool clexNfaTest(clexNode *nfa, const char *target);
void clexNfaDraw(clexNode *nfa);
#endif