[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't compile mesa dlsl parser

From: Akim Demaille
Subject: Re: Can't compile mesa dlsl parser
Date: Mon, 29 Jul 2013 11:17:55 +0200

Le 28 juil. 2013 à 20:05, Никита Малявин <address@hidden> a écrit :


> Hello, i've got compilation error while compiling latest mesa git sources
> with bison version 3.0:
> glsl_parser.cpp: In function 'int
> _mesa_glsl_parse(_mesa_glsl_parse_state*)':
> glsl_parser.cpp:2616:41: error: 'scanner' was not declared in this scope
> It seems to be somehow related to string in glsl/glsl_parser.yy:
> %lex-param   {void *scanner}
> Compilation succeeds with bison 2.7.1
> I'm using archlinux.
> Is there any additional configuraton for 3.0 version to work in backward
> compatibility or something else?

The problem here is that this file is using YYLEX_PARAM, whose support was
removed in favor of %parse-param, %lex-param, and %param.  The latter is
introduced by Bison 2.7, but %parse-param and %lex-param have existed for
a long time now.

The file looks like this currently:

#define YYLEX_PARAM state->scanner
%lex-param   {void *scanner}
%parse-param {struct _mesa_glsl_parse_state *state}

It should rather look like this now:

%lex-param   {struct _mesa_glsl_parse_state *state}
%parse-param {struct _mesa_glsl_parse_state *state}

and use 'state' instead of 'scanner' in the scanner.  Unfortunately
there is no way to pass state->scanner to the scanner.

If using Bison 3.0 is ok for you, then

%param   {struct _mesa_glsl_parse_state *state}

suffices for both.

Are you a contributor to Mesa?  Is there a way to communicate with its
team to help with the migration?

Thanks in advance!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]