/[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.39 by akim, Wed Jun 19 09:07:36 2002 UTC revision 1.40 by akim, Wed Jun 19 10:00:24 2002 UTC
# Line 63  m4_define([b4_rhs_location], Line 63  m4_define([b4_rhs_location],
63    
64    
65    
66    ## -------------- ##
67    ## %pure-parser.  ##
68    ## -------------- ##
69    
70    # b4_pure_if(IF-TRUE, IF-FALSE)
71    # -----------------------------
72    # Expand IF-TRUE, if %pure-parser, IF-FALSE otherwise.
73    m4_define([b4_pure_if],
74    [m4_if(b4_pure, [1],
75           [$1],
76           [$2])])
77    
78    
79  ## ------------------- ##  ## ------------------- ##
80  ## Output file names.  ##  ## Output file names.  ##
81  ## ------------------- ##  ## ------------------- ##
# Line 522  while (0) Line 535  while (0)
535    
536  /* YYLEX -- calling `yylex' with the right arguments.  */  /* YYLEX -- calling `yylex' with the right arguments.  */
537    
538  #if YYPURE  b4_pure_if(
539  # ifdef YYLEX_PARAM  [#ifdef YYLEX_PARAM
540  #  define YYLEX         yylex (&yylval, b4_location_if([&yylloc, ])YYLEX_PARAM)  # define YYLEX  yylex (&yylval, b4_location_if([&yylloc, ])YYLEX_PARAM)
541  # else  #else
542  #  define YYLEX         yylex (&yylval, b4_location_if([&yylloc, ]))  # define YYLEX  yylex (&yylval, b4_location_if([&yylloc, ]))
543  # endif  #endif],
544  #else /* !YYPURE */  [#define YYLEX  yylex ()])
 # define YYLEX          yylex ()  
 #endif /* !YYPURE */  
545    
546  /* Enable debugging if requested.  */  /* Enable debugging if requested.  */
547  #if YYDEBUG  #if YYDEBUG
# Line 658  int yyparse (void); Line 669  int yyparse (void);
669  #endif  #endif
670  static void yydestructor (int symbol_type, YYSTYPE symbol_value);  static void yydestructor (int symbol_type, YYSTYPE symbol_value);
671    
672  /* YY_DECL_VARIABLES -- depending whether we use a pure parser,  m4_divert_push([KILL])# ======================== M4 code.
673     variables are global, or local to YYPARSE.  */  # b4_declare_parser_variables
674    # ---------------------------
675  #define YY_DECL_VARIABLES                               \  # Declare the variables that are global, or local to YYPARSE if
676  /* The lookahead symbol.  */                            \  #  pure-parser
677  int yychar;                                             \  m4_define([b4_declare_parser_variables],
678                                                          \  [/* The lookahead symbol.  */
679  /* The semantic value of the lookahead symbol.  */      \  int yychar;
680  YYSTYPE yylval;                                         \  
681                                                          \  /* The semantic value of the lookahead symbol.  */
682  /* Number of parse errors so far.  */                   \  YYSTYPE yylval;
683  int yynerrs;b4_location_if([                            \  
684  /* Location data for the lookahead symbol.  */          \  /* Number of parse errors so far.  */
685    int yynerrs;b4_location_if([
686    /* Location data for the lookahead symbol.  */
687  YYLTYPE yylloc;])  YYLTYPE yylloc;])
688    ])
689    m4_divert_pop([KILL])dnl# ====================== End of M4 code.
690    
691    b4_pure_if([],
692  /* If nonreentrant, generate the variables here.  */             [b4_declare_parser_variables])
   
 #if !YYPURE  
 YY_DECL_VARIABLES  
 #endif  /* !YYPURE */  
693    
694  int  int
695  yyparse (YYPARSE_PARAM_ARG)  yyparse (YYPARSE_PARAM_ARG)
696       YYPARSE_PARAM_DECL       YYPARSE_PARAM_DECL
697  {[  {[
698    /* If reentrant, generate the variables here.  */    ]b4_pure_if([b4_declare_parser_variables])[
 #if YYPURE  
   YY_DECL_VARIABLES  
 #endif  /* !YYPURE */  
   
699    register int yystate;    register int yystate;
700    register int yyn;    register int yyn;
701    int yyresult;    int yyresult;
# Line 1284  typedef union b4_stype yystype; Line 1291  typedef union b4_stype yystype;
1291  # define YYSTYPE yystype  # define YYSTYPE yystype
1292  #endif  #endif
1293    
1294  m4_if(b4_pure, [0],  b4_pure_if([],
1295  [extern YYSTYPE b4_prefix[]lval;])  [extern YYSTYPE b4_prefix[]lval;])
1296    
1297  b4_location_if(  b4_location_if(

Legend:
Removed from v.1.39  
changed lines
  Added in v.1.40

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