Changeset 1427 for trunk/test/sandbox/lex/lolfx.y
 Timestamp:
 May 30, 2012, 7:59:15 PM (9 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/test/sandbox/lex/lolfx.y
r1413 r1427 43 43 44 44 /* 45 * Deprecated GLSL keywords 46 */ 47 48 %token GT_ATTRIBUTE 49 50 /* 45 51 * GLSL types 46 52 */ … … 83 89 84 90 /* 85 * HLSL and GLSL keywords91 * GLSL keywords that are also in HLSL 86 92 */ 87 93 … … 91 97 %token GHT_SAMPLER1D GHT_SAMPLER2D GHT_SAMPLER3D GHT_SAMPLERCUBE GHT_STRUCT 92 98 %token GHT_SWITCH GHT_UINT GHT_UNIFORM GHT_VOID GHT_WHILE 99 100 /* 101 * HLSL keywords that are also in GLSL 102 */ 93 103 94 104 %token HGT_BOOL HGT_BREAK HGT_CASE HGT_CENTROID HGT_CONST HGT_CONTINUE … … 183 193 184 194 /* 185 * Language keywords195 * Language symbols 186 196 */ 187 197 … … 194 204 */ 195 205 196 %token <ival> INT197 206 %token <fval> FLOAT 198 207 %token <sval> STRING NAME 199 208 209 /* 210 * Our entry point 211 */ 212 213 %start lolfx_file 214 200 215 %% 216 217 /* 218 * Shortcuts for token groups 219 */ 220 221 group_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 236 group_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 314 group_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 347 group_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 380 group_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 473 group_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 596 group_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 612 group_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 647 group_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 */ 201 674 202 675 lolfx_file: … … 206 679 lolfx_section_list: 207 680 lolfx_section 208  lolfx_section_list lolfx_section681  lolfx_section lolfx_section_list 209 682 ; 210 683 211 684 lolfx_section: 212 685 lolfx_technique 213 686  lolfx_shader 214 687 ; 215 688 … … 219 692 220 693 lolfx_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; } 222 695 ; 223 696 … … 228 701 pass_list: 229 702 pass 230  pass_list pass703  pass pass_list 231 704 ; 232 705 233 706 pass: 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; } 235 708 ; 236 709 237 710 pass_stmt_list: 238 711 pass_stmt 239  pass_stmt_list pass_stmt 240 ; 241 712  pass_stmt pass_stmt_list 713 ; 714 715 /* Shitty shit */ 242 716 pass_stmt: 243 717 ';' 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 ';' 248 732 ; 249 733 … … 254 738 lolfx_shader: 255 739 lolfx_shader_region glsl_translation_unit 256 740  lolfx_shader_region 257 741 ; 258 742 … … 263 747 lolfx_shader_name: 264 748 IDENTIFIER { $$ = $1; } 265  lolfx_shader_name '.' IDENTIFIER{ $$ = $3; } /* FIXME: concatenate */749  lolfx_shader_name '.' IDENTIFIER { $$ = $3; } /* FIXME: concatenate */ 266 750 ; 267 751 … … 276 760 glsl_primary_expression: 277 761 glsl_variable_identifier 278 279 280 281 282 762  INTCONSTANT 763  UINTCONSTANT 764  FLOATCONSTANT 765  BOOLCONSTANT 766  '(' glsl_expression ')' 283 767 ; 284 768 285 769 glsl_postfix_expression: 286 770 glsl_primary_expression 287 288 289 290 291 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 292 776 ; 293 777 … … 302 786 glsl_function_call_or_method: 303 787 glsl_function_call_generic 304 788  glsl_postfix_expression '.' glsl_function_call_generic 305 789 ; 306 790 307 791 glsl_function_call_generic: 308 792 glsl_function_call_header_with_parameters ')' 309 793  glsl_function_call_header_no_parameters ')' 310 794 ; 311 795 312 796 glsl_function_call_header_no_parameters: 313 797 glsl_function_call_header GHT_VOID 314 798  glsl_function_call_header 315 799 ; 316 800 317 801 glsl_function_call_header_with_parameters: 318 802 glsl_function_call_header glsl_assignment_expression 319 803  glsl_function_call_header_with_parameters ',' glsl_assignment_expression 320 804 ; 321 805 … … 326 810 glsl_function_identifier: 327 811 glsl_type_specifier 328 329 812  IDENTIFIER 813  FIELDSELECTION 330 814 ; 331 815 332 816 glsl_unary_expression: 333 817 glsl_postfix_expression 334 335 336 818  T_INC glsl_unary_expression 819  T_DEC glsl_unary_expression 820  glsl_unary_operator glsl_unary_expression 337 821 ; 338 822 339 823 glsl_unary_operator: 340 824 '+' 341 342 343 825  '' 826  '!' 827  '~' 344 828 ; 345 829 346 830 glsl_multiplicative_expression: 347 831 glsl_unary_expression 348 349 350 832  glsl_multiplicative_expression '*' glsl_unary_expression 833  glsl_multiplicative_expression '/' glsl_unary_expression 834  glsl_multiplicative_expression '%' glsl_unary_expression 351 835 ; 352 836 353 837 glsl_additive_expression: 354 838 glsl_multiplicative_expression 355 356 839  glsl_additive_expression '+' glsl_multiplicative_expression 840  glsl_additive_expression '' glsl_multiplicative_expression 357 841 ; 358 842 359 843 glsl_shift_expression: 360 844 glsl_additive_expression 361 362 845  glsl_shift_expression T_LEFT glsl_additive_expression 846  glsl_shift_expression T_RIGHT glsl_additive_expression 363 847 ; 364 848 365 849 glsl_relational_expression: 366 850 glsl_shift_expression 367 368 369 370 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 371 855 ; 372 856 373 857 glsl_equality_expression: 374 858 glsl_relational_expression 375 376 859  glsl_equality_expression T_EQ glsl_relational_expression 860  glsl_equality_expression T_NE glsl_relational_expression 377 861 ; 378 862 379 863 glsl_and_expression: 380 864 glsl_equality_expression 381 865  glsl_and_expression '&' glsl_equality_expression 382 866 ; 383 867 384 868 glsl_exclusive_or_expression: 385 869 glsl_and_expression 386 870  glsl_exclusive_or_expression '^' glsl_and_expression 387 871 ; 388 872 389 873 glsl_inclusive_or_expression: 390 874 glsl_exclusive_or_expression 391 875  glsl_inclusive_or_expression '' glsl_exclusive_or_expression 392 876 ; 393 877 394 878 glsl_logical_and_expression: 395 879 glsl_inclusive_or_expression 396 880  glsl_logical_and_expression T_AND glsl_inclusive_or_expression 397 881 ; 398 882 399 883 glsl_logical_xor_expression: 400 884 glsl_logical_and_expression 401 885  glsl_logical_xor_expression T_XOR glsl_logical_and_expression 402 886 ; 403 887 404 888 glsl_logical_or_expression: 405 889 glsl_logical_xor_expression 406 890  glsl_logical_or_expression T_OR glsl_logical_xor_expression 407 891 ; 408 892 409 893 glsl_conditional_expression: 410 894 glsl_logical_or_expression 411 895  glsl_logical_or_expression '?' glsl_expression ':' glsl_assignment_expression 412 896 ; 413 897 414 898 glsl_assignment_expression: 415 899 glsl_conditional_expression 416 900  glsl_unary_expression glsl_assignment_operator glsl_assignment_expression 417 901 ; 418 902 419 903 glsl_assignment_operator: 420 904 '=' 421 422 423 424 425 426 427 428 429 430 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 431 915 ; 432 916 433 917 glsl_expression: 434 918 glsl_assignment_expression 435 919  glsl_expression ',' glsl_assignment_expression 436 920 ; 437 921 … … 442 926 glsl_declaration: 443 927 glsl_function_prototype ';' 444 445 446 447 448 449 450 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 ';' 451 935 ; 452 936 … … 457 941 glsl_function_declarator: 458 942 glsl_function_header 459 943  glsl_function_header_with_parameters 460 944 ; 461 945 462 946 glsl_function_header_with_parameters: 463 947 glsl_function_header glsl_parameter_declaration 464 948  glsl_function_header_with_parameters ',' glsl_parameter_declaration 465 949 ; 466 950 … … 471 955 glsl_parameter_declarator: 472 956 glsl_type_specifier IDENTIFIER 473 957  glsl_type_specifier IDENTIFIER '[' glsl_constant_expression ']' 474 958 ; 475 959 476 960 glsl_parameter_declaration: 477 961 glsl_parameter_type_qualifier glsl_parameter_qualifier glsl_parameter_declarator 478 479 480 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 481 965 ; 482 966 483 967 glsl_parameter_qualifier: 484 968 /* empty */ 485  GHT_IN 486  GHT_OUT 487  GHT_INOUT 969  GHT_IN 970  GHT_OUT 971  GHT_INOUT 972  GT_ATTRIBUTE /* deprecated */ 488 973 ; 489 974 … … 494 979 glsl_init_declarator_list: 495 980 glsl_single_declaration 496 497 498 499 500 501 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 502 987 ; 503 988 504 989 glsl_single_declaration: 505 990 glsl_fully_specified_type 506 507 508 509 510 511 512 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 513 998 ; 514 999 515 1000 glsl_fully_specified_type: 516 1001 glsl_type_specifier 517 1002  glsl_type_qualifier glsl_type_specifier 518 1003 ; 519 1004 … … 524 1009 glsl_interpolation_qualifier: 525 1010 GT_SMOOTH 526 527 1011  GT_FLAT 1012  GHT_NOPERSPECTIVE 528 1013 ; 529 1014 … … 534 1019 glsl_layout_qualifier_id_list: 535 1020 glsl_layout_qualifier_id 536 1021  glsl_layout_qualifier_id_list ',' glsl_layout_qualifier_id 537 1022 ; 538 1023 539 1024 glsl_layout_qualifier_id: 540 1025 IDENTIFIER 541 1026  IDENTIFIER '=' INTCONSTANT 542 1027 ; 543 1028 … … 548 1033 glsl_type_qualifier: 549 1034 glsl_storage_qualifier 550 551 552 553 554 555 556 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 557 1042 ; 558 1043 559 1044 glsl_storage_qualifier: 560 1045 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 */ 570 1056 ; 571 1057 572 1058 glsl_type_specifier: 573 1059 glsl_type_specifier_no_prec 574 1060  glsl_precision_qualifier glsl_type_specifier_no_prec 575 1061 ; 576 1062 577 1063 glsl_type_specifier_no_prec: 578 1064 glsl_type_specifier_nonarray 579 580 1065  glsl_type_specifier_nonarray '[' ']' 1066  glsl_type_specifier_nonarray '[' glsl_constant_expression ']' 581 1067 582 1068 glsl_type_specifier_nonarray: 583 1069 GHT_VOID 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 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 670 1156 ; 671 1157 672 1158 glsl_precision_qualifier: 673 1159 GT_HIGHP 674 675 1160  GT_MEDIUMP 1161  GT_LOWP 676 1162 ; 677 1163 678 1164 glsl_struct_specifier: 679 1165 GHT_STRUCT IDENTIFIER '{' glsl_struct_declaration_list '}' 680 1166  GHT_STRUCT '{' glsl_struct_declaration_list '}' 681 1167 ; 682 1168 683 1169 glsl_struct_declaration_list: 684 1170 glsl_struct_declaration 685 1171  glsl_struct_declaration_list glsl_struct_declaration 686 1172 ; 687 1173 688 1174 glsl_struct_declaration: 689 1175 glsl_type_specifier glsl_struct_declarator_list ';' 690 1176  glsl_type_qualifier glsl_type_specifier glsl_struct_declarator_list ';' 691 1177 ; 692 1178 693 1179 glsl_struct_declarator_list: 694 1180 glsl_struct_declarator 695 1181  glsl_struct_declarator_list ',' glsl_struct_declarator 696 1182 ; 697 1183 698 1184 glsl_struct_declarator: 699 1185 IDENTIFIER 700 701 1186  IDENTIFIER '[' ']' 1187  IDENTIFIER '[' glsl_constant_expression ']' 702 1188 ; 703 1189 … … 712 1198 glsl_statement: 713 1199 glsl_compound_statement 714 1200  glsl_simple_statement 715 1201 ; 716 1202 717 1203 glsl_simple_statement: 718 1204 glsl_declaration_statement 719 720 721 722 723 724 1205  glsl_expression_statement 1206  glsl_selection_statement 1207  glsl_switch_statement 1208  glsl_case_label 1209  glsl_iteration_statement 1210  glsl_jump_statement 725 1211 ; 726 1212 727 1213 glsl_compound_statement: 728 1214 '{' '}' 729 1215  '{' glsl_statement_list '}' 730 1216 ; 731 1217 732 1218 glsl_statement_no_new_scope: 733 1219 glsl_compound_statement_no_new_scope 734 1220  glsl_simple_statement 735 1221 ; 736 1222 737 1223 glsl_compound_statement_no_new_scope: 738 1224 '{' '}' 739 1225  '{' glsl_statement_list '}' 740 1226 ; 741 1227 742 1228 glsl_statement_list: 743 1229 glsl_statement 744 1230  glsl_statement_list glsl_statement 745 1231 ; 746 1232 747 1233 glsl_expression_statement: 748 1234 ';' 749 1235  glsl_expression ';' 750 1236 ; 751 1237 … … 756 1242 glsl_selection_rest_statement: 757 1243 glsl_statement GHT_ELSE glsl_statement 758 1244  glsl_statement 759 1245 ; 760 1246 761 1247 glsl_condition: 762 1248 glsl_expression 763 1249  glsl_fully_specified_type IDENTIFIER '=' glsl_initializer 764 1250 ; 765 1251 … … 770 1256 glsl_switch_statement_list: 771 1257 /* nothing */ 772 1258  glsl_statement_list 773 1259 ; 774 1260 775 1261 glsl_case_label: 776 1262 GHT_CASE glsl_expression ':' 777 1263  GHT_DEFAULT ':' 778 1264 ; 779 1265 780 1266 glsl_iteration_statement: 781 1267 GHT_WHILE '(' glsl_condition ')' glsl_statement_no_new_scope 782 783 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 784 1270 ; 785 1271 786 1272 glsl_for_init_statement: 787 1273 glsl_expression_statement 788 1274  glsl_declaration_statement 789 1275 ; 790 1276 791 1277 glsl_conditionopt: 792 1278 glsl_condition 793 1279  /* empty */ 794 1280 ; 795 1281 796 1282 glsl_for_rest_statement: 797 1283 glsl_conditionopt ';' 798 1284  glsl_conditionopt ';' glsl_expression 799 1285 ; 800 1286 801 1287 glsl_jump_statement: 802 1288 GHT_CONTINUE ';' 803 804 805 806 1289  GHT_BREAK ';' 1290  GHT_RETURN ';' 1291  GHT_RETURN glsl_expression ';' 1292  GHT_DISCARD ';' 807 1293 ; 808 1294 809 1295 glsl_translation_unit: 810 1296 glsl_external_declaration 811 1297  glsl_translation_unit glsl_external_declaration 812 1298 ; 813 1299 814 1300 glsl_external_declaration: 815 1301 glsl_function_definition 816 1302  glsl_declaration 817 1303 ; 818 1304 … … 825 1311 main() 826 1312 { 827 yyin = fopen("test.lolfx", "r");1313 yyin = stdin;//fopen("test.lolfx", "r"); 828 1314 do 829 1315 {
Note: See TracChangeset
for help on using the changeset viewer.