This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
yyparse(): only check stack size in outer loop
[perl5.git] / perly.c
CommitLineData
0de566d7
DM
1/* perly.c
2 *
2eee27d7
SS
3 * Copyright (c) 2004, 2005, 2006, 2007, 2008,
4 * 2009, 2010, 2011 by Larry Wall and others
0de566d7
DM
5 *
6 * You may distribute under the terms of either the GNU General Public
7 * License or the Artistic License, as specified in the README file.
8 *
9 * Note that this file was originally generated as an output from
10 * GNU bison version 1.875, but now the code is statically maintained
f05e27e5
DM
11 * and edited; the bits that are dependent on perly.y are now
12 * #included from the files perly.tab and perly.act.
0de566d7
DM
13 *
14 * Here is an important copyright statement from the original, generated
15 * file:
16 *
17 * As a special exception, when this file is copied by Bison into a
18 * Bison output file, you may use that output file without
19 * restriction. This special exception was added by the Free
20 * Software Foundation in version 1.24 of Bison.
bc463c31 21 *
0de566d7
DM
22 */
23
79072805 24#include "EXTERN.h"
864dbfa3 25#define PERL_IN_PERLY_C
79072805 26#include "perl.h"
30d9c59b 27#include "feature.h"
d3d9da4a 28#include "keywords.h"
09bef843 29
3797f23d
DM
30typedef unsigned char yytype_uint8;
31typedef signed char yytype_int8;
32typedef unsigned short int yytype_uint16;
33typedef short int yytype_int16;
0de566d7
DM
34typedef signed char yysigned_char;
35
28ac2b49
Z
36/* YYINITDEPTH -- initial size of the parser's stacks. */
37#define YYINITDEPTH 200
38
599f1ac6
FC
39#ifdef YYDEBUG
40# undef YYDEBUG
41#endif
42#ifdef DEBUGGING
43# define YYDEBUG 1
44#else
45# define YYDEBUG 0
46#endif
47
b3045d9c
FC
48#ifndef YY_NULL
49# define YY_NULL 0
93a17b20 50#endif
09bef843 51
f39ff1f3
DM
52#ifndef YY_NULLPTR
53# define YY_NULLPTR NULL
54#endif
55
f05e27e5
DM
56/* contains all the parser state tables; auto-generated from perly.y */
57#include "perly.tab"
0de566d7
DM
58
59# define YYSIZE_T size_t
60
b2c9b6ee
DM
61/* the max number of RHS shifted elements that can make up a rule.
62 * This should really be auto-generated from the max value in yyr2[]
63 * but that involves extra work, so set it slightly higher than the
64 * current max, and assert each time yyr2[] is accessed.
65 * Used to determine if the parse stack needs extending.
66 */
67
68#define YY_MAXRULE 15
69
0de566d7 70#define YYEOF 0
07a06489 71#define YYTERROR 1
0de566d7
DM
72
73#define YYACCEPT goto yyacceptlab
74#define YYABORT goto yyabortlab
75#define YYERROR goto yyerrlab1
76
0de566d7 77/* Enable debugging if requested. */
9388183f 78#ifdef DEBUGGING
0de566d7
DM
79
80# define yydebug (DEBUG_p_TEST)
81
82# define YYFPRINTF PerlIO_printf
83
84# define YYDPRINTF(Args) \
85do { \
86 if (yydebug) \
87 YYFPRINTF Args; \
88} while (0)
89
9388183f 90# define YYDSYMPRINTF(Title, Token, Value) \
0de566d7
DM
91do { \
92 if (yydebug) { \
93 YYFPRINTF (Perl_debug_log, "%s ", Title); \
356f4fed 94 yysymprint (aTHX_ Perl_debug_log, Token, Value); \
0de566d7
DM
95 YYFPRINTF (Perl_debug_log, "\n"); \
96 } \
97} while (0)
98
99/*--------------------------------.
100| Print this symbol on YYOUTPUT. |
101`--------------------------------*/
102
103static void
356f4fed 104yysymprint(pTHX_ PerlIO * const yyoutput, int yytype, const YYSTYPE * const yyvaluep)
0de566d7 105{
dc3bf405 106 PERL_UNUSED_CONTEXT;
0de566d7
DM
107 if (yytype < YYNTOKENS) {
108 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
109# ifdef YYPRINT
110 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
9388183f 111# else
147e3846 112 YYFPRINTF (yyoutput, "0x%" UVxf, (UV)yyvaluep->ival);
0de566d7
DM
113# endif
114 }
115 else
116 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
117
0de566d7
DM
118 YYFPRINTF (yyoutput, ")");
119}
120
121
9388183f 122/* yy_stack_print()
1654d593
DM
123 * print the top 8 items on the parse stack.
124 */
0de566d7
DM
125
126static void
1654d593 127yy_stack_print (pTHX_ const yy_parser *parser)
0de566d7 128{
1654d593 129 const yy_stack_frame *ps, *min;
9388183f 130
2d29f438 131 min = parser->ps - 8 + 1;
22735491
DM
132 if (min <= parser->stack)
133 min = parser->stack + 1;
9388183f
CB
134
135 PerlIO_printf(Perl_debug_log, "\nindex:");
1654d593 136 for (ps = min; ps <= parser->ps; ps++)
00c0e1ee 137 PerlIO_printf(Perl_debug_log, " %8d", (int)(ps - parser->stack));
1654d593 138
9388183f 139 PerlIO_printf(Perl_debug_log, "\nstate:");
1654d593
DM
140 for (ps = min; ps <= parser->ps; ps++)
141 PerlIO_printf(Perl_debug_log, " %8d", ps->state);
142
9388183f 143 PerlIO_printf(Perl_debug_log, "\ntoken:");
1654d593
DM
144 for (ps = min; ps <= parser->ps; ps++)
145 PerlIO_printf(Perl_debug_log, " %8.8s", ps->name);
146
9388183f 147 PerlIO_printf(Perl_debug_log, "\nvalue:");
1654d593
DM
148 for (ps = min; ps <= parser->ps; ps++) {
149 switch (yy_type_tab[yystos[ps->state]]) {
d5c6462e 150 case toketype_opval:
21612876 151 PerlIO_printf(Perl_debug_log, " %8.8s",
1654d593
DM
152 ps->val.opval
153 ? PL_op_name[ps->val.opval->op_type]
670f3923 154 : "(Nullop)"
21612876 155 );
d5c6462e 156 break;
d5c6462e 157 case toketype_ival:
147e3846 158 PerlIO_printf(Perl_debug_log, " %8" IVdf, (IV)ps->val.ival);
d5c6462e
DM
159 break;
160 default:
147e3846 161 PerlIO_printf(Perl_debug_log, " %8" UVxf, (UV)ps->val.ival);
d5c6462e 162 }
21612876 163 }
9388183f 164 PerlIO_printf(Perl_debug_log, "\n\n");
0de566d7
DM
165}
166
1654d593
DM
167# define YY_STACK_PRINT(parser) \
168do { \
169 if (yydebug && DEBUG_v_TEST) \
170 yy_stack_print (aTHX_ parser); \
0de566d7
DM
171} while (0)
172
09bef843 173
0de566d7
DM
174/*------------------------------------------------.
175| Report that the YYRULE is going to be reduced. |
176`------------------------------------------------*/
177
178static void
179yy_reduce_print (pTHX_ int yyrule)
180{
181 int yyi;
df35152e 182 const unsigned int yylineno = yyrline[yyrule];
0de566d7
DM
183 YYFPRINTF (Perl_debug_log, "Reducing stack by rule %d (line %u), ",
184 yyrule - 1, yylineno);
185 /* Print the symbols being reduced, and their result. */
f39ff1f3
DM
186#if PERL_BISON_VERSION >= 30000 /* 3.0+ */
187 for (yyi = 0; yyi < yyr2[yyrule]; yyi++)
188 YYFPRINTF (Perl_debug_log, "%s ",
189 yytname [yystos[(PL_parser->ps)[yyi + 1 - yyr2[yyrule]].state]]);
190#else
0de566d7
DM
191 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
192 YYFPRINTF (Perl_debug_log, "%s ", yytname [yyrhs[yyi]]);
f39ff1f3 193#endif
0de566d7
DM
194 YYFPRINTF (Perl_debug_log, "-> %s\n", yytname [yyr1[yyrule]]);
195}
196
197# define YY_REDUCE_PRINT(Rule) \
198do { \
199 if (yydebug) \
200 yy_reduce_print (aTHX_ Rule); \
201} while (0)
202
203#else /* !DEBUGGING */
204# define YYDPRINTF(Args)
9388183f 205# define YYDSYMPRINTF(Title, Token, Value)
1654d593 206# define YY_STACK_PRINT(parser)
0de566d7
DM
207# define YY_REDUCE_PRINT(Rule)
208#endif /* !DEBUGGING */
209
718a7425
DM
210/* called during cleanup (via SAVEDESTRUCTOR_X) to free any items on the
211 * parse stack, thus avoiding leaks if we die */
212
213static void
22735491 214S_clear_yystack(pTHX_ const yy_parser *parser)
718a7425 215{
1654d593 216 yy_stack_frame *ps = parser->ps;
0934c9d9 217 int i = 0;
718a7425 218
28ac2b49 219 if (!parser->stack)
718a7425 220 return;
1654d593 221
718a7425 222 YYDPRINTF ((Perl_debug_log, "clearing the parse stack\n"));
670f3923 223
8c63ea58
GG
224 for (i=0; i< parser->yylen; i++) {
225 SvREFCNT_dec(ps[-i].compcv);
226 }
0aded6e1 227 ps -= parser->yylen;
670f3923
DM
228
229 /* now free whole the stack, including the just-reduced ops */
230
22735491 231 while (ps > parser->stack) {
503de470 232 LEAVE_SCOPE(ps->savestack_ix);
1654d593
DM
233 if (yy_type_tab[yystos[ps->state]] == toketype_opval
234 && ps->val.opval)
670f3923 235 {
a293d0fd 236 if (ps->compcv && (ps->compcv != PL_compcv)) {
8c63ea58
GG
237 PL_compcv = ps->compcv;
238 PAD_SET_CUR_NOSAVE(CvPADLIST(PL_compcv), 1);
325e1816 239 PL_comppad_name = PadlistNAMES(CvPADLIST(PL_compcv));
718a7425
DM
240 }
241 YYDPRINTF ((Perl_debug_log, "(freeing op)\n"));
571a568a 242 op_free(ps->val.opval);
718a7425 243 }
8c63ea58 244 SvREFCNT_dec(ps->compcv);
1654d593 245 ps--;
718a7425 246 }
28ac2b49
Z
247
248 Safefree(parser->stack);
718a7425
DM
249}
250
718a7425 251
0de566d7
DM
252/*----------.
253| yyparse. |
254`----------*/
255
79072805 256int
28ac2b49 257Perl_yyparse (pTHX_ int gramtype)
79072805 258{
d3d9da4a 259 dVAR;
eb578fdb
KW
260 int yystate;
261 int yyn;
0de566d7
DM
262 int yyresult;
263
0de566d7 264 /* Lookahead token as an internal (translated) token number. */
714c8e96 265 int yytoken = 0;
0de566d7 266
eb578fdb
KW
267 yy_parser *parser; /* the parser object */
268 yy_stack_frame *ps; /* current parser stack frame */
a0d0e21e 269
1654d593
DM
270#define YYPOPSTACK parser->ps = --ps
271#define YYPUSHSTACK parser->ps = ++ps
0de566d7 272
acdf0a21 273 /* The variable used to return semantic value and location from the
5912531f 274 action routines: ie $$. */
0de566d7
DM
275 YYSTYPE yyval;
276
0de566d7
DM
277 YYDPRINTF ((Perl_debug_log, "Starting parse\n"));
278
acdf0a21 279 parser = PL_parser;
1654d593 280
28ac2b49
Z
281 ENTER; /* force parser state cleanup/restoration before we return */
282 SAVEPPTR(parser->yylval.pval);
283 SAVEINT(parser->yychar);
284 SAVEINT(parser->yyerrstatus);
28ac2b49
Z
285 SAVEINT(parser->yylen);
286 SAVEVPTR(parser->stack);
b2c9b6ee 287 SAVEVPTR(parser->stack_maxbase);
28ac2b49
Z
288 SAVEVPTR(parser->ps);
289
290 /* initialise state for this parse */
291 parser->yychar = gramtype;
292 parser->yyerrstatus = 0;
28ac2b49
Z
293 parser->yylen = 0;
294 Newx(parser->stack, YYINITDEPTH, yy_stack_frame);
b2c9b6ee 295 parser->stack_maxbase = parser->stack + YYINITDEPTH - YY_MAXRULE;
28ac2b49
Z
296 ps = parser->ps = parser->stack;
297 ps->state = 0;
e3abe207 298 SAVEDESTRUCTOR_X(S_clear_yystack, parser);
0de566d7 299
fbe80aaa
DM
300 while (1) {
301 /* main loop: shift some tokens, then reduce when possible */
5019c3ae 302
b2c9b6ee
DM
303 /* grow the stack to accommodate longest possible rule */
304 if (ps >= parser->stack_maxbase) {
305 Size_t pos = ps - parser->stack;
306 Size_t newsize = 2 * (parser->stack_maxbase + YY_MAXRULE
307 - parser->stack);
308 /* this will croak on insufficient memory */
309 Renew(parser->stack, newsize, yy_stack_frame);
310 ps = parser->ps = parser->stack + pos;
311 parser->stack_maxbase = parser->stack + newsize - YY_MAXRULE;
312
313 YYDPRINTF((Perl_debug_log,
314 "parser stack size increased to %lu frames\n",
315 (unsigned long int)newsize));
316 }
317
ddbfb8f6
DM
318 while (1) {
319 /* shift a token, or quit when it's possible to reduce */
5019c3ae 320
b2c9b6ee 321 assert(ps < parser->stack_maxbase + YY_MAXRULE);
ddbfb8f6 322 yystate = ps->state;
5019c3ae 323
ddbfb8f6 324 YYDPRINTF ((Perl_debug_log, "Entering state %d\n", yystate));
3c217e57 325
ddbfb8f6 326 parser->yylen = 0;
3c217e57 327
ddbfb8f6
DM
328 /* Do appropriate processing given the current state. */
329 /* Read a lookahead token if we need one and don't already have one. */
3c217e57 330
ddbfb8f6 331 /* First try to decide what to do without reference to lookahead token. */
3c217e57 332
ddbfb8f6
DM
333 yyn = yypact[yystate];
334 if (yyn == YYPACT_NINF)
335 goto yydefault;
3c217e57 336
ddbfb8f6 337 /* Not known => get a lookahead token if don't already have one. */
3c217e57 338
ddbfb8f6
DM
339 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
340 if (parser->yychar == YYEMPTY) {
341 YYDPRINTF ((Perl_debug_log, "Reading a token:\n"));
342 parser->yychar = yylex();
343 }
3c217e57 344
ddbfb8f6
DM
345 if (parser->yychar <= YYEOF) {
346 parser->yychar = yytoken = YYEOF;
347 YYDPRINTF ((Perl_debug_log, "Now at end of input.\n"));
348 }
349 else {
350 /* perly.tab is shipped based on an ASCII system, so need to index it
351 * with characters translated to ASCII. Although it's not designed for
352 * this purpose, we can use NATIVE_TO_UNI here. It returns its
353 * argument on ASCII platforms, and on EBCDIC translates native to
354 * ascii in the 0-255 range, leaving everything else unchanged. This
355 * jibes with yylex() returning some bare characters in that range, but
356 * all tokens it returns are either 0, or above 255. There could be a
357 * problem if NULs weren't 0, or were ever returned as raw chars by
358 * yylex() */
359 yytoken = YYTRANSLATE (NATIVE_TO_UNI(parser->yychar));
360 YYDSYMPRINTF ("Next token is", yytoken, &parser->yylval);
361 }
3c217e57 362
ddbfb8f6
DM
363 /* If the proper action on seeing token YYTOKEN is to reduce or to
364 * detect an error, take that action.
365 * Casting yyn to unsigned allows a >=0 test to be included as
366 * part of the <=YYLAST test for speed */
367 yyn += yytoken;
368 if ((unsigned int)yyn > YYLAST || yycheck[yyn] != yytoken) {
369 yydefault:
370 /* do the default action for the current state. */
371 yyn = yydefact[yystate];
372 if (yyn == 0)
373 goto yyerrlab;
374 break; /* time to reduce */
375 }
3c217e57 376
ddbfb8f6
DM
377 yyn = yytable[yyn];
378 if (yyn <= 0) {
379 if (yyn == 0 || yyn == YYTABLE_NINF)
380 goto yyerrlab;
381 yyn = -yyn;
382 break; /* time to reduce */
383 }
3c217e57 384
ddbfb8f6
DM
385 if (yyn == YYFINAL)
386 YYACCEPT;
3c217e57 387
ddbfb8f6
DM
388 /* Shift the lookahead token. */
389 YYDPRINTF ((Perl_debug_log, "Shifting token %s, ", yytname[yytoken]));
3c217e57 390
ddbfb8f6
DM
391 /* Discard the token being shifted unless it is eof. */
392 if (parser->yychar != YYEOF)
393 parser->yychar = YYEMPTY;
3c217e57 394
ddbfb8f6
DM
395 YYPUSHSTACK;
396 ps->state = yyn;
397 ps->val = parser->yylval;
398 ps->compcv = (CV*)SvREFCNT_inc(PL_compcv);
399 ps->savestack_ix = PL_savestack_ix;
9388183f 400#ifdef DEBUGGING
ddbfb8f6 401 ps->name = (const char *)(yytname[yytoken]);
9388183f 402#endif
0de566d7 403
ddbfb8f6
DM
404 /* Count tokens shifted since error; after three, turn off error
405 status. */
406 if (parser->yyerrstatus)
407 parser->yyerrstatus--;
0de566d7 408
ddbfb8f6 409 }
0de566d7 410
ddbfb8f6 411 /* Do a reduction */
0de566d7 412
ddbfb8f6
DM
413 /* yyn is the number of a rule to reduce with. */
414 parser->yylen = yyr2[yyn];
b2c9b6ee 415 assert(parser->yylen <= YY_MAXRULE); /* see defn of YY_MAXRULE above */
0de566d7 416
ddbfb8f6
DM
417 /* If YYLEN is nonzero, implement the default value of the action:
418 "$$ = $1".
0de566d7 419
ddbfb8f6
DM
420 Otherwise, the following line sets YYVAL to garbage.
421 This behavior is undocumented and Bison
422 users should not rely upon it. Assigning to YYVAL
423 unconditionally makes the parser a bit smaller, and it avoids a
424 GCC warning that YYVAL may be used uninitialized. */
425 yyval = ps[1-parser->yylen].val;
0de566d7 426
ddbfb8f6
DM
427 YY_STACK_PRINT(parser);
428 YY_REDUCE_PRINT (yyn);
718a7425 429
ddbfb8f6 430 switch (yyn) {
0de566d7 431
ddbfb8f6 432 /* contains all the rule actions; auto-generated from perly.y */
f05e27e5
DM
433#include "perly.act"
434
ddbfb8f6 435 }
0de566d7 436
ddbfb8f6
DM
437 {
438 int i;
439 for (i=0; i< parser->yylen; i++) {
440 SvREFCNT_dec(ps[-i].compcv);
441 }
442 }
670f3923 443
ddbfb8f6 444 parser->ps = ps -= (parser->yylen-1);
0de566d7 445
ddbfb8f6
DM
446 /* Now shift the result of the reduction. Determine what state
447 that goes to, based on the state we popped back to and the rule
448 number reduced by. */
05a03161 449
ddbfb8f6
DM
450 ps->val = yyval;
451 ps->compcv = (CV*)SvREFCNT_inc(PL_compcv);
452 ps->savestack_ix = PL_savestack_ix;
9388183f 453#ifdef DEBUGGING
ddbfb8f6 454 ps->name = (const char *)(yytname [yyr1[yyn]]);
9388183f 455#endif
0de566d7 456
ddbfb8f6 457 yyn = yyr1[yyn];
05a03161 458
ddbfb8f6
DM
459 yystate = yypgoto[yyn - YYNTOKENS] + ps[-1].state;
460 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == ps[-1].state)
461 yystate = yytable[yystate];
462 else
463 yystate = yydefgoto[yyn - YYNTOKENS];
464 ps->state = yystate;
0de566d7 465
ddbfb8f6 466 continue;
0de566d7 467
0de566d7 468
ddbfb8f6
DM
469 /*------------------------------------.
470 | yyerrlab -- here on detecting error |
471 `------------------------------------*/
472 yyerrlab:
473 /* If not already recovering from an error, report this error. */
474 if (!parser->yyerrstatus) {
475 yyerror ("syntax error");
476 }
0de566d7 477
0de566d7 478
ddbfb8f6
DM
479 if (parser->yyerrstatus == 3) {
480 /* If just tried and failed to reuse lookahead token after an
481 error, discard it. */
482
483 /* Return failure if at end of input. */
484 if (parser->yychar == YYEOF) {
485 /* Pop the error token. */
486 SvREFCNT_dec(ps->compcv);
487 YYPOPSTACK;
488 /* Pop the rest of the stack. */
489 while (ps > parser->stack) {
490 YYDSYMPRINTF ("Error: popping", yystos[ps->state], &ps->val);
491 LEAVE_SCOPE(ps->savestack_ix);
492 if (yy_type_tab[yystos[ps->state]] == toketype_opval
493 && ps->val.opval)
494 {
495 YYDPRINTF ((Perl_debug_log, "(freeing op)\n"));
496 if (ps->compcv != PL_compcv) {
497 PL_compcv = ps->compcv;
498 PAD_SET_CUR_NOSAVE(CvPADLIST(PL_compcv), 1);
499 }
500 op_free(ps->val.opval);
501 }
502 SvREFCNT_dec(ps->compcv);
503 YYPOPSTACK;
504 }
505 YYABORT;
506 }
0de566d7 507
ddbfb8f6
DM
508 YYDSYMPRINTF ("Error: discarding", yytoken, &parser->yylval);
509 parser->yychar = YYEMPTY;
0de566d7 510
ddbfb8f6 511 }
0de566d7 512
ddbfb8f6
DM
513 /* Else will try to reuse lookahead token after shifting the error
514 token. */
515 goto yyerrlab1;
516
517
518 /*----------------------------------------------------.
519 | yyerrlab1 -- error raised explicitly by an action. |
520 `----------------------------------------------------*/
521 yyerrlab1:
522 parser->yyerrstatus = 3; /* Each real token shifted decrements this. */
523
524 for (;;) {
525 yyn = yypact[yystate];
526 if (yyn != YYPACT_NINF) {
527 yyn += YYTERROR;
528 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) {
529 yyn = yytable[yyn];
530 if (0 < yyn)
531 break;
532 }
533 }
0de566d7 534
ddbfb8f6
DM
535 /* Pop the current state because it cannot handle the error token. */
536 if (ps == parser->stack)
537 YYABORT;
538
539 YYDSYMPRINTF ("Error: popping", yystos[ps->state], &ps->val);
540 LEAVE_SCOPE(ps->savestack_ix);
541 if (yy_type_tab[yystos[ps->state]] == toketype_opval && ps->val.opval) {
542 YYDPRINTF ((Perl_debug_log, "(freeing op)\n"));
543 if (ps->compcv != PL_compcv) {
544 PL_compcv = ps->compcv;
545 PAD_SET_CUR_NOSAVE(CvPADLIST(PL_compcv), 1);
546 }
547 op_free(ps->val.opval);
548 }
549 SvREFCNT_dec(ps->compcv);
550 YYPOPSTACK;
551 yystate = ps->state;
0de566d7 552
ddbfb8f6
DM
553 YY_STACK_PRINT(parser);
554 }
0de566d7 555
ddbfb8f6
DM
556 if (yyn == YYFINAL)
557 YYACCEPT;
0de566d7 558
ddbfb8f6 559 YYDPRINTF ((Perl_debug_log, "Shifting error token, "));
0de566d7 560
ddbfb8f6
DM
561 YYPUSHSTACK;
562 ps->state = yyn;
563 ps->val = parser->yylval;
564 ps->compcv = (CV*)SvREFCNT_inc(PL_compcv);
565 ps->savestack_ix = PL_savestack_ix;
9388183f 566#ifdef DEBUGGING
ddbfb8f6 567 ps->name ="<err>";
9388183f 568#endif
0de566d7 569
fbe80aaa 570 } /* main loop */
0de566d7
DM
571
572
573 /*-------------------------------------.
574 | yyacceptlab -- YYACCEPT comes here. |
575 `-------------------------------------*/
576 yyacceptlab:
577 yyresult = 0;
8c63ea58
GG
578 for (ps=parser->ps; ps > parser->stack; ps--) {
579 SvREFCNT_dec(ps->compcv);
580 }
22735491 581 parser->ps = parser->stack; /* disable cleanup */
0de566d7
DM
582 goto yyreturn;
583
584 /*-----------------------------------.
585 | yyabortlab -- YYABORT comes here. |
586 `-----------------------------------*/
587 yyabortlab:
588 yyresult = 1;
589 goto yyreturn;
590
0de566d7 591 yyreturn:
e3abe207 592 LEAVE; /* force parser stack cleanup before we return */
0de566d7 593 return yyresult;
e1f15930 594}
66610fdd
RGS
595
596/*
14d04a33 597 * ex: set ts=8 sts=4 sw=4 et:
37442d52 598 */