From 0293b2e2dd81fabd3ecb71e036a99621801e1c94 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Wed, 19 May 2010 10:05:40 -0700 Subject: [PATCH] Rename yylex to glcpp_parser_lex and give it a glcpp_parser_t* argument. Much cleaner this way, (and now our custom lex function has access to all the parser state which it will need). --- glcpp-parse.y | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/glcpp-parse.y b/glcpp-parse.y index 6ef1cae0eca..04bac00e9f9 100644 --- a/glcpp-parse.y +++ b/glcpp-parse.y @@ -82,8 +82,10 @@ _argument_list_length (argument_list_t *list); string_list_t * _argument_list_member_at (argument_list_t *list, int index); +#define yylex glcpp_parser_lex + static int -yylex (yyscan_t scanner); +glcpp_parser_lex (glcpp_parser_t *parser); %} @@ -94,7 +96,7 @@ yylex (yyscan_t scanner); } %parse-param {glcpp_parser_t *parser} -%lex-param {void *scanner} +%lex-param {glcpp_parser_t *parser} %token DEFINE FUNC_MACRO IDENTIFIER NEWLINE OBJ_MACRO REPLACEMENT TOKEN UNDEF %type argument_word FUNC_MACRO IDENTIFIER OBJ_MACRO REPLACEMENT TOKEN @@ -647,7 +649,7 @@ _expand_function_macro (glcpp_parser_t *parser, } static int -yylex (yyscan_t scanner) +glcpp_parser_lex (glcpp_parser_t *parser) { - return glcpp_lex (scanner); + return glcpp_lex (parser->scanner); } -- 2.30.2