sxnd2parser.c File Reference

#include <stdio.h>
#include "sxversion.h"
#include "sxunix.h"
#include "sxba.h"
#include "XxY.h"
#include "XxYxZ.h"
#include "SS.h"
#include "sxnd.h"
Include dependency graph for sxnd2parser.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 sxnd2parser_GC ()
static SXVOID parsers_oflw (SXINT old_size, SXINT new_size)
static SXVOID sons_oflw (SXINT old_size, SXINT new_size)
static SXBOOLEAN set_next_item (struct SXP_item *vector, SXINT *check, SXINT *action, SXINT Max)
SXVOID set2_first_trans (struct SXP_bases *abase, SXINT *check, SXINT *action, SXINT Max, SXINT *next_action_kind)
SXBOOLEAN set2_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)
static SXINT ARC_traversal (SXINT ref, SXINT latok_no)
static SXBOOLEAN new_symbol (SXINT p, SXINT k, SXINT i, SXINT j, SXINT *symbol)
static void set_unit_rule (SXINT lhs, SXINT rhs_symb)
static void set_rule (SXINT lhs, SXINT rhs)
static SXINT build_a_rule (SXINT parser, SXINT index, SXINT rhs)
static SXVOID set_start_symbol (SXINT symbol)
SXINT mreds_push (SXINT parser, SXINT ref)
SXINT seek_parser (SXINT son, SXINT state, SXINT ref, SXINT symbol)
static SXVOID create_parser (SXINT son, SXINT state, SXINT ref, SXINT symbol)
static SXVOID do_reductions ()
static SXVOID do_pops (SXINT p, SXINT l)
static SXVOID seek_paths ()
SXVOID sxndsubparse_a_token (SXINT parser, SXINT ref, SXINT symbol, SXBOOLEAN do_shift_reduce)
static SXVOID do_reductions (SXINT son, SXBOOLEAN is_in_set)
static SXVOID do_limited_reductions (SXINT p, SXINT l)
static SXVOID seek_paths (SXINT p, SXINT p_trans, SXBOOLEAN is_in_set, SXINT l)
static SXVOID parse_forest ()
SXVOID reducer ()
static SXVOID sxndparse_a_token (SXINT symbol)
static SXVOID grammar_new_rule (SXINT lhs)
static SXVOID grammar_put (SXINT symbol)
static SXVOID expand_rule (SXINT tnt)
static SXVOID hook_construction (SXINT symbol)
static SXVOID unused_rule_elimination ()
static SXVOID output_rule (SXINT rule)
static SXVOID output_grammar ()
static SXVOID sxndparse_it ()
static SXVOID dag_set (SXINT index, SXINT succ_kind, SXINT new_kind)
static SXVOID sxnd2parse_it ()
static SXBOOLEAN sxnddesambig_it ()
SXBOOLEAN sxndparser (SXINT what_to_do, struct sxtables *arg)
SXBOOLEAN sxnd22parser (SXINT what_to_do, struct sxtables *arg)
SXBOOLEAN sxnd2parse_in_la (SXINT ep_la, SXINT Ttok_no, SXINT *Htok_no, struct sxparse_mode *mode_ptr)

Variables

static char ME [] = "ND2PARSER"
char WHAT_SXND2PARSER [] = "@(#)SYNTAX - $Id: sxnd2parser.c 1416 2008-06-25 14:42:55Z rlacroix $" WHAT_DEBUG
static SXINT * rhs_stack
static SXINT * symbol_stack
static SXINT * symb_to_rule_hd
static SXINT * symb_to_rule_list
static SXBA symbol_set
static SXBA hook_symbol_set

Define Documentation

#define Commun   1

Definition at line 68 of file sxnd2parser.c.

Referenced by set2_first_trans(), set2_next_trans(), set_first_trans(), and set_next_trans().

#define Defaut   3

Definition at line 70 of file sxnd2parser.c.

Referenced by set2_first_trans(), set2_next_trans(), set_first_trans(), and set_next_trans().

#define Done   4

Definition at line 71 of file sxnd2parser.c.

Referenced by set2_first_trans(), set2_next_trans(), set_first_trans(), and set_next_trans().

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

Definition at line 61 of file sxnd2parser.c.

#define Propre   2

Definition at line 69 of file sxnd2parser.c.

Referenced by set2_next_trans(), and set_next_trans().

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

Definition at line 60 of file sxnd2parser.c.

#define stdout_or_NULL   stdout

Definition at line 44 of file sxnd2parser.c.

Referenced by models_dag(), sxndparser(), and sxndtkn_mngr().


Function Documentation

static SXINT ARC_traversal ( SXINT  ref,
SXINT  latok_no 
) [static]
static SXINT build_a_rule ( SXINT  parser,
SXINT  index,
SXINT  rhs 
) [static]

Definition at line 502 of file sxnd2parser.c.

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

Referenced by seek_paths().

static SXVOID create_parser ( SXINT  son,
SXINT  state,
SXINT  ref,
SXINT  symbol 
) [static]
static SXVOID dag_set ( SXINT  index,
SXINT  succ_kind,
SXINT  new_kind 
) [static]

Definition at line 1877 of file sxnd2parser.c.

References ME, and sxtrap().

Referenced by sxnd2parse_it().

static SXVOID do_limited_reductions ( SXINT  p,
SXINT  l 
) [static]

Definition at line 963 of file sxnd2parser.c.

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

Referenced by reducer().

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

Definition at line 754 of file sxnd2parser.c.

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

Referenced by reducer(), and sxndsubparse_a_token().

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

Definition at line 1354 of file sxnd2parser.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 1375 of file sxnd2parser.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 
)

