Mesa (9.2): glsl: Change the lexer's namespace.

Ian Romanick idr at kemper.freedesktop.org
Tue Aug 6 16:22:50 UTC 2013


Module: Mesa
Branch: 9.2
Commit: d4c2c5a739c5212634c3fb83835e866ee4e0a8c0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d4c2c5a739c5212634c3fb83835e866ee4e0a8c0

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Mon Jul 29 15:27:46 2013 -0700

glsl: Change the lexer's namespace.

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>
Reviewed-by: Matt Turner <mattst88 at gmail.com>
Tested-by: Laurent Carlier <lordheavym at gmail.com>
Cc: "9.2" mesa-stable at lists.freedesktop.org
(cherry picked from commit eb7c8c7fb6e49a04f3fe84a6d438160dc4a14ac0)

---

 src/glsl/glsl_lexer.ll        |    2 +-
 src/glsl/glsl_parser.yy       |    6 ++++++
 src/glsl/glsl_parser_extras.h |    4 ++--
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/glsl/glsl_lexer.ll b/src/glsl/glsl_lexer.ll
index 2c581b2..6c5d003 100644
--- a/src/glsl/glsl_lexer.ll
+++ b/src/glsl/glsl_lexer.ll
@@ -149,7 +149,7 @@ literal_integer(char *text, int len, struct _mesa_glsl_parse_state *state,
 %option bison-bridge bison-locations reentrant noyywrap
 %option nounput noyy_top_state
 %option never-interactive
-%option prefix="_mesa_glsl_"
+%option prefix="_mesa_glsl_lexer_"
 %option extra-type="struct _mesa_glsl_parse_state *"
 
 %x PP PRAGMA
diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index cbd94b4..9c7b297 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -39,6 +39,12 @@ static void yyerror(YYLTYPE *loc, _mesa_glsl_parse_state *st, const char *msg)
 {
    _mesa_glsl_error(loc, st, "%s", msg);
 }
+
+static int
+_mesa_glsl_lex(YYSTYPE *val, YYLTYPE *loc, void *scanner)
+{
+   return _mesa_glsl_lexer_lex(val, loc, scanner);
+}
 %}
 
 %expect 0
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
index 7f478df..1e386dd 100644
--- a/src/glsl/glsl_parser_extras.h
+++ b/src/glsl/glsl_parser_extras.h
@@ -337,8 +337,8 @@ extern void _mesa_glsl_lexer_ctor(struct _mesa_glsl_parse_state *state,
 extern void _mesa_glsl_lexer_dtor(struct _mesa_glsl_parse_state *state);
 
 union YYSTYPE;
-extern int _mesa_glsl_lex(union YYSTYPE *yylval, YYLTYPE *yylloc, 
-			  void *scanner);
+extern int _mesa_glsl_lexer_lex(union YYSTYPE *yylval, YYLTYPE *yylloc,
+                                void *scanner);
 
 extern int _mesa_glsl_parse(struct _mesa_glsl_parse_state *);
 




More information about the mesa-commit mailing list