From 38aa83560be3368b4e9784b3ef8f73144171ca45 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Mon, 10 May 2010 11:52:29 -0700 Subject: Make the lexer reentrant (to avoid "still reachable" memory). This allows the final program to be 100% "valgrind clean", (freeing all memory that it allocates). This will make it much easier to ensure that any allocation that parser actions perform are also cleaned up. --- glcpp-parse.y | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'glcpp-parse.y') diff --git a/glcpp-parse.y b/glcpp-parse.y index 739b2935b3..9acd549b24 100644 --- a/glcpp-parse.y +++ b/glcpp-parse.y @@ -28,10 +28,13 @@ #define YYSTYPE int void -yyerror (const char *error); +yyerror (const char *error, void *scanner); %} +%parse-param {void *scanner} +%lex-param {void *scanner} + %token TOKEN %% @@ -51,7 +54,7 @@ token: TOKEN %% void -yyerror (const char *error) +yyerror (const char *error, void *scanner) { fprintf (stderr, "Parse error: %s\n", error); } -- cgit v1.2.3