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