sxndparser.c File Reference

#include "sxversion.h"
#include "sxcommon.h"
#include <stdio.h>
#include "sxnd.h"
Include dependency graph for sxndparser.c:

Go to the source code of this file.

Defines

#define stdout_or_NULL   stdout
#define PUSH(T, x)   T [x] = T [0], T [0] = x
#define POP(T, x)   x = T [0], T [0] = T [x], T [x] = 0
#define Commun   1
#define Propre   2
#define Defaut   3
#define Done   4

Functions

SXVOID output_repair_list (void)
SXVOID output_repair_string (SXINT output_repair_string_index)
SXVOID sxndparser_GC (SXINT current_parser)
static SXVOID parsers_oflw (SXINT old_size, SXINT new_size)
static SXVOID sons_oflw (SXINT old_size, SXINT new_size)
static SXVOID symbols_oflw (SXINT old_size, SXINT new_size)
static SXBOOLEAN set_next_item (struct SXP_item *vector, SXINT *check, SXINT *action, SXINT Max)
SXVOID set_first_trans (struct SXP_bases *abase, SXINT *check, SXINT *action, SXINT Max, SXINT *next_action_kind)
SXBOOLEAN set_next_trans (struct SXP_bases *abase, SXINT *check, SXINT *action, SXINT Max, SXINT *next_action_kind)
SXINT NDP_access (struct SXP_bases *abase, SXINT j)
SXBOOLEAN new_symbol (SXINT reduce, SXINT k, SXINT i, SXINT j, SXINT *symbol)
void set_rule (SXINT lhs, SXINT rhs)
static SXINT build_a_rule (SXINT parser, SXINT build_a_rule_index, SXINT rhs)
SXVOID set_start_symbol (SXINT symbol)
static SXVOID clear_triples (void)
SXINT mreds_push (SXINT parser, SXINT ref, SXINT tok_no, SXBOOLEAN is_new_triple, SXBOOLEAN is_shift_reduce, SXINT symbol)
SXINT new_parser (SXINT son, SXINT state, SXINT symbol)
static SXBOOLEAN call_predicate (SXINT current_token, SXINT prdct)
static SXINT ARC_traversal (SXINT ref)
static void create_ref (SXINT father, SXINT ref)
SXBOOLEAN sxndsubparse_a_token (SXINT parser, SXINT ref, SXINT symbol, SXINT(*f)(SXINT, SXINT, SXINT))
static SXBOOLEAN do_reductions (SXINT son, SXBOOLEAN is_in_set)
static SXBOOLEAN do_pops (SXINT p, SXINT l)
static SXVOID seek_paths (SXINT p, SXINT p_trans, SXBOOLEAN is_in_set, SXINT l)
static SXBOOLEAN do_limited_pops (SXINT p, SXINT l)
static SXVOID parse_forest (void)
static void single_reduce (SXINT xtriple, SXBOOLEAN is_limited)
SXVOID reducer (void)
static SXVOID grammar_new_rule (SXINT lhs)
static SXVOID grammar_put (SXINT symbol)
static SXVOID push_new_nt (SXINT symbol)
static SXVOID expand_rule (SXINT tnt)
static SXVOID hook_construction (SXINT symbol)
static SXVOID unused_rule_elimination (void)
static SXVOID output_rule (SXINT rule)
static SXVOID output_grammar (void)
static SXVOID do_put_error (void)
static SXVOID sxndparse_it (void)
static SXBOOLEAN dag_set (SXINT dag_set_index, SXINT succ_kind, SXINT new_kind)
static SXBOOLEAN sxnd2_error_detected (void)
static SXVOID sxnd2parse_it (void)
static SXBOOLEAN sxnddesambig_it (void)
void sxndparse_erase_hook_item (SXINT item)
SXBOOLEAN sxndparse_clean_forest (void)
void sxndparse_pack_forest (void)
SXBOOLEAN sxndparser (SXINT what_to_do, struct sxtables *arg)
SXBOOLEAN sxnd2parser (SXINT what_to_do, struct sxtables *arg)
SXBOOLEAN sxndparse_in_la (SXINT ep_la, SXINT Ttok_no, SXINT *Htok_no, struct sxparse_mode *mode_ptr)

