/[bison]/bison/data/yacc.c
ViewVC logotype

Diff of /bison/data/yacc.c

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

revision 1.30 by akim, Thu Nov 7 12:52:19 2002 UTC revision 1.31 by eggert, Tue Nov 12 07:22:01 2002 UTC
# Line 39  m4_define_default([b4_location_type], [y Line 39  m4_define_default([b4_location_type], [y
39  ## ------------------------ ##  ## ------------------------ ##
40    
41    
42  # b4_Pure_if(IF-TRUE, IF-FALSE)  # b4_pure_if(IF-TRUE, IF-FALSE)
43  # -----------------------------  # -----------------------------
44  # Expand IF-TRUE, if %pure-parser and %parse-param, IF-FALSE otherwise.  # Expand IF-TRUE, if %pure-parser and %parse-param, IF-FALSE otherwise.
45  m4_define([b4_Pure_if],  m4_define([b4_Pure_if],
# Line 105  m4_define([b4_lhs_value], Line 105  m4_define([b4_lhs_value],
105  # Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH  # Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
106  # symbols on RHS.  # symbols on RHS.
107  m4_define([b4_rhs_value],  m4_define([b4_rhs_value],
108  [yyvsp@<:@m4_eval([$2 - $1])@:>@m4_ifval([$3], [.$3])])  [yyvsp@{m4_eval([$2 - $1])@}m4_ifval([$3], [.$3])])
109    
110    
111    
# Line 125  m4_define([b4_lhs_location], Line 125  m4_define([b4_lhs_location],
125  # Expansion of @NUM, where the current rule has RULE-LENGTH symbols  # Expansion of @NUM, where the current rule has RULE-LENGTH symbols
126  # on RHS.  # on RHS.
127  m4_define([b4_rhs_location],  m4_define([b4_rhs_location],
128  [yylsp@<:@m4_eval([$2 - $1])@:>@])  [yylsp@{m4_eval([$2 - $1])@}])
   
   
   
 ## ------------------- ##  
 ## Output file names.  ##  
 ## ------------------- ##  
   
 m4_define_default([b4_input_suffix], [.y])  
   
 m4_define_default([b4_output_parser_suffix],  
 [m4_translit(b4_input_suffix, [yY], [cC])])  
   
 m4_define_default([b4_output_parser_name],  
 [b4_output_prefix[]b4_output_infix[]b4_output_parser_suffix[]])  
   
   
 m4_define_default([b4_output_header_suffix],  
 [m4_translit(b4_input_suffix, [yY], [hH])])  
   
 m4_define_default([b4_output_header_name],  
 [b4_output_prefix[]b4_output_infix[]b4_output_header_suffix[]])  
   
 m4_define_default([b4_header_guard],  
                   [m4_bpatsubst(m4_toupper([BISON_]b4_output_header_name),  
                                 [[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]], [_])])  
129    
130    
131    
# Line 168  m4_pushdef([b4_at_dollar], [yylocation]) Line 143  m4_pushdef([b4_at_dollar], [yylocation])
143        case $4: /* $3 */        case $4: /* $3 */
144  b4_syncline([$2], [$1])  b4_syncline([$2], [$1])
145          $5;          $5;
146  b4_syncline([__oline__], [__ofile__])  b4_syncline([@oline@], [@ofile@])
147          break;          break;
148  m4_popdef([b4_at_dollar])dnl  m4_popdef([b4_at_dollar])dnl
149  m4_popdef([b4_dollar_dollar])dnl  m4_popdef([b4_dollar_dollar])dnl
# Line 178  m4_popdef([b4_dollar_dollar])dnl Line 153  m4_popdef([b4_dollar_dollar])dnl
153  # We do want M4 expansion after # for CPP macros.  # We do want M4 expansion after # for CPP macros.
154  m4_changecom()  m4_changecom()
155  m4_divert(0)dnl  m4_divert(0)dnl
156  #output "b4_output_parser_name"  @output @output_parser_name@
157  b4_copyright([Skeleton parser for Yacc-like parsing with Bison],  b4_copyright([Skeleton parser for Yacc-like parsing with Bison],
158               [1984, 1989, 1990, 2000, 2001, 2002])               [1984, 1989, 1990, 2000, 2001, 2002])
159    
# Line 233  m4_ifdef([b4_stype], Line 208  m4_ifdef([b4_stype],
208  [b4_syncline([b4_stype_line], [b4_filename])  [b4_syncline([b4_stype_line], [b4_filename])
209  typedef union b4_stype yystype;  typedef union b4_stype yystype;
210  /* Line __line__ of __file__.  */  /* Line __line__ of __file__.  */
211  b4_syncline([__oline__], [__ofile__])],  b4_syncline([@oline@], [@ofile@])],
212  [typedef int yystype;])  [typedef int yystype;])
213  # define YYSTYPE yystype  # define YYSTYPE yystype
214  # define YYSTYPE_IS_TRIVIAL 1  # define YYSTYPE_IS_TRIVIAL 1
# Line 255  typedef struct yyltype Line 230  typedef struct yyltype
230  b4_post_prologue  b4_post_prologue
231    
232  /* Line __line__ of __file__.  */  /* Line __line__ of __file__.  */
233  b4_syncline([__oline__], [__ofile__])  b4_syncline([@oline@], [@ofile@])
234    
235  #if ! defined (yyoverflow) || YYERROR_VERBOSE  #if ! defined (yyoverflow) || YYERROR_VERBOSE
236    
# Line 1054  yyreduce: Line 1029  yyreduce:
1029      }      }
1030    
1031  /* Line __line__ of __file__.  */  /* Line __line__ of __file__.  */
1032  b4_syncline([__oline__], [__ofile__])  b4_syncline([@oline@], [@ofile@])
1033    
1034  [  yyvsp -= yylen;  [  yyvsp -= yylen;
1035    yyssp -= yylen;    yyssp -= yylen;
# Line 1275  yyreturn: Line 1250  yyreturn:
1250    
1251  b4_epilogue  b4_epilogue
1252  m4_if(b4_defines_flag, 0, [],  m4_if(b4_defines_flag, 0, [],
1253  [#output "b4_output_header_name"  [@output @output_header_name@
1254  b4_copyright([Skeleton parser for Yacc-like parsing with Bison],  b4_copyright([Skeleton parser for Yacc-like parsing with Bison],
1255               [1984, 1989, 1990, 2000, 2001, 2002])               [1984, 1989, 1990, 2000, 2001, 2002])
1256    
# Line 1284  b4_copyright([Skeleton parser for Yacc-l Line 1259  b4_copyright([Skeleton parser for Yacc-l
1259     This special exception was added by the Free Software Foundation     This special exception was added by the Free Software Foundation
1260     in version 1.24 of Bison.  */     in version 1.24 of Bison.  */
1261    
 #ifndef b4_header_guard  
 # define b4_header_guard  
   
1262  b4_token_defines(b4_tokens)  b4_token_defines(b4_tokens)
1263    
1264  #ifndef YYSTYPE  #ifndef YYSTYPE
# Line 1294  m4_ifdef([b4_stype], Line 1266  m4_ifdef([b4_stype],
1266  [b4_syncline([b4_stype_line], [b4_filename])  [b4_syncline([b4_stype_line], [b4_filename])
1267  typedef union b4_stype yystype;  typedef union b4_stype yystype;
1268  /* Line __line__ of __file__.  */  /* Line __line__ of __file__.  */
1269  b4_syncline([__oline__], [__ofile__])],  b4_syncline([@oline@], [@ofile@])],
1270  [typedef int yystype;])  [typedef int yystype;])
1271  # define YYSTYPE yystype  # define YYSTYPE yystype
1272    # define YYSTYPE_IS_TRIVIAL 1
1273  #endif  #endif
1274    
1275  b4_pure_if([],  b4_pure_if([],
# Line 1317  typedef struct yyltype Line 1290  typedef struct yyltype
1290  m4_if(b4_pure, [0],  m4_if(b4_pure, [0],
1291  [extern YYLTYPE b4_prefix[]lloc;])  [extern YYLTYPE b4_prefix[]lloc;])
1292  ])  ])
 #endif /* not b4_header_guard */  
1293  ])  ])

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.31

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