/[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.24 by akim, Sun Oct 20 11:20:15 2002 UTC revision 1.25 by akim, Sun Oct 20 12:51:10 2002 UTC
# Line 40  m4_dquote(b4_pure_if([[[[YYSTYPE *]], [[ Line 40  m4_dquote(b4_pure_if([[[[YYSTYPE *]], [[
40  b4_location_if([, [[YYLTYPE *], [&yylloc]]])])dnl  b4_location_if([, [[YYLTYPE *], [&yylloc]]])])dnl
41  m4_ifdef([b4_lex_param], [, ]b4_lex_param)))  m4_ifdef([b4_lex_param], [, ]b4_lex_param)))
42    
43    # Yes, this is quite ugly...
44    m4_define_default([b4_parse_param])
45    m4_ifdef([b4_parse_param],
46    [m4_define([b4_parse_param],
47               b4_parse_param)])
48    
49    
50  ## ----------------- ##  ## ----------------- ##
51  ## Semantic Values.  ##  ## Semantic Values.  ##
# Line 625  yystpcpy (yydest, yysrc) Line 631  yystpcpy (yydest, yysrc)
631  | Print this symbol on YYOUT.  |  | Print this symbol on YYOUT.  |
632  `-----------------------------*/  `-----------------------------*/
633    
634  b4_c_function([yysymprint],  b4_c_function_def([yysymprint],
635                [static void],                    [static void],
636                [[FILE*],   [yyout]],                    [[FILE *yyout],        [yyout]],
637                [[int],     [yytype]],                    [[int yytype],         [yytype]],
638                [[YYSTYPE], [yyvalue]]b4_location_if([,                    [[YYSTYPE yyvalue],    [yyvalue]]b4_location_if([,
639                [[YYLTYPE], [yylocation]]]))                    [[YYLTYPE yylocation], [yylocation]]]))
640  {  {
641    /* Pacify ``unused variable'' warnings.  */    /* Pacify ``unused variable'' warnings.  */
642    (void) yyvalue;    (void) yyvalue;
# Line 662  m4_map([b4_symbol_actions], m4_defn([b4_ Line 668  m4_map([b4_symbol_actions], m4_defn([b4_
668  | Release the memory associated to this symbol.  |  | Release the memory associated to this symbol.  |
669  `-----------------------------------------------*/  `-----------------------------------------------*/
670    
671  b4_c_function([yydestruct],  b4_c_function_def([yydestruct],
672                [static void],                    [static void],
673                [[int],     [yytype]],                    [[int yytype],         [yytype]],
674                [[YYSTYPE], [yyvalue]]b4_location_if([,                    [[YYSTYPE yyvalue],    [yyvalue]]b4_location_if([,
675                [[YYLTYPE], [yylocation]]]))                    [[YYLTYPE yylocation], [yylocation]]]))
676  {  {
677    /* Pacify ``unused variable'' warnings.  */    /* Pacify ``unused variable'' warnings.  */
678    (void) yyvalue;    (void) yyvalue;
# Line 683  m4_map([b4_symbol_actions], m4_defn([b4_ Line 689  m4_map([b4_symbol_actions], m4_defn([b4_
689    
690    
691    
692  /* The user can define YYPARSE_PARAM as the name of an argument to be passed  /* Prevent warnings from -Wmissing-prototypes.  */
    into yyparse.  The argument should have type void *.  
    It should actually point to an object.  
    Grammar actions can access the variable by casting it  
    to the proper pointer type.  */  
693    
694  #ifdef YYPARSE_PARAM  #ifdef YYPARSE_PARAM
695  # if defined (__STDC__) || defined (__cplusplus)  # if defined (__STDC__) || defined (__cplusplus)
696  #  define YYPARSE_PARAM_ARG void *YYPARSE_PARAM  int yyparse (void *YYPARSE_PARAM);
 #  define YYPARSE_PARAM_DECL  
 # else  
 #  define YYPARSE_PARAM_ARG YYPARSE_PARAM  
 #  define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;  
 # endif  
 #else /* !YYPARSE_PARAM */  
 # define YYPARSE_PARAM_ARG  
 # define YYPARSE_PARAM_DECL  
 #endif /* !YYPARSE_PARAM */  
   
 /* Prevent warning if -Wstrict-prototypes.  */  
 #ifdef __GNUC__  
 # ifdef YYPARSE_PARAM  
 int yyparse (void *);  
697  # else  # else
698  int yyparse (void);  int yyparse ();
699  # endif  # endif
700    #else /* ! YYPARSE_PARAM */
701    b4_c_function_decl([yyparse], [int], b4_parse_param)
702  #endif  #endif
703    
704    
705  m4_divert_push([KILL])# ======================== M4 code.  m4_divert_push([KILL])# ======================== M4 code.
706  # b4_declare_parser_variables  # b4_declare_parser_variables
707  # ---------------------------  # ---------------------------
708  # Declare the variables that are global, or local to YYPARSE if  # Declare the variables that are global, or local to YYPARSE if
709  #  pure-parser  # pure-parser.
710  m4_define([b4_declare_parser_variables],  m4_define([b4_declare_parser_variables],
711  [/* The lookahead symbol.  */  [/* The lookahead symbol.  */
712  int yychar;  int yychar;
# Line 733  m4_divert_pop([KILL])dnl# ============== Line 724  m4_divert_pop([KILL])dnl# ==============
724  b4_pure_if([],  b4_pure_if([],
725             [b4_declare_parser_variables])             [b4_declare_parser_variables])
726    
727  int  
728  yyparse (YYPARSE_PARAM_ARG)  /*----------.
729       YYPARSE_PARAM_DECL  | yyparse.  |
730    `----------*/
731    
732    #ifdef YYPARSE_PARAM
733    # if defined (__STDC__) || defined (__cplusplus)
734    int yyparse (void *YYPARSE_PARAM)
735    # else
736    int yyparse (YYPARSE_PARAM)
737      void *YYPARSE_PARAM;
738    # endif
739    #else /* ! YYPARSE_PARAM */
740    b4_c_function_def([yyparse], [int], b4_parse_param)
741    #endif
742  {[  {[
743    ]b4_pure_if([b4_declare_parser_variables])[    ]b4_pure_if([b4_declare_parser_variables])[
744    register int yystate;    register int yystate;

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25

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