Variables

static char ME [] = "NDPARSER"
char WHAT_SXNDPARSER32 [] = "@(#)SYNTAX - $Id: sxndparser.c 1491 2008-07-23 16:13:15Z sagot $ SXNDPARSER_32" WHAT_DEBUG
static SXINT * rhs_stack
static SXINT * symbol_stack
static SXINT * symb_to_rule_hd
static SXINT * symb_to_rule_list
static SXBA hook_symbol_set

Define Documentation

#define Commun   1

Definition at line 65 of file sxndparser.c.

#define Defaut   3

Definition at line 67 of file sxndparser.c.

#define Done   4

Definition at line 68 of file sxndparser.c.

#define POP ( T,
 )     x = T [0], T [0] = T [x], T [x] = 0

Definition at line 59 of file sxndparser.c.

#define Propre   2

Definition at line 66 of file sxndparser.c.

#define PUSH ( T,
 )     T [x] = T [0], T [0] = x

Definition at line 58 of file sxndparser.c.

#define stdout_or_NULL   stdout

Definition at line 44 of file sxndparser.c.


Function Documentation

static SXINT ARC_traversal ( SXINT  ref  )  [static]

Definition at line 723 of file sxndparser.c.

References ARC_traversal(), call_predicate(), NDP_access(), sxget_token(), and sxplocals.

static SXINT build_a_rule ( SXINT  parser,
SXINT  build_a_rule_index,
SXINT  rhs 
) [static]

Definition at line 480 of file sxndparser.c.

References ME, new_symbol(), set_rule(), SXBOOLEAN, and sxtrap().

Referenced by parse_forest(), and seek_paths().

static SXBOOLEAN call_predicate ( SXINT  current_token,
SXINT  prdct 
) [static]

Definition at line 710 of file sxndparser.c.

References SXBOOLEAN, and sxplocals.

Referenced by ARC_traversal().

static SXVOID clear_triples ( void   )  [static]

Definition at line 520 of file sxndparser.c.

Referenced by reducer().

static void create_ref ( SXINT  father,
SXINT  ref 
) [static]
static SXBOOLEAN dag_set ( SXINT  dag_set_index,
SXINT  succ_kind,
SXINT  new_kind 
) [static]

Definition at line 2846 of file sxndparser.c.

References ME, SXBOOLEAN, SXFALSE, sxtrap(), and SXTRUE.

Referenced by sxnd2parse_it().

static SXBOOLEAN do_limited_pops ( SXINT  p,
SXINT  l 
) [static]

Definition at line 1286 of file sxndparser.c.

References do_reductions(), son, sxba_scan(), sxba_scan_reset(), SXBOOLEAN, SXFALSE, and SXTRUE.

Referenced by single_reduce().

static SXBOOLEAN do_pops ( SXINT  p,
SXINT  l 
) [static]

Definition at line 1169 of file sxndparser.c.

References do_reductions(), son, sxba_scan_reset(), SXBOOLEAN, SXFALSE, and SXTRUE.

Referenced by single_reduce().

static SXVOID do_put_error ( void   )  [static]

Definition at line 2635 of file sxndparser.c.

References output_repair_string(), SXBOOLEAN, SXFALSE, and SXTRUE.

Referenced by one_correction_message(), and sxnddesambig_it().

static SXBOOLEAN do_reductions ( SXINT  son,
SXBOOLEAN  is_in_set 
) [static]
static SXVOID expand_rule ( SXINT  tnt  )  [static]

Definition at line 1980 of file sxndparser.c.

References grammar_new_rule(), grammar_put(), push_new_nt(), rhs_stack, and sxplocals.

Referenced by unused_rule_elimination().

static SXVOID grammar_new_rule ( SXINT  lhs  )  [static]

Definition at line 1902 of file sxndparser.c.

References symb_to_rule_hd, and symb_to_rule_list.

Referenced by expand_rule(), hook_construction(), and unused_rule_elimination().

