Changeset 1427


Ignore:
Timestamp:
May 30, 2012, 7:59:15 PM (8 years ago)
Author:
sam
Message:

test: a better GLSL parser in the LolFx test parser.

Location:
trunk/test/sandbox/lex
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/sandbox/lex/lolfx.l

    r1413 r1427  
    6262"precision"                  { return GT_PRECISION; }
    6363"invariant"                  { return GT_INVARIANT; }
     64
     65 /*
     66  * Deprecated GLSL keywords
     67  */
     68
     69"attribute"                  { return GT_ATTRIBUTE; }
    6470
    6571 /*
     
    435441
    436442 /*
     443  * GLSL preprocessor directives
     444  */
     445
     446"#"[ \t]*"version".*         { /* ignore for now */ }
     447
     448 /*
    437449  * LolFx preprocessor directives
    438450  */
    439451
    440 "#"[ \t]*"region"            { return PREPROCESSOR_REGION; }
     452"#"[ \t]*"region"                  { return PREPROCESSOR_REGION; }
     453"#"[ \t]*"pragma"[ \t]*"lolfx".*   { /* ignore for now */ }
    441454
    442455 /*
  • trunk/test/sandbox/lex/lolfx.y

    r1413 r1427  
    4343
    4444 /*
     45  * Deprecated GLSL keywords
     46  */
     47
     48%token GT_ATTRIBUTE
     49
     50 /*
    4551  * GLSL types
    4652  */
     
    8389
    8490 /*
    85   * HLSL and GLSL keywords
     91  * GLSL keywords that are also in HLSL
    8692  */
    8793
     
    9197%token GHT_SAMPLER1D GHT_SAMPLER2D GHT_SAMPLER3D GHT_SAMPLERCUBE GHT_STRUCT
    9298%token GHT_SWITCH GHT_UINT GHT_UNIFORM GHT_VOID GHT_WHILE
     99
     100 /*
     101  * HLSL keywords that are also in GLSL
     102  */
    93103
    94104%token HGT_BOOL HGT_BREAK HGT_CASE HGT_CENTROID HGT_CONST HGT_CONTINUE
     
    183193
    184194 /*
    185   * Language keywords
     195  * Language symbols
    186196  */
    187197
     
    194204  */
    195205
    196 %token <ival> INT
    197206%token <fval> FLOAT
    198207%token <sval> STRING NAME
    199208
     209 /*
     210  * Our entry point
     211  */
     212
     213%start lolfx_file
     214
    200215%%
     216
     217 /*
     218  * Shortcuts for token groups
     219  */
     220
     221group_glsl_keyword:
     222    GT_SUBROUTINE
     223  | GT_PATCH
     224  | GT_SAMPLE
     225  | GT_FLAT
     226  | GT_SMOOTH
     227  | GT_LAYOUT
     228  | GT_INVARIANT
     229  | GT_HIGHP
     230  | GT_MEDIUMP
     231  | GT_LOWP
     232  | GT_PRECISION
     233  | GT_ATTRIBUTE
     234    ;
     235
     236group_glsl_type:
     237    GT_VEC2
     238  | GT_VEC3
     239  | GT_VEC4
     240  | GT_BVEC2
     241  | GT_BVEC3
     242  | GT_BVEC4
     243  | GT_DVEC2
     244  | GT_DVEC3
     245  | GT_DVEC4
     246  | GT_IVEC2
     247  | GT_IVEC3
     248  | GT_IVEC4
     249  | GT_UVEC2
     250  | GT_UVEC3
     251  | GT_UVEC4
     252  | GT_MAT2
     253  | GT_MAT2X2
     254  | GT_MAT2X3
     255  | GT_MAT2X4
     256  | GT_MAT3
     257  | GT_MAT3X2
     258  | GT_MAT3X3
     259  | GT_MAT3X4
     260  | GT_MAT4
     261  | GT_MAT4X2
     262  | GT_MAT4X3
     263  | GT_MAT4X4
     264  | GT_DMAT2
     265  | GT_DMAT2X2
     266  | GT_DMAT2X3
     267  | GT_DMAT2X4
     268  | GT_DMAT3
     269  | GT_DMAT3X2
     270  | GT_DMAT3X3
     271  | GT_DMAT3X4
     272  | GT_DMAT4
     273  | GT_DMAT4X2
     274  | GT_DMAT4X3
     275  | GT_DMAT4X4
     276  | GT_SAMPLER1DSHADOW
     277  | GT_SAMPLER1DARRAY
     278  | GT_SAMPLER1DARRAYSHADOW
     279  | GT_SAMPLER2DSHADOW
     280  | GT_SAMPLER2DARRAY
     281  | GT_SAMPLER2DARRAYSHADOW
     282  | GT_SAMPLER2DRECT
     283  | GT_SAMPLER2DRECTSHADOW
     284  | GT_SAMPLER2DMS
     285  | GT_SAMPLER2DMSARRAY
     286  | GT_SAMPLERCUBESHADOW
     287  | GT_SAMPLERCUBEARRAY
     288  | GT_SAMPLERCUBEARRAYSHADOW
     289  | GT_SAMPLERBUFFER
     290  | GT_ISAMPLER1D
     291  | GT_ISAMPLER1DARRAY
     292  | GT_ISAMPLER2D
     293  | GT_ISAMPLER2DARRAY
     294  | GT_ISAMPLER2DRECT
     295  | GT_ISAMPLER2DMS
     296  | GT_ISAMPLER2DMSARRAY
     297  | GT_ISAMPLER3D
     298  | GT_ISAMPLERCUBE
     299  | GT_ISAMPLERCUBEARRAY
     300  | GT_ISAMPLERBUFFER
     301  | GT_USAMPLER1D
     302  | GT_USAMPLER1DARRAY
     303  | GT_USAMPLER2D
     304  | GT_USAMPLER2DARRAY
     305  | GT_USAMPLER2DRECT
     306  | GT_USAMPLER2DMS
     307  | GT_USAMPLER2DMSARRAY
     308  | GT_USAMPLER3D
     309  | GT_USAMPLERCUBE
     310  | GT_USAMPLERCUBEARRAY
     311  | GT_USAMPLERBUFFER
     312    ;
     313
     314group_glsl_keyword_in_hlsl:
     315    GHT_BOOL
     316  | GHT_BREAK
     317  | GHT_CASE
     318  | GHT_CENTROID
     319  | GHT_CONST
     320  | GHT_CONTINUE
     321  | GHT_DEFAULT
     322  | GHT_DISCARD
     323  | GHT_DO
     324  | GHT_DOUBLE
     325  | GHT_ELSE
     326  | GHT_FLOAT
     327  | GHT_FOR
     328  | GHT_IF
     329  | GHT_IN
     330  | GHT_INOUT
     331  | GHT_INT
     332  | GHT_NOPERSPECTIVE
     333  | GHT_OUT
     334  | GHT_RETURN
     335  | GHT_SAMPLER1D
     336  | GHT_SAMPLER2D
     337  | GHT_SAMPLER3D
     338  | GHT_SAMPLERCUBE
     339  | GHT_STRUCT
     340  | GHT_SWITCH
     341  | GHT_UINT
     342  | GHT_UNIFORM
     343  | GHT_VOID
     344  | GHT_WHILE
     345    ;
     346
     347group_hlsl_keyword_in_glsl:
     348    HGT_BOOL
     349  | HGT_BREAK
     350  | HGT_CASE
     351  | HGT_CENTROID
     352  | HGT_CONST
     353  | HGT_CONTINUE
     354  | HGT_DEFAULT
     355  | HGT_DISCARD
     356  | HGT_DO
     357  | HGT_DOUBLE
     358  | HGT_ELSE
     359  | HGT_FLOAT
     360  | HGT_FOR
     361  | HGT_IF
     362  | HGT_IN
     363  | HGT_INOUT
     364  | HGT_INT
     365  | HGT_NOPERSPECTIVE
     366  | HGT_OUT
     367  | HGT_RETURN
     368  | HGT_SAMPLER1D
     369  | HGT_SAMPLER2D
     370  | HGT_SAMPLER3D
     371  | HGT_SAMPLERCUBE
     372  | HGT_STRUCT
     373  | HGT_SWITCH
     374  | HGT_UINT
     375  | HGT_UNIFORM
     376  | HGT_VOID
     377  | HGT_WHILE
     378    ;
     379
     380group_hlsl_keyword:
     381    HT_APPENDSTRUCTUREDBUFFER
     382  | HT_ASM
     383  | HT_ASM_FRAGMENT
     384  | HT_BLENDSTATE
     385  | HT_BUFFER
     386  | HT_BYTEADDRESSBUFFER
     387  | HT_CBUFFER
     388  | HT_COLUMN_MAJOR
     389  | HT_COMPILE
     390  | HT_COMPILE_FRAGMENT
     391  | HT_COMPILESHADER
     392  | HT_COMPUTESHADER
     393  | HT_CONSUMESTRUCTUREDBUFFER
     394  | HT_DEPTHSTENCILSTATE
     395  | HT_DEPTHSTENCILVIEW
     396  | HT_DOMAINSHADER
     397  | HT_DWORD
     398  | HT_EXTERN
     399  | HT_FALSE
     400  | HT_FXGROUP
     401  | HT_GEOMETRYSHADER
     402  | HT_GROUPSHARED
     403  | HT_HALF
     404  | HT_HULLSHADER
     405  | HT_INLINE
     406  | HT_INPUTPATCH
     407  | HT_INTERFACE
     408  | HT_LINE
     409  | HT_LINEADJ
     410  | HT_LINEAR
     411  | HT_LINESTREAM
     412  | HT_MATRIX
     413  | HT_NAMESPACE
     414  | HT_NOINTERPOLATION
     415  | HT_NULL
     416  | HT_OUTPUTPATCH
     417  | HT_PACKOFFSET
     418  | HT_PASS
     419  | HT_PIXELFRAGMENT
     420  | HT_PIXELSHADER
     421  | HT_POINT
     422  | HT_POINTSTREAM
     423  | HT_PRECISE
     424  | HT_RASTERIZERSTATE
     425  | HT_RENDERTARGETVIEW
     426  | HT_REGISTER
     427  | HT_ROW_MAJOR
     428  | HT_RWBUFFER
     429  | HT_RWBYTEADDRESSBUFFER
     430  | HT_RWSTRUCTUREDBUFFER
     431  | HT_RWTEXTURE1D
     432  | HT_RWTEXTURE1DARRAY
     433  | HT_RWTEXTURE2D
     434  | HT_RWTEXTURE2DARRAY
     435  | HT_RWTEXTURE3D
     436  | HT_SAMPLER
     437  | HT_SAMPLER_STATE
     438  | HT_SAMPLERSTATE
     439  | HT_SAMPLERCOMPARISONSTATE
     440  | HT_SHARED
     441  | HT_SNORM
     442  | HT_STATEBLOCK
     443  | HT_STATEBLOCK_STATE
     444  | HT_STATIC
     445  | HT_STRING
     446  | HT_STRUCTUREDBUFFER
     447  | HT_TBUFFER
     448  | HT_TECHNIQUE
     449  | HT_TECHNIQUE10
     450  | HT_TECHNIQUE11XZ
     451  | HT_TEXTURE
     452  | HT_TEXTURE1D
     453  | HT_TEXTURE1DARRAY
     454  | HT_TEXTURE2D
     455  | HT_TEXTURE2DARRAY
     456  | HT_TEXTURE2DMS
     457  | HT_TEXTURE2DMSARRAY
     458  | HT_TEXTURE3D
     459  | HT_TEXTURECUBE
     460  | HT_TEXTURECUBEARRAY
     461  | HT_TRUE
     462  | HT_TYPEDEF
     463  | HT_TRIANGLE
     464  | HT_TRIANGLEADJ
     465  | HT_TRIANGLESTREAM
     466  | HT_UNORM
     467  | HT_VECTOR
     468  | HT_VERTEXFRAGMENT
     469  | HT_VERTEXSHADER
     470  | HT_VOLATILE
     471    ;
     472
     473group_hlsl_type:
     474    HT_BOOL1
     475  | HT_BOOL1x1
     476  | HT_BOOL2x1
     477  | HT_BOOL3x1
     478  | HT_BOOL4x1
     479  | HT_BOOL2
     480  | HT_BOOL1x2
     481  | HT_BOOL2x2
     482  | HT_BOOL3x2
     483  | HT_BOOL4x2
     484  | HT_BOOL3
     485  | HT_BOOL1x3
     486  | HT_BOOL2x3
     487  | HT_BOOL3x3
     488  | HT_BOOL4x3
     489  | HT_BOOL4
     490  | HT_BOOL1x4
     491  | HT_BOOL2x4
     492  | HT_BOOL3x4
     493  | HT_BOOL4x4
     494  | HT_FLOAT1
     495  | HT_FLOAT1x1
     496  | HT_FLOAT2x1
     497  | HT_FLOAT3x1
     498  | HT_FLOAT4x1
     499  | HT_FLOAT2
     500  | HT_FLOAT1x2
     501  | HT_FLOAT2x2
     502  | HT_FLOAT3x2
     503  | HT_FLOAT4x2
     504  | HT_FLOAT3
     505  | HT_FLOAT1x3
     506  | HT_FLOAT2x3
     507  | HT_FLOAT3x3
     508  | HT_FLOAT4x3
     509  | HT_FLOAT4
     510  | HT_FLOAT1x4
     511  | HT_FLOAT2x4
     512  | HT_FLOAT3x4
     513  | HT_FLOAT4x4
     514  | HT_DOUBLE1
     515  | HT_DOUBLE1x1
     516  | HT_DOUBLE2x1
     517  | HT_DOUBLE3x1
     518  | HT_DOUBLE4x1
     519  | HT_DOUBLE2
     520  | HT_DOUBLE1x2
     521  | HT_DOUBLE2x2
     522  | HT_DOUBLE3x2
     523  | HT_DOUBLE4x2
     524  | HT_DOUBLE3
     525  | HT_DOUBLE1x3
     526  | HT_DOUBLE2x3
     527  | HT_DOUBLE3x3
     528  | HT_DOUBLE4x3
     529  | HT_DOUBLE4
     530  | HT_DOUBLE1x4
     531  | HT_DOUBLE2x4
     532  | HT_DOUBLE3x4
     533  | HT_DOUBLE4x4
     534  | HT_DWORD1
     535  | HT_DWORD1x1
     536  | HT_DWORD2x1
     537  | HT_DWORD3x1
     538  | HT_DWORD4x1
     539  | HT_DWORD2
     540  | HT_DWORD1x2
     541  | HT_DWORD2x2
     542  | HT_DWORD3x2
     543  | HT_DWORD4x2
     544  | HT_DWORD3
     545  | HT_DWORD1x3
     546  | HT_DWORD2x3
     547  | HT_DWORD3x3
     548  | HT_DWORD4x3
     549  | HT_DWORD4
     550  | HT_DWORD1x4
     551  | HT_DWORD2x4
     552  | HT_DWORD3x4
     553  | HT_DWORD4x4
     554  | HT_INT1
     555  | HT_INT1x1
     556  | HT_INT2x1
     557  | HT_INT3x1
     558  | HT_INT4x1
     559  | HT_INT2
     560  | HT_INT1x2
     561  | HT_INT2x2
     562  | HT_INT3x2
     563  | HT_INT4x2
     564  | HT_INT3
     565  | HT_INT1x3
     566  | HT_INT2x3
     567  | HT_INT3x3
     568  | HT_INT4x3
     569  | HT_INT4
     570  | HT_INT1x4
     571  | HT_INT2x4
     572  | HT_INT3x4
     573  | HT_INT4x4
     574  | HT_UINT1
     575  | HT_UINT1x1
     576  | HT_UINT2x1
     577  | HT_UINT3x1
     578  | HT_UINT4x1
     579  | HT_UINT2
     580  | HT_UINT1x2
     581  | HT_UINT2x2
     582  | HT_UINT3x2
     583  | HT_UINT4x2
     584  | HT_UINT3
     585  | HT_UINT1x3
     586  | HT_UINT2x3
     587  | HT_UINT3x3
     588  | HT_UINT4x3
     589  | HT_UINT4
     590  | HT_UINT1x4
     591  | HT_UINT2x4
     592  | HT_UINT3x4
     593  | HT_UINT4x4
     594    ;
     595
     596group_hlsl_preprocessor:
     597    PREPROCESSOR_DEFINE
     598  | PREPROCESSOR_ELIF
     599  | PREPROCESSOR_ELSE
     600  | PREPROCESSOR_ENDIF
     601  | PREPROCESSOR_ERROR
     602  | PREPROCESSOR_IF
     603  | PREPROCESSOR_IFDEF
     604  | PREPROCESSOR_IFNDEF
     605  | PREPROCESSOR_INCLUDE
     606  | PREPROCESSOR_LINE
     607  | PREPROCESSOR_PRAGMA
     608  | PREPROCESSOR_UNDEF
     609  | PREPROCESSOR_REGION
     610    ;
     611
     612group_hlsl_reserved:
     613    HT_AUTO
     614  | HT_CATCH
     615  | HT_CHAR
     616  | HT_CLASS
     617  | HT_CONST_CAST
     618  | HT_DELETE
     619  | HT_DYNAMIC_CAST
     620  | HT_ENUM
     621  | HT_EXPLICIT
     622  | HT_FRIEND
     623  | HT_GOTO
     624  | HT_LONG
     625  | HT_MUTABLE
     626  | HT_NEW
     627  | HT_OPERATOR
     628  | HT_PRIVATE
     629  | HT_PROTECTED
     630  | HT_PUBLIC
     631  | HT_REINTERPRET_CAST
     632  | HT_SHORT
     633  | HT_SIGNED
     634  | HT_SIZEOF
     635  | HT_STATIC_CAST
     636  | HT_TEMPLATE
     637  | HT_THIS
     638  | HT_THROW
     639  | HT_TRY
     640  | HT_TYPENAME
     641  | HT_UNION
     642  | HT_UNSIGNED
     643  | HT_USING
     644  | HT_VIRTUAL
     645    ;
     646
     647group_language_symbols:
     648    T_INC
     649  | T_DEC
     650  | T_LE
     651  | T_GE
     652  | T_EQ
     653  | T_NE
     654  | T_LEFT
     655  | T_RIGHT
     656  | T_AND
     657  | T_OR
     658  | T_XOR
     659  | T_MULEQ
     660  | T_DIVEQ
     661  | T_MODEQ
     662  | T_ADDEQ
     663  | T_SUBEQ
     664  | T_LEFTEQ
     665  | T_RIGHTEQ
     666  | T_ANDEQ
     667  | T_XOREQ
     668  | T_OREQ
     669    ;
     670
     671 /*
     672  * Grammar for LolFx files
     673  */
    201674
    202675lolfx_file:
     
    206679lolfx_section_list:
    207680    lolfx_section
    208     | lolfx_section_list lolfx_section
     681  | lolfx_section lolfx_section_list
    209682    ;
    210683
    211684lolfx_section:
    212685    lolfx_technique
    213     | lolfx_shader
     686  | lolfx_shader
    214687    ;
    215688
     
    219692
    220693lolfx_technique:
    221     HT_TECHNIQUE NAME '{' pass_list '}' { std::cout << "New tech" << std::endl; }
     694    HT_TECHNIQUE IDENTIFIER '{' pass_list '}' { std::cout << "New tech" << std::endl; }
    222695    ;
    223696
     
    228701pass_list:
    229702    pass
    230     | pass_list pass
     703  | pass pass_list
    231704    ;
    232705
    233706pass:
    234     HT_PASS NAME '{' pass_stmt_list '}' { std::cout << "New pass" << std::endl; }
     707    HT_PASS IDENTIFIER '{' pass_stmt_list '}' { std::cout << "New pass" << std::endl; }
    235708    ;
    236709
    237710pass_stmt_list:
    238711    pass_stmt
    239     | pass_stmt_list pass_stmt
    240     ;
    241 
     712  | pass_stmt pass_stmt_list
     713    ;
     714
     715 /* Shitty shit */
    242716pass_stmt:
    243717    ';'
    244     | NAME '=' NAME ';'
    245     | NAME '=' INT ';'
    246     | NAME '[' INT ']' '=' NAME ';'
    247     | NAME '[' INT ']' '=' INT ';'
     718  | IDENTIFIER '=' IDENTIFIER ';'
     719  | IDENTIFIER '=' INTCONSTANT ';'
     720  | IDENTIFIER '=' BOOLCONSTANT ';'
     721  | IDENTIFIER '=' HT_FALSE ';'
     722  | IDENTIFIER '=' HT_TRUE ';'
     723  | IDENTIFIER '[' INTCONSTANT ']' '=' IDENTIFIER ';'
     724  | IDENTIFIER '[' INTCONSTANT ']' '=' INTCONSTANT ';'
     725  | HT_TEXTURE '[' INTCONSTANT ']' '=' IDENTIFIER ';'
     726  | HT_TEXTURE '[' INTCONSTANT ']' '=' HT_NULL ';'
     727  | HT_DOMAINSHADER '=' IDENTIFIER ';'
     728  | HT_GEOMETRYSHADER '=' IDENTIFIER ';'
     729  | HT_HULLSHADER '=' IDENTIFIER ';'
     730  | HT_PIXELSHADER '=' IDENTIFIER ';'
     731  | HT_VERTEXSHADER '=' IDENTIFIER ';'
    248732    ;
    249733
     
    254738lolfx_shader:
    255739    lolfx_shader_region glsl_translation_unit
    256     | lolfx_shader_region
     740  | lolfx_shader_region
    257741    ;
    258742
     
    263747lolfx_shader_name:
    264748    IDENTIFIER                            { $$ = $1; }
    265     | lolfx_shader_name '.' IDENTIFIER    { $$ = $3; } /* FIXME: concatenate */
     749  | lolfx_shader_name '.' IDENTIFIER      { $$ = $3; } /* FIXME: concatenate */
    266750    ;
    267751
     
    276760glsl_primary_expression:
    277761    glsl_variable_identifier
    278     | INTCONSTANT
    279     | UINTCONSTANT
    280     | FLOATCONSTANT
    281     | BOOLCONSTANT
    282     | '(' glsl_expression ')'
     762  | INTCONSTANT
     763  | UINTCONSTANT
     764  | FLOATCONSTANT
     765  | BOOLCONSTANT
     766  | '(' glsl_expression ')'
    283767    ;
    284768
    285769glsl_postfix_expression:
    286770    glsl_primary_expression
    287     | glsl_postfix_expression '[' glsl_integer_expression ']'
    288     | glsl_function_call
    289     | glsl_postfix_expression '.' FIELDSELECTION
    290     | glsl_postfix_expression T_INC
    291     | glsl_postfix_expression T_DEC
     771  | glsl_postfix_expression '[' glsl_integer_expression ']'
     772  | glsl_function_call
     773  | glsl_postfix_expression '.' FIELDSELECTION
     774  | glsl_postfix_expression T_INC
     775  | glsl_postfix_expression T_DEC
    292776    ;
    293777
     
    302786glsl_function_call_or_method:
    303787    glsl_function_call_generic
    304     | glsl_postfix_expression '.' glsl_function_call_generic
     788  | glsl_postfix_expression '.' glsl_function_call_generic
    305789    ;
    306790
    307791glsl_function_call_generic:
    308792    glsl_function_call_header_with_parameters ')'
    309     | glsl_function_call_header_no_parameters ')'
     793  | glsl_function_call_header_no_parameters ')'
    310794    ;
    311795
    312796glsl_function_call_header_no_parameters:
    313797    glsl_function_call_header GHT_VOID
    314     | glsl_function_call_header
     798  | glsl_function_call_header
    315799    ;
    316800
    317801glsl_function_call_header_with_parameters:
    318802    glsl_function_call_header glsl_assignment_expression
    319     | glsl_function_call_header_with_parameters ',' glsl_assignment_expression
     803  | glsl_function_call_header_with_parameters ',' glsl_assignment_expression
    320804    ;
    321805
     
    326810glsl_function_identifier:
    327811    glsl_type_specifier
    328     | IDENTIFIER
    329     | FIELDSELECTION
     812  | IDENTIFIER
     813  | FIELDSELECTION
    330814    ;
    331815
    332816glsl_unary_expression:
    333817    glsl_postfix_expression
    334     | T_INC glsl_unary_expression
    335     | T_DEC glsl_unary_expression
    336     | glsl_unary_operator glsl_unary_expression
     818  | T_INC glsl_unary_expression
     819  | T_DEC glsl_unary_expression
     820  | glsl_unary_operator glsl_unary_expression
    337821    ;
    338822
    339823glsl_unary_operator:
    340824    '+'
    341     | '-'
    342     | '!'
    343     | '~'
     825  | '-'
     826  | '!'
     827  | '~'
    344828    ;
    345829
    346830glsl_multiplicative_expression:
    347831    glsl_unary_expression
    348     | glsl_multiplicative_expression '*' glsl_unary_expression
    349     | glsl_multiplicative_expression '/' glsl_unary_expression
    350     | glsl_multiplicative_expression '%' glsl_unary_expression
     832  | glsl_multiplicative_expression '*' glsl_unary_expression
     833  | glsl_multiplicative_expression '/' glsl_unary_expression
     834  | glsl_multiplicative_expression '%' glsl_unary_expression
    351835    ;
    352836
    353837glsl_additive_expression:
    354838    glsl_multiplicative_expression
    355     | glsl_additive_expression '+' glsl_multiplicative_expression
    356     | glsl_additive_expression '-' glsl_multiplicative_expression
     839  | glsl_additive_expression '+' glsl_multiplicative_expression
     840  | glsl_additive_expression '-' glsl_multiplicative_expression
    357841    ;
    358842
    359843glsl_shift_expression:
    360844    glsl_additive_expression
    361     | glsl_shift_expression T_LEFT glsl_additive_expression
    362     | glsl_shift_expression T_RIGHT glsl_additive_expression
     845  | glsl_shift_expression T_LEFT glsl_additive_expression
     846  | glsl_shift_expression T_RIGHT glsl_additive_expression
    363847    ;
    364848
    365849glsl_relational_expression:
    366850    glsl_shift_expression
    367     | glsl_relational_expression '<' glsl_shift_expression
    368     | glsl_relational_expression '>' glsl_shift_expression
    369     | glsl_relational_expression T_LE glsl_shift_expression
    370     | glsl_relational_expression T_GE glsl_shift_expression
     851  | glsl_relational_expression '<' glsl_shift_expression
     852  | glsl_relational_expression '>' glsl_shift_expression
     853  | glsl_relational_expression T_LE glsl_shift_expression
     854  | glsl_relational_expression T_GE glsl_shift_expression
    371855    ;
    372856
    373857glsl_equality_expression:
    374858    glsl_relational_expression
    375     | glsl_equality_expression T_EQ glsl_relational_expression
    376     | glsl_equality_expression T_NE glsl_relational_expression
     859  | glsl_equality_expression T_EQ glsl_relational_expression
     860  | glsl_equality_expression T_NE glsl_relational_expression
    377861    ;
    378862
    379863glsl_and_expression:
    380864    glsl_equality_expression
    381     | glsl_and_expression '&' glsl_equality_expression
     865  | glsl_and_expression '&' glsl_equality_expression
    382866    ;
    383867
    384868glsl_exclusive_or_expression:
    385869    glsl_and_expression
    386     | glsl_exclusive_or_expression '^' glsl_and_expression
     870  | glsl_exclusive_or_expression '^' glsl_and_expression
    387871    ;
    388872
    389873glsl_inclusive_or_expression:
    390874    glsl_exclusive_or_expression
    391     | glsl_inclusive_or_expression '|' glsl_exclusive_or_expression
     875  | glsl_inclusive_or_expression '|' glsl_exclusive_or_expression
    392876    ;
    393877
    394878glsl_logical_and_expression:
    395879    glsl_inclusive_or_expression
    396     | glsl_logical_and_expression T_AND glsl_inclusive_or_expression
     880  | glsl_logical_and_expression T_AND glsl_inclusive_or_expression
    397881    ;
    398882
    399883glsl_logical_xor_expression:
    400884    glsl_logical_and_expression
    401     | glsl_logical_xor_expression T_XOR glsl_logical_and_expression
     885  | glsl_logical_xor_expression T_XOR glsl_logical_and_expression
    402886    ;
    403887
    404888glsl_logical_or_expression:
    405889    glsl_logical_xor_expression
    406     | glsl_logical_or_expression T_OR glsl_logical_xor_expression
     890  | glsl_logical_or_expression T_OR glsl_logical_xor_expression
    407891    ;
    408892
    409893glsl_conditional_expression:
    410894    glsl_logical_or_expression
    411     | glsl_logical_or_expression '?' glsl_expression ':' glsl_assignment_expression
     895  | glsl_logical_or_expression '?' glsl_expression ':' glsl_assignment_expression
    412896    ;
    413897
    414898glsl_assignment_expression:
    415899    glsl_conditional_expression
    416     | glsl_unary_expression glsl_assignment_operator glsl_assignment_expression
     900  | glsl_unary_expression glsl_assignment_operator glsl_assignment_expression
    417901    ;
    418902
    419903glsl_assignment_operator:
    420904    '='
    421     | T_MULEQ
    422     | T_DIVEQ
    423     | T_MODEQ
    424     | T_ADDEQ
    425     | T_SUBEQ
    426     | T_LEFTEQ
    427     | T_RIGHTEQ
    428     | T_ANDEQ
    429     | T_XOREQ
    430     | T_OREQ
     905  | T_MULEQ
     906  | T_DIVEQ
     907  | T_MODEQ
     908  | T_ADDEQ
     909  | T_SUBEQ
     910  | T_LEFTEQ
     911  | T_RIGHTEQ
     912  | T_ANDEQ
     913  | T_XOREQ
     914  | T_OREQ
    431915    ;
    432916
    433917glsl_expression:
    434918    glsl_assignment_expression
    435     | glsl_expression ',' glsl_assignment_expression
     919  | glsl_expression ',' glsl_assignment_expression
    436920    ;
    437921
     
    442926glsl_declaration:
    443927    glsl_function_prototype ';'
    444     | glsl_init_declarator_list ';'
    445     | GT_PRECISION glsl_precision_qualifier glsl_type_specifier_no_prec ';'
    446     | glsl_type_qualifier IDENTIFIER '{' glsl_struct_declaration_list '}' ';'
    447     | glsl_type_qualifier IDENTIFIER '{' glsl_struct_declaration_list '}' IDENTIFIER ';'
    448     | glsl_type_qualifier IDENTIFIER '{' glsl_struct_declaration_list '}' IDENTIFIER '[' ']' ';'
    449     | glsl_type_qualifier IDENTIFIER '{' glsl_struct_declaration_list '}' IDENTIFIER '[' glsl_constant_expression ']' ';'
    450     | glsl_type_qualifier ';'
     928  | glsl_init_declarator_list ';'
     929  | GT_PRECISION glsl_precision_qualifier glsl_type_specifier_no_prec ';'
     930  | glsl_type_qualifier IDENTIFIER '{' glsl_struct_declaration_list '}' ';'
     931  | glsl_type_qualifier IDENTIFIER '{' glsl_struct_declaration_list '}' IDENTIFIER ';'
     932  | glsl_type_qualifier IDENTIFIER '{' glsl_struct_declaration_list '}' IDENTIFIER '[' ']' ';'
     933  | glsl_type_qualifier IDENTIFIER '{' glsl_struct_declaration_list '}' IDENTIFIER '[' glsl_constant_expression ']' ';'
     934  | glsl_type_qualifier ';'
    451935    ;
    452936
     
    457941glsl_function_declarator:
    458942    glsl_function_header
    459     | glsl_function_header_with_parameters
     943  | glsl_function_header_with_parameters
    460944    ;
    461945
    462946glsl_function_header_with_parameters:
    463947    glsl_function_header glsl_parameter_declaration
    464     | glsl_function_header_with_parameters ',' glsl_parameter_declaration
     948  | glsl_function_header_with_parameters ',' glsl_parameter_declaration
    465949    ;
    466950
     
    471955glsl_parameter_declarator:
    472956    glsl_type_specifier IDENTIFIER
    473     | glsl_type_specifier IDENTIFIER '[' glsl_constant_expression ']'
     957  | glsl_type_specifier IDENTIFIER '[' glsl_constant_expression ']'
    474958    ;
    475959
    476960glsl_parameter_declaration:
    477961    glsl_parameter_type_qualifier glsl_parameter_qualifier glsl_parameter_declarator
    478     | glsl_parameter_qualifier glsl_parameter_declarator
    479     | glsl_parameter_type_qualifier glsl_parameter_qualifier glsl_parameter_type_specifier
    480     | glsl_parameter_qualifier glsl_parameter_type_specifier
     962  | glsl_parameter_qualifier glsl_parameter_declarator
     963  | glsl_parameter_type_qualifier glsl_parameter_qualifier glsl_parameter_type_specifier
     964  | glsl_parameter_qualifier glsl_parameter_type_specifier
    481965    ;
    482966
    483967glsl_parameter_qualifier:
    484968    /* empty */
    485     | GHT_IN
    486     | GHT_OUT
    487     | GHT_INOUT
     969  | GHT_IN
     970  | GHT_OUT
     971  | GHT_INOUT
     972  | GT_ATTRIBUTE /* deprecated */
    488973    ;
    489974
     
    494979glsl_init_declarator_list:
    495980    glsl_single_declaration
    496     | glsl_init_declarator_list ',' IDENTIFIER
    497     | glsl_init_declarator_list ',' IDENTIFIER '[' ']'
    498     | glsl_init_declarator_list ',' IDENTIFIER '[' glsl_constant_expression ']'
    499     | glsl_init_declarator_list ',' IDENTIFIER '[' ']' '=' glsl_initializer
    500     | glsl_init_declarator_list ',' IDENTIFIER '[' glsl_constant_expression ']' '=' glsl_initializer
    501     | glsl_init_declarator_list ',' IDENTIFIER '=' glsl_initializer
     981  | glsl_init_declarator_list ',' IDENTIFIER
     982  | glsl_init_declarator_list ',' IDENTIFIER '[' ']'
     983  | glsl_init_declarator_list ',' IDENTIFIER '[' glsl_constant_expression ']'
     984  | glsl_init_declarator_list ',' IDENTIFIER '[' ']' '=' glsl_initializer
     985  | glsl_init_declarator_list ',' IDENTIFIER '[' glsl_constant_expression ']' '=' glsl_initializer
     986  | glsl_init_declarator_list ',' IDENTIFIER '=' glsl_initializer
    502987    ;
    503988
    504989glsl_single_declaration:
    505990    glsl_fully_specified_type
    506     | glsl_fully_specified_type IDENTIFIER
    507     | glsl_fully_specified_type IDENTIFIER '[' ']'
    508     | glsl_fully_specified_type IDENTIFIER '[' glsl_constant_expression ']'
    509     | glsl_fully_specified_type IDENTIFIER '[' ']' '=' glsl_initializer
    510     | glsl_fully_specified_type IDENTIFIER '[' glsl_constant_expression ']' '=' glsl_initializer
    511     | glsl_fully_specified_type IDENTIFIER '=' glsl_initializer
    512     | GT_INVARIANT IDENTIFIER
     991  | glsl_fully_specified_type IDENTIFIER
     992  | glsl_fully_specified_type IDENTIFIER '[' ']'
     993  | glsl_fully_specified_type IDENTIFIER '[' glsl_constant_expression ']'
     994  | glsl_fully_specified_type IDENTIFIER '[' ']' '=' glsl_initializer
     995  | glsl_fully_specified_type IDENTIFIER '[' glsl_constant_expression ']' '=' glsl_initializer
     996  | glsl_fully_specified_type IDENTIFIER '=' glsl_initializer
     997  | GT_INVARIANT IDENTIFIER
    513998    ;
    514999
    5151000glsl_fully_specified_type:
    5161001    glsl_type_specifier
    517     | glsl_type_qualifier glsl_type_specifier
     1002  | glsl_type_qualifier glsl_type_specifier
    5181003    ;
    5191004
     
    5241009glsl_interpolation_qualifier:
    5251010    GT_SMOOTH
    526     | GT_FLAT
    527     | GHT_NOPERSPECTIVE
     1011  | GT_FLAT
     1012  | GHT_NOPERSPECTIVE
    5281013    ;
    5291014
     
    5341019glsl_layout_qualifier_id_list:
    5351020    glsl_layout_qualifier_id
    536     | glsl_layout_qualifier_id_list ',' glsl_layout_qualifier_id
     1021  | glsl_layout_qualifier_id_list ',' glsl_layout_qualifier_id
    5371022    ;
    5381023
    5391024glsl_layout_qualifier_id:
    5401025    IDENTIFIER
    541     | IDENTIFIER '=' INTCONSTANT
     1026  | IDENTIFIER '=' INTCONSTANT
    5421027    ;
    5431028
     
    5481033glsl_type_qualifier:
    5491034    glsl_storage_qualifier
    550     | glsl_layout_qualifier
    551     | glsl_layout_qualifier glsl_storage_qualifier
    552     | glsl_interpolation_qualifier glsl_storage_qualifier
    553     | glsl_interpolation_qualifier
    554     | glsl_invariant_qualifier glsl_storage_qualifier
    555     | glsl_invariant_qualifier glsl_interpolation_qualifier glsl_storage_qualifier
    556     | glsl_invariant_qualifier
     1035  | glsl_layout_qualifier
     1036  | glsl_layout_qualifier glsl_storage_qualifier
     1037  | glsl_interpolation_qualifier glsl_storage_qualifier
     1038  | glsl_interpolation_qualifier
     1039  | glsl_invariant_qualifier glsl_storage_qualifier
     1040  | glsl_invariant_qualifier glsl_interpolation_qualifier glsl_storage_qualifier
     1041  | glsl_invariant_qualifier
    5571042    ;
    5581043
    5591044glsl_storage_qualifier:
    5601045    GHT_CONST
    561     | GHT_IN
    562     | GHT_OUT
    563     | GHT_CENTROID GHT_IN
    564     | GHT_CENTROID GHT_OUT
    565     | GT_PATCH GHT_IN
    566     | GT_PATCH GHT_OUT
    567     | GT_SAMPLE GHT_IN
    568     | GT_SAMPLE GHT_OUT
    569     | GHT_UNIFORM
     1046  | GHT_IN
     1047  | GHT_OUT
     1048  | GHT_CENTROID GHT_IN
     1049  | GHT_CENTROID GHT_OUT
     1050  | GT_PATCH GHT_IN
     1051  | GT_PATCH GHT_OUT
     1052  | GT_SAMPLE GHT_IN
     1053  | GT_SAMPLE GHT_OUT
     1054  | GHT_UNIFORM
     1055  | GT_ATTRIBUTE /* deprecated */
    5701056    ;
    5711057
    5721058glsl_type_specifier:
    5731059    glsl_type_specifier_no_prec
    574     | glsl_precision_qualifier glsl_type_specifier_no_prec
     1060  | glsl_precision_qualifier glsl_type_specifier_no_prec
    5751061    ;
    5761062
    5771063glsl_type_specifier_no_prec:
    5781064    glsl_type_specifier_nonarray
    579     | glsl_type_specifier_nonarray '[' ']'
    580     | glsl_type_specifier_nonarray '[' glsl_constant_expression ']'
     1065  | glsl_type_specifier_nonarray '[' ']'
     1066  | glsl_type_specifier_nonarray '[' glsl_constant_expression ']'
    5811067
    5821068glsl_type_specifier_nonarray:
    5831069    GHT_VOID
    584     | GHT_FLOAT
    585     | GHT_DOUBLE
    586     | GHT_INT
    587     | GHT_UINT
    588     | GHT_BOOL
    589     | GT_VEC2
    590     | GT_VEC3
    591     | GT_VEC4
    592     | GT_DVEC2
    593     | GT_DVEC3
    594     | GT_DVEC4
    595     | GT_BVEC2
    596     | GT_BVEC3
    597     | GT_BVEC4
    598     | GT_IVEC2
    599     | GT_IVEC3
    600     | GT_IVEC4
    601     | GT_UVEC2
    602     | GT_UVEC3
    603     | GT_UVEC4
    604     | GT_MAT2
    605     | GT_MAT3
    606     | GT_MAT4
    607     | GT_MAT2X2
    608     | GT_MAT2X3
    609     | GT_MAT2X4
    610     | GT_MAT3X2
    611     | GT_MAT3X3
    612     | GT_MAT3X4
    613     | GT_MAT4X2
    614     | GT_MAT4X3
    615     | GT_MAT4X4
    616     | GT_DMAT2
    617     | GT_DMAT3
    618     | GT_DMAT4
    619     | GT_DMAT2X2
    620     | GT_DMAT2X3
    621     | GT_DMAT2X4
    622     | GT_DMAT3X2
    623     | GT_DMAT3X3
    624     | GT_DMAT3X4
    625     | GT_DMAT4X2
    626     | GT_DMAT4X3
    627     | GT_DMAT4X4
    628     | GHT_SAMPLER1D
    629     | GHT_SAMPLER2D
    630     | GHT_SAMPLER3D
    631     | GHT_SAMPLERCUBE
    632     | GT_SAMPLER1DSHADOW
    633     | GT_SAMPLER2DSHADOW
    634     | GT_SAMPLERCUBESHADOW
    635     | GT_SAMPLER1DARRAY
    636     | GT_SAMPLER2DARRAY
    637     | GT_SAMPLER1DARRAYSHADOW
    638     | GT_SAMPLER2DARRAYSHADOW
    639     | GT_SAMPLERCUBEARRAY
    640     | GT_SAMPLERCUBEARRAYSHADOW
    641     | GT_ISAMPLER1D
    642     | GT_ISAMPLER2D
    643     | GT_ISAMPLER3D
    644     | GT_ISAMPLERCUBE
    645     | GT_ISAMPLER1DARRAY
    646     | GT_ISAMPLER2DARRAY
    647     | GT_ISAMPLERCUBEARRAY
    648     | GT_USAMPLER1D
    649     | GT_USAMPLER2D
    650     | GT_USAMPLER3D
    651     | GT_USAMPLERCUBE
    652     | GT_USAMPLER1DARRAY
    653     | GT_USAMPLER2DARRAY
    654     | GT_USAMPLERCUBEARRAY
    655     | GT_SAMPLER2DRECT
    656     | GT_SAMPLER2DRECTSHADOW
    657     | GT_ISAMPLER2DRECT
    658     | GT_USAMPLER2DRECT
    659     | GT_SAMPLERBUFFER
    660     | GT_ISAMPLERBUFFER
    661     | GT_USAMPLERBUFFER
    662     | GT_SAMPLER2DMS
    663     | GT_ISAMPLER2DMS
    664     | GT_USAMPLER2DMS
    665     | GT_SAMPLER2DMSARRAY
    666     | GT_ISAMPLER2DMSARRAY
    667     | GT_USAMPLER2DMSARRAY
    668     | glsl_struct_specifier
    669     | TYPENAME
     1070  | GHT_FLOAT
     1071  | GHT_DOUBLE
     1072  | GHT_INT
     1073  | GHT_UINT
     1074  | GHT_BOOL
     1075  | GT_VEC2
     1076  | GT_VEC3
     1077  | GT_VEC4
     1078  | GT_DVEC2
     1079  | GT_DVEC3
     1080  | GT_DVEC4
     1081  | GT_BVEC2
     1082  | GT_BVEC3
     1083  | GT_BVEC4
     1084  | GT_IVEC2
     1085  | GT_IVEC3
     1086  | GT_IVEC4
     1087  | GT_UVEC2
     1088  | GT_UVEC3
     1089  | GT_UVEC4
     1090  | GT_MAT2
     1091  | GT_MAT3
     1092  | GT_MAT4
     1093  | GT_MAT2X2
     1094  | GT_MAT2X3
     1095  | GT_MAT2X4
     1096  | GT_MAT3X2
     1097  | GT_MAT3X3
     1098  | GT_MAT3X4
     1099  | GT_MAT4X2
     1100  | GT_MAT4X3
     1101  | GT_MAT4X4
     1102  | GT_DMAT2
     1103  | GT_DMAT3
     1104  | GT_DMAT4
     1105  | GT_DMAT2X2
     1106  | GT_DMAT2X3
     1107  | GT_DMAT2X4
     1108  | GT_DMAT3X2
     1109  | GT_DMAT3X3
     1110  | GT_DMAT3X4
     1111  | GT_DMAT4X2
     1112  | GT_DMAT4X3
     1113  | GT_DMAT4X4
     1114  | GHT_SAMPLER1D
     1115  | GHT_SAMPLER2D
     1116  | GHT_SAMPLER3D
     1117  | GHT_SAMPLERCUBE
     1118  | GT_SAMPLER1DSHADOW
     1119  | GT_SAMPLER2DSHADOW
     1120  | GT_SAMPLERCUBESHADOW
     1121  | GT_SAMPLER1DARRAY
     1122  | GT_SAMPLER2DARRAY
     1123  | GT_SAMPLER1DARRAYSHADOW
     1124  | GT_SAMPLER2DARRAYSHADOW
     1125  | GT_SAMPLERCUBEARRAY
     1126  | GT_SAMPLERCUBEARRAYSHADOW
     1127  | GT_ISAMPLER1D
     1128  | GT_ISAMPLER2D
     1129  | GT_ISAMPLER3D
     1130  | GT_ISAMPLERCUBE
     1131  | GT_ISAMPLER1DARRAY
     1132  | GT_ISAMPLER2DARRAY
     1133  | GT_ISAMPLERCUBEARRAY
     1134  | GT_USAMPLER1D
     1135  | GT_USAMPLER2D
     1136  | GT_USAMPLER3D
     1137  | GT_USAMPLERCUBE
     1138  | GT_USAMPLER1DARRAY
     1139  | GT_USAMPLER2DARRAY
     1140  | GT_USAMPLERCUBEARRAY
     1141  | GT_SAMPLER2DRECT
     1142  | GT_SAMPLER2DRECTSHADOW
     1143  | GT_ISAMPLER2DRECT
     1144  | GT_USAMPLER2DRECT
     1145  | GT_SAMPLERBUFFER
     1146  | GT_ISAMPLERBUFFER
     1147  | GT_USAMPLERBUFFER
     1148  | GT_SAMPLER2DMS
     1149  | GT_ISAMPLER2DMS
     1150  | GT_USAMPLER2DMS
     1151  | GT_SAMPLER2DMSARRAY
     1152  | GT_ISAMPLER2DMSARRAY
     1153  | GT_USAMPLER2DMSARRAY
     1154  | glsl_struct_specifier
     1155  | TYPENAME
    6701156    ;
    6711157
    6721158glsl_precision_qualifier:
    6731159    GT_HIGHP
    674     | GT_MEDIUMP
    675     | GT_LOWP
     1160  | GT_MEDIUMP
     1161  | GT_LOWP
    6761162    ;
    6771163
    6781164glsl_struct_specifier:
    6791165    GHT_STRUCT IDENTIFIER '{' glsl_struct_declaration_list '}'
    680     | GHT_STRUCT '{' glsl_struct_declaration_list '}'
     1166  | GHT_STRUCT '{' glsl_struct_declaration_list '}'
    6811167    ;
    6821168
    6831169glsl_struct_declaration_list:
    6841170    glsl_struct_declaration
    685     | glsl_struct_declaration_list glsl_struct_declaration
     1171  | glsl_struct_declaration_list glsl_struct_declaration
    6861172    ;
    6871173
    6881174glsl_struct_declaration:
    6891175    glsl_type_specifier glsl_struct_declarator_list ';'
    690     | glsl_type_qualifier glsl_type_specifier glsl_struct_declarator_list ';'
     1176  | glsl_type_qualifier glsl_type_specifier glsl_struct_declarator_list ';'
    6911177    ;
    6921178
    6931179glsl_struct_declarator_list:
    6941180    glsl_struct_declarator
    695     | glsl_struct_declarator_list ',' glsl_struct_declarator
     1181  | glsl_struct_declarator_list ',' glsl_struct_declarator
    6961182    ;
    6971183
    6981184glsl_struct_declarator:
    6991185    IDENTIFIER
    700     | IDENTIFIER '[' ']'
    701     | IDENTIFIER '[' glsl_constant_expression ']'
     1186  | IDENTIFIER '[' ']'
     1187  | IDENTIFIER '[' glsl_constant_expression ']'
    7021188    ;
    7031189
     
    7121198glsl_statement:
    7131199    glsl_compound_statement
    714     | glsl_simple_statement
     1200  | glsl_simple_statement
    7151201    ;
    7161202
    7171203glsl_simple_statement:
    7181204    glsl_declaration_statement
    719     | glsl_expression_statement
    720     | glsl_selection_statement
    721     | glsl_switch_statement
    722     | glsl_case_label
    723     | glsl_iteration_statement
    724     | glsl_jump_statement
     1205  | glsl_expression_statement
     1206  | glsl_selection_statement
     1207  | glsl_switch_statement
     1208  | glsl_case_label
     1209  | glsl_iteration_statement
     1210  | glsl_jump_statement
    7251211    ;
    7261212
    7271213glsl_compound_statement:
    7281214    '{' '}'
    729     | '{' glsl_statement_list '}'
     1215  | '{' glsl_statement_list '}'
    7301216    ;
    7311217
    7321218glsl_statement_no_new_scope:
    7331219    glsl_compound_statement_no_new_scope
    734     | glsl_simple_statement
     1220  | glsl_simple_statement
    7351221    ;
    7361222
    7371223glsl_compound_statement_no_new_scope:
    7381224    '{' '}'
    739     | '{' glsl_statement_list '}'
     1225  | '{' glsl_statement_list '}'
    7401226    ;
    7411227
    7421228glsl_statement_list:
    7431229    glsl_statement
    744     | glsl_statement_list glsl_statement
     1230  | glsl_statement_list glsl_statement
    7451231    ;
    7461232
    7471233glsl_expression_statement:
    7481234    ';'
    749     | glsl_expression ';'
     1235  | glsl_expression ';'
    7501236    ;
    7511237
     
    7561242glsl_selection_rest_statement:
    7571243    glsl_statement GHT_ELSE glsl_statement
    758     | glsl_statement
     1244  | glsl_statement
    7591245    ;
    7601246
    7611247glsl_condition:
    7621248    glsl_expression
    763     | glsl_fully_specified_type IDENTIFIER '=' glsl_initializer
     1249  | glsl_fully_specified_type IDENTIFIER '=' glsl_initializer
    7641250    ;
    7651251
     
    7701256glsl_switch_statement_list:
    7711257    /* nothing */
    772     | glsl_statement_list
     1258  | glsl_statement_list
    7731259    ;
    7741260
    7751261glsl_case_label:
    7761262    GHT_CASE glsl_expression ':'
    777     | GHT_DEFAULT ':'
     1263  | GHT_DEFAULT ':'
    7781264    ;
    7791265
    7801266glsl_iteration_statement:
    7811267    GHT_WHILE '(' glsl_condition ')' glsl_statement_no_new_scope
    782     | GHT_DO glsl_statement GHT_WHILE '(' glsl_expression ')' ';'
    783     | GHT_FOR '(' glsl_for_init_statement glsl_for_rest_statement ')' glsl_statement_no_new_scope
     1268  | GHT_DO glsl_statement GHT_WHILE '(' glsl_expression ')' ';'
     1269  | GHT_FOR '(' glsl_for_init_statement glsl_for_rest_statement ')' glsl_statement_no_new_scope
    7841270    ;
    7851271
    7861272glsl_for_init_statement:
    7871273    glsl_expression_statement
    788     | glsl_declaration_statement
     1274  | glsl_declaration_statement
    7891275    ;
    7901276
    7911277glsl_conditionopt:
    7921278    glsl_condition
    793     | /* empty */
     1279  | /* empty */
    7941280    ;
    7951281
    7961282glsl_for_rest_statement:
    7971283    glsl_conditionopt ';'
    798     | glsl_conditionopt ';' glsl_expression
     1284  | glsl_conditionopt ';' glsl_expression
    7991285    ;
    8001286
    8011287glsl_jump_statement:
    8021288    GHT_CONTINUE ';'
    803     | GHT_BREAK ';'
    804     | GHT_RETURN ';'
    805     | GHT_RETURN glsl_expression ';'
    806     | GHT_DISCARD ';'
     1289  | GHT_BREAK ';'
     1290  | GHT_RETURN ';'
     1291  | GHT_RETURN glsl_expression ';'
     1292  | GHT_DISCARD ';'
    8071293    ;
    8081294
    8091295glsl_translation_unit:
    8101296    glsl_external_declaration
    811     | glsl_translation_unit glsl_external_declaration
     1297  | glsl_translation_unit glsl_external_declaration
    8121298    ;
    8131299
    8141300glsl_external_declaration:
    8151301    glsl_function_definition
    816     | glsl_declaration
     1302  | glsl_declaration
    8171303    ;
    8181304
     
    8251311main()
    8261312{
    827     yyin = fopen("test.lolfx", "r");
     1313    yyin = stdin;//fopen("test.lolfx", "r");
    8281314    do
    8291315    {
  • trunk/test/sandbox/lex/test.lolfx

    r1409 r1427  
    6767/* Defines GLSL shader "Prout" */
    6868
    69 #section GLSL.Prout
     69#region GLSL.Prout
    7070
    7171#version 120
     
    8181void main(void)
    8282{
    83     ...
     83    /* ... */
    8484}
    8585
    8686/* Defines GLSL shader "Zob" */
    8787
    88 #section GLSL.Zob
     88#region GLSL.Zob
    8989
    9090void main(void)
    9191{
    92     shit fuck fuck shit;
     92    shit(); fuck(); fuck(); shit();
    9393}
    9494
    9595/* Defines HLSL shader "Prout" */
    9696
    97 #section HLSL.Prout
     97#region HLSL.Prout
    9898
    9999void main(void)
Note: See TracChangeset for help on using the changeset viewer.