sxreg_exp_mngr.c File Reference

#include "sxversion.h"
#include "sxcommon.h"
#include <stdlib.h>
#include "reg_exp_t.h"
#include "reg_exp_pact.h"
#include "reg_exp_sact.h"
#include "sxdynam_scanner.h"
#include "varstr.h"
#include "sxalloc.h"
#include "reg_exp_nn.h"
Include dependency graph for sxreg_exp_mngr.c:

Go to the source code of this file.

Data Structures

struct  reg_exp_node

Defines

#define SXNODE   struct reg_exp_node
#define sxtables   reg_exp_tables
#define SCANACT   lecl_scan_act
#define PARSACT   lecl_pars_act
#define sempass   sxre_smp
#define char_sets_incr()
#define WRITE(p, l)   ((bytes=(l))>0&&(write(file_descr, p, (size_t) bytes) == bytes))
#define READ(p, l)   ((bytes=(l))>0&&(read (file_descr, p, (size_t)bytes) == bytes))
#define re_cat(s)

Functions

static void reg_exp_pcn_oflw (SXINT old_size, SXINT new_size)
static void reg_exp_pcn_free (void)
static void reg_exp_pcn_alloc (void)
static SXINT char_sets_oflw (void)
static void terminals_oflw (SXINT old_size, SXINT new_size)
static void abbrev_names_oflw (SXINT old_size, SXINT new_size)
static void reg_exp_names_oflw (SXINT old_size, SXINT new_size)
void sxre_store (void)
void sxre_restore (void)
void sxre_alloc (void)
SXINT sxre_process_eof (SXINT eof_code)
void sxre_doit (FILE *infile, char *file_name_or_source_string)
void sxre_free (void)
static void initialize_reg_exp (SXINT init_item, SXBA first)
static void set_new_item (SXINT kind, SXINT set_new_item_item_no, SXINT val, SXINT param, SXBA next, SXBOOLEAN is_erased)
static void insert_abbrev (SXINT abbrev_no, SXINT insert_abbrev_item_no, SXBA next, SXBOOLEAN is_erased)
static void abbrev_to_first (SXINT abbrev_no, SXINT abbrev_to_first_item_no, SXBA first)
static void error (char *string, struct reg_exp_node *visited)
static SXBOOLEAN first_pass (struct reg_exp_node *visited, SXBOOLEAN *is_action)
static SXBOOLEAN second_pass (struct reg_exp_node *visited)
static SXBOOLEAN class_denotations (struct reg_exp_node *visited)
static SXBOOLEAN process_action (struct reg_exp_node *visited, SXINT *action, SXINT *param)
static SXBOOLEAN process_predicate (struct reg_exp_node *visited, SXINT *action, SXINT *param)
static SXBOOLEAN third_pass (struct reg_exp_node *visited, SXBA next, SXBOOLEAN is_del)
static SXBOOLEAN classes (struct reg_exp_node *visited)
static SXINT re_maj_item_top (SXINT n)
static SXBOOLEAN regular_expression (struct reg_exp_node *visited, SXBOOLEAN *is_action)
static SXBOOLEAN abbreviations (struct reg_exp_node *visited)
static SXBOOLEAN set_priority_kind (struct reg_exp_node *visited, char current)
static SXBOOLEAN environment (struct reg_exp_node *visited)
static SXINT GetReduceId (SXINT re1)
static SXBOOLEAN reg_exps (struct reg_exp_node *visited)
static SXBOOLEAN synonyms (struct reg_exp_node *visited, SXINT *prev_ste)
SXINT sxre_smp (SXINT sxre_smp_what, struct reg_exp_tables *sxtables_ptr)
SXINT sxre_string_to_re (char *string, SXINT t_code, SXBOOLEAN is_a_generic_terminal)
SXBOOLEAN sxre_write (sxfiledesc_t file_descr)
SXBOOLEAN sxre_read (sxfiledesc_t file_descr)
static void re_out_tab_int (FILE *file, char *name1, char *name2, SXINT *tab, SXINT size, SXINT top)
static void re_out_tab_struct (FILE *file, char *struct_name, char *name1, char *name2, void(*print)(FILE *, SXINT), SXINT size, SXINT top)
static void re_print_abbrev_to_attr (FILE *file, SXINT re_print_abbrev_to_attr_index)
static void re_print_reg_exp_to_attr (FILE *file, SXINT re_print_reg_exp_to_attr_index)
static void re_print_item_to_attr (FILE *file, SXINT re_print_item_to_attr_index)
static void re_print_terminal_to_attr (FILE *file, SXINT re_print_terminal_to_attr_index)
void sxre_array_to_c (FILE *file, char *name)
void sxre_header_to_c (FILE *file, char *name)
void sxre_to_c (FILE *file, char *name, SXBOOLEAN is_static)
void sxre_reuse (void)