static SXVOID grammar_put ( SXINT  symbol  )  [static]

Definition at line 1925 of file sxndparser.c.

Referenced by expand_rule(), hook_construction(), and unused_rule_elimination().

static SXVOID hook_construction ( SXINT  symbol  )  [static]
SXINT mreds_push ( SXINT  parser,
SXINT  ref,
SXINT  tok_no,
SXBOOLEAN  is_new_triple,
SXBOOLEAN  is_shift_reduce,
SXINT  symbol 
)

Definition at line 538 of file sxndparser.c.

References ME, PUSH, SXFALSE, sxtrap(), and top.

SXINT NDP_access ( struct SXP_bases *  abase,
SXINT  j 
)

Definition at line 376 of file sxndparser.c.

References check(), and sxplocals.

SXINT new_parser ( SXINT  son,
SXINT  state,
SXINT  symbol 
)
SXBOOLEAN new_symbol ( SXINT  reduce,
SXINT  k,
SXINT  i,
SXINT  j,
SXINT *  symbol 
)

Definition at line 403 of file sxndparser.c.

References ME, sxplocals, sxtrap(), and XxY_set().

Referenced by build_a_rule(), do_reductions(), and set_start_symbol().

static SXVOID output_grammar ( void   )  [static]

Definition at line 2615 of file sxndparser.c.

References output_rule().

Referenced by sxnddesambig_it().

SXVOID output_repair_list ( void   ) 

Definition at line 429 of file sxndp_rcvr.c.

References output_repair_string().

Referenced by sxnddesambig_it().

SXVOID output_repair_string ( SXINT  output_repair_string_index  ) 

Definition at line 406 of file sxndp_rcvr.c.

References sxerror(), and sxplocals.

Referenced by do_put_error(), and output_repair_list().

static SXVOID output_rule ( SXINT  rule  )  [static]

Definition at line 2524 of file sxndparser.c.

References sxplocals.

Referenced by output_grammar().

static SXVOID parse_forest ( void   )  [static]

Definition at line 1522 of file sxndparser.c.

References build_a_rule(), ME, p, seek_paths(), set_rule(), set_start_symbol(), SXBOOLEAN, sxplocals, sxtrap(), and XxY_set().

Referenced by reducer().

static SXVOID parsers_oflw ( SXINT  old_size,
SXINT  new_size 
) [static]

Definition at line 201 of file sxndparser.c.

References sxbm_resize().

Referenced by sxndparser().

static SXVOID push_new_nt ( SXINT  symbol  )  [static]

Definition at line 1945 of file sxndparser.c.

References hook_symbol_set, PUSH, symbol_set, and symbol_stack.

Referenced by expand_rule(), and unused_rule_elimination().

SXVOID reducer ( void   ) 
static SXVOID seek_paths ( SXINT  p,
SXINT  p_trans,
SXBOOLEAN  is_in_set,
SXINT  l 
) [static]

Definition at line 1383 of file sxndparser.c.

References build_a_rule(), set_rule(), son, sxba_scan_reset(), SXBOOLEAN, SXFALSE, SXTRUE, and XxY_set().

Referenced by parse_forest().

SXVOID set_first_trans ( struct SXP_bases *  abase,
SXINT *  check,
SXINT *  action,
SXINT  Max,
SXINT *  next_action_kind 
)
static SXBOOLEAN set_next_item ( struct SXP_item *  vector,
SXINT *  check,
SXINT *  action,
SXINT  Max 
) [static]

Definition at line 297 of file sxndparser.c.

References SXFALSE, sxplocals, SXTRUE, and val.

Referenced by set_first_trans(), and set_next_trans().

SXBOOLEAN set_next_trans ( struct SXP_bases *  abase,
SXINT *  check,
SXINT *  action,
SXINT  Max,
SXINT *  next_action_kind 
)
void set_rule ( SXINT  lhs,
SXINT  rhs 
)

Definition at line 445 of file sxndparser.c.

References ME, reduce(), sxplocals, sxtrap(), SXTRUE, and XxY_set().

