mesa/program: Switch from the deprecated YYLEX_PARAM to %lex-param.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 29 Jul 2013 23:03:46 +0000 (16:03 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 31 Jul 2013 18:52:13 +0000 (11:52 -0700)
commit6d2a9220b832d9a0c0cf35fcc5b9de1542af267d
treee636f02b3356838cf860fe75e5568c6c53911845
parentde917b4c4c4dfc949d5f8e3d9eb2dd48b63a3de5
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 <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Tested-by: Laurent Carlier <lordheavym@gmail.com>
Cc: "9.2" mesa-stable@lists.freedesktop.org
src/mesa/program/program_parse.y