/[bison]/bison/data/bison.simple
ViewVC logotype

Diff of /bison/data/bison.simple

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

revision 1.32 by akim, Fri Jun 14 17:29:17 2002 UTC revision 1.33 by akim, Mon Jun 17 08:43:11 2002 UTC
# Line 68  m4_define_default([b4_header_guard], Line 68  m4_define_default([b4_header_guard],
68                                  [[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]], [_])])                                  [[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]], [_])])
69    
70    
71    ## ------------------------- ##
72    ## Assigning token numbers.  ##
73    ## ------------------------- ##
74    
75  # b4_token_define(TOKEN-NAME, TOKEN-NUMBER)  # b4_token_define(TOKEN-NAME, TOKEN-NUMBER)
76  # -----------------------------------------  # -----------------------------------------
77  # Output the definition of this token as #define.  # Output the definition of this token as #define.
# Line 432  static const short yycheck[[]] = Line 436  static const short yycheck[[]] =
436    b4_check    b4_check
437  };  };
438    
 #if YYDEBUG  
439  /* YYSTOS[[STATE-NUM]] -- The (internal number of the) accessing  /* YYSTOS[[STATE-NUM]] -- The (internal number of the) accessing
440     symbol of state STATE-NUM.  */     symbol of state STATE-NUM.  */
441  static const b4_uint_type(b4_stos_max) yystos[[]] =  static const b4_uint_type(b4_stos_max) yystos[[]] =
442  {  {
443    b4_stos    b4_stos
444  };  };
 #endif  
445    
446  #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)  #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
447  # define YYSIZE_T __SIZE_TYPE__  # define YYSIZE_T __SIZE_TYPE__
# Line 649  int yyparse (void *); Line 651  int yyparse (void *);
651  int yyparse (void);  int yyparse (void);
652  # endif  # endif
653  #endif  #endif
654    static void yydestructor (int symbol_type, YYSTYPE symbol_value);
655    
656  /* YY_DECL_VARIABLES -- depending whether we use a pure parser,  /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
657     variables are global, or local to YYPARSE.  */     variables are global, or local to YYPARSE.  */
# Line 1123  yyerrlab1: Line 1126  yyerrlab1:
1126          YYABORT;          YYABORT;
1127        YYDPRINTF ((stderr, "Discarding token %d (%s).\n",        YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1128                    yychar, yytname[yychar1]));                    yychar, yytname[yychar1]));
1129          yydestructor (yychar1, yylval);
1130        yychar = YYEMPTY;        yychar = YYEMPTY;
1131      }      }
1132    
# Line 1169  yyerrlab1: Line 1173  yyerrlab1:
1173          }          }
1174  #endif  #endif
1175    
1176          yydestructor (yystos[yystate], *yyvsp);
1177        yyvsp--;        yyvsp--;
1178        yystate = *--yyssp;        yystate = *--yyssp;
1179  #if YYLSP_NEEDED  #if YYLSP_NEEDED
# Line 1231  yyreturn: Line 1236  yyreturn:
1236    return yyresult;    return yyresult;
1237  ]}  ]}
1238    
1239    /* Release the memory associated to SYMBOL-NUMBER. */
1240    m4_divert_push([KILL])# M4 code.
1241    # b4_eval
1242    # -------
1243    # FIXME: This is really wrong, we no longer guarantee we don't evaluate
1244    # the user's input.  This demonstrates that decoding actions (BRACED_CODE)
1245    # ought to be done when output, not when read.
1246    m4_define([b4_eval],
1247    [$*])
1248    
1249    # b4_symbol_destructor(SYMBOL-NUMBER, DESTRUCTOR, TYPE-NAME)
1250    # ----------------------------------------------------------
1251    m4_define([b4_symbol_destructor],
1252    [m4_pushdef([b4_dollar_dollar], [symbol_value.$3])dnl
1253          case $1:
1254            b4_eval($2);
1255            break;
1256    m4_popdef([b4_dollar_dollar])])
1257    
1258    m4_divert_pop([KILL])dnl# End of M4 code.
1259    static void
1260    yydestructor (int symbol_type, YYSTYPE symbol_value)
1261    {
1262      switch (symbol_type)
1263        {
1264    m4_map([b4_symbol_destructor], m4_defn([b4_symbol_destructors]))dnl
1265          default:
1266            YYDPRINTF ((stderr, "yydestructor: unknown symbol type: %s\n",
1267                        yytname[[symbol_type]]));
1268            break;
1269        }
1270    }
1271    
1272  b4_epilogue  b4_epilogue
1273  m4_if(b4_defines_flag, 0, [],  m4_if(b4_defines_flag, 0, [],
1274  [#output "b4_output_header_name"  [#output "b4_output_header_name"

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.33

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