Variables

char WHAT_SXREG_EXP_MNGR [] = "@(#)SYNTAX - $Id: sxreg_exp_mngr.c 1510 2008-08-20 12:43:27Z sagot $" WHAT_DEBUG
struct {
   char *   name
   char *   elems
predefs []
static struct sx_variables store
static SXINT node_no
static SXINT item_no
static VARSTR vstr
static SXINT master_reg_exp_no
static SXUINT sc_names_total_lgth
static SXUINT abbrev_names_total_lgth
static SXUINT reg_exp_names_total_lgth
static SXUINT terminals_total_lgth

Define Documentation

 
#define char_sets_incr (  ) 
Value:
((++SXDS->char_sets_top == SXDS->char_sets_size) \
                 ? char_sets_oflw () : SXDS->char_sets_top)

Definition at line 242 of file sxreg_exp_mngr.c.

Referenced by class_denotations(), sxre_process_eof(), and sxre_string_to_re().

#define PARSACT   lecl_pars_act

Definition at line 38 of file sxreg_exp_mngr.c.

#define re_cat (  ) 
Value:
(vstr->current = vstr->first + prefix_lgth, \
             varstr_catenate (vstr, s),         \
             varstr_tostr (vstr))

Definition at line 2558 of file sxreg_exp_mngr.c.

Referenced by sxre_array_to_c(), and sxre_header_to_c().

#define READ ( p,
 )     ((bytes=(l))>0&&(read (file_descr, p, (size_t)bytes) == bytes))
#define SCANACT   lecl_scan_act

Definition at line 37 of file sxreg_exp_mngr.c.

#define sempass   sxre_smp

Definition at line 39 of file sxreg_exp_mngr.c.

#define SXNODE   struct reg_exp_node

Definition at line 34 of file sxreg_exp_mngr.c.

#define sxtables   reg_exp_tables

Definition at line 36 of file sxreg_exp_mngr.c.

#define WRITE ( p,
 )     ((bytes=(l))>0&&(write(file_descr, p, (size_t) bytes) == bytes))

Function Documentation

static void abbrev_names_oflw ( SXINT  old_size,
SXINT  new_size 
) [static]

Definition at line 265 of file sxreg_exp_mngr.c.

Referenced by sxre_alloc(), sxre_read(), and sxre_reuse().

static void abbrev_to_first ( SXINT  abbrev_no,
SXINT  abbrev_to_first_item_no,
SXBA  first 
) [static]

Definition at line 635 of file sxreg_exp_mngr.c.

Referenced by second_pass().

static SXBOOLEAN abbreviations ( struct reg_exp_node visited  )  [static]
static SXINT char_sets_oflw ( void   )  [static]

Definition at line 218 of file sxreg_exp_mngr.c.

References sxbm_calloc(), sxbm_resize(), and SXFALSE.

static SXBOOLEAN class_denotations ( struct reg_exp_node visited  )  [static]
static SXBOOLEAN classes ( struct reg_exp_node visited  )  [static]
static SXBOOLEAN environment ( struct reg_exp_node visited  )  [static]
static void error ( char string,
struct reg_exp_node visited 
) [static]
static SXBOOLEAN first_pass ( struct reg_exp_node visited,
SXBOOLEAN *  is_action 
) [static]
static SXINT GetReduceId ( SXINT  re1  )  [static]

Definition at line 1758 of file sxreg_exp_mngr.c.

References sxba_first_difference().

Referenced by reg_exps(), and sxre_string_to_re().

static void initialize_reg_exp ( SXINT  init_item,
SXBA  first 
) [static]

Definition at line 559 of file sxreg_exp_mngr.c.

References sxba_scan(), and XxY_set().

Referenced by regular_expression().

