[Mesa-stable] [PATCH 3/4] mesa/program: Change the program parser's namespace.

Kenneth Graunke kenneth at whitecape.org
Mon Jul 29 16:07:37 PDT 2013


Bison 3.0 removes the YYLEX_PARAM macro.  In preparation for handling
this using %lex-param, the parser needs a wrapper function for the
actual Flex lex() function.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67354
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Cc: mesa-stable at lists.freedesktop.org
Cc: Sandeep <sandy.8925 at gmail.com>
Cc: Bruno Jacquet <maxijac at free.fr>
Cc: Laurent Carlier <lordheavym at gmail.com>
Cc: Nikita Malyavin <nikitamalyavin at gmail.com>
---
 src/mesa/program/program_lexer.l |  2 +-
 src/mesa/program/program_parse.y | 11 +++++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/mesa/program/program_lexer.l b/src/mesa/program/program_lexer.l
index 0947bb0..d5dbcf3 100644
--- a/src/mesa/program/program_lexer.l
+++ b/src/mesa/program/program_lexer.l
@@ -165,7 +165,7 @@ szf    [HR]?
 cc     C?
 sat    (_SAT)?
 
-%option prefix="_mesa_program_"
+%option prefix="_mesa_program_lexer_"
 %option bison-bridge bison-locations reentrant noyywrap
 %%
 
diff --git a/src/mesa/program/program_parse.y b/src/mesa/program/program_parse.y
index e2da633..6415bef 100644
--- a/src/mesa/program/program_parse.y
+++ b/src/mesa/program/program_parse.y
@@ -269,8 +269,15 @@ static struct asm_instruction *asm_instruction_copy_ctor(
 %type <negate> optionalSign
 
 %{
-extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param,
-    void *yyscanner);
+extern int
+_mesa_program_lexer_lex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param,
+                        void *yyscanner);
+
+static int
+yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, void *yyscanner)
+{
+   return _mesa_program_lexer_lex(yylval_param, yylloc_param, yyscanner);
+}
 %}
 
 %%
-- 
1.8.3.4



More information about the mesa-stable mailing list