regexp.h File Reference


Detailed Description

Regular Expression functions.

Author:
Antoine Fraboulet
Date:
2005

Definition in file regexp.h.

#include <stdio.h>

Go to the source code of this file.

Data Structures

struct  node
struct  search_RegE_list_t
 Structure used for Dic_search_RegE
this structure is used to explicit letters list that will be matched against special tokens in the regular expression search. More...
struct  regexp_error_report_t

Defines

#define NODE_TOP   0
#define NODE_VAR   1
#define NODE_OR   2
#define NODE_AND   3
#define NODE_STAR   4
#define NODE_PLUS   5
#define REGEXP_MAX   32
 maximum number of accepted terminals in regular expressions
#define RE_EPSILON   (DIC_LETTERS + 0)
 special terminals that should not appear in the dictionary
#define RE_FINAL_TOK   (DIC_LETTERS + 1)
#define RE_ALL_MATCH   (DIC_LETTERS + 2)
#define RE_VOWL_MATCH   (DIC_LETTERS + 3)
#define RE_CONS_MATCH   (DIC_LETTERS + 4)
#define RE_USR1_MATCH   (DIC_LETTERS + 5)
#define RE_USR2_MATCH   (DIC_LETTERS + 6)
#define DIC_SEARCH_REGE_LIST   (REGEXP_MAX)
 number of lists for regexp letter match
0 : all tiles
1 : vowels
2 : consonants
3 : user defined 1
4 : user defined 2
x : lists used during parsing

#define RE_LIST_ALL_MATCH   0
#define RE_LIST_VOYL_MATCH   1
#define RE_LIST_CONS_MATCH   2
#define RE_LIST_USER_BEGIN   3
#define RE_LIST_USER_END   4
#define MAX_REGEXP_ERROR_LENGTH   500

Typedefs

typedef node NODE

Functions

NODEregexp_createNODE (int type, char v, NODE *fg, NODE *fd)
 Create a node for the syntactic tree used for parsing regular expressions
The fonction is called by bison grammar rules.
void regexp_delete_tree (NODE *root)
 delete regexp syntactic tree
void regexp_parcours (NODE *r, int *p, int *n, int ptl[])
 Computes positions, first positions (PP), last position (DP) and translation table 'position to letter' (ptl).
void regexp_possuivante (NODE *r, int PS[])
 Computes 'next position' table used for building the automaton.
void regexp_print_letter (FILE *f, char l)
void regexp_print_letter2 (FILE *f, char l)
void regexp_print_PS (int PS[])
void regexp_print_ptl (int ptl[])
void regexp_print_tree (NODE *n, char *name, int detail)


Define Documentation

#define DIC_SEARCH_REGE_LIST   (REGEXP_MAX)
 

number of lists for regexp letter match
0 : all tiles
1 : vowels
2 : consonants
3 : user defined 1
4 : user defined 2
x : lists used during parsing

Definition at line 78 of file regexp.h.

Referenced by PRegExp::build_letter_lists(), and s_automaton_successor().

#define MAX_REGEXP_ERROR_LENGTH   500
 

Definition at line 134 of file regexp.h.

#define NODE_AND   3
 

Definition at line 37 of file regexp.h.

Referenced by regexp_parcours(), and regexp_possuivante().

#define NODE_OR   2
 

Definition at line 36 of file regexp.h.

Referenced by regexp_parcours().

#define NODE_PLUS   5
 

Definition at line 39 of file regexp.h.

Referenced by regexp_parcours(), and regexp_possuivante().

#define NODE_STAR   4
 

Definition at line 38 of file regexp.h.

Referenced by regexp_parcours().

#define NODE_TOP   0
 

Definition at line 34 of file regexp.h.

#define NODE_VAR   1
 

Definition at line 35 of file regexp.h.

Referenced by regexp_parcours().

#define RE_ALL_MATCH   (DIC_LETTERS + 2)
 

Definition at line 63 of file regexp.h.

Referenced by PRegExp::build_letter_lists(), and init_letter_lists().

