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

Diff of /bison/src/bison.simple

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

revision 1.71 by akim, Mon Nov 12 09:24:14 2001 UTC revision 1.72 by akim, Mon Nov 12 09:24:50 2001 UTC
# Line 102  Line 102 
102  # define YYSTACK_USE_ALLOCA 0  # define YYSTACK_USE_ALLOCA 0
103  #endif  #endif
104    
105    /* Realloc WHAT from SIZE to YYSTACKSIZE elements of TYPE.
106       If WHAT was malloc'ed (not the original automatic ARRAY), free it. */
107  #if YYSTACK_USE_ALLOCA  #if YYSTACK_USE_ALLOCA
108  # define YYSTACK_ALLOC alloca  # define YYSTACK_REALLOC(Type, What, Array)                             \
109    do {                                                                    \
110      Type *old = What;                                                     \
111      What = (Type *) malloc (yystacksize * sizeof (Type));                 \
112      __yy_memcpy ((char *) What, (char *) old,                             \
113                   (size) * (unsigned int) sizeof (Type));                  \
114      yyfree_stacks = 1;                                                    \
115      if (old != Array)                                                     \
116        free (old);                                                         \
117    } while (0)
118  #else  #else
119  # define YYSTACK_ALLOC malloc  # define YYSTACK_REALLOC(Type, What, Array)                             \
120    do {                                                                    \
121      Type *old = What;                                                     \
122      What = (Type *) alloca (yystacksize * sizeof (Type));                 \
123      __yy_memcpy ((char *) What, (char *) old,                             \
124                   (size) * (unsigned int) sizeof (Type));                  \
125    } while (0)
126  #endif  #endif
127    
128  #define YYBISON 1       /* Identify Bison output.  */  #define YYBISON 1       /* Identify Bison output.  */
# Line 452  yyparse (YYPARSE_PARAM_ARG) Line 469  yyparse (YYPARSE_PARAM_ARG)
469    
470    /* Three stacks and their tools:    /* Three stacks and their tools:
471       `yyss': related to states,       `yyss': related to states,
472       `yysv': related to semantic values,       `yyvs': related to semantic values,
473       `yyls': related to locations.       `yyls': related to locations.
474    
475       Refer to the stacks thru separate pointers, to allow yyoverflow       Refer to the stacks thru separate pointers, to allow yyoverflow
# Line 580  yyparse (YYPARSE_PARAM_ARG) Line 597  yyparse (YYPARSE_PARAM_ARG)
597        yystacksize *= 2;        yystacksize *= 2;
598        if (yystacksize > YYMAXDEPTH)        if (yystacksize > YYMAXDEPTH)
599          yystacksize = YYMAXDEPTH;          yystacksize = YYMAXDEPTH;
600  # if !YYSTACK_USE_ALLOCA  
601        yyfree_stacks = 1;        YYSTACK_REALLOC (short, yyss, yyssa);
602  # endif        YYSTACK_REALLOC (YYSTYPE, yyvs, yyvsa);
       yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));  
       __yy_memcpy ((char *)yyss, (char *)yyss1,  
                    size * (unsigned int) sizeof (*yyssp));  
       yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));  
       __yy_memcpy ((char *)yyvs, (char *)yyvs1,  
                    size * (unsigned int) sizeof (*yyvsp));  
603  # if YYLSP_NEEDED  # if YYLSP_NEEDED
604        yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));        YYSTACK_REALLOC (YYLTYPE, yyls, yylsa);
       __yy_memcpy ((char *)yyls, (char *)yyls1,  
                    size * (unsigned int) sizeof (*yylsp));  
605  # endif  # endif
606  #endif /* no yyoverflow */  #endif /* no yyoverflow */
607    

Legend:
Removed from v.1.71  
changed lines
  Added in v.1.72

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