static void insert_abbrev ( SXINT  abbrev_no,
SXINT  insert_abbrev_item_no,
SXBA  next,
SXBOOLEAN  is_erased 
) [static]

Definition at line 596 of file sxreg_exp_mngr.c.

References sxba_scan(), and XxY_set().

Referenced by third_pass().

static SXBOOLEAN process_action ( struct reg_exp_node visited,
SXINT *  action,
SXINT *  param 
) [static]

Definition at line 1028 of file sxreg_exp_mngr.c.

References class_denotations(), error(), sxba_scan(), SXFALSE, sxtrap(), and SXTRUE.

Referenced by third_pass().

static SXBOOLEAN process_predicate ( struct reg_exp_node visited,
SXINT *  action,
SXINT *  param 
) [static]

Definition at line 1125 of file sxreg_exp_mngr.c.

References error(), SXFALSE, sxtrap(), and SXTRUE.

Referenced by third_pass().

static SXINT re_maj_item_top ( SXINT  n  )  [static]

Definition at line 1402 of file sxreg_exp_mngr.c.

References SXFALSE.

Referenced by reg_exps(), and regular_expression().

static void re_out_tab_int ( FILE *  file,
char name1,
char name2,
SXINT *  tab,
SXINT  size,
SXINT  top 
) [static]

Definition at line 2485 of file sxreg_exp_mngr.c.

Referenced by sxre_array_to_c().

static void re_out_tab_struct ( FILE *  file,
char struct_name,
char name1,
char name2,
void(*)(FILE *, SXINT)  print,
SXINT  size,
SXINT  top 
) [static]

Definition at line 2502 of file sxreg_exp_mngr.c.

Referenced by sxre_array_to_c().

static void re_print_abbrev_to_attr ( FILE *  file,
SXINT  re_print_abbrev_to_attr_index 
) [static]

Definition at line 2526 of file sxreg_exp_mngr.c.

References p.

Referenced by sxre_array_to_c().

static void re_print_item_to_attr ( FILE *  file,
SXINT  re_print_item_to_attr_index 
) [static]

Definition at line 2543 of file sxreg_exp_mngr.c.

References p.

Referenced by sxre_array_to_c().

static void re_print_reg_exp_to_attr ( FILE *  file,
SXINT  re_print_reg_exp_to_attr_index 
) [static]

Definition at line 2535 of file sxreg_exp_mngr.c.

References p.

Referenced by sxre_array_to_c().

static void re_print_terminal_to_attr ( FILE *  file,
SXINT  re_print_terminal_to_attr_index 
) [static]

Definition at line 2551 of file sxreg_exp_mngr.c.

References p.

Referenced by sxre_array_to_c().

static void reg_exp_names_oflw ( SXINT  old_size,
SXINT  new_size 
) [static]

Definition at line 284 of file sxreg_exp_mngr.c.

References sxbm_calloc(), and sxbm_resize().

Referenced by sxre_alloc(), sxre_read(), and sxre_reuse().

static void reg_exp_pcn_alloc ( void   )  [static]
static void reg_exp_pcn_free ( void   )  [static]

Definition at line 159 of file sxreg_exp_mngr.c.

References sxbm_free(), and sxword_free().

Referenced by sxre_free().

static void reg_exp_pcn_oflw ( SXINT  old_size,
SXINT  new_size 
) [static]

Definition at line 142 of file sxreg_exp_mngr.c.

Referenced by reg_exp_pcn_alloc(), sxre_read(), and sxre_reuse().

static SXBOOLEAN reg_exps ( struct reg_exp_node visited  )  [static]
static SXBOOLEAN regular_expression ( struct reg_exp_node visited,
SXBOOLEAN *  is_action 
) [static]
static SXBOOLEAN second_pass ( struct reg_exp_node visited  )  [static]
static void set_new_item ( SXINT  kind,
SXINT  set_new_item_item_no,
SXINT  val,
SXINT  param,
SXBA  next,
SXBOOLEAN  is_erased 
) [static]

Definition at line 572 of file sxreg_exp_mngr.c.

References sxba_scan(), and XxY_set().

Referenced by reg_exps(), and third_pass().

static SXBOOLEAN set_priority_kind ( struct reg_exp_node visited,
char  current 
) [static]

Definition at line 1546 of file sxreg_exp_mngr.c.

References error(), p, SXFALSE, and SXTRUE.

