successfully parse a few of our full GLSL/HLSL shaders.legacy
@@ -39,13 +39,13 @@ bool EasyMeshCompiler::ParseString(char const *command) | |||
void EasyMeshCompiler::Error(const class location& l, const std::string& m) | |||
{ | |||
Log::Error("Syntax error line %d column %d: %s", | |||
Log::Error("EasyMesh syntax error line %d column %d: %s\n", | |||
l.begin.line, l.begin.column, m.c_str()); | |||
} | |||
void EasyMeshCompiler::Error(const std::string& m) | |||
{ | |||
Log::Error("Syntax error: %s", m.c_str()); | |||
Log::Error("EasyMesh syntax error: %s\n", m.c_str()); | |||
} | |||
} /* namespace lol */ | |||
@@ -118,365 +118,365 @@ namespace lol { | |||
GT_LOWP = 274, | |||
GT_PRECISION = 275, | |||
GT_ATTRIBUTE = 276, | |||
GT_VEC2 = 277, | |||
GT_VEC3 = 278, | |||
GT_VEC4 = 279, | |||
GT_BVEC2 = 280, | |||
GT_BVEC3 = 281, | |||
GT_BVEC4 = 282, | |||
GT_DVEC2 = 283, | |||
GT_DVEC3 = 284, | |||
GT_DVEC4 = 285, | |||
GT_IVEC2 = 286, | |||
GT_IVEC3 = 287, | |||
GT_IVEC4 = 288, | |||
GT_UVEC2 = 289, | |||
GT_UVEC3 = 290, | |||
GT_UVEC4 = 291, | |||
GT_MAT2 = 292, | |||
GT_MAT2X2 = 293, | |||
GT_MAT2X3 = 294, | |||
GT_MAT2X4 = 295, | |||
GT_MAT3 = 296, | |||
GT_MAT3X2 = 297, | |||
GT_MAT3X3 = 298, | |||
GT_MAT3X4 = 299, | |||
GT_MAT4 = 300, | |||
GT_MAT4X2 = 301, | |||
GT_MAT4X3 = 302, | |||
GT_MAT4X4 = 303, | |||
GT_DMAT2 = 304, | |||
GT_DMAT2X2 = 305, | |||
GT_DMAT2X3 = 306, | |||
GT_DMAT2X4 = 307, | |||
GT_DMAT3 = 308, | |||
GT_DMAT3X2 = 309, | |||
GT_DMAT3X3 = 310, | |||
GT_DMAT3X4 = 311, | |||
GT_DMAT4 = 312, | |||
GT_DMAT4X2 = 313, | |||
GT_DMAT4X3 = 314, | |||
GT_DMAT4X4 = 315, | |||
GT_SAMPLER1DSHADOW = 316, | |||
GT_SAMPLER1DARRAY = 317, | |||
GT_SAMPLER1DARRAYSHADOW = 318, | |||
GT_SAMPLER2DSHADOW = 319, | |||
GT_SAMPLER2DARRAY = 320, | |||
GT_SAMPLER2DARRAYSHADOW = 321, | |||
GT_SAMPLER2DRECT = 322, | |||
GT_SAMPLER2DRECTSHADOW = 323, | |||
GT_SAMPLER2DMS = 324, | |||
GT_SAMPLER2DMSARRAY = 325, | |||
GT_SAMPLERCUBESHADOW = 326, | |||
GT_SAMPLERCUBEARRAY = 327, | |||
GT_SAMPLERCUBEARRAYSHADOW = 328, | |||
GT_SAMPLERBUFFER = 329, | |||
GT_ISAMPLER1D = 330, | |||
GT_ISAMPLER1DARRAY = 331, | |||
GT_ISAMPLER2D = 332, | |||
GT_ISAMPLER2DARRAY = 333, | |||
GT_ISAMPLER2DRECT = 334, | |||
GT_ISAMPLER2DMS = 335, | |||
GT_ISAMPLER2DMSARRAY = 336, | |||
GT_ISAMPLER3D = 337, | |||
GT_ISAMPLERCUBE = 338, | |||
GT_ISAMPLERCUBEARRAY = 339, | |||
GT_ISAMPLERBUFFER = 340, | |||
GT_USAMPLER1D = 341, | |||
GT_USAMPLER1DARRAY = 342, | |||
GT_USAMPLER2D = 343, | |||
GT_USAMPLER2DARRAY = 344, | |||
GT_USAMPLER2DRECT = 345, | |||
GT_USAMPLER2DMS = 346, | |||
GT_USAMPLER2DMSARRAY = 347, | |||
GT_USAMPLER3D = 348, | |||
GT_USAMPLERCUBE = 349, | |||
GT_USAMPLERCUBEARRAY = 350, | |||
GT_USAMPLERBUFFER = 351, | |||
GHT_BOOL = 352, | |||
GHT_BREAK = 353, | |||
GHT_CASE = 354, | |||
GHT_CENTROID = 355, | |||
GHT_CONST = 356, | |||
GHT_CONTINUE = 357, | |||
GHT_DEFAULT = 358, | |||
GHT_DISCARD = 359, | |||
GHT_DO = 360, | |||
GHT_DOUBLE = 361, | |||
GHT_ELSE = 362, | |||
GHT_FLOAT = 363, | |||
GHT_FOR = 364, | |||
GHT_IF = 365, | |||
GHT_IN = 366, | |||
GHT_INOUT = 367, | |||
GHT_INT = 368, | |||
GHT_NOPERSPECTIVE = 369, | |||
GHT_OUT = 370, | |||
GHT_RETURN = 371, | |||
GHT_SAMPLER1D = 372, | |||
GHT_SAMPLER2D = 373, | |||
GHT_SAMPLER3D = 374, | |||
GHT_SAMPLERCUBE = 375, | |||
GHT_STRUCT = 376, | |||
GHT_SWITCH = 377, | |||
GHT_UINT = 378, | |||
GHT_UNIFORM = 379, | |||
GHT_VOID = 380, | |||
GHT_WHILE = 381, | |||
HGT_BOOL = 382, | |||
HGT_BREAK = 383, | |||
HGT_CASE = 384, | |||
HGT_CENTROID = 385, | |||
HGT_CONST = 386, | |||
HGT_CONTINUE = 387, | |||
HGT_DEFAULT = 388, | |||
HGT_DISCARD = 389, | |||
HGT_DO = 390, | |||
HGT_DOUBLE = 391, | |||
HGT_ELSE = 392, | |||
HGT_FLOAT = 393, | |||
HGT_FOR = 394, | |||
HGT_IF = 395, | |||
HGT_IN = 396, | |||
HGT_INOUT = 397, | |||
HGT_INT = 398, | |||
HGT_NOPERSPECTIVE = 399, | |||
HGT_OUT = 400, | |||
HGT_RETURN = 401, | |||
HGT_SAMPLER1D = 402, | |||
HGT_SAMPLER2D = 403, | |||
HGT_SAMPLER3D = 404, | |||
HGT_SAMPLERCUBE = 405, | |||
HGT_STRUCT = 406, | |||
HGT_SWITCH = 407, | |||
HGT_UINT = 408, | |||
HGT_UNIFORM = 409, | |||
HGT_VOID = 410, | |||
HGT_WHILE = 411, | |||
HT_APPENDSTRUCTUREDBUFFER = 412, | |||
HT_ASM = 413, | |||
HT_ASM_FRAGMENT = 414, | |||
HT_BLENDSTATE = 415, | |||
HT_BUFFER = 416, | |||
HT_BYTEADDRESSBUFFER = 417, | |||
HT_CBUFFER = 418, | |||
HT_COLUMN_MAJOR = 419, | |||
HT_COMPILE = 420, | |||
HT_COMPILE_FRAGMENT = 421, | |||
HT_COMPILESHADER = 422, | |||
HT_COMPUTESHADER = 423, | |||
HT_CONSUMESTRUCTUREDBUFFER = 424, | |||
HT_DEPTHSTENCILSTATE = 425, | |||
HT_DEPTHSTENCILVIEW = 426, | |||
HT_DOMAINSHADER = 427, | |||
HT_DWORD = 428, | |||
HT_EXTERN = 429, | |||
HT_FALSE = 430, | |||
HT_FXGROUP = 431, | |||
HT_GEOMETRYSHADER = 432, | |||
HT_GROUPSHARED = 433, | |||
HT_HALF = 434, | |||
HT_HULLSHADER = 435, | |||
HT_INLINE = 436, | |||
HT_INPUTPATCH = 437, | |||
HT_INTERFACE = 438, | |||
HT_LINE = 439, | |||
HT_LINEADJ = 440, | |||
HT_LINEAR = 441, | |||
HT_LINESTREAM = 442, | |||
HT_MATRIX = 443, | |||
HT_NAMESPACE = 444, | |||
HT_NOINTERPOLATION = 445, | |||
HT_NULL = 446, | |||
HT_OUTPUTPATCH = 447, | |||
HT_PACKOFFSET = 448, | |||
HT_PASS = 449, | |||
HT_PIXELFRAGMENT = 450, | |||
HT_PIXELSHADER = 451, | |||
HT_POINT = 452, | |||
HT_POINTSTREAM = 453, | |||
HT_PRECISE = 454, | |||
HT_RASTERIZERSTATE = 455, | |||
HT_RENDERTARGETVIEW = 456, | |||
HT_REGISTER = 457, | |||
HT_ROW_MAJOR = 458, | |||
HT_RWBUFFER = 459, | |||
HT_RWBYTEADDRESSBUFFER = 460, | |||
HT_RWSTRUCTUREDBUFFER = 461, | |||
HT_RWTEXTURE1D = 462, | |||
HT_RWTEXTURE1DARRAY = 463, | |||
HT_RWTEXTURE2D = 464, | |||
HT_RWTEXTURE2DARRAY = 465, | |||
HT_RWTEXTURE3D = 466, | |||
HT_SAMPLER = 467, | |||
HT_SAMPLER_STATE = 468, | |||
HT_SAMPLERSTATE = 469, | |||
HT_SAMPLERCOMPARISONSTATE = 470, | |||
HT_SHARED = 471, | |||
HT_SNORM = 472, | |||
HT_STATEBLOCK = 473, | |||
HT_STATEBLOCK_STATE = 474, | |||
HT_STATIC = 475, | |||
HT_STRING = 476, | |||
HT_STRUCTUREDBUFFER = 477, | |||
HT_TBUFFER = 478, | |||
HT_TECHNIQUE = 479, | |||
HT_TECHNIQUE10 = 480, | |||
HT_TECHNIQUE11XZ = 481, | |||
HT_TEXTURE = 482, | |||
HT_TEXTURE1D = 483, | |||
HT_TEXTURE1DARRAY = 484, | |||
HT_TEXTURE2D = 485, | |||
HT_TEXTURE2DARRAY = 486, | |||
HT_TEXTURE2DMS = 487, | |||
HT_TEXTURE2DMSARRAY = 488, | |||
HT_TEXTURE3D = 489, | |||
HT_TEXTURECUBE = 490, | |||
HT_TEXTURECUBEARRAY = 491, | |||
HT_TRUE = 492, | |||
HT_TYPEDEF = 493, | |||
HT_TRIANGLE = 494, | |||
HT_TRIANGLEADJ = 495, | |||
HT_TRIANGLESTREAM = 496, | |||
HT_UNORM = 497, | |||
HT_VECTOR = 498, | |||
HT_VERTEXFRAGMENT = 499, | |||
HT_VERTEXSHADER = 500, | |||
HT_VOLATILE = 501, | |||
HT_BOOL1 = 502, | |||
HT_BOOL1x1 = 503, | |||
HT_BOOL2x1 = 504, | |||
HT_BOOL3x1 = 505, | |||
HT_BOOL4x1 = 506, | |||
HT_BOOL2 = 507, | |||
HT_BOOL1x2 = 508, | |||
HT_BOOL2x2 = 509, | |||
HT_BOOL3x2 = 510, | |||
HT_BOOL4x2 = 511, | |||
HT_BOOL3 = 512, | |||
HT_BOOL1x3 = 513, | |||
HT_BOOL2x3 = 514, | |||
HT_BOOL3x3 = 515, | |||
HT_BOOL4x3 = 516, | |||
HT_BOOL4 = 517, | |||
HT_BOOL1x4 = 518, | |||
HT_BOOL2x4 = 519, | |||
HT_BOOL3x4 = 520, | |||
HT_BOOL4x4 = 521, | |||
HT_FLOAT1 = 522, | |||
HT_FLOAT1x1 = 523, | |||
HT_FLOAT2x1 = 524, | |||
HT_FLOAT3x1 = 525, | |||
HT_FLOAT4x1 = 526, | |||
HT_FLOAT2 = 527, | |||
HT_FLOAT1x2 = 528, | |||
HT_FLOAT2x2 = 529, | |||
HT_FLOAT3x2 = 530, | |||
HT_FLOAT4x2 = 531, | |||
HT_FLOAT3 = 532, | |||
HT_FLOAT1x3 = 533, | |||
HT_FLOAT2x3 = 534, | |||
HT_FLOAT3x3 = 535, | |||
HT_FLOAT4x3 = 536, | |||
HT_FLOAT4 = 537, | |||
HT_FLOAT1x4 = 538, | |||
HT_FLOAT2x4 = 539, | |||
HT_FLOAT3x4 = 540, | |||
HT_FLOAT4x4 = 541, | |||
HT_DOUBLE1 = 542, | |||
HT_DOUBLE1x1 = 543, | |||
HT_DOUBLE2x1 = 544, | |||
HT_DOUBLE3x1 = 545, | |||
HT_DOUBLE4x1 = 546, | |||
HT_DOUBLE2 = 547, | |||
HT_DOUBLE1x2 = 548, | |||
HT_DOUBLE2x2 = 549, | |||
HT_DOUBLE3x2 = 550, | |||
HT_DOUBLE4x2 = 551, | |||
HT_DOUBLE3 = 552, | |||
HT_DOUBLE1x3 = 553, | |||
HT_DOUBLE2x3 = 554, | |||
HT_DOUBLE3x3 = 555, | |||
HT_DOUBLE4x3 = 556, | |||
HT_DOUBLE4 = 557, | |||
HT_DOUBLE1x4 = 558, | |||
HT_DOUBLE2x4 = 559, | |||
HT_DOUBLE3x4 = 560, | |||
HT_DOUBLE4x4 = 561, | |||
HT_DWORD1 = 562, | |||
HT_DWORD1x1 = 563, | |||
HT_DWORD2x1 = 564, | |||
HT_DWORD3x1 = 565, | |||
HT_DWORD4x1 = 566, | |||
HT_DWORD2 = 567, | |||
HT_DWORD1x2 = 568, | |||
HT_DWORD2x2 = 569, | |||
HT_DWORD3x2 = 570, | |||
HT_DWORD4x2 = 571, | |||
HT_DWORD3 = 572, | |||
HT_DWORD1x3 = 573, | |||
HT_DWORD2x3 = 574, | |||
HT_DWORD3x3 = 575, | |||
HT_DWORD4x3 = 576, | |||
HT_DWORD4 = 577, | |||
HT_DWORD1x4 = 578, | |||
HT_DWORD2x4 = 579, | |||
HT_DWORD3x4 = 580, | |||
HT_DWORD4x4 = 581, | |||
HT_INT1 = 582, | |||
HT_INT1x1 = 583, | |||
HT_INT2x1 = 584, | |||
HT_INT3x1 = 585, | |||
HT_INT4x1 = 586, | |||
HT_INT2 = 587, | |||
HT_INT1x2 = 588, | |||
HT_INT2x2 = 589, | |||
HT_INT3x2 = 590, | |||
HT_INT4x2 = 591, | |||
HT_INT3 = 592, | |||
HT_INT1x3 = 593, | |||
HT_INT2x3 = 594, | |||
HT_INT3x3 = 595, | |||
HT_INT4x3 = 596, | |||
HT_INT4 = 597, | |||
HT_INT1x4 = 598, | |||
HT_INT2x4 = 599, | |||
HT_INT3x4 = 600, | |||
HT_INT4x4 = 601, | |||
HT_UINT1 = 602, | |||
HT_UINT1x1 = 603, | |||
HT_UINT2x1 = 604, | |||
HT_UINT3x1 = 605, | |||
HT_UINT4x1 = 606, | |||
HT_UINT2 = 607, | |||
HT_UINT1x2 = 608, | |||
HT_UINT2x2 = 609, | |||
HT_UINT3x2 = 610, | |||
HT_UINT4x2 = 611, | |||
HT_UINT3 = 612, | |||
HT_UINT1x3 = 613, | |||
HT_UINT2x3 = 614, | |||
HT_UINT3x3 = 615, | |||
HT_UINT4x3 = 616, | |||
HT_UINT4 = 617, | |||
HT_UINT1x4 = 618, | |||
HT_UINT2x4 = 619, | |||
HT_UINT3x4 = 620, | |||
HT_UINT4x4 = 621, | |||
PREPROCESSOR_DEFINE = 622, | |||
PREPROCESSOR_ELIF = 623, | |||
PREPROCESSOR_ELSE = 624, | |||
PREPROCESSOR_ENDIF = 625, | |||
PREPROCESSOR_ERROR = 626, | |||
PREPROCESSOR_IF = 627, | |||
PREPROCESSOR_IFDEF = 628, | |||
PREPROCESSOR_IFNDEF = 629, | |||
PREPROCESSOR_INCLUDE = 630, | |||
PREPROCESSOR_LINE = 631, | |||
PREPROCESSOR_PRAGMA = 632, | |||
PREPROCESSOR_UNDEF = 633, | |||
PREPROCESSOR_REGION = 634, | |||
PRAGMA_LOLFX = 635, | |||
GT_VARYING = 277, | |||
GT_VEC2 = 278, | |||
GT_VEC3 = 279, | |||
GT_VEC4 = 280, | |||
GT_BVEC2 = 281, | |||
GT_BVEC3 = 282, | |||
GT_BVEC4 = 283, | |||
GT_DVEC2 = 284, | |||
GT_DVEC3 = 285, | |||
GT_DVEC4 = 286, | |||
GT_IVEC2 = 287, | |||
GT_IVEC3 = 288, | |||
GT_IVEC4 = 289, | |||
GT_UVEC2 = 290, | |||
GT_UVEC3 = 291, | |||
GT_UVEC4 = 292, | |||
GT_MAT2 = 293, | |||
GT_MAT2X2 = 294, | |||
GT_MAT2X3 = 295, | |||
GT_MAT2X4 = 296, | |||
GT_MAT3 = 297, | |||
GT_MAT3X2 = 298, | |||
GT_MAT3X3 = 299, | |||
GT_MAT3X4 = 300, | |||
GT_MAT4 = 301, | |||
GT_MAT4X2 = 302, | |||
GT_MAT4X3 = 303, | |||
GT_MAT4X4 = 304, | |||
GT_DMAT2 = 305, | |||
GT_DMAT2X2 = 306, | |||
GT_DMAT2X3 = 307, | |||
GT_DMAT2X4 = 308, | |||
GT_DMAT3 = 309, | |||
GT_DMAT3X2 = 310, | |||
GT_DMAT3X3 = 311, | |||
GT_DMAT3X4 = 312, | |||
GT_DMAT4 = 313, | |||
GT_DMAT4X2 = 314, | |||
GT_DMAT4X3 = 315, | |||
GT_DMAT4X4 = 316, | |||
GT_SAMPLER1DSHADOW = 317, | |||
GT_SAMPLER1DARRAY = 318, | |||
GT_SAMPLER1DARRAYSHADOW = 319, | |||
GT_SAMPLER2DSHADOW = 320, | |||
GT_SAMPLER2DARRAY = 321, | |||
GT_SAMPLER2DARRAYSHADOW = 322, | |||
GT_SAMPLER2DRECT = 323, | |||
GT_SAMPLER2DRECTSHADOW = 324, | |||
GT_SAMPLER2DMS = 325, | |||
GT_SAMPLER2DMSARRAY = 326, | |||
GT_SAMPLERCUBESHADOW = 327, | |||
GT_SAMPLERCUBEARRAY = 328, | |||
GT_SAMPLERCUBEARRAYSHADOW = 329, | |||
GT_SAMPLERBUFFER = 330, | |||
GT_ISAMPLER1D = 331, | |||
GT_ISAMPLER1DARRAY = 332, | |||
GT_ISAMPLER2D = 333, | |||
GT_ISAMPLER2DARRAY = 334, | |||
GT_ISAMPLER2DRECT = 335, | |||
GT_ISAMPLER2DMS = 336, | |||
GT_ISAMPLER2DMSARRAY = 337, | |||
GT_ISAMPLER3D = 338, | |||
GT_ISAMPLERCUBE = 339, | |||
GT_ISAMPLERCUBEARRAY = 340, | |||
GT_ISAMPLERBUFFER = 341, | |||
GT_USAMPLER1D = 342, | |||
GT_USAMPLER1DARRAY = 343, | |||
GT_USAMPLER2D = 344, | |||
GT_USAMPLER2DARRAY = 345, | |||
GT_USAMPLER2DRECT = 346, | |||
GT_USAMPLER2DMS = 347, | |||
GT_USAMPLER2DMSARRAY = 348, | |||
GT_USAMPLER3D = 349, | |||
GT_USAMPLERCUBE = 350, | |||
GT_USAMPLERCUBEARRAY = 351, | |||
GT_USAMPLERBUFFER = 352, | |||
GHT_BOOL = 353, | |||
GHT_BREAK = 354, | |||
GHT_CASE = 355, | |||
GHT_CENTROID = 356, | |||
GHT_CONST = 357, | |||
GHT_CONTINUE = 358, | |||
GHT_DEFAULT = 359, | |||
GHT_DISCARD = 360, | |||
GHT_DO = 361, | |||
GHT_DOUBLE = 362, | |||
GHT_ELSE = 363, | |||
GHT_FLOAT = 364, | |||
GHT_FOR = 365, | |||
GHT_IF = 366, | |||
GHT_IN = 367, | |||
GHT_INOUT = 368, | |||
GHT_INT = 369, | |||
GHT_NOPERSPECTIVE = 370, | |||
GHT_OUT = 371, | |||
GHT_RETURN = 372, | |||
GHT_SAMPLER1D = 373, | |||
GHT_SAMPLER2D = 374, | |||
GHT_SAMPLER3D = 375, | |||
GHT_SAMPLERCUBE = 376, | |||
GHT_STRUCT = 377, | |||
GHT_SWITCH = 378, | |||
GHT_UINT = 379, | |||
GHT_UNIFORM = 380, | |||
GHT_VOID = 381, | |||
GHT_WHILE = 382, | |||
HGT_BOOL = 383, | |||
HGT_BREAK = 384, | |||
HGT_CASE = 385, | |||
HGT_CENTROID = 386, | |||
HGT_CONST = 387, | |||
HGT_CONTINUE = 388, | |||
HGT_DEFAULT = 389, | |||
HGT_DISCARD = 390, | |||
HGT_DO = 391, | |||
HGT_DOUBLE = 392, | |||
HGT_ELSE = 393, | |||
HGT_FLOAT = 394, | |||
HGT_FOR = 395, | |||
HGT_IF = 396, | |||
HGT_IN = 397, | |||
HGT_INOUT = 398, | |||
HGT_INT = 399, | |||
HGT_NOPERSPECTIVE = 400, | |||
HGT_OUT = 401, | |||
HGT_RETURN = 402, | |||
HGT_SAMPLER1D = 403, | |||
HGT_SAMPLER2D = 404, | |||
HGT_SAMPLER3D = 405, | |||
HGT_SAMPLERCUBE = 406, | |||
HGT_STRUCT = 407, | |||
HGT_SWITCH = 408, | |||
HGT_UINT = 409, | |||
HGT_UNIFORM = 410, | |||
HGT_VOID = 411, | |||
HGT_WHILE = 412, | |||
HT_APPENDSTRUCTUREDBUFFER = 413, | |||
HT_ASM = 414, | |||
HT_ASM_FRAGMENT = 415, | |||
HT_BLENDSTATE = 416, | |||
HT_BUFFER = 417, | |||
HT_BYTEADDRESSBUFFER = 418, | |||
HT_CBUFFER = 419, | |||
HT_COLUMN_MAJOR = 420, | |||
HT_COMPILE = 421, | |||
HT_COMPILE_FRAGMENT = 422, | |||
HT_COMPILESHADER = 423, | |||
HT_COMPUTESHADER = 424, | |||
HT_CONSUMESTRUCTUREDBUFFER = 425, | |||
HT_DEPTHSTENCILSTATE = 426, | |||
HT_DEPTHSTENCILVIEW = 427, | |||
HT_DOMAINSHADER = 428, | |||
HT_DWORD = 429, | |||
HT_EXTERN = 430, | |||
HT_FALSE = 431, | |||
HT_FXGROUP = 432, | |||
HT_GEOMETRYSHADER = 433, | |||
HT_GROUPSHARED = 434, | |||
HT_HALF = 435, | |||
HT_HULLSHADER = 436, | |||
HT_INLINE = 437, | |||
HT_INPUTPATCH = 438, | |||
HT_INTERFACE = 439, | |||
HT_LINE = 440, | |||
HT_LINEADJ = 441, | |||
HT_LINEAR = 442, | |||
HT_LINESTREAM = 443, | |||
HT_MATRIX = 444, | |||
HT_NAMESPACE = 445, | |||
HT_NOINTERPOLATION = 446, | |||
HT_NULL = 447, | |||
HT_OUTPUTPATCH = 448, | |||
HT_PACKOFFSET = 449, | |||
HT_PASS = 450, | |||
HT_PIXELFRAGMENT = 451, | |||
HT_PIXELSHADER = 452, | |||
HT_POINT = 453, | |||
HT_POINTSTREAM = 454, | |||
HT_PRECISE = 455, | |||
HT_RASTERIZERSTATE = 456, | |||
HT_RENDERTARGETVIEW = 457, | |||
HT_REGISTER = 458, | |||
HT_ROW_MAJOR = 459, | |||
HT_RWBUFFER = 460, | |||
HT_RWBYTEADDRESSBUFFER = 461, | |||
HT_RWSTRUCTUREDBUFFER = 462, | |||
HT_RWTEXTURE1D = 463, | |||
HT_RWTEXTURE1DARRAY = 464, | |||
HT_RWTEXTURE2D = 465, | |||
HT_RWTEXTURE2DARRAY = 466, | |||
HT_RWTEXTURE3D = 467, | |||
HT_SAMPLER = 468, | |||
HT_SAMPLER_STATE = 469, | |||
HT_SAMPLERSTATE = 470, | |||
HT_SAMPLERCOMPARISONSTATE = 471, | |||
HT_SHARED = 472, | |||
HT_SNORM = 473, | |||
HT_STATEBLOCK = 474, | |||
HT_STATEBLOCK_STATE = 475, | |||
HT_STATIC = 476, | |||
HT_STRING = 477, | |||
HT_STRUCTUREDBUFFER = 478, | |||
HT_TBUFFER = 479, | |||
HT_TECHNIQUE = 480, | |||
HT_TECHNIQUE10 = 481, | |||
HT_TECHNIQUE11XZ = 482, | |||
HT_TEXTURE = 483, | |||
HT_TEXTURE1D = 484, | |||
HT_TEXTURE1DARRAY = 485, | |||
HT_TEXTURE2D = 486, | |||
HT_TEXTURE2DARRAY = 487, | |||
HT_TEXTURE2DMS = 488, | |||
HT_TEXTURE2DMSARRAY = 489, | |||
HT_TEXTURE3D = 490, | |||
HT_TEXTURECUBE = 491, | |||
HT_TEXTURECUBEARRAY = 492, | |||
HT_TRUE = 493, | |||
HT_TYPEDEF = 494, | |||
HT_TRIANGLE = 495, | |||
HT_TRIANGLEADJ = 496, | |||
HT_TRIANGLESTREAM = 497, | |||
HT_UNORM = 498, | |||
HT_VECTOR = 499, | |||
HT_VERTEXFRAGMENT = 500, | |||
HT_VERTEXSHADER = 501, | |||
HT_VOLATILE = 502, | |||
HT_BOOL1 = 503, | |||
HT_BOOL1x1 = 504, | |||
HT_BOOL2x1 = 505, | |||
HT_BOOL3x1 = 506, | |||
HT_BOOL4x1 = 507, | |||
HT_BOOL2 = 508, | |||
HT_BOOL1x2 = 509, | |||
HT_BOOL2x2 = 510, | |||
HT_BOOL3x2 = 511, | |||
HT_BOOL4x2 = 512, | |||
HT_BOOL3 = 513, | |||
HT_BOOL1x3 = 514, | |||
HT_BOOL2x3 = 515, | |||
HT_BOOL3x3 = 516, | |||
HT_BOOL4x3 = 517, | |||
HT_BOOL4 = 518, | |||
HT_BOOL1x4 = 519, | |||
HT_BOOL2x4 = 520, | |||
HT_BOOL3x4 = 521, | |||
HT_BOOL4x4 = 522, | |||
HT_FLOAT1 = 523, | |||
HT_FLOAT1x1 = 524, | |||
HT_FLOAT2x1 = 525, | |||
HT_FLOAT3x1 = 526, | |||
HT_FLOAT4x1 = 527, | |||
HT_FLOAT2 = 528, | |||
HT_FLOAT1x2 = 529, | |||
HT_FLOAT2x2 = 530, | |||
HT_FLOAT3x2 = 531, | |||
HT_FLOAT4x2 = 532, | |||
HT_FLOAT3 = 533, | |||
HT_FLOAT1x3 = 534, | |||
HT_FLOAT2x3 = 535, | |||
HT_FLOAT3x3 = 536, | |||
HT_FLOAT4x3 = 537, | |||
HT_FLOAT4 = 538, | |||
HT_FLOAT1x4 = 539, | |||
HT_FLOAT2x4 = 540, | |||
HT_FLOAT3x4 = 541, | |||
HT_FLOAT4x4 = 542, | |||
HT_DOUBLE1 = 543, | |||
HT_DOUBLE1x1 = 544, | |||
HT_DOUBLE2x1 = 545, | |||
HT_DOUBLE3x1 = 546, | |||
HT_DOUBLE4x1 = 547, | |||
HT_DOUBLE2 = 548, | |||
HT_DOUBLE1x2 = 549, | |||
HT_DOUBLE2x2 = 550, | |||
HT_DOUBLE3x2 = 551, | |||
HT_DOUBLE4x2 = 552, | |||
HT_DOUBLE3 = 553, | |||
HT_DOUBLE1x3 = 554, | |||
HT_DOUBLE2x3 = 555, | |||
HT_DOUBLE3x3 = 556, | |||
HT_DOUBLE4x3 = 557, | |||
HT_DOUBLE4 = 558, | |||
HT_DOUBLE1x4 = 559, | |||
HT_DOUBLE2x4 = 560, | |||
HT_DOUBLE3x4 = 561, | |||
HT_DOUBLE4x4 = 562, | |||
HT_DWORD1 = 563, | |||
HT_DWORD1x1 = 564, | |||
HT_DWORD2x1 = 565, | |||
HT_DWORD3x1 = 566, | |||
HT_DWORD4x1 = 567, | |||
HT_DWORD2 = 568, | |||
HT_DWORD1x2 = 569, | |||
HT_DWORD2x2 = 570, | |||
HT_DWORD3x2 = 571, | |||
HT_DWORD4x2 = 572, | |||
HT_DWORD3 = 573, | |||
HT_DWORD1x3 = 574, | |||
HT_DWORD2x3 = 575, | |||
HT_DWORD3x3 = 576, | |||
HT_DWORD4x3 = 577, | |||
HT_DWORD4 = 578, | |||
HT_DWORD1x4 = 579, | |||
HT_DWORD2x4 = 580, | |||
HT_DWORD3x4 = 581, | |||
HT_DWORD4x4 = 582, | |||
HT_INT1 = 583, | |||
HT_INT1x1 = 584, | |||
HT_INT2x1 = 585, | |||
HT_INT3x1 = 586, | |||
HT_INT4x1 = 587, | |||
HT_INT2 = 588, | |||
HT_INT1x2 = 589, | |||
HT_INT2x2 = 590, | |||
HT_INT3x2 = 591, | |||
HT_INT4x2 = 592, | |||
HT_INT3 = 593, | |||
HT_INT1x3 = 594, | |||
HT_INT2x3 = 595, | |||
HT_INT3x3 = 596, | |||
HT_INT4x3 = 597, | |||
HT_INT4 = 598, | |||
HT_INT1x4 = 599, | |||
HT_INT2x4 = 600, | |||
HT_INT3x4 = 601, | |||
HT_INT4x4 = 602, | |||
HT_UINT1 = 603, | |||
HT_UINT1x1 = 604, | |||
HT_UINT2x1 = 605, | |||
HT_UINT3x1 = 606, | |||
HT_UINT4x1 = 607, | |||
HT_UINT2 = 608, | |||
HT_UINT1x2 = 609, | |||
HT_UINT2x2 = 610, | |||
HT_UINT3x2 = 611, | |||
HT_UINT4x2 = 612, | |||
HT_UINT3 = 613, | |||
HT_UINT1x3 = 614, | |||
HT_UINT2x3 = 615, | |||
HT_UINT3x3 = 616, | |||
HT_UINT4x3 = 617, | |||
HT_UINT4 = 618, | |||
HT_UINT1x4 = 619, | |||
HT_UINT2x4 = 620, | |||
HT_UINT3x4 = 621, | |||
HT_UINT4x4 = 622, | |||
PREPROCESSOR_DEFINE = 623, | |||
PREPROCESSOR_ELIF = 624, | |||
PREPROCESSOR_ELSE = 625, | |||
PREPROCESSOR_ENDIF = 626, | |||
PREPROCESSOR_ERROR = 627, | |||
PREPROCESSOR_IF = 628, | |||
PREPROCESSOR_IFDEF = 629, | |||
PREPROCESSOR_IFNDEF = 630, | |||
PREPROCESSOR_INCLUDE = 631, | |||
PREPROCESSOR_LINE = 632, | |||
PREPROCESSOR_PRAGMA = 633, | |||
PREPROCESSOR_UNDEF = 634, | |||
PREPROCESSOR_REGION = 635, | |||
HT_AUTO = 636, | |||
HT_CATCH = 637, | |||
HT_CHAR = 638, | |||
@@ -37,13 +37,13 @@ bool LolFxCompiler::ParseString(char const *command) | |||
void LolFxCompiler::Error(const class location& l, const std::string& m) | |||
{ | |||
Log::Error("Syntax error line %d column %d: %s", | |||
Log::Error("LolFx syntax error line %d column %d: %s\n", | |||
l.begin.line, l.begin.column, m.c_str()); | |||
} | |||
void LolFxCompiler::Error(const std::string& m) | |||
{ | |||
Log::Error("Syntax error: %s", m.c_str()); | |||
Log::Error("LolFx syntax error: %s\n", m.c_str()); | |||
} | |||
} /* namespace lol */ | |||
@@ -48,7 +48,7 @@ | |||
%token <ival> INTCONSTANT | |||
%token <uval> UINTCONSTANT | |||
%token <fval> FLOATCONSTANT | |||
%token /* TODO */ FIELDSELECTION | |||
%token <sval> FIELDSELECTION | |||
%token <sval> IDENTIFIER | |||
%token <sval> TYPENAME | |||
@@ -64,7 +64,7 @@ | |||
* Deprecated GLSL keywords | |||
*/ | |||
%token GT_ATTRIBUTE | |||
%token GT_ATTRIBUTE GT_VARYING | |||
/* | |||
* GLSL types | |||
@@ -199,8 +199,6 @@ | |||
%token PREPROCESSOR_LINE PREPROCESSOR_PRAGMA PREPROCESSOR_UNDEF | |||
%token PREPROCESSOR_REGION | |||
%token PRAGMA_LOLFX | |||
/* | |||
* HLSL reserved keywords | |||
*/ | |||
@@ -265,7 +263,8 @@ group_glsl_keyword: | |||
| GT_MEDIUMP | |||
| GT_LOWP | |||
| GT_PRECISION | |||
| GT_ATTRIBUTE | |||
| GT_ATTRIBUTE /* deprecated */ | |||
| GT_VARYING /* deprecated */ | |||
; | |||
group_glsl_type: | |||
@@ -726,7 +725,16 @@ lolfx_section: | |||
*/ | |||
lolfx_technique: | |||
HT_TECHNIQUE IDENTIFIER '{' pass_list '}' { std::cout << "New tech " << $2 << std::endl; } | |||
HT_TECHNIQUE lolfx_identifier '{' pass_list '}' { std::cout << "New tech " << std::endl; } | |||
; | |||
/* | |||
* The valid LolFx identifiers | |||
*/ | |||
lolfx_identifier: | |||
IDENTIFIER { std::cout << "New name " << $1 << std::endl; } | |||
| FIELDSELECTION { std::cout << "New name " << $1 << std::endl; } | |||
; | |||
/* | |||
@@ -739,7 +747,7 @@ pass_list: | |||
; | |||
pass: | |||
HT_PASS IDENTIFIER '{' pass_stmt_list '}' { std::cout << "New pass " << $2 << std::endl; } | |||
HT_PASS lolfx_identifier '{' pass_stmt_list '}' { std::cout << "New pass " << std::endl; } | |||
; | |||
pass_stmt_list: | |||
@@ -775,22 +783,16 @@ lolfx_shader: | |||
; | |||
lolfx_shader_declaration: | |||
PRAGMA_LOLFX lolfx_shader_type '(' lolfx_shader_description_list ')' { std::cout << "new shader" << std::endl; } | |||
; | |||
lolfx_shader_type: | |||
HT_VERTEXSHADER | |||
| HT_PIXELSHADER | |||
'[' lolfx_shader_name_list ']' { std::cout << "new shader" << std::endl; } | |||
; | |||
lolfx_shader_description_list: | |||
lolfx_shader_description ',' lolfx_shader_description | |||
| lolfx_shader_description | |||
lolfx_shader_name_list: | |||
lolfx_shader_name '.' lolfx_shader_name_list | |||
| lolfx_shader_name | |||
; | |||
lolfx_shader_description: | |||
IDENTIFIER '=' IDENTIFIER FLOATCONSTANT | |||
| IDENTIFIER '=' IDENTIFIER | |||
lolfx_shader_name: | |||
lolfx_identifier | |||
; | |||
/* | |||
@@ -971,10 +973,10 @@ glsl_declaration: | |||
glsl_function_prototype ';' | |||
| glsl_init_declarator_list ';' | |||
| GT_PRECISION glsl_precision_qualifier glsl_type_specifier_no_prec ';' | |||
| glsl_type_qualifier IDENTIFIER '{' glsl_struct_declaration_list '}' ';' | |||
| glsl_type_qualifier IDENTIFIER '{' glsl_struct_declaration_list '}' IDENTIFIER ';' | |||
| glsl_type_qualifier IDENTIFIER '{' glsl_struct_declaration_list '}' IDENTIFIER '[' ']' ';' | |||
| glsl_type_qualifier IDENTIFIER '{' glsl_struct_declaration_list '}' IDENTIFIER '[' glsl_constant_expression ']' ';' | |||
| glsl_type_qualifier lolfx_identifier '{' glsl_struct_declaration_list '}' ';' | |||
| glsl_type_qualifier lolfx_identifier '{' glsl_struct_declaration_list '}' lolfx_identifier ';' | |||
| glsl_type_qualifier lolfx_identifier '{' glsl_struct_declaration_list '}' lolfx_identifier '[' ']' ';' | |||
| glsl_type_qualifier lolfx_identifier '{' glsl_struct_declaration_list '}' lolfx_identifier '[' glsl_constant_expression ']' ';' | |||
| glsl_type_qualifier ';' | |||
; | |||
@@ -988,24 +990,34 @@ glsl_function_declarator: | |||
; | |||
glsl_function_header_with_parameters: | |||
glsl_function_header glsl_parameter_declaration | |||
| glsl_function_header_with_parameters ',' glsl_parameter_declaration | |||
glsl_function_header lolfx_parameter_declaration | |||
| glsl_function_header_with_parameters ',' lolfx_parameter_declaration | |||
; | |||
glsl_function_header: | |||
glsl_fully_specified_type IDENTIFIER '(' | |||
glsl_fully_specified_type lolfx_identifier '(' | |||
; | |||
glsl_parameter_declarator: | |||
glsl_type_specifier IDENTIFIER | |||
| glsl_type_specifier IDENTIFIER '[' glsl_constant_expression ']' | |||
glsl_type_specifier lolfx_identifier | |||
| glsl_type_specifier lolfx_identifier '[' glsl_constant_expression ']' | |||
; | |||
lolfx_parameter_declaration: | |||
glsl_parameter_declaration ':' lolfx_identifier /* HLSL only */ | |||
| glsl_parameter_declaration | |||
; | |||
glsl_parameter_declaration: | |||
glsl_parameter_type_qualifier glsl_parameter_qualifier glsl_parameter_declarator | |||
| glsl_parameter_qualifier glsl_parameter_declarator | |||
| glsl_parameter_type_qualifier glsl_parameter_qualifier glsl_parameter_type_specifier | |||
| glsl_parameter_qualifier glsl_parameter_type_specifier | |||
glsl_parameter_type_qualifier lolfx_parameter_qualifier glsl_parameter_declarator | |||
| lolfx_parameter_qualifier glsl_parameter_declarator | |||
| glsl_parameter_type_qualifier lolfx_parameter_qualifier glsl_parameter_type_specifier | |||
| lolfx_parameter_qualifier glsl_parameter_type_specifier | |||
; | |||
lolfx_parameter_qualifier: | |||
glsl_parameter_qualifier | |||
| GHT_UNIFORM /* HLSL only */ | |||
; | |||
glsl_parameter_qualifier: | |||
@@ -1014,6 +1026,7 @@ glsl_parameter_qualifier: | |||
| GHT_OUT | |||
| GHT_INOUT | |||
| GT_ATTRIBUTE /* deprecated */ | |||
| GT_VARYING /* deprecated */ | |||
; | |||
glsl_parameter_type_specifier: | |||
@@ -1022,23 +1035,23 @@ glsl_parameter_type_specifier: | |||
glsl_init_declarator_list: | |||
glsl_single_declaration | |||
| glsl_init_declarator_list ',' IDENTIFIER | |||
| glsl_init_declarator_list ',' IDENTIFIER '[' ']' | |||
| glsl_init_declarator_list ',' IDENTIFIER '[' glsl_constant_expression ']' | |||
| glsl_init_declarator_list ',' IDENTIFIER '[' ']' '=' glsl_initializer | |||
| glsl_init_declarator_list ',' IDENTIFIER '[' glsl_constant_expression ']' '=' glsl_initializer | |||
| glsl_init_declarator_list ',' IDENTIFIER '=' glsl_initializer | |||
| glsl_init_declarator_list ',' lolfx_identifier | |||
| glsl_init_declarator_list ',' lolfx_identifier '[' ']' | |||
| glsl_init_declarator_list ',' lolfx_identifier '[' glsl_constant_expression ']' | |||
| glsl_init_declarator_list ',' lolfx_identifier '[' ']' '=' glsl_initializer | |||
| glsl_init_declarator_list ',' lolfx_identifier '[' glsl_constant_expression ']' '=' glsl_initializer | |||
| glsl_init_declarator_list ',' lolfx_identifier '=' glsl_initializer | |||
; | |||
glsl_single_declaration: | |||
glsl_fully_specified_type | |||
| glsl_fully_specified_type IDENTIFIER | |||
| glsl_fully_specified_type IDENTIFIER '[' ']' | |||
| glsl_fully_specified_type IDENTIFIER '[' glsl_constant_expression ']' | |||
| glsl_fully_specified_type IDENTIFIER '[' ']' '=' glsl_initializer | |||
| glsl_fully_specified_type IDENTIFIER '[' glsl_constant_expression ']' '=' glsl_initializer | |||
| glsl_fully_specified_type IDENTIFIER '=' glsl_initializer | |||
| GT_INVARIANT IDENTIFIER | |||
| glsl_fully_specified_type lolfx_identifier | |||
| glsl_fully_specified_type lolfx_identifier '[' ']' | |||
| glsl_fully_specified_type lolfx_identifier '[' glsl_constant_expression ']' | |||
| glsl_fully_specified_type lolfx_identifier '[' ']' '=' glsl_initializer | |||
| glsl_fully_specified_type lolfx_identifier '[' glsl_constant_expression ']' '=' glsl_initializer | |||
| glsl_fully_specified_type lolfx_identifier '=' glsl_initializer | |||
| GT_INVARIANT lolfx_identifier | |||
; | |||
glsl_fully_specified_type: | |||
@@ -1066,8 +1079,8 @@ glsl_layout_qualifier_id_list: | |||
; | |||
glsl_layout_qualifier_id: | |||
IDENTIFIER | |||
| IDENTIFIER '=' INTCONSTANT | |||
lolfx_identifier | |||
| lolfx_identifier '=' INTCONSTANT | |||
; | |||
glsl_parameter_type_qualifier: | |||
@@ -1097,6 +1110,7 @@ glsl_storage_qualifier: | |||
| GT_SAMPLE GHT_OUT | |||
| GHT_UNIFORM | |||
| GT_ATTRIBUTE /* deprecated */ | |||
| GT_VARYING /* deprecated */ | |||
; | |||
glsl_type_specifier: | |||
@@ -1105,9 +1119,14 @@ glsl_type_specifier: | |||
; | |||
glsl_type_specifier_no_prec: | |||
lolfx_type_specifier_nonarray | |||
| lolfx_type_specifier_nonarray '[' ']' | |||
| lolfx_type_specifier_nonarray '[' glsl_constant_expression ']' | |||
lolfx_type_specifier_nonarray: | |||
glsl_type_specifier_nonarray | |||
| glsl_type_specifier_nonarray '[' ']' | |||
| glsl_type_specifier_nonarray '[' glsl_constant_expression ']' | |||
| group_hlsl_type /* HLSL only */ | |||
; | |||
glsl_type_specifier_nonarray: | |||
GHT_VOID | |||
@@ -1116,85 +1135,11 @@ glsl_type_specifier_nonarray: | |||
| GHT_INT | |||
| GHT_UINT | |||
| GHT_BOOL | |||
| GT_VEC2 | |||
| GT_VEC3 | |||
| GT_VEC4 | |||
| GT_DVEC2 | |||
| GT_DVEC3 | |||
| GT_DVEC4 | |||
| GT_BVEC2 | |||
| GT_BVEC3 | |||
| GT_BVEC4 | |||
| GT_IVEC2 | |||
| GT_IVEC3 | |||
| GT_IVEC4 | |||
| GT_UVEC2 | |||
| GT_UVEC3 | |||
| GT_UVEC4 | |||
| GT_MAT2 | |||
| GT_MAT3 | |||
| GT_MAT4 | |||
| GT_MAT2X2 | |||
| GT_MAT2X3 | |||
| GT_MAT2X4 | |||
| GT_MAT3X2 | |||
| GT_MAT3X3 | |||
| GT_MAT3X4 | |||
| GT_MAT4X2 | |||
| GT_MAT4X3 | |||
| GT_MAT4X4 | |||
| GT_DMAT2 | |||
| GT_DMAT3 | |||
| GT_DMAT4 | |||
| GT_DMAT2X2 | |||
| GT_DMAT2X3 | |||
| GT_DMAT2X4 | |||
| GT_DMAT3X2 | |||
| GT_DMAT3X3 | |||
| GT_DMAT3X4 | |||
| GT_DMAT4X2 | |||
| GT_DMAT4X3 | |||
| GT_DMAT4X4 | |||
| group_glsl_type | |||
| GHT_SAMPLER1D | |||
| GHT_SAMPLER2D | |||
| GHT_SAMPLER3D | |||
| GHT_SAMPLERCUBE | |||
| GT_SAMPLER1DSHADOW | |||
| GT_SAMPLER2DSHADOW | |||
| GT_SAMPLERCUBESHADOW | |||
| GT_SAMPLER1DARRAY | |||
| GT_SAMPLER2DARRAY | |||
| GT_SAMPLER1DARRAYSHADOW | |||
| GT_SAMPLER2DARRAYSHADOW | |||
| GT_SAMPLERCUBEARRAY | |||
| GT_SAMPLERCUBEARRAYSHADOW | |||
| GT_ISAMPLER1D | |||
| GT_ISAMPLER2D | |||
| GT_ISAMPLER3D | |||
| GT_ISAMPLERCUBE | |||
| GT_ISAMPLER1DARRAY | |||
| GT_ISAMPLER2DARRAY | |||
| GT_ISAMPLERCUBEARRAY | |||
| GT_USAMPLER1D | |||
| GT_USAMPLER2D | |||
| GT_USAMPLER3D | |||
| GT_USAMPLERCUBE | |||
| GT_USAMPLER1DARRAY | |||
| GT_USAMPLER2DARRAY | |||
| GT_USAMPLERCUBEARRAY | |||
| GT_SAMPLER2DRECT | |||
| GT_SAMPLER2DRECTSHADOW | |||
| GT_ISAMPLER2DRECT | |||
| GT_USAMPLER2DRECT | |||
| GT_SAMPLERBUFFER | |||
| GT_ISAMPLERBUFFER | |||
| GT_USAMPLERBUFFER | |||
| GT_SAMPLER2DMS | |||
| GT_ISAMPLER2DMS | |||
| GT_USAMPLER2DMS | |||
| GT_SAMPLER2DMSARRAY | |||
| GT_ISAMPLER2DMSARRAY | |||
| GT_USAMPLER2DMSARRAY | |||
| glsl_struct_specifier | |||
| TYPENAME | |||
; | |||
@@ -1206,7 +1151,7 @@ glsl_precision_qualifier: | |||
; | |||
glsl_struct_specifier: | |||
GHT_STRUCT IDENTIFIER '{' glsl_struct_declaration_list '}' | |||
GHT_STRUCT lolfx_identifier '{' glsl_struct_declaration_list '}' | |||
| GHT_STRUCT '{' glsl_struct_declaration_list '}' | |||
; | |||
@@ -1226,9 +1171,9 @@ glsl_struct_declarator_list: | |||
; | |||
glsl_struct_declarator: | |||
IDENTIFIER | |||
| IDENTIFIER '[' ']' | |||
| IDENTIFIER '[' glsl_constant_expression ']' | |||
lolfx_identifier | |||
| lolfx_identifier '[' ']' | |||
| lolfx_identifier '[' glsl_constant_expression ']' | |||
; | |||
glsl_initializer: | |||
@@ -1290,7 +1235,7 @@ glsl_selection_rest_statement: | |||
glsl_condition: | |||
glsl_expression | |||
| glsl_fully_specified_type IDENTIFIER '=' glsl_initializer | |||
| glsl_fully_specified_type lolfx_identifier '=' glsl_initializer | |||
; | |||
glsl_switch_statement: | |||
@@ -110,6 +110,7 @@ typedef lol::LolFxParser::token_type token_type; | |||
*/ | |||
"attribute" { return token::GT_ATTRIBUTE; } | |||
"varying" { return token::GT_VARYING; } | |||
/* | |||
* GLSL vector types | |||
@@ -488,12 +489,6 @@ typedef lol::LolFxParser::token_type token_type; | |||
"#"[ \t]*"version".* { /* ignore for now */ } | |||
/* | |||
* LolFx preprocessor directives | |||
*/ | |||
"#"[ \t]*(?i:pragma)[ \t]*(?i:lolfx) { return token::PRAGMA_LOLFX; } | |||
/* | |||
* HLSL reserved keywords | |||
* Gathered from http://msdn.microsoft.com/en-us/library/windows/desktop/bb509569%28v=vs.85%29.aspx | |||
@@ -572,15 +567,15 @@ typedef lol::LolFxParser::token_type token_type; | |||
return token::INTCONSTANT; | |||
} | |||
[a-zA-Z][a-zA-Z0-9_]* { | |||
[a-zA-Z_][a-zA-Z0-9_]* { | |||
/* Copy token for now */ | |||
yylval->sval = strdup(yytext); | |||
return token::IDENTIFIER; | |||
} | |||
[ \t]+ { /* ignore whitespace */ } | |||
[\n] { ++yylineno; } | |||
. { return token::T_ERROR; } | |||
[ \t\r]+ { /* ignore whitespace */ } | |||
[\n] { yylloc->lines(1); } | |||
. { return (token_type)*yytext; /* accept all characters */ } | |||
/* | |||
* Ignore C comments | |||
@@ -589,7 +584,7 @@ typedef lol::LolFxParser::token_type token_type; | |||
"/*" { BEGIN(C_COMMENT); } | |||
<C_COMMENT>"*/" { BEGIN(INITIAL); } | |||
<C_COMMENT>[^*\n]* { } | |||
<C_COMMENT>\n { ++yylineno; } | |||
<C_COMMENT>\n { yylloc->lines(1); } | |||
<C_COMMENT>. { } | |||
/* | |||
@@ -597,7 +592,7 @@ typedef lol::LolFxParser::token_type token_type; | |||
*/ | |||
"//" { BEGIN(CPP_COMMENT); } | |||
<CPP_COMMENT>\n { ++yylineno; BEGIN(INITIAL); } | |||
<CPP_COMMENT>\n { yylloc->lines(1); BEGIN(INITIAL); } | |||
<CPP_COMMENT>.* { } | |||
%% | |||
@@ -2,9 +2,9 @@ | |||
* Awesome triangle shader | |||
*/ | |||
technique Triangle | |||
technique FlatColor | |||
{ | |||
pass FirstPass | |||
pass DefaultPass | |||
{ | |||
vertexshader = vert; | |||
pixelshader = frag; | |||