Mescal
|
Construction of a NFA from a regular expression. Thompson's et Glushkov's algorithms. More...
#include "error.h"
#include "nfa.h"
#include "nfa_intersec.h"
#include "nfa_minimization.h"
#include "regexp.h"
#include "type_boolarray.h"
#include <stdlib.h>
Go to the source code of this file.
Classes | |
struct | glushkov_info |
Type utilized to represent the information computed by Glushkov's algorithm from the input regular expression. More... | |
Functions | |
uint | reg_countletters (regexp *) |
Counts the number of letters in a regular expression. | |
glushkov_info * | reg_create_gk_emp (uint) |
Initialization of a glushkov_info for a sub-expression defining the empty language. | |
void | reg_gk_delete (glushkov_info *) |
Realease of a glushkov_info object. | |
glushkov_info * | gk_indexleaves (regexp *, uint, uint *, letter *) |
Full computation of the glushkov_info object from a regular expression. | |
nfa * | reg_glushkov (regexp *) |
Glushkov's algorithm. | |
nfa * | reg_thompson (regexp *) |
Thompson's algorithm. | |
Construction of a NFA from a regular expression. Thompson's et Glushkov's algorithms.
glushkov_info * gk_indexleaves | ( | regexp * | exp, |
uint | size, | ||
uint * | i, | ||
letter * | map ) |
Full computation of the glushkov_info object from a regular expression.
The computation is recursive. The total number of letters in the complete expression must be given as input.
exp | A sub-expression of the one considered by the Glushkov's algorithm. |
size | The total number of letters in the full regular expression. |
i | A pointer to a counter which stores the number of letters which have already been renamed. |
map | Array indexed by the letter named computed by the function. Maps each name to the original letter in the expression. |
uint reg_countletters | ( | regexp * | exp | ) |
Counts the number of letters in a regular expression.
exp | The regular expression. |
glushkov_info * reg_create_gk_emp | ( | uint | size | ) |
Initialization of a glushkov_info for a sub-expression defining the empty language.
size | Total number of letters in the complete expression. |
void reg_gk_delete | ( | glushkov_info * | info | ) |
Realease of a glushkov_info object.
info | The left glushkov_info object. |
Glushkov's algorithm.
Computes a NFA from a regular expression.
exp | A simple regular expression. |