#define RE_CONS_MATCH   (DIC_LETTERS + 4)
 

Definition at line 65 of file regexp.h.

Referenced by PRegExp::build_letter_lists(), and init_letter_lists().

#define RE_EPSILON   (DIC_LETTERS + 0)
 

special terminals that should not appear in the dictionary

Definition at line 61 of file regexp.h.

Referenced by s_automaton_successor().

#define RE_FINAL_TOK   (DIC_LETTERS + 1)
 

Definition at line 62 of file regexp.h.

Referenced by s_automaton_successor().

#define RE_LIST_ALL_MATCH   0
 

Definition at line 98 of file regexp.h.

#define RE_LIST_CONS_MATCH   2
 

Definition at line 100 of file regexp.h.

#define RE_LIST_USER_BEGIN   3
 

Definition at line 101 of file regexp.h.

#define RE_LIST_USER_END   4
 

Definition at line 102 of file regexp.h.

#define RE_LIST_VOYL_MATCH   1
 

Definition at line 99 of file regexp.h.

#define RE_USR1_MATCH   (DIC_LETTERS + 5)
 

Definition at line 66 of file regexp.h.

Referenced by PRegExp::build_letter_lists().

#define RE_USR2_MATCH   (DIC_LETTERS + 6)
 

Definition at line 67 of file regexp.h.

Referenced by PRegExp::build_letter_lists().

#define RE_VOWL_MATCH   (DIC_LETTERS + 3)
 

Definition at line 64 of file regexp.h.

Referenced by PRegExp::build_letter_lists(), and init_letter_lists().

#define REGEXP_MAX   32
 

maximum number of accepted terminals in regular expressions

Definition at line 56 of file regexp.h.

Referenced by Dic_search_RegE().


Typedef Documentation

typedef struct node NODE
 


Function Documentation

NODE* regexp_createNODE int  type,
char  v,
NODE fg,
NODE fd
 

Create a node for the syntactic tree used for parsing regular expressions
The fonction is called by bison grammar rules.

Definition at line 48 of file regexp.c.

References node::annulable, node::DP, node::fd, node::fg, node::numero, node::position, node::PP, node::type, and node::var.

void regexp_delete_tree NODE root  ) 
 

delete regexp syntactic tree

Definition at line 64 of file regexp.c.

References node::fd, node::fg, and regexp_delete_tree().

Referenced by Dic_search_RegE(), and regexp_delete_tree().

void regexp_parcours NODE r,
int *  p,
int *  n,
int  ptl[]
 

Computes positions, first positions (PP), last position (DP) and translation table 'position to letter' (ptl).

Parameters:
r = root
p = current leaf position
n = current node number
ptl = position to letter

Definition at line 85 of file regexp.c.

References node::annulable, node::DP, node::fd, node::fg, NODE_AND, NODE_OR, NODE_PLUS, NODE_STAR, NODE_VAR, node::numero, node::position, node::PP, regexp_parcours(), node::type, and node::var.

Referenced by Dic_search_RegE(), and regexp_parcours().

void regexp_possuivante NODE r,
int  PS[]
 

Computes 'next position' table used for building the automaton.

Parameters:
r = root
PS = next position

Definition at line 139 of file regexp.c.

References node::DP, node::fd, node::fg, NODE_AND, NODE_PLUS, node::PP, regexp_possuivante(), and node::type.

Referenced by Dic_search_RegE(), and regexp_possuivante().

void regexp_print_letter FILE *  f,
char  l
 

Definition at line 222 of file regexp.c.

Referenced by s_automaton_NFA_to_DFA(), s_automaton_print_edges(), and s_automaton_successor().

void regexp_print_letter2 FILE *  f,
char  l
 

Definition at line 245 of file regexp.c.

void regexp_print_PS int  PS[]  ) 
 

void regexp_print_ptl int  ptl[]  ) 
 

void regexp_print_tree NODE n,
char *  name,
int  detail
 


Generated on Thu Dec 29 02:01:15 2005 for Eliot by  doxygen 1.4.5