summaryrefslogtreecommitdiffstats
path: root/src/mesa/program/program_parse.y
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2013-07-29 16:03:46 -0700
committerKenneth Graunke <[email protected]>2013-07-31 11:52:13 -0700
commit6d2a9220b832d9a0c0cf35fcc5b9de1542af267d (patch)
treee636f02b3356838cf860fe75e5568c6c53911845 /src/mesa/program/program_parse.y
parentde917b4c4c4dfc949d5f8e3d9eb2dd48b63a3de5 (diff)
mesa/program: Switch from the deprecated YYLEX_PARAM to %lex-param.
YYLEX_PARAM is no longer supported as of Bison 3.0. Instead, the Bison developers recommend using %lex-param. %lex-param takes a type and variable name, similar to %parse-param, so you can't pass an arbitrary expression like state->scanner. But Flex insists on passing the actual scanner object, not an arbitrary object like state. To solve this, the parser defines a wrapper lex() function which accepts "state," and calls Flex's lex() function with state->scanner. Fixes the build with Bison 3.0. Also works with Bison 2.7.1. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67354 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Tested-by: Laurent Carlier <[email protected]> Cc: "9.2" [email protected]
Diffstat (limited to 'src/mesa/program/program_parse.y')
-rw-r--r--src/mesa/program/program_parse.y9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/mesa/program/program_parse.y b/src/mesa/program/program_parse.y
index 6415bef765f..3aceb21f43c 100644
--- a/src/mesa/program/program_parse.y
+++ b/src/mesa/program/program_parse.y
@@ -113,15 +113,13 @@ static struct asm_instruction *asm_instruction_copy_ctor(
+ (Current).first_column; \
} \
} while(YYID(0))
-
-#define YYLEX_PARAM state->scanner
%}
%pure-parser
%locations
+%lex-param { struct asm_parser_state *state }
%parse-param { struct asm_parser_state *state }
%error-verbose
-%lex-param { void *scanner }
%union {
struct asm_instruction *inst;
@@ -274,9 +272,10 @@ _mesa_program_lexer_lex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param,
void *yyscanner);
static int
-yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, void *yyscanner)
+yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param,
+ struct asm_parser_state *state)
{
- return _mesa_program_lexer_lex(yylval_param, yylloc_param, yyscanner);
+ return _mesa_program_lexer_lex(yylval_param, yylloc_param, state->scanner);
}
%}