Referenced by build_a_rule(), parse_forest(), and seek_paths().

SXVOID set_start_symbol ( SXINT  symbol  ) 

Definition at line 500 of file sxndparser.c.

References new_symbol(), and XxY_set().

Referenced by parse_forest(), and sxndsubparse_a_token().

static void single_reduce ( SXINT  xtriple,
SXBOOLEAN  is_limited 
) [static]

Definition at line 1790 of file sxndparser.c.

References do_limited_pops(), do_pops(), SXBOOLEAN, sxplocals, and SXTRUE.

Referenced by reducer().

static SXVOID sons_oflw ( SXINT  old_size,
SXINT  new_size 
) [static]

Definition at line 221 of file sxndparser.c.

References sxba_resize().

Referenced by sxndparser().

static SXBOOLEAN sxnd2_error_detected ( void   )  [static]

Definition at line 2950 of file sxndparser.c.

References SXFALSE, and SXTRUE.

Referenced by sxnd2parse_it().

static SXVOID sxnd2parse_it ( void   )  [static]
SXBOOLEAN sxnd2parser ( SXINT  what_to_do,
struct sxtables arg 
)
static SXBOOLEAN sxnddesambig_it ( void   )  [static]
SXBOOLEAN sxndparse_clean_forest ( void   ) 
void sxndparse_erase_hook_item ( SXINT  item  ) 

Definition at line 3255 of file sxndparser.c.

Referenced by sxndparse_clean_forest().

SXBOOLEAN sxndparse_in_la ( SXINT  ep_la,
SXINT  Ttok_no,
SXINT *  Htok_no,
struct sxparse_mode *  mode_ptr 
)
static SXVOID sxndparse_it ( void   )  [static]

Definition at line 2672 of file sxndparser.c.

References ME, reducer(), SXFALSE, sxndsubparse_a_token(), sxplocals, sxtime(), sxtrap(), and SXTRUE.

Referenced by sxndparser().

void sxndparse_pack_forest ( void   ) 

Definition at line 3434 of file sxndparser.c.

References ME, sxba_0_lrscan(), sxba_scan(), and sxtrap().

SXBOOLEAN sxndparser ( SXINT  what_to_do,
struct sxtables arg 
)
SXVOID sxndparser_GC ( SXINT  current_parser  ) 

Definition at line 70 of file sxndparser.c.

References son, sxba_1_rlscan(), sxba_fill(), SXBOOLEAN, SXFALSE, and SXTRUE.

Referenced by ndp_recovery(), and new_parser().

SXBOOLEAN sxndsubparse_a_token ( SXINT  parser,
SXINT  ref,
SXINT  symbol,
SXINT(*)(SXINT, SXINT, SXINT)  f 
)
static SXVOID symbols_oflw ( SXINT  old_size,
SXINT  new_size 
) [static]

Definition at line 232 of file sxndparser.c.

Referenced by sxndparser().

static SXVOID unused_rule_elimination ( void   )  [static]

Variable Documentation

SXBA hook_symbol_set [static]

Definition at line 63 of file sxndparser.c.

Referenced by push_new_nt(), and unused_rule_elimination().

char ME[] = "NDPARSER" [static]
SXINT* rhs_stack [static]

Definition at line 62 of file sxndparser.c.

Referenced by expand_rule(), and unused_rule_elimination().

SXINT * symb_to_rule_hd [static]

Definition at line 62 of file sxndparser.c.

Referenced by grammar_new_rule(), hook_construction(), and unused_rule_elimination().

SXINT * symb_to_rule_list [static]

Definition at line 62 of file sxndparser.c.

Referenced by grammar_new_rule(), hook_construction(), and unused_rule_elimination().

SXINT * symbol_stack [static]

Definition at line 62 of file sxndparser.c.

Referenced by push_new_nt(), and unused_rule_elimination().

char WHAT_SXNDPARSER32[] = "@(#)SYNTAX - $Id: sxndparser.c 1491 2008-07-23 16:13:15Z sagot $ SXNDPARSER_32" WHAT_DEBUG

Definition at line 41 of file sxndparser.c.


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