Data Structures
gfsmRegexCompiler.h File Reference

Regular expression compiler. More...

#include <gfsmScanner.h>
#include <gfsmAlgebra.h>
Include dependency graph for gfsmRegexCompiler.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  gfsmRegexCompiler
 Type for a regular expression compiler. More...

Functions

gfsmAutomatongfsm_regex_compiler_parse (gfsmRegexCompiler *rec)
Regex Compiler: Alphabet Utilities
gfsmLabelVal gfsm_regex_compiler_char2label (gfsmRegexCompiler *rec, gchar c)
gfsmLabelVal gfsm_regex_compiler_gstring2label (gfsmRegexCompiler *rec, GString *gs)
Regex Compiler: Automaton Utilities
gfsmAutomatongfsm_regex_compiler_new_fsm (gfsmRegexCompiler *rec)
gfsmAutomatongfsm_regex_compiler_epsilon_fsm (gfsmRegexCompiler *rec)
gfsmAutomatongfsm_regex_compiler_label_fsm (gfsmRegexCompiler *rec, gfsmLabelVal lab)
gfsmAutomatongfsm_regex_compiler_append_lab (gfsmRegexCompiler *rec, gfsmAutomaton *fsm, gfsmLabelVal lab)
gfsmAutomatongfsm_regex_compiler_prepend_lab (gfsmRegexCompiler *rec, gfsmLabelVal lab, gfsmAutomaton *fsm)
gfsmAutomatongfsm_regex_compiler_concat (gfsmRegexCompiler *rec, gfsmAutomaton *fsm1, gfsmAutomaton *fsm2)
gfsmAutomatongfsm_regex_compiler_closure (gfsmRegexCompiler *rec, gfsmAutomaton *fsm, gboolean is_plus)
gfsmAutomatongfsm_regex_compiler_power (gfsmRegexCompiler *rec, gfsmAutomaton *fsm, guint32 n)
gfsmAutomatongfsm_regex_compiler_optional (gfsmRegexCompiler *rec, gfsmAutomaton *fsm)
gfsmAutomatongfsm_regex_compiler_project (gfsmRegexCompiler *rec, gfsmAutomaton *fsm, gfsmLabelSide which)
gfsmAutomatongfsm_regex_compiler_complement (gfsmRegexCompiler *rec, gfsmAutomaton *fsm)
gfsmAutomatongfsm_regex_compiler_union (gfsmRegexCompiler *rec, gfsmAutomaton *fsm1, gfsmAutomaton *fsm2)
gfsmAutomatongfsm_regex_compiler_intersect (gfsmRegexCompiler *rec, gfsmAutomaton *fsm1, gfsmAutomaton *fsm2)
gfsmAutomatongfsm_regex_compiler_product (gfsmRegexCompiler *rec, gfsmAutomaton *fsm1, gfsmAutomaton *fsm2)
gfsmAutomatongfsm_regex_compiler_compose (gfsmRegexCompiler *rec, gfsmAutomaton *fsm1, gfsmAutomaton *fsm2)
gfsmAutomatongfsm_regex_compiler_difference (gfsmRegexCompiler *rec, gfsmAutomaton *fsm1, gfsmAutomaton *fsm2)
gfsmAutomatongfsm_regex_compiler_weight (gfsmRegexCompiler *rec, gfsmAutomaton *fsm1, gfsmWeight w)
gfsmAutomatongfsm_regex_compiler_rmepsilon (gfsmRegexCompiler *rec, gfsmAutomaton *fsm)
gfsmAutomatongfsm_regex_compiler_determinize (gfsmRegexCompiler *rec, gfsmAutomaton *fsm)
gfsmAutomatongfsm_regex_compiler_connect (gfsmRegexCompiler *rec, gfsmAutomaton *fsm)

Regex Compiler: Constructors etc.

#define gfsm_regex_compiler_new()   gfsm_regex_compiler_new_full("gfsmRegexCompiler", NULL, gfsmAutomatonDefaultSRType, TRUE);
gfsmRegexCompilergfsm_regex_compiler_new_full (const gchar *name, gfsmAlphabet *abet, gfsmSRType srtype, gboolean emit_warnings)
void gfsm_regex_compiler_free (gfsmRegexCompiler *rec, gboolean free_alphabet, gboolean free_automaton)
void gfsm_regex_compiler_reset (gfsmRegexCompiler *rec, gboolean free_automaton)

Detailed Description

Macro Definition Documentation

#define gfsm_regex_compiler_new ( )    gfsm_regex_compiler_new_full("gfsmRegexCompiler", NULL, gfsmAutomatonDefaultSRType, TRUE);

Create and return a new gfsmRegexCompiler, no alphabet

Function Documentation

