/[bison]/bison/src/output.c
ViewVC logotype

Diff of /bison/src/output.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.184 by akim, Wed Jul 3 06:52:02 2002 UTC revision 1.185 by akim, Wed Jul 3 12:51:30 2002 UTC
# Line 20  Line 20 
20     02111-1307, USA.  */     02111-1307, USA.  */
21    
22    
23  /* The parser tables consist of these tables.  Marked ones needed only  /* The parser tables consist of these tables.
    for the semantic parser.  Double marked are output only if switches  
    are set.  
24    
25     YYTRANSLATE = vector mapping yylex's token numbers into bison's     YYTRANSLATE = vector mapping yylex's token numbers into bison's
26     token numbers.     token numbers.
27    
28     ++ YYTNAME = vector of string-names indexed by bison token number.     YYTNAME = vector of string-names indexed by bison token number.
29    
30     ++ YYTOKNUM = vector of yylex token numbers corresponding to     YYTOKNUM = vector of yylex token numbers corresponding to entries
31     entries in YYTNAME.     in YYTNAME.
32    
33     YYRLINE = vector of line-numbers of all rules.  For yydebug     YYRLINE = vector of line-numbers of all rules.  For yydebug
34     printouts.     printouts.
# Line 44  Line 42 
42    
43     YYR2[R] = number of symbols composing right hand side of rule R.     YYR2[R] = number of symbols composing right hand side of rule R.
44    
45     + YYSTOS[S] = the symbol number of the symbol that leads to state     YYSTOS[S] = the symbol number of the symbol that leads to state S.
    S.  
46    
47     YYDEFACT[S] = default rule to reduce with in state s, when YYTABLE     YYDEFACT[S] = default rule to reduce with in state s, when YYTABLE
48     doesn't specify something else to do.  Zero means the default is an     doesn't specify something else to do.  Zero means the default is an
# Line 109  void m4_invoke PARAMS ((const char *defi Line 106  void m4_invoke PARAMS ((const char *defi
106    
107  static int nvectors;  static int nvectors;
108  static int nentries;  static int nentries;
109  static short **froms = NULL;  static state_number_t **froms = NULL;
110  static short **tos = NULL;  static state_number_t **tos = NULL;
111  static unsigned int **conflict_tos = NULL;  static unsigned int **conflict_tos = NULL;
112  static short *tally = NULL;  static short *tally = NULL;
113  static short *width = NULL;  static short *width = NULL;
# Line 790  static void Line 787  static void
787  save_column (symbol_number_t symbol, state_number_t default_state)  save_column (symbol_number_t symbol, state_number_t default_state)
788  {  {
789    int i;    int i;
790    short *sp;    state_number_t *sp;
791    short *sp1;    state_number_t *sp1;
792    short *sp2;    state_number_t *sp2;
793    int count;    int count;
794    int symno = symbol - ntokens + state_number_as_int (nstates);    int symno = symbol - ntokens + state_number_as_int (nstates);
795    
796    int begin = goto_map[symbol];    goto_number_t begin = goto_map[symbol];
797    int end = goto_map[symbol + 1];    goto_number_t end = goto_map[symbol + 1];
798    
799    count = 0;    count = 0;
800    for (i = begin; i < end; i++)    for (i = begin; i < end; i++)
# Line 827  default_goto (symbol_number_t symbol) Line 824  default_goto (symbol_number_t symbol)
824  {  {
825    state_number_t s;    state_number_t s;
826    int i;    int i;
827    int m = goto_map[symbol];    goto_number_t m = goto_map[symbol];
828    int n = goto_map[symbol + 1];    goto_number_t n = goto_map[symbol + 1];
829    state_number_t default_state = (state_number_t) -1;    state_number_t default_state = (state_number_t) -1;
830    int max = 0;    int max = 0;
831    
# Line 1214  output_skeleton (void) Line 1211  output_skeleton (void)
1211  static void  static void
1212  prepare (void)  prepare (void)
1213  {  {
1214    MUSCLE_INSERT_INT ("last", high);    /* Flags. */
1215    MUSCLE_INSERT_INT ("flag", SHRT_MIN);    MUSCLE_INSERT_INT ("locations_flag", locations_flag);
1216      MUSCLE_INSERT_INT ("defines_flag", defines_flag);
1217      MUSCLE_INSERT_INT ("error_verbose", error_verbose);
1218    MUSCLE_INSERT_INT ("pure", pure_parser);    MUSCLE_INSERT_INT ("pure", pure_parser);
   MUSCLE_INSERT_INT ("nsym", nsyms);  
