[Mesa-dev] [PATCH 2/6] glsl: Add productions to GLSL grammar for switch statement

Dan McCabe zen3d.linux at gmail.com
Fri Jun 24 12:59:31 PDT 2011


On 06/20/2011 03:39 PM, Ian Romanick wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 06/17/2011 05:43 PM, Dan McCabe wrote:
>> The grammar is modified to support switch statements. Rather than follow the
>> grammar in the appendix, which allows case labels to be placed ANYWHERE
>> as a regular statement, we follow the development of the grammar as
>> described in the body of the GLSL.
>>
>> In this variation, the switch statement has a body which consists of a list
>> of case statements. A case statement is preceded by a list of case labels and
>> ends with a list of statements.
> Either this patch or patch 6/6 is the right place to restrict
> switch-statements and case labels to GLSL 1.30.  From the looks of the
> series, these patches will merrily allow switch-statements on any GLSL
> version.  That seems bad. :)

Isn't that the purpose of the KYEWORD macro in glsl_lexer.ll ? Those 
macros already specify that that these are valid keywords in 1.3 or 
beyond already.

cheers, danm


More information about the mesa-dev mailing list