Main Page
Related Pages
Data Structures
Files
File List
Globals
src
libgfsm
gfsmRegexCompiler.h
Go to the documentation of this file.
1
2
/*=============================================================================*\
3
* File: gfsmRegexCompiler.h
4
* Author: Bryan Jurish <moocow.bovine@gmail.com>
5
* Description: finite state machine library
6
*
7
* Copyright (c) 2005-2007 Bryan Jurish.
8
*
9
* This library is free software; you can redistribute it and/or
10
* modify it under the terms of the GNU Lesser General Public
11
* License as published by the Free Software Foundation; either
12
* version 3 of the License, or (at your option) any later version.
13
*
14
* This library is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
* Lesser General Public License for more details.
18
*
19
* You should have received a copy of the GNU Lesser General Public
20
* License along with this library; if not, write to the Free Software
21
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
*=============================================================================*/
23
40
#ifndef _GFSM_REGEX_COMPILER_H
41
#define _GFSM_REGEX_COMPILER_H
42
43
#include <
gfsmScanner.h
>
44
#include <
gfsmAlgebra.h
>
45
46
/*======================================================================
47
* Types
48
*/
49
51
typedef
struct
{
52
gfsmScanner
scanner
;
53
gfsmSRType
srtype
;
54
gfsmAutomaton
*
fsm
;
55
gfsmAlphabet
*
abet
;
56
GString *
gstr
;
57
}
gfsmRegexCompiler
;
58
59
/*======================================================================
60
* Regex Compiler: Constructors etc.
61
*/
63
64
66
gfsmRegexCompiler
*
gfsm_regex_compiler_new_full
(
const
gchar *name,
67
gfsmAlphabet
*abet,
68
gfsmSRType
srtype,
69
gboolean emit_warnings);
70
72
#define gfsm_regex_compiler_new() \
73
gfsm_regex_compiler_new_full("gfsmRegexCompiler", NULL, gfsmAutomatonDefaultSRType, TRUE);
74
79
void
gfsm_regex_compiler_free
(
gfsmRegexCompiler
*rec, gboolean free_alphabet, gboolean free_automaton);
80
82
void
gfsm_regex_compiler_reset
(
gfsmRegexCompiler
*rec, gboolean free_automaton);
83
85
86
/*======================================================================
87
* Regex Compiler: Methods
88
*/
90
95
gfsmAutomaton
*
gfsm_regex_compiler_parse
(
gfsmRegexCompiler
*rec);
96
98
99
/*======================================================================
100
* Regex Compiler: Alphabet Utilities
101
*/
103
104
106
gfsmLabelVal
gfsm_regex_compiler_char2label
(
gfsmRegexCompiler
*rec, gchar c);
107
109
gfsmLabelVal
gfsm_regex_compiler_gstring2label
(
gfsmRegexCompiler
*rec, GString *gs);
110
112
113
/*======================================================================
114
* Regex Compiler: Automaton Utilities
115
*/
117
118
119
//--------------------------------------------------------------
121
gfsmAutomaton
*
gfsm_regex_compiler_new_fsm
(
gfsmRegexCompiler
*rec);
122
124
gfsmAutomaton
*
gfsm_regex_compiler_epsilon_fsm
(
gfsmRegexCompiler
*rec);
125
127
gfsmAutomaton
*
gfsm_regex_compiler_label_fsm
(
gfsmRegexCompiler
*rec,
gfsmLabelVal
lab);
128
129
130
//--------------------------------------------------------------
132
gfsmAutomaton
*
gfsm_regex_compiler_append_lab
(
gfsmRegexCompiler
*rec,
133
gfsmAutomaton
*fsm,
134
gfsmLabelVal
lab);
135
137
gfsmAutomaton
*
gfsm_regex_compiler_prepend_lab
(
gfsmRegexCompiler
*rec,
138
gfsmLabelVal
lab,
139
gfsmAutomaton
*fsm);
140
142
gfsmAutomaton
*
gfsm_regex_compiler_concat
(
gfsmRegexCompiler
*rec,
143
gfsmAutomaton
*fsm1,
144
gfsmAutomaton
*fsm2);
145
146
//--------------------------------------------------------------
148
gfsmAutomaton
*
gfsm_regex_compiler_closure
(
gfsmRegexCompiler
*rec,
149
gfsmAutomaton
*fsm,
150
gboolean is_plus);
151
153
gfsmAutomaton
*
gfsm_regex_compiler_power
(
gfsmRegexCompiler
*rec,
154
gfsmAutomaton
*fsm,
155
guint32 n);
156
158
gfsmAutomaton
*
gfsm_regex_compiler_optional
(
gfsmRegexCompiler
*rec,
gfsmAutomaton
*fsm);
159
160
//--------------------------------------------------------------
162
gfsmAutomaton
*
gfsm_regex_compiler_project
(
gfsmRegexCompiler
*rec,
163
gfsmAutomaton
*fsm,
164
gfsmLabelSide
which);
165
166
//--------------------------------------------------------------
168
gfsmAutomaton
*
gfsm_regex_compiler_complement
(
gfsmRegexCompiler
*rec,
169
gfsmAutomaton
*fsm);
170
171
//--------------------------------------------------------------
173
gfsmAutomaton
*
gfsm_regex_compiler_union
(
gfsmRegexCompiler
*rec,
174
gfsmAutomaton
*fsm1,
175
gfsmAutomaton
*fsm2);
176
177
//--------------------------------------------------------------
179
gfsmAutomaton
*
gfsm_regex_compiler_intersect
(
gfsmRegexCompiler
*rec,
180
gfsmAutomaton
*fsm1,
181
gfsmAutomaton
*fsm2);
182
183
//--------------------------------------------------------------
185
gfsmAutomaton
*
gfsm_regex_compiler_product
(
gfsmRegexCompiler
*rec,
186
gfsmAutomaton
*fsm1,
187
gfsmAutomaton
*fsm2);
188
189
//--------------------------------------------------------------
191
gfsmAutomaton
*
gfsm_regex_compiler_compose
(
gfsmRegexCompiler
*rec,
192
gfsmAutomaton
*fsm1,
193
gfsmAutomaton
*fsm2);
194
195
//--------------------------------------------------------------
197
gfsmAutomaton
*
gfsm_regex_compiler_difference
(
gfsmRegexCompiler
*rec,
198
gfsmAutomaton
*fsm1,
199
gfsmAutomaton
*fsm2);
200
201
//--------------------------------------------------------------
203
gfsmAutomaton
*
gfsm_regex_compiler_weight
(
gfsmRegexCompiler
*rec,
204
gfsmAutomaton
*fsm1,
205
gfsmWeight
w);
206
207
//--------------------------------------------------------------
209
gfsmAutomaton
*
gfsm_regex_compiler_rmepsilon
(
gfsmRegexCompiler
*rec,
gfsmAutomaton
*fsm);
210
211
212
//--------------------------------------------------------------
214
gfsmAutomaton
*
gfsm_regex_compiler_determinize
(
gfsmRegexCompiler
*rec,
gfsmAutomaton
*fsm);
215
216
//--------------------------------------------------------------
218
gfsmAutomaton
*
gfsm_regex_compiler_connect
(
gfsmRegexCompiler
*rec,
gfsmAutomaton
*fsm);
219
221
222
223
#endif
/* _GFSM_REGEX_COMPILER_H */
Generated on Tue Oct 21 2014 09:44:47 for libgfsm by
1.8.1.2