diff options
author | Andy Lester <andy@petdance.com> | 2005-04-13 05:06:47 -0500 |
---|---|---|
committer | H.Merijn Brand <h.m.brand@xs4all.nl> | 2005-04-13 15:10:24 +0000 |
commit | df35152e63ab1003da75eded38490691ff18b6c6 (patch) | |
tree | 75e6383360cd19ebff910d919947073966f1403e /perly.c | |
parent | 3f8312b9451dad9a3b0a4e9004015177ef82fbb7 (diff) | |
download | perl-df35152e63ab1003da75eded38490691ff18b6c6.tar.gz |
Removing yydestruct from perly.c
Message-ID: <20050413150647.GA13464@petdance.com>
p4raw-id: //depot/perl@24236
Diffstat (limited to 'perly.c')
-rw-r--r-- | perly.c | 42 |
1 files changed, 6 insertions, 36 deletions
@@ -109,11 +109,8 @@ do { \ `--------------------------------*/ static void -yysymprint (pTHX_ PerlIO *yyoutput, int yytype, YYSTYPE *yyvaluep) +yysymprint (pTHX_ PerlIO *yyoutput, int yytype, const YYSTYPE *yyvaluep) { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - if (yytype < YYNTOKENS) { YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); # ifdef YYPRINT @@ -125,10 +122,6 @@ yysymprint (pTHX_ PerlIO *yyoutput, int yytype, YYSTYPE *yyvaluep) else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - switch (yytype) { - default: - break; - } YYFPRINTF (yyoutput, ")"); } @@ -138,7 +131,7 @@ yysymprint (pTHX_ PerlIO *yyoutput, int yytype, YYSTYPE *yyvaluep) * meanings as the local vars in yyparse() of the same name */ static void -yy_stack_print (pTHX_ short *yyss, short *yyssp, YYSTYPE *yyvs, const char**yyns) +yy_stack_print (pTHX_ const short *yyss, const short *yyssp, const YYSTYPE *yyvs, const char**yyns) { int i; int start = 1; @@ -179,7 +172,7 @@ static void yy_reduce_print (pTHX_ int yyrule) { int yyi; - unsigned int yylineno = yyrline[yyrule]; + const unsigned int yylineno = yyrline[yyrule]; YYFPRINTF (Perl_debug_log, "Reducing stack by rule %d (line %u), ", yyrule - 1, yylineno); /* Print the symbols being reduced, and their result. */ @@ -250,26 +243,6 @@ yystpcpy (pTHX_ char *yydest, const char *yysrc) #endif /* !YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -static void -yydestruct (int yytype, YYSTYPE *yyvaluep) -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - switch (yytype) { - default: - break; - } -} - - - - /*----------. | yyparse. | `----------*/ @@ -378,7 +351,7 @@ Perl_yyparse (pTHX) if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; + const YYSIZE_T yysize = yyssp - yyss + 1; /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) @@ -579,7 +552,7 @@ Perl_yyparse (pTHX) if (YYPACT_NINF < yyn && yyn < YYLAST) { YYSIZE_T yysize = 0; - int yytype = YYTRANSLATE (yychar); + const int yytype = YYTRANSLATE (yychar); char *yymsg; int yyx, yycount; @@ -594,7 +567,7 @@ Perl_yyparse (pTHX) yysize += yystrlen (yytname[yytype]); New(yymsg, yysize, char *); if (yymsg != 0) { - char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); + const char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); yyp = yystpcpy (yyp, yytname[yytype]); if (yycount < 5) { @@ -635,14 +608,12 @@ Perl_yyparse (pTHX) /* Pop the rest of the stack. */ while (yyss < yyssp) { YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp); - yydestruct (yystos[*yyssp], yyvsp); YYPOPSTACK; } YYABORT; } YYDSYMPRINTF ("Error: discarding", yytoken, &yylval); - yydestruct (yytoken, &yylval); yychar = YYEMPTY; } @@ -674,7 +645,6 @@ Perl_yyparse (pTHX) YYABORT; YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp); - yydestruct (yystos[yystate], yyvsp); yyvsp--; #ifdef DEBUGGING yynsp--; |