gfsmRegexCompiler* gfsm_regex_compiler_new_full ( const gchar *  name,
gfsmAlphabet abet,
gfsmSRType  srtype,
gboolean  emit_warnings 
)

Create and return a new gfsmRegexCompiler

void gfsm_regex_compiler_free ( gfsmRegexCompiler rec,
gboolean  free_alphabet,
gboolean  free_automaton 
)

Destroy a gfsmRegexCompiler.

Parameters
free_automatonwhether to free the stored alphabet, if present
free_automatonwhether to free the parsed automaton, if present
void gfsm_regex_compiler_reset ( gfsmRegexCompiler rec,
gboolean  free_automaton 
)

Reset regex compiler; possibly freeing associated automaton

gfsmAutomaton* gfsm_regex_compiler_parse ( gfsmRegexCompiler rec)

Parse an automaton from the currently selected input source.

Returns
parsed automaton, or NULL on error
gfsmLabelVal gfsm_regex_compiler_char2label ( gfsmRegexCompiler rec,
gchar  c 
)

Get a label value for a single character

gfsmLabelVal gfsm_regex_compiler_gstring2label ( gfsmRegexCompiler rec,
GString *  gs 
)

Get a label value for a GString* (implicitly frees gs)

gfsmAutomaton* gfsm_regex_compiler_new_fsm ( gfsmRegexCompiler rec)

New full-fleded automaton

gfsmAutomaton* gfsm_regex_compiler_epsilon_fsm ( gfsmRegexCompiler rec)

New Epsilon recognizer

gfsmAutomaton* gfsm_regex_compiler_label_fsm ( gfsmRegexCompiler rec,
gfsmLabelVal  lab 
)

New single-character recognizer

gfsmAutomaton* gfsm_regex_compiler_append_lab ( gfsmRegexCompiler rec,
gfsmAutomaton fsm,
gfsmLabelVal  lab 
)

Single-label concatenation: (low-level): append

gfsmAutomaton* gfsm_regex_compiler_prepend_lab ( gfsmRegexCompiler rec,
gfsmLabelVal  lab,
gfsmAutomaton fsm 
)

Single-label concatenation (low-level): prepend

gfsmAutomaton* gfsm_regex_compiler_concat ( gfsmRegexCompiler rec,
gfsmAutomaton fsm1,
gfsmAutomaton fsm2 
)

General concatenation

gfsmAutomaton* gfsm_regex_compiler_closure ( gfsmRegexCompiler rec,
gfsmAutomaton fsm,
gboolean  is_plus 
)

Closure

gfsmAutomaton* gfsm_regex_compiler_power ( gfsmRegexCompiler rec,
gfsmAutomaton fsm,
guint32  n 
)

Power (n-ary closure)

gfsmAutomaton* gfsm_regex_compiler_optional ( gfsmRegexCompiler rec,
gfsmAutomaton fsm 
)

Optionality

gfsmAutomaton* gfsm_regex_compiler_project ( gfsmRegexCompiler rec,
gfsmAutomaton fsm,
gfsmLabelSide  which 
)

Projection

gfsmAutomaton* gfsm_regex_compiler_complement ( gfsmRegexCompiler rec,
gfsmAutomaton fsm 
)

Complement

gfsmAutomaton* gfsm_regex_compiler_union ( gfsmRegexCompiler rec,
gfsmAutomaton fsm1,
gfsmAutomaton fsm2 
)

Union

gfsmAutomaton* gfsm_regex_compiler_intersect ( gfsmRegexCompiler rec,
gfsmAutomaton fsm1,
gfsmAutomaton fsm2 
)

Intersection

gfsmAutomaton* gfsm_regex_compiler_product ( gfsmRegexCompiler rec,
gfsmAutomaton fsm1,
gfsmAutomaton fsm2 
)

Product

gfsmAutomaton* gfsm_regex_compiler_compose ( gfsmRegexCompiler rec,
gfsmAutomaton fsm1,
gfsmAutomaton fsm2 
)

Composition

gfsmAutomaton* gfsm_regex_compiler_difference ( gfsmRegexCompiler rec,
gfsmAutomaton fsm1,
gfsmAutomaton fsm2 
)

Difference

gfsmAutomaton* gfsm_regex_compiler_weight ( gfsmRegexCompiler rec,
gfsmAutomaton fsm1,
gfsmWeight  w 
)

Weight (final)

gfsmAutomaton* gfsm_regex_compiler_rmepsilon ( gfsmRegexCompiler rec,
gfsmAutomaton fsm 
)

Remove epsilons

gfsmAutomaton* gfsm_regex_compiler_determinize ( gfsmRegexCompiler rec,
gfsmAutomaton fsm 
)

Determinize

gfsmAutomaton* gfsm_regex_compiler_connect ( gfsmRegexCompiler rec,
gfsmAutomaton fsm 
)

Connect