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;
56  GString *gstr;
58 
59 /*======================================================================
60  * Regex Compiler: Constructors etc.
61  */
63 
64 
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 
96 
98 
99 /*======================================================================
100  * Regex Compiler: Alphabet Utilities
101  */
103 
104 
107 
110 
112 
113 /*======================================================================
114  * Regex Compiler: Automaton Utilities
115  */
117 
118 
119 //--------------------------------------------------------------
122 
125 
128 
129 
130 //--------------------------------------------------------------
133  gfsmAutomaton *fsm,
134  gfsmLabelVal lab);
135 
138  gfsmLabelVal lab,
139  gfsmAutomaton *fsm);
140 
143  gfsmAutomaton *fsm1,
144  gfsmAutomaton *fsm2);
145 
146 //--------------------------------------------------------------
149  gfsmAutomaton *fsm,
150  gboolean is_plus);
151 
154  gfsmAutomaton *fsm,
155  guint32 n);
156 
159 
160 //--------------------------------------------------------------
163  gfsmAutomaton *fsm,
164  gfsmLabelSide which);
165 
166 //--------------------------------------------------------------
169  gfsmAutomaton *fsm);
170 
171 //--------------------------------------------------------------
174  gfsmAutomaton *fsm1,
175  gfsmAutomaton *fsm2);
176 
177 //--------------------------------------------------------------
180  gfsmAutomaton *fsm1,
181  gfsmAutomaton *fsm2);
182 
183 //--------------------------------------------------------------
186  gfsmAutomaton *fsm1,
187  gfsmAutomaton *fsm2);
188 
189 //--------------------------------------------------------------
192  gfsmAutomaton *fsm1,
193  gfsmAutomaton *fsm2);
194 
195 //--------------------------------------------------------------
198  gfsmAutomaton *fsm1,
199  gfsmAutomaton *fsm2);
200 
201 //--------------------------------------------------------------
204  gfsmAutomaton *fsm1,
205  gfsmWeight w);
206 
207 //--------------------------------------------------------------
210 
211 
212 //--------------------------------------------------------------
215 
216 //--------------------------------------------------------------
219 
221 
222 
223 #endif /* _GFSM_REGEX_COMPILER_H */