forked from bkase/CUDA-grep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
regex.h
32 lines (24 loc) · 818 Bytes
/
regex.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
#ifndef REGEX_H
#define REGEX_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "nfautil.h"
typedef struct {
int i;
int size;
char * re;
} SimpleReBuilder;
/* Constructor */
void simpleReBuilder(SimpleReBuilder ** builder, int len);
/* Destructor */
void _simpleReBuilder(SimpleReBuilder * builder);
void regex_error(int i);
char * stringify(char * nonull, int j);
void handle_escape(SimpleReBuilder * builder, char ** complexRe, int *len, int * bi, int * ci);
void putRange(SimpleReBuilder * builder, char start, char end, int * bi);
void handle_range(SimpleReBuilder * builder, char * complexRe, int len, int * bi, int * ci);
SimpleReBuilder * simplifyRe(char ** complexRe, SimpleReBuilder * builder);
void freeNFAStates(State *s);
char * stringifyRegex(const char * oldRegex);
#endif