Definition at line 544 of file sxnd2parser.c.

References PUSH, sxplocals, and top.

Referenced by create_ref(), seek_parser(), set_next_shift_state(), and sxndsubparse_a_token().

SXINT NDP_access ( struct SXP_bases *  abase,
SXINT  j 
)

Definition at line 361 of file sxnd2parser.c.

static SXBOOLEAN new_symbol ( SXINT  p,
SXINT  k,
SXINT  i,
SXINT  j,
SXINT *  symbol 
) [static]

Definition at line 442 of file sxnd2parser.c.

References sxplocals, and XxY_set().

static SXVOID output_grammar ( void   )  [static]

Definition at line 1811 of file sxnd2parser.c.

References output_rule().

Referenced by sxnddesambig_it().

static SXVOID output_rule ( SXINT  rule  )  [static]

Definition at line 1733 of file sxnd2parser.c.

References sxplocals.

Referenced by output_grammar().

static SXVOID parse_forest ( void   )  [static]

Definition at line 1194 of file sxnd2parser.c.

References p, seek_paths(), SXBOOLEAN, SXFALSE, sxplocals, SXTRUE, and XxY_set().

Referenced by reducer().

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

Definition at line 189 of file sxnd2parser.c.

References sxbm_resize().

Referenced by sxndparser().

SXVOID reducer ( void   ) 

Definition at line 1249 of file sxnd2parser.c.

SXINT seek_parser ( SXINT  son,
SXINT  state,
SXINT  ref,
SXINT  symbol 
)
static SXVOID seek_paths ( SXINT  p,
SXINT  p_trans,
SXBOOLEAN  is_in_set,
SXINT  l 
) [static]
static SXVOID seek_paths (  )  [static]
SXVOID set2_first_trans ( struct SXP_bases *  abase,
SXINT *  check,
SXINT *  action,
SXINT  Max,
SXINT *  next_action_kind 
)

Definition at line 298 of file sxnd2parser.c.

References Commun, Defaut, Done, set_next_item(), and sxplocals.

SXBOOLEAN set2_next_trans ( struct SXP_bases *  abase,
SXINT *  check,
SXINT *  action,
SXINT  Max,
SXINT *  next_action_kind 
)

Definition at line 325 of file sxnd2parser.c.

References Commun, Defaut, Done, Propre, set_next_item(), SXFALSE, sxplocals, sxtrap(), and SXTRUE.

static SXBOOLEAN set_next_item ( struct SXP_item *  vector,
SXINT *  check,
SXINT *  action,
SXINT  Max 
) [static]

Definition at line 274 of file sxnd2parser.c.

References SXFALSE, sxplocals, SXTRUE, and val.

Referenced by set2_first_trans(), and set2_next_trans().

static void set_rule ( SXINT  lhs,
SXINT  rhs 
) [static]

Definition at line 476 of file sxnd2parser.c.

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

static SXVOID set_start_symbol ( SXINT  symbol  )  [static]

Definition at line 523 of file sxnd2parser.c.

References new_symbol(), and XxY_set().

static void set_unit_rule ( SXINT  lhs,
SXINT  rhs_symb 
) [static]

Definition at line 465 of file sxnd2parser.c.

References XxY_set().

Referenced by seek_parser(), and sxndsubparse_a_token().

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

Definition at line 206 of file sxnd2parser.c.

References sxba_resize().

Referenced by sxndparser().

SXBOOLEAN sxnd22parser ( SXINT  what_to_do,
struct sxtables arg 
)
SXBOOLEAN sxnd2parse_in_la ( SXINT  ep_la,
SXINT  Ttok_no,
SXINT *  Htok_no,
struct sxparse_mode *  mode_ptr 
)
static SXVOID sxnd2parse_it ( void   )  [static]
SXVOID sxnd2parser_GC (  ) 
static SXBOOLEAN sxnddesambig_it ( void   )  [static]
static SXVOID sxndparse_a_token ( SXINT  symbol  )  [static]

Definition at line 1333 of file sxnd2parser.c.

References reducer(), sxndsubparse_a_token(), and SXTRUE.

Referenced by sxnd2parse_in_la(), and sxndparse_it().

static SXVOID sxndparse_it ( void   )  [static]

Definition at line 1835 of file sxnd2parser.c.

References sxndparse_a_token(), sxplocals, and sxtime().

Referenced by sxndparser().

SXBOOLEAN sxndparser ( SXINT  what_to_do,
struct sxtables arg 
)
SXVOID sxndsubparse_a_token ( SXINT  parser,
SXINT  ref,
SXINT  symbol,
SXBOOLEAN  do_shift_reduce 
)
static SXVOID unused_rule_elimination ( void   )  [static]

Variable Documentation

SXBA hook_symbol_set [static]

Definition at line 65 of file sxnd2parser.c.

Referenced by unused_rule_elimination().

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

Definition at line 64 of file sxnd2parser.c.

Referenced by expand_rule(), and unused_rule_elimination().

SXINT * symb_to_rule_hd [static]

Definition at line 64 of file sxnd2parser.c.

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

SXINT * symb_to_rule_list [static]

Definition at line 64 of file sxnd2parser.c.

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

SXBA symbol_set [static]

Definition at line 65 of file sxnd2parser.c.

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

SXINT * symbol_stack [static]

Definition at line 64 of file sxnd2parser.c.

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

char WHAT_SXND2PARSER[] = "@(#)SYNTAX - $Id: sxnd2parser.c 1416 2008-06-25 14:42:55Z rlacroix $" WHAT_DEBUG

Definition at line 41 of file sxnd2parser.c.


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