1219    MUSCLE_INSERT_INT ("debug", debug_flag);    MUSCLE_INSERT_INT ("debug", debug_flag);
   MUSCLE_INSERT_INT ("final", final_state->number);  
   MUSCLE_INSERT_INT ("undef_token_number", undeftoken->number);  
   MUSCLE_INSERT_INT ("user_token_number_max", max_user_token_number);  
   MUSCLE_INSERT_INT ("error_verbose", error_verbose);  
   MUSCLE_INSERT_STRING ("prefix", spec_name_prefix ? spec_name_prefix : "yy");  
1220    
1221    /* FIXME: This is wrong: the muscles should decide whether they hold    /* FIXME: This is wrong: the muscles should decide whether they hold
1222       a copy or not, but the situation is too obscure currently.  */       a copy or not, but the situation is too obscure currently.  */
1223      MUSCLE_INSERT_STRING ("prefix", spec_name_prefix ? spec_name_prefix : "yy");
1224    MUSCLE_INSERT_STRING ("output_infix", output_infix ? output_infix : "");    MUSCLE_INSERT_STRING ("output_infix", output_infix ? output_infix : "");
1225    MUSCLE_INSERT_STRING ("output_prefix", short_base_name);    MUSCLE_INSERT_STRING ("output_prefix", short_base_name);
1226    MUSCLE_INSERT_STRING ("output_parser_name", parser_file_name);    MUSCLE_INSERT_STRING ("output_parser_name", parser_file_name);
1227    MUSCLE_INSERT_STRING ("output_header_name", spec_defines_file);    MUSCLE_INSERT_STRING ("output_header_name", spec_defines_file);
1228    
1229    MUSCLE_INSERT_INT ("nnts", nvars);    /* Symbols. */
1230    MUSCLE_INSERT_INT ("nrules", nrules);    MUSCLE_INSERT_INT ("tokens_number", ntokens);
1231    MUSCLE_INSERT_INT ("nstates", nstates);    MUSCLE_INSERT_INT ("nterms_number", nvars);
1232    MUSCLE_INSERT_INT ("ntokens", ntokens);    MUSCLE_INSERT_INT ("undef_token_number", undeftoken->number);
1233      MUSCLE_INSERT_INT ("user_token_number_max", max_user_token_number);
1234    
1235    MUSCLE_INSERT_INT ("locations_flag", locations_flag);    /* Rules. */
1236    MUSCLE_INSERT_INT ("defines_flag", defines_flag);    MUSCLE_INSERT_INT ("rules_number", nrules);
1237    
1238      /* States. */
1239      MUSCLE_INSERT_INT ("last", high);
1240      MUSCLE_INSERT_INT ("flag", SHRT_MIN);
1241      MUSCLE_INSERT_INT ("final_state_number", final_state->number);
1242      MUSCLE_INSERT_INT ("states_number", nstates);
1243    
1244    /* Copy definitions in directive.  */    /* User Code.  */
1245    obstack_1grow (&pre_prologue_obstack, 0);    obstack_1grow (&pre_prologue_obstack, 0);
1246    obstack_1grow (&post_prologue_obstack, 0);    obstack_1grow (&post_prologue_obstack, 0);
1247    muscle_insert ("pre_prologue", obstack_finish (&pre_prologue_obstack));    muscle_insert ("pre_prologue", obstack_finish (&pre_prologue_obstack));

Legend:
Removed from v.1.184  
changed lines
  Added in v.1.185

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26