p |int |yyerror |NN const char* s
p |int |yylex
p |int |yyparse
+p |void |parser_free |NN const yy_parser *
p |int |yywarn |NN const char* s
#if defined(MYMALLOC)
Ap |void |dump_mstats |NN char* s
#define yyerror Perl_yyerror
#define yylex Perl_yylex
#define yyparse Perl_yyparse
+#define parser_free Perl_parser_free
#define yywarn Perl_yywarn
#endif
#if defined(MYMALLOC)
#define yyerror(a) Perl_yyerror(aTHX_ a)
#define yylex() Perl_yylex(aTHX)
#define yyparse() Perl_yyparse(aTHX)
+#define parser_free(a) Perl_parser_free(aTHX_ a)
#define yywarn(a) Perl_yywarn(aTHX_ a)
#endif
#if defined(MYMALLOC)
* and lexer (perly.c, toke,c).
*/
+#define YYEMPTY (-2)
+
typedef struct {
YYSTYPE val; /* semantic value */
short state;
# define YYSIZE_T size_t
-#define YYEMPTY (-2)
#define YYEOF 0
#define YYTERROR 1
# define YY_REDUCE_PRINT(Rule)
#endif /* !DEBUGGING */
-/* YYINITDEPTH -- initial size of the parser's stacks. */
-#define YYINITDEPTH 200
-
/* called during cleanup (via SAVEDESTRUCTOR_X) to free any items on the
* parse stack, thus avoiding leaks if we die */
/* delete a parser object */
-static void
-S_parser_free(pTHX_ const yy_parser *parser)
+void
+Perl_parser_free(pTHX_ const yy_parser *parser)
{
S_clear_yystack(aTHX_ parser);
Safefree(parser->stack);
#define YYPOPSTACK parser->ps = --ps
#define YYPUSHSTACK parser->ps = ++ps
- /* The variables used to return semantic value and location from the
+ /* The variable used to return semantic value and location from the
action routines: ie $$. */
YYSTYPE yyval;
YYDPRINTF ((Perl_debug_log, "Starting parse\n"));
- Newx(parser, 1, yy_parser);
- parser->old_parser = PL_parser;
- PL_parser = parser;
-
- Newx(ps, YYINITDEPTH, yy_stack_frame);
- parser->stack = ps;
- parser->ps = ps;
- parser->stack_size = YYINITDEPTH;
+ parser = PL_parser;
+ ps = parser->ps;
ENTER; /* force parser free before we return */
- SAVEDESTRUCTOR_X(S_parser_free, (void*) parser);
-
-
- ps->state = 0;
- parser->yyerrstatus = 0;
- parser->yychar = YYEMPTY; /* Cause a token to be read. */
+ SAVEDESTRUCTOR_X(Perl_parser_free, (void*) parser);
/*------------------------------------------------------------.
| yynewstate -- Push a new state, which is found in yystate. |
PERL_CALLCONV int Perl_yylex(pTHX);
PERL_CALLCONV int Perl_yyparse(pTHX);
+PERL_CALLCONV void Perl_parser_free(pTHX_ const yy_parser *)
+ __attribute__nonnull__(pTHX_1);
+
PERL_CALLCONV int Perl_yywarn(pTHX_ const char* s)
__attribute__nonnull__(pTHX_1);
#define yylval (PL_parser->yylval)
+/* YYINITDEPTH -- initial size of the parser's stacks. */
+#define YYINITDEPTH 200
+
static const char ident_too_long[] = "Identifier too long";
static const char commaless_variable_list[] = "comma-less variable list";
dVAR;
const char *s;
STRLEN len;
+ yy_parser *parser;
+
+ /* create and initialise a parser */
+
+ Newx(parser, 1, yy_parser);
+ parser->old_parser = PL_parser;
+ PL_parser = parser;
+
+ Newx(parser->stack, YYINITDEPTH, yy_stack_frame);
+ parser->ps = parser->stack;
+ parser->stack_size = YYINITDEPTH;
+
+ parser->stack->state = 0;
+ parser->yyerrstatus = 0;
+ parser->yychar = YYEMPTY; /* Cause a token to be read. */
+
+ /* initialise lexer state */
SAVEI32(PL_lex_dojoin);
SAVEI32(PL_lex_brackets);