/[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.46 by akim, Thu Jun 20 11:28:33 2002 UTC revision 1.47 by akim, Thu Jun 20 11:46:59 2002 UTC
# Line 143  m4_map([b4_token_define], [$@]) Line 143  m4_map([b4_token_define], [$@])
143  ])  ])
144    
145    
146    ## --------------------------------------------------------- ##
147    ## Defining symbol actions, e.g., printers and destructors.  ##
148    ## --------------------------------------------------------- ##
149    
150    # b4_symbol_actions(FILENAME, LINENO,
151    #                   SYMBOL-TAG, SYMBOL-NUM,
152    #                   SYMBOL-ACTION, SYMBOL-TYPENAME)
153    # -------------------------------------------------
154    m4_define([b4_symbol_actions],
155    [m4_pushdef([b4_dollar_dollar], [yyvalue.$6])dnl
156    m4_pushdef([b4_at_dollar], [yylocation])dnl
157          case $4: /* $3 */
158    #line $2 "$1"
159            $5;
160    #line __oline__ "__ofile__"
161            break;
162    m4_popdef([b4_at_dollar])dnl
163    m4_popdef([b4_dollar_dollar])dnl
164    ])
165    
166    
167    
168  m4_divert(0)dnl  m4_divert(0)dnl
169  #output "b4_output_parser_name"  #output "b4_output_parser_name"
170  /* A Bison parser, made from b4_filename  /* A Bison parser, made from b4_filename
# Line 1221  yyreturn: Line 1243  yyreturn:
1243  | Release the memory associated to this symbol.  |  | Release the memory associated to this symbol.  |
1244  `-----------------------------------------------*/  `-----------------------------------------------*/
1245    
 m4_divert_push([KILL])# M4 code.  
 # b4_symbol_destructor(SYMBOL-NUMBER, DESTRUCTOR, TYPE-NAME)  
 # ----------------------------------------------------------  
 m4_define([b4_symbol_destructor],  
 [m4_pushdef([b4_dollar_dollar], [yyvalue.$6])dnl  
 m4_pushdef([b4_at_dollar], [yylocation])dnl  
       case $4: /* $3 */  
 #line $2 "$1"  
         $5;  
 #line __oline__ "__ofile__"  
         break;  
 m4_popdef([b4_at_dollar])dnl  
 m4_popdef([b4_dollar_dollar])])  
   
 m4_divert_pop([KILL])dnl# End of M4 code.  
1246  static void  static void
1247  yydestruct (int yytype,  yydestruct (int yytype,
1248              YYSTYPE yyvalue[]b4_location_if([, YYLTYPE yylocation]))              YYSTYPE yyvalue[]b4_location_if([, YYLTYPE yylocation]))
1249  {  {
1250    switch (yytype)    switch (yytype)
1251      {      {
1252  m4_map([b4_symbol_destructor], m4_defn([b4_symbol_destructors]))dnl  m4_map([b4_symbol_actions], m4_defn([b4_symbol_destructors]))dnl
1253        default:        default:
1254          break;          break;
1255      }      }
# Line 1254  m4_map([b4_symbol_destructor], m4_defn([ Line 1261  m4_map([b4_symbol_destructor], m4_defn([
1261  | Print this symbol on YYOUT.  |  | Print this symbol on YYOUT.  |
1262  `-----------------------------*/  `-----------------------------*/
1263    
 m4_divert_push([KILL])# M4 code.  
 # b4_symbol_printer(SYMBOL-NUMBER, PRINTER, TYPE-NAME)  
 # ----------------------------------------------------------  
 m4_define([b4_symbol_printer],  
 [m4_pushdef([b4_dollar_dollar], [yyvalue.$6])dnl  
 m4_pushdef([b4_at_dollar], [yylocation])dnl  
       case $4: /* $3 */  
 #line $2 "$1"  
         $5;  
 #line __oline__ "__ofile__"  
         break;  
 m4_popdef([b4_at_dollar])dnl  
 m4_popdef([b4_dollar_dollar])])  
   
 m4_divert_pop([KILL])dnl# End of M4 code.  
1264  static void  static void
1265  yysymprint (FILE* yyout, int yytype,  yysymprint (FILE* yyout, int yytype,
1266              YYSTYPE yyvalue[]b4_location_if([, YYLTYPE yylocation]))              YYSTYPE yyvalue[]b4_location_if([, YYLTYPE yylocation]))
1267  {  {
1268    if (yytype < YYNTOKENS)    if (yytype < YYNTOKENS)
1269      YYFPRINTF (yyout, "token %s (", yytname[[yytype]]);      {
1270          YYFPRINTF (yyout, "token %s (", yytname[[yytype]]);
1271    # ifdef YYPRINT
1272          YYPRINT (yyout, yytoknum[[yytype]], yyvalue);
1273    # endif
1274        }
1275    else    else
1276      YYFPRINTF (yyout, "nterm %s (", yytname[[yytype]]);      YYFPRINTF (yyout, "nterm %s (", yytname[[yytype]]);
1277  # ifdef YYPRINT  
   YYPRINT (yyout, yytype, yyvalue);  
 # else  
1278    switch (yytype)    switch (yytype)
1279      {      {
1280  m4_map([b4_symbol_printer], m4_defn([b4_symbol_printers]))dnl  m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
1281        default:        default:
1282          break;          break;
1283      }      }
 # endif /* !defined YYPRINT. */  
1284    YYFPRINTF (yyout, ")");    YYFPRINTF (yyout, ")");
1285  }  }
1286  #endif /* YYDEBUG. */  #endif /* YYDEBUG. */

Legend:
Removed from v.1.46  
changed lines
  Added in v.1.47

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