Referenced by environment().

void sxre_alloc ( void   ) 
void sxre_array_to_c ( FILE *  file,
char name 
)
void sxre_doit ( FILE *  infile,
char file_name_or_source_string 
)

Definition at line 473 of file sxreg_exp_mngr.c.

References sxbm_calloc(), SXFALSE, sxsrc_mngr(), SXTRUE, syntax(), varstr_alloc(), and vstr.

void sxre_free ( void   ) 
void sxre_header_to_c ( FILE *  file,
char name 
)
SXINT sxre_process_eof ( SXINT  eof_code  ) 

Definition at line 416 of file sxreg_exp_mngr.c.

References char_sets_incr, SXFALSE, SXTRUE, sxword_2save(), and XxY_set().

SXBOOLEAN sxre_read ( sxfiledesc_t  file_descr  ) 
void sxre_restore ( void   ) 

Definition at line 344 of file sxreg_exp_mngr.c.

References store, sxplocals, and sxsvar.

void sxre_reuse ( void   ) 
SXINT sxre_smp ( SXINT  sxre_smp_what,
struct reg_exp_tables *  sxtables_ptr 
)
void sxre_store ( void   ) 

Definition at line 325 of file sxreg_exp_mngr.c.

References store, sxplocals, and sxsvar.

SXINT sxre_string_to_re ( char string,
SXINT  t_code,
SXBOOLEAN  is_a_generic_terminal 
)
void sxre_to_c ( FILE *  file,
char name,
SXBOOLEAN  is_static 
)

Definition at line 2676 of file sxreg_exp_mngr.c.

References sxre_array_to_c(), and sxre_header_to_c().

SXBOOLEAN sxre_write ( sxfiledesc_t  file_descr  ) 

Definition at line 2353 of file sxreg_exp_mngr.c.

References bytes, sxbm_write(), SXBOOLEAN, SXTRUE, sxword_write(), WRITE, and XxY_write().

static SXBOOLEAN synonyms ( struct reg_exp_node visited,
SXINT *  prev_ste 
) [static]

Definition at line 2016 of file sxreg_exp_mngr.c.

References name, p, SXFALSE, sxson(), sxtrap(), SXTRUE, and sxword_2save().

Referenced by sxre_smp().

static void terminals_oflw ( SXINT  old_size,
SXINT  new_size 
) [static]

Definition at line 246 of file sxreg_exp_mngr.c.

Referenced by sxre_alloc(), sxre_read(), and sxre_reuse().

static SXBOOLEAN third_pass ( struct reg_exp_node visited,
SXBA  next,
SXBOOLEAN  is_del 
) [static]

Variable Documentation

SXUINT abbrev_names_total_lgth [static]

Definition at line 2562 of file sxreg_exp_mngr.c.

Definition at line 66 of file sxreg_exp_mngr.c.

SXINT item_no [static]

Definition at line 136 of file sxreg_exp_mngr.c.

Referenced by first_pass(), reg_exps(), and regular_expression().

SXINT master_reg_exp_no [static]

Definition at line 139 of file sxreg_exp_mngr.c.

Referenced by reg_exps().

SXINT node_no [static]

Definition at line 136 of file sxreg_exp_mngr.c.

Referenced by first_pass(), and regular_expression().

struct { ... } predefs[] [static]

Referenced by reg_exp_pcn_alloc().

SXUINT reg_exp_names_total_lgth [static]

Definition at line 2562 of file sxreg_exp_mngr.c.

SXUINT sc_names_total_lgth [static]

Definition at line 2562 of file sxreg_exp_mngr.c.

struct sx_variables store [static]

Definition at line 135 of file sxreg_exp_mngr.c.

Referenced by read_a_re(), read_a_sdag(), read_a_udag(), sxre_restore(), and sxre_store().

SXUINT terminals_total_lgth [static]

Definition at line 2562 of file sxreg_exp_mngr.c.

VARSTR vstr [static]
char WHAT_SXREG_EXP_MNGR[] = "@(#)SYNTAX - $Id: sxreg_exp_mngr.c 1510 2008-08-20 12:43:27Z sagot $" WHAT_DEBUG

Definition at line 52 of file sxreg_exp_mngr.c.


Generated on Wed Apr 21 16:39:38 2010 for syntax-6.0b7 by  doxygen 1.6.1