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