-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathregexexpression.h
93 lines (72 loc) · 3.03 KB
/
regexexpression.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
//
// regexexpression.h
//
//
// Created by Cameron Monks on 06/09/2021
// Copyright © 2021 cameronmonks. All rights reserved.
//
#ifndef regexexpression_h
#define regexexpression_h
#include "vector.h"
struct regexcharacter {
char minc;
char maxc;
char currentc;
};
struct regexcharactergroup {
struct vector characters;
};
struct regexoptions {
struct vector groups;
size_t index;
};
struct regexrange {
struct regexoptions baseoption;
struct vector options;
unsigned minlen;
unsigned maxlen;
};
struct regexexpression {
struct vector ranges;
};
void regexexpression_init(struct regexexpression * self);
void regexrange_init(struct regexrange * self,
struct regexrange baseoption, unsigned minlen, unsigned maxlen);
void regexoptions_init(struct regexoptions * self);
void regexcharactergroup_init(struct regexcharactergroup * self);
void regexexpression_deinit(struct regexexpression * self);
void regexrange_deinit(struct regexrange * self);
void regexoptions_deinit(struct regexoptions * self);
void regexcharactergroup_deinit(struct regexcharactergroup * self);
void regexexpression_copy(struct regexexpression * dst, const struct regexexpression * src);
void regexrange_copy(struct regexrange * dst, const struct regexrange * src);
void regexoptions_copy(struct regexoptions * dst, const struct regexoptions * src);
void regexcharactergroup_copy(struct regexcharactergroup * dst,
const struct regexcharactergroup * src);
void regexcharacter_copy(struct regexcharacter * dst,
const struct regexcharacter * src);
void regexexpression_push(struct regexexpression * self, struct regexrange item);
void regexrange_push(struct regexrange * self, struct regexoptions item);
void regexoptions_push(struct regexoptions * self, struct regexcharactergroup item);
void regexcharactergroup_push(struct regexcharactergroup * self, struct regexcharacter item);
void regexexpression_debug(struct regexexpression * self);
void regexrange_debug(struct regexrange * self);
void regexoptions_debug(struct regexoptions * self);
void regexcharactergroup_debug(struct regexcharactergroup * self);
void regexcharacter_debug(struct regexcharacter * self);
void regexexpression_print(struct regexexpression * self);
void regexrange_print(struct regexrange * self);
void regexoptions_print(struct regexoptions * self);
void regexcharactergroup_print(struct regexcharactergroup * self);
void regexcharacter_print(struct regexcharacter * self);
void regexexpression_reset(struct regexexpression * self);
void regexrange_reset(struct regexrange * self);
void regexoptions_reset(struct regexoptions * self);
void regexcharactergroup_reset(struct regexcharactergroup * self);
void regexcharacter_reset(struct regexcharacter * self);
int regexexpression_inc(struct regexexpression * self);
int regexrange_inc(struct regexrange * self);
int regexoptions_inc(struct regexoptions * self);
int regexcharactergroup_inc(struct regexcharactergroup * self);
int regexcharacter_inc(struct regexcharacter * self);
#endif /* regexexpression_h */