Changeset 152946 in webkit
- Timestamp:
- Jul 20, 2013, 3:23:23 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 3 added
- 77 deleted
- 43 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/ThirdParty/ANGLE/ANGLE.plist
r152755 r152946 7 7 <string>ANGLE</string> 8 8 <key>OpenSourceVersion</key> 9 <string>r 2426</string>9 <string>r1641</string> 10 10 <key>OpenSourceWebsiteURL</key> 11 11 <string>http://code.google.com/p/angleproject/</string> 12 12 <key>OpenSourceSCM</key> 13 <string>svn co -r 2426http://angleproject.googlecode.com/svn/trunk/</string>13 <string>svn co -r1641 http://angleproject.googlecode.com/svn/trunk/</string> 14 14 <key>OpenSourceImportDate</key> 15 <string>2013-0 6-13</string>15 <string>2013-01-04</string> 16 16 <key>OpenSourceLicense</key> 17 17 <string>BSD</string> -
trunk/Source/ThirdParty/ANGLE/ANGLE.xcodeproj/project.pbxproj
r152929 r152946 7 7 objects = { 8 8 9 /* Begin PBXAggregateTarget section */10 5C9D829B1798B1CD007E1588 /* Derived Sources */ = {11 isa = PBXAggregateTarget;12 buildConfigurationList = 5C9D829C1798B1CE007E1588 /* Build configuration list for PBXAggregateTarget "Derived Sources" */;13 buildPhases = (14 5C9D82A01798B1D6007E1588 /* ShellScript */,15 );16 dependencies = (17 );18 name = "Derived Sources";19 productName = "Derived Sources";20 };21 /* End PBXAggregateTarget section */22 23 9 /* Begin PBXBuildFile section */ 24 10 312BDB0C15FECAC90097EBC7 /* ANGLE.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = 312BDB0915FEC91E0097EBC7 /* ANGLE.plist */; }; … … 27 13 49951C0914B7AAD80060E96E /* BuiltInFunctionEmulator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49951C0514B7AAD70060E96E /* BuiltInFunctionEmulator.cpp */; }; 28 14 49951C0A14B7AAD80060E96E /* BuiltInFunctionEmulator.h in Headers */ = {isa = PBXBuildFile; fileRef = 49951C0614B7AAD80060E96E /* BuiltInFunctionEmulator.h */; }; 29 49951C0B14B7AAD80060E96E /* DetectCallDepth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49951C0714B7AAD80060E96E /* DetectCallDepth.cpp */; }; 30 49951C0C14B7AAD80060E96E /* DetectCallDepth.h in Headers */ = {isa = PBXBuildFile; fileRef = 49951C0814B7AAD80060E96E /* DetectCallDepth.h */; }; 31 5C9D82961798B1A1007E1588 /* ExpressionParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C9D82911798B1A1007E1588 /* ExpressionParser.cpp */; }; 32 5C9D82971798B1A1007E1588 /* glslang_lex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C9D82921798B1A1007E1588 /* glslang_lex.cpp */; }; 33 5C9D82981798B1A1007E1588 /* glslang_tab.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C9D82931798B1A1007E1588 /* glslang_tab.cpp */; }; 34 5C9D82991798B1A1007E1588 /* glslang_tab.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C9D82941798B1A1007E1588 /* glslang_tab.h */; }; 35 5C9D829A1798B1A1007E1588 /* Tokenizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C9D82951798B1A1007E1588 /* Tokenizer.cpp */; }; 36 5CCEB8B617908EEC00FD9496 /* builtin_symbol_table.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5CCEB8B417908E3A00FD9496 /* builtin_symbol_table.cpp */; }; 15 49951C0B14B7AAD80060E96E /* DetectRecursion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49951C0714B7AAD80060E96E /* DetectRecursion.cpp */; }; 16 49951C0C14B7AAD80060E96E /* DetectRecursion.h in Headers */ = {isa = PBXBuildFile; fileRef = 49951C0814B7AAD80060E96E /* DetectRecursion.h */; }; 37 17 90D9B10212E11DCB002D4255 /* Compiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 90D9B0F912E11DCB002D4255 /* Compiler.cpp */; }; 38 18 90D9B10312E11DCB002D4255 /* ExtensionBehavior.h in Headers */ = {isa = PBXBuildFile; fileRef = 90D9B0FA12E11DCB002D4255 /* ExtensionBehavior.h */; }; 19 90D9B10412E11DCB002D4255 /* glslang_lex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 90D9B0FB12E11DCB002D4255 /* glslang_lex.cpp */; }; 20 90D9B10512E11DCB002D4255 /* glslang_tab.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 90D9B0FC12E11DCB002D4255 /* glslang_tab.cpp */; }; 21 90D9B10612E11DCB002D4255 /* glslang_tab.h in Headers */ = {isa = PBXBuildFile; fileRef = 90D9B0FD12E11DCB002D4255 /* glslang_tab.h */; }; 39 22 90D9B10712E11DCB002D4255 /* glslang.h in Headers */ = {isa = PBXBuildFile; fileRef = 90D9B0FE12E11DCB002D4255 /* glslang.h */; }; 40 23 90D9B10912E11DCB002D4255 /* SearchSymbol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 90D9B10012E11DCB002D4255 /* SearchSymbol.cpp */; }; … … 66 49 A264F8B016974DED006FAA5A /* DirectiveParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A264F89716974DED006FAA5A /* DirectiveParser.cpp */; }; 67 50 A264F8B116974DED006FAA5A /* DirectiveParser.h in Headers */ = {isa = PBXBuildFile; fileRef = A264F89816974DED006FAA5A /* DirectiveParser.h */; }; 51 A264F8B216974DED006FAA5A /* ExpressionParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A264F89916974DED006FAA5A /* ExpressionParser.cpp */; }; 68 52 A264F8B316974DED006FAA5A /* ExpressionParser.h in Headers */ = {isa = PBXBuildFile; fileRef = A264F89A16974DED006FAA5A /* ExpressionParser.h */; }; 69 53 A264F8B416974DED006FAA5A /* Input.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A264F89B16974DED006FAA5A /* Input.cpp */; }; … … 82 66 A264F8C116974DED006FAA5A /* Token.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A264F8A816974DED006FAA5A /* Token.cpp */; }; 83 67 A264F8C216974DED006FAA5A /* Token.h in Headers */ = {isa = PBXBuildFile; fileRef = A264F8A916974DED006FAA5A /* Token.h */; }; 68 A264F8C316974DED006FAA5A /* Tokenizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A264F8AA16974DED006FAA5A /* Tokenizer.cpp */; }; 84 69 A264F8C416974DED006FAA5A /* Tokenizer.h in Headers */ = {isa = PBXBuildFile; fileRef = A264F8AB16974DED006FAA5A /* Tokenizer.h */; }; 85 70 A264F8C816974E2A006FAA5A /* HashNames.h in Headers */ = {isa = PBXBuildFile; fileRef = A264F8C516974E2A006FAA5A /* HashNames.h */; }; … … 126 111 /* End PBXBuildFile section */ 127 112 128 /* Begin PBXContainerItemProxy section */129 5C9D82A11798B1E6007E1588 /* PBXContainerItemProxy */ = {130 isa = PBXContainerItemProxy;131 containerPortal = FB39D0701200ED9200088E69 /* Project object */;132 proxyType = 1;133 remoteGlobalIDString = 5C9D829B1798B1CD007E1588;134 remoteInfo = "Derived Sources";135 };136 /* End PBXContainerItemProxy section */137 138 113 /* Begin PBXCopyFilesBuildPhase section */ 139 114 312BDB0B15FECAB00097EBC7 /* CopyFiles */ = { … … 166 141 49951C0514B7AAD70060E96E /* BuiltInFunctionEmulator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BuiltInFunctionEmulator.cpp; sourceTree = "<group>"; }; 167 142 49951C0614B7AAD80060E96E /* BuiltInFunctionEmulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BuiltInFunctionEmulator.h; sourceTree = "<group>"; }; 168 49951C0714B7AAD80060E96E /* DetectCallDepth.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DetectCallDepth.cpp; sourceTree = "<group>"; }; 169 49951C0814B7AAD80060E96E /* DetectCallDepth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetectCallDepth.h; sourceTree = "<group>"; }; 170 5C9D82911798B1A1007E1588 /* ExpressionParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExpressionParser.cpp; sourceTree = "<group>"; }; 171 5C9D82921798B1A1007E1588 /* glslang_lex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = glslang_lex.cpp; sourceTree = "<group>"; }; 172 5C9D82931798B1A1007E1588 /* glslang_tab.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = glslang_tab.cpp; sourceTree = "<group>"; }; 173 5C9D82941798B1A1007E1588 /* glslang_tab.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = glslang_tab.h; sourceTree = "<group>"; }; 174 5C9D82951798B1A1007E1588 /* Tokenizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Tokenizer.cpp; sourceTree = "<group>"; }; 175 5CCEB8B417908E3A00FD9496 /* builtin_symbol_table.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = builtin_symbol_table.cpp; sourceTree = "<group>"; }; 176 5CCEB8B517908E3A00FD9496 /* builtin_symbol_table.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = builtin_symbol_table.h; sourceTree = "<group>"; }; 143 49951C0714B7AAD80060E96E /* DetectRecursion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DetectRecursion.cpp; sourceTree = "<group>"; }; 144 49951C0814B7AAD80060E96E /* DetectRecursion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetectRecursion.h; sourceTree = "<group>"; }; 177 145 5D7C59C51208C68B001C873E /* ANGLE.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ANGLE.xcconfig; sourceTree = "<group>"; }; 178 146 5D7C59C61208C68B001C873E /* Base.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = "<group>"; }; … … 180 148 90D9B0F912E11DCB002D4255 /* Compiler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Compiler.cpp; sourceTree = "<group>"; }; 181 149 90D9B0FA12E11DCB002D4255 /* ExtensionBehavior.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExtensionBehavior.h; sourceTree = "<group>"; }; 150 90D9B0FB12E11DCB002D4255 /* glslang_lex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = glslang_lex.cpp; sourceTree = "<group>"; }; 151 90D9B0FC12E11DCB002D4255 /* glslang_tab.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = glslang_tab.cpp; sourceTree = "<group>"; }; 152 90D9B0FD12E11DCB002D4255 /* glslang_tab.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = glslang_tab.h; sourceTree = "<group>"; }; 182 153 90D9B0FE12E11DCB002D4255 /* glslang.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = glslang.h; sourceTree = "<group>"; }; 183 154 90D9B10012E11DCB002D4255 /* SearchSymbol.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SearchSymbol.cpp; sourceTree = "<group>"; }; … … 209 180 A264F89716974DED006FAA5A /* DirectiveParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DirectiveParser.cpp; sourceTree = "<group>"; }; 210 181 A264F89816974DED006FAA5A /* DirectiveParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DirectiveParser.h; sourceTree = "<group>"; }; 182 A264F89916974DED006FAA5A /* ExpressionParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExpressionParser.cpp; sourceTree = "<group>"; }; 211 183 A264F89A16974DED006FAA5A /* ExpressionParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExpressionParser.h; sourceTree = "<group>"; }; 212 184 A264F89B16974DED006FAA5A /* Input.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Input.cpp; sourceTree = "<group>"; }; … … 225 197 A264F8A816974DED006FAA5A /* Token.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Token.cpp; sourceTree = "<group>"; }; 226 198 A264F8A916974DED006FAA5A /* Token.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Token.h; sourceTree = "<group>"; }; 199 A264F8AA16974DED006FAA5A /* Tokenizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Tokenizer.cpp; sourceTree = "<group>"; }; 227 200 A264F8AB16974DED006FAA5A /* Tokenizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tokenizer.h; sourceTree = "<group>"; }; 228 201 A264F8C516974E2A006FAA5A /* HashNames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HashNames.h; sourceTree = "<group>"; }; … … 313 286 sourceTree = "<group>"; 314 287 }; 315 5C9D82901798B173007E1588 /* Derived Sources */ = {316 isa = PBXGroup;317 children = (318 5C9D82911798B1A1007E1588 /* ExpressionParser.cpp */,319 5C9D82921798B1A1007E1588 /* glslang_lex.cpp */,320 5C9D82931798B1A1007E1588 /* glslang_tab.cpp */,321 5C9D82941798B1A1007E1588 /* glslang_tab.h */,322 5C9D82951798B1A1007E1588 /* Tokenizer.cpp */,323 );324 name = "Derived Sources";325 path = DerivedSources/ANGLE;326 sourceTree = BUILT_PRODUCTS_DIR;327 };328 288 5D7C59C41208C68B001C873E /* Configurations */ = { 329 289 isa = PBXGroup; … … 400 360 isa = PBXGroup; 401 361 children = ( 402 5C9D82901798B173007E1588 /* Derived Sources */,403 362 5D7C59C41208C68B001C873E /* Configurations */, 404 363 A29B15E916978B7D00111D97 /* include */, … … 432 391 FB39D2441200F35A00088E69 /* preprocessor */, 433 392 A2656834159C23E100398539 /* timing */, 434 5CCEB8B417908E3A00FD9496 /* builtin_symbol_table.cpp */,435 5CCEB8B517908E3A00FD9496 /* builtin_symbol_table.h */,436 393 FB39D2211200F35A00088E69 /* BaseTypes.h */, 437 394 49951C0514B7AAD70060E96E /* BuiltInFunctionEmulator.cpp */, … … 443 400 FB39D2261200F35A00088E69 /* debug.cpp */, 444 401 FB39D2271200F35A00088E69 /* debug.h */, 445 49951C0714B7AAD80060E96E /* Detect CallDepth.cpp */,446 49951C0814B7AAD80060E96E /* Detect CallDepth.h */,402 49951C0714B7AAD80060E96E /* DetectRecursion.cpp */, 403 49951C0814B7AAD80060E96E /* DetectRecursion.h */, 447 404 A26567B0159C21B100398539 /* Diagnostics.cpp */, 448 405 A26567B1159C21B100398539 /* Diagnostics.h */, … … 453 410 A0AABE2B13AFE81000F2EBD1 /* ForLoopUnroll.h */, 454 411 90D9B0FE12E11DCB002D4255 /* glslang.h */, 412 90D9B0FB12E11DCB002D4255 /* glslang_lex.cpp */, 413 90D9B0FC12E11DCB002D4255 /* glslang_tab.cpp */, 414 90D9B0FD12E11DCB002D4255 /* glslang_tab.h */, 455 415 A264F8C516974E2A006FAA5A /* HashNames.h */, 456 416 FB39D22A1200F35A00088E69 /* InfoSink.cpp */, … … 526 486 A264F89716974DED006FAA5A /* DirectiveParser.cpp */, 527 487 A264F89816974DED006FAA5A /* DirectiveParser.h */, 488 A264F89916974DED006FAA5A /* ExpressionParser.cpp */, 528 489 A264F89A16974DED006FAA5A /* ExpressionParser.h */, 529 490 A264F89B16974DED006FAA5A /* Input.cpp */, … … 543 504 A264F8A816974DED006FAA5A /* Token.cpp */, 544 505 A264F8A916974DED006FAA5A /* Token.h */, 506 A264F8AA16974DED006FAA5A /* Tokenizer.cpp */, 545 507 A264F8AB16974DED006FAA5A /* Tokenizer.h */, 546 508 ); … … 569 531 A265683C159C23E100398539 /* DependencyGraphBuilder.h in Headers */, 570 532 A265683E159C23E100398539 /* DependencyGraphOutput.h in Headers */, 571 49951C0C14B7AAD80060E96E /* Detect CallDepth.h in Headers */,533 49951C0C14B7AAD80060E96E /* DetectRecursion.h in Headers */, 572 534 A26567BC159C21B100398539 /* Diagnostics.h in Headers */, 573 535 A264F8AD16974DED006FAA5A /* DiagnosticsBase.h in Headers */, … … 579 541 A0AABE2D13AFE81000F2EBD1 /* ForLoopUnroll.h in Headers */, 580 542 90D9B10712E11DCB002D4255 /* glslang.h in Headers */, 543 90D9B10612E11DCB002D4255 /* glslang_tab.h in Headers */, 581 544 A264F8C816974E2A006FAA5A /* HashNames.h in Headers */, 582 545 A264F8B516974DED006FAA5A /* Input.h in Headers */, … … 607 570 A264F8CA16974E2A006FAA5A /* VariablePacker.h in Headers */, 608 571 90D9B11A12E11DD6002D4255 /* VersionGLSL.h in Headers */, 609 5C9D82991798B1A1007E1588 /* glslang_tab.h in Headers */,610 572 ); 611 573 runOnlyForDeploymentPostprocessing = 0; … … 627 589 ); 628 590 dependencies = ( 629 5C9D82A21798B1E6007E1588 /* PBXTargetDependency */,630 591 ); 631 592 name = ANGLE; … … 657 618 targets = ( 658 619 FB39D0D01200F0E300088E69 /* ANGLE */, 659 5C9D829B1798B1CD007E1588 /* Derived Sources */,660 620 ); 661 621 }; 662 622 /* End PBXProject section */ 663 664 /* Begin PBXShellScriptBuildPhase section */665 5C9D82A01798B1D6007E1588 /* ShellScript */ = {666 isa = PBXShellScriptBuildPhase;667 buildActionMask = 2147483647;668 files = (669 );670 inputPaths = (671 );672 outputPaths = (673 );674 runOnlyForDeploymentPostprocessing = 0;675 shellPath = /bin/sh;676 shellScript = "mkdir -p \"${BUILT_PRODUCTS_DIR}/DerivedSources/ANGLE\"\ncd \"${BUILT_PRODUCTS_DIR}/DerivedSources/ANGLE\"\n\n/bin/ln -sfh \"${SRCROOT}\" .\nexport ANGLE=\"ANGLE\"\n\nmake --no-builtin-rules -f \"ANGLE/DerivedSources.make\" -j `/usr/sbin/sysctl -n hw.availcpu`";677 };678 /* End PBXShellScriptBuildPhase section */679 623 680 624 /* Begin PBXSourcesBuildPhase section */ … … 692 636 A265683D159C23E100398539 /* DependencyGraphOutput.cpp in Sources */, 693 637 A265683F159C23E100398539 /* DependencyGraphTraverse.cpp in Sources */, 694 49951C0B14B7AAD80060E96E /* Detect CallDepth.cpp in Sources */,638 49951C0B14B7AAD80060E96E /* DetectRecursion.cpp in Sources */, 695 639 A26567BB159C21B100398539 /* Diagnostics.cpp in Sources */, 696 640 A264F8AC16974DED006FAA5A /* DiagnosticsBase.cpp in Sources */, … … 698 642 A264F8AE16974DED006FAA5A /* DirectiveHandlerBase.cpp in Sources */, 699 643 A264F8B016974DED006FAA5A /* DirectiveParser.cpp in Sources */, 644 A264F8B216974DED006FAA5A /* ExpressionParser.cpp in Sources */, 700 645 A0AABE2C13AFE81000F2EBD1 /* ForLoopUnroll.cpp in Sources */, 646 90D9B10412E11DCB002D4255 /* glslang_lex.cpp in Sources */, 647 90D9B10512E11DCB002D4255 /* glslang_tab.cpp in Sources */, 701 648 FB39D2791200F35A00088E69 /* InfoSink.cpp in Sources */, 702 649 FB39D27B1200F35A00088E69 /* Initialize.cpp in Sources */, … … 724 671 A2656842159C23E100398539 /* RestrictVertexShaderTiming.cpp in Sources */, 725 672 90D9B10912E11DCB002D4255 /* SearchSymbol.cpp in Sources */, 726 5CCEB8B617908EEC00FD9496 /* builtin_symbol_table.cpp in Sources */,727 673 FB39D2A81200F35A00088E69 /* ShaderLang.cpp in Sources */, 728 674 FB39D2AA1200F35A00088E69 /* SymbolTable.cpp in Sources */, 729 675 A264F8C116974DED006FAA5A /* Token.cpp in Sources */, 676 A264F8C316974DED006FAA5A /* Tokenizer.cpp in Sources */, 730 677 A0AABE4813AFE96100F2EBD1 /* TranslatorESSL.cpp in Sources */, 731 678 FB39D2AC1200F35A00088E69 /* TranslatorGLSL.cpp in Sources */, … … 735 682 A264F8C916974E2A006FAA5A /* VariablePacker.cpp in Sources */, 736 683 90D9B11912E11DD6002D4255 /* VersionGLSL.cpp in Sources */, 737 5C9D82961798B1A1007E1588 /* ExpressionParser.cpp in Sources */,738 5C9D82971798B1A1007E1588 /* glslang_lex.cpp in Sources */,739 5C9D82981798B1A1007E1588 /* glslang_tab.cpp in Sources */,740 5C9D829A1798B1A1007E1588 /* Tokenizer.cpp in Sources */,741 684 ); 742 685 runOnlyForDeploymentPostprocessing = 0; … … 744 687 /* End PBXSourcesBuildPhase section */ 745 688 746 /* Begin PBXTargetDependency section */747 5C9D82A21798B1E6007E1588 /* PBXTargetDependency */ = {748 isa = PBXTargetDependency;749 target = 5C9D829B1798B1CD007E1588 /* Derived Sources */;750 targetProxy = 5C9D82A11798B1E6007E1588 /* PBXContainerItemProxy */;751 };752 /* End PBXTargetDependency section */753 754 689 /* Begin XCBuildConfiguration section */ 755 5C9D829D1798B1CE007E1588 /* Debug */ = {756 isa = XCBuildConfiguration;757 buildSettings = {758 PRODUCT_NAME = "$(TARGET_NAME)";759 };760 name = Debug;761 };762 5C9D829E1798B1CE007E1588 /* Release */ = {763 isa = XCBuildConfiguration;764 buildSettings = {765 PRODUCT_NAME = "$(TARGET_NAME)";766 };767 name = Release;768 };769 5C9D829F1798B1CE007E1588 /* Production */ = {770 isa = XCBuildConfiguration;771 buildSettings = {772 PRODUCT_NAME = "$(TARGET_NAME)";773 };774 name = Production;775 };776 690 5D7C59DB1208C6C3001C873E /* Production */ = { 777 691 isa = XCBuildConfiguration; … … 820 734 821 735 /* Begin XCConfigurationList section */ 822 5C9D829C1798B1CE007E1588 /* Build configuration list for PBXAggregateTarget "Derived Sources" */ = {823 isa = XCConfigurationList;824 buildConfigurations = (825 5C9D829D1798B1CE007E1588 /* Debug */,826 5C9D829E1798B1CE007E1588 /* Release */,827 5C9D829F1798B1CE007E1588 /* Production */,828 );829 defaultConfigurationIsVisible = 0;830 defaultConfigurationName = Production;831 };832 736 FB39D0731200ED9200088E69 /* Build configuration list for PBXProject "ANGLE" */ = { 833 737 isa = XCConfigurationList; -
trunk/Source/ThirdParty/ANGLE/ChangeLog
r152929 r152946 1 2013-07-20 Dean Jackson <dino@apple.com> 2 3 Updated ANGLE is leaking like a sieve 4 https://bugs.webkit.org/show_bug.cgi?id=118939 5 6 Rollout 152863, r152821, r152929 and r152755. 7 8 * ANGLE.plist: 9 * ANGLE.xcodeproj/project.pbxproj: 10 * DerivedSources.make: Removed. 11 * GNUmakefile.am: 12 * Target.pri: 13 * include/GLSLANG/ShaderLang.h: 14 * src/compiler/BaseTypes.h: 15 (getQualifierString): 16 * src/compiler/Common.h: 17 (EncodeSourceLoc): 18 (DecodeSourceLoc): 19 * src/compiler/Compiler.cpp: 20 (TCompiler::TCompiler): 21 (TCompiler::Init): 22 (TCompiler::compile): 23 (TCompiler::detectRecursion): 24 * src/compiler/ConstantUnion.h: 25 (ConstantUnion::ConstantUnion): 26 * src/compiler/DetectCallDepth.cpp: Removed. 27 * src/compiler/DetectRecursion.cpp: Added. 28 (DetectRecursion::FunctionNode::FunctionNode): 29 (DetectRecursion::FunctionNode::getName): 30 (DetectRecursion::FunctionNode::addCallee): 31 (DetectRecursion::FunctionNode::detectRecursion): 32 (DetectRecursion::DetectRecursion): 33 (DetectRecursion::~DetectRecursion): 34 (DetectRecursion::visitAggregate): 35 (DetectRecursion::detectRecursion): 36 (DetectRecursion::findFunctionByName): 37 * src/compiler/DetectRecursion.h: Renamed from Source/ThirdParty/ANGLE/src/compiler/DetectCallDepth.h. 38 * src/compiler/Diagnostics.cpp: 39 (TDiagnostics::writeInfo): 40 * src/compiler/ForLoopUnroll.cpp: 41 (ForLoopUnroll::evaluateIntConstant): 42 * src/compiler/InfoSink.cpp: 43 (TInfoSinkBase::prefix): 44 (TInfoSinkBase::location): 45 (TInfoSinkBase::message): 46 * src/compiler/InfoSink.h: 47 * src/compiler/Initialize.cpp: 48 (BuiltInFunctionsCommon): 49 (BuiltInFunctionsVertex): 50 (TBuiltIns::initialize): 51 (IdentifyBuiltIns): 52 (InitExtensionBehavior): 53 * src/compiler/Intermediate.cpp: 54 (TIntermediate::addSymbol): 55 (TIntermediate::addBinaryMath): 56 (TIntermediate::addAssign): 57 (TIntermediate::addIndex): 58 (TIntermediate::addUnaryMath): 59 (TIntermediate::setAggregateOperator): 60 (TIntermediate::addConversion): 61 (TIntermediate::growAggregate): 62 (TIntermediate::makeAggregate): 63 (TIntermediate::addSelection): 64 (TIntermediate::addComma): 65 (TIntermediate::addConstantUnion): 66 (TIntermediate::addSwizzle): 67 (TIntermediate::addLoop): 68 (TIntermediate::addBranch): 69 (TIntermUnary::promote): 70 (TIntermBinary::promote): 71 (CompareStruct): 72 (CompareStructure): 73 (TIntermConstantUnion::fold): 74 (TIntermediate::promoteConstantUnion): 75 * src/compiler/OutputGLSL.cpp: 76 (TOutputGLSL::writeVariablePrecision): 77 * src/compiler/OutputGLSL.h: 78 * src/compiler/OutputGLSLBase.cpp: 79 (TOutputGLSLBase::writeVariableType): 80 (TOutputGLSLBase::writeConstantUnion): 81 (TOutputGLSLBase::visitBinary): 82 (TOutputGLSLBase::visitAggregate): 83 (TOutputGLSLBase::getTypeName): 84 (TOutputGLSLBase::hashFunctionName): 85 * src/compiler/OutputGLSLBase.h: 86 * src/compiler/OutputHLSL.cpp: 87 (sh::OutputHLSL::OutputHLSL): 88 (sh::OutputHLSL::header): 89 (sh::OutputHLSL::visitSymbol): 90 (sh::OutputHLSL::visitBinary): 91 (sh::OutputHLSL::visitAggregate): 92 (sh::OutputHLSL::visitSelection): 93 (sh::OutputHLSL::visitLoop): 94 (sh::OutputHLSL::handleExcessiveLoop): 95 (sh::OutputHLSL::typeString): 96 (sh::OutputHLSL::initializer): 97 (sh::OutputHLSL::addConstructor): 98 (sh::OutputHLSL::writeConstantUnion): 99 (sh::OutputHLSL::decorateField): 100 * src/compiler/OutputHLSL.h: 101 * src/compiler/ParseHelper.cpp: 102 (TParseContext::parseVectorFields): 103 (TParseContext::parseMatrixFields): 104 (TParseContext::error): 105 (TParseContext::warning): 106 (TParseContext::assignError): 107 (TParseContext::unaryOpError): 108 (TParseContext::binaryOpError): 109 (TParseContext::precisionErrorCheck): 110 (TParseContext::lValueErrorCheck): 111 (TParseContext::globalErrorCheck): 112 (TParseContext::reservedErrorCheck): 113 (TParseContext::constructorErrorCheck): 114 (TParseContext::voidErrorCheck): 115 (TParseContext::boolErrorCheck): 116 (TParseContext::samplerErrorCheck): 117 (TParseContext::structQualifierErrorCheck): 118 (TParseContext::parameterSamplerErrorCheck): 119 (TParseContext::containsSampler): 120 (TParseContext::arraySizeErrorCheck): 121 (TParseContext::arrayQualifierErrorCheck): 122 (TParseContext::arrayTypeErrorCheck): 123 (TParseContext::arrayErrorCheck): 124 (TParseContext::arraySetMaxSize): 125 (TParseContext::nonInitConstErrorCheck): 126 (TParseContext::nonInitErrorCheck): 127 (TParseContext::paramErrorCheck): 128 (TParseContext::extensionErrorCheck): 129 (TParseContext::handleExtensionDirective): 130 (TParseContext::handlePragmaDirective): 131 (TParseContext::findFunction): 132 (TParseContext::executeInitializer): 133 (TParseContext::addConstructor): 134 (TParseContext::constructBuiltIn): 135 (TParseContext::constructStruct): 136 (TParseContext::addConstVectorNode): 137 (TParseContext::addConstMatrixNode): 138 (TParseContext::addConstArrayNode): 139 (TParseContext::addConstStruct): 140 (TParseContext::enterStructDeclaration): 141 (TParseContext::structNestingErrorCheck): 142 * src/compiler/ParseHelper.h: 143 (TParseContext::TParseContext): 144 (TParseContext::pragma): 145 * src/compiler/PoolAlloc.cpp: 146 (TPoolAllocator::allocate): 147 * src/compiler/ShHandle.h: 148 * src/compiler/ShaderLang.cpp: 149 (ShInitBuiltInResources): 150 * src/compiler/SymbolTable.cpp: 151 (TType::TType): 152 (TType::buildMangledName): 153 (TType::getStructSize): 154 (TType::computeDeepestStructNesting): 155 (TType::isStructureContainingArrays): 156 (TSymbolTableLevel::relateToExtension): 157 (TSymbol::TSymbol): 158 (TVariable::TVariable): 159 (TVariable::clone): 160 (TFunction::TFunction): 161 (TFunction::clone): 162 (TSymbolTableLevel::clone): 163 (TSymbolTable::copyTable): 164 * src/compiler/SymbolTable.h: 165 (TVariable::TVariable): 166 (TVariable::updateArrayInformationType): 167 (TVariable::getArrayInformationType): 168 (TParameter::copyParam): 169 (TFunction::relateToExtension): 170 (TFunction::getExtension): 171 * src/compiler/Types.h: 172 (NewPoolTTypeList): 173 (TType::TType): 174 (TType::copyType): 175 (TType::clone): 176 (TType::getObjectSize): 177 (TType::getMaxArraySize): 178 (TType::setMaxArraySize): 179 (TType::clearArrayness): 180 (TType::setArrayInformationType): 181 (TType::getArrayInformationType): 182 (TType::getStruct): 183 (TType::setStruct): 184 (TType::getTypeName): 185 (TType::setTypeName): 186 (TType::isField): 187 (TType::getFieldName): 188 (TType::setFieldName): 189 (TType::getMangledName): 190 (TType::getDeepestStructNesting): 191 (TPublicType::setBasic): 192 * src/compiler/VariableInfo.cpp: 193 (getUserDefinedVariableInfo): 194 * src/compiler/builtin_symbol_table.cpp: Removed. 195 * src/compiler/builtin_symbol_table.h: Removed. 196 * src/compiler/builtin_symbols.json: Removed. 197 * src/compiler/generate_builtin_symbol_table.py: Removed. 198 * src/compiler/glslang.l: 199 * src/compiler/glslang.y: 200 * src/compiler/glslang_lex.cpp: 201 (yy_get_previous_state): 202 (yy_try_NUL_trans): 203 (yy_push_state): 204 (yy_pop_state): 205 (yy_top_state): 206 (string_input): 207 (check_type): 208 (reserved_word): 209 (yyerror): 210 (glslang_scan): 211 * src/compiler/glslang_tab.cpp: 212 * src/compiler/glslang_tab.h: 213 * src/compiler/intermOut.cpp: 214 (TOutputTraverser::visitUnary): 215 (TOutputTraverser::visitAggregate): 216 (TOutputTraverser::visitConstantUnion): 217 * src/compiler/intermediate.h: 218 (TIntermNode::TIntermNode): 219 (TIntermNode::getLine): 220 (TIntermNode::setLine): 221 (TIntermNode::~TIntermNode): 222 (TIntermConstantUnion::setUnionArrayPointer): 223 (TIntermAggregate::TIntermAggregate): 224 (TIntermAggregate::setEndLine): 225 (TIntermAggregate::getEndLine): 226 (TIntermTraverser::TIntermTraverser): 227 (TIntermTraverser::incrementDepth): 228 * src/compiler/localintermediate.h: 229 * src/compiler/parseConst.cpp: 230 (TConstTraverser::visitSymbol): 231 (TConstTraverser::visitBinary): 232 (TConstTraverser::visitUnary): 233 (TConstTraverser::visitAggregate): 234 (TConstTraverser::visitSelection): 235 (TConstTraverser::visitConstantUnion): 236 (TConstTraverser::visitLoop): 237 (TConstTraverser::visitBranch): 238 (TIntermediate::parseConstTree): 239 * src/compiler/timing/RestrictVertexShaderTiming.cpp: 240 (RestrictVertexShaderTiming::visitSymbol): 241 * src/libEGL/Config.cpp: Removed. 242 * src/libEGL/Config.h: Removed. 243 * src/libEGL/Display.cpp: Removed. 244 * src/libEGL/Display.h: Removed. 245 * src/libEGL/README: Added. 246 * src/libEGL/ShaderCache.h: Removed. 247 * src/libEGL/Surface.cpp: Removed. 248 * src/libEGL/Surface.h: Removed. 249 * src/libEGL/libEGL.cpp: Removed. 250 * src/libEGL/libEGL.def: Removed. 251 * src/libEGL/libEGL.rc: Removed. 252 * src/libEGL/libEGL.vcxproj: Removed. 253 * src/libEGL/libEGL.vcxproj.filters: Removed. 254 * src/libEGL/main.cpp: Removed. 255 * src/libEGL/main.h: Removed. 256 * src/libEGL/resource.h: Removed. 257 * src/libGLESv2/BinaryStream.h: Removed. 258 * src/libGLESv2/Blit.cpp: Removed. 259 * src/libGLESv2/Blit.h: Removed. 260 * src/libGLESv2/Buffer.cpp: Removed. 261 * src/libGLESv2/Buffer.h: Removed. 262 * src/libGLESv2/Context.cpp: Removed. 263 * src/libGLESv2/Context.h: Removed. 264 * src/libGLESv2/D3DConstantTable.cpp: Removed. 265 * src/libGLESv2/D3DConstantTable.h: Removed. 266 * src/libGLESv2/Fence.cpp: Removed. 267 * src/libGLESv2/Fence.h: Removed. 268 * src/libGLESv2/Float16ToFloat32.cpp: Removed. 269 * src/libGLESv2/Float16ToFloat32.py: Removed. 270 * src/libGLESv2/Framebuffer.cpp: Removed. 271 * src/libGLESv2/Framebuffer.h: Removed. 272 * src/libGLESv2/HandleAllocator.cpp: Removed. 273 * src/libGLESv2/HandleAllocator.h: Removed. 274 * src/libGLESv2/IndexDataManager.cpp: Removed. 275 * src/libGLESv2/IndexDataManager.h: Removed. 276 * src/libGLESv2/Program.cpp: Removed. 277 * src/libGLESv2/Program.h: Removed. 278 * src/libGLESv2/ProgramBinary.cpp: Removed. 279 * src/libGLESv2/ProgramBinary.h: Removed. 280 * src/libGLESv2/Query.cpp: Removed. 281 * src/libGLESv2/Query.h: Removed. 282 * src/libGLESv2/README: Added. 283 * src/libGLESv2/Renderbuffer.cpp: Removed. 284 * src/libGLESv2/Renderbuffer.h: Removed. 285 * src/libGLESv2/ResourceManager.cpp: Removed. 286 * src/libGLESv2/ResourceManager.h: Removed. 287 * src/libGLESv2/Shader.cpp: Removed. 288 * src/libGLESv2/Shader.h: Removed. 289 * src/libGLESv2/Texture.cpp: Removed. 290 * src/libGLESv2/Texture.h: Removed. 291 * src/libGLESv2/TextureSSE2.cpp: Removed. 292 * src/libGLESv2/VertexDataManager.cpp: Removed. 293 * src/libGLESv2/VertexDataManager.h: Removed. 294 * src/libGLESv2/libGLESv2.cpp: Removed. 295 * src/libGLESv2/libGLESv2.def: Removed. 296 * src/libGLESv2/libGLESv2.rc: Removed. 297 * src/libGLESv2/libGLESv2.vcxproj: Removed. 298 * src/libGLESv2/libGLESv2.vcxproj.filters: Removed. 299 * src/libGLESv2/main.cpp: Removed. 300 * src/libGLESv2/main.h: Removed. 301 * src/libGLESv2/mathutil.h: Removed. 302 * src/libGLESv2/resource.h: Removed. 303 * src/libGLESv2/shaders/Blit.ps: Removed. 304 * src/libGLESv2/shaders/Blit.vs: Removed. 305 * src/libGLESv2/shaders/componentmaskps.h: Removed. 306 * src/libGLESv2/shaders/flipyvs.h: Removed. 307 * src/libGLESv2/shaders/generate_shaders.bat: Removed. 308 * src/libGLESv2/shaders/luminanceps.h: Removed. 309 * src/libGLESv2/shaders/passthroughps.h: Removed. 310 * src/libGLESv2/shaders/standardvs.h: Removed. 311 * src/libGLESv2/utilities.cpp: Removed. 312 * src/libGLESv2/utilities.h: Removed. 313 * src/libGLESv2/vertexconversion.h: Removed. 314 1 315 2013-07-19 Alex Christensen <achristensen@apple.com> 2 316 -
trunk/Source/ThirdParty/ANGLE/GNUmakefile.am
r152755 r152946 25 25 Source/ThirdParty/ANGLE/src/common/angleutils.h \ 26 26 Source/ThirdParty/ANGLE/src/compiler/BaseTypes.h \ 27 Source/ThirdParty/ANGLE/src/compiler/builtin_symbol_table.cpp \28 Source/ThirdParty/ANGLE/src/compiler/builtin_symbol_table.h \29 27 Source/ThirdParty/ANGLE/src/compiler/BuiltInFunctionEmulator.cpp \ 30 28 Source/ThirdParty/ANGLE/src/compiler/BuiltInFunctionEmulator.h \ … … 42 40 Source/ThirdParty/ANGLE/src/compiler/depgraph/DependencyGraphOutput.cpp \ 43 41 Source/ThirdParty/ANGLE/src/compiler/depgraph/DependencyGraphTraverse.cpp \ 44 Source/ThirdParty/ANGLE/src/compiler/DetectCallDepth.cpp \45 Source/ThirdParty/ANGLE/src/compiler/DetectCallDepth.h \46 42 Source/ThirdParty/ANGLE/src/compiler/DetectDiscontinuity.cpp \ 47 43 Source/ThirdParty/ANGLE/src/compiler/DetectDiscontinuity.h \ 44 Source/ThirdParty/ANGLE/src/compiler/DetectRecursion.cpp \ 45 Source/ThirdParty/ANGLE/src/compiler/DetectRecursion.h \ 48 46 Source/ThirdParty/ANGLE/src/compiler/Diagnostics.cpp \ 49 47 Source/ThirdParty/ANGLE/src/compiler/Diagnostics.h \ -
trunk/Source/ThirdParty/ANGLE/Target.pri
r152755 r152946 19 19 HEADERS += \ 20 20 src/compiler/BaseTypes.h \ 21 src/compiler/builtin_symbol_table.h \22 21 src/compiler/BuiltInFunctionEmulator.h \ 23 22 src/compiler/Common.h \ … … 27 26 src/compiler/depgraph/DependencyGraphBuilder.h \ 28 27 src/compiler/depgraph/DependencyGraphOutput.h \ 29 src/compiler/DetectCallDepth.h \30 28 src/compiler/DetectDiscontinuity.h \ 29 src/compiler/DetectRecursion.h \ 31 30 src/compiler/Diagnostics.h \ 32 31 src/compiler/DirectiveHandler.h \ … … 86 85 87 86 SOURCES += \ 88 src/compiler/builtin_symbol_table.cpp \89 87 src/compiler/BuiltInFunctionEmulator.cpp \ 90 88 src/compiler/CodeGenGLSL.cpp \ … … 95 93 src/compiler/depgraph/DependencyGraphOutput.cpp \ 96 94 src/compiler/depgraph/DependencyGraphTraverse.cpp \ 97 src/compiler/DetectCallDepth.cpp \98 95 src/compiler/DetectDiscontinuity.cpp \ 96 src/compiler/DetectRecursion.cpp \ 99 97 src/compiler/Diagnostics.cpp \ 100 98 src/compiler/DirectiveHandler.cpp \ -
trunk/Source/ThirdParty/ANGLE/include/GLSLANG/ShaderLang.h
r152755 r152946 160 160 // specified in the ShBuiltInResources when constructing the 161 161 // compiler, selects the strategy for the clamping implementation. 162 SH_CLAMP_INDIRECT_ARRAY_BOUNDS = 0x1000, 163 164 // This flag limits the complexity of an expression. 165 SH_LIMIT_EXPRESSION_COMPLEXITY = 0x2000, 166 167 // This flag limits the depth of the call stack. 168 SH_LIMIT_CALL_STACK_DEPTH = 0x4000, 162 SH_CLAMP_INDIRECT_ARRAY_BOUNDS = 0x1000 169 163 } ShCompileOptions; 170 164 … … 216 210 int ARB_texture_rectangle; 217 211 int EXT_draw_buffers; 218 int EXT_frag_depth;219 212 220 213 // Set to 1 if highp precision is supported in the fragment language. … … 230 223 // Default is SH_CLAMP_WITH_CLAMP_INTRINSIC. 231 224 ShArrayIndexClampingStrategy ArrayIndexClampingStrategy; 232 233 // The maximum complexity an expression can be.234 int MaxExpressionComplexity;235 236 // The maximum depth a call stack can be.237 int MaxCallStackDepth;238 225 } ShBuiltInResources; 239 226 -
trunk/Source/ThirdParty/ANGLE/src/compiler/BaseTypes.h
r152755 r152946 91 91 EvqUniform, // Readonly, vertex and fragment 92 92 93 // pack/unpack input and output 94 EvqInput, 95 EvqOutput, 96 93 97 // parameters 94 98 EvqIn, … … 109 113 EvqFragColor, 110 114 EvqFragData, 111 EvqFragDepth,112 115 113 116 // end of list … … 135 138 case EvqOut: return "out"; break; 136 139 case EvqInOut: return "inout"; break; 140 case EvqInput: return "input"; break; 141 case EvqOutput: return "output"; break; 137 142 case EvqPosition: return "Position"; break; 138 143 case EvqPointSize: return "PointSize"; break; … … 141 146 case EvqFragColor: return "FragColor"; break; 142 147 case EvqFragData: return "FragData"; break; 143 case EvqFragDepth: return "FragDepth"; break;144 148 default: return "unknown qualifier"; 145 149 } -
trunk/Source/ThirdParty/ANGLE/src/compiler/Common.h
r152755 r152946 15 15 #include "compiler/PoolAlloc.h" 16 16 17 struct TSourceLoc { 18 int first_file; 19 int first_line; 20 int last_file; 21 int last_line; 22 }; 17 // We need two pieces of information to report errors/warnings - string and 18 // line number. We encode these into a single int so that it can be easily 19 // incremented/decremented by lexer. The right SOURCE_LOC_LINE_SIZE bits store 20 // line number while the rest store the string number. Since the shaders are 21 // usually small, we should not run out of memory. SOURCE_LOC_LINE_SIZE 22 // can be increased to alleviate this issue. 23 typedef int TSourceLoc; 24 const unsigned int SOURCE_LOC_LINE_SIZE = 16; // in bits. 25 const unsigned int SOURCE_LOC_LINE_MASK = (1 << SOURCE_LOC_LINE_SIZE) - 1; 26 27 inline TSourceLoc EncodeSourceLoc(int string, int line) { 28 return (string << SOURCE_LOC_LINE_SIZE) | (line & SOURCE_LOC_LINE_MASK); 29 } 30 31 inline void DecodeSourceLoc(TSourceLoc loc, int* string, int* line) { 32 if (string) *string = loc >> SOURCE_LOC_LINE_SIZE; 33 if (line) *line = loc & SOURCE_LOC_LINE_MASK; 34 } 23 35 24 36 // -
trunk/Source/ThirdParty/ANGLE/src/compiler/Compiler.cpp
r152755 r152946 5 5 // 6 6 7 #include "compiler/builtin_symbol_table.h"8 7 #include "compiler/BuiltInFunctionEmulator.h" 9 #include "compiler/Detect CallDepth.h"8 #include "compiler/DetectRecursion.h" 10 9 #include "compiler/ForLoopUnroll.h" 11 10 #include "compiler/Initialize.h" … … 64 63 if (PaParseStrings(1, &builtInShaders, &builtInLengths, &parseContext) != 0) 65 64 { 66 infoSink.info.prefix(EPrefixInternalError); 67 infoSink.info << "Unable to parse built-ins"; 65 infoSink.info.message(EPrefixInternalError, "Unable to parse built-ins"); 68 66 return false; 69 67 } 70 }71 72 73 switch (type) {74 case SH_FRAGMENT_SHADER:75 InsertBuiltInFunctionsCommon(resources, &symbolTable);76 break;77 78 case SH_VERTEX_SHADER:79 InsertBuiltInFunctionsCommon(resources, &symbolTable);80 InsertBuiltInFunctionsVertex(resources, &symbolTable);81 break;82 83 default: assert(false && "Language not supported");84 68 } 85 69 … … 120 104 : shaderType(type), 121 105 shaderSpec(spec), 122 maxUniformVectors(0),123 maxExpressionComplexity(0),124 maxCallStackDepth(0),125 106 fragmentPrecisionHigh(false), 126 107 clampingStrategy(SH_CLAMP_WITH_CLAMP_INTRINSIC), … … 141 122 resources.MaxVertexUniformVectors : 142 123 resources.MaxFragmentUniformVectors; 143 maxExpressionComplexity = resources.MaxExpressionComplexity;144 maxCallStackDepth = resources.MaxCallStackDepth;145 124 TScopedPoolAllocator scopedAlloc(&allocator, false); 146 125 … … 148 127 if (!InitBuiltInSymbolTable(resources)) 149 128 return false; 150 151 129 InitExtensionBehavior(resources, extensionBehavior); 152 130 fragmentPrecisionHigh = resources.FragmentPrecisionHigh == 1; … … 193 171 // Start pushing the user-defined symbols at global level. 194 172 symbolTable.push(); 195 if (!symbolTable.atGlobalLevel()) { 196 infoSink.info.prefix(EPrefixInternalError); 197 infoSink.info << "Wrong symbol table level"; 198 } 173 if (!symbolTable.atGlobalLevel()) 174 infoSink.info.message(EPrefixInternalError, "Wrong symbol table level"); 199 175 200 176 // Parse shader. … … 207 183 208 184 if (success) 209 success = detect CallDepth(root, infoSink, (compileOptions & SH_LIMIT_CALL_STACK_DEPTH) != 0);185 success = detectRecursion(root); 210 186 211 187 if (success && (compileOptions & SH_VALIDATE_LOOP_INDEXING)) … … 229 205 if (success && (compileOptions & SH_CLAMP_INDIRECT_ARRAY_BOUNDS)) 230 206 arrayBoundsClamper.MarkIndirectArrayBoundsForClamping(root); 231 232 // Disallow expressions deemed too complex.233 if (success && (compileOptions & SH_LIMIT_EXPRESSION_COMPLEXITY))234 success = limitExpressionComplexity(root);235 207 236 208 // Call mapLongVariableNames() before collectAttribsUniforms() so in … … 246 218 success = enforcePackingRestrictions(); 247 219 if (!success) { 248 infoSink.info.prefix(EPrefixError); 249 infoSink.info << "too many uniforms"; 220 infoSink.info.message(EPrefixError, "too many uniforms"); 250 221 } 251 222 } … … 293 264 } 294 265 295 bool TCompiler::detect CallDepth(TIntermNode* root, TInfoSink& infoSink, bool limitCallStackDepth)296 { 297 Detect CallDepth detect(infoSink, limitCallStackDepth, maxCallStackDepth);266 bool TCompiler::detectRecursion(TIntermNode* root) 267 { 268 DetectRecursion detect; 298 269 root->traverse(&detect); 299 switch (detect.detect CallDepth()) {300 case Detect CallDepth::kErrorNone:270 switch (detect.detectRecursion()) { 271 case DetectRecursion::kErrorNone: 301 272 return true; 302 case DetectCallDepth::kErrorMissingMain: 303 infoSink.info.prefix(EPrefixError); 304 infoSink.info << "Missing main()"; 273 case DetectRecursion::kErrorMissingMain: 274 infoSink.info.message(EPrefixError, "Missing main()"); 305 275 return false; 306 case DetectCallDepth::kErrorRecursion: 307 infoSink.info.prefix(EPrefixError); 308 infoSink.info << "Function recursion detected"; 309 return false; 310 case DetectCallDepth::kErrorMaxDepthExceeded: 311 infoSink.info.prefix(EPrefixError); 312 infoSink.info << "Function call stack too deep"; 276 case DetectRecursion::kErrorRecursion: 277 infoSink.info.message(EPrefixError, "Function recursion detected"); 313 278 return false; 314 279 default: … … 356 321 } 357 322 358 bool TCompiler::limitExpressionComplexity(TIntermNode* root)359 {360 TIntermTraverser traverser;361 root->traverse(&traverser);362 TDependencyGraph graph(root);363 364 for (TFunctionCallVector::const_iterator iter = graph.beginUserDefinedFunctionCalls();365 iter != graph.endUserDefinedFunctionCalls();366 ++iter)367 {368 TGraphFunctionCall* samplerSymbol = *iter;369 TDependencyGraphTraverser graphTraverser;370 samplerSymbol->traverse(&graphTraverser);371 }372 373 if (traverser.getMaxDepth() > maxExpressionComplexity) {374 infoSink.info << "Expression too complex.";375 return false;376 }377 return true;378 }379 380 323 bool TCompiler::enforceFragmentShaderTimingRestrictions(const TDependencyGraph& graph) 381 324 { -
trunk/Source/ThirdParty/ANGLE/src/compiler/ConstantUnion.h
r152755 r152946 1 1 // 2 // Copyright (c) 2002-201 3The ANGLE Project Authors. All rights reserved.2 // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. 3 3 // Use of this source code is governed by a BSD-style license that can be 4 4 // found in the LICENSE file. … … 15 15 { 16 16 iConst = 0; 17 type = EbtVoid;18 17 } 19 18 -
trunk/Source/ThirdParty/ANGLE/src/compiler/DetectRecursion.h
-
Property svn:eol-style
set to
native
-
Property svn:keywords
set to
Date Author Id Revision HeadURL
r152943 r152946 10 10 #include "GLSLANG/ShaderLang.h" 11 11 12 #include <limits.h>13 12 #include "compiler/intermediate.h" 14 13 #include "compiler/VariableInfo.h" 15 14 16 class TInfoSink;17 18 15 // Traverses intermediate tree to detect function recursion. 19 class Detect CallDepth: public TIntermTraverser {16 class DetectRecursion : public TIntermTraverser { 20 17 public: 21 18 enum ErrorCode { 22 19 kErrorMissingMain, 23 20 kErrorRecursion, 24 kErrorMaxDepthExceeded,25 21 kErrorNone 26 22 }; 27 23 28 Detect CallDepth(TInfoSink& infoSync, bool limitCallStackDepth, int maxCallStackDepth);29 ~Detect CallDepth();24 DetectRecursion(); 25 ~DetectRecursion(); 30 26 31 27 virtual bool visitAggregate(Visit, TIntermAggregate*); 32 28 33 bool checkExceedsMaxDepth(int depth); 34 35 ErrorCode detectCallDepth(); 29 ErrorCode detectRecursion(); 36 30 37 31 private: 38 32 class FunctionNode { 39 33 public: 40 static const int kInfiniteCallDepth = INT_MAX;41 42 34 FunctionNode(const TString& fname); 43 35 … … 47 39 void addCallee(FunctionNode* callee); 48 40 49 // Returns kInifinityCallDepth if recursive function calls are detected. 50 int detectCallDepth(DetectCallDepth* detectCallDepth, int depth); 51 52 // Reset state. 53 void reset(); 41 // Return true if recursive function calls are detected. 42 bool detectRecursion(); 54 43 55 44 private: … … 63 52 }; 64 53 65 ErrorCode detectCallDepthForFunction(FunctionNode* func);66 54 FunctionNode* findFunctionByName(const TString& name); 67 void resetFunctionNodes();68 69 TInfoSink& getInfoSink() { return infoSink; }70 55 71 56 TVector<FunctionNode*> functions; 72 57 FunctionNode* currentFunction; 73 TInfoSink& infoSink;74 int maxDepth;75 76 DetectCallDepth(const DetectCallDepth&);77 void operator=(const DetectCallDepth&);78 58 }; 79 59 -
Property svn:eol-style
set to
-
trunk/Source/ThirdParty/ANGLE/src/compiler/Diagnostics.cpp
r152755 r152946 47 47 /* VC++ format: file(linenum) : error #: 'token' : extrainfo */ 48 48 sink.prefix(prefix); 49 sink.location( loc.file, loc.line);49 sink.location(EncodeSourceLoc(loc.file, loc.line)); 50 50 sink << "'" << token << "' : " << reason << " " << extra << "\n"; 51 51 } -
trunk/Source/ThirdParty/ANGLE/src/compiler/ForLoopUnroll.cpp
r152755 r152946 1 1 // 2 // Copyright (c) 2002-201 3The ANGLE Project Authors. All rights reserved.2 // Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved. 3 3 // Use of this source code is governed by a BSD-style license that can be 4 4 // found in the LICENSE file. … … 211 211 { 212 212 ASSERT((node != NULL) && (node->getUnionArrayPointer() != NULL)); 213 return node->get IConst(0);214 } 215 213 return node->getUnionArrayPointer()->getIConst(); 214 } 215 -
trunk/Source/ThirdParty/ANGLE/src/compiler/InfoSink.cpp
r152755 r152946 7 7 #include "compiler/InfoSink.h" 8 8 9 void TInfoSinkBase::prefix(TPrefixType p) {10 switch( p) {9 void TInfoSinkBase::prefix(TPrefixType message) { 10 switch(message) { 11 11 case EPrefixNone: 12 12 break; … … 32 32 } 33 33 34 void TInfoSinkBase::location(int file, int line) { 34 void TInfoSinkBase::location(TSourceLoc loc) { 35 int string = 0, line = 0; 36 DecodeSourceLoc(loc, &string, &line); 37 35 38 TPersistStringStream stream; 36 39 if (line) 37 stream << file<< ":" << line;40 stream << string << ":" << line; 38 41 else 39 stream << file<< ":? ";42 stream << string << ":? "; 40 43 stream << ": "; 41 44 … … 43 46 } 44 47 45 void TInfoSinkBase::location(const TSourceLoc& loc) { 46 location(loc.first_file, loc.first_line); 48 void TInfoSinkBase::message(TPrefixType message, const char* s) { 49 prefix(message); 50 sink.append(s); 51 sink.append("\n"); 47 52 } 48 53 49 void TInfoSinkBase::message(TPrefixType p, const TSourceLoc& loc, const char* m) {50 prefix( p);54 void TInfoSinkBase::message(TPrefixType message, const char* s, TSourceLoc loc) { 55 prefix(message); 51 56 location(loc); 52 sink.append( m);57 sink.append(s); 53 58 sink.append("\n"); 54 59 } -
trunk/Source/ThirdParty/ANGLE/src/compiler/InfoSink.h
r152755 r152946 97 97 const char* c_str() const { return sink.c_str(); } 98 98 99 void prefix(TPrefixType p);100 void location( int file, int line);101 void location(const TSourceLoc& loc);102 void message(TPrefixType p, const TSourceLoc& loc, const char* m);99 void prefix(TPrefixType message); 100 void location(TSourceLoc loc); 101 void message(TPrefixType message, const char* s); 102 void message(TPrefixType message, const char* s, TSourceLoc loc); 103 103 104 104 private: -
trunk/Source/ThirdParty/ANGLE/src/compiler/Initialize.cpp
r152755 r152946 14 14 15 15 #include "compiler/intermediate.h" 16 17 //============================================================================ 18 // 19 // Prototypes for built-in functions seen by both vertex and fragment shaders. 20 // 21 //============================================================================ 22 static TString BuiltInFunctionsCommon(const ShBuiltInResources& resources) 23 { 24 TString s; 25 26 // 27 // Angle and Trigonometric Functions. 28 // 29 s.append(TString("float radians(float degrees);")); 30 s.append(TString("vec2 radians(vec2 degrees);")); 31 s.append(TString("vec3 radians(vec3 degrees);")); 32 s.append(TString("vec4 radians(vec4 degrees);")); 33 34 s.append(TString("float degrees(float radians);")); 35 s.append(TString("vec2 degrees(vec2 radians);")); 36 s.append(TString("vec3 degrees(vec3 radians);")); 37 s.append(TString("vec4 degrees(vec4 radians);")); 38 39 s.append(TString("float sin(float angle);")); 40 s.append(TString("vec2 sin(vec2 angle);")); 41 s.append(TString("vec3 sin(vec3 angle);")); 42 s.append(TString("vec4 sin(vec4 angle);")); 43 44 s.append(TString("float cos(float angle);")); 45 s.append(TString("vec2 cos(vec2 angle);")); 46 s.append(TString("vec3 cos(vec3 angle);")); 47 s.append(TString("vec4 cos(vec4 angle);")); 48 49 s.append(TString("float tan(float angle);")); 50 s.append(TString("vec2 tan(vec2 angle);")); 51 s.append(TString("vec3 tan(vec3 angle);")); 52 s.append(TString("vec4 tan(vec4 angle);")); 53 54 s.append(TString("float asin(float x);")); 55 s.append(TString("vec2 asin(vec2 x);")); 56 s.append(TString("vec3 asin(vec3 x);")); 57 s.append(TString("vec4 asin(vec4 x);")); 58 59 s.append(TString("float acos(float x);")); 60 s.append(TString("vec2 acos(vec2 x);")); 61 s.append(TString("vec3 acos(vec3 x);")); 62 s.append(TString("vec4 acos(vec4 x);")); 63 64 s.append(TString("float atan(float y, float x);")); 65 s.append(TString("vec2 atan(vec2 y, vec2 x);")); 66 s.append(TString("vec3 atan(vec3 y, vec3 x);")); 67 s.append(TString("vec4 atan(vec4 y, vec4 x);")); 68 69 s.append(TString("float atan(float y_over_x);")); 70 s.append(TString("vec2 atan(vec2 y_over_x);")); 71 s.append(TString("vec3 atan(vec3 y_over_x);")); 72 s.append(TString("vec4 atan(vec4 y_over_x);")); 73 74 // 75 // Exponential Functions. 76 // 77 s.append(TString("float pow(float x, float y);")); 78 s.append(TString("vec2 pow(vec2 x, vec2 y);")); 79 s.append(TString("vec3 pow(vec3 x, vec3 y);")); 80 s.append(TString("vec4 pow(vec4 x, vec4 y);")); 81 82 s.append(TString("float exp(float x);")); 83 s.append(TString("vec2 exp(vec2 x);")); 84 s.append(TString("vec3 exp(vec3 x);")); 85 s.append(TString("vec4 exp(vec4 x);")); 86 87 s.append(TString("float log(float x);")); 88 s.append(TString("vec2 log(vec2 x);")); 89 s.append(TString("vec3 log(vec3 x);")); 90 s.append(TString("vec4 log(vec4 x);")); 91 92 s.append(TString("float exp2(float x);")); 93 s.append(TString("vec2 exp2(vec2 x);")); 94 s.append(TString("vec3 exp2(vec3 x);")); 95 s.append(TString("vec4 exp2(vec4 x);")); 96 97 s.append(TString("float log2(float x);")); 98 s.append(TString("vec2 log2(vec2 x);")); 99 s.append(TString("vec3 log2(vec3 x);")); 100 s.append(TString("vec4 log2(vec4 x);")); 101 102 s.append(TString("float sqrt(float x);")); 103 s.append(TString("vec2 sqrt(vec2 x);")); 104 s.append(TString("vec3 sqrt(vec3 x);")); 105 s.append(TString("vec4 sqrt(vec4 x);")); 106 107 s.append(TString("float inversesqrt(float x);")); 108 s.append(TString("vec2 inversesqrt(vec2 x);")); 109 s.append(TString("vec3 inversesqrt(vec3 x);")); 110 s.append(TString("vec4 inversesqrt(vec4 x);")); 111 112 // 113 // Common Functions. 114 // 115 s.append(TString("float abs(float x);")); 116 s.append(TString("vec2 abs(vec2 x);")); 117 s.append(TString("vec3 abs(vec3 x);")); 118 s.append(TString("vec4 abs(vec4 x);")); 119 120 s.append(TString("float sign(float x);")); 121 s.append(TString("vec2 sign(vec2 x);")); 122 s.append(TString("vec3 sign(vec3 x);")); 123 s.append(TString("vec4 sign(vec4 x);")); 124 125 s.append(TString("float floor(float x);")); 126 s.append(TString("vec2 floor(vec2 x);")); 127 s.append(TString("vec3 floor(vec3 x);")); 128 s.append(TString("vec4 floor(vec4 x);")); 129 130 s.append(TString("float ceil(float x);")); 131 s.append(TString("vec2 ceil(vec2 x);")); 132 s.append(TString("vec3 ceil(vec3 x);")); 133 s.append(TString("vec4 ceil(vec4 x);")); 134 135 s.append(TString("float fract(float x);")); 136 s.append(TString("vec2 fract(vec2 x);")); 137 s.append(TString("vec3 fract(vec3 x);")); 138 s.append(TString("vec4 fract(vec4 x);")); 139 140 s.append(TString("float mod(float x, float y);")); 141 s.append(TString("vec2 mod(vec2 x, float y);")); 142 s.append(TString("vec3 mod(vec3 x, float y);")); 143 s.append(TString("vec4 mod(vec4 x, float y);")); 144 s.append(TString("vec2 mod(vec2 x, vec2 y);")); 145 s.append(TString("vec3 mod(vec3 x, vec3 y);")); 146 s.append(TString("vec4 mod(vec4 x, vec4 y);")); 147 148 s.append(TString("float min(float x, float y);")); 149 s.append(TString("vec2 min(vec2 x, float y);")); 150 s.append(TString("vec3 min(vec3 x, float y);")); 151 s.append(TString("vec4 min(vec4 x, float y);")); 152 s.append(TString("vec2 min(vec2 x, vec2 y);")); 153 s.append(TString("vec3 min(vec3 x, vec3 y);")); 154 s.append(TString("vec4 min(vec4 x, vec4 y);")); 155 156 s.append(TString("float max(float x, float y);")); 157 s.append(TString("vec2 max(vec2 x, float y);")); 158 s.append(TString("vec3 max(vec3 x, float y);")); 159 s.append(TString("vec4 max(vec4 x, float y);")); 160 s.append(TString("vec2 max(vec2 x, vec2 y);")); 161 s.append(TString("vec3 max(vec3 x, vec3 y);")); 162 s.append(TString("vec4 max(vec4 x, vec4 y);")); 163 164 s.append(TString("float clamp(float x, float minVal, float maxVal);")); 165 s.append(TString("vec2 clamp(vec2 x, float minVal, float maxVal);")); 166 s.append(TString("vec3 clamp(vec3 x, float minVal, float maxVal);")); 167 s.append(TString("vec4 clamp(vec4 x, float minVal, float maxVal);")); 168 s.append(TString("vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal);")); 169 s.append(TString("vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal);")); 170 s.append(TString("vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal);")); 171 172 s.append(TString("float mix(float x, float y, float a);")); 173 s.append(TString("vec2 mix(vec2 x, vec2 y, float a);")); 174 s.append(TString("vec3 mix(vec3 x, vec3 y, float a);")); 175 s.append(TString("vec4 mix(vec4 x, vec4 y, float a);")); 176 s.append(TString("vec2 mix(vec2 x, vec2 y, vec2 a);")); 177 s.append(TString("vec3 mix(vec3 x, vec3 y, vec3 a);")); 178 s.append(TString("vec4 mix(vec4 x, vec4 y, vec4 a);")); 179 180 s.append(TString("float step(float edge, float x);")); 181 s.append(TString("vec2 step(vec2 edge, vec2 x);")); 182 s.append(TString("vec3 step(vec3 edge, vec3 x);")); 183 s.append(TString("vec4 step(vec4 edge, vec4 x);")); 184 s.append(TString("vec2 step(float edge, vec2 x);")); 185 s.append(TString("vec3 step(float edge, vec3 x);")); 186 s.append(TString("vec4 step(float edge, vec4 x);")); 187 188 s.append(TString("float smoothstep(float edge0, float edge1, float x);")); 189 s.append(TString("vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x);")); 190 s.append(TString("vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x);")); 191 s.append(TString("vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x);")); 192 s.append(TString("vec2 smoothstep(float edge0, float edge1, vec2 x);")); 193 s.append(TString("vec3 smoothstep(float edge0, float edge1, vec3 x);")); 194 s.append(TString("vec4 smoothstep(float edge0, float edge1, vec4 x);")); 195 196 // 197 // Geometric Functions. 198 // 199 s.append(TString("float length(float x);")); 200 s.append(TString("float length(vec2 x);")); 201 s.append(TString("float length(vec3 x);")); 202 s.append(TString("float length(vec4 x);")); 203 204 s.append(TString("float distance(float p0, float p1);")); 205 s.append(TString("float distance(vec2 p0, vec2 p1);")); 206 s.append(TString("float distance(vec3 p0, vec3 p1);")); 207 s.append(TString("float distance(vec4 p0, vec4 p1);")); 208 209 s.append(TString("float dot(float x, float y);")); 210 s.append(TString("float dot(vec2 x, vec2 y);")); 211 s.append(TString("float dot(vec3 x, vec3 y);")); 212 s.append(TString("float dot(vec4 x, vec4 y);")); 213 214 s.append(TString("vec3 cross(vec3 x, vec3 y);")); 215 s.append(TString("float normalize(float x);")); 216 s.append(TString("vec2 normalize(vec2 x);")); 217 s.append(TString("vec3 normalize(vec3 x);")); 218 s.append(TString("vec4 normalize(vec4 x);")); 219 220 s.append(TString("float faceforward(float N, float I, float Nref);")); 221 s.append(TString("vec2 faceforward(vec2 N, vec2 I, vec2 Nref);")); 222 s.append(TString("vec3 faceforward(vec3 N, vec3 I, vec3 Nref);")); 223 s.append(TString("vec4 faceforward(vec4 N, vec4 I, vec4 Nref);")); 224 225 s.append(TString("float reflect(float I, float N);")); 226 s.append(TString("vec2 reflect(vec2 I, vec2 N);")); 227 s.append(TString("vec3 reflect(vec3 I, vec3 N);")); 228 s.append(TString("vec4 reflect(vec4 I, vec4 N);")); 229 230 s.append(TString("float refract(float I, float N, float eta);")); 231 s.append(TString("vec2 refract(vec2 I, vec2 N, float eta);")); 232 s.append(TString("vec3 refract(vec3 I, vec3 N, float eta);")); 233 s.append(TString("vec4 refract(vec4 I, vec4 N, float eta);")); 234 235 // 236 // Matrix Functions. 237 // 238 s.append(TString("mat2 matrixCompMult(mat2 x, mat2 y);")); 239 s.append(TString("mat3 matrixCompMult(mat3 x, mat3 y);")); 240 s.append(TString("mat4 matrixCompMult(mat4 x, mat4 y);")); 241 242 // 243 // Vector relational functions. 244 // 245 s.append(TString("bvec2 lessThan(vec2 x, vec2 y);")); 246 s.append(TString("bvec3 lessThan(vec3 x, vec3 y);")); 247 s.append(TString("bvec4 lessThan(vec4 x, vec4 y);")); 248 249 s.append(TString("bvec2 lessThan(ivec2 x, ivec2 y);")); 250 s.append(TString("bvec3 lessThan(ivec3 x, ivec3 y);")); 251 s.append(TString("bvec4 lessThan(ivec4 x, ivec4 y);")); 252 253 s.append(TString("bvec2 lessThanEqual(vec2 x, vec2 y);")); 254 s.append(TString("bvec3 lessThanEqual(vec3 x, vec3 y);")); 255 s.append(TString("bvec4 lessThanEqual(vec4 x, vec4 y);")); 256 257 s.append(TString("bvec2 lessThanEqual(ivec2 x, ivec2 y);")); 258 s.append(TString("bvec3 lessThanEqual(ivec3 x, ivec3 y);")); 259 s.append(TString("bvec4 lessThanEqual(ivec4 x, ivec4 y);")); 260 261 s.append(TString("bvec2 greaterThan(vec2 x, vec2 y);")); 262 s.append(TString("bvec3 greaterThan(vec3 x, vec3 y);")); 263 s.append(TString("bvec4 greaterThan(vec4 x, vec4 y);")); 264 265 s.append(TString("bvec2 greaterThan(ivec2 x, ivec2 y);")); 266 s.append(TString("bvec3 greaterThan(ivec3 x, ivec3 y);")); 267 s.append(TString("bvec4 greaterThan(ivec4 x, ivec4 y);")); 268 269 s.append(TString("bvec2 greaterThanEqual(vec2 x, vec2 y);")); 270 s.append(TString("bvec3 greaterThanEqual(vec3 x, vec3 y);")); 271 s.append(TString("bvec4 greaterThanEqual(vec4 x, vec4 y);")); 272 273 s.append(TString("bvec2 greaterThanEqual(ivec2 x, ivec2 y);")); 274 s.append(TString("bvec3 greaterThanEqual(ivec3 x, ivec3 y);")); 275 s.append(TString("bvec4 greaterThanEqual(ivec4 x, ivec4 y);")); 276 277 s.append(TString("bvec2 equal(vec2 x, vec2 y);")); 278 s.append(TString("bvec3 equal(vec3 x, vec3 y);")); 279 s.append(TString("bvec4 equal(vec4 x, vec4 y);")); 280 281 s.append(TString("bvec2 equal(ivec2 x, ivec2 y);")); 282 s.append(TString("bvec3 equal(ivec3 x, ivec3 y);")); 283 s.append(TString("bvec4 equal(ivec4 x, ivec4 y);")); 284 285 s.append(TString("bvec2 equal(bvec2 x, bvec2 y);")); 286 s.append(TString("bvec3 equal(bvec3 x, bvec3 y);")); 287 s.append(TString("bvec4 equal(bvec4 x, bvec4 y);")); 288 289 s.append(TString("bvec2 notEqual(vec2 x, vec2 y);")); 290 s.append(TString("bvec3 notEqual(vec3 x, vec3 y);")); 291 s.append(TString("bvec4 notEqual(vec4 x, vec4 y);")); 292 293 s.append(TString("bvec2 notEqual(ivec2 x, ivec2 y);")); 294 s.append(TString("bvec3 notEqual(ivec3 x, ivec3 y);")); 295 s.append(TString("bvec4 notEqual(ivec4 x, ivec4 y);")); 296 297 s.append(TString("bvec2 notEqual(bvec2 x, bvec2 y);")); 298 s.append(TString("bvec3 notEqual(bvec3 x, bvec3 y);")); 299 s.append(TString("bvec4 notEqual(bvec4 x, bvec4 y);")); 300 301 s.append(TString("bool any(bvec2 x);")); 302 s.append(TString("bool any(bvec3 x);")); 303 s.append(TString("bool any(bvec4 x);")); 304 305 s.append(TString("bool all(bvec2 x);")); 306 s.append(TString("bool all(bvec3 x);")); 307 s.append(TString("bool all(bvec4 x);")); 308 309 s.append(TString("bvec2 not(bvec2 x);")); 310 s.append(TString("bvec3 not(bvec3 x);")); 311 s.append(TString("bvec4 not(bvec4 x);")); 312 313 // 314 // Texture Functions. 315 // 316 s.append(TString("vec4 texture2D(sampler2D sampler, vec2 coord);")); 317 s.append(TString("vec4 texture2DProj(sampler2D sampler, vec3 coord);")); 318 s.append(TString("vec4 texture2DProj(sampler2D sampler, vec4 coord);")); 319 s.append(TString("vec4 textureCube(samplerCube sampler, vec3 coord);")); 320 321 if (resources.OES_EGL_image_external) { 322 s.append(TString("vec4 texture2D(samplerExternalOES sampler, vec2 coord);")); 323 s.append(TString("vec4 texture2DProj(samplerExternalOES sampler, vec3 coord);")); 324 s.append(TString("vec4 texture2DProj(samplerExternalOES sampler, vec4 coord);")); 325 } 326 327 if (resources.ARB_texture_rectangle) { 328 s.append(TString("vec4 texture2DRect(sampler2DRect sampler, vec2 coord);")); 329 s.append(TString("vec4 texture2DRectProj(sampler2DRect sampler, vec3 coord);")); 330 s.append(TString("vec4 texture2DRectProj(sampler2DRect sampler, vec4 coord);")); 331 } 332 333 // 334 // Noise functions. 335 // 336 //s.append(TString("float noise1(float x);")); 337 //s.append(TString("float noise1(vec2 x);")); 338 //s.append(TString("float noise1(vec3 x);")); 339 //s.append(TString("float noise1(vec4 x);")); 340 341 //s.append(TString("vec2 noise2(float x);")); 342 //s.append(TString("vec2 noise2(vec2 x);")); 343 //s.append(TString("vec2 noise2(vec3 x);")); 344 //s.append(TString("vec2 noise2(vec4 x);")); 345 346 //s.append(TString("vec3 noise3(float x);")); 347 //s.append(TString("vec3 noise3(vec2 x);")); 348 //s.append(TString("vec3 noise3(vec3 x);")); 349 //s.append(TString("vec3 noise3(vec4 x);")); 350 351 //s.append(TString("vec4 noise4(float x);")); 352 //s.append(TString("vec4 noise4(vec2 x);")); 353 //s.append(TString("vec4 noise4(vec3 x);")); 354 //s.append(TString("vec4 noise4(vec4 x);")); 355 356 return s; 357 } 358 359 //============================================================================ 360 // 361 // Prototypes for built-in functions seen by vertex shaders only. 362 // 363 //============================================================================ 364 static TString BuiltInFunctionsVertex(const ShBuiltInResources& resources) 365 { 366 TString s; 367 368 // 369 // Geometric Functions. 370 // 371 //s.append(TString("vec4 ftransform();")); 372 373 // 374 // Texture Functions. 375 // 376 s.append(TString("vec4 texture2DLod(sampler2D sampler, vec2 coord, float lod);")); 377 s.append(TString("vec4 texture2DProjLod(sampler2D sampler, vec3 coord, float lod);")); 378 s.append(TString("vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod);")); 379 s.append(TString("vec4 textureCubeLod(samplerCube sampler, vec3 coord, float lod);")); 380 381 return s; 382 } 16 383 17 384 //============================================================================ … … 134 501 case SH_FRAGMENT_SHADER: 135 502 builtInStrings.push_back(DefaultPrecisionFragment()); 503 builtInStrings.push_back(BuiltInFunctionsCommon(resources)); 136 504 builtInStrings.push_back(BuiltInFunctionsFragment(resources)); 137 505 builtInStrings.push_back(StandardUniforms()); … … 140 508 case SH_VERTEX_SHADER: 141 509 builtInStrings.push_back(DefaultPrecisionVertex()); 510 builtInStrings.push_back(BuiltInFunctionsCommon(resources)); 511 builtInStrings.push_back(BuiltInFunctionsVertex(resources)); 142 512 builtInStrings.push_back(StandardUniforms()); 143 513 break; … … 170 540 symbolTable.insert(*new TVariable(NewPoolTString("gl_FragColor"), TType(EbtFloat, EbpMedium, EvqFragColor, 4))); 171 541 symbolTable.insert(*new TVariable(NewPoolTString("gl_FragData[gl_MaxDrawBuffers]"), TType(EbtFloat, EbpMedium, EvqFragData, 4))); 172 if (resources.EXT_frag_depth) {173 symbolTable.insert(*new TVariable(NewPoolTString("gl_FragDepthEXT"), TType(EbtFloat, resources.FragmentPrecisionHigh ? EbpHigh : EbpMedium, EvqFragDepth, 1)));174 symbolTable.relateToExtension("gl_FragDepthEXT", "GL_EXT_frag_depth");175 }176 542 } else { 177 543 symbolTable.insert(*new TVariable(NewPoolTString("css_MixColor"), TType(EbtFloat, EbpMedium, EvqGlobal, 4))); … … 291 657 if (resources.EXT_draw_buffers) 292 658 extBehavior["GL_EXT_draw_buffers"] = EBhUndefined; 293 if (resources.EXT_frag_depth) 294 extBehavior["GL_EXT_frag_depth"] = EBhUndefined; 295 } 659 } -
trunk/Source/ThirdParty/ANGLE/src/compiler/Intermediate.cpp
r152755 r152946 1 1 // 2 // Copyright (c) 2002-201 3The ANGLE Project Authors. All rights reserved.2 // Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved. 3 3 // Use of this source code is governed by a BSD-style license that can be 4 4 // found in the LICENSE file. … … 132 132 // Returns the added node. 133 133 // 134 TIntermSymbol* TIntermediate::addSymbol(int id, const TString& name, const TType& type, const TSourceLoc&line)134 TIntermSymbol* TIntermediate::addSymbol(int id, const TString& name, const TType& type, TSourceLoc line) 135 135 { 136 136 TIntermSymbol* node = new TIntermSymbol(id, name, type); … … 145 145 // Returns the added node. 146 146 // 147 TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIntermTyped* right, const TSourceLoc&line, TSymbolTable& symbolTable)147 TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIntermTyped* right, TSourceLoc line, TSymbolTable& symbolTable) 148 148 { 149 149 switch (op) { … … 201 201 // 202 202 TIntermBinary* node = new TIntermBinary(op); 203 if (line == 0) 204 line = right->getLine(); 203 205 node->setLine(line); 204 206 … … 229 231 // Returns the added node. 230 232 // 231 TIntermTyped* TIntermediate::addAssign(TOperator op, TIntermTyped* left, TIntermTyped* right, const TSourceLoc&line)233 TIntermTyped* TIntermediate::addAssign(TOperator op, TIntermTyped* left, TIntermTyped* right, TSourceLoc line) 232 234 { 233 235 // … … 236 238 // 237 239 TIntermBinary* node = new TIntermBinary(op); 240 if (line == 0) 241 line = left->getLine(); 238 242 node->setLine(line); 239 243 … … 257 261 // The caller should set the type of the returned node. 258 262 // 259 TIntermTyped* TIntermediate::addIndex(TOperator op, TIntermTyped* base, TIntermTyped* index, const TSourceLoc&line)263 TIntermTyped* TIntermediate::addIndex(TOperator op, TIntermTyped* base, TIntermTyped* index, TSourceLoc line) 260 264 { 261 265 TIntermBinary* node = new TIntermBinary(op); 266 if (line == 0) 267 line = index->getLine(); 262 268 node->setLine(line); 263 269 node->setLeft(base); … … 274 280 // Returns the added node. 275 281 // 276 TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermNode* childNode, const TSourceLoc&line, TSymbolTable& symbolTable)282 TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermNode* childNode, TSourceLoc line, TSymbolTable& symbolTable) 277 283 { 278 284 TIntermUnary* node; … … 280 286 281 287 if (child == 0) { 282 infoSink.info.message(EPrefixInternalError, line, "Bad type in AddUnaryMath");288 infoSink.info.message(EPrefixInternalError, "Bad type in AddUnaryMath", line); 283 289 return 0; 284 290 } … … 343 349 // 344 350 node = new TIntermUnary(op); 351 if (line == 0) 352 line = child->getLine(); 345 353 node->setLine(line); 346 354 node->setOperand(child); … … 369 377 // it was already an aggregate but no operator was set. 370 378 // 371 TIntermAggregate* TIntermediate::setAggregateOperator(TIntermNode* node, TOperator op, const TSourceLoc&line)379 TIntermAggregate* TIntermediate::setAggregateOperator(TIntermNode* node, TOperator op, TSourceLoc line) 372 380 { 373 381 TIntermAggregate* aggNode; … … 384 392 aggNode = new TIntermAggregate(); 385 393 aggNode->getSequence().push_back(node); 394 if (line == 0) 395 line = node->getLine(); 386 396 } 387 397 } else … … 392 402 // 393 403 aggNode->setOp(op); 394 aggNode->setLine(line); 404 if (line != 0) 405 aggNode->setLine(line); 395 406 396 407 return aggNode; … … 481 492 case EbtBool: newOp = EOpConvBoolToFloat; break; 482 493 default: 483 infoSink.info.message(EPrefixInternalError, node->getLine(), "Bad promotion node");494 infoSink.info.message(EPrefixInternalError, "Bad promotion node", node->getLine()); 484 495 return 0; 485 496 } … … 490 501 case EbtFloat: newOp = EOpConvFloatToBool; break; 491 502 default: 492 infoSink.info.message(EPrefixInternalError, node->getLine(), "Bad promotion node");503 infoSink.info.message(EPrefixInternalError, "Bad promotion node", node->getLine()); 493 504 return 0; 494 505 } … … 499 510 case EbtFloat: newOp = EOpConvFloatToInt; break; 500 511 default: 501 infoSink.info.message(EPrefixInternalError, node->getLine(), "Bad promotion node");512 infoSink.info.message(EPrefixInternalError, "Bad promotion node", node->getLine()); 502 513 return 0; 503 514 } 504 515 break; 505 516 default: 506 infoSink.info.message(EPrefixInternalError, node->getLine(), "Bad promotion type");517 infoSink.info.message(EPrefixInternalError, "Bad promotion type", node->getLine()); 507 518 return 0; 508 519 } … … 524 535 // both existing nodes. 525 536 // 526 TIntermAggregate* TIntermediate::growAggregate(TIntermNode* left, TIntermNode* right, const TSourceLoc&line)537 TIntermAggregate* TIntermediate::growAggregate(TIntermNode* left, TIntermNode* right, TSourceLoc line) 527 538 { 528 539 if (left == 0 && right == 0) … … 541 552 aggNode->getSequence().push_back(right); 542 553 543 aggNode->setLine(line); 554 if (line != 0) 555 aggNode->setLine(line); 544 556 545 557 return aggNode; … … 551 563 // Returns an aggregate, unless 0 was passed in for the existing node. 552 564 // 553 TIntermAggregate* TIntermediate::makeAggregate(TIntermNode* node, const TSourceLoc&line)565 TIntermAggregate* TIntermediate::makeAggregate(TIntermNode* node, TSourceLoc line) 554 566 { 555 567 if (node == 0) … … 558 570 TIntermAggregate* aggNode = new TIntermAggregate; 559 571 aggNode->getSequence().push_back(node); 560 aggNode->setLine(line); 572 573 if (line != 0) 574 aggNode->setLine(line); 575 else 576 aggNode->setLine(node->getLine()); 561 577 562 578 return aggNode; … … 570 586 // Returns the selection node created. 571 587 // 572 TIntermNode* TIntermediate::addSelection(TIntermTyped* cond, TIntermNodePair nodePair, const TSourceLoc&line)588 TIntermNode* TIntermediate::addSelection(TIntermTyped* cond, TIntermNodePair nodePair, TSourceLoc line) 573 589 { 574 590 // … … 578 594 579 595 if (cond->getAsTyped() && cond->getAsTyped()->getAsConstantUnion()) { 580 if (cond->getAs ConstantUnion()->getBConst(0) == true)596 if (cond->getAsTyped()->getAsConstantUnion()->getUnionArrayPointer()->getBConst() == true) 581 597 return nodePair.node1 ? setAggregateOperator(nodePair.node1, EOpSequence, nodePair.node1->getLine()) : NULL; 582 598 else … … 591 607 592 608 593 TIntermTyped* TIntermediate::addComma(TIntermTyped* left, TIntermTyped* right, const TSourceLoc&line)609 TIntermTyped* TIntermediate::addComma(TIntermTyped* left, TIntermTyped* right, TSourceLoc line) 594 610 { 595 611 if (left->getType().getQualifier() == EvqConst && right->getType().getQualifier() == EvqConst) { … … 611 627 // Returns the selection node created, or 0 if one could not be. 612 628 // 613 TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* trueBlock, TIntermTyped* falseBlock, const TSourceLoc&line)629 TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* trueBlock, TIntermTyped* falseBlock, TSourceLoc line) 614 630 { 615 631 // … … 632 648 633 649 if (cond->getAsConstantUnion() && trueBlock->getAsConstantUnion() && falseBlock->getAsConstantUnion()) { 634 if (cond->getAsConstantUnion()->get BConst(0))650 if (cond->getAsConstantUnion()->getUnionArrayPointer()->getBConst()) 635 651 return trueBlock; 636 652 else … … 654 670 // 655 671 656 TIntermConstantUnion* TIntermediate::addConstantUnion(ConstantUnion* unionArrayPointer, const TType& t, const TSourceLoc&line)672 TIntermConstantUnion* TIntermediate::addConstantUnion(ConstantUnion* unionArrayPointer, const TType& t, TSourceLoc line) 657 673 { 658 674 TIntermConstantUnion* node = new TIntermConstantUnion(unionArrayPointer, t); … … 662 678 } 663 679 664 TIntermTyped* TIntermediate::addSwizzle(TVectorFields& fields, const TSourceLoc&line)680 TIntermTyped* TIntermediate::addSwizzle(TVectorFields& fields, TSourceLoc line) 665 681 { 666 682 … … 685 701 // Create loop nodes. 686 702 // 687 TIntermNode* TIntermediate::addLoop(TLoopType type, TIntermNode* init, TIntermTyped* cond, TIntermTyped* expr, TIntermNode* body, const TSourceLoc&line)703 TIntermNode* TIntermediate::addLoop(TLoopType type, TIntermNode* init, TIntermTyped* cond, TIntermTyped* expr, TIntermNode* body, TSourceLoc line) 688 704 { 689 705 TIntermNode* node = new TIntermLoop(type, init, cond, expr, body); … … 696 712 // Add branches. 697 713 // 698 TIntermBranch* TIntermediate::addBranch(TOperator branchOp, const TSourceLoc&line)714 TIntermBranch* TIntermediate::addBranch(TOperator branchOp, TSourceLoc line) 699 715 { 700 716 return addBranch(branchOp, 0, line); 701 717 } 702 718 703 TIntermBranch* TIntermediate::addBranch(TOperator branchOp, TIntermTyped* expression, const TSourceLoc&line)719 TIntermBranch* TIntermediate::addBranch(TOperator branchOp, TIntermTyped* expression, TSourceLoc line) 704 720 { 705 721 TIntermBranch* node = new TIntermBranch(branchOp, expression); … … 831 847 832 848 setType(operand->getType()); 833 type.setQualifier(EvqTemporary);834 849 835 850 return true; … … 846 861 // This function only handles scalars, vectors, and matrices. 847 862 if (left->isArray() || right->isArray()) { 848 infoSink.info.message(EPrefixInternalError, getLine(), "Invalid operation for arrays");863 infoSink.info.message(EPrefixInternalError, "Invalid operation for arrays", getLine()); 849 864 return false; 850 865 } … … 951 966 } 952 967 } else { 953 infoSink.info.message(EPrefixInternalError, getLine(), "Missing elses");968 infoSink.info.message(EPrefixInternalError, "Missing elses", getLine()); 954 969 return false; 955 970 } … … 980 995 } 981 996 } else { 982 infoSink.info.message(EPrefixInternalError, getLine(), "Missing elses");997 infoSink.info.message(EPrefixInternalError, "Missing elses", getLine()); 983 998 return false; 984 999 } … … 1020 1035 bool CompareStruct(const TType& leftNodeType, ConstantUnion* rightUnionArray, ConstantUnion* leftUnionArray) 1021 1036 { 1022 const T FieldList& fields = leftNodeType.getStruct()->fields();1023 1024 size_t structSize = fields .size();1025 size_t index = 0;1037 const TTypeList* fields = leftNodeType.getStruct(); 1038 1039 size_t structSize = fields->size(); 1040 int index = 0; 1026 1041 1027 1042 for (size_t j = 0; j < structSize; j++) { 1028 size_t size = fields[j]->type()->getObjectSize();1029 for ( size_t i = 0; i < size; i++) {1030 if ( fields[j]->type()->getBasicType() == EbtStruct) {1031 if (!CompareStructure(*( fields[j]->type()), &rightUnionArray[index], &leftUnionArray[index]))1043 int size = (*fields)[j].type->getObjectSize(); 1044 for (int i = 0; i < size; i++) { 1045 if ((*fields)[j].type->getBasicType() == EbtStruct) { 1046 if (!CompareStructure(*(*fields)[j].type, &rightUnionArray[index], &leftUnionArray[index])) 1032 1047 return false; 1033 1048 } else { … … 1036 1051 index++; 1037 1052 } 1053 1038 1054 } 1039 1055 } … … 1047 1063 typeWithoutArrayness.clearArrayness(); 1048 1064 1049 size_t arraySize = leftNodeType.getArraySize();1050 1051 for ( size_t i = 0; i < arraySize; ++i) {1052 size_t offset = typeWithoutArrayness.getObjectSize() * i;1065 int arraySize = leftNodeType.getArraySize(); 1066 1067 for (int i = 0; i < arraySize; ++i) { 1068 int offset = typeWithoutArrayness.getObjectSize() * i; 1053 1069 if (!CompareStruct(typeWithoutArrayness, &rightUnionArray[offset], &leftUnionArray[offset])) 1054 1070 return false; … … 1070 1086 { 1071 1087 ConstantUnion *unionArray = getUnionArrayPointer(); 1072 size_t objectSize = getType().getObjectSize();1088 int objectSize = getType().getObjectSize(); 1073 1089 1074 1090 if (constantNode) { // binary operations … … 1080 1096 if (constantNode->getType().getObjectSize() == 1 && objectSize > 1) { 1081 1097 rightUnionArray = new ConstantUnion[objectSize]; 1082 for ( size_t i = 0; i < objectSize; ++i)1098 for (int i = 0; i < objectSize; ++i) 1083 1099 rightUnionArray[i] = *node->getUnionArrayPointer(); 1084 1100 returnType = getType(); … … 1086 1102 // for a case like float f = vec4(2,3,4,5) + 1.2; 1087 1103 unionArray = new ConstantUnion[constantNode->getType().getObjectSize()]; 1088 for ( size_t i = 0; i < constantNode->getType().getObjectSize(); ++i)1104 for (int i = 0; i < constantNode->getType().getObjectSize(); ++i) 1089 1105 unionArray[i] = *getUnionArrayPointer(); 1090 1106 returnType = node->getType(); … … 1100 1116 tempConstArray = new ConstantUnion[objectSize]; 1101 1117 {// support MSVC++6.0 1102 for ( size_t i = 0; i < objectSize; i++)1118 for (int i = 0; i < objectSize; i++) 1103 1119 tempConstArray[i] = unionArray[i] + rightUnionArray[i]; 1104 1120 } … … 1107 1123 tempConstArray = new ConstantUnion[objectSize]; 1108 1124 {// support MSVC++6.0 1109 for ( size_t i = 0; i < objectSize; i++)1125 for (int i = 0; i < objectSize; i++) 1110 1126 tempConstArray[i] = unionArray[i] - rightUnionArray[i]; 1111 1127 } … … 1117 1133 tempConstArray = new ConstantUnion[objectSize]; 1118 1134 {// support MSVC++6.0 1119 for ( size_t i = 0; i < objectSize; i++)1135 for (int i = 0; i < objectSize; i++) 1120 1136 tempConstArray[i] = unionArray[i] * rightUnionArray[i]; 1121 1137 } … … 1123 1139 case EOpMatrixTimesMatrix: 1124 1140 if (getType().getBasicType() != EbtFloat || node->getBasicType() != EbtFloat) { 1125 infoSink.info.message(EPrefixInternalError, getLine(), "Constant Folding cannot be done for matrix multiply");1141 infoSink.info.message(EPrefixInternalError, "Constant Folding cannot be done for matrix multiply", getLine()); 1126 1142 return 0; 1127 1143 } … … 1142 1158 tempConstArray = new ConstantUnion[objectSize]; 1143 1159 {// support MSVC++6.0 1144 for ( size_t i = 0; i < objectSize; i++) {1160 for (int i = 0; i < objectSize; i++) { 1145 1161 switch (getType().getBasicType()) { 1146 1162 case EbtFloat: 1147 1163 if (rightUnionArray[i] == 0.0f) { 1148 infoSink.info.message(EPrefixWarning, getLine(), "Divide by zero error during constant folding");1164 infoSink.info.message(EPrefixWarning, "Divide by zero error during constant folding", getLine()); 1149 1165 tempConstArray[i].setFConst(unionArray[i].getFConst() < 0 ? -FLT_MAX : FLT_MAX); 1150 1166 } else … … 1154 1170 case EbtInt: 1155 1171 if (rightUnionArray[i] == 0) { 1156 infoSink.info.message(EPrefixWarning, getLine(), "Divide by zero error during constant folding");1172 infoSink.info.message(EPrefixWarning, "Divide by zero error during constant folding", getLine()); 1157 1173 tempConstArray[i].setIConst(INT_MAX); 1158 1174 } else … … 1160 1176 break; 1161 1177 default: 1162 infoSink.info.message(EPrefixInternalError, getLine(), "Constant folding cannot be done for \"/\"");1178 infoSink.info.message(EPrefixInternalError, "Constant folding cannot be done for \"/\"", getLine()); 1163 1179 return 0; 1164 1180 } … … 1169 1185 case EOpMatrixTimesVector: 1170 1186 if (node->getBasicType() != EbtFloat) { 1171 infoSink.info.message(EPrefixInternalError, getLine(), "Constant Folding cannot be done for matrix times vector");1187 infoSink.info.message(EPrefixInternalError, "Constant Folding cannot be done for matrix times vector", getLine()); 1172 1188 return 0; 1173 1189 } … … 1190 1206 case EOpVectorTimesMatrix: 1191 1207 if (getType().getBasicType() != EbtFloat) { 1192 infoSink.info.message(EPrefixInternalError, getLine(), "Constant Folding cannot be done for vector times matrix");1208 infoSink.info.message(EPrefixInternalError, "Constant Folding cannot be done for vector times matrix", getLine()); 1193 1209 return 0; 1194 1210 } … … 1208 1224 tempConstArray = new ConstantUnion[objectSize]; 1209 1225 {// support MSVC++6.0 1210 for ( size_t i = 0; i < objectSize; i++)1226 for (int i = 0; i < objectSize; i++) 1211 1227 tempConstArray[i] = unionArray[i] && rightUnionArray[i]; 1212 1228 } … … 1216 1232 tempConstArray = new ConstantUnion[objectSize]; 1217 1233 {// support MSVC++6.0 1218 for ( size_t i = 0; i < objectSize; i++)1234 for (int i = 0; i < objectSize; i++) 1219 1235 tempConstArray[i] = unionArray[i] || rightUnionArray[i]; 1220 1236 } … … 1224 1240 tempConstArray = new ConstantUnion[objectSize]; 1225 1241 {// support MSVC++6.0 1226 for ( size_t i = 0; i < objectSize; i++)1242 for (int i = 0; i < objectSize; i++) 1227 1243 switch (getType().getBasicType()) { 1228 1244 case EbtBool: tempConstArray[i].setBConst((unionArray[i] == rightUnionArray[i]) ? false : true); break; … … 1270 1286 boolNodeFlag = true; 1271 1287 } else { 1272 for ( size_t i = 0; i < objectSize; i++) {1288 for (int i = 0; i < objectSize; i++) { 1273 1289 if (unionArray[i] != rightUnionArray[i]) { 1274 1290 boolNodeFlag = true; … … 1296 1312 boolNodeFlag = true; 1297 1313 } else { 1298 for ( size_t i = 0; i < objectSize; i++) {1314 for (int i = 0; i < objectSize; i++) { 1299 1315 if (unionArray[i] == rightUnionArray[i]) { 1300 1316 boolNodeFlag = true; … … 1318 1334 1319 1335 default: 1320 infoSink.info.message(EPrefixInternalError, getLine(), "Invalid operator for constant folding");1336 infoSink.info.message(EPrefixInternalError, "Invalid operator for constant folding", getLine()); 1321 1337 return 0; 1322 1338 } … … 1331 1347 TIntermConstantUnion *newNode = 0; 1332 1348 ConstantUnion* tempConstArray = new ConstantUnion[objectSize]; 1333 for ( size_t i = 0; i < objectSize; i++) {1349 for (int i = 0; i < objectSize; i++) { 1334 1350 switch(op) { 1335 1351 case EOpNegative: … … 1338 1354 case EbtInt: tempConstArray[i].setIConst(-unionArray[i].getIConst()); break; 1339 1355 default: 1340 infoSink.info.message(EPrefixInternalError, getLine(), "Unary operation not folded into constant");1356 infoSink.info.message(EPrefixInternalError, "Unary operation not folded into constant", getLine()); 1341 1357 return 0; 1342 1358 } … … 1346 1362 case EbtBool: tempConstArray[i].setBConst(!unionArray[i].getBConst()); break; 1347 1363 default: 1348 infoSink.info.message(EPrefixInternalError, getLine(), "Unary operation not folded into constant");1364 infoSink.info.message(EPrefixInternalError, "Unary operation not folded into constant", getLine()); 1349 1365 return 0; 1350 1366 } … … 1362 1378 TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermConstantUnion* node) 1363 1379 { 1364 size_t size = node->getType().getObjectSize(); 1380 ConstantUnion *rightUnionArray = node->getUnionArrayPointer(); 1381 int size = node->getType().getObjectSize(); 1365 1382 1366 1383 ConstantUnion *leftUnionArray = new ConstantUnion[size]; 1367 1384 1368 for ( size_t i =0; i < size; i++) {1385 for (int i=0; i < size; i++) { 1369 1386 1370 1387 switch (promoteTo) { … … 1372 1389 switch (node->getType().getBasicType()) { 1373 1390 case EbtInt: 1374 leftUnionArray[i].setFConst(static_cast<float>( node->getIConst(static_cast<int>(i))));1391 leftUnionArray[i].setFConst(static_cast<float>(rightUnionArray[i].getIConst())); 1375 1392 break; 1376 1393 case EbtBool: 1377 leftUnionArray[i].setFConst(static_cast<float>( node->getBConst(static_cast<bool>(i))));1394 leftUnionArray[i].setFConst(static_cast<float>(rightUnionArray[i].getBConst())); 1378 1395 break; 1379 1396 case EbtFloat: 1380 leftUnionArray[i] .setFConst(static_cast<float>(node->getFConst(static_cast<float>(i))));1397 leftUnionArray[i] = rightUnionArray[i]; 1381 1398 break; 1382 1399 default: 1383 infoSink.info.message(EPrefixInternalError, node->getLine(), "Cannot promote");1400 infoSink.info.message(EPrefixInternalError, "Cannot promote", node->getLine()); 1384 1401 return 0; 1385 1402 } … … 1388 1405 switch (node->getType().getBasicType()) { 1389 1406 case EbtInt: 1390 leftUnionArray[i] .setIConst(static_cast<int>(node->getIConst(static_cast<int>(i))));1407 leftUnionArray[i] = rightUnionArray[i]; 1391 1408 break; 1392 1409 case EbtBool: 1393 leftUnionArray[i].setIConst(static_cast<int>( node->getBConst(static_cast<bool>(i))));1410 leftUnionArray[i].setIConst(static_cast<int>(rightUnionArray[i].getBConst())); 1394 1411 break; 1395 1412 case EbtFloat: 1396 leftUnionArray[i].setIConst(static_cast<int>( node->getFConst(static_cast<float>(i))));1413 leftUnionArray[i].setIConst(static_cast<int>(rightUnionArray[i].getFConst())); 1397 1414 break; 1398 1415 default: 1399 infoSink.info.message(EPrefixInternalError, node->getLine(), "Cannot promote");1416 infoSink.info.message(EPrefixInternalError, "Cannot promote", node->getLine()); 1400 1417 return 0; 1401 1418 } … … 1404 1421 switch (node->getType().getBasicType()) { 1405 1422 case EbtInt: 1406 leftUnionArray[i].setBConst( node->getIConst(static_cast<int>(i)) != 0);1423 leftUnionArray[i].setBConst(rightUnionArray[i].getIConst() != 0); 1407 1424 break; 1408 1425 case EbtBool: 1409 leftUnionArray[i] .setBConst(node->getBConst(static_cast<bool>(i)));1426 leftUnionArray[i] = rightUnionArray[i]; 1410 1427 break; 1411 1428 case EbtFloat: 1412 leftUnionArray[i].setBConst( node->getFConst(static_cast<float>(i)) != 0.0f);1429 leftUnionArray[i].setBConst(rightUnionArray[i].getFConst() != 0.0f); 1413 1430 break; 1414 1431 default: 1415 infoSink.info.message(EPrefixInternalError, node->getLine(), "Cannot promote");1432 infoSink.info.message(EPrefixInternalError, "Cannot promote", node->getLine()); 1416 1433 return 0; 1417 1434 } … … 1419 1436 break; 1420 1437 default: 1421 infoSink.info.message(EPrefixInternalError, node->getLine(), "Incorrect data type found");1438 infoSink.info.message(EPrefixInternalError, "Incorrect data type found", node->getLine()); 1422 1439 return 0; 1423 1440 } -
trunk/Source/ThirdParty/ANGLE/src/compiler/OutputGLSL.cpp
r152755 r152946 20 20 return false; 21 21 } 22 23 void TOutputGLSL::visitSymbol(TIntermSymbol* node)24 {25 TInfoSinkBase& out = objSink();26 27 if (node->getSymbol() == "gl_FragDepthEXT")28 {29 out << "gl_FragDepth";30 }31 else32 {33 TOutputGLSLBase::visitSymbol(node);34 }35 } -
trunk/Source/ThirdParty/ANGLE/src/compiler/OutputGLSL.h
r152755 r152946 21 21 protected: 22 22 virtual bool writeVariablePrecision(TPrecision); 23 virtual void visitSymbol(TIntermSymbol* node);24 23 }; 25 24 -
trunk/Source/ThirdParty/ANGLE/src/compiler/OutputGLSLBase.cpp
r152755 r152946 80 80 out << type.getQualifierString() << " "; 81 81 // Declare the struct if we have not done so already. 82 if ((type.getBasicType() == EbtStruct) && !structDeclared(type.getStruct())) 83 { 84 declareStruct(type.getStruct()); 82 if ((type.getBasicType() == EbtStruct) && 83 (mDeclaredStructs.find(type.getTypeName()) == mDeclaredStructs.end())) 84 { 85 out << "struct " << hashName(type.getTypeName()) << "{\n"; 86 const TTypeList* structure = type.getStruct(); 87 ASSERT(structure != NULL); 88 for (size_t i = 0; i < structure->size(); ++i) 89 { 90 const TType* fieldType = (*structure)[i].type; 91 ASSERT(fieldType != NULL); 92 if (writeVariablePrecision(fieldType->getPrecision())) 93 out << " "; 94 out << getTypeName(*fieldType) << " " << hashName(fieldType->getFieldName()); 95 if (fieldType->isArray()) 96 out << arrayBrackets(*fieldType); 97 out << ";\n"; 98 } 99 out << "}"; 100 mDeclaredStructs.insert(type.getTypeName()); 85 101 } 86 102 else … … 123 139 if (type.getBasicType() == EbtStruct) 124 140 { 125 const TStructure* structure = type.getStruct(); 126 out << hashName(structure->name()) << "("; 127 128 const TFieldList& fields = structure->fields(); 129 for (size_t i = 0; i < fields.size(); ++i) 141 out << hashName(type.getTypeName()) << "("; 142 const TTypeList* structure = type.getStruct(); 143 ASSERT(structure != NULL); 144 for (size_t i = 0; i < structure->size(); ++i) 130 145 { 131 const TType* fieldType = fields[i]->type();146 const TType* fieldType = (*structure)[i].type; 132 147 ASSERT(fieldType != NULL); 133 148 pConstUnion = writeConstantUnion(*fieldType, pConstUnion); 134 if (i != fields.size() - 1) out << ", ";149 if (i != structure->size() - 1) out << ", "; 135 150 } 136 151 out << ")"; … … 138 153 else 139 154 { 140 size_t size = type.getObjectSize();155 int size = type.getObjectSize(); 141 156 bool writeType = size > 1; 142 157 if (writeType) out << getTypeName(type) << "("; 143 for ( size_t i = 0; i < size; ++i, ++pConstUnion)158 for (int i = 0; i < size; ++i, ++pConstUnion) 144 159 { 145 160 switch (pConstUnion->getType()) … … 246 261 if (visit == InVisit) 247 262 { 248 // Here we are writing out "foo.bar", where "foo" is struct249 // and "bar" is field. In AST, it is represented as a binary250 // node, where left child represents "foo" and right child "bar".251 // The node itself represents ".". The struct field "bar" is252 // actually stored as an index into TStructure::fields.253 263 out << "."; 254 const TStructure* structure = node->getLeft()->getType().getStruct(); 255 const TIntermConstantUnion* index = node->getRight()->getAsConstantUnion(); 256 const TField* field = structure->fields()[index->getIConst(0)]; 257 258 TString fieldName = field->name(); 259 if (!mSymbolTable.findBuiltIn(structure->name())) 264 // TODO(alokp): ASSERT 265 TString fieldName = node->getType().getFieldName(); 266 267 const TType& structType = node->getLeft()->getType(); 268 if (!mSymbolTable.findBuiltIn(structType.getTypeName())) 260 269 fieldName = hashName(fieldName); 261 270 … … 588 597 const TType& type = node->getType(); 589 598 ASSERT(type.getBasicType() == EbtStruct); 590 out << hashName(type.get Struct()->name()) << "(";599 out << hashName(type.getTypeName()) << "("; 591 600 } 592 601 else if (visit == InVisit) … … 757 766 { 758 767 if (type.getBasicType() == EbtStruct) 759 out << hashName(type.get Struct()->name());768 out << hashName(type.getTypeName()); 760 769 else 761 770 out << type.getBasicString(); … … 790 799 return hashName(name); 791 800 } 792 793 bool TOutputGLSLBase::structDeclared(const TStructure* structure) const794 {795 return mDeclaredStructs.find(structure->name()) != mDeclaredStructs.end();796 }797 798 void TOutputGLSLBase::declareStruct(const TStructure* structure)799 {800 TInfoSinkBase& out = objSink();801 802 out << "struct " << hashName(structure->name()) << "{\n";803 const TFieldList& fields = structure->fields();804 for (size_t i = 0; i < fields.size(); ++i)805 {806 const TField* field = fields[i];807 if (writeVariablePrecision(field->type()->getPrecision()))808 out << " ";809 out << getTypeName(*field->type()) << " " << hashName(field->name());810 if (field->type()->isArray())811 out << arrayBrackets(*field->type());812 out << ";\n";813 }814 out << "}";815 816 mDeclaredStructs.insert(structure->name());817 } -
trunk/Source/ThirdParty/ANGLE/src/compiler/OutputGLSLBase.h
r152755 r152946 53 53 54 54 private: 55 bool structDeclared(const TStructure* structure) const;56 void declareStruct(const TStructure* structure);57 58 55 TInfoSinkBase& mObjSink; 59 56 bool mDeclaringVariables; -
trunk/Source/ThirdParty/ANGLE/src/compiler/OutputHLSL.cpp
r152755 r152946 53 53 mUsesFrontFacing = false; 54 54 mUsesPointSize = false; 55 mUsesFragDepth = false;56 55 mUsesXor = false; 57 56 mUsesMod1 = false; … … 191 190 "static float4 gl_Color[1] = {float4(0, 0, 0, 0)};\n"; 192 191 193 if (mUsesFragDepth)194 {195 out << "static float gl_Depth = 0.0;\n";196 }197 198 192 if (mUsesFragCoord) 199 193 { … … 516 510 } 517 511 518 if (mUsesFragDepth)519 {520 out << "#define GL_USES_FRAG_DEPTH\n";521 }522 523 512 if (mUsesDepthRange) 524 513 { … … 855 844 out << name; 856 845 } 857 else if (name == "gl_FragDepthEXT")858 {859 mUsesFragDepth = true;860 out << "gl_Depth";861 }862 846 else 863 847 { … … 969 953 if (visit == InVisit) 970 954 { 971 const TStructure* structure = node->getLeft()->getType().getStruct(); 972 const TIntermConstantUnion* index = node->getRight()->getAsConstantUnion(); 973 const TField* field = structure->fields()[index->getIConst(0)]; 974 out << "." + decorateField(field->name(), node->getLeft()->getType()); 955 out << "." + decorateField(node->getType().getFieldName(), node->getLeft()->getType()); 975 956 976 957 return false; … … 994 975 if (element) 995 976 { 996 int i = element->get IConst(0);977 int i = element->getUnionArrayPointer()[0].getIConst(); 997 978 998 979 switch (i) … … 1041 1022 } 1042 1023 1043 const T FieldList &fields = node->getLeft()->getType().getStruct()->fields();1044 1045 for (size_t i = 0; i < fields .size(); i++)1046 { 1047 const T Field *field = fields[i];1024 const TTypeList *fields = node->getLeft()->getType().getStruct(); 1025 1026 for (size_t i = 0; i < fields->size(); i++) 1027 { 1028 const TType *fieldType = (*fields)[i].type; 1048 1029 1049 1030 node->getLeft()->traverse(this); 1050 out << "." + decorateField(field ->name(), node->getLeft()->getType()) + " == ";1031 out << "." + decorateField(fieldType->getFieldName(), node->getLeft()->getType()) + " == "; 1051 1032 node->getRight()->traverse(this); 1052 out << "." + decorateField(field ->name(), node->getLeft()->getType());1053 1054 if (i < fields .size() - 1)1033 out << "." + decorateField(fieldType->getFieldName(), node->getLeft()->getType()); 1034 1035 if (i < fields->size() - 1) 1055 1036 { 1056 1037 out << " && "; … … 1258 1239 if (mInsideFunction) 1259 1240 { 1260 outputLineDirective(node->getLine() .first_line);1241 outputLineDirective(node->getLine()); 1261 1242 out << "{\n"; 1262 1243 … … 1275 1256 for (TIntermSequence::iterator sit = node->getSequence().begin(); sit != node->getSequence().end(); sit++) 1276 1257 { 1277 outputLineDirective((*sit)->getLine() .first_line);1258 outputLineDirective((*sit)->getLine()); 1278 1259 1279 1260 traverseStatements(*sit); … … 1284 1265 if (mInsideFunction) 1285 1266 { 1286 outputLineDirective(node->get Line().last_line);1267 outputLineDirective(node->getEndLine()); 1287 1268 out << "}\n"; 1288 1269 … … 1303 1284 if (variable->getType().getStruct()) 1304 1285 { 1305 addConstructor(variable->getType(), scopedStruct(variable->getType().get Struct()->name()), NULL);1286 addConstructor(variable->getType(), scopedStruct(variable->getType().getTypeName()), NULL); 1306 1287 } 1307 1288 … … 1421 1402 if (symbol->getType().getStruct()) 1422 1403 { 1423 addConstructor(symbol->getType(), scopedStruct(symbol->getType().get Struct()->name()), NULL);1404 addConstructor(symbol->getType(), scopedStruct(symbol->getType().getTypeName()), NULL); 1424 1405 } 1425 1406 … … 1670 1651 break; 1671 1652 case EOpConstructStruct: 1672 addConstructor(node->getType(), scopedStruct(node->getType().get Struct()->name()), &node->getSequence());1673 outputTriplet(visit, structLookup(node->getType().get Struct()->name()) + "_ctor(", ", ", ")");1653 addConstructor(node->getType(), scopedStruct(node->getType().getTypeName()), &node->getSequence()); 1654 outputTriplet(visit, structLookup(node->getType().getTypeName()) + "_ctor(", ", ", ")"); 1674 1655 break; 1675 1656 case EOpLessThan: outputTriplet(visit, "(", " < ", ")"); break; … … 1761 1742 out << ")\n"; 1762 1743 1763 outputLineDirective(node->getLine() .first_line);1744 outputLineDirective(node->getLine()); 1764 1745 out << "{\n"; 1765 1746 … … 1769 1750 } 1770 1751 1771 outputLineDirective(node->getLine() .first_line);1752 outputLineDirective(node->getLine()); 1772 1753 out << ";\n}\n"; 1773 1754 … … 1776 1757 out << "else\n"; 1777 1758 1778 outputLineDirective(node->getFalseBlock()->getLine() .first_line);1759 outputLineDirective(node->getFalseBlock()->getLine()); 1779 1760 out << "{\n"; 1780 1761 1781 outputLineDirective(node->getFalseBlock()->getLine() .first_line);1762 outputLineDirective(node->getFalseBlock()->getLine()); 1782 1763 traverseStatements(node->getFalseBlock()); 1783 1764 1784 outputLineDirective(node->getFalseBlock()->getLine() .first_line);1765 outputLineDirective(node->getFalseBlock()->getLine()); 1785 1766 out << ";\n}\n"; 1786 1767 } … … 1815 1796 out << "{do\n"; 1816 1797 1817 outputLineDirective(node->getLine() .first_line);1798 outputLineDirective(node->getLine()); 1818 1799 out << "{\n"; 1819 1800 } … … 1843 1824 out << ")\n"; 1844 1825 1845 outputLineDirective(node->getLine() .first_line);1826 outputLineDirective(node->getLine()); 1846 1827 out << "{\n"; 1847 1828 } … … 1852 1833 } 1853 1834 1854 outputLineDirective(node->getLine() .first_line);1835 outputLineDirective(node->getLine()); 1855 1836 out << ";}\n"; 1856 1837 1857 1838 if (node->getType() == ELoopDoWhile) 1858 1839 { 1859 outputLineDirective(node->getCondition()->getLine() .first_line);1840 outputLineDirective(node->getCondition()->getLine()); 1860 1841 out << "while(\n"; 1861 1842 … … 1997 1978 { 1998 1979 index = symbol; 1999 initial = constant->get IConst(0);1980 initial = constant->getUnionArrayPointer()[0].getIConst(); 2000 1981 } 2001 1982 } … … 2019 2000 { 2020 2001 comparator = test->getOp(); 2021 limit = constant->get IConst(0);2002 limit = constant->getUnionArrayPointer()[0].getIConst(); 2022 2003 } 2023 2004 } … … 2040 2021 if (constant->getBasicType() == EbtInt && constant->getNominalSize() == 1) 2041 2022 { 2042 int value = constant->get IConst(0);2023 int value = constant->getUnionArrayPointer()[0].getIConst(); 2043 2024 2044 2025 switch (op) … … 2129 2110 out << ")\n"; 2130 2111 2131 outputLineDirective(node->getLine() .first_line);2112 outputLineDirective(node->getLine()); 2132 2113 out << "{\n"; 2133 2114 … … 2137 2118 } 2138 2119 2139 outputLineDirective(node->getLine() .first_line);2120 outputLineDirective(node->getLine()); 2140 2121 out << ";}\n"; 2141 2122 … … 2233 2214 if (type.getBasicType() == EbtStruct) 2234 2215 { 2235 const TString& typeName = type.getStruct()->name(); 2236 if (typeName != "") 2237 { 2238 return structLookup(typeName); 2216 if (type.getTypeName() != "") 2217 { 2218 return structLookup(type.getTypeName()); 2239 2219 } 2240 2220 else // Nameless structure, define in place 2241 2221 { 2242 const T FieldList &fields = type.getStruct()->fields();2222 const TTypeList &fields = *type.getStruct(); 2243 2223 2244 2224 TString string = "struct\n" … … 2247 2227 for (unsigned int i = 0; i < fields.size(); i++) 2248 2228 { 2249 const T Field *field = fields[i];2250 2251 string += " " + typeString( *field->type()) + " " + decorate(field->name()) + arrayString(*field->type()) + ";\n";2229 const TType &field = *fields[i].type; 2230 2231 string += " " + typeString(field) + " " + decorate(field.getFieldName()) + arrayString(field) + ";\n"; 2252 2232 } 2253 2233 … … 2325 2305 TString string; 2326 2306 2327 size_t size = type.getObjectSize(); 2328 for (size_t component = 0; component < size; component++) 2307 for (int component = 0; component < type.getObjectSize(); component++) 2329 2308 { 2330 2309 string += "0"; 2331 2310 2332 if (component + 1 < size)2311 if (component < type.getObjectSize() - 1) 2333 2312 { 2334 2313 string += ", "; … … 2369 2348 "{\n"; 2370 2349 2371 const T FieldList &fields = type.getStruct()->fields();2350 const TTypeList &fields = *type.getStruct(); 2372 2351 2373 2352 for (unsigned int i = 0; i < fields.size(); i++) 2374 2353 { 2375 const T Field *field = fields[i];2376 2377 structure += " " + typeString( *field->type()) + " " + decorateField(field->name(), type) + arrayString(*field->type()) + ";\n";2354 const TType &field = *fields[i].type; 2355 2356 structure += " " + typeString(field) + " " + decorateField(field.getFieldName(), type) + arrayString(field) + ";\n"; 2378 2357 } 2379 2358 … … 2387 2366 for (unsigned int i = 0; i < fields.size(); i++) 2388 2367 { 2389 ctorParameters.push_back(*fields[i] ->type());2368 ctorParameters.push_back(*fields[i].type); 2390 2369 } 2391 2370 } … … 2480 2459 else 2481 2460 { 2482 size_t remainingComponents = ctorType.getObjectSize();2483 size_t parameterIndex = 0;2461 int remainingComponents = ctorType.getObjectSize(); 2462 int parameterIndex = 0; 2484 2463 2485 2464 while (remainingComponents > 0) 2486 2465 { 2487 2466 const TType ¶meter = ctorParameters[parameterIndex]; 2488 const size_t parameterSize = parameter.getObjectSize(); 2489 bool moreParameters = parameterIndex + 1 < ctorParameters.size(); 2467 bool moreParameters = parameterIndex < (int)ctorParameters.size() - 1; 2490 2468 2491 2469 constructor += "x" + str(parameterIndex); … … 2493 2471 if (parameter.isScalar()) 2494 2472 { 2495 ASSERT(parameterSize <= remainingComponents); 2496 remainingComponents -= parameterSize; 2473 remainingComponents -= parameter.getObjectSize(); 2497 2474 } 2498 2475 else if (parameter.isVector()) 2499 2476 { 2500 if (remainingComponents == parameterSize || moreParameters) 2501 { 2502 ASSERT(parameterSize <= remainingComponents); 2503 remainingComponents -= parameterSize; 2504 } 2505 else if (remainingComponents < static_cast<size_t>(parameter.getNominalSize())) 2477 if (remainingComponents == parameter.getObjectSize() || moreParameters) 2478 { 2479 remainingComponents -= parameter.getObjectSize(); 2480 } 2481 else if (remainingComponents < parameter.getNominalSize()) 2506 2482 { 2507 2483 switch (remainingComponents) … … 2520 2496 else if (parameter.isMatrix() || parameter.getStruct()) 2521 2497 { 2522 ASSERT(remainingComponents == parameterSize || moreParameters); 2523 ASSERT(parameterSize <= remainingComponents); 2498 ASSERT(remainingComponents == parameter.getObjectSize() || moreParameters); 2524 2499 2525 remainingComponents -= parameter Size;2500 remainingComponents -= parameter.getObjectSize(); 2526 2501 } 2527 2502 else UNREACHABLE(); … … 2560 2535 if (type.getBasicType() == EbtStruct) 2561 2536 { 2562 out << structLookup(type.get Struct()->name()) + "_ctor(";2537 out << structLookup(type.getTypeName()) + "_ctor("; 2563 2538 2564 const T FieldList &fields = type.getStruct()->fields();2565 2566 for (size_t i = 0; i < fields.size(); i++)2567 { 2568 const TType *fieldType = fields[i]->type();2539 const TTypeList *structure = type.getStruct(); 2540 2541 for (size_t i = 0; i < structure->size(); i++) 2542 { 2543 const TType *fieldType = (*structure)[i].type; 2569 2544 2570 2545 constUnion = writeConstantUnion(*fieldType, constUnion); 2571 2546 2572 if (i != fields.size() - 1)2547 if (i != structure->size() - 1) 2573 2548 { 2574 2549 out << ", "; … … 2580 2555 else 2581 2556 { 2582 size_t size = type.getObjectSize();2557 int size = type.getObjectSize(); 2583 2558 bool writeType = size > 1; 2584 2559 … … 2588 2563 } 2589 2564 2590 for ( size_t i = 0; i < size; i++, constUnion++)2565 for (int i = 0; i < size; i++, constUnion++) 2591 2566 { 2592 2567 switch (constUnion->getType()) … … 2681 2656 TString OutputHLSL::decorateField(const TString &string, const TType &structure) 2682 2657 { 2683 if (structure.get Struct()->name().compare(0, 3, "gl_") != 0)2658 if (structure.getTypeName().compare(0, 3, "gl_") != 0) 2684 2659 { 2685 2660 return decorate(string); -
trunk/Source/ThirdParty/ANGLE/src/compiler/OutputHLSL.h
r152755 r152946 98 98 bool mUsesFrontFacing; 99 99 bool mUsesPointSize; 100 bool mUsesFragDepth;101 100 bool mUsesXor; 102 101 bool mUsesMod1; -
trunk/Source/ThirdParty/ANGLE/src/compiler/ParseHelper.cpp
r152755 r152946 1 1 // 2 // Copyright (c) 2002-201 3The ANGLE Project Authors. All rights reserved.2 // Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved. 3 3 // Use of this source code is governed by a BSD-style license that can be 4 4 // found in the LICENSE file. … … 23 23 // for a vector. 24 24 // 25 bool TParseContext::parseVectorFields(const TString& compString, int vecSize, TVectorFields& fields, const TSourceLoc&line)25 bool TParseContext::parseVectorFields(const TString& compString, int vecSize, TVectorFields& fields, int line) 26 26 { 27 27 fields.num = (int) compString.size(); … … 116 116 // for a matrix. 117 117 // 118 bool TParseContext::parseMatrixFields(const TString& compString, int matSize, TMatrixFields& fields, const TSourceLoc&line)118 bool TParseContext::parseMatrixFields(const TString& compString, int matSize, TMatrixFields& fields, int line) 119 119 { 120 120 fields.wholeRow = false; … … 176 176 // Used by flex/bison to output all syntax and parsing errors. 177 177 // 178 void TParseContext::error( const TSourceLoc&loc,178 void TParseContext::error(TSourceLoc loc, 179 179 const char* reason, const char* token, 180 180 const char* extraInfo) 181 181 { 182 182 pp::SourceLocation srcLoc; 183 srcLoc.file = loc.first_file; 184 srcLoc.line = loc.first_line; 183 DecodeSourceLoc(loc, &srcLoc.file, &srcLoc.line); 185 184 diagnostics.writeInfo(pp::Diagnostics::ERROR, 186 185 srcLoc, reason, token, extraInfo); … … 188 187 } 189 188 190 void TParseContext::warning( const TSourceLoc&loc,189 void TParseContext::warning(TSourceLoc loc, 191 190 const char* reason, const char* token, 192 191 const char* extraInfo) { 193 192 pp::SourceLocation srcLoc; 194 srcLoc.file = loc.first_file; 195 srcLoc.line = loc.first_line; 193 DecodeSourceLoc(loc, &srcLoc.file, &srcLoc.line); 196 194 diagnostics.writeInfo(pp::Diagnostics::WARNING, 197 195 srcLoc, reason, token, extraInfo); … … 206 204 // Same error message for all places assignments don't work. 207 205 // 208 void TParseContext::assignError( const TSourceLoc&line, const char* op, TString left, TString right)206 void TParseContext::assignError(int line, const char* op, TString left, TString right) 209 207 { 210 208 std::stringstream extraInfoStream; … … 217 215 // Same error message for all places unary operations don't work. 218 216 // 219 void TParseContext::unaryOpError( const TSourceLoc&line, const char* op, TString operand)217 void TParseContext::unaryOpError(int line, const char* op, TString operand) 220 218 { 221 219 std::stringstream extraInfoStream; … … 229 227 // Same error message for all binary operations don't work. 230 228 // 231 void TParseContext::binaryOpError( const TSourceLoc&line, const char* op, TString left, TString right)229 void TParseContext::binaryOpError(int line, const char* op, TString left, TString right) 232 230 { 233 231 std::stringstream extraInfoStream; … … 238 236 } 239 237 240 bool TParseContext::precisionErrorCheck( const TSourceLoc&line, TPrecision precision, TBasicType type){238 bool TParseContext::precisionErrorCheck(int line, TPrecision precision, TBasicType type){ 241 239 if (!checksPrecisionErrors) 242 240 return false; … … 266 264 // Returns true if the was an error. 267 265 // 268 bool TParseContext::lValueErrorCheck( const TSourceLoc&line, const char* op, TIntermTyped* node)266 bool TParseContext::lValueErrorCheck(int line, const char* op, TIntermTyped* node) 269 267 { 270 268 TIntermSymbol* symNode = node->getAsSymbolNode(); … … 289 287 for (TIntermSequence::iterator p = aggrNode->getSequence().begin(); 290 288 p != aggrNode->getSequence().end(); p++) { 291 int value = (*p)->getAsTyped()->getAsConstantUnion()->get IConst(0);289 int value = (*p)->getAsTyped()->getAsConstantUnion()->getUnionArrayPointer()->getIConst(); 292 290 offset[value]++; 293 291 if (offset[value] > 1) { … … 320 318 case EvqUniform: message = "can't modify a uniform"; break; 321 319 case EvqVaryingIn: message = "can't modify a varying"; break; 320 case EvqInput: message = "can't modify an input"; break; 322 321 case EvqFragCoord: message = "can't modify gl_FragCoord"; break; 323 322 case EvqFrontFacing: message = "can't modify gl_FrontFacing"; break; … … 411 410 // Returns true if the was an error. 412 411 // 413 bool TParseContext::globalErrorCheck( const TSourceLoc&line, bool global, const char* token)412 bool TParseContext::globalErrorCheck(int line, bool global, const char* token) 414 413 { 415 414 if (global) … … 430 429 // Returns true if there was an error. 431 430 // 432 bool TParseContext::reservedErrorCheck( const TSourceLoc&line, const TString& identifier)431 bool TParseContext::reservedErrorCheck(int line, const TString& identifier) 433 432 { 434 433 static const char* reservedErrMsg = "reserved built-in name"; … … 468 467 // Returns true if there was an error in construction. 469 468 // 470 bool TParseContext::constructorErrorCheck( const TSourceLoc&line, TIntermNode* node, TFunction& function, TOperator op, TType* type)469 bool TParseContext::constructorErrorCheck(int line, TIntermNode* node, TFunction& function, TOperator op, TType* type) 471 470 { 472 471 *type = function.getReturnType(); … … 489 488 // 490 489 491 size_t size = 0;490 int size = 0; 492 491 bool constType = true; 493 492 bool full = false; … … 536 535 } 537 536 538 if (op == EOpConstructStruct && !type->isArray() && int(type->getStruct()-> fields().size()) != function.getParamCount()) {537 if (op == EOpConstructStruct && !type->isArray() && int(type->getStruct()->size()) != function.getParamCount()) { 539 538 error(line, "Number of constructor parameters does not match the number of structure fields", "constructor"); 540 539 return true; … … 570 569 // returns true in case of an error 571 570 // 572 bool TParseContext::voidErrorCheck( const TSourceLoc&line, const TString& identifier, const TPublicType& pubType)571 bool TParseContext::voidErrorCheck(int line, const TString& identifier, const TPublicType& pubType) 573 572 { 574 573 if (pubType.type == EbtVoid) { … … 584 583 // returns true in case of an error 585 584 // 586 bool TParseContext::boolErrorCheck( const TSourceLoc&line, const TIntermTyped* type)585 bool TParseContext::boolErrorCheck(int line, const TIntermTyped* type) 587 586 { 588 587 if (type->getBasicType() != EbtBool || type->isArray() || type->isMatrix() || type->isVector()) { … … 598 597 // returns true in case of an error 599 598 // 600 bool TParseContext::boolErrorCheck( const TSourceLoc&line, const TPublicType& pType)599 bool TParseContext::boolErrorCheck(int line, const TPublicType& pType) 601 600 { 602 601 if (pType.type != EbtBool || pType.array || pType.matrix || (pType.size > 1)) { … … 608 607 } 609 608 610 bool TParseContext::samplerErrorCheck( const TSourceLoc&line, const TPublicType& pType, const char* reason)609 bool TParseContext::samplerErrorCheck(int line, const TPublicType& pType, const char* reason) 611 610 { 612 611 if (pType.type == EbtStruct) { … … 627 626 } 628 627 629 bool TParseContext::structQualifierErrorCheck( const TSourceLoc&line, const TPublicType& pType)628 bool TParseContext::structQualifierErrorCheck(int line, const TPublicType& pType) 630 629 { 631 630 if ((pType.qualifier == EvqVaryingIn || pType.qualifier == EvqVaryingOut || pType.qualifier == EvqAttribute) && … … 642 641 } 643 642 644 bool TParseContext::parameterSamplerErrorCheck( const TSourceLoc&line, TQualifier qualifier, const TType& type)643 bool TParseContext::parameterSamplerErrorCheck(int line, TQualifier qualifier, const TType& type) 645 644 { 646 645 if ((qualifier == EvqOut || qualifier == EvqInOut) && … … 659 658 660 659 if (type.getBasicType() == EbtStruct) { 661 const TFieldList& fields = type.getStruct()->fields();662 for (unsigned int i = 0; i < fields.size(); ++i) {663 if (containsSampler(* fields[i]->type()))660 TTypeList& structure = *type.getStruct(); 661 for (unsigned int i = 0; i < structure.size(); ++i) { 662 if (containsSampler(*structure[i].type)) 664 663 return true; 665 664 } … … 674 673 // Returns true if there was an error. 675 674 // 676 bool TParseContext::arraySizeErrorCheck( const TSourceLoc&line, TIntermTyped* expr, int& size)675 bool TParseContext::arraySizeErrorCheck(int line, TIntermTyped* expr, int& size) 677 676 { 678 677 TIntermConstantUnion* constant = expr->getAsConstantUnion(); … … 682 681 } 683 682 684 size = constant->get IConst(0);683 size = constant->getUnionArrayPointer()->getIConst(); 685 684 686 685 if (size <= 0) { … … 698 697 // Returns true if there is an error. 699 698 // 700 bool TParseContext::arrayQualifierErrorCheck( const TSourceLoc&line, TPublicType type)699 bool TParseContext::arrayQualifierErrorCheck(int line, TPublicType type) 701 700 { 702 701 if ((type.qualifier == EvqAttribute) || (type.qualifier == EvqConst)) { … … 713 712 // Returns true if there is an error. 714 713 // 715 bool TParseContext::arrayTypeErrorCheck( const TSourceLoc&line, TPublicType type)714 bool TParseContext::arrayTypeErrorCheck(int line, TPublicType type) 716 715 { 717 716 // … … 734 733 // Returns true if there was an error. 735 734 // 736 bool TParseContext::arrayErrorCheck( const TSourceLoc&line, TString& identifier, TPublicType type, TVariable*& variable)735 bool TParseContext::arrayErrorCheck(int line, TString& identifier, TPublicType type, TVariable*& variable) 737 736 { 738 737 // … … 779 778 } 780 779 780 TType* t = variable->getArrayInformationType(); 781 while (t != 0) { 782 if (t->getMaxArraySize() > type.arraySize) { 783 error(line, "higher index value already used for the array", identifier.c_str()); 784 return true; 785 } 786 t->setArraySize(type.arraySize); 787 t = t->getArrayInformationType(); 788 } 789 781 790 if (type.arraySize) 782 791 variable->getType().setArraySize(type.arraySize); … … 789 798 } 790 799 800 bool TParseContext::arraySetMaxSize(TIntermSymbol *node, TType* type, int size, bool updateFlag, TSourceLoc line) 801 { 802 bool builtIn = false; 803 TSymbol* symbol = symbolTable.find(node->getSymbol(), &builtIn); 804 if (symbol == 0) { 805 error(line, " undeclared identifier", node->getSymbol().c_str()); 806 return true; 807 } 808 TVariable* variable = static_cast<TVariable*>(symbol); 809 810 type->setArrayInformationType(variable->getArrayInformationType()); 811 variable->updateArrayInformationType(type); 812 813 // special casing to test index value of gl_FragData. If the accessed index is >= gl_MaxDrawBuffers 814 // its an error 815 if (node->getSymbol() == "gl_FragData") { 816 TSymbol* fragData = symbolTable.find("gl_MaxDrawBuffers", &builtIn); 817 ASSERT(fragData); 818 819 int fragDataValue = static_cast<TVariable*>(fragData)->getConstPointer()[0].getIConst(); 820 if (fragDataValue <= size) { 821 error(line, "", "[", "gl_FragData can only have a max array size of up to gl_MaxDrawBuffers"); 822 return true; 823 } 824 } 825 826 // we dont want to update the maxArraySize when this flag is not set, we just want to include this 827 // node type in the chain of node types so that its updated when a higher maxArraySize comes in. 828 if (!updateFlag) 829 return false; 830 831 size++; 832 variable->getType().setMaxArraySize(size); 833 type->setMaxArraySize(size); 834 TType* tt = type; 835 836 while(tt->getArrayInformationType() != 0) { 837 tt = tt->getArrayInformationType(); 838 tt->setMaxArraySize(size); 839 } 840 841 return false; 842 } 843 791 844 // 792 845 // Enforce non-initializer type/qualifier rules. … … 794 847 // Returns true if there was an error. 795 848 // 796 bool TParseContext::nonInitConstErrorCheck( const TSourceLoc&line, TString& identifier, TPublicType& type, bool array)849 bool TParseContext::nonInitConstErrorCheck(int line, TString& identifier, TPublicType& type, bool array) 797 850 { 798 851 if (type.qualifier == EvqConst) … … 826 879 // Returns true if there was an error. 827 880 // 828 bool TParseContext::nonInitErrorCheck( const TSourceLoc&line, TString& identifier, TPublicType& type, TVariable*& variable)881 bool TParseContext::nonInitErrorCheck(int line, TString& identifier, TPublicType& type, TVariable*& variable) 829 882 { 830 883 if (reservedErrorCheck(line, identifier)) … … 846 899 } 847 900 848 bool TParseContext::paramErrorCheck( const TSourceLoc&line, TQualifier qualifier, TQualifier paramQualifier, TType* type)901 bool TParseContext::paramErrorCheck(int line, TQualifier qualifier, TQualifier paramQualifier, TType* type) 849 902 { 850 903 if (qualifier != EvqConst && qualifier != EvqTemporary) { … … 865 918 } 866 919 867 bool TParseContext::extensionErrorCheck( const TSourceLoc&line, const TString& extension)920 bool TParseContext::extensionErrorCheck(int line, const TString& extension) 868 921 { 869 922 const TExtensionBehavior& extBehavior = extensionBehavior(); … … 893 946 } 894 947 948 void TParseContext::handleExtensionDirective(int line, const char* extName, const char* behavior) 949 { 950 pp::SourceLocation loc; 951 DecodeSourceLoc(line, &loc.file, &loc.line); 952 directiveHandler.handleExtension(loc, extName, behavior); 953 } 954 955 void TParseContext::handlePragmaDirective(int line, const char* name, const char* value) 956 { 957 pp::SourceLocation loc; 958 DecodeSourceLoc(line, &loc.file, &loc.line); 959 directiveHandler.handlePragma(loc, name, value); 960 } 961 895 962 ///////////////////////////////////////////////////////////////////////////////// 896 963 // … … 904 971 // Return the function symbol if found, otherwise 0. 905 972 // 906 const TFunction* TParseContext::findFunction( const TSourceLoc&line, TFunction* call, bool *builtIn)973 const TFunction* TParseContext::findFunction(int line, TFunction* call, bool *builtIn) 907 974 { 908 975 // First find by unmangled name to check whether the function name has been … … 926 993 } 927 994 928 bool TParseContext::isVariableBuiltIn(const TVariable* var)929 {930 bool builtIn = false;931 // First find by unmangled name to check whether the function name has been932 // hidden by a variable name or struct typename.933 const TSymbol* symbol = symbolTable.find(var->getName(), &builtIn);934 if (symbol == 0) {935 symbol = symbolTable.find(var->getMangledName(), &builtIn);936 }937 938 if (symbol == 0) {939 return false;940 }941 942 if (!symbol->isVariable()) {943 return false;944 }945 946 return builtIn;947 }948 949 995 // 950 996 // Initializers show up in several places in the grammar. Have one set of 951 997 // code to handle them here. 952 998 // 953 bool TParseContext::executeInitializer( const TSourceLoc&line, TString& identifier, TPublicType& pType,999 bool TParseContext::executeInitializer(TSourceLoc line, TString& identifier, TPublicType& pType, 954 1000 TIntermTyped* initializer, TIntermNode*& intermNode, TVariable* variable) 955 1001 { … … 1003 1049 } 1004 1050 if (initializer->getAsConstantUnion()) { 1005 variable->shareConstPointer(initializer->getAsConstantUnion()->getUnionArrayPointer()); 1051 ConstantUnion* unionArray = variable->getConstPointer(); 1052 1053 if (type.getObjectSize() == 1 && type.getBasicType() != EbtStruct) { 1054 *unionArray = (initializer->getAsConstantUnion()->getUnionArrayPointer())[0]; 1055 } else { 1056 variable->shareConstPointer(initializer->getAsConstantUnion()->getUnionArrayPointer()); 1057 } 1006 1058 } else if (initializer->getAsSymbolNode()) { 1007 1059 const TSymbol* symbol = symbolTable.find(initializer->getAsSymbolNode()->getSymbol()); … … 1057 1109 // Returns 0 for an error or the constructed node (aggregate or typed) for no error. 1058 1110 // 1059 TIntermTyped* TParseContext::addConstructor(TIntermNode* node, const TType* type, TOperator op, TFunction* fnCall, const TSourceLoc&line)1111 TIntermTyped* TParseContext::addConstructor(TIntermNode* node, const TType* type, TOperator op, TFunction* fnCall, TSourceLoc line) 1060 1112 { 1061 1113 if (node == 0) … … 1064 1116 TIntermAggregate* aggrNode = node->getAsAggregate(); 1065 1117 1066 T FieldList::const_iterator memberFields;1118 TTypeList::const_iterator memberTypes; 1067 1119 if (op == EOpConstructStruct) 1068 member Fields = type->getStruct()->fields().begin();1120 memberTypes = type->getStruct()->begin(); 1069 1121 1070 1122 TType elementType = *type; … … 1088 1140 newNode = constructStruct(node, &elementType, 1, node->getLine(), false); 1089 1141 else if (op == EOpConstructStruct) 1090 newNode = constructStruct(node, (*member Fields)->type(), 1, node->getLine(), false);1142 newNode = constructStruct(node, (*memberTypes).type, 1, node->getLine(), false); 1091 1143 else 1092 1144 newNode = constructBuiltIn(type, op, node, node->getLine(), false); … … 1119 1171 newNode = constructStruct(*p, &elementType, paramCount+1, node->getLine(), true); 1120 1172 else if (op == EOpConstructStruct) 1121 newNode = constructStruct(*p, memberFields[paramCount]->type(), paramCount+1, node->getLine(), true);1173 newNode = constructStruct(*p, (memberTypes[paramCount]).type, paramCount+1, node->getLine(), true); 1122 1174 else 1123 1175 newNode = constructBuiltIn(type, op, *p, node->getLine(), true); … … 1165 1217 // Returns 0 for an error or the constructed node. 1166 1218 // 1167 TIntermTyped* TParseContext::constructBuiltIn(const TType* type, TOperator op, TIntermNode* node, const TSourceLoc&line, bool subset)1219 TIntermTyped* TParseContext::constructBuiltIn(const TType* type, TOperator op, TIntermNode* node, TSourceLoc line, bool subset) 1168 1220 { 1169 1221 TIntermTyped* newNode; … … 1227 1279 // Returns 0 for an error or the input node itself if the expected and the given parameter types match. 1228 1280 // 1229 TIntermTyped* TParseContext::constructStruct(TIntermNode* node, TType* type, int paramCount, const TSourceLoc&line, bool subset)1281 TIntermTyped* TParseContext::constructStruct(TIntermNode* node, TType* type, int paramCount, TSourceLoc line, bool subset) 1230 1282 { 1231 1283 if (*type == node->getAsTyped()->getType()) { … … 1254 1306 // a constant matrix. 1255 1307 // 1256 TIntermTyped* TParseContext::addConstVectorNode(TVectorFields& fields, TIntermTyped* node, const TSourceLoc&line)1308 TIntermTyped* TParseContext::addConstVectorNode(TVectorFields& fields, TIntermTyped* node, TSourceLoc line) 1257 1309 { 1258 1310 TIntermTyped* typedNode; … … 1262 1314 if (tempConstantNode) { 1263 1315 unionArray = tempConstantNode->getUnionArrayPointer(); 1316 ASSERT(unionArray); 1264 1317 1265 1318 if (!unionArray) { … … 1276 1329 1277 1330 for (int i = 0; i < fields.num; i++) { 1278 if (fields.offsets[i] >= node->getType().get NominalSize()) {1331 if (fields.offsets[i] >= node->getType().getObjectSize()) { 1279 1332 std::stringstream extraInfoStream; 1280 1333 extraInfoStream << "vector field selection out of range '" << fields.offsets[i] << "'"; … … 1298 1351 // constant matrix or it could be the tree representation of the constant matrix (s.m1[0] where s is a constant structure) 1299 1352 // 1300 TIntermTyped* TParseContext::addConstMatrixNode(int index, TIntermTyped* node, const TSourceLoc&line)1353 TIntermTyped* TParseContext::addConstMatrixNode(int index, TIntermTyped* node, TSourceLoc line) 1301 1354 { 1302 1355 TIntermTyped* typedNode; … … 1333 1386 // constant array or it could be the tree representation of the constant array (s.a1[0] where s is a constant structure) 1334 1387 // 1335 TIntermTyped* TParseContext::addConstArrayNode(int index, TIntermTyped* node, const TSourceLoc&line)1388 TIntermTyped* TParseContext::addConstArrayNode(int index, TIntermTyped* node, TSourceLoc line) 1336 1389 { 1337 1390 TIntermTyped* typedNode; … … 1349 1402 } 1350 1403 1404 int arrayElementSize = arrayElementType.getObjectSize(); 1405 1351 1406 if (tempConstantNode) { 1352 size_t arrayElementSize = arrayElementType.getObjectSize();1353 1407 ConstantUnion* unionArray = tempConstantNode->getUnionArrayPointer(); 1354 1408 typedNode = intermediate.addConstantUnion(&unionArray[arrayElementSize * index], tempConstantNode->getType(), line); … … 1369 1423 // function and returns the parse-tree with the values of the embedded/nested struct. 1370 1424 // 1371 TIntermTyped* TParseContext::addConstStruct(TString& identifier, TIntermTyped* node, const TSourceLoc& line) 1372 { 1373 const TFieldList& fields = node->getType().getStruct()->fields(); 1374 1375 size_t instanceSize = 0; 1376 for (size_t index = 0; index < fields.size(); ++index) { 1377 if (fields[index]->name() == identifier) { 1425 TIntermTyped* TParseContext::addConstStruct(TString& identifier, TIntermTyped* node, TSourceLoc line) 1426 { 1427 const TTypeList* fields = node->getType().getStruct(); 1428 TIntermTyped *typedNode; 1429 int instanceSize = 0; 1430 unsigned int index = 0; 1431 TIntermConstantUnion *tempConstantNode = node->getAsConstantUnion(); 1432 1433 for ( index = 0; index < fields->size(); ++index) { 1434 if ((*fields)[index].type->getFieldName() == identifier) { 1378 1435 break; 1379 1436 } else { 1380 instanceSize += fields[index]->type()->getObjectSize(); 1381 } 1382 } 1383 1384 TIntermTyped* typedNode = 0; 1385 TIntermConstantUnion* tempConstantNode = node->getAsConstantUnion(); 1437 instanceSize += (*fields)[index].type->getObjectSize(); 1438 } 1439 } 1440 1386 1441 if (tempConstantNode) { 1387 1442 ConstantUnion* constArray = tempConstantNode->getUnionArrayPointer(); … … 1398 1453 } 1399 1454 1400 bool TParseContext::enterStructDeclaration( const TSourceLoc&line, const TString& identifier)1455 bool TParseContext::enterStructDeclaration(int line, const TString& identifier) 1401 1456 { 1402 1457 ++structNestingLevel; … … 1424 1479 } // namespace 1425 1480 1426 bool TParseContext::structNestingErrorCheck( const TSourceLoc& line, const TField& field)1481 bool TParseContext::structNestingErrorCheck(TSourceLoc line, const TType& fieldType) 1427 1482 { 1428 1483 if (!isWebGLBasedSpec(shaderSpec)) { … … 1430 1485 } 1431 1486 1432 if (field .type()->getBasicType() != EbtStruct) {1487 if (fieldType.getBasicType() != EbtStruct) { 1433 1488 return false; 1434 1489 } … … 1436 1491 // We're already inside a structure definition at this point, so add 1437 1492 // one to the field's struct nesting. 1438 if (1 + field .type()->getDeepestStructNesting() > kWebGLMaxStructNesting) {1493 if (1 + fieldType.getDeepestStructNesting() > kWebGLMaxStructNesting) { 1439 1494 std::stringstream extraInfoStream; 1440 extraInfoStream << "Reference of struct type " << field .name()1495 extraInfoStream << "Reference of struct type " << fieldType.getTypeName() 1441 1496 << " exceeds maximum struct nesting of " << kWebGLMaxStructNesting; 1442 1497 std::string extraInfo = extraInfoStream.str(); -
trunk/Source/ThirdParty/ANGLE/src/compiler/ParseHelper.h
r152755 r152946 34 34 sourcePath(sourcePath), 35 35 treeRoot(0), 36 lexAfterType(false), 36 37 loopNestingLevel(0), 37 38 structNestingLevel(0), 39 inTypeParen(false), 38 40 currentFunctionType(NULL), 39 41 functionReturnsValue(false), … … 50 52 const char* sourcePath; // Path of source file or NULL. 51 53 TIntermNode* treeRoot; // root of parse tree being created 54 bool lexAfterType; // true if we've recognized a type, so can only be looking for an identifier 52 55 int loopNestingLevel; // 0 if outside all loops 53 56 int structNestingLevel; // incremented while parsing a struct declaration 57 bool inTypeParen; // true if in parentheses, looking only for an identifier 54 58 const TType* currentFunctionType; // the return type of the function that's currently being parsed 55 59 bool functionReturnsValue; // true if a non-void function has a return … … 57 61 bool fragmentPrecisionHigh; // true if highp precision is supported in the fragment language. 58 62 TString HashErrMsg; 63 bool AfterEOF; 59 64 TDiagnostics diagnostics; 60 65 TDirectiveHandler directiveHandler; … … 64 69 int numErrors() const { return diagnostics.numErrors(); } 65 70 TInfoSink& infoSink() { return diagnostics.infoSink(); } 66 void error( const TSourceLoc&loc, const char *reason, const char* token,71 void error(TSourceLoc loc, const char *reason, const char* token, 67 72 const char* extraInfo=""); 68 void warning( const TSourceLoc&loc, const char* reason, const char* token,73 void warning(TSourceLoc loc, const char* reason, const char* token, 69 74 const char* extraInfo=""); 70 75 void trace(const char* str); 71 76 void recover(); 72 77 73 bool parseVectorFields(const TString&, int vecSize, TVectorFields&, const TSourceLoc&line);74 bool parseMatrixFields(const TString&, int matSize, TMatrixFields&, const TSourceLoc&line);78 bool parseVectorFields(const TString&, int vecSize, TVectorFields&, int line); 79 bool parseMatrixFields(const TString&, int matSize, TMatrixFields&, int line); 75 80 76 bool reservedErrorCheck( const TSourceLoc&line, const TString& identifier);77 void assignError( const TSourceLoc&line, const char* op, TString left, TString right);78 void unaryOpError( const TSourceLoc&line, const char* op, TString operand);79 void binaryOpError( const TSourceLoc&line, const char* op, TString left, TString right);80 bool precisionErrorCheck( const TSourceLoc&line, TPrecision precision, TBasicType type);81 bool lValueErrorCheck( const TSourceLoc&line, const char* op, TIntermTyped*);81 bool reservedErrorCheck(int line, const TString& identifier); 82 void assignError(int line, const char* op, TString left, TString right); 83 void unaryOpError(int line, const char* op, TString operand); 84 void binaryOpError(int line, const char* op, TString left, TString right); 85 bool precisionErrorCheck(int line, TPrecision precision, TBasicType type); 86 bool lValueErrorCheck(int line, const char* op, TIntermTyped*); 82 87 bool constErrorCheck(TIntermTyped* node); 83 88 bool integerErrorCheck(TIntermTyped* node, const char* token); 84 bool globalErrorCheck(const TSourceLoc& line, bool global, const char* token); 85 bool constructorErrorCheck(const TSourceLoc& line, TIntermNode*, TFunction&, TOperator, TType*); 86 bool arraySizeErrorCheck(const TSourceLoc& line, TIntermTyped* expr, int& size); 87 bool arrayQualifierErrorCheck(const TSourceLoc& line, TPublicType type); 88 bool arrayTypeErrorCheck(const TSourceLoc& line, TPublicType type); 89 bool arrayErrorCheck(const TSourceLoc& line, TString& identifier, TPublicType type, TVariable*& variable); 90 bool voidErrorCheck(const TSourceLoc&, const TString&, const TPublicType&); 91 bool boolErrorCheck(const TSourceLoc&, const TIntermTyped*); 92 bool boolErrorCheck(const TSourceLoc&, const TPublicType&); 93 bool samplerErrorCheck(const TSourceLoc& line, const TPublicType& pType, const char* reason); 94 bool structQualifierErrorCheck(const TSourceLoc& line, const TPublicType& pType); 95 bool parameterSamplerErrorCheck(const TSourceLoc& line, TQualifier qualifier, const TType& type); 96 bool nonInitConstErrorCheck(const TSourceLoc& line, TString& identifier, TPublicType& type, bool array); 97 bool nonInitErrorCheck(const TSourceLoc& line, TString& identifier, TPublicType& type, TVariable*& variable); 98 bool paramErrorCheck(const TSourceLoc& line, TQualifier qualifier, TQualifier paramQualifier, TType* type); 99 bool extensionErrorCheck(const TSourceLoc& line, const TString&); 89 bool globalErrorCheck(int line, bool global, const char* token); 90 bool constructorErrorCheck(int line, TIntermNode*, TFunction&, TOperator, TType*); 91 bool arraySizeErrorCheck(int line, TIntermTyped* expr, int& size); 92 bool arrayQualifierErrorCheck(int line, TPublicType type); 93 bool arrayTypeErrorCheck(int line, TPublicType type); 94 bool arrayErrorCheck(int line, TString& identifier, TPublicType type, TVariable*& variable); 95 bool voidErrorCheck(int, const TString&, const TPublicType&); 96 bool boolErrorCheck(int, const TIntermTyped*); 97 bool boolErrorCheck(int, const TPublicType&); 98 bool samplerErrorCheck(int line, const TPublicType& pType, const char* reason); 99 bool structQualifierErrorCheck(int line, const TPublicType& pType); 100 bool parameterSamplerErrorCheck(int line, TQualifier qualifier, const TType& type); 101 bool nonInitConstErrorCheck(int line, TString& identifier, TPublicType& type, bool array); 102 bool nonInitErrorCheck(int line, TString& identifier, TPublicType& type, TVariable*& variable); 103 bool paramErrorCheck(int line, TQualifier qualifier, TQualifier paramQualifier, TType* type); 104 bool extensionErrorCheck(int line, const TString&); 105 106 const TExtensionBehavior& extensionBehavior() const { return directiveHandler.extensionBehavior(); } 107 bool supportsExtension(const char* extension); 108 void handleExtensionDirective(int line, const char* extName, const char* behavior); 100 109 101 110 const TPragma& pragma() const { return directiveHandler.pragma(); } 102 const TExtensionBehavior& extensionBehavior() const { return directiveHandler.extensionBehavior(); } 103 bool supportsExtension(const char* extension); 111 void handlePragmaDirective(int line, const char* name, const char* value); 104 112 105 113 bool containsSampler(TType& type); 106 114 bool areAllChildConst(TIntermAggregate* aggrNode); 107 const TFunction* findFunction(const TSourceLoc& line, TFunction* pfnCall, bool *builtIn = 0); 108 bool isVariableBuiltIn(const TVariable* pVar); 109 bool executeInitializer(const TSourceLoc& line, TString& identifier, TPublicType& pType, 115 const TFunction* findFunction(int line, TFunction* pfnCall, bool *builtIn = 0); 116 bool executeInitializer(TSourceLoc line, TString& identifier, TPublicType& pType, 110 117 TIntermTyped* initializer, TIntermNode*& intermNode, TVariable* variable = 0); 118 bool arraySetMaxSize(TIntermSymbol*, TType*, int, bool, TSourceLoc); 111 119 112 TIntermTyped* addConstructor(TIntermNode*, const TType*, TOperator, TFunction*, const TSourceLoc&);120 TIntermTyped* addConstructor(TIntermNode*, const TType*, TOperator, TFunction*, TSourceLoc); 113 121 TIntermTyped* foldConstConstructor(TIntermAggregate* aggrNode, const TType& type); 114 TIntermTyped* constructStruct(TIntermNode*, TType*, int, const TSourceLoc&, bool subset);115 TIntermTyped* constructBuiltIn(const TType*, TOperator, TIntermNode*, const TSourceLoc&, bool subset);116 TIntermTyped* addConstVectorNode(TVectorFields&, TIntermTyped*, const TSourceLoc&);117 TIntermTyped* addConstMatrixNode(int , TIntermTyped*, const TSourceLoc&);118 TIntermTyped* addConstArrayNode(int index, TIntermTyped* node, const TSourceLoc&line);119 TIntermTyped* addConstStruct(TString& , TIntermTyped*, const TSourceLoc&);122 TIntermTyped* constructStruct(TIntermNode*, TType*, int, TSourceLoc, bool subset); 123 TIntermTyped* constructBuiltIn(const TType*, TOperator, TIntermNode*, TSourceLoc, bool subset); 124 TIntermTyped* addConstVectorNode(TVectorFields&, TIntermTyped*, TSourceLoc); 125 TIntermTyped* addConstMatrixNode(int , TIntermTyped*, TSourceLoc); 126 TIntermTyped* addConstArrayNode(int index, TIntermTyped* node, TSourceLoc line); 127 TIntermTyped* addConstStruct(TString& , TIntermTyped*, TSourceLoc); 120 128 121 129 // Performs an error check for embedded struct declarations. 122 130 // Returns true if an error was raised due to the declaration of 123 131 // this struct. 124 bool enterStructDeclaration( const TSourceLoc&line, const TString& identifier);132 bool enterStructDeclaration(TSourceLoc line, const TString& identifier); 125 133 void exitStructDeclaration(); 126 134 127 bool structNestingErrorCheck( const TSourceLoc& line, const TField& field);135 bool structNestingErrorCheck(TSourceLoc line, const TType& fieldType); 128 136 }; 129 137 -
trunk/Source/ThirdParty/ANGLE/src/compiler/PoolAlloc.cpp
r152755 r152946 229 229 void* TPoolAllocator::allocate(size_t numBytes) 230 230 { 231 //232 // Just keep some interesting statistics.233 //234 ++numCalls;235 totalBytes += numBytes;236 237 231 // If we are using guard blocks, all allocations are bracketed by 238 232 // them: [guardblock][allocation][guardblock]. numBytes is how … … 241 235 // guardBlockSize=0 and this all gets optimized away. 242 236 size_t allocationSize = TAllocation::allocationSize(numBytes); 243 // Detect integer overflow. 244 if (allocationSize < numBytes) 245 return 0; 237 238 // 239 // Just keep some interesting statistics. 240 // 241 ++numCalls; 242 totalBytes += numBytes; 246 243 247 244 // … … 249 246 // This step could be moved to be inline sometime. 250 247 // 251 if ( allocationSize <= pageSize - currentPageOffset) {248 if (currentPageOffset + allocationSize <= pageSize) { 252 249 // 253 250 // Safe to allocate from currentPageOffset. … … 260 257 } 261 258 262 if (allocationSize > pageSize - headerSkip) {259 if (allocationSize + headerSkip > pageSize) { 263 260 // 264 261 // Do a multi-page allocation. Don't mix these with the others. … … 266 263 // 267 264 size_t numBytesToAlloc = allocationSize + headerSkip; 268 // Detect integer overflow.269 if (numBytesToAlloc < allocationSize)270 return 0;271 272 265 tHeader* memory = reinterpret_cast<tHeader*>(::new char[numBytesToAlloc]); 273 266 if (memory == 0) -
trunk/Source/ThirdParty/ANGLE/src/compiler/ShHandle.h
r152755 r152946 82 82 // Clears the results from the previous compilation. 83 83 void clearResults(); 84 // Return true if function recursion is detected or call depth exceeded.85 bool detect CallDepth(TIntermNode* root, TInfoSink& infoSink, bool limitCallStackDepth);84 // Return true if function recursion is detected. 85 bool detectRecursion(TIntermNode* root); 86 86 // Rewrites a shader's intermediate tree according to the CSS Shaders spec. 87 87 void rewriteCSSShader(TIntermNode* root); … … 105 105 // flow or in operations whose time can depend on the input values. 106 106 bool enforceFragmentShaderTimingRestrictions(const TDependencyGraph& graph); 107 // Return true if the maximum expression complexity below the limit.108 bool limitExpressionComplexity(TIntermNode* root);109 107 // Get built-in extensions with default behavior. 110 108 const TExtensionBehavior& getExtensionBehavior() const; … … 119 117 120 118 int maxUniformVectors; 121 int maxExpressionComplexity;122 int maxCallStackDepth;123 119 124 120 // Built-in symbol table for the given language, spec, and resources. -
trunk/Source/ThirdParty/ANGLE/src/compiler/ShaderLang.cpp
r152755 r152946 127 127 resources->ARB_texture_rectangle = 0; 128 128 resources->EXT_draw_buffers = 0; 129 resources->EXT_frag_depth = 0;130 129 131 130 // Disable highp precision in fragment shader by default. -
trunk/Source/ThirdParty/ANGLE/src/compiler/SymbolTable.cpp
r152755 r152946 18 18 #include <stdio.h> 19 19 #include <algorithm> 20 #include <climits> 20 21 #include "common/angleutils.h" 21 22 22 23 TType::TType(const TPublicType &p) : 23 type(p.type), precision(p.precision), qualifier(p.qualifier), size(p.size), matrix(p.matrix), array(p.array), arraySize(p.arraySize), structure(0) 24 { 25 if (p.userDef) 24 type(p.type), precision(p.precision), qualifier(p.qualifier), size(p.size), matrix(p.matrix), array(p.array), arraySize(p.arraySize), 25 maxArraySize(0), arrayInformationType(0), structure(0), structureSize(0), deepestStructNesting(0), fieldName(0), mangled(0), typeName(0) 26 { 27 if (p.userDef) { 26 28 structure = p.userDef->getStruct(); 29 typeName = NewPoolTString(p.userDef->getTypeName().c_str()); 30 computeDeepestStructNesting(); 31 } 27 32 } 28 33 … … 30 35 // Recursively generate mangled names. 31 36 // 32 TString TType::buildMangledName() const 33 { 34 TString mangledName; 37 void TType::buildMangledName(TString& mangledName) 38 { 35 39 if (isMatrix()) 36 40 mangledName += 'm'; … … 39 43 40 44 switch (type) { 41 case EbtFloat: mangledName += 'f'; break; 42 case EbtInt: mangledName += 'i'; break; 43 case EbtBool: mangledName += 'b'; break; 44 case EbtSampler2D: mangledName += "s2"; break; 45 case EbtSamplerCube: mangledName += "sC"; break; 46 case EbtStruct: mangledName += structure->mangledName(); break; 47 default: break; 45 case EbtFloat: mangledName += 'f'; break; 46 case EbtInt: mangledName += 'i'; break; 47 case EbtBool: mangledName += 'b'; break; 48 case EbtSampler2D: mangledName += "s2"; break; 49 case EbtSamplerCube: mangledName += "sC"; break; 50 case EbtStruct: 51 mangledName += "struct-"; 52 if (typeName) 53 mangledName += *typeName; 54 {// support MSVC++6.0 55 for (unsigned int i = 0; i < structure->size(); ++i) { 56 mangledName += '-'; 57 (*structure)[i].type->buildMangledName(mangledName); 58 } 59 } 60 default: 61 break; 48 62 } 49 63 … … 56 70 mangledName += ']'; 57 71 } 58 return mangledName; 59 } 60 61 size_t TType::getObjectSize() const 62 { 63 size_t totalSize = 0; 64 65 if (getBasicType() == EbtStruct) 66 totalSize = structure->objectSize(); 67 else if (matrix) 68 totalSize = size * size; 69 else 70 totalSize = size; 71 72 if (isArray()) { 73 size_t arraySize = getArraySize(); 74 if (arraySize > INT_MAX / totalSize) 75 totalSize = INT_MAX; 76 else 77 totalSize *= arraySize; 78 } 79 80 return totalSize; 81 } 82 83 bool TStructure::containsArrays() const 84 { 85 for (size_t i = 0; i < mFields->size(); ++i) { 86 const TType* fieldType = (*mFields)[i]->type(); 87 if (fieldType->isArray() || fieldType->isStructureContainingArrays()) 72 } 73 74 int TType::getStructSize() const 75 { 76 if (!getStruct()) { 77 assert(false && "Not a struct"); 78 return 0; 79 } 80 81 if (structureSize == 0) 82 for (TTypeList::const_iterator tl = getStruct()->begin(); tl != getStruct()->end(); tl++) 83 structureSize += ((*tl).type)->getObjectSize(); 84 85 return structureSize; 86 } 87 88 void TType::computeDeepestStructNesting() 89 { 90 if (!getStruct()) { 91 return; 92 } 93 94 int maxNesting = 0; 95 for (TTypeList::const_iterator tl = getStruct()->begin(); tl != getStruct()->end(); ++tl) { 96 maxNesting = std::max(maxNesting, ((*tl).type)->getDeepestStructNesting()); 97 } 98 99 deepestStructNesting = 1 + maxNesting; 100 } 101 102 bool TType::isStructureContainingArrays() const 103 { 104 if (!structure) 105 { 106 return false; 107 } 108 109 for (TTypeList::const_iterator member = structure->begin(); member != structure->end(); member++) 110 { 111 if (member->type->isArray() || 112 member->type->isStructureContainingArrays()) 113 { 88 114 return true; 89 } 115 } 116 } 117 90 118 return false; 91 }92 93 TString TStructure::buildMangledName() const94 {95 TString mangledName("struct-");96 mangledName += *mName;97 for (size_t i = 0; i < mFields->size(); ++i) {98 mangledName += '-';99 mangledName += (*mFields)[i]->type()->getMangledName();100 }101 return mangledName;102 }103 104 size_t TStructure::calculateObjectSize() const105 {106 size_t size = 0;107 for (size_t i = 0; i < mFields->size(); ++i) {108 size_t fieldSize = (*mFields)[i]->type()->getObjectSize();109 if (fieldSize > INT_MAX - size)110 size = INT_MAX;111 else112 size += fieldSize;113 }114 return size;115 }116 117 int TStructure::calculateDeepestNesting() const118 {119 int maxNesting = 0;120 for (size_t i = 0; i < mFields->size(); ++i) {121 maxNesting = std::max(maxNesting, (*mFields)[i]->type()->getDeepestStructNesting());122 }123 return 1 + maxNesting;124 119 } 125 120 … … 202 197 { 203 198 for (tLevel::iterator it = level.begin(); it != level.end(); ++it) { 204 TSymbol* symbol = it->second; 205 if (symbol->getName() == name) 206 symbol->relateToExtension(ext); 207 } 208 } 199 if (it->second->isFunction()) { 200 TFunction* function = static_cast<TFunction*>(it->second); 201 if (function->getName() == name) 202 function->relateToExtension(ext); 203 } 204 } 205 } 206 207 TSymbol::TSymbol(const TSymbol& copyOf) 208 { 209 name = NewPoolTString(copyOf.name->c_str()); 210 uniqueId = copyOf.uniqueId; 211 } 212 213 TVariable::TVariable(const TVariable& copyOf, TStructureMap& remapper) : TSymbol(copyOf) 214 { 215 type.copyType(copyOf.type, remapper); 216 userType = copyOf.userType; 217 // for builtIn symbol table level, unionArray and arrayInformation pointers should be NULL 218 assert(copyOf.arrayInformationType == 0); 219 arrayInformationType = 0; 220 221 if (copyOf.unionArray) { 222 assert(!copyOf.type.getStruct()); 223 assert(copyOf.type.getObjectSize() == 1); 224 unionArray = new ConstantUnion[1]; 225 unionArray[0] = copyOf.unionArray[0]; 226 } else 227 unionArray = 0; 228 } 229 230 TVariable* TVariable::clone(TStructureMap& remapper) 231 { 232 TVariable *variable = new TVariable(*this, remapper); 233 234 return variable; 235 } 236 237 TFunction::TFunction(const TFunction& copyOf, TStructureMap& remapper) : TSymbol(copyOf) 238 { 239 for (unsigned int i = 0; i < copyOf.parameters.size(); ++i) { 240 TParameter param; 241 parameters.push_back(param); 242 parameters.back().copyParam(copyOf.parameters[i], remapper); 243 } 244 245 returnType.copyType(copyOf.returnType, remapper); 246 mangledName = copyOf.mangledName; 247 op = copyOf.op; 248 defined = copyOf.defined; 249 } 250 251 TFunction* TFunction::clone(TStructureMap& remapper) 252 { 253 TFunction *function = new TFunction(*this, remapper); 254 255 return function; 256 } 257 258 TSymbolTableLevel* TSymbolTableLevel::clone(TStructureMap& remapper) 259 { 260 TSymbolTableLevel *symTableLevel = new TSymbolTableLevel(); 261 tLevel::iterator iter; 262 for (iter = level.begin(); iter != level.end(); ++iter) { 263 symTableLevel->insert(*iter->second->clone(remapper)); 264 } 265 266 return symTableLevel; 267 } 268 269 void TSymbolTable::copyTable(const TSymbolTable& copyOf) 270 { 271 TStructureMap remapper; 272 uniqueId = copyOf.uniqueId; 273 for (unsigned int i = 0; i < copyOf.table.size(); ++i) { 274 table.push_back(copyOf.table[i]->clone(remapper)); 275 } 276 for( unsigned int i = 0; i < copyOf.precisionStack.size(); i++) { 277 precisionStack.push_back( copyOf.precisionStack[i] ); 278 } 279 } -
trunk/Source/ThirdParty/ANGLE/src/compiler/SymbolTable.h
r152755 r152946 33 33 #include <assert.h> 34 34 35 #include "common/angleutils.h"36 35 #include "compiler/InfoSink.h" 37 36 #include "compiler/intermediate.h" … … 51 50 void setUniqueId(int id) { uniqueId = id; } 52 51 int getUniqueId() const { return uniqueId; } 53 virtual void dump(TInfoSink &infoSink) const = 0; 54 void relateToExtension(const TString& ext) { extension = ext; } 55 const TString& getExtension() const { return extension; } 56 57 private: 58 DISALLOW_COPY_AND_ASSIGN(TSymbol); 59 52 virtual void dump(TInfoSink &infoSink) const = 0; 53 TSymbol(const TSymbol&); 54 virtual TSymbol* clone(TStructureMap& remapper) = 0; 55 56 protected: 60 57 const TString *name; 61 58 unsigned int uniqueId; // For real comparing during code generation 62 TString extension;63 59 }; 64 60 … … 75 71 class TVariable : public TSymbol { 76 72 public: 77 TVariable(const TString *name, const TType& t, bool uT = false ) : TSymbol(name), type(t), userType(uT), unionArray(0) { }73 TVariable(const TString *name, const TType& t, bool uT = false ) : TSymbol(name), type(t), userType(uT), unionArray(0), arrayInformationType(0) { } 78 74 virtual ~TVariable() { } 79 75 virtual bool isVariable() const { return true; } … … 82 78 bool isUserType() const { return userType; } 83 79 void setQualifier(TQualifier qualifier) { type.setQualifier(qualifier); } 80 void updateArrayInformationType(TType *t) { arrayInformationType = t; } 81 TType* getArrayInformationType() { return arrayInformationType; } 84 82 85 83 virtual void dump(TInfoSink &infoSink) const; … … 103 101 unionArray = constArray; 104 102 } 105 106 private: 107 DISALLOW_COPY_AND_ASSIGN(TVariable); 108 103 TVariable(const TVariable&, TStructureMap& remapper); // copy constructor 104 virtual TVariable* clone(TStructureMap& remapper); 105 106 protected: 109 107 TType type; 110 108 bool userType; … … 112 110 // when this object is destroyed 113 111 ConstantUnion *unionArray; 112 TType *arrayInformationType; // this is used for updating maxArraySize in all the references to a given symbol 114 113 }; 115 114 … … 121 120 TString *name; 122 121 TType* type; 122 void copyParam(const TParameter& param, TStructureMap& remapper) 123 { 124 name = NewPoolTString(param.name->c_str()); 125 type = param.type->clone(remapper); 126 } 123 127 }; 124 128 … … 160 164 TOperator getBuiltInOp() const { return op; } 161 165 166 void relateToExtension(const TString& ext) { extension = ext; } 167 const TString& getExtension() const { return extension; } 168 162 169 void setDefined() { defined = true; } 163 170 bool isDefined() { return defined; } … … 167 174 168 175 virtual void dump(TInfoSink &infoSink) const; 169 170 private: 171 DISALLOW_COPY_AND_ASSIGN(TFunction); 172 176 TFunction(const TFunction&, TStructureMap& remapper); 177 virtual TFunction* clone(TStructureMap& remapper); 178 179 protected: 173 180 typedef TVector<TParameter> TParamList; 174 181 TParamList parameters; … … 176 183 TString mangledName; 177 184 TOperator op; 185 TString extension; 178 186 bool defined; 179 187 }; … … 224 232 void relateToExtension(const char* name, const TString& ext); 225 233 void dump(TInfoSink &infoSink) const; 234 TSymbolTableLevel* clone(TStructureMap& remapper); 226 235 227 236 protected: … … 313 322 int getMaxSymbolId() { return uniqueId; } 314 323 void dump(TInfoSink &infoSink) const; 324 void copyTable(const TSymbolTable& copyOf); 315 325 316 326 bool setDefaultPrecision( const TPublicType& type, TPrecision prec ){ -
trunk/Source/ThirdParty/ANGLE/src/compiler/Types.h
r152755 r152946 8 8 #define _TYPES_INCLUDED 9 9 10 #include "common/angleutils.h"11 12 10 #include "compiler/BaseTypes.h" 13 11 #include "compiler/Common.h" 14 12 #include "compiler/debug.h" 15 13 14 class TType; 16 15 struct TPublicType; 17 class TType; 18 19 class TField 16 17 // 18 // Need to have association of line numbers to types in a list for building structs. 19 // 20 struct TTypeLine { 21 TType* type; 22 int line; 23 }; 24 typedef TVector<TTypeLine> TTypeList; 25 26 inline TTypeList* NewPoolTTypeList() 20 27 { 21 public: 22 POOL_ALLOCATOR_NEW_DELETE(GlobalPoolAllocator); 23 TField(TType* type, TString* name) : mType(type), mName(name) {} 24 25 // TODO(alokp): We should only return const type. 26 // Fix it by tweaking grammar. 27 TType* type() { return mType; } 28 const TType* type() const { return mType; } 29 30 const TString& name() const { return *mName; } 31 32 private: 33 DISALLOW_COPY_AND_ASSIGN(TField); 34 TType* mType; 35 TString* mName; 36 }; 37 38 typedef TVector<TField*> TFieldList; 39 inline TFieldList* NewPoolTFieldList() 40 { 41 void* memory = GlobalPoolAllocator.allocate(sizeof(TFieldList)); 42 return new(memory) TFieldList; 28 void* memory = GlobalPoolAllocator.allocate(sizeof(TTypeList)); 29 return new(memory) TTypeList; 43 30 } 44 31 45 class TStructure 46 { 47 public: 48 POOL_ALLOCATOR_NEW_DELETE(GlobalPoolAllocator); 49 TStructure(TString* name, TFieldList* fields) 50 : mName(name), 51 mFields(fields), 52 mObjectSize(0), 53 mDeepestNesting(0) { 54 } 55 56 const TString& name() const { return *mName; } 57 const TFieldList& fields() const { return *mFields; } 58 59 const TString& mangledName() const { 60 if (mMangledName.empty()) 61 mMangledName = buildMangledName(); 62 return mMangledName; 63 } 64 size_t objectSize() const { 65 if (mObjectSize == 0) 66 mObjectSize = calculateObjectSize(); 67 return mObjectSize; 68 }; 69 int deepestNesting() const { 70 if (mDeepestNesting == 0) 71 mDeepestNesting = calculateDeepestNesting(); 72 return mDeepestNesting; 73 } 74 bool containsArrays() const; 75 76 private: 77 DISALLOW_COPY_AND_ASSIGN(TStructure); 78 TString buildMangledName() const; 79 size_t calculateObjectSize() const; 80 int calculateDeepestNesting() const; 81 82 TString* mName; 83 TFieldList* mFields; 84 85 mutable TString mMangledName; 86 mutable size_t mObjectSize; 87 mutable int mDeepestNesting; 88 }; 32 typedef TMap<TTypeList*, TTypeList*> TStructureMap; 33 typedef TMap<TTypeList*, TTypeList*>::iterator TStructureMapIterator; 89 34 90 35 // … … 97 42 TType() {} 98 43 TType(TBasicType t, TPrecision p, TQualifier q = EvqTemporary, int s = 1, bool m = false, bool a = false) : 99 type(t), precision(p), qualifier(q), size(s), matrix(m), array(a), arraySize(0), structure(0) 44 type(t), precision(p), qualifier(q), size(s), matrix(m), array(a), arraySize(0), 45 maxArraySize(0), arrayInformationType(0), structure(0), structureSize(0), deepestStructNesting(0), fieldName(0), mangled(0), typeName(0) 100 46 { 101 47 } 102 48 explicit TType(const TPublicType &p); 103 TType(TStructure* userDef, TPrecision p = EbpUndefined) : 104 type(EbtStruct), precision(p), qualifier(EvqTemporary), size(1), matrix(false), array(false), arraySize(0), structure(userDef) 105 { 49 TType(TTypeList* userDef, const TString& n, TPrecision p = EbpUndefined) : 50 type(EbtStruct), precision(p), qualifier(EvqTemporary), size(1), matrix(false), array(false), arraySize(0), 51 maxArraySize(0), arrayInformationType(0), structure(userDef), structureSize(0), deepestStructNesting(0), fieldName(0), mangled(0) 52 { 53 typeName = NewPoolTString(n.c_str()); 54 } 55 56 void copyType(const TType& copyOf, TStructureMap& remapper) 57 { 58 type = copyOf.type; 59 precision = copyOf.precision; 60 qualifier = copyOf.qualifier; 61 size = copyOf.size; 62 matrix = copyOf.matrix; 63 array = copyOf.array; 64 arraySize = copyOf.arraySize; 65 66 TStructureMapIterator iter; 67 if (copyOf.structure) { 68 if ((iter = remapper.find(structure)) == remapper.end()) { 69 // create the new structure here 70 structure = NewPoolTTypeList(); 71 for (unsigned int i = 0; i < copyOf.structure->size(); ++i) { 72 TTypeLine typeLine; 73 typeLine.line = (*copyOf.structure)[i].line; 74 typeLine.type = (*copyOf.structure)[i].type->clone(remapper); 75 structure->push_back(typeLine); 76 } 77 } else { 78 structure = iter->second; 79 } 80 } else 81 structure = 0; 82 83 fieldName = 0; 84 if (copyOf.fieldName) 85 fieldName = NewPoolTString(copyOf.fieldName->c_str()); 86 typeName = 0; 87 if (copyOf.typeName) 88 typeName = NewPoolTString(copyOf.typeName->c_str()); 89 90 mangled = 0; 91 if (copyOf.mangled) 92 mangled = NewPoolTString(copyOf.mangled->c_str()); 93 94 structureSize = copyOf.structureSize; 95 maxArraySize = copyOf.maxArraySize; 96 deepestStructNesting = copyOf.deepestStructNesting; 97 assert(copyOf.arrayInformationType == 0); 98 arrayInformationType = 0; // arrayInformationType should not be set for builtIn symbol table level 99 } 100 101 TType* clone(TStructureMap& remapper) 102 { 103 TType *newType = new TType(); 104 newType->copyType(*this, remapper); 105 106 return newType; 106 107 } 107 108 … … 119 120 void setNominalSize(int s) { size = s; } 120 121 // Full size of single instance of type 121 size_t getObjectSize() const; 122 int getObjectSize() const 123 { 124 int totalSize; 125 126 if (getBasicType() == EbtStruct) 127 totalSize = getStructSize(); 128 else if (matrix) 129 totalSize = size * size; 130 else 131 totalSize = size; 132 133 if (isArray()) 134 totalSize *= std::max(getArraySize(), getMaxArraySize()); 135 136 return totalSize; 137 } 122 138 123 139 bool isMatrix() const { return matrix ? true : false; } … … 127 143 int getArraySize() const { return arraySize; } 128 144 void setArraySize(int s) { array = true; arraySize = s; } 129 void clearArrayness() { array = false; arraySize = 0; } 145 int getMaxArraySize () const { return maxArraySize; } 146 void setMaxArraySize (int s) { maxArraySize = s; } 147 void clearArrayness() { array = false; arraySize = 0; maxArraySize = 0; } 148 void setArrayInformationType(TType* t) { arrayInformationType = t; } 149 TType* getArrayInformationType() const { return arrayInformationType; } 130 150 131 151 bool isVector() const { return size > 1 && !matrix; } 132 152 bool isScalar() const { return size == 1 && !matrix && !structure; } 133 153 134 TStructure* getStruct() const { return structure; } 135 void setStruct(TStructure* s) { structure = s; } 136 137 const TString& getMangledName() const { 138 if (mangled.empty()) { 139 mangled = buildMangledName(); 140 mangled += ';'; 154 TTypeList* getStruct() const { return structure; } 155 void setStruct(TTypeList* s) { structure = s; computeDeepestStructNesting(); } 156 157 const TString& getTypeName() const 158 { 159 assert(typeName); 160 return *typeName; 161 } 162 void setTypeName(const TString& n) 163 { 164 typeName = NewPoolTString(n.c_str()); 165 } 166 167 bool isField() const { return fieldName != 0; } 168 const TString& getFieldName() const 169 { 170 assert(fieldName); 171 return *fieldName; 172 } 173 void setFieldName(const TString& n) 174 { 175 fieldName = NewPoolTString(n.c_str()); 176 } 177 178 TString& getMangledName() { 179 if (!mangled) { 180 mangled = NewPoolTString(""); 181 buildMangledName(*mangled); 182 *mangled += ';' ; 141 183 } 142 return mangled; 184 185 return *mangled; 143 186 } 144 187 … … 188 231 // of structures through which indirection must occur to reach the 189 232 // deepest field (nesting2.field1.position). 190 int getDeepestStructNesting() const { 191 return structure ? structure->deepestNesting() : 0; 192 } 193 194 bool isStructureContainingArrays() const { 195 return structure ? structure->containsArrays() : false; 196 } 197 198 private: 199 TString buildMangledName() const; 200 201 #ifdef __GNUC__ 202 TBasicType type; 203 TPrecision precision; 204 TQualifier qualifier; 205 #else 233 int getDeepestStructNesting() const { return deepestStructNesting; } 234 235 bool isStructureContainingArrays() const; 236 237 protected: 238 void buildMangledName(TString&); 239 int getStructSize() const; 240 void computeDeepestStructNesting(); 241 206 242 TBasicType type : 6; 207 243 TPrecision precision; 208 244 TQualifier qualifier : 7; 209 #endif210 245 int size : 8; // size of vector or matrix, not size of array 211 246 unsigned int matrix : 1; 212 247 unsigned int array : 1; 213 248 int arraySize; 214 215 TStructure* structure; // 0 unless this is a struct 216 217 mutable TString mangled; 249 int maxArraySize; 250 TType* arrayInformationType; 251 252 TTypeList* structure; // 0 unless this is a struct 253 mutable int structureSize; 254 int deepestStructNesting; 255 256 TString *fieldName; // for structure field names 257 TString *mangled; 258 TString *typeName; // for structure field type name 218 259 }; 219 260 … … 237 278 int arraySize; 238 279 TType* userDef; 239 TSourceLocline;240 241 void setBasic(TBasicType bt, TQualifier q, const TSourceLoc& ln)280 int line; 281 282 void setBasic(TBasicType bt, TQualifier q, int ln = 0) 242 283 { 243 284 type = bt; -
trunk/Source/ThirdParty/ANGLE/src/compiler/VariableInfo.cpp
r152755 r152946 132 132 ASSERT(type.getBasicType() == EbtStruct); 133 133 134 const TFieldList& fields = type.getStruct()->fields(); 135 for (size_t i = 0; i < fields.size(); ++i) { 136 const TType& fieldType = *(fields[i]->type()); 137 const TString& fieldName = fields[i]->name(); 138 getVariableInfo(fieldType, 139 name + "." + fieldName, 140 mappedName + "." + TIntermTraverser::hash(fieldName, hashFunction), 134 const TTypeList* structure = type.getStruct(); 135 for (size_t i = 0; i < structure->size(); ++i) { 136 const TType* fieldType = (*structure)[i].type; 137 getVariableInfo(*fieldType, 138 name + "." + fieldType->getFieldName(), 139 mappedName + "." + TIntermTraverser::hash(fieldType->getFieldName(), hashFunction), 141 140 infoList, 142 141 hashFunction); -
trunk/Source/ThirdParty/ANGLE/src/compiler/glslang.l
r152755 r152946 48 48 #endif 49 49 50 #define YY_USER_ACTION \ 51 yylloc->first_file = yylloc->last_file = yycolumn; \ 52 yylloc->first_line = yylloc->last_line = yylineno; 53 50 #define YY_USER_ACTION yylval->lex.line = yylineno; 54 51 #define YY_INPUT(buf, result, max_size) \ 55 52 result = string_input(buf, max_size, yyscanner); … … 61 58 62 59 %option noyywrap nounput never-interactive 63 %option yylineno reentrant bison-bridge bison-locations 60 %option yylineno reentrant bison-bridge 61 %option stack 64 62 %option extra-type="TParseContext*" 63 %x COMMENT FIELDS 65 64 66 65 D [0-9] … … 72 71 %% 73 72 74 "invariant" { return INVARIANT; } 75 "highp" { return HIGH_PRECISION; } 76 "mediump" { return MEDIUM_PRECISION; } 77 "lowp" { return LOW_PRECISION; } 78 "precision" { return PRECISION; } 79 80 "attribute" { return ATTRIBUTE; } 81 "const" { return CONST_QUAL; } 82 "uniform" { return UNIFORM; } 83 "varying" { return VARYING; } 84 85 "break" { return BREAK; } 86 "continue" { return CONTINUE; } 87 "do" { return DO; } 88 "for" { return FOR; } 89 "while" { return WHILE; } 90 91 "if" { return IF; } 92 "else" { return ELSE; } 93 94 "in" { return IN_QUAL; } 95 "out" { return OUT_QUAL; } 96 "inout" { return INOUT_QUAL; } 97 98 "float" { return FLOAT_TYPE; } 99 "int" { return INT_TYPE; } 100 "void" { return VOID_TYPE; } 101 "bool" { return BOOL_TYPE; } 102 "true" { yylval->lex.b = true; return BOOLCONSTANT; } 103 "false" { yylval->lex.b = false; return BOOLCONSTANT; } 104 105 "discard" { return DISCARD; } 106 "return" { return RETURN; } 107 108 "mat2" { return MATRIX2; } 109 "mat3" { return MATRIX3; } 110 "mat4" { return MATRIX4; } 111 112 "vec2" { return VEC2; } 113 "vec3" { return VEC3; } 114 "vec4" { return VEC4; } 115 "ivec2" { return IVEC2; } 116 "ivec3" { return IVEC3; } 117 "ivec4" { return IVEC4; } 118 "bvec2" { return BVEC2; } 119 "bvec3" { return BVEC3; } 120 "bvec4" { return BVEC4; } 121 122 "sampler2D" { return SAMPLER2D; } 123 "samplerCube" { return SAMPLERCUBE; } 124 "samplerExternalOES" { return SAMPLER_EXTERNAL_OES; } 125 "sampler2DRect" { return SAMPLER2DRECT; } 126 127 "struct" { return STRUCT; } 73 %{ 74 TParseContext* context = yyextra; 75 %} 76 77 /* Single-line comments */ 78 "//"[^\n]* ; 79 80 /* Multi-line comments */ 81 "/*" { yy_push_state(COMMENT, yyscanner); } 82 <COMMENT>. | 83 <COMMENT>\n ; 84 <COMMENT>"*/" { yy_pop_state(yyscanner); } 85 86 "invariant" { return(INVARIANT); } 87 "highp" { return(HIGH_PRECISION); } 88 "mediump" { return(MEDIUM_PRECISION); } 89 "lowp" { return(LOW_PRECISION); } 90 "precision" { return(PRECISION); } 91 92 "attribute" { return(ATTRIBUTE); } 93 "const" { return(CONST_QUAL); } 94 "uniform" { return(UNIFORM); } 95 "varying" { return(VARYING); } 96 97 "break" { return(BREAK); } 98 "continue" { return(CONTINUE); } 99 "do" { return(DO); } 100 "for" { return(FOR); } 101 "while" { return(WHILE); } 102 103 "if" { return(IF); } 104 "else" { return(ELSE); } 105 106 "in" { return(IN_QUAL); } 107 "out" { return(OUT_QUAL); } 108 "inout" { return(INOUT_QUAL); } 109 110 "float" { context->lexAfterType = true; return(FLOAT_TYPE); } 111 "int" { context->lexAfterType = true; return(INT_TYPE); } 112 "void" { context->lexAfterType = true; return(VOID_TYPE); } 113 "bool" { context->lexAfterType = true; return(BOOL_TYPE); } 114 "true" { yylval->lex.b = true; return(BOOLCONSTANT); } 115 "false" { yylval->lex.b = false; return(BOOLCONSTANT); } 116 117 "discard" { return(DISCARD); } 118 "return" { return(RETURN); } 119 120 "mat2" { context->lexAfterType = true; return(MATRIX2); } 121 "mat3" { context->lexAfterType = true; return(MATRIX3); } 122 "mat4" { context->lexAfterType = true; return(MATRIX4); } 123 124 "vec2" { context->lexAfterType = true; return (VEC2); } 125 "vec3" { context->lexAfterType = true; return (VEC3); } 126 "vec4" { context->lexAfterType = true; return (VEC4); } 127 "ivec2" { context->lexAfterType = true; return (IVEC2); } 128 "ivec3" { context->lexAfterType = true; return (IVEC3); } 129 "ivec4" { context->lexAfterType = true; return (IVEC4); } 130 "bvec2" { context->lexAfterType = true; return (BVEC2); } 131 "bvec3" { context->lexAfterType = true; return (BVEC3); } 132 "bvec4" { context->lexAfterType = true; return (BVEC4); } 133 134 "sampler2D" { context->lexAfterType = true; return SAMPLER2D; } 135 "samplerCube" { context->lexAfterType = true; return SAMPLERCUBE; } 136 "samplerExternalOES" { context->lexAfterType = true; return SAMPLER_EXTERNAL_OES; } 137 "sampler2DRect" { context->lexAfterType = true; return SAMPLER2DRECT; } 138 139 "struct" { context->lexAfterType = true; return(STRUCT); } 128 140 129 141 "asm" { return reserved_word(yyscanner); } … … 172 184 "fvec4" { return reserved_word(yyscanner); } 173 185 174 "sampler1D" { return reserved_word(yyscanner); } 175 "sampler3D" { return reserved_word(yyscanner); } 176 "sampler1DShadow" { return reserved_word(yyscanner); } 177 "sampler2DShadow" { return reserved_word(yyscanner); } 178 "sampler3DRect" { return reserved_word(yyscanner); } 186 "sampler1D" { return reserved_word(yyscanner); } 187 "sampler3D" { return reserved_word(yyscanner); } 188 189 "sampler1DShadow" { return reserved_word(yyscanner); } 190 "sampler2DShadow" { return reserved_word(yyscanner); } 191 192 "sampler3DRect" { return reserved_word(yyscanner); } 179 193 "sampler2DRectShadow" { return reserved_word(yyscanner); } 180 194 … … 190 204 } 191 205 192 0[xX]{H}+ { yylval->lex.i = static_cast<int>(strtol(yytext, 0, 0)); return INTCONSTANT; } 193 0{O}+ { yylval->lex.i = static_cast<int>(strtol(yytext, 0, 0)); return INTCONSTANT; } 194 {D}+ { yylval->lex.i = static_cast<int>(strtol(yytext, 0, 0)); return INTCONSTANT; } 195 196 {D}+{E} { yylval->lex.f = static_cast<float>(atof_dot(yytext)); return FLOATCONSTANT; } 197 {D}+"."{D}*({E})? { yylval->lex.f = static_cast<float>(atof_dot(yytext)); return FLOATCONSTANT; } 198 "."{D}+({E})? { yylval->lex.f = static_cast<float>(atof_dot(yytext)); return FLOATCONSTANT; } 199 200 "+=" { return ADD_ASSIGN; } 201 "-=" { return SUB_ASSIGN; } 202 "*=" { return MUL_ASSIGN; } 203 "/=" { return DIV_ASSIGN; } 204 "%=" { return MOD_ASSIGN; } 205 "<<=" { return LEFT_ASSIGN; } 206 ">>=" { return RIGHT_ASSIGN; } 207 "&=" { return AND_ASSIGN; } 208 "^=" { return XOR_ASSIGN; } 209 "|=" { return OR_ASSIGN; } 210 211 "++" { return INC_OP; } 212 "--" { return DEC_OP; } 213 "&&" { return AND_OP; } 214 "||" { return OR_OP; } 215 "^^" { return XOR_OP; } 216 "<=" { return LE_OP; } 217 ">=" { return GE_OP; } 218 "==" { return EQ_OP; } 219 "!=" { return NE_OP; } 220 "<<" { return LEFT_OP; } 221 ">>" { return RIGHT_OP; } 222 ";" { return SEMICOLON; } 223 ("{"|"<%") { return LEFT_BRACE; } 224 ("}"|"%>") { return RIGHT_BRACE; } 225 "," { return COMMA; } 226 ":" { return COLON; } 227 "=" { return EQUAL; } 228 "(" { return LEFT_PAREN; } 229 ")" { return RIGHT_PAREN; } 230 ("["|"<:") { return LEFT_BRACKET; } 231 ("]"|":>") { return RIGHT_BRACKET; } 232 "." { return DOT; } 233 "!" { return BANG; } 234 "-" { return DASH; } 235 "~" { return TILDE; } 236 "+" { return PLUS; } 237 "*" { return STAR; } 238 "/" { return SLASH; } 239 "%" { return PERCENT; } 240 "<" { return LEFT_ANGLE; } 241 ">" { return RIGHT_ANGLE; } 242 "|" { return VERTICAL_BAR; } 243 "^" { return CARET; } 244 "&" { return AMPERSAND; } 245 "?" { return QUESTION; } 246 247 [ \t\v\n\f\r] { } 248 <<EOF>> { yyterminate(); } 249 . { assert(false); return 0; } 206 0[xX]{H}+ { yylval->lex.i = static_cast<int>(strtol(yytext, 0, 0)); return(INTCONSTANT); } 207 0{O}+ { yylval->lex.i = static_cast<int>(strtol(yytext, 0, 0)); return(INTCONSTANT); } 208 0{D}+ { context->error(yylineno, "Invalid Octal number.", yytext); context->recover(); return 0;} 209 {D}+ { yylval->lex.i = static_cast<int>(strtol(yytext, 0, 0)); return(INTCONSTANT); } 210 211 {D}+{E} { yylval->lex.f = static_cast<float>(atof_dot(yytext)); return(FLOATCONSTANT); } 212 {D}+"."{D}*({E})? { yylval->lex.f = static_cast<float>(atof_dot(yytext)); return(FLOATCONSTANT); } 213 "."{D}+({E})? { yylval->lex.f = static_cast<float>(atof_dot(yytext)); return(FLOATCONSTANT); } 214 215 "+=" { return(ADD_ASSIGN); } 216 "-=" { return(SUB_ASSIGN); } 217 "*=" { return(MUL_ASSIGN); } 218 "/=" { return(DIV_ASSIGN); } 219 "%=" { return(MOD_ASSIGN); } 220 "<<=" { return(LEFT_ASSIGN); } 221 ">>=" { return(RIGHT_ASSIGN); } 222 "&=" { return(AND_ASSIGN); } 223 "^=" { return(XOR_ASSIGN); } 224 "|=" { return(OR_ASSIGN); } 225 226 "++" { return(INC_OP); } 227 "--" { return(DEC_OP); } 228 "&&" { return(AND_OP); } 229 "||" { return(OR_OP); } 230 "^^" { return(XOR_OP); } 231 "<=" { return(LE_OP); } 232 ">=" { return(GE_OP); } 233 "==" { return(EQ_OP); } 234 "!=" { return(NE_OP); } 235 "<<" { return(LEFT_OP); } 236 ">>" { return(RIGHT_OP); } 237 ";" { context->lexAfterType = false; return(SEMICOLON); } 238 ("{"|"<%") { context->lexAfterType = false; return(LEFT_BRACE); } 239 ("}"|"%>") { return(RIGHT_BRACE); } 240 "," { if (context->inTypeParen) context->lexAfterType = false; return(COMMA); } 241 ":" { return(COLON); } 242 "=" { context->lexAfterType = false; return(EQUAL); } 243 "(" { context->lexAfterType = false; context->inTypeParen = true; return(LEFT_PAREN); } 244 ")" { context->inTypeParen = false; return(RIGHT_PAREN); } 245 ("["|"<:") { return(LEFT_BRACKET); } 246 ("]"|":>") { return(RIGHT_BRACKET); } 247 "." { BEGIN(FIELDS); return(DOT); } 248 "!" { return(BANG); } 249 "-" { return(DASH); } 250 "~" { return(TILDE); } 251 "+" { return(PLUS); } 252 "*" { return(STAR); } 253 "/" { return(SLASH); } 254 "%" { return(PERCENT); } 255 "<" { return(LEFT_ANGLE); } 256 ">" { return(RIGHT_ANGLE); } 257 "|" { return(VERTICAL_BAR); } 258 "^" { return(CARET); } 259 "&" { return(AMPERSAND); } 260 "?" { return(QUESTION); } 261 262 <FIELDS>{L}({L}|{D})* { 263 BEGIN(INITIAL); 264 yylval->lex.string = NewPoolTString(yytext); 265 return FIELD_SELECTION; 266 } 267 <FIELDS>[ \t\v\f\r] {} 268 269 [ \t\v\n\f\r] { } 270 <*><<EOF>> { context->AfterEOF = true; yyterminate(); } 271 <*>. { context->warning(yylineno, "Unknown char", yytext, ""); return 0; } 250 272 251 273 %% … … 257 279 if (len < max_size) 258 280 memcpy(buf, token.text.c_str(), len); 259 yyset_column(token.location.file, yyscanner); 260 yyset_lineno(token.location.line, yyscanner); 281 yyset_lineno(EncodeSourceLoc(token.location.file, token.location.line), yyscanner); 261 282 262 283 if (len >= max_size) … … 272 293 int token = IDENTIFIER; 273 294 TSymbol* symbol = yyextra->symbolTable.find(yytext); 274 if ( symbol && symbol->isVariable()) {295 if (yyextra->lexAfterType == false && symbol && symbol->isVariable()) { 275 296 TVariable* variable = static_cast<TVariable*>(symbol); 276 if (variable->isUserType()) 297 if (variable->isUserType()) { 298 yyextra->lexAfterType = true; 277 299 token = TYPE_NAME; 300 } 278 301 } 279 302 yylval->lex.symbol = symbol; … … 284 307 struct yyguts_t* yyg = (struct yyguts_t*) yyscanner; 285 308 286 yyextra->error( *yylloc, "Illegal use of reserved word", yytext, "");309 yyextra->error(yylineno, "Illegal use of reserved word", yytext, ""); 287 310 yyextra->recover(); 288 311 return 0; 312 } 313 314 void yyerror(TParseContext* context, const char* reason) { 315 struct yyguts_t* yyg = (struct yyguts_t*) context->scanner; 316 317 if (context->AfterEOF) { 318 context->error(yylineno, reason, "unexpected EOF"); 319 } else { 320 context->error(yylineno, reason, yytext); 321 } 322 context->recover(); 289 323 } 290 324 … … 311 345 TParseContext* context) { 312 346 yyrestart(NULL, context->scanner); 313 yyset_ column(0, context->scanner);314 yyset_lineno(1, context->scanner);347 yyset_lineno(EncodeSourceLoc(0, 1), context->scanner); 348 context->AfterEOF = false; 315 349 316 350 // Initialize preprocessor. -
trunk/Source/ThirdParty/ANGLE/src/compiler/glslang.y
r152821 r152946 1 1 /* 2 2 // 3 // Copyright (c) 2002-201 3The ANGLE Project Authors. All rights reserved.3 // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. 4 4 // Use of this source code is governed by a BSD-style license that can be 5 5 // found in the LICENSE file. … … 40 40 41 41 #define YYENABLE_NLS 0 42 #define YYLTYPE_IS_TRIVIAL 1 42 43 43 44 #define YYLEX_PARAM context->scanner … … 47 48 %pure-parser 48 49 %parse-param {TParseContext* context} 49 %locations50 50 51 51 %union { 52 #define YYLTYPE TSourceLoc53 #define YYLTYPE_IS_DECLARED 154 52 struct { 53 TSourceLoc line; 55 54 union { 56 55 TString *string; … … 62 61 } lex; 63 62 struct { 63 TSourceLoc line; 64 64 TOperator op; 65 65 union { … … 75 75 TFunction* function; 76 76 TParameter param; 77 T Field* field;78 T FieldList* fieldList;77 TTypeLine typeLine; 78 TTypeList* typeList; 79 79 }; 80 80 } interm; … … 82 82 83 83 %{ 84 extern int yylex(YYSTYPE* yylval, YYLTYPE* yylloc, void* yyscanner); 85 static void yyerror(YYLTYPE* yylloc, TParseContext* context, const char* reason); 86 87 #define YYLLOC_DEFAULT(Current, Rhs, N) \ 88 do { \ 89 if (YYID(N)) { \ 90 (Current).first_file = YYRHSLOC(Rhs, 1).first_file; \ 91 (Current).first_line = YYRHSLOC(Rhs, 1).first_line; \ 92 (Current).last_file = YYRHSLOC(Rhs, N).last_file; \ 93 (Current).last_line = YYRHSLOC(Rhs, N).last_line; \ 94 } \ 95 else { \ 96 (Current).first_file = YYRHSLOC(Rhs, 0).last_file; \ 97 (Current).first_line = YYRHSLOC(Rhs, 0).last_line; \ 98 (Current).last_file = YYRHSLOC(Rhs, 0).last_file; \ 99 (Current).last_line = YYRHSLOC(Rhs, 0).last_line; \ 100 } \ 101 } while (0) 84 extern int yylex(YYSTYPE* yylval_param, void* yyscanner); 85 extern void yyerror(TParseContext* context, const char* reason); 86 87 #define FRAG_VERT_ONLY(S, L) { \ 88 if (context->shaderType != SH_FRAGMENT_SHADER && \ 89 context->shaderType != SH_VERTEX_SHADER) { \ 90 context->error(L, " supported in vertex/fragment shaders only ", S); \ 91 context->recover(); \ 92 } \ 93 } 102 94 103 95 #define VERTEX_ONLY(S, L) { \ … … 125 117 126 118 %token <lex> IDENTIFIER TYPE_NAME FLOATCONSTANT INTCONSTANT BOOLCONSTANT 119 %token <lex> FIELD_SELECTION 127 120 %token <lex> LEFT_OP RIGHT_OP 128 121 %token <lex> INC_OP DEC_OP LE_OP GE_OP EQ_OP NE_OP … … 135 128 %token <lex> LEFT_ANGLE RIGHT_ANGLE VERTICAL_BAR CARET AMPERSAND QUESTION 136 129 137 %type <lex> identifier138 130 %type <interm> assignment_operator unary_operator 139 131 %type <interm.intermTypedNode> variable_identifier primary_expression postfix_expression … … 163 155 %type <interm.type> type_specifier_no_prec type_specifier_nonarray 164 156 %type <interm.type> struct_specifier 165 %type <interm. field> struct_declarator166 %type <interm. fieldList> struct_declarator_list struct_declaration struct_declaration_list157 %type <interm.typeLine> struct_declarator 158 %type <interm.typeList> struct_declarator_list struct_declaration struct_declaration_list 167 159 %type <interm.function> function_header function_declarator function_identifier 168 160 %type <interm.function> function_header_with_parameters function_call_header … … 172 164 %start translation_unit 173 165 %% 174 175 identifier176 : IDENTIFIER177 | TYPE_NAME178 166 179 167 variable_identifier … … 183 171 const TVariable* variable; 184 172 if (symbol == 0) { 185 context->error( @1, "undeclared identifier", $1.string->c_str());173 context->error($1.line, "undeclared identifier", $1.string->c_str()); 186 174 context->recover(); 187 175 TType type(EbtFloat, EbpUndefined); … … 192 180 // This identifier can only be a variable type symbol 193 181 if (! symbol->isVariable()) { 194 context->error( @1, "variable expected", $1.string->c_str());182 context->error($1.line, "variable expected", $1.string->c_str()); 195 183 context->recover(); 196 184 } 197 198 185 variable = static_cast<const TVariable*>(symbol); 199 200 if (context->isVariableBuiltIn(variable) &&201 !variable->getExtension().empty() &&202 context->extensionErrorCheck(@1, variable->getExtension())) {203 context->recover();204 }205 186 } 206 187 … … 211 192 ConstantUnion* constArray = variable->getConstPointer(); 212 193 TType t(variable->getType()); 213 $$ = context->intermediate.addConstantUnion(constArray, t, @1);194 $$ = context->intermediate.addConstantUnion(constArray, t, $1.line); 214 195 } else 215 196 $$ = context->intermediate.addSymbol(variable->getUniqueId(), 216 variable->getName(), 217 variable->getType(), 218 @1); 197 variable->getName(), 198 variable->getType(), $1.line); 219 199 } 220 200 ; … … 230 210 // 231 211 if (abs($1.i) >= (1 << 16)) { 232 context->error( @1, " integer constant overflow", "");212 context->error($1.line, " integer constant overflow", ""); 233 213 context->recover(); 234 214 } 235 215 ConstantUnion *unionArray = new ConstantUnion[1]; 236 216 unionArray->setIConst($1.i); 237 $$ = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), @1);217 $$ = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), $1.line); 238 218 } 239 219 | FLOATCONSTANT { 240 220 ConstantUnion *unionArray = new ConstantUnion[1]; 241 221 unionArray->setFConst($1.f); 242 $$ = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConst), @1);222 $$ = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConst), $1.line); 243 223 } 244 224 | BOOLCONSTANT { 245 225 ConstantUnion *unionArray = new ConstantUnion[1]; 246 226 unionArray->setBConst($1.b); 247 $$ = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), @1);227 $$ = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), $1.line); 248 228 } 249 229 | LEFT_PAREN expression RIGHT_PAREN { … … 259 239 if (!$1->isArray() && !$1->isMatrix() && !$1->isVector()) { 260 240 if ($1->getAsSymbolNode()) 261 context->error( @2, " left of '[' is not of type array, matrix, or vector ", $1->getAsSymbolNode()->getSymbol().c_str());241 context->error($2.line, " left of '[' is not of type array, matrix, or vector ", $1->getAsSymbolNode()->getSymbol().c_str()); 262 242 else 263 context->error(@2, " left of '[' is not of type array, matrix, or vector ", "expression"); 264 context->recover(); 265 } 266 if ($3->getQualifier() == EvqConst) { 267 int index = $3->getAsConstantUnion()->getIConst(0); 268 if (index < 0) { 269 std::stringstream infoStream; 270 infoStream << index; 271 std::string info = infoStream.str(); 272 context->error(@3, "negative index", info.c_str()); 273 context->recover(); 274 index = 0; 275 } 276 if ($1->getType().getQualifier() == EvqConst) { 277 if ($1->isArray()) { // constant folding for arrays 278 $$ = context->addConstArrayNode(index, $1, @2); 279 } else if ($1->isVector()) { // constant folding for vectors 280 TVectorFields fields; 281 fields.num = 1; 282 fields.offsets[0] = index; // need to do it this way because v.xy sends fields integer array 283 $$ = context->addConstVectorNode(fields, $1, @2); 284 } else if ($1->isMatrix()) { // constant folding for matrices 285 $$ = context->addConstMatrixNode(index, $1, @2); 243 context->error($2.line, " left of '[' is not of type array, matrix, or vector ", "expression"); 244 context->recover(); 245 } 246 if ($1->getType().getQualifier() == EvqConst && $3->getQualifier() == EvqConst) { 247 if ($1->isArray()) { // constant folding for arrays 248 $$ = context->addConstArrayNode($3->getAsConstantUnion()->getUnionArrayPointer()->getIConst(), $1, $2.line); 249 } else if ($1->isVector()) { // constant folding for vectors 250 TVectorFields fields; 251 fields.num = 1; 252 fields.offsets[0] = $3->getAsConstantUnion()->getUnionArrayPointer()->getIConst(); // need to do it this way because v.xy sends fields integer array 253 $$ = context->addConstVectorNode(fields, $1, $2.line); 254 } else if ($1->isMatrix()) { // constant folding for matrices 255 $$ = context->addConstMatrixNode($3->getAsConstantUnion()->getUnionArrayPointer()->getIConst(), $1, $2.line); 256 } 257 } else { 258 if ($3->getQualifier() == EvqConst) { 259 if (($1->isVector() || $1->isMatrix()) && $1->getType().getNominalSize() <= $3->getAsConstantUnion()->getUnionArrayPointer()->getIConst() && !$1->isArray() ) { 260 std::stringstream extraInfoStream; 261 extraInfoStream << "field selection out of range '" << $3->getAsConstantUnion()->getUnionArrayPointer()->getIConst() << "'"; 262 std::string extraInfo = extraInfoStream.str(); 263 context->error($2.line, "", "[", extraInfo.c_str()); 264 context->recover(); 265 } else { 266 if ($1->isArray()) { 267 if ($1->getType().getArraySize() == 0) { 268 if ($1->getType().getMaxArraySize() <= $3->getAsConstantUnion()->getUnionArrayPointer()->getIConst()) { 269 if (context->arraySetMaxSize($1->getAsSymbolNode(), $1->getTypePointer(), $3->getAsConstantUnion()->getUnionArrayPointer()->getIConst(), true, $2.line)) 270 context->recover(); 271 } else { 272 if (context->arraySetMaxSize($1->getAsSymbolNode(), $1->getTypePointer(), 0, false, $2.line)) 273 context->recover(); 274 } 275 } else if ( $3->getAsConstantUnion()->getUnionArrayPointer()->getIConst() >= $1->getType().getArraySize()) { 276 std::stringstream extraInfoStream; 277 extraInfoStream << "array index out of range '" << $3->getAsConstantUnion()->getUnionArrayPointer()->getIConst() << "'"; 278 std::string extraInfo = extraInfoStream.str(); 279 context->error($2.line, "", "[", extraInfo.c_str()); 280 context->recover(); 281 } 282 } 283 $$ = context->intermediate.addIndex(EOpIndexDirect, $1, $3, $2.line); 286 284 } 287 285 } else { 288 if ($1->isArray()) { 289 if (index >= $1->getType().getArraySize()) { 290 std::stringstream extraInfoStream; 291 extraInfoStream << "array index out of range '" << index << "'"; 292 std::string extraInfo = extraInfoStream.str(); 293 context->error(@2, "", "[", extraInfo.c_str()); 294 context->recover(); 295 index = $1->getType().getArraySize() - 1; 296 } 297 } else if (($1->isVector() || $1->isMatrix()) && $1->getType().getNominalSize() <= index) { 298 std::stringstream extraInfoStream; 299 extraInfoStream << "field selection out of range '" << index << "'"; 300 std::string extraInfo = extraInfoStream.str(); 301 context->error(@2, "", "[", extraInfo.c_str()); 286 if ($1->isArray() && $1->getType().getArraySize() == 0) { 287 context->error($2.line, "", "[", "array must be redeclared with a size before being indexed with a variable"); 302 288 context->recover(); 303 index = $1->getType().getNominalSize() - 1;304 289 } 305 $3->getAsConstantUnion()->getUnionArrayPointer()->setIConst(index); 306 $$ = context->intermediate.addIndex(EOpIndexDirect, $1, $3, @2); 307 } 308 } else { 309 $$ = context->intermediate.addIndex(EOpIndexIndirect, $1, $3, @2); 290 291 $$ = context->intermediate.addIndex(EOpIndexIndirect, $1, $3, $2.line); 292 } 310 293 } 311 294 if ($$ == 0) { 312 295 ConstantUnion *unionArray = new ConstantUnion[1]; 313 296 unionArray->setFConst(0.0f); 314 $$ = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpHigh, EvqConst), @2);297 $$ = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpHigh, EvqConst), $2.line); 315 298 } else if ($1->isArray()) { 316 299 if ($1->getType().getStruct()) 317 $$->setType(TType($1->getType().getStruct() ));300 $$->setType(TType($1->getType().getStruct(), $1->getType().getTypeName())); 318 301 else 319 302 $$->setType(TType($1->getBasicType(), $1->getPrecision(), EvqTemporary, $1->getNominalSize(), $1->isMatrix())); … … 321 304 if ($1->getType().getQualifier() == EvqConst) 322 305 $$->getTypePointer()->setQualifier(EvqConst); 323 } else if ($1->isMatrix()) { 324 TQualifier qualifier = $1->getType().getQualifier() == EvqConst ? EvqConst : EvqTemporary; 325 $$->setType(TType($1->getBasicType(), $1->getPrecision(), qualifier, $1->getNominalSize())); 326 } else if ($1->isVector()) { 327 TQualifier qualifier = $1->getType().getQualifier() == EvqConst ? EvqConst : EvqTemporary; 328 $$->setType(TType($1->getBasicType(), $1->getPrecision(), qualifier)); 329 } else { 306 } else if ($1->isMatrix() && $1->getType().getQualifier() == EvqConst) 307 $$->setType(TType($1->getBasicType(), $1->getPrecision(), EvqConst, $1->getNominalSize())); 308 else if ($1->isMatrix()) 309 $$->setType(TType($1->getBasicType(), $1->getPrecision(), EvqTemporary, $1->getNominalSize())); 310 else if ($1->isVector() && $1->getType().getQualifier() == EvqConst) 311 $$->setType(TType($1->getBasicType(), $1->getPrecision(), EvqConst)); 312 else if ($1->isVector()) 313 $$->setType(TType($1->getBasicType(), $1->getPrecision(), EvqTemporary)); 314 else 330 315 $$->setType($1->getType()); 331 }332 316 } 333 317 | function_call { 334 318 $$ = $1; 335 319 } 336 | postfix_expression DOT identifier{320 | postfix_expression DOT FIELD_SELECTION { 337 321 if ($1->isArray()) { 338 context->error( @3, "cannot apply dot operator to an array", ".");322 context->error($3.line, "cannot apply dot operator to an array", "."); 339 323 context->recover(); 340 324 } … … 342 326 if ($1->isVector()) { 343 327 TVectorFields fields; 344 if (! context->parseVectorFields(*$3.string, $1->getNominalSize(), fields, @3)) {328 if (! context->parseVectorFields(*$3.string, $1->getNominalSize(), fields, $3.line)) { 345 329 fields.num = 1; 346 330 fields.offsets[0] = 0; … … 349 333 350 334 if ($1->getType().getQualifier() == EvqConst) { // constant folding for vector fields 351 $$ = context->addConstVectorNode(fields, $1, @3);335 $$ = context->addConstVectorNode(fields, $1, $3.line); 352 336 if ($$ == 0) { 353 337 context->recover(); … … 358 342 } else { 359 343 TString vectorString = *$3.string; 360 TIntermTyped* index = context->intermediate.addSwizzle(fields, @3);361 $$ = context->intermediate.addIndex(EOpVectorSwizzle, $1, index, @2);344 TIntermTyped* index = context->intermediate.addSwizzle(fields, $3.line); 345 $$ = context->intermediate.addIndex(EOpVectorSwizzle, $1, index, $2.line); 362 346 $$->setType(TType($1->getBasicType(), $1->getPrecision(), EvqTemporary, (int) vectorString.size())); 363 347 } 364 348 } else if ($1->isMatrix()) { 365 349 TMatrixFields fields; 366 if (! context->parseMatrixFields(*$3.string, $1->getNominalSize(), fields, @3)) {350 if (! context->parseMatrixFields(*$3.string, $1->getNominalSize(), fields, $3.line)) { 367 351 fields.wholeRow = false; 368 352 fields.wholeCol = false; … … 373 357 374 358 if (fields.wholeRow || fields.wholeCol) { 375 context->error( @2, " non-scalar fields not implemented yet", ".");359 context->error($2.line, " non-scalar fields not implemented yet", "."); 376 360 context->recover(); 377 361 ConstantUnion *unionArray = new ConstantUnion[1]; 378 362 unionArray->setIConst(0); 379 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), @3);380 $$ = context->intermediate.addIndex(EOpIndexDirect, $1, index, @2);363 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), $3.line); 364 $$ = context->intermediate.addIndex(EOpIndexDirect, $1, index, $2.line); 381 365 $$->setType(TType($1->getBasicType(), $1->getPrecision(),EvqTemporary, $1->getNominalSize())); 382 366 } else { 383 367 ConstantUnion *unionArray = new ConstantUnion[1]; 384 368 unionArray->setIConst(fields.col * $1->getNominalSize() + fields.row); 385 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), @3);386 $$ = context->intermediate.addIndex(EOpIndexDirect, $1, index, @2);369 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), $3.line); 370 $$ = context->intermediate.addIndex(EOpIndexDirect, $1, index, $2.line); 387 371 $$->setType(TType($1->getBasicType(), $1->getPrecision())); 388 372 } 389 373 } else if ($1->getBasicType() == EbtStruct) { 390 374 bool fieldFound = false; 391 const TFieldList& fields = $1->getType().getStruct()->fields(); 392 unsigned int i; 393 for (i = 0; i < fields.size(); ++i) { 394 if (fields[i]->name() == *$3.string) { 395 fieldFound = true; 396 break; 375 const TTypeList* fields = $1->getType().getStruct(); 376 if (fields == 0) { 377 context->error($2.line, "structure has no fields", "Internal Error"); 378 context->recover(); 379 $$ = $1; 380 } else { 381 unsigned int i; 382 for (i = 0; i < fields->size(); ++i) { 383 if ((*fields)[i].type->getFieldName() == *$3.string) { 384 fieldFound = true; 385 break; 386 } 397 387 } 398 } 399 if (fieldFound) { 400 if ($1->getType().getQualifier() == EvqConst) { 401 $$ = context->addConstStruct(*$3.string, $1, @2); 402 if ($$ == 0) { 403 context->recover(); 404 $$ = $1; 405 } 406 else { 407 $$->setType(*fields[i]->type()); 408 // change the qualifier of the return type, not of the structure field 409 // as the structure definition is shared between various structures. 410 $$->getTypePointer()->setQualifier(EvqConst); 388 if (fieldFound) { 389 if ($1->getType().getQualifier() == EvqConst) { 390 $$ = context->addConstStruct(*$3.string, $1, $2.line); 391 if ($$ == 0) { 392 context->recover(); 393 $$ = $1; 394 } 395 else { 396 $$->setType(*(*fields)[i].type); 397 // change the qualifier of the return type, not of the structure field 398 // as the structure definition is shared between various structures. 399 $$->getTypePointer()->setQualifier(EvqConst); 400 } 401 } else { 402 ConstantUnion *unionArray = new ConstantUnion[1]; 403 unionArray->setIConst(i); 404 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, *(*fields)[i].type, $3.line); 405 $$ = context->intermediate.addIndex(EOpIndexDirectStruct, $1, index, $2.line); 406 $$->setType(*(*fields)[i].type); 411 407 } 412 408 } else { 413 ConstantUnion *unionArray = new ConstantUnion[1]; 414 unionArray->setIConst(i); 415 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, *fields[i]->type(), @3); 416 $$ = context->intermediate.addIndex(EOpIndexDirectStruct, $1, index, @2); 417 $$->setType(*fields[i]->type()); 409 context->error($2.line, " no such field in structure", $3.string->c_str()); 410 context->recover(); 411 $$ = $1; 418 412 } 419 } else {420 context->error(@2, " no such field in structure", $3.string->c_str());421 context->recover();422 $$ = $1;423 413 } 424 414 } else { 425 context->error( @2, " field selection requires structure, vector, or matrix on left hand side", $3.string->c_str());415 context->error($2.line, " field selection requires structure, vector, or matrix on left hand side", $3.string->c_str()); 426 416 context->recover(); 427 417 $$ = $1; … … 430 420 } 431 421 | postfix_expression INC_OP { 432 if (context->lValueErrorCheck( @2, "++", $1))433 context->recover(); 434 $$ = context->intermediate.addUnaryMath(EOpPostIncrement, $1, @2, context->symbolTable);422 if (context->lValueErrorCheck($2.line, "++", $1)) 423 context->recover(); 424 $$ = context->intermediate.addUnaryMath(EOpPostIncrement, $1, $2.line, context->symbolTable); 435 425 if ($$ == 0) { 436 context->unaryOpError( @2, "++", $1->getCompleteString());426 context->unaryOpError($2.line, "++", $1->getCompleteString()); 437 427 context->recover(); 438 428 $$ = $1; … … 440 430 } 441 431 | postfix_expression DEC_OP { 442 if (context->lValueErrorCheck( @2, "--", $1))443 context->recover(); 444 $$ = context->intermediate.addUnaryMath(EOpPostDecrement, $1, @2, context->symbolTable);432 if (context->lValueErrorCheck($2.line, "--", $1)) 433 context->recover(); 434 $$ = context->intermediate.addUnaryMath(EOpPostDecrement, $1, $2.line, context->symbolTable); 445 435 if ($$ == 0) { 446 context->unaryOpError( @2, "--", $1->getCompleteString());436 context->unaryOpError($2.line, "--", $1->getCompleteString()); 447 437 context->recover(); 448 438 $$ = $1; … … 472 462 // 473 463 TType type(EbtVoid, EbpUndefined); // use this to get the type back 474 if (context->constructorErrorCheck( @1, $1.intermNode, *fnCall, op, &type)) {464 if (context->constructorErrorCheck($1.line, $1.intermNode, *fnCall, op, &type)) { 475 465 $$ = 0; 476 466 } else { … … 478 468 // It's a constructor, of type 'type'. 479 469 // 480 $$ = context->addConstructor($1.intermNode, &type, op, fnCall, @1);470 $$ = context->addConstructor($1.intermNode, &type, op, fnCall, $1.line); 481 471 } 482 472 483 473 if ($$ == 0) { 484 474 context->recover(); 485 $$ = context->intermediate.setAggregateOperator(0, op, @1);475 $$ = context->intermediate.setAggregateOperator(0, op, $1.line); 486 476 } 487 477 $$->setType(type); … … 492 482 const TFunction* fnCandidate; 493 483 bool builtIn; 494 fnCandidate = context->findFunction( @1, fnCall, &builtIn);484 fnCandidate = context->findFunction($1.line, fnCall, &builtIn); 495 485 if (fnCandidate) { 496 486 // … … 498 488 // 499 489 if (builtIn && !fnCandidate->getExtension().empty() && 500 context->extensionErrorCheck( @1, fnCandidate->getExtension())) {490 context->extensionErrorCheck($1.line, fnCandidate->getExtension())) { 501 491 context->recover(); 502 492 } … … 510 500 // Treat it like a built-in unary operator. 511 501 // 512 $$ = context->intermediate.addUnaryMath(op, $1.intermNode, @1, context->symbolTable);502 $$ = context->intermediate.addUnaryMath(op, $1.intermNode, 0, context->symbolTable); 513 503 if ($$ == 0) { 514 504 std::stringstream extraInfoStream; … … 519 509 } 520 510 } else { 521 $$ = context->intermediate.setAggregateOperator($1.intermAggregate, op, @1);511 $$ = context->intermediate.setAggregateOperator($1.intermAggregate, op, $1.line); 522 512 } 523 513 } else { 524 514 // This is a real function call 525 515 526 $$ = context->intermediate.setAggregateOperator($1.intermAggregate, EOpFunctionCall, @1);516 $$ = context->intermediate.setAggregateOperator($1.intermAggregate, EOpFunctionCall, $1.line); 527 517 $$->setType(fnCandidate->getReturnType()); 528 518 … … 551 541 ConstantUnion *unionArray = new ConstantUnion[1]; 552 542 unionArray->setFConst(0.0f); 553 $$ = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConst), @1);543 $$ = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConst), $1.line); 554 544 context->recover(); 555 545 } … … 564 554 } 565 555 | postfix_expression DOT function_call_generic { 566 context->error( @3, "methods are not supported", "");556 context->error($3.line, "methods are not supported", ""); 567 557 context->recover(); 568 558 $$ = $3; … … 573 563 : function_call_header_with_parameters RIGHT_PAREN { 574 564 $$ = $1; 565 $$.line = $2.line; 575 566 } 576 567 | function_call_header_no_parameters RIGHT_PAREN { 577 568 $$ = $1; 569 $$.line = $2.line; 578 570 } 579 571 ; … … 601 593 $1.function->addParameter(param); 602 594 $$.function = $1.function; 603 $$.intermNode = context->intermediate.growAggregate($1.intermNode, $3, @2);595 $$.intermNode = context->intermediate.growAggregate($1.intermNode, $3, $2.line); 604 596 } 605 597 ; … … 626 618 if ($1.matrix) { 627 619 switch($1.size) { 628 case 2: op = EOpConstructMat2; break;629 case 3: op = EOpConstructMat3; break;630 case 4: op = EOpConstructMat4; break;620 case 2: op = EOpConstructMat2; break; 621 case 3: op = EOpConstructMat3; break; 622 case 4: op = EOpConstructMat4; break; 631 623 } 632 624 } else { 633 625 switch($1.size) { 634 case 1: op = EOpConstructFloat; break;635 case 2: op = EOpConstructVec2; break;636 case 3: op = EOpConstructVec3; break;637 case 4: op = EOpConstructVec4; break;626 case 1: op = EOpConstructFloat; break; 627 case 2: op = EOpConstructVec2; break; 628 case 3: op = EOpConstructVec3; break; 629 case 4: op = EOpConstructVec4; break; 638 630 } 639 631 } … … 641 633 case EbtInt: 642 634 switch($1.size) { 643 case 1: op = EOpConstructInt; break;644 case 2: op = EOpConstructIVec2; break;645 case 3: op = EOpConstructIVec3; break;646 case 4: op = EOpConstructIVec4; break;635 case 1: op = EOpConstructInt; break; 636 case 2: FRAG_VERT_ONLY("ivec2", $1.line); op = EOpConstructIVec2; break; 637 case 3: FRAG_VERT_ONLY("ivec3", $1.line); op = EOpConstructIVec3; break; 638 case 4: FRAG_VERT_ONLY("ivec4", $1.line); op = EOpConstructIVec4; break; 647 639 } 648 640 break; 649 641 case EbtBool: 650 642 switch($1.size) { 651 case 1: op = EOpConstructBool; break;652 case 2: op = EOpConstructBVec2; break;653 case 3: op = EOpConstructBVec3; break;654 case 4: op = EOpConstructBVec4; break;643 case 1: op = EOpConstructBool; break; 644 case 2: FRAG_VERT_ONLY("bvec2", $1.line); op = EOpConstructBVec2; break; 645 case 3: FRAG_VERT_ONLY("bvec3", $1.line); op = EOpConstructBVec3; break; 646 case 4: FRAG_VERT_ONLY("bvec4", $1.line); op = EOpConstructBVec4; break; 655 647 } 656 648 break; … … 658 650 } 659 651 if (op == EOpNull) { 660 context->error( @1, "cannot construct this type", getBasicString($1.type));652 context->error($1.line, "cannot construct this type", getBasicString($1.type)); 661 653 context->recover(); 662 654 $1.type = EbtFloat; … … 670 662 } 671 663 | IDENTIFIER { 672 if (context->reservedErrorCheck( @1, *$1.string))664 if (context->reservedErrorCheck($1.line, *$1.string)) 673 665 context->recover(); 674 666 TType type(EbtVoid, EbpUndefined); … … 676 668 $$ = function; 677 669 } 670 | FIELD_SELECTION { 671 if (context->reservedErrorCheck($1.line, *$1.string)) 672 context->recover(); 673 TType type(EbtVoid, EbpUndefined); 674 TFunction *function = new TFunction($1.string, type); 675 $$ = function; 676 } 678 677 ; 679 678 … … 683 682 } 684 683 | INC_OP unary_expression { 685 if (context->lValueErrorCheck( @1, "++", $2))686 context->recover(); 687 $$ = context->intermediate.addUnaryMath(EOpPreIncrement, $2, @1, context->symbolTable);684 if (context->lValueErrorCheck($1.line, "++", $2)) 685 context->recover(); 686 $$ = context->intermediate.addUnaryMath(EOpPreIncrement, $2, $1.line, context->symbolTable); 688 687 if ($$ == 0) { 689 context->unaryOpError( @1, "++", $2->getCompleteString());688 context->unaryOpError($1.line, "++", $2->getCompleteString()); 690 689 context->recover(); 691 690 $$ = $2; … … 693 692 } 694 693 | DEC_OP unary_expression { 695 if (context->lValueErrorCheck( @1, "--", $2))696 context->recover(); 697 $$ = context->intermediate.addUnaryMath(EOpPreDecrement, $2, @1, context->symbolTable);694 if (context->lValueErrorCheck($1.line, "--", $2)) 695 context->recover(); 696 $$ = context->intermediate.addUnaryMath(EOpPreDecrement, $2, $1.line, context->symbolTable); 698 697 if ($$ == 0) { 699 context->unaryOpError( @1, "--", $2->getCompleteString());698 context->unaryOpError($1.line, "--", $2->getCompleteString()); 700 699 context->recover(); 701 700 $$ = $2; … … 704 703 | unary_operator unary_expression { 705 704 if ($1.op != EOpNull) { 706 $$ = context->intermediate.addUnaryMath($1.op, $2, @1, context->symbolTable);705 $$ = context->intermediate.addUnaryMath($1.op, $2, $1.line, context->symbolTable); 707 706 if ($$ == 0) { 708 707 const char* errorOp = ""; … … 712 711 default: break; 713 712 } 714 context->unaryOpError( @1, errorOp, $2->getCompleteString());713 context->unaryOpError($1.line, errorOp, $2->getCompleteString()); 715 714 context->recover(); 716 715 $$ = $2; … … 723 722 724 723 unary_operator 725 : PLUS { $$. op = EOpNull; }726 | DASH { $$. op = EOpNegative; }727 | BANG { $$. op = EOpLogicalNot; }724 : PLUS { $$.line = $1.line; $$.op = EOpNull; } 725 | DASH { $$.line = $1.line; $$.op = EOpNegative; } 726 | BANG { $$.line = $1.line; $$.op = EOpLogicalNot; } 728 727 ; 729 728 // Grammar Note: No '*' or '&' unary ops. Pointers are not supported. … … 732 731 : unary_expression { $$ = $1; } 733 732 | multiplicative_expression STAR unary_expression { 734 $$ = context->intermediate.addBinaryMath(EOpMul, $1, $3, @2, context->symbolTable); 733 FRAG_VERT_ONLY("*", $2.line); 734 $$ = context->intermediate.addBinaryMath(EOpMul, $1, $3, $2.line, context->symbolTable); 735 735 if ($$ == 0) { 736 context->binaryOpError( @2, "*", $1->getCompleteString(), $3->getCompleteString());736 context->binaryOpError($2.line, "*", $1->getCompleteString(), $3->getCompleteString()); 737 737 context->recover(); 738 738 $$ = $1; … … 740 740 } 741 741 | multiplicative_expression SLASH unary_expression { 742 $$ = context->intermediate.addBinaryMath(EOpDiv, $1, $3, @2, context->symbolTable); 742 FRAG_VERT_ONLY("/", $2.line); 743 $$ = context->intermediate.addBinaryMath(EOpDiv, $1, $3, $2.line, context->symbolTable); 743 744 if ($$ == 0) { 744 context->binaryOpError( @2, "/", $1->getCompleteString(), $3->getCompleteString());745 context->binaryOpError($2.line, "/", $1->getCompleteString(), $3->getCompleteString()); 745 746 context->recover(); 746 747 $$ = $1; … … 752 753 : multiplicative_expression { $$ = $1; } 753 754 | additive_expression PLUS multiplicative_expression { 754 $$ = context->intermediate.addBinaryMath(EOpAdd, $1, $3, @2, context->symbolTable);755 $$ = context->intermediate.addBinaryMath(EOpAdd, $1, $3, $2.line, context->symbolTable); 755 756 if ($$ == 0) { 756 context->binaryOpError( @2, "+", $1->getCompleteString(), $3->getCompleteString());757 context->binaryOpError($2.line, "+", $1->getCompleteString(), $3->getCompleteString()); 757 758 context->recover(); 758 759 $$ = $1; … … 760 761 } 761 762 | additive_expression DASH multiplicative_expression { 762 $$ = context->intermediate.addBinaryMath(EOpSub, $1, $3, @2, context->symbolTable);763 $$ = context->intermediate.addBinaryMath(EOpSub, $1, $3, $2.line, context->symbolTable); 763 764 if ($$ == 0) { 764 context->binaryOpError( @2, "-", $1->getCompleteString(), $3->getCompleteString());765 context->binaryOpError($2.line, "-", $1->getCompleteString(), $3->getCompleteString()); 765 766 context->recover(); 766 767 $$ = $1; … … 776 777 : shift_expression { $$ = $1; } 777 778 | relational_expression LEFT_ANGLE shift_expression { 778 $$ = context->intermediate.addBinaryMath(EOpLessThan, $1, $3, @2, context->symbolTable);779 $$ = context->intermediate.addBinaryMath(EOpLessThan, $1, $3, $2.line, context->symbolTable); 779 780 if ($$ == 0) { 780 context->binaryOpError( @2, "<", $1->getCompleteString(), $3->getCompleteString());781 context->binaryOpError($2.line, "<", $1->getCompleteString(), $3->getCompleteString()); 781 782 context->recover(); 782 783 ConstantUnion *unionArray = new ConstantUnion[1]; 783 784 unionArray->setBConst(false); 784 $$ = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), @2);785 $$ = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), $2.line); 785 786 } 786 787 } 787 788 | relational_expression RIGHT_ANGLE shift_expression { 788 $$ = context->intermediate.addBinaryMath(EOpGreaterThan, $1, $3, @2, context->symbolTable);789 $$ = context->intermediate.addBinaryMath(EOpGreaterThan, $1, $3, $2.line, context->symbolTable); 789 790 if ($$ == 0) { 790 context->binaryOpError( @2, ">", $1->getCompleteString(), $3->getCompleteString());791 context->binaryOpError($2.line, ">", $1->getCompleteString(), $3->getCompleteString()); 791 792 context->recover(); 792 793 ConstantUnion *unionArray = new ConstantUnion[1]; 793 794 unionArray->setBConst(false); 794 $$ = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), @2);795 $$ = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), $2.line); 795 796 } 796 797 } 797 798 | relational_expression LE_OP shift_expression { 798 $$ = context->intermediate.addBinaryMath(EOpLessThanEqual, $1, $3, @2, context->symbolTable);799 $$ = context->intermediate.addBinaryMath(EOpLessThanEqual, $1, $3, $2.line, context->symbolTable); 799 800 if ($$ == 0) { 800 context->binaryOpError( @2, "<=", $1->getCompleteString(), $3->getCompleteString());801 context->binaryOpError($2.line, "<=", $1->getCompleteString(), $3->getCompleteString()); 801 802 context->recover(); 802 803 ConstantUnion *unionArray = new ConstantUnion[1]; 803 804 unionArray->setBConst(false); 804 $$ = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), @2);805 $$ = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), $2.line); 805 806 } 806 807 } 807 808 | relational_expression GE_OP shift_expression { 808 $$ = context->intermediate.addBinaryMath(EOpGreaterThanEqual, $1, $3, @2, context->symbolTable);809 $$ = context->intermediate.addBinaryMath(EOpGreaterThanEqual, $1, $3, $2.line, context->symbolTable); 809 810 if ($$ == 0) { 810 context->binaryOpError( @2, ">=", $1->getCompleteString(), $3->getCompleteString());811 context->binaryOpError($2.line, ">=", $1->getCompleteString(), $3->getCompleteString()); 811 812 context->recover(); 812 813 ConstantUnion *unionArray = new ConstantUnion[1]; 813 814 unionArray->setBConst(false); 814 $$ = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), @2);815 $$ = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), $2.line); 815 816 } 816 817 } … … 820 821 : relational_expression { $$ = $1; } 821 822 | equality_expression EQ_OP relational_expression { 822 $$ = context->intermediate.addBinaryMath(EOpEqual, $1, $3, @2, context->symbolTable);823 $$ = context->intermediate.addBinaryMath(EOpEqual, $1, $3, $2.line, context->symbolTable); 823 824 if ($$ == 0) { 824 context->binaryOpError( @2, "==", $1->getCompleteString(), $3->getCompleteString());825 context->binaryOpError($2.line, "==", $1->getCompleteString(), $3->getCompleteString()); 825 826 context->recover(); 826 827 ConstantUnion *unionArray = new ConstantUnion[1]; 827 828 unionArray->setBConst(false); 828 $$ = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), @2);829 $$ = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), $2.line); 829 830 } 830 831 } 831 832 | equality_expression NE_OP relational_expression { 832 $$ = context->intermediate.addBinaryMath(EOpNotEqual, $1, $3, @2, context->symbolTable);833 $$ = context->intermediate.addBinaryMath(EOpNotEqual, $1, $3, $2.line, context->symbolTable); 833 834 if ($$ == 0) { 834 context->binaryOpError( @2, "!=", $1->getCompleteString(), $3->getCompleteString());835 context->binaryOpError($2.line, "!=", $1->getCompleteString(), $3->getCompleteString()); 835 836 context->recover(); 836 837 ConstantUnion *unionArray = new ConstantUnion[1]; 837 838 unionArray->setBConst(false); 838 $$ = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), @2);839 $$ = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), $2.line); 839 840 } 840 841 } … … 856 857 : inclusive_or_expression { $$ = $1; } 857 858 | logical_and_expression AND_OP inclusive_or_expression { 858 $$ = context->intermediate.addBinaryMath(EOpLogicalAnd, $1, $3, @2, context->symbolTable);859 $$ = context->intermediate.addBinaryMath(EOpLogicalAnd, $1, $3, $2.line, context->symbolTable); 859 860 if ($$ == 0) { 860 context->binaryOpError( @2, "&&", $1->getCompleteString(), $3->getCompleteString());861 context->binaryOpError($2.line, "&&", $1->getCompleteString(), $3->getCompleteString()); 861 862 context->recover(); 862 863 ConstantUnion *unionArray = new ConstantUnion[1]; 863 864 unionArray->setBConst(false); 864 $$ = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), @2);865 $$ = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), $2.line); 865 866 } 866 867 } … … 870 871 : logical_and_expression { $$ = $1; } 871 872 | logical_xor_expression XOR_OP logical_and_expression { 872 $$ = context->intermediate.addBinaryMath(EOpLogicalXor, $1, $3, @2, context->symbolTable);873 $$ = context->intermediate.addBinaryMath(EOpLogicalXor, $1, $3, $2.line, context->symbolTable); 873 874 if ($$ == 0) { 874 context->binaryOpError( @2, "^^", $1->getCompleteString(), $3->getCompleteString());875 context->binaryOpError($2.line, "^^", $1->getCompleteString(), $3->getCompleteString()); 875 876 context->recover(); 876 877 ConstantUnion *unionArray = new ConstantUnion[1]; 877 878 unionArray->setBConst(false); 878 $$ = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), @2);879 $$ = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), $2.line); 879 880 } 880 881 } … … 884 885 : logical_xor_expression { $$ = $1; } 885 886 | logical_or_expression OR_OP logical_xor_expression { 886 $$ = context->intermediate.addBinaryMath(EOpLogicalOr, $1, $3, @2, context->symbolTable);887 $$ = context->intermediate.addBinaryMath(EOpLogicalOr, $1, $3, $2.line, context->symbolTable); 887 888 if ($$ == 0) { 888 context->binaryOpError( @2, "||", $1->getCompleteString(), $3->getCompleteString());889 context->binaryOpError($2.line, "||", $1->getCompleteString(), $3->getCompleteString()); 889 890 context->recover(); 890 891 ConstantUnion *unionArray = new ConstantUnion[1]; 891 892 unionArray->setBConst(false); 892 $$ = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), @2);893 $$ = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), $2.line); 893 894 } 894 895 } … … 898 899 : logical_or_expression { $$ = $1; } 899 900 | logical_or_expression QUESTION expression COLON assignment_expression { 900 if (context->boolErrorCheck( @2, $1))901 context->recover(); 902 903 $$ = context->intermediate.addSelection($1, $3, $5, @2);901 if (context->boolErrorCheck($2.line, $1)) 902 context->recover(); 903 904 $$ = context->intermediate.addSelection($1, $3, $5, $2.line); 904 905 if ($3->getType() != $5->getType()) 905 906 $$ = 0; 906 907 907 908 if ($$ == 0) { 908 context->binaryOpError( @2, ":", $3->getCompleteString(), $5->getCompleteString());909 context->binaryOpError($2.line, ":", $3->getCompleteString(), $5->getCompleteString()); 909 910 context->recover(); 910 911 $$ = $5; … … 916 917 : conditional_expression { $$ = $1; } 917 918 | unary_expression assignment_operator assignment_expression { 918 if (context->lValueErrorCheck( @2, "assign", $1))919 context->recover(); 920 $$ = context->intermediate.addAssign($2.op, $1, $3, @2);919 if (context->lValueErrorCheck($2.line, "assign", $1)) 920 context->recover(); 921 $$ = context->intermediate.addAssign($2.op, $1, $3, $2.line); 921 922 if ($$ == 0) { 922 context->assignError( @2, "assign", $1->getCompleteString(), $3->getCompleteString());923 context->assignError($2.line, "assign", $1->getCompleteString(), $3->getCompleteString()); 923 924 context->recover(); 924 925 $$ = $1; … … 928 929 929 930 assignment_operator 930 : EQUAL { $$.op = EOpAssign; }931 | MUL_ASSIGN { $$.op = EOpMulAssign; }932 | DIV_ASSIGN { $$.op = EOpDivAssign; }933 | ADD_ASSIGN { $$.op = EOpAddAssign; }934 | SUB_ASSIGN { $$.op = EOpSubAssign; }931 : EQUAL { $$.line = $1.line; $$.op = EOpAssign; } 932 | MUL_ASSIGN { FRAG_VERT_ONLY("*=", $1.line); $$.line = $1.line; $$.op = EOpMulAssign; } 933 | DIV_ASSIGN { FRAG_VERT_ONLY("/=", $1.line); $$.line = $1.line; $$.op = EOpDivAssign; } 934 | ADD_ASSIGN { $$.line = $1.line; $$.op = EOpAddAssign; } 935 | SUB_ASSIGN { $$.line = $1.line; $$.op = EOpSubAssign; } 935 936 ; 936 937 … … 940 941 } 941 942 | expression COMMA assignment_expression { 942 $$ = context->intermediate.addComma($1, $3, @2);943 $$ = context->intermediate.addComma($1, $3, $2.line); 943 944 if ($$ == 0) { 944 context->binaryOpError( @2, ",", $1->getCompleteString(), $3->getCompleteString());945 context->binaryOpError($2.line, ",", $1->getCompleteString(), $3->getCompleteString()); 945 946 context->recover(); 946 947 $$ = $3; … … 970 971 if (param.name != 0) 971 972 { 972 TVariable variable(param.name, *param.type);973 TVariable *variable = new TVariable(param.name, *param.type); 973 974 974 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(variable .getUniqueId(), variable.getName(), variable.getType(), @1), @1);975 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(variable->getUniqueId(), variable->getName(), variable->getType(), $1.line), $1.line); 975 976 } 976 977 else 977 978 { 978 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(0, "", *param.type, @1), @1);979 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(0, "", *param.type, $1.line), $1.line); 979 980 } 980 981 } … … 992 993 | PRECISION precision_qualifier type_specifier_no_prec SEMICOLON { 993 994 if (($2 == EbpHigh) && (context->shaderType == SH_FRAGMENT_SHADER) && !context->fragmentPrecisionHigh) { 994 context->error( @1, "precision is not supported in fragment shader", "highp");995 context->error($1.line, "precision is not supported in fragment shader", "highp"); 995 996 context->recover(); 996 997 } 997 998 if (!context->symbolTable.setDefaultPrecision( $3, $2 )) { 998 context->error( @1, "illegal type argument for default precision qualifier", getBasicString($3.type));999 context->error($1.line, "illegal type argument for default precision qualifier", getBasicString($3.type)); 999 1000 context->recover(); 1000 1001 } … … 1016 1017 if (prevDec) { 1017 1018 if (prevDec->getReturnType() != $1->getReturnType()) { 1018 context->error( @2, "overloaded functions must have the same return type", $1->getReturnType().getBasicString());1019 context->error($2.line, "overloaded functions must have the same return type", $1->getReturnType().getBasicString()); 1019 1020 context->recover(); 1020 1021 } 1021 1022 for (size_t i = 0; i < prevDec->getParamCount(); ++i) { 1022 1023 if (prevDec->getParam(i).type->getQualifier() != $1->getParam(i).type->getQualifier()) { 1023 context->error( @2, "overloaded functions must have the same parameter qualifiers", $1->getParam(i).type->getQualifierString());1024 context->error($2.line, "overloaded functions must have the same parameter qualifiers", $1->getParam(i).type->getQualifierString()); 1024 1025 context->recover(); 1025 1026 } … … 1033 1034 // 1034 1035 $$.function = $1; 1036 $$.line = $2.line; 1035 1037 1036 1038 // We're at the inner scope level of the function's arguments and body statement. … … 1068 1070 // This parameter > first is void 1069 1071 // 1070 context->error( @2, "cannot be an argument type except for '(void)'", "void");1072 context->error($2.line, "cannot be an argument type except for '(void)'", "void"); 1071 1073 context->recover(); 1072 1074 delete $3.param.type; … … 1082 1084 : fully_specified_type IDENTIFIER LEFT_PAREN { 1083 1085 if ($1.qualifier != EvqGlobal && $1.qualifier != EvqTemporary) { 1084 context->error( @2, "no qualifiers allowed for function return", getQualifierString($1.qualifier));1086 context->error($2.line, "no qualifiers allowed for function return", getQualifierString($1.qualifier)); 1085 1087 context->recover(); 1086 1088 } 1087 1089 // make sure a sampler is not involved as well... 1088 if (context->structQualifierErrorCheck( @2, $1))1090 if (context->structQualifierErrorCheck($2.line, $1)) 1089 1091 context->recover(); 1090 1092 … … 1101 1103 parameter_declarator 1102 1104 // Type + name 1103 : type_specifier identifier{1105 : type_specifier IDENTIFIER { 1104 1106 if ($1.type == EbtVoid) { 1105 context->error( @2, "illegal use of type 'void'", $2.string->c_str());1106 context->recover(); 1107 } 1108 if (context->reservedErrorCheck( @2, *$2.string))1107 context->error($2.line, "illegal use of type 'void'", $2.string->c_str()); 1108 context->recover(); 1109 } 1110 if (context->reservedErrorCheck($2.line, *$2.string)) 1109 1111 context->recover(); 1110 1112 TParameter param = {$2.string, new TType($1)}; 1113 $$.line = $2.line; 1111 1114 $$.param = param; 1112 1115 } 1113 | type_specifier identifierLEFT_BRACKET constant_expression RIGHT_BRACKET {1116 | type_specifier IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET { 1114 1117 // Check that we can make an array out of this type 1115 if (context->arrayTypeErrorCheck( @3, $1))1116 context->recover(); 1117 1118 if (context->reservedErrorCheck( @2, *$2.string))1118 if (context->arrayTypeErrorCheck($3.line, $1)) 1119 context->recover(); 1120 1121 if (context->reservedErrorCheck($2.line, *$2.string)) 1119 1122 context->recover(); 1120 1123 1121 1124 int size; 1122 if (context->arraySizeErrorCheck( @3, $4, size))1125 if (context->arraySizeErrorCheck($3.line, $4, size)) 1123 1126 context->recover(); 1124 1127 $1.setArray(true, size); … … 1126 1129 TType* type = new TType($1); 1127 1130 TParameter param = { $2.string, type }; 1131 $$.line = $2.line; 1128 1132 $$.param = param; 1129 1133 } … … 1141 1145 : type_qualifier parameter_qualifier parameter_declarator { 1142 1146 $$ = $3; 1143 if (context->paramErrorCheck( @3, $1.qualifier, $2, $$.param.type))1147 if (context->paramErrorCheck($3.line, $1.qualifier, $2, $$.param.type)) 1144 1148 context->recover(); 1145 1149 } 1146 1150 | parameter_qualifier parameter_declarator { 1147 1151 $$ = $2; 1148 if (context->parameterSamplerErrorCheck( @2, $1, *$2.param.type))1149 context->recover(); 1150 if (context->paramErrorCheck( @2, EvqTemporary, $1, $$.param.type))1152 if (context->parameterSamplerErrorCheck($2.line, $1, *$2.param.type)) 1153 context->recover(); 1154 if (context->paramErrorCheck($2.line, EvqTemporary, $1, $$.param.type)) 1151 1155 context->recover(); 1152 1156 } … … 1156 1160 | type_qualifier parameter_qualifier parameter_type_specifier { 1157 1161 $$ = $3; 1158 if (context->paramErrorCheck( @3, $1.qualifier, $2, $$.param.type))1162 if (context->paramErrorCheck($3.line, $1.qualifier, $2, $$.param.type)) 1159 1163 context->recover(); 1160 1164 } 1161 1165 | parameter_qualifier parameter_type_specifier { 1162 1166 $$ = $2; 1163 if (context->parameterSamplerErrorCheck( @2, $1, *$2.param.type))1164 context->recover(); 1165 if (context->paramErrorCheck( @2, EvqTemporary, $1, $$.param.type))1167 if (context->parameterSamplerErrorCheck($2.line, $1, *$2.param.type)) 1168 context->recover(); 1169 if (context->paramErrorCheck($2.line, EvqTemporary, $1, $$.param.type)) 1166 1170 context->recover(); 1167 1171 } … … 1194 1198 $$ = $1; 1195 1199 } 1196 | init_declarator_list COMMA identifier{1200 | init_declarator_list COMMA IDENTIFIER { 1197 1201 if ($1.type.type == EbtInvariant && !$3.symbol) 1198 1202 { 1199 context->error( @3, "undeclared identifier declared as invariant", $3.string->c_str());1200 context->recover(); 1201 } 1202 1203 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *$3.string, TType($1.type), @3);1204 $$.intermAggregate = context->intermediate.growAggregate($1.intermNode, symbol, @3);1203 context->error($3.line, "undeclared identifier declared as invariant", $3.string->c_str()); 1204 context->recover(); 1205 } 1206 1207 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *$3.string, TType($1.type), $3.line); 1208 $$.intermAggregate = context->intermediate.growAggregate($1.intermNode, symbol, $3.line); 1205 1209 1206 if (context->structQualifierErrorCheck( @3, $$.type))1207 context->recover(); 1208 1209 if (context->nonInitConstErrorCheck( @3, *$3.string, $$.type, false))1210 if (context->structQualifierErrorCheck($3.line, $$.type)) 1211 context->recover(); 1212 1213 if (context->nonInitConstErrorCheck($3.line, *$3.string, $$.type, false)) 1210 1214 context->recover(); 1211 1215 1212 1216 TVariable* variable = 0; 1213 if (context->nonInitErrorCheck( @3, *$3.string, $$.type, variable))1217 if (context->nonInitErrorCheck($3.line, *$3.string, $$.type, variable)) 1214 1218 context->recover(); 1215 1219 if (symbol && variable) 1216 1220 symbol->setId(variable->getUniqueId()); 1217 1221 } 1218 | init_declarator_list COMMA identifierLEFT_BRACKET RIGHT_BRACKET {1219 if (context->structQualifierErrorCheck( @3, $1.type))1220 context->recover(); 1221 1222 if (context->nonInitConstErrorCheck( @3, *$3.string, $1.type, true))1223 context->recover(); 1224 1225 $$ = $1; 1226 1227 if (context->arrayTypeErrorCheck( @4, $1.type) || context->arrayQualifierErrorCheck(@4, $1.type))1222 | init_declarator_list COMMA IDENTIFIER LEFT_BRACKET RIGHT_BRACKET { 1223 if (context->structQualifierErrorCheck($3.line, $1.type)) 1224 context->recover(); 1225 1226 if (context->nonInitConstErrorCheck($3.line, *$3.string, $1.type, true)) 1227 context->recover(); 1228 1229 $$ = $1; 1230 1231 if (context->arrayTypeErrorCheck($4.line, $1.type) || context->arrayQualifierErrorCheck($4.line, $1.type)) 1228 1232 context->recover(); 1229 1233 else { 1230 1234 $1.type.setArray(true); 1231 1235 TVariable* variable; 1232 if (context->arrayErrorCheck( @4, *$3.string, $1.type, variable))1236 if (context->arrayErrorCheck($4.line, *$3.string, $1.type, variable)) 1233 1237 context->recover(); 1234 1238 } 1235 1239 } 1236 | init_declarator_list COMMA identifierLEFT_BRACKET constant_expression RIGHT_BRACKET {1237 if (context->structQualifierErrorCheck( @3, $1.type))1238 context->recover(); 1239 1240 if (context->nonInitConstErrorCheck( @3, *$3.string, $1.type, true))1241 context->recover(); 1242 1243 $$ = $1; 1244 1245 if (context->arrayTypeErrorCheck( @4, $1.type) || context->arrayQualifierErrorCheck(@4, $1.type))1240 | init_declarator_list COMMA IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET { 1241 if (context->structQualifierErrorCheck($3.line, $1.type)) 1242 context->recover(); 1243 1244 if (context->nonInitConstErrorCheck($3.line, *$3.string, $1.type, true)) 1245 context->recover(); 1246 1247 $$ = $1; 1248 1249 if (context->arrayTypeErrorCheck($4.line, $1.type) || context->arrayQualifierErrorCheck($4.line, $1.type)) 1246 1250 context->recover(); 1247 1251 else { 1248 1252 int size; 1249 if (context->arraySizeErrorCheck( @4, $5, size))1253 if (context->arraySizeErrorCheck($4.line, $5, size)) 1250 1254 context->recover(); 1251 1255 $1.type.setArray(true, size); 1252 1256 TVariable* variable = 0; 1253 if (context->arrayErrorCheck( @4, *$3.string, $1.type, variable))1257 if (context->arrayErrorCheck($4.line, *$3.string, $1.type, variable)) 1254 1258 context->recover(); 1255 1259 TType type = TType($1.type); 1256 1260 type.setArraySize(size); 1257 $$.intermAggregate = context->intermediate.growAggregate($1.intermNode, context->intermediate.addSymbol(variable ? variable->getUniqueId() : 0, *$3.string, type, @3), @3);1258 } 1259 } 1260 | init_declarator_list COMMA identifierEQUAL initializer {1261 if (context->structQualifierErrorCheck( @3, $1.type))1261 $$.intermAggregate = context->intermediate.growAggregate($1.intermNode, context->intermediate.addSymbol(variable ? variable->getUniqueId() : 0, *$3.string, type, $3.line), $3.line); 1262 } 1263 } 1264 | init_declarator_list COMMA IDENTIFIER EQUAL initializer { 1265 if (context->structQualifierErrorCheck($3.line, $1.type)) 1262 1266 context->recover(); 1263 1267 … … 1265 1269 1266 1270 TIntermNode* intermNode; 1267 if (!context->executeInitializer( @3, *$3.string, $1.type, $5, intermNode)) {1271 if (!context->executeInitializer($3.line, *$3.string, $1.type, $5, intermNode)) { 1268 1272 // 1269 1273 // build the intermediate representation 1270 1274 // 1271 1275 if (intermNode) 1272 $$.intermAggregate = context->intermediate.growAggregate($1.intermNode, intermNode, @4);1276 $$.intermAggregate = context->intermediate.growAggregate($1.intermNode, intermNode, $4.line); 1273 1277 else 1274 1278 $$.intermAggregate = $1.intermAggregate; … … 1283 1287 : fully_specified_type { 1284 1288 $$.type = $1; 1285 $$.intermAggregate = context->intermediate.makeAggregate(context->intermediate.addSymbol(0, "", TType($1), @1), @1);1286 } 1287 | fully_specified_type identifier{1288 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *$2.string, TType($1), @2);1289 $$.intermAggregate = context->intermediate.makeAggregate(symbol, @2);1289 $$.intermAggregate = context->intermediate.makeAggregate(context->intermediate.addSymbol(0, "", TType($1), $1.line), $1.line); 1290 } 1291 | fully_specified_type IDENTIFIER { 1292 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *$2.string, TType($1), $2.line); 1293 $$.intermAggregate = context->intermediate.makeAggregate(symbol, $2.line); 1290 1294 1291 if (context->structQualifierErrorCheck( @2, $$.type))1292 context->recover(); 1293 1294 if (context->nonInitConstErrorCheck( @2, *$2.string, $$.type, false))1295 if (context->structQualifierErrorCheck($2.line, $$.type)) 1296 context->recover(); 1297 1298 if (context->nonInitConstErrorCheck($2.line, *$2.string, $$.type, false)) 1295 1299 context->recover(); 1296 1300 … … 1298 1302 1299 1303 TVariable* variable = 0; 1300 if (context->nonInitErrorCheck( @2, *$2.string, $$.type, variable))1304 if (context->nonInitErrorCheck($2.line, *$2.string, $$.type, variable)) 1301 1305 context->recover(); 1302 1306 if (variable && symbol) 1303 1307 symbol->setId(variable->getUniqueId()); 1304 1308 } 1305 | fully_specified_type identifierLEFT_BRACKET RIGHT_BRACKET {1306 context->error( @2, "unsized array declarations not supported", $2.string->c_str());1309 | fully_specified_type IDENTIFIER LEFT_BRACKET RIGHT_BRACKET { 1310 context->error($2.line, "unsized array declarations not supported", $2.string->c_str()); 1307 1311 context->recover(); 1308 1312 1309 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *$2.string, TType($1), @2);1310 $$.intermAggregate = context->intermediate.makeAggregate(symbol, @2);1313 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *$2.string, TType($1), $2.line); 1314 $$.intermAggregate = context->intermediate.makeAggregate(symbol, $2.line); 1311 1315 $$.type = $1; 1312 1316 } 1313 | fully_specified_type identifierLEFT_BRACKET constant_expression RIGHT_BRACKET {1317 | fully_specified_type IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET { 1314 1318 TType type = TType($1); 1315 1319 int size; 1316 if (context->arraySizeErrorCheck( @2, $4, size))1320 if (context->arraySizeErrorCheck($2.line, $4, size)) 1317 1321 context->recover(); 1318 1322 type.setArraySize(size); 1319 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *$2.string, type, @2);1320 $$.intermAggregate = context->intermediate.makeAggregate(symbol, @2);1323 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *$2.string, type, $2.line); 1324 $$.intermAggregate = context->intermediate.makeAggregate(symbol, $2.line); 1321 1325 1322 if (context->structQualifierErrorCheck( @2, $1))1323 context->recover(); 1324 1325 if (context->nonInitConstErrorCheck( @2, *$2.string, $1, true))1326 if (context->structQualifierErrorCheck($2.line, $1)) 1327 context->recover(); 1328 1329 if (context->nonInitConstErrorCheck($2.line, *$2.string, $1, true)) 1326 1330 context->recover(); 1327 1331 1328 1332 $$.type = $1; 1329 1333 1330 if (context->arrayTypeErrorCheck( @3, $1) || context->arrayQualifierErrorCheck(@3, $1))1334 if (context->arrayTypeErrorCheck($3.line, $1) || context->arrayQualifierErrorCheck($3.line, $1)) 1331 1335 context->recover(); 1332 1336 else { 1333 1337 int size; 1334 if (context->arraySizeErrorCheck( @3, $4, size))1338 if (context->arraySizeErrorCheck($3.line, $4, size)) 1335 1339 context->recover(); 1336 1340 1337 1341 $1.setArray(true, size); 1338 1342 TVariable* variable = 0; 1339 if (context->arrayErrorCheck( @3, *$2.string, $1, variable))1343 if (context->arrayErrorCheck($3.line, *$2.string, $1, variable)) 1340 1344 context->recover(); 1341 1345 if (variable && symbol) … … 1343 1347 } 1344 1348 } 1345 | fully_specified_type identifierEQUAL initializer {1346 if (context->structQualifierErrorCheck( @2, $1))1349 | fully_specified_type IDENTIFIER EQUAL initializer { 1350 if (context->structQualifierErrorCheck($2.line, $1)) 1347 1351 context->recover(); 1348 1352 … … 1350 1354 1351 1355 TIntermNode* intermNode; 1352 if (!context->executeInitializer( @2, *$2.string, $1, $4, intermNode)) {1356 if (!context->executeInitializer($2.line, *$2.string, $1, $4, intermNode)) { 1353 1357 // 1354 1358 // Build intermediate representation 1355 1359 // 1356 1360 if(intermNode) 1357 $$.intermAggregate = context->intermediate.makeAggregate(intermNode, @3);1361 $$.intermAggregate = context->intermediate.makeAggregate(intermNode, $3.line); 1358 1362 else 1359 1363 $$.intermAggregate = 0; … … 1364 1368 } 1365 1369 | INVARIANT IDENTIFIER { 1366 VERTEX_ONLY("invariant declaration", @1);1367 if (context->globalErrorCheck( @1, context->symbolTable.atGlobalLevel(), "invariant varying"))1368 context->recover(); 1369 $$.type.setBasic(EbtInvariant, EvqInvariantVaryingOut, @2);1370 VERTEX_ONLY("invariant declaration", $1.line); 1371 if (context->globalErrorCheck($1.line, context->symbolTable.atGlobalLevel(), "invariant varying")) 1372 context->recover(); 1373 $$.type.setBasic(EbtInvariant, EvqInvariantVaryingOut, $2.line); 1370 1374 if (!$2.symbol) 1371 1375 { 1372 context->error( @2, "undeclared identifier declared as invariant", $2.string->c_str());1376 context->error($2.line, "undeclared identifier declared as invariant", $2.string->c_str()); 1373 1377 context->recover(); 1374 1378 … … 1377 1381 else 1378 1382 { 1379 TIntermSymbol *symbol = context->intermediate.addSymbol(0, *$2.string, TType($$.type), @2); 1380 $$.intermAggregate = context->intermediate.makeAggregate(symbol, @2); 1381 } 1382 } 1383 ; 1383 TIntermSymbol *symbol = context->intermediate.addSymbol(0, *$2.string, TType($$.type), $2.line); 1384 $$.intermAggregate = context->intermediate.makeAggregate(symbol, $2.line); 1385 } 1386 } 1387 1388 // 1389 // Place holder for the pack/unpack languages. 1390 // 1391 // | buffer_specifier { 1392 // $$.intermAggregate = 0; 1393 // } 1394 ; 1395 1396 // Grammar Note: No 'enum', or 'typedef'. 1397 1398 // 1399 // Place holder for the pack/unpack languages. 1400 // 1401 //%type <interm> buffer_declaration 1402 //%type <interm.type> buffer_specifier input_or_output buffer_declaration_list 1403 //buffer_specifier 1404 // : input_or_output LEFT_BRACE buffer_declaration_list RIGHT_BRACE { 1405 // } 1406 // ; 1407 // 1408 //input_or_output 1409 // : INPUT { 1410 // if (context->globalErrorCheck($1.line, context->symbolTable.atGlobalLevel(), "input")) 1411 // context->recover(); 1412 // UNPACK_ONLY("input", $1.line); 1413 // $$.qualifier = EvqInput; 1414 // } 1415 // | OUTPUT { 1416 // if (context->globalErrorCheck($1.line, context->symbolTable.atGlobalLevel(), "output")) 1417 // context->recover(); 1418 // PACK_ONLY("output", $1.line); 1419 // $$.qualifier = EvqOutput; 1420 // } 1421 // ; 1422 1423 // 1424 // Place holder for the pack/unpack languages. 1425 // 1426 //buffer_declaration_list 1427 // : buffer_declaration { 1428 // } 1429 // | buffer_declaration_list buffer_declaration { 1430 // } 1431 // ; 1432 1433 // 1434 // Input/output semantics: 1435 // float must be 16 or 32 bits 1436 // float alignment restrictions? 1437 // check for only one input and only one output 1438 // sum of bitfields has to be multiple of 32 1439 // 1440 1441 // 1442 // Place holder for the pack/unpack languages. 1443 // 1444 //buffer_declaration 1445 // : type_specifier IDENTIFIER COLON constant_expression SEMICOLON { 1446 // if (context->reservedErrorCheck($2.line, *$2.string, context)) 1447 // context->recover(); 1448 // $$.variable = new TVariable($2.string, $1); 1449 // if (! context->symbolTable.insert(*$$.variable)) { 1450 // context->error($2.line, "redefinition", $$.variable->getName().c_str()); 1451 // context->recover(); 1452 // // don't have to delete $$.variable, the pool pop will take care of it 1453 // } 1454 // } 1455 // ; 1384 1456 1385 1457 fully_specified_type … … 1388 1460 1389 1461 if ($1.array) { 1390 context->error( @1, "not supported", "first-class array");1462 context->error($1.line, "not supported", "first-class array"); 1391 1463 context->recover(); 1392 1464 $1.setArray(false); … … 1395 1467 | type_qualifier type_specifier { 1396 1468 if ($2.array) { 1397 context->error( @2, "not supported", "first-class array");1469 context->error($2.line, "not supported", "first-class array"); 1398 1470 context->recover(); 1399 1471 $2.setArray(false); … … 1402 1474 if ($1.qualifier == EvqAttribute && 1403 1475 ($2.type == EbtBool || $2.type == EbtInt)) { 1404 context->error( @2, "cannot be bool or int", getQualifierString($1.qualifier));1476 context->error($2.line, "cannot be bool or int", getQualifierString($1.qualifier)); 1405 1477 context->recover(); 1406 1478 } 1407 1479 if (($1.qualifier == EvqVaryingIn || $1.qualifier == EvqVaryingOut) && 1408 1480 ($2.type == EbtBool || $2.type == EbtInt)) { 1409 context->error( @2, "cannot be bool or int", getQualifierString($1.qualifier));1481 context->error($2.line, "cannot be bool or int", getQualifierString($1.qualifier)); 1410 1482 context->recover(); 1411 1483 } … … 1417 1489 type_qualifier 1418 1490 : CONST_QUAL { 1419 $$.setBasic(EbtVoid, EvqConst, @1);1491 $$.setBasic(EbtVoid, EvqConst, $1.line); 1420 1492 } 1421 1493 | ATTRIBUTE { 1422 VERTEX_ONLY("attribute", @1);1423 if (context->globalErrorCheck( @1, context->symbolTable.atGlobalLevel(), "attribute"))1424 context->recover(); 1425 $$.setBasic(EbtVoid, EvqAttribute, @1);1494 VERTEX_ONLY("attribute", $1.line); 1495 if (context->globalErrorCheck($1.line, context->symbolTable.atGlobalLevel(), "attribute")) 1496 context->recover(); 1497 $$.setBasic(EbtVoid, EvqAttribute, $1.line); 1426 1498 } 1427 1499 | VARYING { 1428 if (context->globalErrorCheck( @1, context->symbolTable.atGlobalLevel(), "varying"))1500 if (context->globalErrorCheck($1.line, context->symbolTable.atGlobalLevel(), "varying")) 1429 1501 context->recover(); 1430 1502 if (context->shaderType == SH_VERTEX_SHADER) 1431 $$.setBasic(EbtVoid, EvqVaryingOut, @1);1503 $$.setBasic(EbtVoid, EvqVaryingOut, $1.line); 1432 1504 else 1433 $$.setBasic(EbtVoid, EvqVaryingIn, @1);1505 $$.setBasic(EbtVoid, EvqVaryingIn, $1.line); 1434 1506 } 1435 1507 | INVARIANT VARYING { 1436 if (context->globalErrorCheck( @1, context->symbolTable.atGlobalLevel(), "invariant varying"))1508 if (context->globalErrorCheck($1.line, context->symbolTable.atGlobalLevel(), "invariant varying")) 1437 1509 context->recover(); 1438 1510 if (context->shaderType == SH_VERTEX_SHADER) 1439 $$.setBasic(EbtVoid, EvqInvariantVaryingOut, @1);1511 $$.setBasic(EbtVoid, EvqInvariantVaryingOut, $1.line); 1440 1512 else 1441 $$.setBasic(EbtVoid, EvqInvariantVaryingIn, @1);1513 $$.setBasic(EbtVoid, EvqInvariantVaryingIn, $1.line); 1442 1514 } 1443 1515 | UNIFORM { 1444 if (context->globalErrorCheck( @1, context->symbolTable.atGlobalLevel(), "uniform"))1445 context->recover(); 1446 $$.setBasic(EbtVoid, EvqUniform, @1);1516 if (context->globalErrorCheck($1.line, context->symbolTable.atGlobalLevel(), "uniform")) 1517 context->recover(); 1518 $$.setBasic(EbtVoid, EvqUniform, $1.line); 1447 1519 } 1448 1520 ; … … 1454 1526 if ($$.precision == EbpUndefined) { 1455 1527 $$.precision = context->symbolTable.getDefaultPrecision($1.type); 1456 if (context->precisionErrorCheck( @1, $$.precision, $1.type)) {1528 if (context->precisionErrorCheck($1.line, $$.precision, $1.type)) { 1457 1529 context->recover(); 1458 1530 } … … 1484 1556 $$ = $1; 1485 1557 1486 if (context->arrayTypeErrorCheck( @2, $1))1558 if (context->arrayTypeErrorCheck($2.line, $1)) 1487 1559 context->recover(); 1488 1560 else { 1489 1561 int size; 1490 if (context->arraySizeErrorCheck( @2, $3, size))1562 if (context->arraySizeErrorCheck($2.line, $3, size)) 1491 1563 context->recover(); 1492 1564 $$.setArray(true, size); … … 1498 1570 : VOID_TYPE { 1499 1571 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 1500 $$.setBasic(EbtVoid, qual, @1);1572 $$.setBasic(EbtVoid, qual, $1.line); 1501 1573 } 1502 1574 | FLOAT_TYPE { 1503 1575 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 1504 $$.setBasic(EbtFloat, qual, @1);1576 $$.setBasic(EbtFloat, qual, $1.line); 1505 1577 } 1506 1578 | INT_TYPE { 1507 1579 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 1508 $$.setBasic(EbtInt, qual, @1);1580 $$.setBasic(EbtInt, qual, $1.line); 1509 1581 } 1510 1582 | BOOL_TYPE { 1511 1583 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 1512 $$.setBasic(EbtBool, qual, @1); 1513 } 1584 $$.setBasic(EbtBool, qual, $1.line); 1585 } 1586 // | UNSIGNED INT_TYPE { 1587 // PACK_UNPACK_ONLY("unsigned", $1.line); 1588 // TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 1589 // $$.setBasic(EbtInt, qual, $1.line); 1590 // } 1514 1591 | VEC2 { 1515 1592 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 1516 $$.setBasic(EbtFloat, qual, @1);1593 $$.setBasic(EbtFloat, qual, $1.line); 1517 1594 $$.setAggregate(2); 1518 1595 } 1519 1596 | VEC3 { 1520 1597 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 1521 $$.setBasic(EbtFloat, qual, @1);1598 $$.setBasic(EbtFloat, qual, $1.line); 1522 1599 $$.setAggregate(3); 1523 1600 } 1524 1601 | VEC4 { 1525 1602 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 1526 $$.setBasic(EbtFloat, qual, @1);1603 $$.setBasic(EbtFloat, qual, $1.line); 1527 1604 $$.setAggregate(4); 1528 1605 } 1529 1606 | BVEC2 { 1530 1607 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 1531 $$.setBasic(EbtBool, qual, @1);1608 $$.setBasic(EbtBool, qual, $1.line); 1532 1609 $$.setAggregate(2); 1533 1610 } 1534 1611 | BVEC3 { 1535 1612 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 1536 $$.setBasic(EbtBool, qual, @1);1613 $$.setBasic(EbtBool, qual, $1.line); 1537 1614 $$.setAggregate(3); 1538 1615 } 1539 1616 | BVEC4 { 1540 1617 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 1541 $$.setBasic(EbtBool, qual, @1);1618 $$.setBasic(EbtBool, qual, $1.line); 1542 1619 $$.setAggregate(4); 1543 1620 } 1544 1621 | IVEC2 { 1545 1622 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 1546 $$.setBasic(EbtInt, qual, @1);1623 $$.setBasic(EbtInt, qual, $1.line); 1547 1624 $$.setAggregate(2); 1548 1625 } 1549 1626 | IVEC3 { 1550 1627 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 1551 $$.setBasic(EbtInt, qual, @1);1628 $$.setBasic(EbtInt, qual, $1.line); 1552 1629 $$.setAggregate(3); 1553 1630 } 1554 1631 | IVEC4 { 1555 1632 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 1556 $$.setBasic(EbtInt, qual, @1);1633 $$.setBasic(EbtInt, qual, $1.line); 1557 1634 $$.setAggregate(4); 1558 1635 } 1559 1636 | MATRIX2 { 1637 FRAG_VERT_ONLY("mat2", $1.line); 1560 1638 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 1561 $$.setBasic(EbtFloat, qual, @1);1639 $$.setBasic(EbtFloat, qual, $1.line); 1562 1640 $$.setAggregate(2, true); 1563 1641 } 1564 1642 | MATRIX3 { 1643 FRAG_VERT_ONLY("mat3", $1.line); 1565 1644 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 1566 $$.setBasic(EbtFloat, qual, @1);1645 $$.setBasic(EbtFloat, qual, $1.line); 1567 1646 $$.setAggregate(3, true); 1568 1647 } 1569 1648 | MATRIX4 { 1649 FRAG_VERT_ONLY("mat4", $1.line); 1570 1650 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 1571 $$.setBasic(EbtFloat, qual, @1);1651 $$.setBasic(EbtFloat, qual, $1.line); 1572 1652 $$.setAggregate(4, true); 1573 1653 } 1574 1654 | SAMPLER2D { 1655 FRAG_VERT_ONLY("sampler2D", $1.line); 1575 1656 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 1576 $$.setBasic(EbtSampler2D, qual, @1);1657 $$.setBasic(EbtSampler2D, qual, $1.line); 1577 1658 } 1578 1659 | SAMPLERCUBE { 1660 FRAG_VERT_ONLY("samplerCube", $1.line); 1579 1661 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 1580 $$.setBasic(EbtSamplerCube, qual, @1);1662 $$.setBasic(EbtSamplerCube, qual, $1.line); 1581 1663 } 1582 1664 | SAMPLER_EXTERNAL_OES { 1583 1665 if (!context->supportsExtension("GL_OES_EGL_image_external")) { 1584 context->error(@1, "unsupported type", "samplerExternalOES"); 1585 context->recover(); 1586 } 1666 context->error($1.line, "unsupported type", "samplerExternalOES"); 1667 context->recover(); 1668 } 1669 FRAG_VERT_ONLY("samplerExternalOES", $1.line); 1587 1670 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 1588 $$.setBasic(EbtSamplerExternalOES, qual, @1);1671 $$.setBasic(EbtSamplerExternalOES, qual, $1.line); 1589 1672 } 1590 1673 | SAMPLER2DRECT { 1591 1674 if (!context->supportsExtension("GL_ARB_texture_rectangle")) { 1592 context->error(@1, "unsupported type", "sampler2DRect"); 1593 context->recover(); 1594 } 1675 context->error($1.line, "unsupported type", "sampler2DRect"); 1676 context->recover(); 1677 } 1678 FRAG_VERT_ONLY("sampler2DRect", $1.line); 1595 1679 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 1596 $$.setBasic(EbtSampler2DRect, qual, @1);1680 $$.setBasic(EbtSampler2DRect, qual, $1.line); 1597 1681 } 1598 1682 | struct_specifier { 1683 FRAG_VERT_ONLY("struct", $1.line); 1599 1684 $$ = $1; 1600 1685 $$.qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; … … 1607 1692 TType& structure = static_cast<TVariable*>($1.symbol)->getType(); 1608 1693 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 1609 $$.setBasic(EbtStruct, qual, @1);1694 $$.setBasic(EbtStruct, qual, $1.line); 1610 1695 $$.userDef = &structure; 1611 1696 } … … 1613 1698 1614 1699 struct_specifier 1615 : STRUCT identifier LEFT_BRACE { if (context->enterStructDeclaration(@2, *$2.string)) context->recover(); } struct_declaration_list RIGHT_BRACE {1616 if (context->reservedErrorCheck( @2, *$2.string))1617 context->recover(); 1618 1619 TType* structure = new TType( new TStructure($2.string, $5));1700 : STRUCT IDENTIFIER LEFT_BRACE { if (context->enterStructDeclaration($2.line, *$2.string)) context->recover(); } struct_declaration_list RIGHT_BRACE { 1701 if (context->reservedErrorCheck($2.line, *$2.string)) 1702 context->recover(); 1703 1704 TType* structure = new TType($5, *$2.string); 1620 1705 TVariable* userTypeDef = new TVariable($2.string, *structure, true); 1621 1706 if (! context->symbolTable.insert(*userTypeDef)) { 1622 context->error( @2, "redefinition", $2.string->c_str(), "struct");1623 context->recover(); 1624 } 1625 $$.setBasic(EbtStruct, EvqTemporary, @1);1707 context->error($2.line, "redefinition", $2.string->c_str(), "struct"); 1708 context->recover(); 1709 } 1710 $$.setBasic(EbtStruct, EvqTemporary, $1.line); 1626 1711 $$.userDef = structure; 1627 1712 context->exitStructDeclaration(); 1628 1713 } 1629 | STRUCT LEFT_BRACE { if (context->enterStructDeclaration( @2, *$2.string)) context->recover(); } struct_declaration_list RIGHT_BRACE {1630 TType* structure = new TType( new TStructure(NewPoolTString(""), $4));1631 $$.setBasic(EbtStruct, EvqTemporary, @1);1714 | STRUCT LEFT_BRACE { if (context->enterStructDeclaration($2.line, *$2.string)) context->recover(); } struct_declaration_list RIGHT_BRACE { 1715 TType* structure = new TType($4, TString("")); 1716 $$.setBasic(EbtStruct, EvqTemporary, $1.line); 1632 1717 $$.userDef = structure; 1633 1718 context->exitStructDeclaration(); … … 1641 1726 | struct_declaration_list struct_declaration { 1642 1727 $$ = $1; 1643 for (size_t i = 0; i < $2->size(); ++i) { 1644 TField* field = (*$2)[i]; 1645 for (size_t j = 0; j < $$->size(); ++j) { 1646 if ((*$$)[j]->name() == field->name()) { 1647 context->error(@2, "duplicate field name in structure:", "struct", field->name().c_str()); 1728 for (unsigned int i = 0; i < $2->size(); ++i) { 1729 for (unsigned int j = 0; j < $$->size(); ++j) { 1730 if ((*$$)[j].type->getFieldName() == (*$2)[i].type->getFieldName()) { 1731 context->error((*$2)[i].line, "duplicate field name in structure:", "struct", (*$2)[i].type->getFieldName().c_str()); 1648 1732 context->recover(); 1649 1733 } 1650 1734 } 1651 $$->push_back( field);1735 $$->push_back((*$2)[i]); 1652 1736 } 1653 1737 } … … 1658 1742 $$ = $2; 1659 1743 1660 if (context->voidErrorCheck( @1, (*$2)[0]->name(), $1)) {1744 if (context->voidErrorCheck($1.line, (*$2)[0].type->getFieldName(), $1)) { 1661 1745 context->recover(); 1662 1746 } … … 1665 1749 // Careful not to replace already known aspects of type, like array-ness 1666 1750 // 1667 TType* type = (*$$)[i] ->type();1751 TType* type = (*$$)[i].type; 1668 1752 type->setBasicType($1.type); 1669 1753 type->setNominalSize($1.size); … … 1673 1757 // don't allow arrays of arrays 1674 1758 if (type->isArray()) { 1675 if (context->arrayTypeErrorCheck( @1, $1))1759 if (context->arrayTypeErrorCheck($1.line, $1)) 1676 1760 context->recover(); 1677 1761 } 1678 1762 if ($1.array) 1679 1763 type->setArraySize($1.arraySize); 1680 if ($1.userDef) 1764 if ($1.userDef) { 1681 1765 type->setStruct($1.userDef->getStruct()); 1682 1683 if (context->structNestingErrorCheck(@1, *(*$$)[i])) 1766 type->setTypeName($1.userDef->getTypeName()); 1767 } 1768 1769 if (context->structNestingErrorCheck($1.line, *type)) { 1684 1770 context->recover(); 1771 } 1685 1772 } 1686 1773 } … … 1689 1776 struct_declarator_list 1690 1777 : struct_declarator { 1691 $$ = NewPoolT FieldList();1778 $$ = NewPoolTTypeList(); 1692 1779 $$->push_back($1); 1693 1780 } … … 1698 1785 1699 1786 struct_declarator 1700 : identifier { 1701 if (context->reservedErrorCheck(@1, *$1.string)) 1702 context->recover(); 1703 1704 TType* type = new TType(EbtVoid, EbpUndefined); 1705 $$ = new TField(type, $1.string); 1706 } 1707 | identifier LEFT_BRACKET constant_expression RIGHT_BRACKET { 1708 if (context->reservedErrorCheck(@1, *$1.string)) 1709 context->recover(); 1710 1711 TType* type = new TType(EbtVoid, EbpUndefined); 1712 int size = 0; 1713 if (context->arraySizeErrorCheck(@3, $3, size)) 1714 context->recover(); 1715 type->setArraySize(size); 1716 1717 $$ = new TField(type, $1.string); 1787 : IDENTIFIER { 1788 if (context->reservedErrorCheck($1.line, *$1.string)) 1789 context->recover(); 1790 1791 $$.type = new TType(EbtVoid, EbpUndefined); 1792 $$.line = $1.line; 1793 $$.type->setFieldName(*$1.string); 1794 } 1795 | IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET { 1796 if (context->reservedErrorCheck($1.line, *$1.string)) 1797 context->recover(); 1798 1799 $$.type = new TType(EbtVoid, EbpUndefined); 1800 $$.line = $1.line; 1801 $$.type->setFieldName(*$1.string); 1802 1803 int size; 1804 if (context->arraySizeErrorCheck($2.line, $3, size)) 1805 context->recover(); 1806 $$.type->setArraySize(size); 1718 1807 } 1719 1808 ; … … 1747 1836 if ($3 != 0) { 1748 1837 $3->setOp(EOpSequence); 1749 $3->set Line(@$);1838 $3->setEndLine($5.line); 1750 1839 } 1751 1840 $$ = $3; … … 1771 1860 if ($2) { 1772 1861 $2->setOp(EOpSequence); 1773 $2->set Line(@$);1862 $2->setEndLine($3.line); 1774 1863 } 1775 1864 $$ = $2; … … 1779 1868 statement_list 1780 1869 : statement { 1781 $$ = context->intermediate.makeAggregate($1, @$);1870 $$ = context->intermediate.makeAggregate($1, 0); 1782 1871 } 1783 1872 | statement_list statement { 1784 $$ = context->intermediate.growAggregate($1, $2, @$);1873 $$ = context->intermediate.growAggregate($1, $2, 0); 1785 1874 } 1786 1875 ; … … 1793 1882 selection_statement 1794 1883 : IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement { 1795 if (context->boolErrorCheck( @1, $3))1796 context->recover(); 1797 $$ = context->intermediate.addSelection($3, $5, @1);1884 if (context->boolErrorCheck($1.line, $3)) 1885 context->recover(); 1886 $$ = context->intermediate.addSelection($3, $5, $1.line); 1798 1887 } 1799 1888 ; … … 1819 1908 context->recover(); 1820 1909 } 1821 | fully_specified_type identifierEQUAL initializer {1910 | fully_specified_type IDENTIFIER EQUAL initializer { 1822 1911 TIntermNode* intermNode; 1823 if (context->structQualifierErrorCheck( @2, $1))1824 context->recover(); 1825 if (context->boolErrorCheck( @2, $1))1826 context->recover(); 1827 1828 if (!context->executeInitializer( @2, *$2.string, $1, $4, intermNode))1912 if (context->structQualifierErrorCheck($2.line, $1)) 1913 context->recover(); 1914 if (context->boolErrorCheck($2.line, $1)) 1915 context->recover(); 1916 1917 if (!context->executeInitializer($2.line, *$2.string, $1, $4, intermNode)) 1829 1918 $$ = $4; 1830 1919 else { … … 1838 1927 : WHILE LEFT_PAREN { context->symbolTable.push(); ++context->loopNestingLevel; } condition RIGHT_PAREN statement_no_new_scope { 1839 1928 context->symbolTable.pop(); 1840 $$ = context->intermediate.addLoop(ELoopWhile, 0, $4, 0, $6, @1);1929 $$ = context->intermediate.addLoop(ELoopWhile, 0, $4, 0, $6, $1.line); 1841 1930 --context->loopNestingLevel; 1842 1931 } 1843 1932 | DO { ++context->loopNestingLevel; } statement_with_scope WHILE LEFT_PAREN expression RIGHT_PAREN SEMICOLON { 1844 if (context->boolErrorCheck( @8, $6))1845 context->recover(); 1846 1847 $$ = context->intermediate.addLoop(ELoopDoWhile, 0, $6, 0, $3, @4);1933 if (context->boolErrorCheck($8.line, $6)) 1934 context->recover(); 1935 1936 $$ = context->intermediate.addLoop(ELoopDoWhile, 0, $6, 0, $3, $4.line); 1848 1937 --context->loopNestingLevel; 1849 1938 } 1850 1939 | FOR LEFT_PAREN { context->symbolTable.push(); ++context->loopNestingLevel; } for_init_statement for_rest_statement RIGHT_PAREN statement_no_new_scope { 1851 1940 context->symbolTable.pop(); 1852 $$ = context->intermediate.addLoop(ELoopFor, $4, reinterpret_cast<TIntermTyped*>($5.node1), reinterpret_cast<TIntermTyped*>($5.node2), $7, @1);1941 $$ = context->intermediate.addLoop(ELoopFor, $4, reinterpret_cast<TIntermTyped*>($5.node1), reinterpret_cast<TIntermTyped*>($5.node2), $7, $1.line); 1853 1942 --context->loopNestingLevel; 1854 1943 } … … 1887 1976 : CONTINUE SEMICOLON { 1888 1977 if (context->loopNestingLevel <= 0) { 1889 context->error( @1, "continue statement only allowed in loops", "");1890 context->recover(); 1891 } 1892 $$ = context->intermediate.addBranch(EOpContinue, @1);1978 context->error($1.line, "continue statement only allowed in loops", ""); 1979 context->recover(); 1980 } 1981 $$ = context->intermediate.addBranch(EOpContinue, $1.line); 1893 1982 } 1894 1983 | BREAK SEMICOLON { 1895 1984 if (context->loopNestingLevel <= 0) { 1896 context->error( @1, "break statement only allowed in loops", "");1897 context->recover(); 1898 } 1899 $$ = context->intermediate.addBranch(EOpBreak, @1);1985 context->error($1.line, "break statement only allowed in loops", ""); 1986 context->recover(); 1987 } 1988 $$ = context->intermediate.addBranch(EOpBreak, $1.line); 1900 1989 } 1901 1990 | RETURN SEMICOLON { 1902 $$ = context->intermediate.addBranch(EOpReturn, @1);1991 $$ = context->intermediate.addBranch(EOpReturn, $1.line); 1903 1992 if (context->currentFunctionType->getBasicType() != EbtVoid) { 1904 context->error( @1, "non-void function must return a value", "return");1993 context->error($1.line, "non-void function must return a value", "return"); 1905 1994 context->recover(); 1906 1995 } 1907 1996 } 1908 1997 | RETURN expression SEMICOLON { 1909 $$ = context->intermediate.addBranch(EOpReturn, $2, @1);1998 $$ = context->intermediate.addBranch(EOpReturn, $2, $1.line); 1910 1999 context->functionReturnsValue = true; 1911 2000 if (context->currentFunctionType->getBasicType() == EbtVoid) { 1912 context->error( @1, "void function cannot return a value", "return");2001 context->error($1.line, "void function cannot return a value", "return"); 1913 2002 context->recover(); 1914 2003 } else if (*(context->currentFunctionType) != $2->getType()) { 1915 context->error( @1, "function return is not matching type:", "return");2004 context->error($1.line, "function return is not matching type:", "return"); 1916 2005 context->recover(); 1917 2006 } 1918 2007 } 1919 2008 | DISCARD SEMICOLON { 1920 FRAG_ONLY("discard", @1);1921 $$ = context->intermediate.addBranch(EOpKill, @1);2009 FRAG_ONLY("discard", $1.line); 2010 $$ = context->intermediate.addBranch(EOpKill, $1.line); 1922 2011 } 1923 2012 ; … … 1931 2020 } 1932 2021 | translation_unit external_declaration { 1933 $$ = context->intermediate.growAggregate($1, $2, @$);2022 $$ = context->intermediate.growAggregate($1, $2, 0); 1934 2023 context->treeRoot = $$; 1935 2024 } … … 1953 2042 if (builtIn) 1954 2043 { 1955 context->error( @1, "built-in functions cannot be redefined", function->getName().c_str());2044 context->error($1.line, "built-in functions cannot be redefined", function->getName().c_str()); 1956 2045 context->recover(); 1957 2046 } … … 1967 2056 // Then this function already has a body. 1968 2057 // 1969 context->error( @1, "function already has a body", function->getName().c_str());2058 context->error($1.line, "function already has a body", function->getName().c_str()); 1970 2059 context->recover(); 1971 2060 } … … 1977 2066 if (function->getName() == "main") { 1978 2067 if (function->getParamCount() > 0) { 1979 context->error( @1, "function cannot take any parameter(s)", function->getName().c_str());2068 context->error($1.line, "function cannot take any parameter(s)", function->getName().c_str()); 1980 2069 context->recover(); 1981 2070 } 1982 2071 if (function->getReturnType().getBasicType() != EbtVoid) { 1983 context->error( @1, "", function->getReturnType().getBasicString(), "main function cannot return a value");2072 context->error($1.line, "", function->getReturnType().getBasicString(), "main function cannot return a value"); 1984 2073 context->recover(); 1985 2074 } … … 2009 2098 // 2010 2099 if (! context->symbolTable.insert(*variable)) { 2011 context->error( @1, "redefinition", variable->getName().c_str());2100 context->error($1.line, "redefinition", variable->getName().c_str()); 2012 2101 context->recover(); 2013 2102 delete variable; … … 2020 2109 paramNodes, 2021 2110 context->intermediate.addSymbol(variable->getUniqueId(), 2022 variable->getName(), 2023 variable->getType(), 2024 @1), 2025 @1); 2111 variable->getName(), 2112 variable->getType(), $1.line), 2113 $1.line); 2026 2114 } else { 2027 paramNodes = context->intermediate.growAggregate(paramNodes, context->intermediate.addSymbol(0, "", *param.type, @1), @1);2028 } 2029 } 2030 context->intermediate.setAggregateOperator(paramNodes, EOpParameters, @1);2115 paramNodes = context->intermediate.growAggregate(paramNodes, context->intermediate.addSymbol(0, "", *param.type, $1.line), $1.line); 2116 } 2117 } 2118 context->intermediate.setAggregateOperator(paramNodes, EOpParameters, $1.line); 2031 2119 $1.intermAggregate = paramNodes; 2032 2120 context->loopNestingLevel = 0; … … 2036 2124 // May be best done as post process phase on intermediate code 2037 2125 if (context->currentFunctionType->getBasicType() != EbtVoid && ! context->functionReturnsValue) { 2038 context->error( @1, "function does not return a value:", "", $1.function->getName().c_str());2126 context->error($1.line, "function does not return a value:", "", $1.function->getName().c_str()); 2039 2127 context->recover(); 2040 2128 } 2041 2129 2042 $$ = context->intermediate.growAggregate($1.intermAggregate, $3, @$);2043 context->intermediate.setAggregateOperator($$, EOpFunction, @1);2130 $$ = context->intermediate.growAggregate($1.intermAggregate, $3, 0); 2131 context->intermediate.setAggregateOperator($$, EOpFunction, $1.line); 2044 2132 $$->getAsAggregate()->setName($1.function->getMangledName().c_str()); 2045 2133 $$->getAsAggregate()->setType($1.function->getReturnType()); … … 2050 2138 $$->getAsAggregate()->setDebug(context->pragma().debug); 2051 2139 2140 if ($3 && $3->getAsAggregate()) 2141 $$->getAsAggregate()->setEndLine($3->getAsAggregate()->getEndLine()); 2142 2052 2143 context->symbolTable.pop(); 2053 2144 } … … 2055 2146 2056 2147 %% 2057 2058 void yyerror(YYLTYPE* yylloc, TParseContext* context, const char* reason) {2059 context->error(*yylloc, reason, "");2060 context->recover();2061 }2062 2148 2063 2149 int glslang_parse(TParseContext* context) { -
trunk/Source/ThirdParty/ANGLE/src/compiler/glslang_lex.cpp
r152821 r152946 385 385 yyg->yy_c_buf_p = yy_cp; 386 386 387 #define YY_NUM_RULES 1 47388 #define YY_END_OF_BUFFER 1 48387 #define YY_NUM_RULES 155 388 #define YY_END_OF_BUFFER 156 389 389 /* This struct is not used in this scanner, 390 390 but its presence is necessary. */ … … 394 394 flex_int32_t yy_nxt; 395 395 }; 396 static yyconst flex_int16_t yy_accept[4 43] =396 static yyconst flex_int16_t yy_accept[459] = 397 397 { 0, 398 0, 0, 148, 146, 145, 145, 132, 138, 143, 127, 399 128, 136, 135, 124, 133, 131, 137, 96, 96, 125, 400 121, 139, 126, 140, 144, 93, 129, 130, 142, 93, 401 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 402 93, 93, 93, 93, 93, 93, 93, 93, 93, 122, 403 141, 123, 134, 118, 104, 123, 112, 107, 102, 110, 404 100, 111, 101, 99, 103, 98, 95, 96, 0, 0, 405 130, 122, 129, 119, 115, 117, 116, 120, 93, 108, 406 114, 93, 93, 93, 93, 93, 93, 93, 93, 93, 407 93, 12, 93, 93, 93, 93, 93, 93, 93, 93, 408 409 93, 93, 93, 93, 93, 15, 17, 93, 93, 93, 410 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 411 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 412 93, 93, 93, 93, 109, 113, 0, 98, 0, 0, 413 97, 94, 105, 106, 45, 93, 93, 93, 93, 93, 414 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 415 93, 93, 93, 13, 93, 93, 93, 93, 93, 93, 416 93, 93, 21, 93, 93, 93, 93, 93, 93, 93, 417 93, 18, 93, 93, 93, 93, 93, 93, 93, 93, 418 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 419 420 93, 93, 93, 93, 93, 0, 99, 0, 98, 93, 421 23, 93, 93, 90, 93, 93, 93, 93, 93, 93, 422 93, 16, 48, 93, 93, 93, 64, 93, 93, 53, 423 68, 93, 93, 93, 93, 93, 93, 93, 93, 65, 424 4, 28, 29, 30, 93, 93, 93, 93, 93, 93, 425 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 426 51, 24, 93, 93, 93, 93, 93, 93, 31, 32, 427 33, 22, 93, 93, 93, 10, 37, 38, 39, 46, 428 7, 93, 93, 93, 93, 77, 78, 79, 93, 25, 429 69, 20, 80, 81, 82, 2, 74, 75, 76, 93, 430 431 19, 72, 93, 93, 34, 35, 36, 93, 93, 93, 432 93, 93, 93, 93, 93, 93, 66, 93, 93, 93, 433 93, 93, 93, 93, 93, 47, 93, 92, 93, 93, 434 14, 93, 93, 93, 93, 67, 61, 56, 93, 93, 435 93, 93, 93, 73, 52, 93, 59, 27, 93, 89, 436 60, 44, 71, 54, 93, 93, 93, 93, 93, 93, 437 93, 93, 55, 26, 93, 93, 93, 3, 93, 93, 438 93, 93, 93, 49, 8, 93, 9, 93, 93, 11, 439 62, 93, 93, 93, 57, 93, 93, 93, 93, 93, 440 93, 50, 70, 58, 6, 63, 1, 91, 5, 83, 441 442 40, 84, 93, 93, 93, 93, 93, 93, 93, 93, 443 93, 93, 93, 93, 41, 93, 93, 93, 93, 93, 444 93, 93, 43, 93, 87, 93, 93, 93, 93, 93, 445 85, 93, 86, 93, 93, 93, 93, 93, 93, 42, 446 88, 0 398 0, 0, 0, 0, 0, 0, 156, 154, 153, 153, 399 138, 144, 149, 133, 134, 142, 141, 130, 139, 137, 400 143, 102, 102, 131, 127, 145, 132, 146, 150, 98, 401 135, 136, 148, 98, 98, 98, 98, 98, 98, 98, 402 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 403 98, 98, 98, 128, 147, 129, 140, 3, 4, 3, 404 152, 155, 151, 124, 110, 129, 118, 113, 108, 116, 405 106, 117, 107, 105, 2, 1, 109, 104, 100, 101, 406 0, 0, 102, 136, 128, 135, 125, 121, 123, 122, 407 126, 98, 114, 120, 98, 98, 98, 98, 98, 98, 408 409 98, 98, 98, 98, 17, 98, 98, 98, 98, 98, 410 98, 98, 98, 98, 98, 98, 98, 98, 20, 22, 411 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 412 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 413 98, 98, 98, 98, 98, 98, 98, 115, 119, 5, 414 151, 0, 1, 104, 0, 0, 103, 99, 111, 112, 415 50, 98, 98, 98, 98, 98, 98, 98, 98, 98, 416 98, 98, 98, 98, 98, 98, 98, 98, 98, 18, 417 98, 98, 98, 98, 98, 98, 98, 98, 26, 98, 418 98, 98, 98, 98, 98, 98, 98, 23, 98, 98, 419 420 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 421 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 422 98, 0, 105, 0, 104, 98, 28, 98, 98, 95, 423 98, 98, 98, 98, 98, 98, 98, 21, 53, 98, 424 98, 98, 69, 98, 98, 58, 73, 98, 98, 98, 425 98, 98, 98, 98, 98, 70, 9, 33, 34, 35, 426 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 427 98, 98, 98, 98, 98, 98, 56, 29, 98, 98, 428 98, 98, 98, 98, 36, 37, 38, 27, 98, 98, 429 98, 15, 42, 43, 44, 51, 12, 98, 98, 98, 430 431 98, 82, 83, 84, 98, 30, 74, 25, 85, 86, 432 87, 7, 79, 80, 81, 98, 24, 77, 98, 98, 433 39, 40, 41, 98, 98, 98, 98, 98, 98, 98, 434 98, 98, 71, 98, 98, 98, 98, 98, 98, 98, 435 98, 52, 98, 97, 98, 98, 19, 98, 98, 98, 436 98, 72, 66, 61, 98, 98, 98, 98, 98, 78, 437 57, 98, 64, 32, 98, 94, 65, 49, 76, 59, 438 98, 98, 98, 98, 98, 98, 98, 98, 60, 31, 439 98, 98, 98, 8, 98, 98, 98, 98, 98, 54, 440 13, 98, 14, 98, 98, 16, 67, 98, 98, 98, 441 442 62, 98, 98, 98, 98, 98, 98, 55, 75, 63, 443 11, 68, 6, 96, 10, 88, 45, 89, 98, 98, 444 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 445 46, 98, 98, 98, 98, 98, 98, 98, 48, 98, 446 92, 98, 98, 98, 98, 98, 90, 98, 91, 98, 447 98, 98, 98, 98, 98, 47, 93, 0 447 448 } ; 448 449 … … 481 482 static yyconst flex_int32_t yy_meta[68] = 482 483 { 0, 483 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,484 1, 1, 1, 1, 2, 2, 2, 2, 2, 2,485 2, 1, 1, 1, 1, 1, 1, 2, 2, 2,486 2, 3, 3, 3, 3, 3, 1, 1, 1, 2,487 2, 2, 2, 2, 2, 3, 3, 3, 3, 3,488 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,489 3, 3, 3, 1, 1, 1, 1484 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 485 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 486 3, 1, 1, 1, 1, 1, 1, 3, 3, 3, 487 3, 4, 4, 4, 4, 4, 1, 1, 1, 3, 488 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 489 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 490 4, 4, 4, 1, 1, 1, 1 490 491 } ; 491 492 492 static yyconst flex_int16_t yy_base[4 45] =493 static yyconst flex_int16_t yy_base[464] = 493 494 { 0, 494 0, 0, 587, 588, 588, 588, 561, 43, 64, 588, 495 588, 560, 61, 588, 60, 58, 559, 77, 86, 557, 496 588, 104, 557, 55, 588, 0, 588, 588, 75, 26, 497 57, 82, 83, 73, 93, 528, 97, 95, 527, 44, 498 71, 521, 104, 534, 110, 116, 35, 111, 530, 588, 499 114, 588, 588, 588, 588, 588, 588, 588, 588, 588, 500 588, 588, 588, 165, 588, 172, 202, 211, 233, 0, 501 588, 588, 588, 551, 588, 588, 588, 550, 0, 588, 502 588, 523, 516, 519, 527, 526, 513, 528, 515, 521, 503 509, 506, 519, 506, 503, 503, 509, 497, 108, 502, 504 505 512, 498, 504, 507, 508, 0, 145, 507, 113, 493, 506 506, 497, 499, 489, 503, 500, 502, 485, 490, 487, 507 476, 157, 484, 489, 485, 487, 476, 479, 118, 484, 508 476, 488, 70, 481, 588, 588, 246, 253, 270, 219, 509 283, 0, 588, 588, 0, 473, 477, 486, 483, 467, 510 467, 119, 482, 479, 479, 477, 474, 466, 472, 459, 511 470, 456, 472, 0, 469, 457, 464, 461, 465, 458, 512 447, 446, 459, 462, 459, 454, 445, 188, 450, 453, 513 444, 441, 445, 451, 442, 433, 436, 434, 444, 430, 514 428, 441, 427, 429, 426, 437, 436, 124, 431, 426, 515 516 415, 258, 433, 435, 424, 290, 297, 304, 311, 425, 517 0, 423, 275, 0, 415, 413, 421, 410, 427, 416, 518 316, 0, 0, 410, 420, 420, 0, 405, 319, 0, 519 0, 407, 322, 408, 402, 401, 402, 401, 325, 0, 520 0, 0, 0, 0, 397, 398, 403, 394, 407, 402, 521 401, 393, 397, 389, 392, 396, 401, 387, 399, 390, 522 0, 0, 396, 385, 385, 390, 389, 386, 0, 0, 523 0, 0, 376, 388, 390, 0, 0, 0, 0, 0, 524 0, 378, 379, 373, 383, 0, 0, 0, 374, 0, 525 0, 0, 0, 0, 0, 0, 0, 0, 0, 381, 526 527 0, 0, 379, 375, 0, 0, 0, 371, 367, 372, 528 362, 375, 361, 374, 363, 370, 0, 368, 370, 354, 529 356, 362, 368, 363, 351, 0, 353, 0, 352, 355, 530 0, 344, 343, 343, 356, 0, 358, 0, 357, 356, 531 341, 354, 341, 0, 0, 344, 0, 0, 336, 0, 532 0, 0, 0, 0, 333, 344, 337, 343, 340, 335, 533 327, 339, 0, 0, 332, 339, 328, 0, 337, 334, 534 324, 329, 332, 0, 0, 332, 0, 330, 329, 0, 535 0, 328, 314, 326, 0, 317, 338, 337, 336, 307, 536 303, 0, 0, 0, 0, 0, 0, 0, 0, 328, 537 538 166, 325, 316, 299, 308, 310, 306, 308, 307, 306, 539 309, 306, 256, 253, 0, 228, 238, 222, 235, 203, 540 207, 204, 212, 191, 0, 201, 165, 167, 153, 161, 541 0, 170, 0, 175, 151, 141, 100, 114, 59, 0, 542 0, 588, 359, 113 495 0, 0, 65, 66, 75, 0, 680, 681, 681, 681, 496 654, 45, 137, 681, 681, 653, 134, 681, 133, 131, 497 146, 159, 168, 651, 681, 186, 651, 47, 681, 0, 498 681, 681, 128, 100, 110, 152, 156, 146, 166, 622, 499 173, 109, 621, 126, 177, 615, 178, 628, 187, 184, 500 141, 197, 624, 681, 157, 681, 681, 681, 681, 656, 501 681, 681, 0, 681, 681, 681, 681, 681, 681, 681, 502 681, 681, 681, 236, 681, 0, 681, 243, 273, 282, 503 304, 0, 314, 681, 681, 681, 644, 681, 681, 681, 504 643, 0, 681, 681, 616, 609, 612, 620, 619, 606, 505 506 621, 608, 614, 602, 599, 612, 599, 596, 596, 602, 507 590, 189, 595, 605, 591, 597, 600, 601, 0, 216, 508 600, 188, 586, 599, 590, 592, 582, 596, 593, 595, 509 578, 583, 580, 569, 183, 577, 582, 578, 580, 569, 510 572, 220, 577, 569, 581, 176, 574, 681, 681, 681, 511 0, 331, 0, 344, 361, 290, 374, 0, 681, 681, 512 0, 566, 570, 579, 576, 560, 560, 215, 575, 572, 513 572, 570, 567, 559, 565, 552, 563, 549, 565, 0, 514 562, 550, 557, 554, 558, 551, 540, 539, 552, 555, 515 552, 547, 538, 260, 543, 546, 537, 534, 538, 544, 516 517 535, 526, 529, 527, 537, 523, 521, 534, 520, 522, 518 519, 530, 529, 283, 524, 519, 508, 264, 526, 528, 519 517, 381, 388, 395, 402, 518, 0, 516, 320, 0, 520 508, 506, 514, 503, 520, 509, 336, 0, 0, 503, 521 513, 513, 0, 498, 349, 0, 0, 500, 366, 501, 522 495, 494, 495, 494, 407, 0, 0, 0, 0, 0, 523 490, 491, 496, 487, 500, 495, 494, 486, 490, 482, 524 485, 489, 494, 480, 492, 483, 0, 0, 489, 478, 525 478, 483, 482, 479, 0, 0, 0, 0, 469, 481, 526 483, 0, 0, 0, 0, 0, 0, 471, 472, 466, 527 528 476, 0, 0, 0, 467, 0, 0, 0, 0, 0, 529 0, 0, 0, 0, 0, 474, 0, 0, 472, 468, 530 0, 0, 0, 464, 460, 465, 455, 468, 454, 467, 531 456, 463, 0, 461, 463, 447, 449, 455, 461, 456, 532 444, 0, 446, 0, 445, 448, 0, 437, 436, 436, 533 449, 0, 451, 0, 450, 449, 434, 447, 434, 0, 534 0, 437, 0, 0, 429, 0, 0, 0, 0, 0, 535 426, 437, 430, 436, 433, 428, 420, 432, 0, 0, 536 425, 432, 421, 0, 430, 427, 417, 411, 425, 0, 537 0, 425, 0, 423, 422, 0, 0, 421, 407, 419, 538 539 0, 410, 431, 430, 429, 400, 396, 0, 0, 0, 540 0, 0, 0, 0, 0, 421, 250, 421, 411, 384, 541 392, 394, 390, 392, 391, 390, 393, 390, 391, 388, 542 0, 332, 343, 317, 329, 313, 317, 304, 321, 291, 543 0, 302, 280, 271, 255, 262, 0, 256, 0, 232, 544 206, 212, 148, 159, 113, 0, 0, 681, 442, 444, 545 446, 450, 161 543 546 } ; 544 547 545 static yyconst flex_int16_t yy_def[4 45] =548 static yyconst flex_int16_t yy_def[464] = 546 549 { 0, 547 442, 1, 442, 442, 442, 442, 442, 442, 442, 442, 548 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 549 442, 442, 442, 442, 442, 443, 442, 442, 442, 443, 550 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 551 443, 443, 443, 443, 443, 443, 443, 443, 443, 442, 552 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 553 442, 442, 442, 442, 442, 442, 442, 442, 442, 444, 554 442, 442, 442, 442, 442, 442, 442, 442, 443, 442, 555 442, 443, 443, 443, 443, 443, 443, 443, 443, 443, 556 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 557 558 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 559 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 560 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 561 443, 443, 443, 443, 442, 442, 442, 442, 442, 442, 562 442, 444, 442, 442, 443, 443, 443, 443, 443, 443, 563 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 564 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 565 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 566 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 567 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 568 569 443, 443, 443, 443, 443, 442, 442, 442, 442, 443, 570 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 571 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 572 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 573 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 574 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 575 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 576 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 577 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 578 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 579 580 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 581 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 582 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 583 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 584 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 585 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 586 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 587 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 588 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 589 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 590 591 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 592 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 593 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 594 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 595 443, 0, 442, 442 550 458, 1, 459, 459, 458, 5, 458, 458, 458, 458, 551 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 552 458, 458, 458, 458, 458, 458, 458, 458, 458, 460, 553 458, 458, 458, 460, 460, 460, 460, 460, 460, 460, 554 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 555 460, 460, 460, 458, 458, 458, 458, 458, 458, 458, 556 458, 458, 461, 458, 458, 458, 458, 458, 458, 458, 557 458, 458, 458, 458, 458, 462, 458, 458, 458, 458, 558 458, 463, 458, 458, 458, 458, 458, 458, 458, 458, 559 458, 460, 458, 458, 460, 460, 460, 460, 460, 460, 560 561 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 562 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 563 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 564 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 565 460, 460, 460, 460, 460, 460, 460, 458, 458, 458, 566 461, 458, 462, 458, 458, 458, 458, 463, 458, 458, 567 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 568 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 569 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 570 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 571 572 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 573 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 574 460, 458, 458, 458, 458, 460, 460, 460, 460, 460, 575 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 576 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 577 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 578 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 579 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 580 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 581 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 582 583 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 584 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 585 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 586 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 587 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 588 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 589 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 590 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 591 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 592 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 593 594 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 595 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 596 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 597 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 598 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 599 460, 460, 460, 460, 460, 460, 460, 0, 458, 458, 600 458, 458, 458 596 601 } ; 597 602 598 static yyconst flex_int16_t yy_nxt[ 656] =603 static yyconst flex_int16_t yy_nxt[749] = 599 604 { 0, 600 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 601 14, 15, 16, 17, 18, 19, 19, 19, 19, 19, 602 19, 20, 21, 22, 23, 24, 25, 26, 26, 26, 603 26, 26, 26, 26, 26, 26, 27, 28, 29, 30, 604 31, 32, 33, 34, 35, 36, 37, 38, 26, 39, 605 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 606 26, 26, 26, 50, 51, 52, 53, 55, 56, 57, 607 60, 62, 64, 64, 64, 64, 64, 64, 64, 77, 608 78, 82, 83, 110, 63, 61, 129, 111, 58, 66, 609 130, 67, 67, 67, 67, 67, 67, 68, 66, 80, 610 611 68, 68, 68, 68, 68, 68, 68, 69, 72, 84, 612 112, 85, 70, 81, 142, 86, 69, 203, 441, 204, 613 69, 87, 94, 113, 95, 73, 90, 74, 75, 69, 614 91, 88, 97, 96, 89, 92, 103, 70, 135, 106, 615 98, 93, 99, 115, 104, 100, 107, 162, 440, 119, 616 131, 101, 439, 108, 132, 105, 120, 121, 116, 125, 617 163, 117, 126, 133, 176, 198, 122, 123, 264, 124, 618 127, 438, 177, 199, 216, 217, 265, 128, 136, 64, 619 64, 64, 64, 64, 64, 64, 138, 138, 138, 138, 620 138, 138, 138, 437, 170, 137, 190, 171, 172, 406, 621 622 407, 173, 139, 174, 242, 243, 244, 436, 137, 435, 623 434, 191, 433, 432, 66, 139, 67, 67, 67, 67, 624 67, 67, 68, 66, 431, 68, 68, 68, 68, 68, 625 68, 68, 69, 141, 141, 141, 141, 141, 141, 141, 626 430, 69, 140, 429, 140, 69, 428, 141, 141, 141, 627 141, 141, 141, 141, 69, 206, 427, 206, 426, 425, 628 207, 207, 207, 207, 207, 207, 207, 138, 138, 138, 629 138, 138, 138, 138, 269, 270, 271, 424, 423, 208, 630 422, 208, 421, 139, 209, 209, 209, 209, 209, 209, 631 209, 277, 278, 279, 420, 419, 139, 141, 141, 141, 632 633 141, 141, 141, 141, 207, 207, 207, 207, 207, 207, 634 207, 207, 207, 207, 207, 207, 207, 207, 209, 209, 635 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 636 209, 209, 286, 287, 288, 293, 294, 295, 297, 298, 637 299, 305, 306, 307, 387, 388, 389, 418, 417, 416, 638 415, 414, 413, 412, 411, 410, 409, 390, 408, 391, 639 79, 79, 405, 404, 403, 402, 401, 400, 399, 398, 640 397, 396, 395, 394, 393, 392, 386, 385, 384, 383, 641 382, 381, 380, 379, 378, 377, 376, 375, 374, 373, 642 372, 371, 370, 369, 368, 367, 366, 365, 364, 363, 643 644 362, 361, 360, 359, 358, 357, 356, 355, 354, 353, 645 352, 351, 350, 349, 348, 347, 346, 345, 344, 343, 646 342, 341, 340, 339, 338, 337, 336, 335, 334, 333, 647 332, 331, 330, 329, 328, 327, 326, 325, 324, 323, 648 322, 321, 320, 319, 318, 317, 316, 315, 314, 313, 649 312, 311, 310, 309, 308, 304, 303, 302, 301, 300, 650 296, 292, 291, 290, 289, 285, 284, 283, 282, 281, 651 280, 276, 275, 274, 273, 272, 268, 267, 266, 263, 652 262, 261, 260, 259, 258, 257, 256, 255, 254, 253, 653 252, 251, 250, 249, 248, 247, 246, 245, 241, 240, 654 655 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 656 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 657 219, 218, 215, 214, 213, 212, 211, 210, 205, 202, 658 201, 200, 197, 196, 195, 194, 193, 192, 189, 188, 659 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, 660 175, 169, 168, 167, 166, 165, 164, 161, 160, 159, 661 158, 157, 156, 155, 154, 153, 152, 151, 150, 149, 662 148, 147, 146, 145, 144, 143, 134, 118, 114, 109, 663 102, 76, 71, 65, 59, 54, 442, 3, 442, 442, 664 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 665 666 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 667 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 668 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 669 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 670 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 671 442, 442, 442, 442, 442 605 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 606 18, 19, 20, 21, 22, 23, 23, 23, 23, 23, 607 23, 24, 25, 26, 27, 28, 29, 30, 30, 30, 608 30, 30, 30, 30, 30, 30, 31, 32, 33, 34, 609 35, 36, 37, 38, 39, 40, 41, 42, 30, 43, 610 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 611 30, 30, 30, 54, 55, 56, 57, 59, 59, 65, 612 66, 90, 91, 60, 60, 8, 61, 62, 8, 8, 613 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 614 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 615 616 8, 8, 63, 63, 63, 63, 63, 63, 63, 63, 617 63, 8, 8, 8, 63, 63, 63, 63, 63, 63, 618 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 619 63, 63, 63, 63, 63, 63, 63, 63, 8, 8, 620 8, 8, 67, 70, 72, 74, 74, 74, 74, 74, 621 74, 74, 93, 119, 75, 95, 96, 73, 71, 76, 622 120, 68, 97, 158, 98, 123, 94, 121, 99, 124, 623 77, 78, 457, 79, 79, 79, 79, 79, 79, 80, 624 78, 148, 83, 83, 83, 83, 83, 83, 83, 81, 625 85, 100, 142, 456, 82, 107, 143, 108, 81, 103, 626 627 455, 101, 81, 104, 102, 110, 109, 86, 105, 87, 628 88, 81, 116, 111, 106, 112, 125, 128, 113, 82, 629 117, 149, 206, 219, 114, 220, 132, 138, 178, 126, 630 139, 118, 129, 133, 134, 130, 144, 207, 140, 192, 631 145, 179, 454, 135, 136, 141, 137, 193, 453, 146, 632 74, 74, 74, 74, 74, 74, 74, 154, 154, 154, 633 154, 154, 154, 154, 452, 186, 152, 214, 187, 188, 634 232, 233, 189, 155, 190, 215, 258, 259, 260, 152, 635 285, 286, 287, 422, 423, 78, 155, 79, 79, 79, 636 79, 79, 79, 80, 78, 451, 80, 80, 80, 80, 637 638 80, 80, 80, 81, 157, 157, 157, 157, 157, 157, 639 157, 450, 81, 156, 449, 156, 81, 448, 157, 157, 640 157, 157, 157, 157, 157, 81, 78, 280, 83, 83, 641 83, 83, 83, 83, 83, 281, 293, 294, 295, 447, 642 222, 446, 222, 445, 81, 223, 223, 223, 223, 223, 643 223, 223, 302, 303, 304, 444, 443, 81, 154, 154, 644 154, 154, 154, 154, 154, 309, 310, 311, 442, 441, 645 224, 440, 224, 439, 155, 225, 225, 225, 225, 225, 646 225, 225, 313, 314, 315, 438, 437, 155, 157, 157, 647 157, 157, 157, 157, 157, 223, 223, 223, 223, 223, 648 649 223, 223, 223, 223, 223, 223, 223, 223, 223, 225, 650 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 651 225, 225, 225, 321, 322, 323, 403, 404, 405, 436, 652 435, 434, 433, 432, 431, 430, 429, 428, 427, 406, 653 426, 407, 58, 58, 58, 58, 92, 92, 151, 151, 654 153, 425, 153, 153, 424, 421, 420, 419, 418, 417, 655 416, 415, 414, 413, 412, 411, 410, 409, 408, 402, 656 401, 400, 399, 398, 397, 396, 395, 394, 393, 392, 657 391, 390, 389, 388, 387, 386, 385, 384, 383, 382, 658 381, 380, 379, 378, 377, 376, 375, 374, 373, 372, 659 660 371, 370, 369, 368, 367, 366, 365, 364, 363, 362, 661 361, 360, 359, 358, 357, 356, 355, 354, 353, 352, 662 351, 350, 349, 348, 347, 346, 345, 344, 343, 342, 663 341, 340, 339, 338, 337, 336, 335, 334, 333, 332, 664 331, 330, 329, 328, 327, 326, 325, 324, 320, 319, 665 318, 317, 316, 312, 308, 307, 306, 305, 301, 300, 666 299, 298, 297, 296, 292, 291, 290, 289, 288, 284, 667 283, 282, 279, 278, 277, 276, 275, 274, 273, 272, 668 271, 270, 269, 268, 267, 266, 265, 264, 263, 262, 669 261, 257, 256, 255, 254, 253, 252, 251, 250, 249, 670 671 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 672 238, 237, 236, 235, 234, 231, 230, 229, 228, 227, 673 226, 221, 218, 217, 216, 213, 212, 211, 210, 209, 674 208, 205, 204, 203, 202, 201, 200, 199, 198, 197, 675 196, 195, 194, 191, 185, 184, 183, 182, 181, 180, 676 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, 677 167, 166, 165, 164, 163, 162, 161, 160, 159, 150, 678 147, 131, 127, 122, 115, 89, 84, 69, 64, 458, 679 7, 458, 458, 458, 458, 458, 458, 458, 458, 458, 680 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 681 682 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 683 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 684 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 685 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 686 458, 458, 458, 458, 458, 458, 458, 458 672 687 } ; 673 688 674 static yyconst flex_int16_t yy_chk[ 656] =689 static yyconst flex_int16_t yy_chk[749] = 675 690 { 0, 676 691 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, … … 680 695 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 681 696 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 682 1, 1, 1, 1, 1, 1, 1, 8, 8, 9, 683 13, 15, 16, 16, 16, 16, 16, 16, 16, 24, 684 24, 30, 30, 40, 15, 13, 47, 40, 9, 18, 685 47, 18, 18, 18, 18, 18, 18, 18, 19, 29, 686 687 19, 19, 19, 19, 19, 19, 19, 18, 22, 31, 688 41, 31, 18, 29, 444, 31, 19, 133, 439, 133, 689 18, 32, 34, 41, 34, 22, 33, 22, 22, 19, 690 33, 32, 35, 34, 32, 33, 37, 18, 51, 38, 691 35, 33, 35, 43, 37, 35, 38, 99, 438, 45, 692 48, 35, 437, 38, 48, 37, 45, 45, 43, 46, 693 99, 43, 46, 48, 109, 129, 45, 45, 198, 45, 694 46, 436, 109, 129, 152, 152, 198, 46, 51, 64, 695 64, 64, 64, 64, 64, 64, 66, 66, 66, 66, 696 66, 66, 66, 435, 107, 64, 122, 107, 107, 401, 697 698 401, 107, 66, 107, 178, 178, 178, 434, 64, 432, 699 430, 122, 429, 428, 67, 66, 67, 67, 67, 67, 700 67, 67, 67, 68, 427, 68, 68, 68, 68, 68, 701 68, 68, 67, 140, 140, 140, 140, 140, 140, 140, 702 426, 68, 69, 424, 69, 67, 423, 69, 69, 69, 703 69, 69, 69, 69, 68, 137, 422, 137, 421, 420, 704 137, 137, 137, 137, 137, 137, 137, 138, 138, 138, 705 138, 138, 138, 138, 202, 202, 202, 419, 418, 139, 706 417, 139, 416, 138, 139, 139, 139, 139, 139, 139, 707 139, 213, 213, 213, 414, 413, 138, 141, 141, 141, 708 709 141, 141, 141, 141, 206, 206, 206, 206, 206, 206, 710 206, 207, 207, 207, 207, 207, 207, 207, 208, 208, 711 208, 208, 208, 208, 208, 209, 209, 209, 209, 209, 712 209, 209, 221, 221, 221, 229, 229, 229, 233, 233, 713 233, 239, 239, 239, 372, 372, 372, 412, 411, 410, 714 409, 408, 407, 406, 405, 404, 403, 372, 402, 372, 715 443, 443, 400, 391, 390, 389, 388, 387, 386, 384, 716 383, 382, 379, 378, 376, 373, 371, 370, 369, 367, 717 366, 365, 362, 361, 360, 359, 358, 357, 356, 355, 718 349, 346, 343, 342, 341, 340, 339, 337, 335, 334, 719 720 333, 332, 330, 329, 327, 325, 324, 323, 322, 321, 721 320, 319, 318, 316, 315, 314, 313, 312, 311, 310, 722 309, 308, 304, 303, 300, 289, 285, 284, 283, 282, 723 275, 274, 273, 268, 267, 266, 265, 264, 263, 260, 724 259, 258, 257, 256, 255, 254, 253, 252, 251, 250, 725 249, 248, 247, 246, 245, 238, 237, 236, 235, 234, 726 232, 228, 226, 225, 224, 220, 219, 218, 217, 216, 727 215, 212, 210, 205, 204, 203, 201, 200, 199, 197, 728 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, 729 186, 185, 184, 183, 182, 181, 180, 179, 177, 176, 730 731 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, 732 165, 163, 162, 161, 160, 159, 158, 157, 156, 155, 733 154, 153, 151, 150, 149, 148, 147, 146, 134, 132, 734 131, 130, 128, 127, 126, 125, 124, 123, 121, 120, 735 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 736 108, 105, 104, 103, 102, 101, 100, 98, 97, 96, 737 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 738 85, 84, 83, 82, 78, 74, 49, 44, 42, 39, 739 36, 23, 20, 17, 12, 7, 3, 442, 442, 442, 740 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 741 742 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 743 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 744 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 745 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 746 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 747 442, 442, 442, 442, 442 697 1, 1, 1, 1, 1, 1, 1, 3, 4, 12, 698 12, 28, 28, 3, 4, 5, 5, 5, 5, 5, 699 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 700 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 701 702 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 703 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 704 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 705 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 706 5, 5, 13, 17, 19, 20, 20, 20, 20, 20, 707 20, 20, 33, 42, 21, 34, 34, 19, 17, 21, 708 42, 13, 35, 463, 35, 44, 33, 42, 35, 44, 709 21, 22, 455, 22, 22, 22, 22, 22, 22, 22, 710 23, 55, 23, 23, 23, 23, 23, 23, 23, 22, 711 26, 36, 51, 454, 22, 38, 51, 38, 23, 37, 712 713 453, 36, 22, 37, 36, 39, 38, 26, 37, 26, 714 26, 23, 41, 39, 37, 39, 45, 47, 39, 22, 715 41, 55, 135, 146, 39, 146, 49, 50, 112, 45, 716 50, 41, 47, 49, 49, 47, 52, 135, 50, 122, 717 52, 112, 452, 49, 49, 50, 49, 122, 451, 52, 718 74, 74, 74, 74, 74, 74, 74, 78, 78, 78, 719 78, 78, 78, 78, 450, 120, 74, 142, 120, 120, 720 168, 168, 120, 78, 120, 142, 194, 194, 194, 74, 721 218, 218, 218, 417, 417, 79, 78, 79, 79, 79, 722 79, 79, 79, 79, 80, 448, 80, 80, 80, 80, 723 724 80, 80, 80, 79, 156, 156, 156, 156, 156, 156, 725 156, 446, 80, 81, 445, 81, 79, 444, 81, 81, 726 81, 81, 81, 81, 81, 80, 83, 214, 83, 83, 727 83, 83, 83, 83, 83, 214, 229, 229, 229, 443, 728 152, 442, 152, 440, 83, 152, 152, 152, 152, 152, 729 152, 152, 237, 237, 237, 439, 438, 83, 154, 154, 730 154, 154, 154, 154, 154, 245, 245, 245, 437, 436, 731 155, 435, 155, 434, 154, 155, 155, 155, 155, 155, 732 155, 155, 249, 249, 249, 433, 432, 154, 157, 157, 733 157, 157, 157, 157, 157, 222, 222, 222, 222, 222, 734 735 222, 222, 223, 223, 223, 223, 223, 223, 223, 224, 736 224, 224, 224, 224, 224, 224, 225, 225, 225, 225, 737 225, 225, 225, 255, 255, 255, 388, 388, 388, 430, 738 429, 428, 427, 426, 425, 424, 423, 422, 421, 388, 739 420, 388, 459, 459, 459, 459, 460, 460, 461, 461, 740 462, 419, 462, 462, 418, 416, 407, 406, 405, 404, 741 403, 402, 400, 399, 398, 395, 394, 392, 389, 387, 742 386, 385, 383, 382, 381, 378, 377, 376, 375, 374, 743 373, 372, 371, 365, 362, 359, 358, 357, 356, 355, 744 353, 351, 350, 349, 348, 346, 345, 343, 341, 340, 745 746 339, 338, 337, 336, 335, 334, 332, 331, 330, 329, 747 328, 327, 326, 325, 324, 320, 319, 316, 305, 301, 748 300, 299, 298, 291, 290, 289, 284, 283, 282, 281, 749 280, 279, 276, 275, 274, 273, 272, 271, 270, 269, 750 268, 267, 266, 265, 264, 263, 262, 261, 254, 253, 751 252, 251, 250, 248, 244, 242, 241, 240, 236, 235, 752 234, 233, 232, 231, 228, 226, 221, 220, 219, 217, 753 216, 215, 213, 212, 211, 210, 209, 208, 207, 206, 754 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, 755 195, 193, 192, 191, 190, 189, 188, 187, 186, 185, 756 757 184, 183, 182, 181, 179, 178, 177, 176, 175, 174, 758 173, 172, 171, 170, 169, 167, 166, 165, 164, 163, 759 162, 147, 145, 144, 143, 141, 140, 139, 138, 137, 760 136, 134, 133, 132, 131, 130, 129, 128, 127, 126, 761 125, 124, 123, 121, 118, 117, 116, 115, 114, 113, 762 111, 110, 109, 108, 107, 106, 105, 104, 103, 102, 763 101, 100, 99, 98, 97, 96, 95, 91, 87, 60, 764 53, 48, 46, 43, 40, 27, 24, 16, 11, 7, 765 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 766 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 767 768 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 769 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 770 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 771 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 772 458, 458, 458, 458, 458, 458, 458, 458 748 773 } ; 749 774 750 775 /* Table of booleans, true if rule could match eol. */ 751 static yyconst flex_int32_t yy_rule_can_match_eol[1 48] =776 static yyconst flex_int32_t yy_rule_can_match_eol[156] = 752 777 { 0, 753 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,778 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 754 779 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 755 780 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, … … 758 783 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 759 784 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 760 0, 0, 0, 0, 0, 1, 0, 0, };785 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, }; 761 786 762 787 /* The intent behind this definition is that it'll catch … … 793 818 #endif 794 819 795 #define YY_USER_ACTION \ 796 yylloc->first_file = yylloc->last_file = yycolumn; \ 797 yylloc->first_line = yylloc->last_line = yylineno; 798 820 #define YY_USER_ACTION yylval->lex.line = yylineno; 799 821 #define YY_INPUT(buf, result, max_size) \ 800 822 result = string_input(buf, max_size, yyscanner); … … 805 827 806 828 #define INITIAL 0 829 #define COMMENT 1 830 #define FIELDS 2 807 831 808 832 #define YY_EXTRA_TYPE TParseContext* … … 842 866 YYSTYPE * yylval_r; 843 867 844 YYLTYPE * yylloc_r;845 846 868 }; /* end struct yyguts_t */ 847 869 … … 852 874 # define yylval yyg->yylval_r 853 875 854 # define yylloc yyg->yylloc_r855 856 876 int yylex_init (yyscan_t* scanner); 857 877 … … 891 911 void yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); 892 912 893 YYLTYPE *yyget_lloc (yyscan_t yyscanner );894 895 void yyset_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );896 897 913 /* Macros after this point can all be overridden by user definitions in 898 914 * section 1. … … 925 941 #endif 926 942 943 static void yy_push_state (int new_state ,yyscan_t yyscanner); 944 945 static void yy_pop_state (yyscan_t yyscanner ); 946 947 static int yy_top_state (yyscan_t yyscanner ); 948 927 949 /* Amount of stuff to slurp up with each read. */ 928 950 #ifndef YY_READ_BUF_SIZE … … 1001 1023 1002 1024 extern int yylex \ 1003 (YYSTYPE * yylval_param ,YYLTYPE * yylloc_param,yyscan_t yyscanner);1025 (YYSTYPE * yylval_param ,yyscan_t yyscanner); 1004 1026 1005 1027 #define YY_DECL int yylex \ 1006 (YYSTYPE * yylval_param , YYLTYPE * yylloc_param, yyscan_t yyscanner)1028 (YYSTYPE * yylval_param , yyscan_t yyscanner) 1007 1029 #endif /* !YY_DECL */ 1008 1030 … … 1031 1053 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 1032 1054 1055 TParseContext* context = yyextra; 1056 1057 /* Single-line comments */ 1058 1033 1059 yylval = yylval_param; 1034 1035 yylloc = yylloc_param;1036 1060 1037 1061 if ( !yyg->yy_init ) … … 1086 1110 { 1087 1111 yy_current_state = (int) yy_def[yy_current_state]; 1088 if ( yy_current_state >= 4 43)1112 if ( yy_current_state >= 459 ) 1089 1113 yy_c = yy_meta[(unsigned int) yy_c]; 1090 1114 } … … 1092 1116 ++yy_cp; 1093 1117 } 1094 while ( yy_current_state != 4 42);1118 while ( yy_current_state != 458 ); 1095 1119 yy_cp = yyg->yy_last_accepting_cpos; 1096 1120 yy_current_state = yyg->yy_last_accepting_state; … … 1126 1150 case 1: 1127 1151 YY_RULE_SETUP 1128 { return INVARIANT; } 1129 YY_BREAK 1152 ; 1153 YY_BREAK 1154 /* Multi-line comments */ 1130 1155 case 2: 1131 1156 YY_RULE_SETUP 1132 { return HIGH_PRECISION; }1157 { yy_push_state(COMMENT, yyscanner); } 1133 1158 YY_BREAK 1134 1159 case 3: 1135 YY_RULE_SETUP1136 { return MEDIUM_PRECISION; }1137 YY_BREAK1138 1160 case 4: 1139 YY_RULE_SETUP 1140 { return LOW_PRECISION; } 1161 /* rule 4 can match eol */ 1162 YY_RULE_SETUP 1163 ; 1141 1164 YY_BREAK 1142 1165 case 5: 1143 1166 YY_RULE_SETUP 1144 { return PRECISION; }1167 { yy_pop_state(yyscanner); } 1145 1168 YY_BREAK 1146 1169 case 6: 1147 1170 YY_RULE_SETUP 1148 { return ATTRIBUTE; }1171 { return(INVARIANT); } 1149 1172 YY_BREAK 1150 1173 case 7: 1151 1174 YY_RULE_SETUP 1152 { return CONST_QUAL; }1175 { return(HIGH_PRECISION); } 1153 1176 YY_BREAK 1154 1177 case 8: 1155 1178 YY_RULE_SETUP 1156 { return UNIFORM; }1179 { return(MEDIUM_PRECISION); } 1157 1180 YY_BREAK 1158 1181 case 9: 1159 1182 YY_RULE_SETUP 1160 { return VARYING; }1183 { return(LOW_PRECISION); } 1161 1184 YY_BREAK 1162 1185 case 10: 1163 1186 YY_RULE_SETUP 1164 { return BREAK; }1187 { return(PRECISION); } 1165 1188 YY_BREAK 1166 1189 case 11: 1167 1190 YY_RULE_SETUP 1168 { return CONTINUE; }1191 { return(ATTRIBUTE); } 1169 1192 YY_BREAK 1170 1193 case 12: 1171 1194 YY_RULE_SETUP 1172 { return DO; }1195 { return(CONST_QUAL); } 1173 1196 YY_BREAK 1174 1197 case 13: 1175 1198 YY_RULE_SETUP 1176 { return FOR; }1199 { return(UNIFORM); } 1177 1200 YY_BREAK 1178 1201 case 14: 1179 1202 YY_RULE_SETUP 1180 { return WHILE; }1203 { return(VARYING); } 1181 1204 YY_BREAK 1182 1205 case 15: 1183 1206 YY_RULE_SETUP 1184 { return IF; }1207 { return(BREAK); } 1185 1208 YY_BREAK 1186 1209 case 16: 1187 1210 YY_RULE_SETUP 1188 { return ELSE; }1211 { return(CONTINUE); } 1189 1212 YY_BREAK 1190 1213 case 17: 1191 1214 YY_RULE_SETUP 1192 { return IN_QUAL; }1215 { return(DO); } 1193 1216 YY_BREAK 1194 1217 case 18: 1195 1218 YY_RULE_SETUP 1196 { return OUT_QUAL; }1219 { return(FOR); } 1197 1220 YY_BREAK 1198 1221 case 19: 1199 1222 YY_RULE_SETUP 1200 { return INOUT_QUAL; }1223 { return(WHILE); } 1201 1224 YY_BREAK 1202 1225 case 20: 1203 1226 YY_RULE_SETUP 1204 { return FLOAT_TYPE; }1227 { return(IF); } 1205 1228 YY_BREAK 1206 1229 case 21: 1207 1230 YY_RULE_SETUP 1208 { return INT_TYPE; }1231 { return(ELSE); } 1209 1232 YY_BREAK 1210 1233 case 22: 1211 1234 YY_RULE_SETUP 1212 { return VOID_TYPE; }1235 { return(IN_QUAL); } 1213 1236 YY_BREAK 1214 1237 case 23: 1215 1238 YY_RULE_SETUP 1216 { return BOOL_TYPE; }1239 { return(OUT_QUAL); } 1217 1240 YY_BREAK 1218 1241 case 24: 1219 1242 YY_RULE_SETUP 1220 { yylval->lex.b = true; return BOOLCONSTANT; }1243 { return(INOUT_QUAL); } 1221 1244 YY_BREAK 1222 1245 case 25: 1223 1246 YY_RULE_SETUP 1224 { yylval->lex.b = false; return BOOLCONSTANT; }1247 { context->lexAfterType = true; return(FLOAT_TYPE); } 1225 1248 YY_BREAK 1226 1249 case 26: 1227 1250 YY_RULE_SETUP 1228 { return DISCARD; }1251 { context->lexAfterType = true; return(INT_TYPE); } 1229 1252 YY_BREAK 1230 1253 case 27: 1231 1254 YY_RULE_SETUP 1232 { return RETURN; }1255 { context->lexAfterType = true; return(VOID_TYPE); } 1233 1256 YY_BREAK 1234 1257 case 28: 1235 1258 YY_RULE_SETUP 1236 { return MATRIX2; }1259 { context->lexAfterType = true; return(BOOL_TYPE); } 1237 1260 YY_BREAK 1238 1261 case 29: 1239 1262 YY_RULE_SETUP 1240 { return MATRIX3; }1263 { yylval->lex.b = true; return(BOOLCONSTANT); } 1241 1264 YY_BREAK 1242 1265 case 30: 1243 1266 YY_RULE_SETUP 1244 { return MATRIX4; }1267 { yylval->lex.b = false; return(BOOLCONSTANT); } 1245 1268 YY_BREAK 1246 1269 case 31: 1247 1270 YY_RULE_SETUP 1248 { return VEC2; }1271 { return(DISCARD); } 1249 1272 YY_BREAK 1250 1273 case 32: 1251 1274 YY_RULE_SETUP 1252 { return VEC3; }1275 { return(RETURN); } 1253 1276 YY_BREAK 1254 1277 case 33: 1255 1278 YY_RULE_SETUP 1256 { return VEC4; }1279 { context->lexAfterType = true; return(MATRIX2); } 1257 1280 YY_BREAK 1258 1281 case 34: 1259 1282 YY_RULE_SETUP 1260 { return IVEC2; }1283 { context->lexAfterType = true; return(MATRIX3); } 1261 1284 YY_BREAK 1262 1285 case 35: 1263 1286 YY_RULE_SETUP 1264 { return IVEC3; }1287 { context->lexAfterType = true; return(MATRIX4); } 1265 1288 YY_BREAK 1266 1289 case 36: 1267 1290 YY_RULE_SETUP 1268 { return IVEC4; }1291 { context->lexAfterType = true; return (VEC2); } 1269 1292 YY_BREAK 1270 1293 case 37: 1271 1294 YY_RULE_SETUP 1272 { return BVEC2; }1295 { context->lexAfterType = true; return (VEC3); } 1273 1296 YY_BREAK 1274 1297 case 38: 1275 1298 YY_RULE_SETUP 1276 { return BVEC3; }1299 { context->lexAfterType = true; return (VEC4); } 1277 1300 YY_BREAK 1278 1301 case 39: 1279 1302 YY_RULE_SETUP 1280 { return BVEC4; }1303 { context->lexAfterType = true; return (IVEC2); } 1281 1304 YY_BREAK 1282 1305 case 40: 1283 1306 YY_RULE_SETUP 1284 { return SAMPLER2D; }1307 { context->lexAfterType = true; return (IVEC3); } 1285 1308 YY_BREAK 1286 1309 case 41: 1287 1310 YY_RULE_SETUP 1288 { return SAMPLERCUBE; }1311 { context->lexAfterType = true; return (IVEC4); } 1289 1312 YY_BREAK 1290 1313 case 42: 1291 1314 YY_RULE_SETUP 1292 { return SAMPLER_EXTERNAL_OES; }1315 { context->lexAfterType = true; return (BVEC2); } 1293 1316 YY_BREAK 1294 1317 case 43: 1295 1318 YY_RULE_SETUP 1296 { return SAMPLER2DRECT; }1319 { context->lexAfterType = true; return (BVEC3); } 1297 1320 YY_BREAK 1298 1321 case 44: 1299 1322 YY_RULE_SETUP 1300 { return STRUCT; }1323 { context->lexAfterType = true; return (BVEC4); } 1301 1324 YY_BREAK 1302 1325 case 45: 1303 1326 YY_RULE_SETUP 1304 { return reserved_word(yyscanner); }1327 { context->lexAfterType = true; return SAMPLER2D; } 1305 1328 YY_BREAK 1306 1329 case 46: 1307 1330 YY_RULE_SETUP 1308 { return reserved_word(yyscanner); }1331 { context->lexAfterType = true; return SAMPLERCUBE; } 1309 1332 YY_BREAK 1310 1333 case 47: 1311 1334 YY_RULE_SETUP 1312 { return reserved_word(yyscanner); }1335 { context->lexAfterType = true; return SAMPLER_EXTERNAL_OES; } 1313 1336 YY_BREAK 1314 1337 case 48: 1315 1338 YY_RULE_SETUP 1316 { return reserved_word(yyscanner); }1339 { context->lexAfterType = true; return SAMPLER2DRECT; } 1317 1340 YY_BREAK 1318 1341 case 49: 1319 1342 YY_RULE_SETUP 1320 { return reserved_word(yyscanner); }1343 { context->lexAfterType = true; return(STRUCT); } 1321 1344 YY_BREAK 1322 1345 case 50: … … 1493 1516 YY_BREAK 1494 1517 case 93: 1518 YY_RULE_SETUP 1519 { return reserved_word(yyscanner); } 1520 YY_BREAK 1521 case 94: 1522 YY_RULE_SETUP 1523 { return reserved_word(yyscanner); } 1524 YY_BREAK 1525 case 95: 1526 YY_RULE_SETUP 1527 { return reserved_word(yyscanner); } 1528 YY_BREAK 1529 case 96: 1530 YY_RULE_SETUP 1531 { return reserved_word(yyscanner); } 1532 YY_BREAK 1533 case 97: 1534 YY_RULE_SETUP 1535 { return reserved_word(yyscanner); } 1536 YY_BREAK 1537 case 98: 1495 1538 YY_RULE_SETUP 1496 1539 { … … 1499 1542 } 1500 1543 YY_BREAK 1501 case 94:1502 YY_RULE_SETUP1503 { yylval->lex.i = static_cast<int>(strtol(yytext, 0, 0)); return INTCONSTANT; }1504 YY_BREAK1505 case 95:1506 YY_RULE_SETUP1507 { yylval->lex.i = static_cast<int>(strtol(yytext, 0, 0)); return INTCONSTANT; }1508 YY_BREAK1509 case 96:1510 YY_RULE_SETUP1511 { yylval->lex.i = static_cast<int>(strtol(yytext, 0, 0)); return INTCONSTANT; }1512 YY_BREAK1513 case 97:1514 YY_RULE_SETUP1515 { yylval->lex.f = static_cast<float>(atof_dot(yytext)); return FLOATCONSTANT; }1516 YY_BREAK1517 case 98:1518 YY_RULE_SETUP1519 { yylval->lex.f = static_cast<float>(atof_dot(yytext)); return FLOATCONSTANT; }1520 YY_BREAK1521 1544 case 99: 1522 1545 YY_RULE_SETUP 1523 { yylval->lex. f = static_cast<float>(atof_dot(yytext)); return FLOATCONSTANT; }1546 { yylval->lex.i = static_cast<int>(strtol(yytext, 0, 0)); return(INTCONSTANT); } 1524 1547 YY_BREAK 1525 1548 case 100: 1526 1549 YY_RULE_SETUP 1527 { return ADD_ASSIGN; }1550 { yylval->lex.i = static_cast<int>(strtol(yytext, 0, 0)); return(INTCONSTANT); } 1528 1551 YY_BREAK 1529 1552 case 101: 1530 1553 YY_RULE_SETUP 1531 { return SUB_ASSIGN;}1554 { context->error(yylineno, "Invalid Octal number.", yytext); context->recover(); return 0;} 1532 1555 YY_BREAK 1533 1556 case 102: 1534 1557 YY_RULE_SETUP 1535 { return MUL_ASSIGN; }1558 { yylval->lex.i = static_cast<int>(strtol(yytext, 0, 0)); return(INTCONSTANT); } 1536 1559 YY_BREAK 1537 1560 case 103: 1538 1561 YY_RULE_SETUP 1539 { return DIV_ASSIGN; }1562 { yylval->lex.f = static_cast<float>(atof_dot(yytext)); return(FLOATCONSTANT); } 1540 1563 YY_BREAK 1541 1564 case 104: 1542 1565 YY_RULE_SETUP 1543 { return MOD_ASSIGN; }1566 { yylval->lex.f = static_cast<float>(atof_dot(yytext)); return(FLOATCONSTANT); } 1544 1567 YY_BREAK 1545 1568 case 105: 1546 1569 YY_RULE_SETUP 1547 { return LEFT_ASSIGN; }1570 { yylval->lex.f = static_cast<float>(atof_dot(yytext)); return(FLOATCONSTANT); } 1548 1571 YY_BREAK 1549 1572 case 106: 1550 1573 YY_RULE_SETUP 1551 { return RIGHT_ASSIGN; }1574 { return(ADD_ASSIGN); } 1552 1575 YY_BREAK 1553 1576 case 107: 1554 1577 YY_RULE_SETUP 1555 { return AND_ASSIGN; }1578 { return(SUB_ASSIGN); } 1556 1579 YY_BREAK 1557 1580 case 108: 1558 1581 YY_RULE_SETUP 1559 { return XOR_ASSIGN; }1582 { return(MUL_ASSIGN); } 1560 1583 YY_BREAK 1561 1584 case 109: 1562 1585 YY_RULE_SETUP 1563 { return OR_ASSIGN; }1586 { return(DIV_ASSIGN); } 1564 1587 YY_BREAK 1565 1588 case 110: 1566 1589 YY_RULE_SETUP 1567 { return INC_OP; }1590 { return(MOD_ASSIGN); } 1568 1591 YY_BREAK 1569 1592 case 111: 1570 1593 YY_RULE_SETUP 1571 { return DEC_OP; }1594 { return(LEFT_ASSIGN); } 1572 1595 YY_BREAK 1573 1596 case 112: 1574 1597 YY_RULE_SETUP 1575 { return AND_OP; }1598 { return(RIGHT_ASSIGN); } 1576 1599 YY_BREAK 1577 1600 case 113: 1578 1601 YY_RULE_SETUP 1579 { return OR_OP; }1602 { return(AND_ASSIGN); } 1580 1603 YY_BREAK 1581 1604 case 114: 1582 1605 YY_RULE_SETUP 1583 { return XOR_OP; }1606 { return(XOR_ASSIGN); } 1584 1607 YY_BREAK 1585 1608 case 115: 1586 1609 YY_RULE_SETUP 1587 { return LE_OP; }1610 { return(OR_ASSIGN); } 1588 1611 YY_BREAK 1589 1612 case 116: 1590 1613 YY_RULE_SETUP 1591 { return GE_OP; }1614 { return(INC_OP); } 1592 1615 YY_BREAK 1593 1616 case 117: 1594 1617 YY_RULE_SETUP 1595 { return EQ_OP; }1618 { return(DEC_OP); } 1596 1619 YY_BREAK 1597 1620 case 118: 1598 1621 YY_RULE_SETUP 1599 { return NE_OP; }1622 { return(AND_OP); } 1600 1623 YY_BREAK 1601 1624 case 119: 1602 1625 YY_RULE_SETUP 1603 { return LEFT_OP; }1626 { return(OR_OP); } 1604 1627 YY_BREAK 1605 1628 case 120: 1606 1629 YY_RULE_SETUP 1607 { return RIGHT_OP; }1630 { return(XOR_OP); } 1608 1631 YY_BREAK 1609 1632 case 121: 1610 1633 YY_RULE_SETUP 1611 { return SEMICOLON; }1634 { return(LE_OP); } 1612 1635 YY_BREAK 1613 1636 case 122: 1614 1637 YY_RULE_SETUP 1615 { return LEFT_BRACE; }1638 { return(GE_OP); } 1616 1639 YY_BREAK 1617 1640 case 123: 1618 1641 YY_RULE_SETUP 1619 { return RIGHT_BRACE; }1642 { return(EQ_OP); } 1620 1643 YY_BREAK 1621 1644 case 124: 1622 1645 YY_RULE_SETUP 1623 { return COMMA; }1646 { return(NE_OP); } 1624 1647 YY_BREAK 1625 1648 case 125: 1626 1649 YY_RULE_SETUP 1627 { return COLON; }1650 { return(LEFT_OP); } 1628 1651 YY_BREAK 1629 1652 case 126: 1630 1653 YY_RULE_SETUP 1631 { return EQUAL; }1654 { return(RIGHT_OP); } 1632 1655 YY_BREAK 1633 1656 case 127: 1634 1657 YY_RULE_SETUP 1635 { return LEFT_PAREN; }1658 { context->lexAfterType = false; return(SEMICOLON); } 1636 1659 YY_BREAK 1637 1660 case 128: 1638 1661 YY_RULE_SETUP 1639 { return RIGHT_PAREN; }1662 { context->lexAfterType = false; return(LEFT_BRACE); } 1640 1663 YY_BREAK 1641 1664 case 129: 1642 1665 YY_RULE_SETUP 1643 { return LEFT_BRACKET; }1666 { return(RIGHT_BRACE); } 1644 1667 YY_BREAK 1645 1668 case 130: 1646 1669 YY_RULE_SETUP 1647 { return RIGHT_BRACKET; }1670 { if (context->inTypeParen) context->lexAfterType = false; return(COMMA); } 1648 1671 YY_BREAK 1649 1672 case 131: 1650 1673 YY_RULE_SETUP 1651 { return DOT; }1674 { return(COLON); } 1652 1675 YY_BREAK 1653 1676 case 132: 1654 1677 YY_RULE_SETUP 1655 { return BANG; }1678 { context->lexAfterType = false; return(EQUAL); } 1656 1679 YY_BREAK 1657 1680 case 133: 1658 1681 YY_RULE_SETUP 1659 { return DASH; }1682 { context->lexAfterType = false; context->inTypeParen = true; return(LEFT_PAREN); } 1660 1683 YY_BREAK 1661 1684 case 134: 1662 1685 YY_RULE_SETUP 1663 { return TILDE; }1686 { context->inTypeParen = false; return(RIGHT_PAREN); } 1664 1687 YY_BREAK 1665 1688 case 135: 1666 1689 YY_RULE_SETUP 1667 { return PLUS; }1690 { return(LEFT_BRACKET); } 1668 1691 YY_BREAK 1669 1692 case 136: 1670 1693 YY_RULE_SETUP 1671 { return STAR; }1694 { return(RIGHT_BRACKET); } 1672 1695 YY_BREAK 1673 1696 case 137: 1674 1697 YY_RULE_SETUP 1675 { return SLASH; }1698 { BEGIN(FIELDS); return(DOT); } 1676 1699 YY_BREAK 1677 1700 case 138: 1678 1701 YY_RULE_SETUP 1679 { return PERCENT; }1702 { return(BANG); } 1680 1703 YY_BREAK 1681 1704 case 139: 1682 1705 YY_RULE_SETUP 1683 { return LEFT_ANGLE; }1706 { return(DASH); } 1684 1707 YY_BREAK 1685 1708 case 140: 1686 1709 YY_RULE_SETUP 1687 { return RIGHT_ANGLE; }1710 { return(TILDE); } 1688 1711 YY_BREAK 1689 1712 case 141: 1690 1713 YY_RULE_SETUP 1691 { return VERTICAL_BAR; }1714 { return(PLUS); } 1692 1715 YY_BREAK 1693 1716 case 142: 1694 1717 YY_RULE_SETUP 1695 { return CARET; }1718 { return(STAR); } 1696 1719 YY_BREAK 1697 1720 case 143: 1698 1721 YY_RULE_SETUP 1699 { return AMPERSAND; }1722 { return(SLASH); } 1700 1723 YY_BREAK 1701 1724 case 144: 1702 1725 YY_RULE_SETUP 1703 { return QUESTION; }1726 { return(PERCENT); } 1704 1727 YY_BREAK 1705 1728 case 145: 1706 /* rule 145 can match eol */ 1707 YY_RULE_SETUP 1708 { } 1729 YY_RULE_SETUP 1730 { return(LEFT_ANGLE); } 1731 YY_BREAK 1732 case 146: 1733 YY_RULE_SETUP 1734 { return(RIGHT_ANGLE); } 1735 YY_BREAK 1736 case 147: 1737 YY_RULE_SETUP 1738 { return(VERTICAL_BAR); } 1739 YY_BREAK 1740 case 148: 1741 YY_RULE_SETUP 1742 { return(CARET); } 1743 YY_BREAK 1744 case 149: 1745 YY_RULE_SETUP 1746 { return(AMPERSAND); } 1747 YY_BREAK 1748 case 150: 1749 YY_RULE_SETUP 1750 { return(QUESTION); } 1751 YY_BREAK 1752 case 151: 1753 YY_RULE_SETUP 1754 { 1755 BEGIN(INITIAL); 1756 yylval->lex.string = NewPoolTString(yytext); 1757 return FIELD_SELECTION; 1758 } 1759 YY_BREAK 1760 case 152: 1761 YY_RULE_SETUP 1762 {} 1763 YY_BREAK 1764 case 153: 1765 /* rule 153 can match eol */ 1766 YY_RULE_SETUP 1767 { } 1709 1768 YY_BREAK 1710 1769 case YY_STATE_EOF(INITIAL): 1711 { yyterminate(); } 1712 YY_BREAK 1713 case 146: 1714 YY_RULE_SETUP 1715 { assert(false); return 0; } 1716 YY_BREAK 1717 case 147: 1770 case YY_STATE_EOF(COMMENT): 1771 case YY_STATE_EOF(FIELDS): 1772 { context->AfterEOF = true; yyterminate(); } 1773 YY_BREAK 1774 case 154: 1775 YY_RULE_SETUP 1776 { context->warning(yylineno, "Unknown char", yytext, ""); return 0; } 1777 YY_BREAK 1778 case 155: 1718 1779 YY_RULE_SETUP 1719 1780 ECHO; … … 2011 2072 { 2012 2073 yy_current_state = (int) yy_def[yy_current_state]; 2013 if ( yy_current_state >= 4 43)2074 if ( yy_current_state >= 459 ) 2014 2075 yy_c = yy_meta[(unsigned int) yy_c]; 2015 2076 } … … 2040 2101 { 2041 2102 yy_current_state = (int) yy_def[yy_current_state]; 2042 if ( yy_current_state >= 4 43)2103 if ( yy_current_state >= 459 ) 2043 2104 yy_c = yy_meta[(unsigned int) yy_c]; 2044 2105 } 2045 2106 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 2046 yy_is_jam = (yy_current_state == 4 42);2107 yy_is_jam = (yy_current_state == 458); 2047 2108 2048 2109 return yy_is_jam ? 0 : yy_current_state; … … 2488 2549 } 2489 2550 2551 static void yy_push_state (int new_state , yyscan_t yyscanner) 2552 { 2553 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2554 if ( yyg->yy_start_stack_ptr >= yyg->yy_start_stack_depth ) 2555 { 2556 yy_size_t new_size; 2557 2558 yyg->yy_start_stack_depth += YY_START_STACK_INCR; 2559 new_size = yyg->yy_start_stack_depth * sizeof( int ); 2560 2561 if ( ! yyg->yy_start_stack ) 2562 yyg->yy_start_stack = (int *) yyalloc(new_size ,yyscanner ); 2563 2564 else 2565 yyg->yy_start_stack = (int *) yyrealloc((void *) yyg->yy_start_stack,new_size ,yyscanner ); 2566 2567 if ( ! yyg->yy_start_stack ) 2568 YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); 2569 } 2570 2571 yyg->yy_start_stack[yyg->yy_start_stack_ptr++] = YY_START; 2572 2573 BEGIN(new_state); 2574 } 2575 2576 static void yy_pop_state (yyscan_t yyscanner) 2577 { 2578 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2579 if ( --yyg->yy_start_stack_ptr < 0 ) 2580 YY_FATAL_ERROR( "start-condition stack underflow" ); 2581 2582 BEGIN(yyg->yy_start_stack[yyg->yy_start_stack_ptr]); 2583 } 2584 2585 static int yy_top_state (yyscan_t yyscanner) 2586 { 2587 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; 2588 return yyg->yy_start_stack[yyg->yy_start_stack_ptr - 1]; 2589 } 2590 2490 2591 #ifndef YY_EXIT_FAILURE 2491 2592 #define YY_EXIT_FAILURE 2 … … 2673 2774 } 2674 2775 2675 YYLTYPE *yyget_lloc (yyscan_t yyscanner)2676 {2677 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;2678 return yylloc;2679 }2680 2681 void yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)2682 {2683 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;2684 yylloc = yylloc_param;2685 }2686 2687 2776 /* User-visible API */ 2688 2777 … … 2866 2955 if (len < max_size) 2867 2956 memcpy(buf, token.text.c_str(), len); 2868 yyset_column(token.location.file,yyscanner); 2869 yyset_lineno(token.location.line,yyscanner); 2957 yyset_lineno(EncodeSourceLoc(token.location.file, token.location.line),yyscanner); 2870 2958 2871 2959 if (len >= max_size) … … 2881 2969 int token = IDENTIFIER; 2882 2970 TSymbol* symbol = yyextra->symbolTable.find(yytext); 2883 if ( symbol && symbol->isVariable()) {2971 if (yyextra->lexAfterType == false && symbol && symbol->isVariable()) { 2884 2972 TVariable* variable = static_cast<TVariable*>(symbol); 2885 if (variable->isUserType()) 2973 if (variable->isUserType()) { 2974 yyextra->lexAfterType = true; 2886 2975 token = TYPE_NAME; 2976 } 2887 2977 } 2888 2978 yylval->lex.symbol = symbol; … … 2893 2983 struct yyguts_t* yyg = (struct yyguts_t*) yyscanner; 2894 2984 2895 yyextra->error( *yylloc, "Illegal use of reserved word", yytext, "");2985 yyextra->error(yylineno, "Illegal use of reserved word", yytext, ""); 2896 2986 yyextra->recover(); 2897 2987 return 0; 2988 } 2989 2990 void yyerror(TParseContext* context, const char* reason) { 2991 struct yyguts_t* yyg = (struct yyguts_t*) context->scanner; 2992 2993 if (context->AfterEOF) { 2994 context->error(yylineno, reason, "unexpected EOF"); 2995 } else { 2996 context->error(yylineno, reason, yytext); 2997 } 2998 context->recover(); 2898 2999 } 2899 3000 … … 2920 3021 TParseContext* context) { 2921 3022 yyrestart(NULL,context->scanner); 2922 yyset_ column(0,context->scanner);2923 yyset_lineno(1,context->scanner);3023 yyset_lineno(EncodeSourceLoc(0, 1),context->scanner); 3024 context->AfterEOF = false; 2924 3025 2925 3026 // Initialize preprocessor. -
trunk/Source/ThirdParty/ANGLE/src/compiler/glslang_tab.cpp
r152821 r152946 57 57 58 58 /* Using locations. */ 59 #define YYLSP_NEEDED 159 #define YYLSP_NEEDED 0 60 60 61 61 … … 114 114 INTCONSTANT = 303, 115 115 BOOLCONSTANT = 304, 116 LEFT_OP = 305, 117 RIGHT_OP = 306, 118 INC_OP = 307, 119 DEC_OP = 308, 120 LE_OP = 309, 121 GE_OP = 310, 122 EQ_OP = 311, 123 NE_OP = 312, 124 AND_OP = 313, 125 OR_OP = 314, 126 XOR_OP = 315, 127 MUL_ASSIGN = 316, 128 DIV_ASSIGN = 317, 129 ADD_ASSIGN = 318, 130 MOD_ASSIGN = 319, 131 LEFT_ASSIGN = 320, 132 RIGHT_ASSIGN = 321, 133 AND_ASSIGN = 322, 134 XOR_ASSIGN = 323, 135 OR_ASSIGN = 324, 136 SUB_ASSIGN = 325, 137 LEFT_PAREN = 326, 138 RIGHT_PAREN = 327, 139 LEFT_BRACKET = 328, 140 RIGHT_BRACKET = 329, 141 LEFT_BRACE = 330, 142 RIGHT_BRACE = 331, 143 DOT = 332, 144 COMMA = 333, 145 COLON = 334, 146 EQUAL = 335, 147 SEMICOLON = 336, 148 BANG = 337, 149 DASH = 338, 150 TILDE = 339, 151 PLUS = 340, 152 STAR = 341, 153 SLASH = 342, 154 PERCENT = 343, 155 LEFT_ANGLE = 344, 156 RIGHT_ANGLE = 345, 157 VERTICAL_BAR = 346, 158 CARET = 347, 159 AMPERSAND = 348, 160 QUESTION = 349 116 FIELD_SELECTION = 305, 117 LEFT_OP = 306, 118 RIGHT_OP = 307, 119 INC_OP = 308, 120 DEC_OP = 309, 121 LE_OP = 310, 122 GE_OP = 311, 123 EQ_OP = 312, 124 NE_OP = 313, 125 AND_OP = 314, 126 OR_OP = 315, 127 XOR_OP = 316, 128 MUL_ASSIGN = 317, 129 DIV_ASSIGN = 318, 130 ADD_ASSIGN = 319, 131 MOD_ASSIGN = 320, 132 LEFT_ASSIGN = 321, 133 RIGHT_ASSIGN = 322, 134 AND_ASSIGN = 323, 135 XOR_ASSIGN = 324, 136 OR_ASSIGN = 325, 137 SUB_ASSIGN = 326, 138 LEFT_PAREN = 327, 139 RIGHT_PAREN = 328, 140 LEFT_BRACKET = 329, 141 RIGHT_BRACKET = 330, 142 LEFT_BRACE = 331, 143 RIGHT_BRACE = 332, 144 DOT = 333, 145 COMMA = 334, 146 COLON = 335, 147 EQUAL = 336, 148 SEMICOLON = 337, 149 BANG = 338, 150 DASH = 339, 151 TILDE = 340, 152 PLUS = 341, 153 STAR = 342, 154 SLASH = 343, 155 PERCENT = 344, 156 LEFT_ANGLE = 345, 157 RIGHT_ANGLE = 346, 158 VERTICAL_BAR = 347, 159 CARET = 348, 160 AMPERSAND = 349, 161 QUESTION = 350 161 162 }; 162 163 #endif … … 209 210 #define INTCONSTANT 303 210 211 #define BOOLCONSTANT 304 211 #define LEFT_OP 305 212 #define RIGHT_OP 306 213 #define INC_OP 307 214 #define DEC_OP 308 215 #define LE_OP 309 216 #define GE_OP 310 217 #define EQ_OP 311 218 #define NE_OP 312 219 #define AND_OP 313 220 #define OR_OP 314 221 #define XOR_OP 315 222 #define MUL_ASSIGN 316 223 #define DIV_ASSIGN 317 224 #define ADD_ASSIGN 318 225 #define MOD_ASSIGN 319 226 #define LEFT_ASSIGN 320 227 #define RIGHT_ASSIGN 321 228 #define AND_ASSIGN 322 229 #define XOR_ASSIGN 323 230 #define OR_ASSIGN 324 231 #define SUB_ASSIGN 325 232 #define LEFT_PAREN 326 233 #define RIGHT_PAREN 327 234 #define LEFT_BRACKET 328 235 #define RIGHT_BRACKET 329 236 #define LEFT_BRACE 330 237 #define RIGHT_BRACE 331 238 #define DOT 332 239 #define COMMA 333 240 #define COLON 334 241 #define EQUAL 335 242 #define SEMICOLON 336 243 #define BANG 337 244 #define DASH 338 245 #define TILDE 339 246 #define PLUS 340 247 #define STAR 341 248 #define SLASH 342 249 #define PERCENT 343 250 #define LEFT_ANGLE 344 251 #define RIGHT_ANGLE 345 252 #define VERTICAL_BAR 346 253 #define CARET 347 254 #define AMPERSAND 348 255 #define QUESTION 349 212 #define FIELD_SELECTION 305 213 #define LEFT_OP 306 214 #define RIGHT_OP 307 215 #define INC_OP 308 216 #define DEC_OP 309 217 #define LE_OP 310 218 #define GE_OP 311 219 #define EQ_OP 312 220 #define NE_OP 313 221 #define AND_OP 314 222 #define OR_OP 315 223 #define XOR_OP 316 224 #define MUL_ASSIGN 317 225 #define DIV_ASSIGN 318 226 #define ADD_ASSIGN 319 227 #define MOD_ASSIGN 320 228 #define LEFT_ASSIGN 321 229 #define RIGHT_ASSIGN 322 230 #define AND_ASSIGN 323 231 #define XOR_ASSIGN 324 232 #define OR_ASSIGN 325 233 #define SUB_ASSIGN 326 234 #define LEFT_PAREN 327 235 #define RIGHT_PAREN 328 236 #define LEFT_BRACKET 329 237 #define RIGHT_BRACKET 330 238 #define LEFT_BRACE 331 239 #define RIGHT_BRACE 332 240 #define DOT 333 241 #define COMMA 334 242 #define COLON 335 243 #define EQUAL 336 244 #define SEMICOLON 337 245 #define BANG 338 246 #define DASH 339 247 #define TILDE 340 248 #define PLUS 341 249 #define STAR 342 250 #define SLASH 343 251 #define PERCENT 344 252 #define LEFT_ANGLE 345 253 #define RIGHT_ANGLE 346 254 #define VERTICAL_BAR 347 255 #define CARET 348 256 #define AMPERSAND 349 257 #define QUESTION 350 256 258 257 259 … … 286 288 287 289 #define YYENABLE_NLS 0 290 #define YYLTYPE_IS_TRIVIAL 1 288 291 289 292 #define YYLEX_PARAM context->scanner … … 312 315 313 316 { 314 #define YYLTYPE TSourceLoc315 #define YYLTYPE_IS_DECLARED 1316 317 struct { 318 TSourceLoc line; 317 319 union { 318 320 TString *string; … … 324 326 } lex; 325 327 struct { 328 TSourceLoc line; 326 329 TOperator op; 327 330 union { … … 337 340 TFunction* function; 338 341 TParameter param; 339 T Field* field;340 T FieldList* fieldList;342 TTypeLine typeLine; 343 TTypeList* typeList; 341 344 }; 342 345 } interm; … … 350 353 #endif 351 354 352 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED353 typedef struct YYLTYPE354 {355 int first_line;356 int first_column;357 int last_line;358 int last_column;359 } YYLTYPE;360 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */361 # define YYLTYPE_IS_DECLARED 1362 # define YYLTYPE_IS_TRIVIAL 1363 #endif364 355 365 356 … … 367 358 368 359 369 extern int yylex(YYSTYPE* yylval, YYLTYPE* yylloc, void* yyscanner); 370 static void yyerror(YYLTYPE* yylloc, TParseContext* context, const char* reason); 371 372 #define YYLLOC_DEFAULT(Current, Rhs, N) \ 373 do { \ 374 if (YYID(N)) { \ 375 (Current).first_file = YYRHSLOC(Rhs, 1).first_file; \ 376 (Current).first_line = YYRHSLOC(Rhs, 1).first_line; \ 377 (Current).last_file = YYRHSLOC(Rhs, N).last_file; \ 378 (Current).last_line = YYRHSLOC(Rhs, N).last_line; \ 379 } \ 380 else { \ 381 (Current).first_file = YYRHSLOC(Rhs, 0).last_file; \ 382 (Current).first_line = YYRHSLOC(Rhs, 0).last_line; \ 383 (Current).last_file = YYRHSLOC(Rhs, 0).last_file; \ 384 (Current).last_line = YYRHSLOC(Rhs, 0).last_line; \ 385 } \ 386 } while (0) 360 extern int yylex(YYSTYPE* yylval_param, void* yyscanner); 361 extern void yyerror(TParseContext* context, const char* reason); 362 363 #define FRAG_VERT_ONLY(S, L) { \ 364 if (context->shaderType != SH_FRAGMENT_SHADER && \ 365 context->shaderType != SH_VERTEX_SHADER) { \ 366 context->error(L, " supported in vertex/fragment shaders only ", S); \ 367 context->recover(); \ 368 } \ 369 } 387 370 388 371 #define VERTEX_ONLY(S, L) { \ … … 560 543 #if (! defined yyoverflow \ 561 544 && (! defined __cplusplus \ 562 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ 563 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 545 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 564 546 565 547 /* A type that is properly aligned for any stack member. */ … … 568 550 yytype_int16 yyss; 569 551 YYSTYPE yyvs; 570 YYLTYPE yyls; 571 }; 552 }; 572 553 573 554 /* The size of the maximum gap between one aligned stack and the next. */ … … 577 558 N elements. */ 578 559 # define YYSTACK_BYTES(N) \ 579 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \580 + 2 *YYSTACK_GAP_MAXIMUM)560 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ 561 + YYSTACK_GAP_MAXIMUM) 581 562 582 563 /* Copy COUNT objects from FROM to TO. The source and destination do … … 617 598 618 599 /* YYFINAL -- State number of the termination state. */ 619 #define YYFINAL 7 4600 #define YYFINAL 71 620 601 /* YYLAST -- Last index in YYTABLE. */ 621 #define YYLAST 14 90602 #define YYLAST 1416 622 603 623 604 /* YYNTOKENS -- Number of terminals. */ 624 #define YYNTOKENS 9 5605 #define YYNTOKENS 96 625 606 /* YYNNTS -- Number of nonterminals. */ 626 #define YYNNTS 8 4607 #define YYNNTS 83 627 608 /* YYNRULES -- Number of rules. */ 628 #define YYNRULES 20 2609 #define YYNRULES 201 629 610 /* YYNRULES -- Number of states. */ 630 #define YYNSTATES 30 7611 #define YYNSTATES 304 631 612 632 613 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 633 614 #define YYUNDEFTOK 2 634 #define YYMAXUTOK 3 49615 #define YYMAXUTOK 350 635 616 636 617 #define YYTRANSLATE(YYX) \ … … 674 655 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 675 656 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 676 85, 86, 87, 88, 89, 90, 91, 92, 93, 94 657 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 658 95 677 659 }; 678 660 … … 682 664 static const yytype_uint16 yyprhs[] = 683 665 { 684 0, 0, 3, 5, 7, 9, 11, 13, 1 5, 17,685 2 1, 23, 28, 30, 34, 37, 40, 42, 44, 46,686 5 0, 53, 56, 59, 61, 64, 68, 71, 73, 75,687 7 7, 80, 83, 86, 88, 90, 92, 94, 98, 102,688 10 4, 108, 112, 114, 116, 120, 124, 128, 132, 134,689 1 38, 142, 144, 146, 148, 150, 154, 156, 160, 162,690 166, 1 68, 174, 176, 180, 182, 184, 186, 188, 190,691 19 2, 196, 198, 201, 204, 209, 212, 214, 216, 219,692 22 3, 227, 230, 236, 240, 243, 247, 250, 251, 253,693 255, 257, 259, 26 1, 265, 271, 278, 284, 286, 289,694 29 4, 300, 305, 308, 310, 313, 315, 317, 319, 322,695 324, 32 6, 329, 331, 333, 335, 337, 342, 344, 346,666 0, 0, 3, 5, 7, 9, 11, 13, 17, 19, 667 24, 26, 30, 33, 36, 38, 40, 42, 46, 49, 668 52, 55, 57, 60, 64, 67, 69, 71, 73, 75, 669 78, 81, 84, 86, 88, 90, 92, 96, 100, 102, 670 106, 110, 112, 114, 118, 122, 126, 130, 132, 136, 671 140, 142, 144, 146, 148, 152, 154, 158, 160, 164, 672 166, 172, 174, 178, 180, 182, 184, 186, 188, 190, 673 194, 196, 199, 202, 207, 210, 212, 214, 217, 221, 674 225, 228, 234, 238, 241, 245, 248, 249, 251, 253, 675 255, 257, 259, 263, 269, 276, 282, 284, 287, 292, 676 298, 303, 306, 308, 311, 313, 315, 317, 320, 322, 677 324, 327, 329, 331, 333, 335, 340, 342, 344, 346, 696 678 348, 350, 352, 354, 356, 358, 360, 362, 364, 366, 697 368, 370, 372, 374, 376, 378, 380, 382, 384, 38 6,698 3 87, 394, 395, 401, 403, 406, 410, 412, 416, 418,699 423, 425, 427, 429, 431, 433, 435, 437, 439, 44 1,700 44 4, 445, 446, 452, 454, 456, 457, 460, 461, 464,701 46 7, 471, 473, 476, 478, 481, 487, 491, 493, 495,702 500, 501, 508, 509, 518, 519, 527, 529, 531, 533,703 53 4, 537, 541, 544, 547, 550, 554, 557, 559, 562,704 564, 56 6, 567679 368, 370, 372, 374, 376, 378, 380, 382, 384, 385, 680 392, 393, 399, 401, 404, 408, 410, 414, 416, 421, 681 423, 425, 427, 429, 431, 433, 435, 437, 439, 442, 682 443, 444, 450, 452, 454, 455, 458, 459, 462, 465, 683 469, 471, 474, 476, 479, 485, 489, 491, 493, 498, 684 499, 506, 507, 516, 517, 525, 527, 529, 531, 532, 685 535, 539, 542, 545, 548, 552, 555, 557, 560, 562, 686 564, 565 705 687 }; 706 688 … … 708 690 static const yytype_int16 yyrhs[] = 709 691 { 710 175, 0, -1, 45, -1, 46, -1, 45, -1, 97, 711 -1, 48, -1, 47, -1, 49, -1, 71, 124, 72, 712 -1, 98, -1, 99, 73, 100, 74, -1, 101, -1, 713 99, 77, 96, -1, 99, 52, -1, 99, 53, -1, 714 124, -1, 102, -1, 103, -1, 99, 77, 103, -1, 715 105, 72, -1, 104, 72, -1, 106, 39, -1, 106, 716 -1, 106, 122, -1, 105, 78, 122, -1, 107, 71, 717 -1, 142, -1, 45, -1, 99, -1, 52, 108, -1, 718 53, 108, -1, 109, 108, -1, 85, -1, 83, -1, 719 82, -1, 108, -1, 110, 86, 108, -1, 110, 87, 720 108, -1, 110, -1, 111, 85, 110, -1, 111, 83, 721 110, -1, 111, -1, 112, -1, 113, 89, 112, -1, 722 113, 90, 112, -1, 113, 54, 112, -1, 113, 55, 723 112, -1, 113, -1, 114, 56, 113, -1, 114, 57, 724 113, -1, 114, -1, 115, -1, 116, -1, 117, -1, 725 118, 58, 117, -1, 118, -1, 119, 60, 118, -1, 726 119, -1, 120, 59, 119, -1, 120, -1, 120, 94, 727 124, 79, 122, -1, 121, -1, 108, 123, 122, -1, 728 80, -1, 61, -1, 62, -1, 63, -1, 70, -1, 729 122, -1, 124, 78, 122, -1, 121, -1, 127, 81, 730 -1, 135, 81, -1, 7, 140, 141, 81, -1, 128, 731 72, -1, 130, -1, 129, -1, 130, 132, -1, 129, 732 78, 132, -1, 137, 45, 71, -1, 139, 96, -1, 733 139, 96, 73, 125, 74, -1, 138, 133, 131, -1, 734 133, 131, -1, 138, 133, 134, -1, 133, 134, -1, 735 -1, 33, -1, 34, -1, 35, -1, 139, -1, 136, 736 -1, 135, 78, 96, -1, 135, 78, 96, 73, 74, 737 -1, 135, 78, 96, 73, 125, 74, -1, 135, 78, 738 96, 80, 150, -1, 137, -1, 137, 96, -1, 137, 739 96, 73, 74, -1, 137, 96, 73, 125, 74, -1, 740 137, 96, 80, 150, -1, 3, 45, -1, 139, -1, 741 138, 139, -1, 9, -1, 8, -1, 37, -1, 3, 742 37, -1, 36, -1, 141, -1, 140, 141, -1, 4, 743 -1, 5, -1, 6, -1, 142, -1, 142, 73, 125, 744 74, -1, 39, -1, 11, -1, 12, -1, 10, -1, 745 27, -1, 28, -1, 29, -1, 21, -1, 22, -1, 746 23, -1, 24, -1, 25, -1, 26, -1, 30, -1, 747 31, -1, 32, -1, 41, -1, 42, -1, 43, -1, 748 44, -1, 143, -1, 46, -1, -1, 38, 96, 75, 749 144, 146, 76, -1, -1, 38, 75, 145, 146, 76, 750 -1, 147, -1, 146, 147, -1, 139, 148, 81, -1, 751 149, -1, 148, 78, 149, -1, 96, -1, 96, 73, 752 125, 74, -1, 122, -1, 126, -1, 154, -1, 153, 753 -1, 151, -1, 163, -1, 164, -1, 167, -1, 174, 754 -1, 75, 76, -1, -1, -1, 75, 155, 162, 156, 755 76, -1, 161, -1, 153, -1, -1, 159, 161, -1, 756 -1, 160, 153, -1, 75, 76, -1, 75, 162, 76, 757 -1, 152, -1, 162, 152, -1, 81, -1, 124, 81, 758 -1, 18, 71, 124, 72, 165, -1, 158, 16, 158, 759 -1, 158, -1, 124, -1, 137, 96, 80, 150, -1, 760 -1, 40, 71, 168, 166, 72, 157, -1, -1, 15, 761 169, 158, 40, 71, 124, 72, 81, -1, -1, 17, 762 71, 170, 171, 173, 72, 157, -1, 163, -1, 151, 763 -1, 166, -1, -1, 172, 81, -1, 172, 81, 124, 764 -1, 14, 81, -1, 13, 81, -1, 20, 81, -1, 765 20, 124, 81, -1, 19, 81, -1, 176, -1, 175, 766 176, -1, 177, -1, 126, -1, -1, 127, 178, 161, 767 -1 692 175, 0, -1, 45, -1, 97, -1, 48, -1, 47, 693 -1, 49, -1, 72, 124, 73, -1, 98, -1, 99, 694 74, 100, 75, -1, 101, -1, 99, 78, 50, -1, 695 99, 53, -1, 99, 54, -1, 124, -1, 102, -1, 696 103, -1, 99, 78, 103, -1, 105, 73, -1, 104, 697 73, -1, 106, 39, -1, 106, -1, 106, 122, -1, 698 105, 79, 122, -1, 107, 72, -1, 142, -1, 45, 699 -1, 50, -1, 99, -1, 53, 108, -1, 54, 108, 700 -1, 109, 108, -1, 86, -1, 84, -1, 83, -1, 701 108, -1, 110, 87, 108, -1, 110, 88, 108, -1, 702 110, -1, 111, 86, 110, -1, 111, 84, 110, -1, 703 111, -1, 112, -1, 113, 90, 112, -1, 113, 91, 704 112, -1, 113, 55, 112, -1, 113, 56, 112, -1, 705 113, -1, 114, 57, 113, -1, 114, 58, 113, -1, 706 114, -1, 115, -1, 116, -1, 117, -1, 118, 59, 707 117, -1, 118, -1, 119, 61, 118, -1, 119, -1, 708 120, 60, 119, -1, 120, -1, 120, 95, 124, 80, 709 122, -1, 121, -1, 108, 123, 122, -1, 81, -1, 710 62, -1, 63, -1, 64, -1, 71, -1, 122, -1, 711 124, 79, 122, -1, 121, -1, 127, 82, -1, 135, 712 82, -1, 7, 140, 141, 82, -1, 128, 73, -1, 713 130, -1, 129, -1, 130, 132, -1, 129, 79, 132, 714 -1, 137, 45, 72, -1, 139, 45, -1, 139, 45, 715 74, 125, 75, -1, 138, 133, 131, -1, 133, 131, 716 -1, 138, 133, 134, -1, 133, 134, -1, -1, 33, 717 -1, 34, -1, 35, -1, 139, -1, 136, -1, 135, 718 79, 45, -1, 135, 79, 45, 74, 75, -1, 135, 719 79, 45, 74, 125, 75, -1, 135, 79, 45, 81, 720 150, -1, 137, -1, 137, 45, -1, 137, 45, 74, 721 75, -1, 137, 45, 74, 125, 75, -1, 137, 45, 722 81, 150, -1, 3, 45, -1, 139, -1, 138, 139, 723 -1, 9, -1, 8, -1, 37, -1, 3, 37, -1, 724 36, -1, 141, -1, 140, 141, -1, 4, -1, 5, 725 -1, 6, -1, 142, -1, 142, 74, 125, 75, -1, 726 39, -1, 11, -1, 12, -1, 10, -1, 27, -1, 727 28, -1, 29, -1, 21, -1, 22, -1, 23, -1, 728 24, -1, 25, -1, 26, -1, 30, -1, 31, -1, 729 32, -1, 41, -1, 42, -1, 43, -1, 44, -1, 730 143, -1, 46, -1, -1, 38, 45, 76, 144, 146, 731 77, -1, -1, 38, 76, 145, 146, 77, -1, 147, 732 -1, 146, 147, -1, 139, 148, 82, -1, 149, -1, 733 148, 79, 149, -1, 45, -1, 45, 74, 125, 75, 734 -1, 122, -1, 126, -1, 154, -1, 153, -1, 151, 735 -1, 163, -1, 164, -1, 167, -1, 174, -1, 76, 736 77, -1, -1, -1, 76, 155, 162, 156, 77, -1, 737 161, -1, 153, -1, -1, 159, 161, -1, -1, 160, 738 153, -1, 76, 77, -1, 76, 162, 77, -1, 152, 739 -1, 162, 152, -1, 82, -1, 124, 82, -1, 18, 740 72, 124, 73, 165, -1, 158, 16, 158, -1, 158, 741 -1, 124, -1, 137, 45, 81, 150, -1, -1, 40, 742 72, 168, 166, 73, 157, -1, -1, 15, 169, 158, 743 40, 72, 124, 73, 82, -1, -1, 17, 72, 170, 744 171, 173, 73, 157, -1, 163, -1, 151, -1, 166, 745 -1, -1, 172, 82, -1, 172, 82, 124, -1, 14, 746 82, -1, 13, 82, -1, 20, 82, -1, 20, 124, 747 82, -1, 19, 82, -1, 176, -1, 175, 176, -1, 748 177, -1, 126, -1, -1, 127, 178, 161, -1 768 749 }; 769 750 … … 771 752 static const yytype_uint16 yyrline[] = 772 753 { 773 0, 1 76, 176, 177, 180, 223, 226, 239, 244, 249,774 255, 258, 333, 336, 431, 441, 454, 462, 562, 565,775 57 3, 576, 582, 586, 593, 599, 608, 616, 671, 681,776 6 84, 694, 704, 725, 726, 727, 732, 733, 741, 752,777 7 53, 761, 772, 776, 777, 787, 797, 807, 820, 821,778 8 31, 844, 848, 852, 856, 857, 870, 871, 884, 885,779 898, 899, 916, 917, 930, 931, 932, 933, 934, 938,780 9 41, 952, 960, 987, 992, 1006, 1043, 1046, 1053, 1061,781 1 082, 1103, 1113, 1141, 1146, 1156, 1161, 1171, 1174, 1177,782 11 80, 1186, 1193, 1196, 1218, 1236, 1260, 1283, 1287, 1305,783 13 13, 1345, 1365, 1386, 1395, 1418, 1421, 1427, 1435, 1443,784 1 451, 1461, 1468, 1471, 1474, 1480, 1483, 1498, 1502, 1506,785 15 10, 1514, 1519, 1524, 1529, 1534, 1539, 1544, 1549, 1554,786 1 559, 1564, 1569, 1574, 1578, 1582, 1590, 1598, 1602, 1615,787 1 615, 1629, 1629, 1638, 1641, 1657, 1690, 1694, 1700, 1707,788 1 722, 1726, 1730, 1731, 1737, 1738, 1739, 1740, 1741, 1745,789 1 746, 1746, 1746, 1756, 1757, 1761, 1761, 1762, 1762, 1767,790 1 770, 1780, 1783, 1789, 1790, 1794, 1802, 1806, 1816, 1821,791 1 838, 1838, 1843, 1843, 1850, 1850, 1858, 1861, 1867, 1870,792 1 876, 1880, 1887, 1894, 1901, 1908, 1919, 1928, 1932, 1939,793 1942, 1948, 1948754 0, 168, 168, 203, 206, 219, 224, 229, 235, 238, 755 317, 320, 421, 431, 444, 452, 552, 555, 563, 567, 756 574, 578, 585, 591, 600, 608, 663, 670, 680, 683, 757 693, 703, 724, 725, 726, 731, 732, 741, 753, 754, 758 762, 773, 777, 778, 788, 798, 808, 821, 822, 832, 759 845, 849, 853, 857, 858, 871, 872, 885, 886, 899, 760 900, 917, 918, 931, 932, 933, 934, 935, 939, 942, 761 953, 961, 988, 993, 1007, 1045, 1048, 1055, 1063, 1084, 762 1105, 1116, 1145, 1150, 1160, 1165, 1175, 1178, 1181, 1184, 763 1190, 1197, 1200, 1222, 1240, 1264, 1287, 1291, 1309, 1317, 764 1349, 1369, 1458, 1467, 1490, 1493, 1499, 1507, 1515, 1523, 765 1533, 1540, 1543, 1546, 1552, 1555, 1570, 1574, 1578, 1582, 766 1591, 1596, 1601, 1606, 1611, 1616, 1621, 1626, 1631, 1636, 767 1642, 1648, 1654, 1659, 1664, 1673, 1682, 1687, 1700, 1700, 768 1714, 1714, 1723, 1726, 1741, 1777, 1781, 1787, 1795, 1811, 769 1815, 1819, 1820, 1826, 1827, 1828, 1829, 1830, 1834, 1835, 770 1835, 1835, 1845, 1846, 1850, 1850, 1851, 1851, 1856, 1859, 771 1869, 1872, 1878, 1879, 1883, 1891, 1895, 1905, 1910, 1927, 772 1927, 1932, 1932, 1939, 1939, 1947, 1950, 1956, 1959, 1965, 773 1969, 1976, 1983, 1990, 1997, 2008, 2017, 2021, 2028, 2031, 774 2037, 2037 794 775 }; 795 776 #endif … … 808 789 "VARYING", "STRUCT", "VOID_TYPE", "WHILE", "SAMPLER2D", "SAMPLERCUBE", 809 790 "SAMPLER_EXTERNAL_OES", "SAMPLER2DRECT", "IDENTIFIER", "TYPE_NAME", 810 "FLOATCONSTANT", "INTCONSTANT", "BOOLCONSTANT", " LEFT_OP", "RIGHT_OP",811 " INC_OP", "DEC_OP", "LE_OP", "GE_OP", "EQ_OP", "NE_OP", "AND_OP",812 " OR_OP", "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN", "ADD_ASSIGN",813 " MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", "AND_ASSIGN", "XOR_ASSIGN",814 " OR_ASSIGN", "SUB_ASSIGN", "LEFT_PAREN", "RIGHT_PAREN", "LEFT_BRACKET",815 " RIGHT_BRACKET", "LEFT_BRACE", "RIGHT_BRACE", "DOT", "COMMA", "COLON",816 " EQUAL", "SEMICOLON", "BANG", "DASH", "TILDE", "PLUS", "STAR", "SLASH",817 " PERCENT", "LEFT_ANGLE", "RIGHT_ANGLE", "VERTICAL_BAR", "CARET",818 " AMPERSAND", "QUESTION", "$accept", "identifier", "variable_identifier",791 "FLOATCONSTANT", "INTCONSTANT", "BOOLCONSTANT", "FIELD_SELECTION", 792 "LEFT_OP", "RIGHT_OP", "INC_OP", "DEC_OP", "LE_OP", "GE_OP", "EQ_OP", 793 "NE_OP", "AND_OP", "OR_OP", "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN", 794 "ADD_ASSIGN", "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", "AND_ASSIGN", 795 "XOR_ASSIGN", "OR_ASSIGN", "SUB_ASSIGN", "LEFT_PAREN", "RIGHT_PAREN", 796 "LEFT_BRACKET", "RIGHT_BRACKET", "LEFT_BRACE", "RIGHT_BRACE", "DOT", 797 "COMMA", "COLON", "EQUAL", "SEMICOLON", "BANG", "DASH", "TILDE", "PLUS", 798 "STAR", "SLASH", "PERCENT", "LEFT_ANGLE", "RIGHT_ANGLE", "VERTICAL_BAR", 799 "CARET", "AMPERSAND", "QUESTION", "$accept", "variable_identifier", 819 800 "primary_expression", "postfix_expression", "integer_expression", 820 801 "function_call", "function_call_or_method", "function_call_generic", … … 862 843 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 863 844 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 864 345, 346, 347, 348, 349 845 345, 346, 347, 348, 349, 350 865 846 }; 866 847 # endif … … 869 850 static const yytype_uint8 yyr1[] = 870 851 { 871 0, 9 5, 96, 96, 97, 98, 98, 98, 98, 98,872 99, 99, 99, 99, 99, 99, 100, 101, 102, 102,873 10 3, 103, 104, 104, 105, 105, 106, 107, 107, 108,874 108, 108, 10 8, 109, 109, 109, 110, 110, 110, 111,875 111, 11 1, 112, 113, 113, 113, 113, 113, 114, 114,876 11 4, 115, 116, 117, 118, 118, 119, 119, 120, 120,877 121, 12 1, 122, 122, 123, 123, 123, 123, 123, 124,878 12 4, 125, 126, 126, 126, 127, 128, 128, 129, 129,879 13 0, 131, 131, 132, 132, 132, 132, 133, 133, 133,880 13 3, 134, 135, 135, 135, 135, 135, 136, 136, 136,881 136, 136, 13 6, 137, 137, 138, 138, 138, 138, 138,882 139, 1 39, 140, 140, 140, 141, 141, 142, 142, 142,852 0, 96, 97, 98, 98, 98, 98, 98, 99, 99, 853 99, 99, 99, 99, 100, 101, 102, 102, 103, 103, 854 104, 104, 105, 105, 106, 107, 107, 107, 108, 108, 855 108, 108, 109, 109, 109, 110, 110, 110, 111, 111, 856 111, 112, 113, 113, 113, 113, 113, 114, 114, 114, 857 115, 116, 117, 118, 118, 119, 119, 120, 120, 121, 858 121, 122, 122, 123, 123, 123, 123, 123, 124, 124, 859 125, 126, 126, 126, 127, 128, 128, 129, 129, 130, 860 131, 131, 132, 132, 132, 132, 133, 133, 133, 133, 861 134, 135, 135, 135, 135, 135, 136, 136, 136, 136, 862 136, 136, 137, 137, 138, 138, 138, 138, 138, 139, 863 139, 140, 140, 140, 141, 141, 142, 142, 142, 142, 883 864 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 884 142, 142, 142, 142, 142, 142, 142, 142, 14 2, 144,885 14 3, 145, 143, 146, 146, 147, 148, 148, 149, 149,886 15 0, 151, 152, 152, 153, 153, 153, 153, 153, 154,887 15 5, 156, 154, 157, 157, 159, 158, 160, 158, 161,888 16 1, 162, 162, 163, 163, 164, 165, 165, 166, 166,889 16 8, 167, 169, 167, 170, 167, 171, 171, 172, 172,890 173, 17 3, 174, 174, 174, 174, 174, 175, 175, 176,891 17 6, 178, 177865 142, 142, 142, 142, 142, 142, 142, 142, 144, 143, 866 145, 143, 146, 146, 147, 148, 148, 149, 149, 150, 867 151, 152, 152, 153, 153, 153, 153, 153, 154, 155, 868 156, 154, 157, 157, 159, 158, 160, 158, 161, 161, 869 162, 162, 163, 163, 164, 165, 165, 166, 166, 168, 870 167, 169, 167, 170, 167, 171, 171, 172, 172, 173, 871 173, 174, 174, 174, 174, 174, 175, 175, 176, 176, 872 178, 177 892 873 }; 893 874 … … 895 876 static const yytype_uint8 yyr2[] = 896 877 { 897 0, 2, 1, 1, 1, 1, 1, 1, 1, 3,898 1, 4, 1, 3, 2, 2, 1, 1, 1, 3,899 2, 2, 2, 1, 2, 3, 2, 1, 1, 1,900 2, 2, 2, 1, 1, 1, 1, 3, 3, 1,901 3, 3, 1, 1, 3, 3, 3, 3, 1, 3,902 3, 1, 1, 1, 1, 3, 1, 3, 1, 3,903 1, 5, 1, 3, 1, 1, 1, 1, 1, 1,904 3, 1, 2, 2, 4, 2, 1, 1, 2, 3,905 3, 2, 5, 3, 2, 3, 2, 0, 1, 1,906 1, 1, 1, 3, 5, 6, 5, 1, 2, 4,907 5, 4, 2, 1, 2, 1, 1, 1, 2, 1,908 1, 2, 1, 1, 1, 1, 4, 1, 1, 1,878 0, 2, 1, 1, 1, 1, 1, 3, 1, 4, 879 1, 3, 2, 2, 1, 1, 1, 3, 2, 2, 880 2, 1, 2, 3, 2, 1, 1, 1, 1, 2, 881 2, 2, 1, 1, 1, 1, 3, 3, 1, 3, 882 3, 1, 1, 3, 3, 3, 3, 1, 3, 3, 883 1, 1, 1, 1, 3, 1, 3, 1, 3, 1, 884 5, 1, 3, 1, 1, 1, 1, 1, 1, 3, 885 1, 2, 2, 4, 2, 1, 1, 2, 3, 3, 886 2, 5, 3, 2, 3, 2, 0, 1, 1, 1, 887 1, 1, 3, 5, 6, 5, 1, 2, 4, 5, 888 4, 2, 1, 2, 1, 1, 1, 2, 1, 1, 889 2, 1, 1, 1, 1, 4, 1, 1, 1, 1, 909 890 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 910 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,911 6, 0, 5, 1, 2, 3, 1, 3, 1, 4,912 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,913 0, 0, 5, 1, 1, 0, 2, 0, 2, 2,914 3, 1, 2, 1, 2, 5, 3, 1, 1, 4,915 0, 6, 0, 8, 0, 7, 1, 1, 1, 0,916 2, 3, 2, 2, 2, 3, 2, 1, 2, 1,917 1,0, 3891 1, 1, 1, 1, 1, 1, 1, 1, 0, 6, 892 0, 5, 1, 2, 3, 1, 3, 1, 4, 1, 893 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 894 0, 5, 1, 1, 0, 2, 0, 2, 2, 3, 895 1, 2, 1, 2, 5, 3, 1, 1, 4, 0, 896 6, 0, 8, 0, 7, 1, 1, 1, 0, 2, 897 3, 2, 2, 2, 3, 2, 1, 2, 1, 1, 898 0, 3 918 899 }; 919 900 … … 923 904 static const yytype_uint8 yydefact[] = 924 905 { 925 0, 0, 11 2, 113, 114, 0, 106, 105, 120, 118,926 11 9, 124, 125, 126, 127, 128, 129, 121, 122, 123,927 1 30, 131, 132, 109, 107, 0, 117, 133, 134, 135,928 13 6, 138, 200, 201, 0, 77, 87, 0, 92, 97,929 0, 10 3, 0, 110, 115, 137, 0, 197, 199, 108,930 10 2, 0, 2, 3, 141, 0, 72, 0, 75, 87,931 0, 88, 89, 90, 78, 0, 87, 0, 73, 2,932 98, 104, 111, 0, 1, 198, 0, 0, 139, 0,933 202, 79, 84, 86, 91, 0, 93, 80, 0, 0,934 4, 7, 6, 8, 0, 0, 0, 35, 34, 33,935 5, 10, 29, 12, 17, 18, 0, 0, 23, 0,936 3 6, 0, 39, 42, 43, 48, 51, 52, 53, 54,937 5 6, 58, 60, 71, 0, 27, 74, 0, 0, 143,938 0, 0, 0, 182, 0, 0, 0, 0, 0, 160,939 169, 173, 36, 62, 69, 0, 151, 0, 115, 154,940 1 71, 153, 152, 0, 155, 156, 157, 158, 81, 83,941 85, 0, 0, 99, 0, 150, 101, 30, 31, 0,942 14, 15, 0, 0, 21, 20, 0, 22, 24, 26,943 32, 0, 0, 0, 0, 0, 0, 0, 0, 0,944 0, 0, 0, 0, 0, 116, 148, 0, 146, 142,945 1 44, 0, 193, 192, 167, 184, 0, 196, 194, 0,946 180, 159, 0, 65, 66, 67, 68, 64, 0, 0,947 17 4, 170, 172, 0, 94, 0, 96, 100, 9, 0,948 1 6, 2, 3, 13, 19, 25, 37, 38, 41, 40,949 4 6, 47, 44, 45, 49, 50, 55, 57, 59, 0,950 0, 0, 145, 140, 0, 0, 0, 0, 0, 195,951 0, 161, 63, 70, 0, 95, 11, 0, 0, 147,952 0, 166, 168, 187, 186, 189, 167, 178, 0,0,953 0, 82, 61, 149, 0, 188, 0, 0, 177, 175,954 0, 0, 162, 0, 190, 0, 167, 0, 164, 181,955 1 63, 0, 191, 185, 176, 179, 183906 0, 0, 111, 112, 113, 0, 105, 104, 119, 117, 907 118, 123, 124, 125, 126, 127, 128, 120, 121, 122, 908 129, 130, 131, 108, 106, 0, 116, 132, 133, 134, 909 135, 137, 199, 200, 0, 76, 86, 0, 91, 96, 910 0, 102, 0, 109, 114, 136, 0, 196, 198, 107, 911 101, 0, 0, 140, 71, 0, 74, 86, 0, 87, 912 88, 89, 77, 0, 86, 0, 72, 97, 103, 110, 913 0, 1, 197, 0, 138, 0, 0, 201, 78, 83, 914 85, 90, 0, 92, 79, 0, 0, 2, 5, 4, 915 6, 27, 0, 0, 0, 34, 33, 32, 3, 8, 916 28, 10, 15, 16, 0, 0, 21, 0, 35, 0, 917 38, 41, 42, 47, 50, 51, 52, 53, 55, 57, 918 59, 70, 0, 25, 73, 0, 0, 0, 142, 0, 919 0, 181, 0, 0, 0, 0, 0, 159, 168, 172, 920 35, 61, 68, 0, 150, 0, 114, 153, 170, 152, 921 151, 0, 154, 155, 156, 157, 80, 82, 84, 0, 922 0, 98, 0, 149, 100, 29, 30, 0, 12, 13, 923 0, 0, 19, 18, 0, 20, 22, 24, 31, 0, 924 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 925 0, 0, 0, 115, 0, 147, 0, 145, 141, 143, 926 192, 191, 166, 183, 0, 195, 193, 0, 179, 158, 927 0, 64, 65, 66, 67, 63, 0, 0, 173, 169, 928 171, 0, 93, 0, 95, 99, 7, 0, 14, 26, 929 11, 17, 23, 36, 37, 40, 39, 45, 46, 43, 930 44, 48, 49, 54, 56, 58, 0, 139, 0, 0, 931 144, 0, 0, 0, 0, 0, 194, 0, 160, 62, 932 69, 0, 94, 9, 0, 0, 146, 0, 165, 167, 933 186, 185, 188, 166, 177, 0, 0, 0, 81, 60, 934 148, 0, 187, 0, 0, 176, 174, 0, 0, 161, 935 0, 189, 0, 166, 0, 163, 180, 162, 0, 190, 936 184, 175, 178, 182 956 937 }; 957 938 … … 959 940 static const yytype_int16 yydefgoto[] = 960 941 { 961 -1, 196, 100, 101, 102, 229, 103, 104, 105, 106,962 10 7, 108, 109, 142, 111, 112, 113, 114, 115, 116,963 11 7, 118, 119, 120, 121, 122, 143, 144, 218, 145,964 1 24, 146, 147, 34, 35, 36, 82, 64, 65, 83,965 3 7, 38, 39, 40, 41, 42, 43, 125, 45, 130,966 77, 128, 129, 197, 198, 166, 149, 150, 151, 152,967 2 12, 280, 299, 254, 255, 256, 300, 153, 154, 155,968 2 89, 279, 156, 260, 204, 257, 275, 286, 287, 157,969 4 6, 47, 48, 57942 -1, 98, 99, 100, 227, 101, 102, 103, 104, 105, 943 106, 107, 140, 109, 110, 111, 112, 113, 114, 115, 944 116, 117, 118, 119, 120, 141, 142, 216, 143, 122, 945 144, 145, 34, 35, 36, 79, 62, 63, 80, 37, 946 38, 39, 40, 41, 42, 43, 123, 45, 125, 75, 947 127, 128, 196, 197, 164, 147, 148, 149, 150, 210, 948 277, 296, 251, 252, 253, 297, 151, 152, 153, 286, 949 276, 154, 257, 202, 254, 272, 283, 284, 155, 46, 950 47, 48, 55 970 951 }; 971 952 972 953 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 973 954 STATE-NUM. */ 974 #define YYPACT_NINF -26 1955 #define YYPACT_NINF -266 975 956 static const yytype_int16 yypact[] = 976 957 { 977 1 327, -20, -261, -261, -261, 113, -261, -261, -261, -261,978 -26 1, -261, -261, -261, -261, -261, -261, -261, -261, -261,979 -26 1, -261, -261, -261, -261, -19, -261, -261, -261, -261,980 -26 1, -261, -261, -61, -40, -28, 75, -7, -261, 24,981 1 370, -261, 1444, -261, -11, -261, 1283, -261, -261, -261,982 -26 1, 1444, -261, -261, -261, 6, -261, 54, -261, 88,983 62, -261, -261, -261, -261, 1370, 59, 91, -261, 36,984 -50, -261, -261, 1051, -261, -261, 63, 1370, -261, 293,985 -26 1, -261, -261, -261, 91, 1370, -12, -261, 856, 1051,986 77, -261, -261, -261, 1051, 1051, 1051, -261, -261, -261,987 -261, -261, -14, -261, -261, -261, 84, -44, 1116, 95,988 -261, 1051, 53, 3, -261, -36, 89, -261, -261, -261,989 104, 107, -45, -261, 96, -261, -261, 91, 1184, -261,990 1370, 92, 93, -261, 98, 101, 94, 921, 105, 102,991 -261, -261, 72, -261, -261, 9, -261, -61, 42, -261,992 -26 1, -261, -261, 376, -261, -261, -261, -261, 106, -261,993 -261, 986, 1051, -261, 103, -261, -261, -261, -261, -41,994 -261, -261, 1051, 1407, -261, -261, 1051, 110, -261, -261,995 -261, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051,996 1051, 1051, 1051, 1051, 1051, -261, 109, 23, -261, -261,997 -26 1, 1227, -261, -261, 111, -261, 1051, -261, -261, 25,998 -261, -261, 459, -261, -261, -261, -261, -261, 1051, 1051,999 -26 1, -261, -261, 1051, -261, 114, -261, -261, -261, 115,1000 1 12, 77, 116, -261, -261, -261, -261, -261, 53, 53,1001 -26 1, -261, -261, -261, -36, -36, -261, 104, 107, 76,1002 1051, 91, -261, -261, 145, 54, 625, 708, -6, -261,1003 791, 459, -261, -261, 117, -261, -261, 1051, 120, -261,1004 124, -261, -261, -261, -261, 791, 111, 112, 91, 125,1005 122, -261, -261, -261, 1051, -261, 118, 128, 180, -261,1006 126, 542, -261, -5, 1051, 542, 111, 1051, -261, -261,1007 -26 1, 123, 112, -261, -261, -261, -261958 1253, -20, -266, -266, -266, 148, -266, -266, -266, -266, 959 -266, -266, -266, -266, -266, -266, -266, -266, -266, -266, 960 -266, -266, -266, -266, -266, -39, -266, -266, -266, -266, 961 -266, -266, -266, -18, -2, 6, 21, -61, -266, 51, 962 1296, -266, 1370, -266, 25, -266, 1209, -266, -266, -266, 963 -266, 1370, 42, -266, -266, 50, -266, 71, 95, -266, 964 -266, -266, -266, 1296, 123, 105, -266, 9, -266, -266, 965 974, -266, -266, 81, -266, 1296, 290, -266, -266, -266, 966 -266, 125, 1296, -13, -266, 776, 974, 99, -266, -266, 967 -266, -266, 974, 974, 974, -266, -266, -266, -266, -266, 968 35, -266, -266, -266, 100, -6, 1040, 104, -266, 974, 969 36, -64, -266, -21, 102, -266, -266, -266, 113, 117, 970 -51, -266, 108, -266, -266, 1296, 129, 1109, -266, 97, 971 103, -266, 112, 114, 106, 842, 115, 116, -266, -266, 972 39, -266, -266, -43, -266, -18, 47, -266, -266, -266, 973 -266, 374, -266, -266, -266, -266, 118, -266, -266, 908, 974 974, -266, 120, -266, -266, -266, -266, 19, -266, -266, 975 974, 1333, -266, -266, 974, 119, -266, -266, -266, 974, 976 974, 974, 974, 974, 974, 974, 974, 974, 974, 974, 977 974, 974, 974, -266, 1152, 122, -29, -266, -266, -266, 978 -266, -266, 121, -266, 974, -266, -266, 5, -266, -266, 979 458, -266, -266, -266, -266, -266, 974, 974, -266, -266, 980 -266, 974, -266, 137, -266, -266, -266, 138, 111, -266, 981 142, -266, -266, -266, -266, 36, 36, -266, -266, -266, 982 -266, -21, -21, -266, 113, 117, 82, -266, 974, 129, 983 -266, 175, 50, 626, 710, 38, -266, 197, 458, -266, 984 -266, 141, -266, -266, 974, 155, -266, 145, -266, -266, 985 -266, -266, 197, 121, 111, 186, 159, 160, -266, -266, 986 -266, 974, -266, 166, 176, 236, -266, 174, 542, -266, 987 43, 974, 542, 121, 974, -266, -266, -266, 177, 111, 988 -266, -266, -266, -266 1008 989 }; 1009 990 … … 1011 992 static const yytype_int16 yypgoto[] = 1012 993 { 1013 -26 1, -24, -261, -261, -261, -261, -261, -261, 34, -261,1014 -26 1, -261, -261, 32, -261, -33, -261, -27, -26, -261,1015 -26 1, -261, 14, 16, 18, -261, -66, -87, -261, -92,1016 -85, 11, 12, -261, -261, -261, 141, 150, 161, 143,1017 -26 1, -261, -231, 5, -30, 224, -18, 0, -261, -261,1018 -261, 100, -119, -261, -17, -156, -25, -145, -243, -261,1019 -26 1, -261, -64, -260, -261, -261, -52, 21, -22, -261,1020 -261, -39, -261, -261, -261, -261, -261, -261, -261, -261,1021 -261, 191, -261, -261994 -266, -266, -266, -266, -266, -266, -266, 85, -266, -266, 995 -266, -266, -44, -266, -15, -266, -55, -19, -266, -266, 996 -266, 72, 70, 73, -266, -66, -83, -266, -92, -73, 997 13, 14, -266, -266, -266, 180, 206, 201, 184, -266, 998 -266, -241, -25, -30, 262, -4, 0, -266, -266, -266, 999 143, -122, -266, 22, -145, 16, -144, -226, -266, -266, 1000 -266, -17, -265, -266, -266, -54, 63, 20, -266, -266, 1001 4, -266, -266, -266, -266, -266, -266, -266, -266, -266, 1002 231, -266, -266 1022 1003 }; 1023 1004 … … 1026 1007 number is the opposite. If zero, do what YYDEFACT says. 1027 1008 If YYTABLE_NINF, syntax error. */ 1028 #define YYTABLE_NINF -16 61009 #define YYTABLE_NINF -165 1029 1010 static const yytype_int16 yytable[] = 1030 1011 { 1031 44, 55, 165, 164, 169, 80, 226, 123, 222, 200, 1032 71, 32, 33, 272, 193, 70, 288, 49, 185, 186, 1033 56, 178, 123, 88, 72, 50, 52, 53, 175, 278, 1034 89, 228, 58, 76, 176, 84, 304, 219, 170, 171, 1035 44, 66, 44, 86, 278, 209, 44, 127, 298, 194, 1036 59, 44, 298, 187, 188, 84, 54, 32, 33, 172, 1037 158, 161, 73, 173, 66, 44, 276, 301, 162, 69, 1038 53, 67, 219, 219, 68, 165, 225, 44, 60, 148, 1039 230, 78, 200, 6, 7, 44, 183, 219, 184, 235, 1040 220, 60, 61, 62, 63, 123, 6, 7, 127, 49, 1041 127, 251, 249, 219, 252, 110, 259, 87, 61, 62, 1042 63, 23, 24, -27, 258, 73, 222, 2, 3, 4, 1043 110, 61, 62, 63, 23, 24, 167, 168, 44, 79, 1044 44, 262, 263, 213, 214, 215, 52, 53, 264, 181, 1045 182, 305, 216, 180, 126, 189, 190, -76, -28, 233, 1046 238, 239, 217, 148, 219, 267, 174, 123, 240, 241, 1047 242, 243, 191, 244, 245, 268, 179, 192, 277, 205, 1048 195, 127, 206, 202, 203, 207, 210, 227, 211, 223, 1049 282, -117, 250, 277, 123, 270, -165, -138, 265, 266, 1050 219, 281, 293, 110, 283, 284, 296, 291, 292, 294, 1051 295, 44, 302, 271, 306, 246, 297, 234, 247, 81, 1052 165, 248, 148, 236, 237, 110, 110, 110, 110, 110, 1053 110, 110, 110, 110, 110, 110, 159, 85, 160, 51, 1054 201, 303, 273, 261, 269, 274, 285, 75, 0, 0, 1012 44, 77, 167, 163, 121, 199, 52, 220, 285, 191, 1013 68, 64, 162, 32, 33, 224, 275, 49, 65, 121, 1014 181, 66, 182, 176, 58, 50, 108, 269, 301, 6, 1015 7, 275, 64, 81, 183, 184, 217, 53, 69, 218, 1016 44, 108, 44, 207, 192, 126, 44, 73, 165, 166, 1017 249, 44, 81, 250, 59, 60, 61, 23, 24, 32, 1018 33, 159, 295, 44, 54, 178, 295, 173, 160, 185, 1019 186, 56, 199, 174, 58, 44, 146, 163, 228, 6, 1020 7, 84, 44, 85, 217, 57, 223, 256, 168, 169, 1021 86, 232, 226, 121, -75, 126, 67, 126, 217, 70, 1022 246, 211, 212, 213, 59, 60, 61, 23, 24, 170, 1023 214, 273, 255, 171, 220, 108, 298, 217, 74, -25, 1024 215, 70, 217, 179, 180, 44, 76, 44, 237, 238, 1025 239, 240, 49, 259, 260, 233, 234, 108, 108, 108, 1026 108, 108, 108, 108, 108, 108, 108, 108, 261, 302, 1027 83, 146, 2, 3, 4, 121, 59, 60, 61, 187, 1028 188, 217, 264, 124, 126, 274, 235, 236, 241, 242, 1029 156, -26, 189, 172, 195, 265, 177, 108, 190, 200, 1030 274, 279, 121, 193, 203, 201, 204, 208, 205, 290, 1031 217, -116, 221, 209, 44, 225, 248, -164, 268, 299, 1032 58, 2, 3, 4, 108, 6, 7, 8, 9, 10, 1033 146, 163, 262, 263, -27, 267, 278, 281, 11, 12, 1034 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 1035 280, 287, 288, 23, 24, 25, 26, 289, 27, 28, 1036 29, 30, 87, 31, 88, 89, 90, 91, 291, 292, 1037 92, 93, 293, 146, 146, 294, 231, 146, 146, 303, 1038 244, 243, 157, 78, 245, 82, 158, 51, 194, 94, 1039 270, 266, 146, 258, 271, 300, 282, 72, 0, 0, 1040 95, 96, 0, 97, 0, 0, 0, 0, 146, 0, 1041 0, 0, 146, 1, 2, 3, 4, 5, 6, 7, 1042 8, 9, 10, 129, 130, 131, 0, 132, 133, 134, 1043 135, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1044 20, 21, 22, 0, 0, 0, 23, 24, 25, 26, 1045 136, 27, 28, 29, 30, 87, 31, 88, 89, 90, 1046 91, 0, 0, 92, 93, 0, 0, 0, 0, 0, 1055 1047 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1056 0, 0, 0, 0, 290, 110, 148, 148, 0, 0, 1057 148, 148, 0, 0, 0, 0, 0, 0, 0, 0, 1058 0, 0, 0, 0, 0, 148, 0, 0, 0, 0, 1059 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 1060 0, 148, 0, 0, 0, 148, 1, 2, 3, 4, 1061 5, 6, 7, 8, 9, 10, 131, 132, 133, 0, 1062 134, 135, 136, 137, 11, 12, 13, 14, 15, 16, 1063 17, 18, 19, 20, 21, 22, 0, 0, 0, 23, 1064 24, 25, 26, 138, 27, 28, 29, 30, 90, 31, 1065 91, 92, 93, 0, 0, 94, 95, 0, 0, 0, 1048 0, 0, 94, 0, 0, 0, 137, 138, 0, 0, 1049 0, 0, 139, 95, 96, 0, 97, 1, 2, 3, 1050 4, 5, 6, 7, 8, 9, 10, 129, 130, 131, 1051 0, 132, 133, 134, 135, 11, 12, 13, 14, 15, 1052 16, 17, 18, 19, 20, 21, 22, 0, 0, 0, 1053 23, 24, 25, 26, 136, 27, 28, 29, 30, 87, 1054 31, 88, 89, 90, 91, 0, 0, 92, 93, 0, 1066 1055 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1067 0, 0, 0, 0, 96, 0, 0, 0, 139, 140, 1068 0, 0, 0, 0, 141, 97, 98, 0, 99, 1, 1069 2, 3, 4, 5, 6, 7, 8, 9, 10, 131, 1070 132, 133, 0, 134, 135, 136, 137, 11, 12, 13, 1056 0, 0, 0, 0, 0, 0, 94, 0, 0, 0, 1057 137, 219, 0, 0, 0, 0, 139, 95, 96, 0, 1058 97, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1059 10, 129, 130, 131, 0, 132, 133, 134, 135, 11, 1060 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 1061 22, 0, 0, 0, 23, 24, 25, 26, 136, 27, 1062 28, 29, 30, 87, 31, 88, 89, 90, 91, 0, 1063 0, 92, 93, 0, 0, 0, 0, 0, 0, 0, 1064 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1065 94, 0, 0, 0, 137, 0, 0, 0, 0, 0, 1066 139, 95, 96, 0, 97, 1, 2, 3, 4, 5, 1067 6, 7, 8, 9, 10, 129, 130, 131, 0, 132, 1068 133, 134, 135, 11, 12, 13, 14, 15, 16, 17, 1069 18, 19, 20, 21, 22, 0, 0, 0, 23, 24, 1070 25, 26, 136, 27, 28, 29, 30, 87, 31, 88, 1071 89, 90, 91, 0, 0, 92, 93, 0, 0, 0, 1072 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1073 0, 0, 0, 0, 94, 0, 0, 0, 76, 0, 1074 0, 0, 0, 0, 139, 95, 96, 0, 97, 1, 1075 2, 3, 4, 5, 6, 7, 8, 9, 10, 129, 1076 130, 131, 0, 132, 133, 134, 135, 11, 12, 13, 1071 1077 14, 15, 16, 17, 18, 19, 20, 21, 22, 0, 1072 0, 0, 23, 24, 25, 26, 138, 27, 28, 29, 1073 30, 90, 31, 91, 92, 93, 0, 0, 94, 95, 1078 0, 0, 23, 24, 25, 26, 136, 27, 28, 29, 1079 30, 87, 31, 88, 89, 90, 91, 0, 0, 92, 1080 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1081 0, 0, 0, 0, 0, 0, 0, 0, 94, 0, 1082 0, 0, 0, 0, 0, 0, 0, 0, 139, 95, 1083 96, 0, 97, 1, 2, 3, 4, 5, 6, 7, 1084 8, 9, 10, 0, 0, 0, 0, 0, 0, 0, 1085 0, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1086 20, 21, 22, 0, 0, 0, 23, 24, 25, 26, 1087 0, 27, 28, 29, 30, 87, 31, 88, 89, 90, 1088 91, 0, 0, 92, 93, 0, 0, 0, 0, 0, 1074 1089 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1075 0, 0, 0, 0, 0, 0, 0, 96, 0, 0, 1076 0, 139, 221, 0, 0, 0, 0, 141, 97, 98, 1077 0, 99, 1, 2, 3, 4, 5, 6, 7, 8, 1078 9, 10, 131, 132, 133, 0, 134, 135, 136, 137, 1079 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 1080 21, 22, 0, 0, 0, 23, 24, 25, 26, 138, 1081 27, 28, 29, 30, 90, 31, 91, 92, 93, 0, 1082 0, 94, 95, 0, 0, 0, 0, 0, 0, 0, 1083 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1084 96, 0, 0, 0, 139, 0, 0, 0, 0, 0, 1085 141, 97, 98, 0, 99, 1, 2, 3, 4, 5, 1086 6, 7, 8, 9, 10, 131, 132, 133, 0, 134, 1087 135, 136, 137, 11, 12, 13, 14, 15, 16, 17, 1088 18, 19, 20, 21, 22, 0, 0, 0, 23, 24, 1089 25, 26, 138, 27, 28, 29, 30, 90, 31, 91, 1090 92, 93, 0, 0, 94, 95, 0, 0, 0, 0, 1091 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092 0, 0, 0, 96, 0, 0, 0, 79, 0, 0, 1093 0, 0, 0, 141, 97, 98, 0, 99, 1, 2, 1094 3, 4, 5, 6, 7, 8, 9, 10, 131, 132, 1095 133, 0, 134, 135, 136, 137, 11, 12, 13, 14, 1096 15, 16, 17, 18, 19, 20, 21, 22, 0, 0, 1097 0, 23, 24, 25, 26, 138, 27, 28, 29, 30, 1098 90, 31, 91, 92, 93, 0, 0, 94, 95, 0, 1099 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1100 0, 0, 0, 0, 0, 0, 96, 0, 0, 0, 1101 0, 0, 0, 0, 0, 0, 141, 97, 98, 0, 1102 99, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1103 10, 0, 0, 0, 0, 0, 0, 0, 0, 11, 1104 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 1105 22, 0, 0, 0, 23, 24, 25, 26, 0, 27, 1106 28, 29, 30, 90, 31, 91, 92, 93, 0, 0, 1107 94, 95, 0, 0, 0, 0, 0, 0, 0, 0, 1108 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 1109 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, 1110 97, 98, 0, 99, 60, 2, 3, 4, 0, 6, 1111 7, 8, 9, 10, 0, 0, 0, 0, 0, 0, 1112 0, 0, 11, 12, 13, 14, 15, 16, 17, 18, 1113 19, 20, 21, 22, 0, 0, 0, 23, 24, 25, 1114 26, 0, 27, 28, 29, 30, 90, 31, 91, 92, 1115 93, 0, 0, 94, 95, 0, 0, 0, 0, 0, 1116 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1117 0, 0, 96, 0, 0, 0, 8, 9, 10, 0, 1118 0, 0, 0, 97, 98, 0, 99, 11, 12, 13, 1090 0, 0, 94, 0, 0, 0, 8, 9, 10, 0, 1091 0, 0, 139, 95, 96, 0, 97, 11, 12, 13, 1119 1092 14, 15, 16, 17, 18, 19, 20, 21, 22, 0, 1120 1093 0, 0, 0, 0, 25, 26, 0, 27, 28, 29, 1121 30, 90, 31, 91, 92, 93, 0, 0, 94, 95, 1094 30, 87, 31, 88, 89, 90, 91, 0, 0, 92, 1095 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1096 0, 0, 0, 0, 0, 0, 0, 0, 94, 0, 1097 0, 161, 8, 9, 10, 0, 0, 0, 0, 95, 1098 96, 0, 97, 11, 12, 13, 14, 15, 16, 17, 1099 18, 19, 20, 21, 22, 0, 0, 0, 0, 0, 1100 25, 26, 0, 27, 28, 29, 30, 87, 31, 88, 1101 89, 90, 91, 0, 0, 92, 93, 0, 0, 0, 1122 1102 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1123 0, 0, 0, 0, 0, 0, 0, 96, 0, 0,1124 163, 8, 9, 10, 0, 0, 0, 0, 97, 98,1125 0, 99, 11, 12, 13, 14, 15, 16, 17, 18,1126 19, 20, 21, 22, 0, 0, 0, 0, 0, 25,1127 2 6, 0, 27, 28, 29, 30, 90, 31, 91, 92,1128 93, 0, 0, 94, 95, 0, 0, 0, 0, 0,1103 0, 0, 0, 0, 94, 0, 0, 0, 8, 9, 1104 10, 0, 0, 0, 206, 95, 96, 0, 97, 11, 1105 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 1106 22, 0, 0, 0, 0, 0, 25, 26, 0, 27, 1107 28, 29, 30, 87, 31, 88, 89, 90, 91, 0, 1108 0, 92, 93, 0, 0, 0, 0, 0, 0, 0, 1129 1109 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1130 0, 0, 96, 0, 0, 0, 8, 9, 10, 0, 1131 0, 0, 208, 97, 98, 0, 99, 11, 12, 13, 1110 94, 0, 0, 222, 8, 9, 10, 0, 0, 0, 1111 0, 95, 96, 0, 97, 11, 12, 13, 14, 15, 1112 16, 17, 18, 19, 20, 21, 22, 0, 0, 0, 1113 0, 0, 25, 26, 0, 27, 28, 29, 30, 87, 1114 31, 88, 89, 90, 91, 0, 0, 92, 93, 0, 1115 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1116 0, 0, 0, 0, 0, 0, 94, 0, 0, 0, 1117 8, 9, 10, 0, 0, 0, 0, 95, 96, 0, 1118 97, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1119 20, 21, 22, 0, 0, 0, 0, 0, 25, 175, 1120 0, 27, 28, 29, 30, 87, 31, 88, 89, 90, 1121 91, 0, 0, 92, 93, 0, 0, 0, 0, 0, 1122 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1123 0, 0, 94, 2, 3, 4, 0, 0, 0, 8, 1124 9, 10, 0, 95, 96, 0, 97, 0, 0, 0, 1125 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 1126 21, 22, 0, 0, 0, 0, 0, 25, 26, 0, 1127 27, 28, 29, 30, 0, 31, 2, 3, 4, 0, 1128 0, 0, 8, 9, 10, 0, 0, 0, 0, 0, 1129 0, 0, 0, 11, 12, 13, 14, 15, 16, 17, 1130 18, 19, 20, 21, 22, 0, 198, 0, 0, 0, 1131 25, 26, 0, 27, 28, 29, 30, 0, 31, 0, 1132 0, 0, 0, 0, 0, 0, 0, 0, 0, 71, 1133 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 1134 9, 10, 0, 0, 0, 0, 0, 0, 0, 247, 1135 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 1136 21, 22, 0, 0, 0, 23, 24, 25, 26, 0, 1137 27, 28, 29, 30, 0, 31, 1, 2, 3, 4, 1138 5, 6, 7, 8, 9, 10, 0, 0, 0, 0, 1139 0, 0, 0, 0, 11, 12, 13, 14, 15, 16, 1140 17, 18, 19, 20, 21, 22, 0, 0, 0, 23, 1141 24, 25, 26, 0, 27, 28, 29, 30, 0, 31, 1142 2, 3, 4, 0, 0, 0, 8, 9, 10, 0, 1143 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, 1132 1144 14, 15, 16, 17, 18, 19, 20, 21, 22, 0, 1133 1145 0, 0, 0, 0, 25, 26, 0, 27, 28, 29, 1134 30, 90, 31, 91, 92, 93, 0, 0, 94, 95, 1135 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1136 0, 0, 0, 0, 0, 0, 0, 96, 0, 0, 1137 224, 8, 9, 10, 0, 0, 0, 0, 97, 98, 1138 0, 99, 11, 12, 13, 14, 15, 16, 17, 18, 1139 19, 20, 21, 22, 0, 0, 0, 0, 0, 25, 1140 26, 0, 27, 28, 29, 30, 90, 31, 91, 92, 1141 93, 0, 0, 94, 95, 0, 0, 0, 0, 0, 1142 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1143 0, 0, 96, 0, 0, 0, 8, 9, 10, 0, 1144 0, 0, 0, 97, 98, 0, 99, 11, 12, 13, 1145 14, 15, 16, 17, 18, 19, 20, 21, 22, 0, 1146 0, 0, 0, 0, 25, 177, 0, 27, 28, 29, 1147 30, 90, 31, 91, 92, 93, 0, 0, 94, 95, 1148 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1149 0, 0, 0, 0, 0, 0, 0, 96, 2, 3, 1150 4, 0, 0, 0, 8, 9, 10, 0, 97, 98, 1151 0, 99, 0, 0, 0, 11, 12, 13, 14, 15, 1152 16, 17, 18, 19, 20, 21, 22, 0, 0, 0, 1153 0, 0, 25, 26, 0, 27, 28, 29, 30, 0, 1154 31, 2, 3, 4, 0, 0, 0, 8, 9, 10, 1155 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 1156 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 1157 199, 0, 0, 0, 0, 25, 26, 0, 27, 28, 1158 29, 30, 0, 31, 0, 0, 0, 0, 0, 0, 1159 0, 0, 0, 74, 0, 0, 1, 2, 3, 4, 1160 5, 6, 7, 8, 9, 10, 0, 0, 0, 0, 1161 0, 0, 0, 253, 11, 12, 13, 14, 15, 16, 1162 17, 18, 19, 20, 21, 22, 0, 0, 0, 23, 1163 24, 25, 26, 0, 27, 28, 29, 30, 0, 31, 1164 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1165 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 1166 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 1167 0, 0, 0, 23, 24, 25, 26, 0, 27, 28, 1168 29, 30, 0, 31, 2, 3, 4, 0, 0, 0, 1169 8, 9, 10, 0, 0, 0, 0, 0, 0, 0, 1146 30, 0, 31, 8, 9, 10, 0, 0, 0, 0, 1147 0, 0, 0, 0, 11, 12, 13, 14, 15, 16, 1148 17, 18, 19, 20, 21, 22, 0, 0, 0, 0, 1149 0, 25, 26, 0, 27, 28, 29, 30, 229, 31, 1150 8, 9, 10, 230, 0, 0, 0, 0, 0, 0, 1170 1151 0, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1171 1152 20, 21, 22, 0, 0, 0, 0, 0, 25, 26, 1172 0, 27, 28, 29, 30, 0, 31, 8, 9, 10, 1173 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, 1174 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 1175 0, 0, 0, 0, 0, 25, 26, 0, 27, 28, 1176 29, 30, 231, 232, 8, 9, 10, 0, 0, 0, 1177 0, 0, 0, 0, 0, 11, 12, 13, 14, 15, 1178 16, 17, 18, 19, 20, 21, 22, 0, 0, 0, 1179 0, 0, 25, 26, 0, 27, 28, 29, 30, 0, 1180 31 1153 0, 27, 28, 29, 30, 0, 31 1181 1154 }; 1182 1155 1183 1156 static const yytype_int16 yycheck[] = 1184 1157 { 1185 0, 25, 89, 88, 96, 57, 162, 73, 153, 128, 1186 40, 0, 0, 256, 59, 39, 276, 37, 54, 55, 1187 81, 108, 88, 73, 42, 45, 45, 46, 72, 260, 1188 80, 72, 72, 51, 78, 65, 296, 78, 52, 53, 1189 40, 36, 42, 67, 275, 137, 46, 77, 291, 94, 1190 78, 51, 295, 89, 90, 85, 75, 46, 46, 73, 1191 84, 73, 73, 77, 59, 65, 72, 72, 80, 45, 1192 46, 78, 78, 78, 81, 162, 161, 77, 3, 79, 1193 172, 75, 201, 8, 9, 85, 83, 78, 85, 176, 1194 81, 3, 33, 34, 35, 161, 8, 9, 128, 37, 1195 130, 78, 194, 78, 81, 73, 81, 71, 33, 34, 1196 35, 36, 37, 71, 206, 73, 261, 4, 5, 6, 1197 88, 33, 34, 35, 36, 37, 94, 95, 128, 75, 1198 130, 218, 219, 61, 62, 63, 45, 46, 223, 86, 1199 87, 297, 70, 111, 81, 56, 57, 72, 71, 173, 1200 183, 184, 80, 153, 78, 79, 72, 223, 185, 186, 1201 187, 188, 58, 189, 190, 250, 71, 60, 260, 71, 1202 74, 201, 71, 81, 81, 81, 71, 74, 76, 73, 1203 267, 71, 73, 275, 250, 40, 75, 71, 74, 74, 1204 78, 74, 284, 161, 74, 71, 16, 72, 76, 81, 1205 72, 201, 294, 255, 81, 191, 80, 173, 192, 59, 1206 297, 193, 212, 181, 182, 183, 184, 185, 186, 187, 1207 188, 189, 190, 191, 192, 193, 85, 66, 85, 5, 1208 130, 295, 257, 212, 251, 257, 275, 46, -1, -1, 1158 0, 55, 94, 86, 70, 127, 45, 151, 273, 60, 1159 40, 36, 85, 0, 0, 160, 257, 37, 79, 85, 1160 84, 82, 86, 106, 3, 45, 70, 253, 293, 8, 1161 9, 272, 57, 63, 55, 56, 79, 76, 42, 82, 1162 40, 85, 42, 135, 95, 75, 46, 51, 92, 93, 1163 79, 51, 82, 82, 33, 34, 35, 36, 37, 46, 1164 46, 74, 288, 63, 82, 109, 292, 73, 81, 90, 1165 91, 73, 194, 79, 3, 75, 76, 160, 170, 8, 1166 9, 72, 82, 74, 79, 79, 159, 82, 53, 54, 1167 81, 174, 73, 159, 73, 125, 45, 127, 79, 74, 1168 192, 62, 63, 64, 33, 34, 35, 36, 37, 74, 1169 71, 73, 204, 78, 258, 159, 73, 79, 76, 72, 1170 81, 74, 79, 87, 88, 125, 76, 127, 183, 184, 1171 185, 186, 37, 216, 217, 179, 180, 181, 182, 183, 1172 184, 185, 186, 187, 188, 189, 190, 191, 221, 294, 1173 45, 151, 4, 5, 6, 221, 33, 34, 35, 57, 1174 58, 79, 80, 82, 194, 257, 181, 182, 187, 188, 1175 45, 72, 59, 73, 45, 248, 72, 221, 61, 82, 1176 272, 264, 248, 75, 72, 82, 72, 72, 82, 281, 1177 79, 72, 74, 77, 194, 75, 74, 76, 252, 291, 1178 3, 4, 5, 6, 248, 8, 9, 10, 11, 12, 1179 210, 294, 75, 75, 72, 40, 75, 72, 21, 22, 1180 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 1181 75, 45, 73, 36, 37, 38, 39, 77, 41, 42, 1182 43, 44, 45, 46, 47, 48, 49, 50, 82, 73, 1183 53, 54, 16, 253, 254, 81, 171, 257, 258, 82, 1184 190, 189, 82, 57, 191, 64, 82, 5, 125, 72, 1185 254, 249, 272, 210, 254, 292, 272, 46, -1, -1, 1186 83, 84, -1, 86, -1, -1, -1, -1, 288, -1, 1187 -1, -1, 292, 3, 4, 5, 6, 7, 8, 9, 1188 10, 11, 12, 13, 14, 15, -1, 17, 18, 19, 1189 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 1190 30, 31, 32, -1, -1, -1, 36, 37, 38, 39, 1191 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 1192 50, -1, -1, 53, 54, -1, -1, -1, -1, -1, 1209 1193 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1210 -1, -1, -1, -1, 278, 223, 256, 257, -1, -1, 1211 260, 261, -1, -1, -1, -1, -1, -1, -1, -1, 1212 -1, -1, -1, -1, -1, 275, -1, -1, -1, -1, 1213 -1, -1, 250, -1, -1, -1, -1, -1, -1, -1, 1214 -1, 291, -1, -1, -1, 295, 3, 4, 5, 6, 1215 7, 8, 9, 10, 11, 12, 13, 14, 15, -1, 1216 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 1217 27, 28, 29, 30, 31, 32, -1, -1, -1, 36, 1218 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 1219 47, 48, 49, -1, -1, 52, 53, -1, -1, -1, 1194 -1, -1, 72, -1, -1, -1, 76, 77, -1, -1, 1195 -1, -1, 82, 83, 84, -1, 86, 3, 4, 5, 1196 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1197 -1, 17, 18, 19, 20, 21, 22, 23, 24, 25, 1198 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, 1199 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 1200 46, 47, 48, 49, 50, -1, -1, 53, 54, -1, 1220 1201 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1221 -1, -1, -1, -1, 71, -1, -1, -1, 75, 76, 1222 -1, -1, -1, -1, 81, 82, 83, -1, 85, 3, 1202 -1, -1, -1, -1, -1, -1, 72, -1, -1, -1, 1203 76, 77, -1, -1, -1, -1, 82, 83, 84, -1, 1204 86, 3, 4, 5, 6, 7, 8, 9, 10, 11, 1205 12, 13, 14, 15, -1, 17, 18, 19, 20, 21, 1206 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 1207 32, -1, -1, -1, 36, 37, 38, 39, 40, 41, 1208 42, 43, 44, 45, 46, 47, 48, 49, 50, -1, 1209 -1, 53, 54, -1, -1, -1, -1, -1, -1, -1, 1210 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1211 72, -1, -1, -1, 76, -1, -1, -1, -1, -1, 1212 82, 83, 84, -1, 86, 3, 4, 5, 6, 7, 1213 8, 9, 10, 11, 12, 13, 14, 15, -1, 17, 1214 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 1215 28, 29, 30, 31, 32, -1, -1, -1, 36, 37, 1216 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 1217 48, 49, 50, -1, -1, 53, 54, -1, -1, -1, 1218 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1219 -1, -1, -1, -1, 72, -1, -1, -1, 76, -1, 1220 -1, -1, -1, -1, 82, 83, 84, -1, 86, 3, 1223 1221 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 1224 1222 14, 15, -1, 17, 18, 19, 20, 21, 22, 23, 1225 1223 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, 1226 1224 -1, -1, 36, 37, 38, 39, 40, 41, 42, 43, 1227 44, 45, 46, 47, 48, 49, -1, -1, 52, 53, 1225 44, 45, 46, 47, 48, 49, 50, -1, -1, 53, 1226 54, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1227 -1, -1, -1, -1, -1, -1, -1, -1, 72, -1, 1228 -1, -1, -1, -1, -1, -1, -1, -1, 82, 83, 1229 84, -1, 86, 3, 4, 5, 6, 7, 8, 9, 1230 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 1231 -1, 21, 22, 23, 24, 25, 26, 27, 28, 29, 1232 30, 31, 32, -1, -1, -1, 36, 37, 38, 39, 1233 -1, 41, 42, 43, 44, 45, 46, 47, 48, 49, 1234 50, -1, -1, 53, 54, -1, -1, -1, -1, -1, 1228 1235 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1229 -1, -1, -1, -1, -1, -1, -1, 71, -1, -1, 1230 -1, 75, 76, -1, -1, -1, -1, 81, 82, 83, 1231 -1, 85, 3, 4, 5, 6, 7, 8, 9, 10, 1232 11, 12, 13, 14, 15, -1, 17, 18, 19, 20, 1233 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 1234 31, 32, -1, -1, -1, 36, 37, 38, 39, 40, 1235 41, 42, 43, 44, 45, 46, 47, 48, 49, -1, 1236 -1, 52, 53, -1, -1, -1, -1, -1, -1, -1, 1237 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1238 71, -1, -1, -1, 75, -1, -1, -1, -1, -1, 1239 81, 82, 83, -1, 85, 3, 4, 5, 6, 7, 1240 8, 9, 10, 11, 12, 13, 14, 15, -1, 17, 1241 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 1242 28, 29, 30, 31, 32, -1, -1, -1, 36, 37, 1243 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 1244 48, 49, -1, -1, 52, 53, -1, -1, -1, -1, 1245 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1246 -1, -1, -1, 71, -1, -1, -1, 75, -1, -1, 1247 -1, -1, -1, 81, 82, 83, -1, 85, 3, 4, 1248 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 1249 15, -1, 17, 18, 19, 20, 21, 22, 23, 24, 1250 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, 1251 -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 1252 45, 46, 47, 48, 49, -1, -1, 52, 53, -1, 1253 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1254 -1, -1, -1, -1, -1, -1, 71, -1, -1, -1, 1255 -1, -1, -1, -1, -1, -1, 81, 82, 83, -1, 1256 85, 3, 4, 5, 6, 7, 8, 9, 10, 11, 1257 12, -1, -1, -1, -1, -1, -1, -1, -1, 21, 1258 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 1259 32, -1, -1, -1, 36, 37, 38, 39, -1, 41, 1260 42, 43, 44, 45, 46, 47, 48, 49, -1, -1, 1261 52, 53, -1, -1, -1, -1, -1, -1, -1, -1, 1262 -1, -1, -1, -1, -1, -1, -1, -1, -1, 71, 1263 -1, -1, -1, -1, -1, -1, -1, -1, -1, 81, 1264 82, 83, -1, 85, 3, 4, 5, 6, -1, 8, 1265 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, 1266 -1, -1, 21, 22, 23, 24, 25, 26, 27, 28, 1267 29, 30, 31, 32, -1, -1, -1, 36, 37, 38, 1268 39, -1, 41, 42, 43, 44, 45, 46, 47, 48, 1269 49, -1, -1, 52, 53, -1, -1, -1, -1, -1, 1270 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1271 -1, -1, 71, -1, -1, -1, 10, 11, 12, -1, 1272 -1, -1, -1, 82, 83, -1, 85, 21, 22, 23, 1236 -1, -1, 72, -1, -1, -1, 10, 11, 12, -1, 1237 -1, -1, 82, 83, 84, -1, 86, 21, 22, 23, 1273 1238 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, 1274 1239 -1, -1, -1, -1, 38, 39, -1, 41, 42, 43, 1275 44, 45, 46, 47, 48, 49, -1, -1, 52, 53, 1240 44, 45, 46, 47, 48, 49, 50, -1, -1, 53, 1241 54, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1242 -1, -1, -1, -1, -1, -1, -1, -1, 72, -1, 1243 -1, 75, 10, 11, 12, -1, -1, -1, -1, 83, 1244 84, -1, 86, 21, 22, 23, 24, 25, 26, 27, 1245 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, 1246 38, 39, -1, 41, 42, 43, 44, 45, 46, 47, 1247 48, 49, 50, -1, -1, 53, 54, -1, -1, -1, 1276 1248 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1277 -1, -1, -1, -1, -1, -1, -1, 71, -1, -1,1278 74, 10, 11, 12, -1, -1, -1, -1, 82, 83,1279 -1, 85, 21, 22, 23, 24, 25, 26, 27, 28,1280 29, 30, 31, 32, -1, -1, -1, -1, -1, 38,1281 39, -1, 41, 42, 43, 44, 45, 46, 47, 48,1282 49, -1, -1, 52, 53, -1, -1, -1, -1, -1,1249 -1, -1, -1, -1, 72, -1, -1, -1, 10, 11, 1250 12, -1, -1, -1, 82, 83, 84, -1, 86, 21, 1251 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 1252 32, -1, -1, -1, -1, -1, 38, 39, -1, 41, 1253 42, 43, 44, 45, 46, 47, 48, 49, 50, -1, 1254 -1, 53, 54, -1, -1, -1, -1, -1, -1, -1, 1283 1255 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1284 -1, -1, 71, -1, -1, -1, 10, 11, 12, -1, 1285 -1, -1, 81, 82, 83, -1, 85, 21, 22, 23, 1256 72, -1, -1, 75, 10, 11, 12, -1, -1, -1, 1257 -1, 83, 84, -1, 86, 21, 22, 23, 24, 25, 1258 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, 1259 -1, -1, 38, 39, -1, 41, 42, 43, 44, 45, 1260 46, 47, 48, 49, 50, -1, -1, 53, 54, -1, 1261 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1262 -1, -1, -1, -1, -1, -1, 72, -1, -1, -1, 1263 10, 11, 12, -1, -1, -1, -1, 83, 84, -1, 1264 86, 21, 22, 23, 24, 25, 26, 27, 28, 29, 1265 30, 31, 32, -1, -1, -1, -1, -1, 38, 39, 1266 -1, 41, 42, 43, 44, 45, 46, 47, 48, 49, 1267 50, -1, -1, 53, 54, -1, -1, -1, -1, -1, 1268 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1269 -1, -1, 72, 4, 5, 6, -1, -1, -1, 10, 1270 11, 12, -1, 83, 84, -1, 86, -1, -1, -1, 1271 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 1272 31, 32, -1, -1, -1, -1, -1, 38, 39, -1, 1273 41, 42, 43, 44, -1, 46, 4, 5, 6, -1, 1274 -1, -1, 10, 11, 12, -1, -1, -1, -1, -1, 1275 -1, -1, -1, 21, 22, 23, 24, 25, 26, 27, 1276 28, 29, 30, 31, 32, -1, 77, -1, -1, -1, 1277 38, 39, -1, 41, 42, 43, 44, -1, 46, -1, 1278 -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1279 -1, -1, 3, 4, 5, 6, 7, 8, 9, 10, 1280 11, 12, -1, -1, -1, -1, -1, -1, -1, 77, 1281 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 1282 31, 32, -1, -1, -1, 36, 37, 38, 39, -1, 1283 41, 42, 43, 44, -1, 46, 3, 4, 5, 6, 1284 7, 8, 9, 10, 11, 12, -1, -1, -1, -1, 1285 -1, -1, -1, -1, 21, 22, 23, 24, 25, 26, 1286 27, 28, 29, 30, 31, 32, -1, -1, -1, 36, 1287 37, 38, 39, -1, 41, 42, 43, 44, -1, 46, 1288 4, 5, 6, -1, -1, -1, 10, 11, 12, -1, 1289 -1, -1, -1, -1, -1, -1, -1, 21, 22, 23, 1286 1290 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, 1287 1291 -1, -1, -1, -1, 38, 39, -1, 41, 42, 43, 1288 44, 45, 46, 47, 48, 49, -1, -1, 52, 53, 1289 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1290 -1, -1, -1, -1, -1, -1, -1, 71, -1, -1, 1291 74, 10, 11, 12, -1, -1, -1, -1, 82, 83, 1292 -1, 85, 21, 22, 23, 24, 25, 26, 27, 28, 1293 29, 30, 31, 32, -1, -1, -1, -1, -1, 38, 1294 39, -1, 41, 42, 43, 44, 45, 46, 47, 48, 1295 49, -1, -1, 52, 53, -1, -1, -1, -1, -1, 1296 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1297 -1, -1, 71, -1, -1, -1, 10, 11, 12, -1, 1298 -1, -1, -1, 82, 83, -1, 85, 21, 22, 23, 1299 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, 1300 -1, -1, -1, -1, 38, 39, -1, 41, 42, 43, 1301 44, 45, 46, 47, 48, 49, -1, -1, 52, 53, 1302 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1303 -1, -1, -1, -1, -1, -1, -1, 71, 4, 5, 1304 6, -1, -1, -1, 10, 11, 12, -1, 82, 83, 1305 -1, 85, -1, -1, -1, 21, 22, 23, 24, 25, 1306 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, 1307 -1, -1, 38, 39, -1, 41, 42, 43, 44, -1, 1308 46, 4, 5, 6, -1, -1, -1, 10, 11, 12, 1309 -1, -1, -1, -1, -1, -1, -1, -1, 21, 22, 1310 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 1311 76, -1, -1, -1, -1, 38, 39, -1, 41, 42, 1312 43, 44, -1, 46, -1, -1, -1, -1, -1, -1, 1313 -1, -1, -1, 0, -1, -1, 3, 4, 5, 6, 1314 7, 8, 9, 10, 11, 12, -1, -1, -1, -1, 1315 -1, -1, -1, 76, 21, 22, 23, 24, 25, 26, 1316 27, 28, 29, 30, 31, 32, -1, -1, -1, 36, 1317 37, 38, 39, -1, 41, 42, 43, 44, -1, 46, 1318 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1319 -1, -1, -1, -1, -1, -1, -1, -1, 21, 22, 1320 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 1321 -1, -1, -1, 36, 37, 38, 39, -1, 41, 42, 1322 43, 44, -1, 46, 4, 5, 6, -1, -1, -1, 1323 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 1292 44, -1, 46, 10, 11, 12, -1, -1, -1, -1, 1293 -1, -1, -1, -1, 21, 22, 23, 24, 25, 26, 1294 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, 1295 -1, 38, 39, -1, 41, 42, 43, 44, 45, 46, 1296 10, 11, 12, 50, -1, -1, -1, -1, -1, -1, 1324 1297 -1, 21, 22, 23, 24, 25, 26, 27, 28, 29, 1325 1298 30, 31, 32, -1, -1, -1, -1, -1, 38, 39, 1326 -1, 41, 42, 43, 44, -1, 46, 10, 11, 12, 1327 -1, -1, -1, -1, -1, -1, -1, -1, 21, 22, 1328 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 1329 -1, -1, -1, -1, -1, 38, 39, -1, 41, 42, 1330 43, 44, 45, 46, 10, 11, 12, -1, -1, -1, 1331 -1, -1, -1, -1, -1, 21, 22, 23, 24, 25, 1332 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, 1333 -1, -1, 38, 39, -1, 41, 42, 43, 44, -1, 1334 46 1299 -1, 41, 42, 43, 44, -1, 46 1335 1300 }; 1336 1301 … … 1344 1309 44, 46, 126, 127, 128, 129, 130, 135, 136, 137, 1345 1310 138, 139, 140, 141, 142, 143, 175, 176, 177, 37, 1346 45, 140, 45, 46, 75, 96, 81, 178, 72, 78,1347 3, 33, 34, 35, 132, 133, 138, 78, 81, 45,1348 96, 139, 141, 73, 0, 176, 141, 145, 75, 75,1349 1 61, 132, 131, 134, 139, 133, 96, 71, 73, 80,1350 4 5, 47, 48, 49, 52, 53, 71, 82, 83, 85,1351 9 7, 98, 99, 101, 102, 103, 104, 105, 106, 107,1352 1 08, 109, 110, 111, 112, 113, 114, 115, 116, 117,1353 1 18, 119, 120, 121, 125, 142, 81, 139, 146, 147,1354 144, 13, 14, 15, 17, 18, 19, 20, 40, 75,1355 76, 81, 108, 121, 122, 124, 126, 127, 142, 151,1356 15 2, 153, 154, 162, 163, 164, 167, 174, 96, 131,1357 134, 73, 80, 74, 125, 122, 150, 108, 108, 124,1358 52, 53, 73, 77, 72, 72, 78, 39, 122, 71,1359 108, 86, 87, 83, 85, 54, 55, 89, 90, 56,1360 57, 58, 60, 59, 94, 74, 96, 148, 149, 76,1361 147, 146, 81, 81, 169, 71, 71, 81, 81, 124,1362 71, 76, 155, 61, 62, 63, 70, 80, 123, 78,1363 81, 76, 152, 73, 74, 125, 150, 74, 72, 100,1364 124, 45, 46, 96, 103, 122, 108, 108, 110, 110,1365 112, 11 2, 112, 112, 113, 113, 117, 118, 119, 124,1366 73, 78, 81, 76, 158, 159, 160, 170, 124, 81,1367 1 68, 162, 122, 122, 125, 74, 74, 79, 125, 149,1368 40, 161, 153, 151, 163, 171, 72, 124, 137, 166,1369 156, 74, 122, 74, 71, 166, 172, 173, 158, 165,1370 96, 72, 76, 124, 81, 72, 16, 80, 153, 157,1371 1 61, 72, 124, 157, 158, 150, 811311 45, 140, 45, 76, 82, 178, 73, 79, 3, 33, 1312 34, 35, 132, 133, 138, 79, 82, 45, 139, 141, 1313 74, 0, 176, 141, 76, 145, 76, 161, 132, 131, 1314 134, 139, 133, 45, 72, 74, 81, 45, 47, 48, 1315 49, 50, 53, 54, 72, 83, 84, 86, 97, 98, 1316 99, 101, 102, 103, 104, 105, 106, 107, 108, 109, 1317 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 1318 120, 121, 125, 142, 82, 144, 139, 146, 147, 13, 1319 14, 15, 17, 18, 19, 20, 40, 76, 77, 82, 1320 108, 121, 122, 124, 126, 127, 142, 151, 152, 153, 1321 154, 162, 163, 164, 167, 174, 45, 131, 134, 74, 1322 81, 75, 125, 122, 150, 108, 108, 124, 53, 54, 1323 74, 78, 73, 73, 79, 39, 122, 72, 108, 87, 1324 88, 84, 86, 55, 56, 90, 91, 57, 58, 59, 1325 61, 60, 95, 75, 146, 45, 148, 149, 77, 147, 1326 82, 82, 169, 72, 72, 82, 82, 124, 72, 77, 1327 155, 62, 63, 64, 71, 81, 123, 79, 82, 77, 1328 152, 74, 75, 125, 150, 75, 73, 100, 124, 45, 1329 50, 103, 122, 108, 108, 110, 110, 112, 112, 112, 1330 112, 113, 113, 117, 118, 119, 124, 77, 74, 79, 1331 82, 158, 159, 160, 170, 124, 82, 168, 162, 122, 1332 122, 125, 75, 75, 80, 125, 149, 40, 161, 153, 1333 151, 163, 171, 73, 124, 137, 166, 156, 75, 122, 1334 75, 72, 166, 172, 173, 158, 165, 45, 73, 77, 1335 124, 82, 73, 16, 81, 153, 157, 161, 73, 124, 1336 157, 158, 150, 82 1372 1337 }; 1373 1338 … … 1402 1367 else \ 1403 1368 { \ 1404 yyerror ( &yylloc,context, YY_("syntax error: cannot back up")); \1369 yyerror (context, YY_("syntax error: cannot back up")); \ 1405 1370 YYERROR; \ 1406 1371 } \ … … 1457 1422 1458 1423 #ifdef YYLEX_PARAM 1459 # define YYLEX yylex (&yylval, &yylloc,YYLEX_PARAM)1424 # define YYLEX yylex (&yylval, YYLEX_PARAM) 1460 1425 #else 1461 # define YYLEX yylex (&yylval , &yylloc)1426 # define YYLEX yylex (&yylval) 1462 1427 #endif 1463 1428 … … 1482 1447 YYFPRINTF (stderr, "%s ", Title); \ 1483 1448 yy_symbol_print (stderr, \ 1484 Type, Value, Location,context); \1449 Type, Value, context); \ 1485 1450 YYFPRINTF (stderr, "\n"); \ 1486 1451 } \ … … 1496 1461 || defined __cplusplus || defined _MSC_VER) 1497 1462 static void 1498 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp,TParseContext* context)1463 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, TParseContext* context) 1499 1464 #else 1500 1465 static void 1501 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp,context)1466 yy_symbol_value_print (yyoutput, yytype, yyvaluep, context) 1502 1467 FILE *yyoutput; 1503 1468 int yytype; 1504 1469 YYSTYPE const * const yyvaluep; 1505 YYLTYPE const * const yylocationp;1506 1470 TParseContext* context; 1507 1471 #endif … … 1509 1473 if (!yyvaluep) 1510 1474 return; 1511 YYUSE (yylocationp);1512 1475 YYUSE (context); 1513 1476 # ifdef YYPRINT … … 1532 1495 || defined __cplusplus || defined _MSC_VER) 1533 1496 static void 1534 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp,TParseContext* context)1497 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, TParseContext* context) 1535 1498 #else 1536 1499 static void 1537 yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp,context)1500 yy_symbol_print (yyoutput, yytype, yyvaluep, context) 1538 1501 FILE *yyoutput; 1539 1502 int yytype; 1540 1503 YYSTYPE const * const yyvaluep; 1541 YYLTYPE const * const yylocationp;1542 1504 TParseContext* context; 1543 1505 #endif … … 1548 1510 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); 1549 1511 1550 YY_LOCATION_PRINT (yyoutput, *yylocationp); 1551 YYFPRINTF (yyoutput, ": "); 1552 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, context); 1512 yy_symbol_value_print (yyoutput, yytype, yyvaluep, context); 1553 1513 YYFPRINTF (yyoutput, ")"); 1554 1514 } … … 1590 1550 || defined __cplusplus || defined _MSC_VER) 1591 1551 static void 1592 yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp,int yyrule, TParseContext* context)1552 yy_reduce_print (YYSTYPE *yyvsp, int yyrule, TParseContext* context) 1593 1553 #else 1594 1554 static void 1595 yy_reduce_print (yyvsp, yy lsp, yyrule, context)1555 yy_reduce_print (yyvsp, yyrule, context) 1596 1556 YYSTYPE *yyvsp; 1597 YYLTYPE *yylsp;1598 1557 int yyrule; 1599 1558 TParseContext* context; … … 1611 1570 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], 1612 1571 &(yyvsp[(yyi + 1) - (yynrhs)]) 1613 , &(yylsp[(yyi + 1) - (yynrhs)]), context);1572 , context); 1614 1573 fprintf (stderr, "\n"); 1615 1574 } … … 1619 1578 do { \ 1620 1579 if (yydebug) \ 1621 yy_reduce_print (yyvsp, yylsp,Rule, context); \1580 yy_reduce_print (yyvsp, Rule, context); \ 1622 1581 } while (YYID (0)) 1623 1582 … … 1872 1831 || defined __cplusplus || defined _MSC_VER) 1873 1832 static void 1874 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp,TParseContext* context)1833 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, TParseContext* context) 1875 1834 #else 1876 1835 static void 1877 yydestruct (yymsg, yytype, yyvaluep, yylocationp,context)1836 yydestruct (yymsg, yytype, yyvaluep, context) 1878 1837 const char *yymsg; 1879 1838 int yytype; 1880 1839 YYSTYPE *yyvaluep; 1881 YYLTYPE *yylocationp;1882 1840 TParseContext* context; 1883 1841 #endif 1884 1842 { 1885 1843 YYUSE (yyvaluep); 1886 YYUSE (yylocationp);1887 1844 YYUSE (context); 1888 1845 … … 1956 1913 /* Number of syntax errors so far. */ 1957 1914 int yynerrs; 1958 /* Location data for the look-ahead symbol. */1959 YYLTYPE yylloc;1960 1915 1961 1916 int yystate; … … 1991 1946 YYSTYPE *yyvsp; 1992 1947 1993 /* The location stack. */ 1994 YYLTYPE yylsa[YYINITDEPTH]; 1995 YYLTYPE *yyls = yylsa; 1996 YYLTYPE *yylsp; 1997 /* The locations where the error started and ended. */ 1998 YYLTYPE yyerror_range[2]; 1999 2000 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) 1948 1949 1950 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 2001 1951 2002 1952 YYSIZE_T yystacksize = YYINITDEPTH; … … 2005 1955 action routines. */ 2006 1956 YYSTYPE yyval; 2007 YYLTYPE yyloc; 1957 2008 1958 2009 1959 /* The number of symbols on the RHS of the reduced rule. … … 2025 1975 yyssp = yyss; 2026 1976 yyvsp = yyvs; 2027 yylsp = yyls;2028 #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL2029 /* Initialize the default location before parsing starts. */2030 yylloc.first_line = yylloc.last_line = 1;2031 yylloc.first_column = yylloc.last_column = 0;2032 #endif2033 1977 2034 1978 goto yysetstate; … … 2057 2001 YYSTYPE *yyvs1 = yyvs; 2058 2002 yytype_int16 *yyss1 = yyss; 2059 YYLTYPE *yyls1 = yyls; 2003 2060 2004 2061 2005 /* Each stack pointer address is followed by the size of the … … 2066 2010 &yyss1, yysize * sizeof (*yyssp), 2067 2011 &yyvs1, yysize * sizeof (*yyvsp), 2068 &yyls1, yysize * sizeof (*yylsp), 2012 2069 2013 &yystacksize); 2070 yyls = yyls1; 2014 2071 2015 yyss = yyss1; 2072 2016 yyvs = yyvs1; … … 2091 2035 YYSTACK_RELOCATE (yyss); 2092 2036 YYSTACK_RELOCATE (yyvs); 2093 YYSTACK_RELOCATE (yyls); 2037 2094 2038 # undef YYSTACK_RELOCATE 2095 2039 if (yyss1 != yyssa) … … 2101 2045 yyssp = yyss + yysize - 1; 2102 2046 yyvsp = yyvs + yysize - 1; 2103 yylsp = yyls + yysize - 1; 2047 2104 2048 2105 2049 YYDPRINTF ((stderr, "Stack size increased to %lu\n", … … 2178 2122 yystate = yyn; 2179 2123 *++yyvsp = yylval; 2180 *++yylsp = yylloc; 2124 2181 2125 goto yynewstate; 2182 2126 … … 2209 2153 yyval = yyvsp[1-yylen]; 2210 2154 2211 /* Default location. */ 2212 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); 2155 2213 2156 YY_REDUCE_PRINT (yyn); 2214 2157 switch (yyn) 2215 2158 { 2216 case 4:2159 case 2: 2217 2160 2218 2161 { … … 2221 2164 const TVariable* variable; 2222 2165 if (symbol == 0) { 2223 context->error((yy lsp[(1) - (1)]), "undeclared identifier", (yyvsp[(1) - (1)].lex).string->c_str());2166 context->error((yyvsp[(1) - (1)].lex).line, "undeclared identifier", (yyvsp[(1) - (1)].lex).string->c_str()); 2224 2167 context->recover(); 2225 2168 TType type(EbtFloat, EbpUndefined); … … 2230 2173 // This identifier can only be a variable type symbol 2231 2174 if (! symbol->isVariable()) { 2232 context->error((yy lsp[(1) - (1)]), "variable expected", (yyvsp[(1) - (1)].lex).string->c_str());2175 context->error((yyvsp[(1) - (1)].lex).line, "variable expected", (yyvsp[(1) - (1)].lex).string->c_str()); 2233 2176 context->recover(); 2234 2177 } 2235 2236 2178 variable = static_cast<const TVariable*>(symbol); 2237 2238 if (context->isVariableBuiltIn(variable) &&2239 !variable->getExtension().empty() &&2240 context->extensionErrorCheck((yylsp[(1) - (1)]), variable->getExtension())) {2241 context->recover();2242 }2243 2179 } 2244 2180 … … 2249 2185 ConstantUnion* constArray = variable->getConstPointer(); 2250 2186 TType t(variable->getType()); 2251 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(constArray, t, (yy lsp[(1) - (1)]));2187 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(constArray, t, (yyvsp[(1) - (1)].lex).line); 2252 2188 } else 2253 2189 (yyval.interm.intermTypedNode) = context->intermediate.addSymbol(variable->getUniqueId(), 2254 variable->getName(), 2255 variable->getType(), 2256 (yylsp[(1) - (1)])); 2257 ;} 2258 break; 2259 2260 case 5: 2190 variable->getName(), 2191 variable->getType(), (yyvsp[(1) - (1)].lex).line); 2192 ;} 2193 break; 2194 2195 case 3: 2261 2196 2262 2197 { … … 2265 2200 break; 2266 2201 2267 case 6:2202 case 4: 2268 2203 2269 2204 { … … 2273 2208 // 2274 2209 if (abs((yyvsp[(1) - (1)].lex).i) >= (1 << 16)) { 2275 context->error((yy lsp[(1) - (1)]), " integer constant overflow", "");2210 context->error((yyvsp[(1) - (1)].lex).line, " integer constant overflow", ""); 2276 2211 context->recover(); 2277 2212 } 2278 2213 ConstantUnion *unionArray = new ConstantUnion[1]; 2279 2214 unionArray->setIConst((yyvsp[(1) - (1)].lex).i); 2280 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), (yy lsp[(1) - (1)]));2281 ;} 2282 break; 2283 2284 case 7:2215 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].lex).line); 2216 ;} 2217 break; 2218 2219 case 5: 2285 2220 2286 2221 { 2287 2222 ConstantUnion *unionArray = new ConstantUnion[1]; 2288 2223 unionArray->setFConst((yyvsp[(1) - (1)].lex).f); 2289 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConst), (yy lsp[(1) - (1)]));2290 ;} 2291 break; 2292 2293 case 8:2224 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].lex).line); 2225 ;} 2226 break; 2227 2228 case 6: 2294 2229 2295 2230 { 2296 2231 ConstantUnion *unionArray = new ConstantUnion[1]; 2297 2232 unionArray->setBConst((yyvsp[(1) - (1)].lex).b); 2298 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yylsp[(1) - (1)])); 2233 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].lex).line); 2234 ;} 2235 break; 2236 2237 case 7: 2238 2239 { 2240 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (3)].interm.intermTypedNode); 2241 ;} 2242 break; 2243 2244 case 8: 2245 2246 { 2247 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); 2299 2248 ;} 2300 2249 break; 2301 2250 2302 2251 case 9: 2303 2304 {2305 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (3)].interm.intermTypedNode);2306 ;}2307 break;2308 2309 case 10:2310 2311 {2312 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);2313 ;}2314 break;2315 2316 case 11:2317 2252 2318 2253 { 2319 2254 if (!(yyvsp[(1) - (4)].interm.intermTypedNode)->isArray() && !(yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix() && !(yyvsp[(1) - (4)].interm.intermTypedNode)->isVector()) { 2320 2255 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode()) 2321 context->error((yy lsp[(2) - (4)]), " left of '[' is not of type array, matrix, or vector ", (yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode()->getSymbol().c_str());2256 context->error((yyvsp[(2) - (4)].lex).line, " left of '[' is not of type array, matrix, or vector ", (yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode()->getSymbol().c_str()); 2322 2257 else 2323 context->error((yylsp[(2) - (4)]), " left of '[' is not of type array, matrix, or vector ", "expression"); 2324 context->recover(); 2325 } 2326 if ((yyvsp[(3) - (4)].interm.intermTypedNode)->getQualifier() == EvqConst) { 2327 int index = (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0); 2328 if (index < 0) { 2329 std::stringstream infoStream; 2330 infoStream << index; 2331 std::string info = infoStream.str(); 2332 context->error((yylsp[(3) - (4)]), "negative index", info.c_str()); 2333 context->recover(); 2334 index = 0; 2258 context->error((yyvsp[(2) - (4)].lex).line, " left of '[' is not of type array, matrix, or vector ", "expression"); 2259 context->recover(); 2260 } 2261 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConst && (yyvsp[(3) - (4)].interm.intermTypedNode)->getQualifier() == EvqConst) { 2262 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray()) { // constant folding for arrays 2263 (yyval.interm.intermTypedNode) = context->addConstArrayNode((yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getUnionArrayPointer()->getIConst(), (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line); 2264 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector()) { // constant folding for vectors 2265 TVectorFields fields; 2266 fields.num = 1; 2267 fields.offsets[0] = (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getUnionArrayPointer()->getIConst(); // need to do it this way because v.xy sends fields integer array 2268 (yyval.interm.intermTypedNode) = context->addConstVectorNode(fields, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line); 2269 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix()) { // constant folding for matrices 2270 (yyval.interm.intermTypedNode) = context->addConstMatrixNode((yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getUnionArrayPointer()->getIConst(), (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line); 2335 2271 } 2336 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConst) { 2337 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray()) { // constant folding for arrays 2338 (yyval.interm.intermTypedNode) = context->addConstArrayNode(index, (yyvsp[(1) - (4)].interm.intermTypedNode), (yylsp[(2) - (4)])); 2339 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector()) { // constant folding for vectors 2340 TVectorFields fields; 2341 fields.num = 1; 2342 fields.offsets[0] = index; // need to do it this way because v.xy sends fields integer array 2343 (yyval.interm.intermTypedNode) = context->addConstVectorNode(fields, (yyvsp[(1) - (4)].interm.intermTypedNode), (yylsp[(2) - (4)])); 2344 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix()) { // constant folding for matrices 2345 (yyval.interm.intermTypedNode) = context->addConstMatrixNode(index, (yyvsp[(1) - (4)].interm.intermTypedNode), (yylsp[(2) - (4)])); 2272 } else { 2273 if ((yyvsp[(3) - (4)].interm.intermTypedNode)->getQualifier() == EvqConst) { 2274 if (((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector() || (yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix()) && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getNominalSize() <= (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getUnionArrayPointer()->getIConst() && !(yyvsp[(1) - (4)].interm.intermTypedNode)->isArray() ) { 2275 std::stringstream extraInfoStream; 2276 extraInfoStream << "field selection out of range '" << (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getUnionArrayPointer()->getIConst() << "'"; 2277 std::string extraInfo = extraInfoStream.str(); 2278 context->error((yyvsp[(2) - (4)].lex).line, "", "[", extraInfo.c_str()); 2279 context->recover(); 2280 } else { 2281 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray()) { 2282 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getArraySize() == 0) { 2283 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getMaxArraySize() <= (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getUnionArrayPointer()->getIConst()) { 2284 if (context->arraySetMaxSize((yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getTypePointer(), (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getUnionArrayPointer()->getIConst(), true, (yyvsp[(2) - (4)].lex).line)) 2285 context->recover(); 2286 } else { 2287 if (context->arraySetMaxSize((yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getTypePointer(), 0, false, (yyvsp[(2) - (4)].lex).line)) 2288 context->recover(); 2289 } 2290 } else if ( (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getUnionArrayPointer()->getIConst() >= (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getArraySize()) { 2291 std::stringstream extraInfoStream; 2292 extraInfoStream << "array index out of range '" << (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getUnionArrayPointer()->getIConst() << "'"; 2293 std::string extraInfo = extraInfoStream.str(); 2294 context->error((yyvsp[(2) - (4)].lex).line, "", "[", extraInfo.c_str()); 2295 context->recover(); 2296 } 2297 } 2298 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirect, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(3) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line); 2346 2299 } 2347 2300 } else { 2348 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray()) { 2349 if (index >= (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getArraySize()) { 2350 std::stringstream extraInfoStream; 2351 extraInfoStream << "array index out of range '" << index << "'"; 2352 std::string extraInfo = extraInfoStream.str(); 2353 context->error((yylsp[(2) - (4)]), "", "[", extraInfo.c_str()); 2354 context->recover(); 2355 index = (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getArraySize() - 1; 2356 } 2357 } else if (((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector() || (yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix()) && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getNominalSize() <= index) { 2358 std::stringstream extraInfoStream; 2359 extraInfoStream << "field selection out of range '" << index << "'"; 2360 std::string extraInfo = extraInfoStream.str(); 2361 context->error((yylsp[(2) - (4)]), "", "[", extraInfo.c_str()); 2301 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray() && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getArraySize() == 0) { 2302 context->error((yyvsp[(2) - (4)].lex).line, "", "[", "array must be redeclared with a size before being indexed with a variable"); 2362 2303 context->recover(); 2363 index = (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getNominalSize() - 1;2364 2304 } 2365 (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getUnionArrayPointer()->setIConst(index); 2366 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndex Direct, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(3) - (4)].interm.intermTypedNode), (yylsp[(2) - (4)]));2305 2306 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexIndirect, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(3) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line); 2367 2307 } 2368 } else {2369 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexIndirect, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(3) - (4)].interm.intermTypedNode), (yylsp[(2) - (4)]));2370 2308 } 2371 2309 if ((yyval.interm.intermTypedNode) == 0) { 2372 2310 ConstantUnion *unionArray = new ConstantUnion[1]; 2373 2311 unionArray->setFConst(0.0f); 2374 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpHigh, EvqConst), (yy lsp[(2) - (4)]));2312 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpHigh, EvqConst), (yyvsp[(2) - (4)].lex).line); 2375 2313 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray()) { 2376 2314 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getStruct()) 2377 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getStruct() ));2315 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getStruct(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getTypeName())); 2378 2316 else 2379 2317 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqTemporary, (yyvsp[(1) - (4)].interm.intermTypedNode)->getNominalSize(), (yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix())); … … 2381 2319 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConst) 2382 2320 (yyval.interm.intermTypedNode)->getTypePointer()->setQualifier(EvqConst); 2383 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix()) { 2384 TQualifier qualifier = (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConst ? EvqConst : EvqTemporary; 2385 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), qualifier, (yyvsp[(1) - (4)].interm.intermTypedNode)->getNominalSize())); 2386 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector()) { 2387 TQualifier qualifier = (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConst ? EvqConst : EvqTemporary; 2388 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), qualifier)); 2389 } else { 2321 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix() && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConst) 2322 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqConst, (yyvsp[(1) - (4)].interm.intermTypedNode)->getNominalSize())); 2323 else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix()) 2324 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqTemporary, (yyvsp[(1) - (4)].interm.intermTypedNode)->getNominalSize())); 2325 else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector() && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConst) 2326 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqConst)); 2327 else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector()) 2328 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqTemporary)); 2329 else 2390 2330 (yyval.interm.intermTypedNode)->setType((yyvsp[(1) - (4)].interm.intermTypedNode)->getType()); 2391 } 2392 ;} 2393 break; 2394 2395 case 12: 2331 ;} 2332 break; 2333 2334 case 10: 2396 2335 2397 2336 { … … 2400 2339 break; 2401 2340 2402 case 1 3:2341 case 11: 2403 2342 2404 2343 { 2405 2344 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->isArray()) { 2406 context->error((yy lsp[(3) - (3)]), "cannot apply dot operator to an array", ".");2345 context->error((yyvsp[(3) - (3)].lex).line, "cannot apply dot operator to an array", "."); 2407 2346 context->recover(); 2408 2347 } … … 2410 2349 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->isVector()) { 2411 2350 TVectorFields fields; 2412 if (! context->parseVectorFields(*(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize(), fields, (yy lsp[(3) - (3)]))) {2351 if (! context->parseVectorFields(*(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize(), fields, (yyvsp[(3) - (3)].lex).line)) { 2413 2352 fields.num = 1; 2414 2353 fields.offsets[0] = 0; … … 2417 2356 2418 2357 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->getType().getQualifier() == EvqConst) { // constant folding for vector fields 2419 (yyval.interm.intermTypedNode) = context->addConstVectorNode(fields, (yyvsp[(1) - (3)].interm.intermTypedNode), (yy lsp[(3) - (3)]));2358 (yyval.interm.intermTypedNode) = context->addConstVectorNode(fields, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].lex).line); 2420 2359 if ((yyval.interm.intermTypedNode) == 0) { 2421 2360 context->recover(); … … 2426 2365 } else { 2427 2366 TString vectorString = *(yyvsp[(3) - (3)].lex).string; 2428 TIntermTyped* index = context->intermediate.addSwizzle(fields, (yy lsp[(3) - (3)]));2429 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpVectorSwizzle, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yy lsp[(2) - (3)]));2367 TIntermTyped* index = context->intermediate.addSwizzle(fields, (yyvsp[(3) - (3)].lex).line); 2368 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpVectorSwizzle, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line); 2430 2369 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getPrecision(), EvqTemporary, (int) vectorString.size())); 2431 2370 } 2432 2371 } else if ((yyvsp[(1) - (3)].interm.intermTypedNode)->isMatrix()) { 2433 2372 TMatrixFields fields; 2434 if (! context->parseMatrixFields(*(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize(), fields, (yy lsp[(3) - (3)]))) {2373 if (! context->parseMatrixFields(*(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize(), fields, (yyvsp[(3) - (3)].lex).line)) { 2435 2374 fields.wholeRow = false; 2436 2375 fields.wholeCol = false; … … 2441 2380 2442 2381 if (fields.wholeRow || fields.wholeCol) { 2443 context->error((yy lsp[(2) - (3)]), " non-scalar fields not implemented yet", ".");2382 context->error((yyvsp[(2) - (3)].lex).line, " non-scalar fields not implemented yet", "."); 2444 2383 context->recover(); 2445 2384 ConstantUnion *unionArray = new ConstantUnion[1]; 2446 2385 unionArray->setIConst(0); 2447 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), (yy lsp[(3) - (3)]));2448 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirect, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yy lsp[(2) - (3)]));2386 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), (yyvsp[(3) - (3)].lex).line); 2387 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirect, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line); 2449 2388 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getPrecision(),EvqTemporary, (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize())); 2450 2389 } else { 2451 2390 ConstantUnion *unionArray = new ConstantUnion[1]; 2452 2391 unionArray->setIConst(fields.col * (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize() + fields.row); 2453 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), (yy lsp[(3) - (3)]));2454 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirect, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yy lsp[(2) - (3)]));2392 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), (yyvsp[(3) - (3)].lex).line); 2393 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirect, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line); 2455 2394 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getPrecision())); 2456 2395 } 2457 2396 } else if ((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType() == EbtStruct) { 2458 2397 bool fieldFound = false; 2459 const TFieldList& fields = (yyvsp[(1) - (3)].interm.intermTypedNode)->getType().getStruct()->fields(); 2460 unsigned int i; 2461 for (i = 0; i < fields.size(); ++i) { 2462 if (fields[i]->name() == *(yyvsp[(3) - (3)].lex).string) { 2463 fieldFound = true; 2464 break; 2398 const TTypeList* fields = (yyvsp[(1) - (3)].interm.intermTypedNode)->getType().getStruct(); 2399 if (fields == 0) { 2400 context->error((yyvsp[(2) - (3)].lex).line, "structure has no fields", "Internal Error"); 2401 context->recover(); 2402 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); 2403 } else { 2404 unsigned int i; 2405 for (i = 0; i < fields->size(); ++i) { 2406 if ((*fields)[i].type->getFieldName() == *(yyvsp[(3) - (3)].lex).string) { 2407 fieldFound = true; 2408 break; 2409 } 2410 } 2411 if (fieldFound) { 2412 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->getType().getQualifier() == EvqConst) { 2413 (yyval.interm.intermTypedNode) = context->addConstStruct(*(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line); 2414 if ((yyval.interm.intermTypedNode) == 0) { 2415 context->recover(); 2416 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); 2417 } 2418 else { 2419 (yyval.interm.intermTypedNode)->setType(*(*fields)[i].type); 2420 // change the qualifier of the return type, not of the structure field 2421 // as the structure definition is shared between various structures. 2422 (yyval.interm.intermTypedNode)->getTypePointer()->setQualifier(EvqConst); 2423 } 2424 } else { 2425 ConstantUnion *unionArray = new ConstantUnion[1]; 2426 unionArray->setIConst(i); 2427 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, *(*fields)[i].type, (yyvsp[(3) - (3)].lex).line); 2428 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirectStruct, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line); 2429 (yyval.interm.intermTypedNode)->setType(*(*fields)[i].type); 2430 } 2431 } else { 2432 context->error((yyvsp[(2) - (3)].lex).line, " no such field in structure", (yyvsp[(3) - (3)].lex).string->c_str()); 2433 context->recover(); 2434 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); 2465 2435 } 2466 2436 } 2467 if (fieldFound) {2468 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->getType().getQualifier() == EvqConst) {2469 (yyval.interm.intermTypedNode) = context->addConstStruct(*(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));2470 if ((yyval.interm.intermTypedNode) == 0) {2471 context->recover();2472 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);2473 }2474 else {2475 (yyval.interm.intermTypedNode)->setType(*fields[i]->type());2476 // change the qualifier of the return type, not of the structure field2477 // as the structure definition is shared between various structures.2478 (yyval.interm.intermTypedNode)->getTypePointer()->setQualifier(EvqConst);2479 }2480 } else {2481 ConstantUnion *unionArray = new ConstantUnion[1];2482 unionArray->setIConst(i);2483 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, *fields[i]->type(), (yylsp[(3) - (3)]));2484 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirectStruct, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yylsp[(2) - (3)]));2485 (yyval.interm.intermTypedNode)->setType(*fields[i]->type());2486 }2487 } else {2488 context->error((yylsp[(2) - (3)]), " no such field in structure", (yyvsp[(3) - (3)].lex).string->c_str());2489 context->recover();2490 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);2491 }2492 2437 } else { 2493 context->error((yy lsp[(2) - (3)]), " field selection requires structure, vector, or matrix on left hand side", (yyvsp[(3) - (3)].lex).string->c_str());2438 context->error((yyvsp[(2) - (3)].lex).line, " field selection requires structure, vector, or matrix on left hand side", (yyvsp[(3) - (3)].lex).string->c_str()); 2494 2439 context->recover(); 2495 2440 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); … … 2499 2444 break; 2500 2445 2446 case 12: 2447 2448 { 2449 if (context->lValueErrorCheck((yyvsp[(2) - (2)].lex).line, "++", (yyvsp[(1) - (2)].interm.intermTypedNode))) 2450 context->recover(); 2451 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPostIncrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line, context->symbolTable); 2452 if ((yyval.interm.intermTypedNode) == 0) { 2453 context->unaryOpError((yyvsp[(2) - (2)].lex).line, "++", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString()); 2454 context->recover(); 2455 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode); 2456 } 2457 ;} 2458 break; 2459 2460 case 13: 2461 2462 { 2463 if (context->lValueErrorCheck((yyvsp[(2) - (2)].lex).line, "--", (yyvsp[(1) - (2)].interm.intermTypedNode))) 2464 context->recover(); 2465 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPostDecrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line, context->symbolTable); 2466 if ((yyval.interm.intermTypedNode) == 0) { 2467 context->unaryOpError((yyvsp[(2) - (2)].lex).line, "--", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString()); 2468 context->recover(); 2469 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode); 2470 } 2471 ;} 2472 break; 2473 2501 2474 case 14: 2502 2475 2503 2476 { 2504 if (context->lValueErrorCheck((yylsp[(2) - (2)]), "++", (yyvsp[(1) - (2)].interm.intermTypedNode))) 2505 context->recover(); 2506 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPostIncrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yylsp[(2) - (2)]), context->symbolTable); 2507 if ((yyval.interm.intermTypedNode) == 0) { 2508 context->unaryOpError((yylsp[(2) - (2)]), "++", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString()); 2509 context->recover(); 2510 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode); 2511 } 2477 if (context->integerErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode), "[]")) 2478 context->recover(); 2479 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); 2512 2480 ;} 2513 2481 break; 2514 2482 2515 2483 case 15: 2516 2517 {2518 if (context->lValueErrorCheck((yylsp[(2) - (2)]), "--", (yyvsp[(1) - (2)].interm.intermTypedNode)))2519 context->recover();2520 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPostDecrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yylsp[(2) - (2)]), context->symbolTable);2521 if ((yyval.interm.intermTypedNode) == 0) {2522 context->unaryOpError((yylsp[(2) - (2)]), "--", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString());2523 context->recover();2524 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode);2525 }2526 ;}2527 break;2528 2529 case 16:2530 2531 {2532 if (context->integerErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode), "[]"))2533 context->recover();2534 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);2535 ;}2536 break;2537 2538 case 17:2539 2484 2540 2485 { … … 2550 2495 // 2551 2496 TType type(EbtVoid, EbpUndefined); // use this to get the type back 2552 if (context->constructorErrorCheck((yy lsp[(1) - (1)]), (yyvsp[(1) - (1)].interm).intermNode, *fnCall, op, &type)) {2497 if (context->constructorErrorCheck((yyvsp[(1) - (1)].interm).line, (yyvsp[(1) - (1)].interm).intermNode, *fnCall, op, &type)) { 2553 2498 (yyval.interm.intermTypedNode) = 0; 2554 2499 } else { … … 2556 2501 // It's a constructor, of type 'type'. 2557 2502 // 2558 (yyval.interm.intermTypedNode) = context->addConstructor((yyvsp[(1) - (1)].interm).intermNode, &type, op, fnCall, (yy lsp[(1) - (1)]));2503 (yyval.interm.intermTypedNode) = context->addConstructor((yyvsp[(1) - (1)].interm).intermNode, &type, op, fnCall, (yyvsp[(1) - (1)].interm).line); 2559 2504 } 2560 2505 2561 2506 if ((yyval.interm.intermTypedNode) == 0) { 2562 2507 context->recover(); 2563 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator(0, op, (yy lsp[(1) - (1)]));2508 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator(0, op, (yyvsp[(1) - (1)].interm).line); 2564 2509 } 2565 2510 (yyval.interm.intermTypedNode)->setType(type); … … 2570 2515 const TFunction* fnCandidate; 2571 2516 bool builtIn; 2572 fnCandidate = context->findFunction((yy lsp[(1) - (1)]), fnCall, &builtIn);2517 fnCandidate = context->findFunction((yyvsp[(1) - (1)].interm).line, fnCall, &builtIn); 2573 2518 if (fnCandidate) { 2574 2519 // … … 2576 2521 // 2577 2522 if (builtIn && !fnCandidate->getExtension().empty() && 2578 context->extensionErrorCheck((yy lsp[(1) - (1)]), fnCandidate->getExtension())) {2523 context->extensionErrorCheck((yyvsp[(1) - (1)].interm).line, fnCandidate->getExtension())) { 2579 2524 context->recover(); 2580 2525 } … … 2588 2533 // Treat it like a built-in unary operator. 2589 2534 // 2590 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(op, (yyvsp[(1) - (1)].interm).intermNode, (yylsp[(1) - (1)]), context->symbolTable);2535 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(op, (yyvsp[(1) - (1)].interm).intermNode, 0, context->symbolTable); 2591 2536 if ((yyval.interm.intermTypedNode) == 0) { 2592 2537 std::stringstream extraInfoStream; … … 2597 2542 } 2598 2543 } else { 2599 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, op, (yy lsp[(1) - (1)]));2544 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, op, (yyvsp[(1) - (1)].interm).line); 2600 2545 } 2601 2546 } else { 2602 2547 // This is a real function call 2603 2548 2604 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, EOpFunctionCall, (yy lsp[(1) - (1)]));2549 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, EOpFunctionCall, (yyvsp[(1) - (1)].interm).line); 2605 2550 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType()); 2606 2551 … … 2629 2574 ConstantUnion *unionArray = new ConstantUnion[1]; 2630 2575 unionArray->setFConst(0.0f); 2631 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConst), (yy lsp[(1) - (1)]));2576 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].interm).line); 2632 2577 context->recover(); 2633 2578 } … … 2637 2582 break; 2638 2583 2639 case 1 8:2584 case 16: 2640 2585 2641 2586 { … … 2644 2589 break; 2645 2590 2646 case 1 9:2647 2648 { 2649 context->error((yy lsp[(3) - (3)]), "methods are not supported", "");2591 case 17: 2592 2593 { 2594 context->error((yyvsp[(3) - (3)].interm).line, "methods are not supported", ""); 2650 2595 context->recover(); 2651 2596 (yyval.interm) = (yyvsp[(3) - (3)].interm); … … 2653 2598 break; 2654 2599 2600 case 18: 2601 2602 { 2603 (yyval.interm) = (yyvsp[(1) - (2)].interm); 2604 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line; 2605 ;} 2606 break; 2607 2608 case 19: 2609 2610 { 2611 (yyval.interm) = (yyvsp[(1) - (2)].interm); 2612 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line; 2613 ;} 2614 break; 2615 2655 2616 case 20: 2656 2657 {2658 (yyval.interm) = (yyvsp[(1) - (2)].interm);2659 ;}2660 break;2661 2662 case 21:2663 2664 {2665 (yyval.interm) = (yyvsp[(1) - (2)].interm);2666 ;}2667 break;2668 2669 case 22:2670 2617 2671 2618 { … … 2675 2622 break; 2676 2623 2677 case 2 3:2624 case 21: 2678 2625 2679 2626 { … … 2683 2630 break; 2684 2631 2685 case 2 4:2632 case 22: 2686 2633 2687 2634 { … … 2693 2640 break; 2694 2641 2695 case 2 5:2642 case 23: 2696 2643 2697 2644 { … … 2699 2646 (yyvsp[(1) - (3)].interm).function->addParameter(param); 2700 2647 (yyval.interm).function = (yyvsp[(1) - (3)].interm).function; 2701 (yyval.interm).intermNode = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermNode, (yyvsp[(3) - (3)].interm.intermTypedNode), (yy lsp[(2) - (3)]));2702 ;} 2703 break; 2704 2705 case 2 6:2648 (yyval.interm).intermNode = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermNode, (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line); 2649 ;} 2650 break; 2651 2652 case 24: 2706 2653 2707 2654 { … … 2710 2657 break; 2711 2658 2712 case 2 7:2659 case 25: 2713 2660 2714 2661 { … … 2724 2671 if ((yyvsp[(1) - (1)].interm.type).matrix) { 2725 2672 switch((yyvsp[(1) - (1)].interm.type).size) { 2726 case 2: op = EOpConstructMat2; break;2727 case 3: op = EOpConstructMat3; break;2728 case 4: op = EOpConstructMat4; break;2673 case 2: op = EOpConstructMat2; break; 2674 case 3: op = EOpConstructMat3; break; 2675 case 4: op = EOpConstructMat4; break; 2729 2676 } 2730 2677 } else { 2731 2678 switch((yyvsp[(1) - (1)].interm.type).size) { 2732 case 1: op = EOpConstructFloat; break;2733 case 2: op = EOpConstructVec2; break;2734 case 3: op = EOpConstructVec3; break;2735 case 4: op = EOpConstructVec4; break;2679 case 1: op = EOpConstructFloat; break; 2680 case 2: op = EOpConstructVec2; break; 2681 case 3: op = EOpConstructVec3; break; 2682 case 4: op = EOpConstructVec4; break; 2736 2683 } 2737 2684 } … … 2739 2686 case EbtInt: 2740 2687 switch((yyvsp[(1) - (1)].interm.type).size) { 2741 case 1: op = EOpConstructInt; break;2742 case 2: op = EOpConstructIVec2; break;2743 case 3: op = EOpConstructIVec3; break;2744 case 4: op = EOpConstructIVec4; break;2688 case 1: op = EOpConstructInt; break; 2689 case 2: FRAG_VERT_ONLY("ivec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec2; break; 2690 case 3: FRAG_VERT_ONLY("ivec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec3; break; 2691 case 4: FRAG_VERT_ONLY("ivec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec4; break; 2745 2692 } 2746 2693 break; 2747 2694 case EbtBool: 2748 2695 switch((yyvsp[(1) - (1)].interm.type).size) { 2749 case 1: op = EOpConstructBool; break;2750 case 2: op = EOpConstructBVec2; break;2751 case 3: op = EOpConstructBVec3; break;2752 case 4: op = EOpConstructBVec4; break;2696 case 1: op = EOpConstructBool; break; 2697 case 2: FRAG_VERT_ONLY("bvec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec2; break; 2698 case 3: FRAG_VERT_ONLY("bvec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec3; break; 2699 case 4: FRAG_VERT_ONLY("bvec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec4; break; 2753 2700 } 2754 2701 break; … … 2756 2703 } 2757 2704 if (op == EOpNull) { 2758 context->error((yy lsp[(1) - (1)]), "cannot construct this type", getBasicString((yyvsp[(1) - (1)].interm.type).type));2705 context->error((yyvsp[(1) - (1)].interm.type).line, "cannot construct this type", getBasicString((yyvsp[(1) - (1)].interm.type).type)); 2759 2706 context->recover(); 2760 2707 (yyvsp[(1) - (1)].interm.type).type = EbtFloat; … … 2769 2716 break; 2770 2717 2771 case 2 8:2772 2773 { 2774 if (context->reservedErrorCheck((yy lsp[(1) - (1)]), *(yyvsp[(1) - (1)].lex).string))2718 case 26: 2719 2720 { 2721 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string)) 2775 2722 context->recover(); 2776 2723 TType type(EbtVoid, EbpUndefined); … … 2780 2727 break; 2781 2728 2729 case 27: 2730 2731 { 2732 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string)) 2733 context->recover(); 2734 TType type(EbtVoid, EbpUndefined); 2735 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type); 2736 (yyval.interm.function) = function; 2737 ;} 2738 break; 2739 2740 case 28: 2741 2742 { 2743 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); 2744 ;} 2745 break; 2746 2782 2747 case 29: 2783 2748 2784 2749 { 2785 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); 2750 if (context->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode))) 2751 context->recover(); 2752 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreIncrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line, context->symbolTable); 2753 if ((yyval.interm.intermTypedNode) == 0) { 2754 context->unaryOpError((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString()); 2755 context->recover(); 2756 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode); 2757 } 2786 2758 ;} 2787 2759 break; … … 2790 2762 2791 2763 { 2792 if (context->lValueErrorCheck((yy lsp[(1) - (2)]), "++", (yyvsp[(2) - (2)].interm.intermTypedNode)))2793 context->recover(); 2794 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPre Increment, (yyvsp[(2) - (2)].interm.intermTypedNode), (yylsp[(1) - (2)]), context->symbolTable);2764 if (context->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode))) 2765 context->recover(); 2766 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreDecrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line, context->symbolTable); 2795 2767 if ((yyval.interm.intermTypedNode) == 0) { 2796 context->unaryOpError((yy lsp[(1) - (2)]), "++", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());2768 context->unaryOpError((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString()); 2797 2769 context->recover(); 2798 2770 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode); … … 2804 2776 2805 2777 { 2806 if (context->lValueErrorCheck((yylsp[(1) - (2)]), "--", (yyvsp[(2) - (2)].interm.intermTypedNode)))2807 context->recover();2808 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreDecrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yylsp[(1) - (2)]), context->symbolTable);2809 if ((yyval.interm.intermTypedNode) == 0) {2810 context->unaryOpError((yylsp[(1) - (2)]), "--", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());2811 context->recover();2812 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);2813 }2814 ;}2815 break;2816 2817 case 32:2818 2819 {2820 2778 if ((yyvsp[(1) - (2)].interm).op != EOpNull) { 2821 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath((yyvsp[(1) - (2)].interm).op, (yyvsp[(2) - (2)].interm.intermTypedNode), (yy lsp[(1) - (2)]), context->symbolTable);2779 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath((yyvsp[(1) - (2)].interm).op, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].interm).line, context->symbolTable); 2822 2780 if ((yyval.interm.intermTypedNode) == 0) { 2823 2781 const char* errorOp = ""; … … 2827 2785 default: break; 2828 2786 } 2829 context->unaryOpError((yy lsp[(1) - (2)]), errorOp, (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());2787 context->unaryOpError((yyvsp[(1) - (2)].interm).line, errorOp, (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString()); 2830 2788 context->recover(); 2831 2789 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode); … … 2836 2794 break; 2837 2795 2796 case 32: 2797 2798 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNull; ;} 2799 break; 2800 2838 2801 case 33: 2839 2802 2840 { (yyval.interm). op = EOpNull; ;}2803 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNegative; ;} 2841 2804 break; 2842 2805 2843 2806 case 34: 2844 2807 2845 { (yyval.interm). op = EOpNegative; ;}2808 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpLogicalNot; ;} 2846 2809 break; 2847 2810 2848 2811 case 35: 2849 2812 2850 { (yyval.interm ).op = EOpLogicalNot; ;}2813 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); ;} 2851 2814 break; 2852 2815 2853 2816 case 36: 2854 2817 2818 { 2819 FRAG_VERT_ONLY("*", (yyvsp[(2) - (3)].lex).line); 2820 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpMul, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable); 2821 if ((yyval.interm.intermTypedNode) == 0) { 2822 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "*", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); 2823 context->recover(); 2824 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); 2825 } 2826 ;} 2827 break; 2828 2829 case 37: 2830 2831 { 2832 FRAG_VERT_ONLY("/", (yyvsp[(2) - (3)].lex).line); 2833 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpDiv, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable); 2834 if ((yyval.interm.intermTypedNode) == 0) { 2835 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "/", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); 2836 context->recover(); 2837 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); 2838 } 2839 ;} 2840 break; 2841 2842 case 38: 2843 2855 2844 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); ;} 2856 2845 break; 2857 2846 2858 case 3 7:2859 2860 { 2861 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOp Mul, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]), context->symbolTable);2847 case 39: 2848 2849 { 2850 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpAdd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable); 2862 2851 if ((yyval.interm.intermTypedNode) == 0) { 2863 context->binaryOpError((yy lsp[(2) - (3)]), "*", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());2852 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "+", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); 2864 2853 context->recover(); 2865 2854 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); … … 2868 2857 break; 2869 2858 2870 case 38:2871 2872 { 2873 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOp Div, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]), context->symbolTable);2859 case 40: 2860 2861 { 2862 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpSub, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable); 2874 2863 if ((yyval.interm.intermTypedNode) == 0) { 2875 context->binaryOpError((yy lsp[(2) - (3)]), "/", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());2864 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "-", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); 2876 2865 context->recover(); 2877 2866 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); … … 2880 2869 break; 2881 2870 2882 case 39:2871 case 41: 2883 2872 2884 2873 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); ;} 2885 2874 break; 2886 2875 2887 case 40: 2888 2889 { 2890 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpAdd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]), context->symbolTable); 2876 case 42: 2877 2878 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); ;} 2879 break; 2880 2881 case 43: 2882 2883 { 2884 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLessThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable); 2891 2885 if ((yyval.interm.intermTypedNode) == 0) { 2892 context->binaryOpError((yylsp[(2) - (3)]), "+", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); 2893 context->recover(); 2894 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); 2895 } 2896 ;} 2897 break; 2898 2899 case 41: 2900 2901 { 2902 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpSub, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]), context->symbolTable); 2903 if ((yyval.interm.intermTypedNode) == 0) { 2904 context->binaryOpError((yylsp[(2) - (3)]), "-", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); 2905 context->recover(); 2906 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); 2907 } 2908 ;} 2909 break; 2910 2911 case 42: 2912 2913 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); ;} 2914 break; 2915 2916 case 43: 2917 2918 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); ;} 2919 break; 2920 2921 case 44: 2922 2923 { 2924 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLessThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]), context->symbolTable); 2925 if ((yyval.interm.intermTypedNode) == 0) { 2926 context->binaryOpError((yylsp[(2) - (3)]), "<", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); 2886 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); 2927 2887 context->recover(); 2928 2888 ConstantUnion *unionArray = new ConstantUnion[1]; 2929 2889 unionArray->setBConst(false); 2930 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yy lsp[(2) - (3)]));2931 } 2932 ;} 2933 break; 2934 2935 case 4 5:2936 2937 { 2938 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpGreaterThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yy lsp[(2) - (3)]), context->symbolTable);2890 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line); 2891 } 2892 ;} 2893 break; 2894 2895 case 44: 2896 2897 { 2898 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpGreaterThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable); 2939 2899 if ((yyval.interm.intermTypedNode) == 0) { 2940 context->binaryOpError((yy lsp[(2) - (3)]), ">", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());2900 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); 2941 2901 context->recover(); 2942 2902 ConstantUnion *unionArray = new ConstantUnion[1]; 2943 2903 unionArray->setBConst(false); 2944 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yy lsp[(2) - (3)]));2945 } 2946 ;} 2947 break; 2948 2949 case 4 6:2950 2951 { 2952 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLessThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yy lsp[(2) - (3)]), context->symbolTable);2904 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line); 2905 } 2906 ;} 2907 break; 2908 2909 case 45: 2910 2911 { 2912 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLessThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable); 2953 2913 if ((yyval.interm.intermTypedNode) == 0) { 2954 context->binaryOpError((yy lsp[(2) - (3)]), "<=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());2914 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); 2955 2915 context->recover(); 2956 2916 ConstantUnion *unionArray = new ConstantUnion[1]; 2957 2917 unionArray->setBConst(false); 2958 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yy lsp[(2) - (3)]));2959 } 2960 ;} 2961 break; 2962 2963 case 4 7:2964 2965 { 2966 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpGreaterThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yy lsp[(2) - (3)]), context->symbolTable);2918 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line); 2919 } 2920 ;} 2921 break; 2922 2923 case 46: 2924 2925 { 2926 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpGreaterThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable); 2967 2927 if ((yyval.interm.intermTypedNode) == 0) { 2968 context->binaryOpError((yy lsp[(2) - (3)]), ">=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());2928 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); 2969 2929 context->recover(); 2970 2930 ConstantUnion *unionArray = new ConstantUnion[1]; 2971 2931 unionArray->setBConst(false); 2972 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yylsp[(2) - (3)])); 2973 } 2974 ;} 2932 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line); 2933 } 2934 ;} 2935 break; 2936 2937 case 47: 2938 2939 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); ;} 2975 2940 break; 2976 2941 2977 2942 case 48: 2978 2943 2979 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); ;} 2980 break; 2981 2982 case 49: 2983 2984 { 2985 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]), context->symbolTable); 2944 { 2945 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable); 2986 2946 if ((yyval.interm.intermTypedNode) == 0) { 2987 context->binaryOpError((yy lsp[(2) - (3)]), "==", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());2947 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "==", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); 2988 2948 context->recover(); 2989 2949 ConstantUnion *unionArray = new ConstantUnion[1]; 2990 2950 unionArray->setBConst(false); 2991 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yy lsp[(2) - (3)]));2992 } 2993 ;} 2994 break; 2995 2996 case 50:2997 2998 { 2999 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpNotEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yy lsp[(2) - (3)]), context->symbolTable);2951 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line); 2952 } 2953 ;} 2954 break; 2955 2956 case 49: 2957 2958 { 2959 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpNotEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable); 3000 2960 if ((yyval.interm.intermTypedNode) == 0) { 3001 context->binaryOpError((yy lsp[(2) - (3)]), "!=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());2961 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "!=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); 3002 2962 context->recover(); 3003 2963 ConstantUnion *unionArray = new ConstantUnion[1]; 3004 2964 unionArray->setBConst(false); 3005 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yylsp[(2) - (3)])); 3006 } 3007 ;} 2965 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line); 2966 } 2967 ;} 2968 break; 2969 2970 case 50: 2971 2972 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); ;} 3008 2973 break; 3009 2974 … … 3025 2990 case 54: 3026 2991 3027 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); ;} 3028 break; 3029 3030 case 55: 3031 3032 { 3033 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalAnd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]), context->symbolTable); 2992 { 2993 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalAnd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable); 3034 2994 if ((yyval.interm.intermTypedNode) == 0) { 3035 context->binaryOpError((yy lsp[(2) - (3)]), "&&", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());2995 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "&&", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); 3036 2996 context->recover(); 3037 2997 ConstantUnion *unionArray = new ConstantUnion[1]; 3038 2998 unionArray->setBConst(false); 3039 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yylsp[(2) - (3)])); 3040 } 3041 ;} 2999 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line); 3000 } 3001 ;} 3002 break; 3003 3004 case 55: 3005 3006 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); ;} 3042 3007 break; 3043 3008 3044 3009 case 56: 3045 3010 3046 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); ;} 3047 break; 3048 3049 case 57: 3050 3051 { 3052 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalXor, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]), context->symbolTable); 3011 { 3012 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalXor, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable); 3053 3013 if ((yyval.interm.intermTypedNode) == 0) { 3054 context->binaryOpError((yy lsp[(2) - (3)]), "^^", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());3014 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "^^", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); 3055 3015 context->recover(); 3056 3016 ConstantUnion *unionArray = new ConstantUnion[1]; 3057 3017 unionArray->setBConst(false); 3058 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yylsp[(2) - (3)])); 3059 } 3060 ;} 3018 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line); 3019 } 3020 ;} 3021 break; 3022 3023 case 57: 3024 3025 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); ;} 3061 3026 break; 3062 3027 3063 3028 case 58: 3064 3029 3065 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); ;} 3066 break; 3067 3068 case 59: 3069 3070 { 3071 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]), context->symbolTable); 3030 { 3031 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable); 3072 3032 if ((yyval.interm.intermTypedNode) == 0) { 3073 context->binaryOpError((yy lsp[(2) - (3)]), "||", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());3033 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "||", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); 3074 3034 context->recover(); 3075 3035 ConstantUnion *unionArray = new ConstantUnion[1]; 3076 3036 unionArray->setBConst(false); 3077 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yylsp[(2) - (3)])); 3078 } 3079 ;} 3037 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line); 3038 } 3039 ;} 3040 break; 3041 3042 case 59: 3043 3044 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); ;} 3080 3045 break; 3081 3046 3082 3047 case 60: 3083 3048 3084 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); ;} 3085 break; 3086 3087 case 61: 3088 3089 { 3090 if (context->boolErrorCheck((yylsp[(2) - (5)]), (yyvsp[(1) - (5)].interm.intermTypedNode))) 3091 context->recover(); 3092 3093 (yyval.interm.intermTypedNode) = context->intermediate.addSelection((yyvsp[(1) - (5)].interm.intermTypedNode), (yyvsp[(3) - (5)].interm.intermTypedNode), (yyvsp[(5) - (5)].interm.intermTypedNode), (yylsp[(2) - (5)])); 3049 { 3050 if (context->boolErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(1) - (5)].interm.intermTypedNode))) 3051 context->recover(); 3052 3053 (yyval.interm.intermTypedNode) = context->intermediate.addSelection((yyvsp[(1) - (5)].interm.intermTypedNode), (yyvsp[(3) - (5)].interm.intermTypedNode), (yyvsp[(5) - (5)].interm.intermTypedNode), (yyvsp[(2) - (5)].lex).line); 3094 3054 if ((yyvsp[(3) - (5)].interm.intermTypedNode)->getType() != (yyvsp[(5) - (5)].interm.intermTypedNode)->getType()) 3095 3055 (yyval.interm.intermTypedNode) = 0; 3096 3056 3097 3057 if ((yyval.interm.intermTypedNode) == 0) { 3098 context->binaryOpError((yy lsp[(2) - (5)]), ":", (yyvsp[(3) - (5)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(5) - (5)].interm.intermTypedNode)->getCompleteString());3058 context->binaryOpError((yyvsp[(2) - (5)].lex).line, ":", (yyvsp[(3) - (5)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(5) - (5)].interm.intermTypedNode)->getCompleteString()); 3099 3059 context->recover(); 3100 3060 (yyval.interm.intermTypedNode) = (yyvsp[(5) - (5)].interm.intermTypedNode); … … 3103 3063 break; 3104 3064 3065 case 61: 3066 3067 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); ;} 3068 break; 3069 3105 3070 case 62: 3106 3071 3107 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); ;} 3072 { 3073 if (context->lValueErrorCheck((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode))) 3074 context->recover(); 3075 (yyval.interm.intermTypedNode) = context->intermediate.addAssign((yyvsp[(2) - (3)].interm).op, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].interm).line); 3076 if ((yyval.interm.intermTypedNode) == 0) { 3077 context->assignError((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); 3078 context->recover(); 3079 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); 3080 } 3081 ;} 3108 3082 break; 3109 3083 3110 3084 case 63: 3111 3085 3112 { 3113 if (context->lValueErrorCheck((yylsp[(2) - (3)]), "assign", (yyvsp[(1) - (3)].interm.intermTypedNode))) 3114 context->recover(); 3115 (yyval.interm.intermTypedNode) = context->intermediate.addAssign((yyvsp[(2) - (3)].interm).op, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)])); 3086 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAssign; ;} 3087 break; 3088 3089 case 64: 3090 3091 { FRAG_VERT_ONLY("*=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpMulAssign; ;} 3092 break; 3093 3094 case 65: 3095 3096 { FRAG_VERT_ONLY("/=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpDivAssign; ;} 3097 break; 3098 3099 case 66: 3100 3101 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAddAssign; ;} 3102 break; 3103 3104 case 67: 3105 3106 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpSubAssign; ;} 3107 break; 3108 3109 case 68: 3110 3111 { 3112 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); 3113 ;} 3114 break; 3115 3116 case 69: 3117 3118 { 3119 (yyval.interm.intermTypedNode) = context->intermediate.addComma((yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line); 3116 3120 if ((yyval.interm.intermTypedNode) == 0) { 3117 context->assignError((yylsp[(2) - (3)]), "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); 3118 context->recover(); 3119 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); 3120 } 3121 ;} 3122 break; 3123 3124 case 64: 3125 3126 { (yyval.interm).op = EOpAssign; ;} 3127 break; 3128 3129 case 65: 3130 3131 { (yyval.interm).op = EOpMulAssign; ;} 3132 break; 3133 3134 case 66: 3135 3136 { (yyval.interm).op = EOpDivAssign; ;} 3137 break; 3138 3139 case 67: 3140 3141 { (yyval.interm).op = EOpAddAssign; ;} 3142 break; 3143 3144 case 68: 3145 3146 { (yyval.interm).op = EOpSubAssign; ;} 3147 break; 3148 3149 case 69: 3150 3151 { 3121 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ",", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); 3122 context->recover(); 3123 (yyval.interm.intermTypedNode) = (yyvsp[(3) - (3)].interm.intermTypedNode); 3124 } 3125 ;} 3126 break; 3127 3128 case 70: 3129 3130 { 3131 if (context->constErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode))) 3132 context->recover(); 3152 3133 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); 3153 3134 ;} 3154 3135 break; 3155 3136 3156 case 70:3157 3158 {3159 (yyval.interm.intermTypedNode) = context->intermediate.addComma((yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));3160 if ((yyval.interm.intermTypedNode) == 0) {3161 context->binaryOpError((yylsp[(2) - (3)]), ",", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());3162 context->recover();3163 (yyval.interm.intermTypedNode) = (yyvsp[(3) - (3)].interm.intermTypedNode);3164 }3165 ;}3166 break;3167 3168 3137 case 71: 3169 3170 {3171 if (context->constErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)))3172 context->recover();3173 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);3174 ;}3175 break;3176 3177 case 72:3178 3138 3179 3139 { … … 3189 3149 if (param.name != 0) 3190 3150 { 3191 TVariable variable(param.name, *param.type);3151 TVariable *variable = new TVariable(param.name, *param.type); 3192 3152 3193 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(variable .getUniqueId(), variable.getName(), variable.getType(), (yylsp[(1) - (2)])), (yylsp[(1) - (2)]));3153 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(variable->getUniqueId(), variable->getName(), variable->getType(), (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line); 3194 3154 } 3195 3155 else 3196 3156 { 3197 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(0, "", *param.type, (yy lsp[(1) - (2)])), (yylsp[(1) - (2)]));3157 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line); 3198 3158 } 3199 3159 } … … 3206 3166 break; 3207 3167 3208 case 7 3:3168 case 72: 3209 3169 3210 3170 { … … 3215 3175 break; 3216 3176 3177 case 73: 3178 3179 { 3180 if (((yyvsp[(2) - (4)].interm.precision) == EbpHigh) && (context->shaderType == SH_FRAGMENT_SHADER) && !context->fragmentPrecisionHigh) { 3181 context->error((yyvsp[(1) - (4)].lex).line, "precision is not supported in fragment shader", "highp"); 3182 context->recover(); 3183 } 3184 if (!context->symbolTable.setDefaultPrecision( (yyvsp[(3) - (4)].interm.type), (yyvsp[(2) - (4)].interm.precision) )) { 3185 context->error((yyvsp[(1) - (4)].lex).line, "illegal type argument for default precision qualifier", getBasicString((yyvsp[(3) - (4)].interm.type).type)); 3186 context->recover(); 3187 } 3188 (yyval.interm.intermNode) = 0; 3189 ;} 3190 break; 3191 3217 3192 case 74: 3218 3219 {3220 if (((yyvsp[(2) - (4)].interm.precision) == EbpHigh) && (context->shaderType == SH_FRAGMENT_SHADER) && !context->fragmentPrecisionHigh) {3221 context->error((yylsp[(1) - (4)]), "precision is not supported in fragment shader", "highp");3222 context->recover();3223 }3224 if (!context->symbolTable.setDefaultPrecision( (yyvsp[(3) - (4)].interm.type), (yyvsp[(2) - (4)].interm.precision) )) {3225 context->error((yylsp[(1) - (4)]), "illegal type argument for default precision qualifier", getBasicString((yyvsp[(3) - (4)].interm.type).type));3226 context->recover();3227 }3228 (yyval.interm.intermNode) = 0;3229 ;}3230 break;3231 3232 case 75:3233 3193 3234 3194 { … … 3244 3204 if (prevDec) { 3245 3205 if (prevDec->getReturnType() != (yyvsp[(1) - (2)].interm.function)->getReturnType()) { 3246 context->error((yy lsp[(2) - (2)]), "overloaded functions must have the same return type", (yyvsp[(1) - (2)].interm.function)->getReturnType().getBasicString());3206 context->error((yyvsp[(2) - (2)].lex).line, "overloaded functions must have the same return type", (yyvsp[(1) - (2)].interm.function)->getReturnType().getBasicString()); 3247 3207 context->recover(); 3248 3208 } 3249 3209 for (size_t i = 0; i < prevDec->getParamCount(); ++i) { 3250 3210 if (prevDec->getParam(i).type->getQualifier() != (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifier()) { 3251 context->error((yy lsp[(2) - (2)]), "overloaded functions must have the same parameter qualifiers", (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifierString());3211 context->error((yyvsp[(2) - (2)].lex).line, "overloaded functions must have the same parameter qualifiers", (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifierString()); 3252 3212 context->recover(); 3253 3213 } … … 3261 3221 // 3262 3222 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function); 3223 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line; 3263 3224 3264 3225 // We're at the inner scope level of the function's arguments and body statement. … … 3268 3229 break; 3269 3230 3231 case 75: 3232 3233 { 3234 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function); 3235 ;} 3236 break; 3237 3270 3238 case 76: 3271 3239 … … 3276 3244 3277 3245 case 77: 3278 3279 {3280 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);3281 ;}3282 break;3283 3284 case 78:3285 3246 3286 3247 { … … 3294 3255 break; 3295 3256 3296 case 7 9:3257 case 78: 3297 3258 3298 3259 { … … 3305 3266 // This parameter > first is void 3306 3267 // 3307 context->error((yy lsp[(2) - (3)]), "cannot be an argument type except for '(void)'", "void");3268 context->error((yyvsp[(2) - (3)].lex).line, "cannot be an argument type except for '(void)'", "void"); 3308 3269 context->recover(); 3309 3270 delete (yyvsp[(3) - (3)].interm).param.type; … … 3316 3277 break; 3317 3278 3318 case 80:3279 case 79: 3319 3280 3320 3281 { 3321 3282 if ((yyvsp[(1) - (3)].interm.type).qualifier != EvqGlobal && (yyvsp[(1) - (3)].interm.type).qualifier != EvqTemporary) { 3322 context->error((yy lsp[(2) - (3)]), "no qualifiers allowed for function return", getQualifierString((yyvsp[(1) - (3)].interm.type).qualifier));3283 context->error((yyvsp[(2) - (3)].lex).line, "no qualifiers allowed for function return", getQualifierString((yyvsp[(1) - (3)].interm.type).qualifier)); 3323 3284 context->recover(); 3324 3285 } 3325 3286 // make sure a sampler is not involved as well... 3326 if (context->structQualifierErrorCheck((yy lsp[(2) - (3)]), (yyvsp[(1) - (3)].interm.type)))3287 if (context->structQualifierErrorCheck((yyvsp[(2) - (3)].lex).line, (yyvsp[(1) - (3)].interm.type))) 3327 3288 context->recover(); 3328 3289 … … 3337 3298 break; 3338 3299 3300 case 80: 3301 3302 { 3303 if ((yyvsp[(1) - (2)].interm.type).type == EbtVoid) { 3304 context->error((yyvsp[(2) - (2)].lex).line, "illegal use of type 'void'", (yyvsp[(2) - (2)].lex).string->c_str()); 3305 context->recover(); 3306 } 3307 if (context->reservedErrorCheck((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string)) 3308 context->recover(); 3309 TParameter param = {(yyvsp[(2) - (2)].lex).string, new TType((yyvsp[(1) - (2)].interm.type))}; 3310 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line; 3311 (yyval.interm).param = param; 3312 ;} 3313 break; 3314 3339 3315 case 81: 3340 3316 3341 3317 { 3342 if ((yyvsp[(1) - (2)].interm.type).type == EbtVoid) {3343 context->error((yylsp[(2) - (2)]), "illegal use of type 'void'", (yyvsp[(2) - (2)].lex).string->c_str());3344 context->recover();3345 }3346 if (context->reservedErrorCheck((yylsp[(2) - (2)]), *(yyvsp[(2) - (2)].lex).string))3347 context->recover();3348 TParameter param = {(yyvsp[(2) - (2)].lex).string, new TType((yyvsp[(1) - (2)].interm.type))};3349 (yyval.interm).param = param;3350 ;}3351 break;3352 3353 case 82:3354 3355 {3356 3318 // Check that we can make an array out of this type 3357 if (context->arrayTypeErrorCheck((yy lsp[(3) - (5)]), (yyvsp[(1) - (5)].interm.type)))3358 context->recover(); 3359 3360 if (context->reservedErrorCheck((yy lsp[(2) - (5)]), *(yyvsp[(2) - (5)].lex).string))3319 if (context->arrayTypeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type))) 3320 context->recover(); 3321 3322 if (context->reservedErrorCheck((yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string)) 3361 3323 context->recover(); 3362 3324 3363 3325 int size; 3364 if (context->arraySizeErrorCheck((yy lsp[(3) - (5)]), (yyvsp[(4) - (5)].interm.intermTypedNode), size))3326 if (context->arraySizeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size)) 3365 3327 context->recover(); 3366 3328 (yyvsp[(1) - (5)].interm.type).setArray(true, size); … … 3368 3330 TType* type = new TType((yyvsp[(1) - (5)].interm.type)); 3369 3331 TParameter param = { (yyvsp[(2) - (5)].lex).string, type }; 3332 (yyval.interm).line = (yyvsp[(2) - (5)].lex).line; 3370 3333 (yyval.interm).param = param; 3371 3334 ;} 3372 3335 break; 3373 3336 3337 case 82: 3338 3339 { 3340 (yyval.interm) = (yyvsp[(3) - (3)].interm); 3341 if (context->paramErrorCheck((yyvsp[(3) - (3)].interm).line, (yyvsp[(1) - (3)].interm.type).qualifier, (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type)) 3342 context->recover(); 3343 ;} 3344 break; 3345 3374 3346 case 83: 3375 3347 3376 3348 { 3349 (yyval.interm) = (yyvsp[(2) - (2)].interm); 3350 if (context->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type)) 3351 context->recover(); 3352 if (context->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type)) 3353 context->recover(); 3354 ;} 3355 break; 3356 3357 case 84: 3358 3359 { 3377 3360 (yyval.interm) = (yyvsp[(3) - (3)].interm); 3378 if (context->paramErrorCheck((yy lsp[(3) - (3)]), (yyvsp[(1) - (3)].interm.type).qualifier, (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type))3379 context->recover(); 3380 ;} 3381 break; 3382 3383 case 8 4:3361 if (context->paramErrorCheck((yyvsp[(3) - (3)].interm).line, (yyvsp[(1) - (3)].interm.type).qualifier, (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type)) 3362 context->recover(); 3363 ;} 3364 break; 3365 3366 case 85: 3384 3367 3385 3368 { 3386 3369 (yyval.interm) = (yyvsp[(2) - (2)].interm); 3387 if (context->parameterSamplerErrorCheck((yylsp[(2) - (2)]), (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type)) 3388 context->recover(); 3389 if (context->paramErrorCheck((yylsp[(2) - (2)]), EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type)) 3390 context->recover(); 3391 ;} 3392 break; 3393 3394 case 85: 3395 3396 { 3397 (yyval.interm) = (yyvsp[(3) - (3)].interm); 3398 if (context->paramErrorCheck((yylsp[(3) - (3)]), (yyvsp[(1) - (3)].interm.type).qualifier, (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type)) 3370 if (context->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type)) 3371 context->recover(); 3372 if (context->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type)) 3399 3373 context->recover(); 3400 3374 ;} … … 3404 3378 3405 3379 { 3406 (yyval.interm) = (yyvsp[(2) - (2)].interm); 3407 if (context->parameterSamplerErrorCheck((yylsp[(2) - (2)]), (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type)) 3408 context->recover(); 3409 if (context->paramErrorCheck((yylsp[(2) - (2)]), EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type)) 3410 context->recover(); 3380 (yyval.interm.qualifier) = EvqIn; 3411 3381 ;} 3412 3382 break; … … 3422 3392 3423 3393 { 3424 (yyval.interm.qualifier) = Evq In;3394 (yyval.interm.qualifier) = EvqOut; 3425 3395 ;} 3426 3396 break; … … 3429 3399 3430 3400 { 3431 (yyval.interm.qualifier) = Evq Out;3401 (yyval.interm.qualifier) = EvqInOut; 3432 3402 ;} 3433 3403 break; 3434 3404 3435 3405 case 90: 3436 3437 {3438 (yyval.interm.qualifier) = EvqInOut;3439 ;}3440 break;3441 3442 case 91:3443 3406 3444 3407 { … … 3448 3411 break; 3449 3412 3413 case 91: 3414 3415 { 3416 (yyval.interm) = (yyvsp[(1) - (1)].interm); 3417 ;} 3418 break; 3419 3450 3420 case 92: 3451 3452 {3453 (yyval.interm) = (yyvsp[(1) - (1)].interm);3454 ;}3455 break;3456 3457 case 93:3458 3421 3459 3422 { 3460 3423 if ((yyvsp[(1) - (3)].interm).type.type == EbtInvariant && !(yyvsp[(3) - (3)].lex).symbol) 3461 3424 { 3462 context->error((yy lsp[(3) - (3)]), "undeclared identifier declared as invariant", (yyvsp[(3) - (3)].lex).string->c_str());3463 context->recover(); 3464 } 3465 3466 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(3) - (3)].lex).string, TType((yyvsp[(1) - (3)].interm).type), (yy lsp[(3) - (3)]));3467 (yyval.interm).intermAggregate = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermNode, symbol, (yy lsp[(3) - (3)]));3425 context->error((yyvsp[(3) - (3)].lex).line, "undeclared identifier declared as invariant", (yyvsp[(3) - (3)].lex).string->c_str()); 3426 context->recover(); 3427 } 3428 3429 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(3) - (3)].lex).string, TType((yyvsp[(1) - (3)].interm).type), (yyvsp[(3) - (3)].lex).line); 3430 (yyval.interm).intermAggregate = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermNode, symbol, (yyvsp[(3) - (3)].lex).line); 3468 3431 3469 if (context->structQualifierErrorCheck((yy lsp[(3) - (3)]), (yyval.interm).type))3470 context->recover(); 3471 3472 if (context->nonInitConstErrorCheck((yy lsp[(3) - (3)]), *(yyvsp[(3) - (3)].lex).string, (yyval.interm).type, false))3432 if (context->structQualifierErrorCheck((yyvsp[(3) - (3)].lex).line, (yyval.interm).type)) 3433 context->recover(); 3434 3435 if (context->nonInitConstErrorCheck((yyvsp[(3) - (3)].lex).line, *(yyvsp[(3) - (3)].lex).string, (yyval.interm).type, false)) 3473 3436 context->recover(); 3474 3437 3475 3438 TVariable* variable = 0; 3476 if (context->nonInitErrorCheck((yy lsp[(3) - (3)]), *(yyvsp[(3) - (3)].lex).string, (yyval.interm).type, variable))3439 if (context->nonInitErrorCheck((yyvsp[(3) - (3)].lex).line, *(yyvsp[(3) - (3)].lex).string, (yyval.interm).type, variable)) 3477 3440 context->recover(); 3478 3441 if (symbol && variable) … … 3481 3444 break; 3482 3445 3483 case 9 4:3484 3485 { 3486 if (context->structQualifierErrorCheck((yy lsp[(3) - (5)]), (yyvsp[(1) - (5)].interm).type))3487 context->recover(); 3488 3489 if (context->nonInitConstErrorCheck((yy lsp[(3) - (5)]), *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, true))3446 case 93: 3447 3448 { 3449 if (context->structQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type)) 3450 context->recover(); 3451 3452 if (context->nonInitConstErrorCheck((yyvsp[(3) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, true)) 3490 3453 context->recover(); 3491 3454 3492 3455 (yyval.interm) = (yyvsp[(1) - (5)].interm); 3493 3456 3494 if (context->arrayTypeErrorCheck((yy lsp[(4) - (5)]), (yyvsp[(1) - (5)].interm).type) || context->arrayQualifierErrorCheck((yylsp[(4) - (5)]), (yyvsp[(1) - (5)].interm).type))3457 if (context->arrayTypeErrorCheck((yyvsp[(4) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type) || context->arrayQualifierErrorCheck((yyvsp[(4) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type)) 3495 3458 context->recover(); 3496 3459 else { 3497 3460 (yyvsp[(1) - (5)].interm).type.setArray(true); 3498 3461 TVariable* variable; 3499 if (context->arrayErrorCheck((yy lsp[(4) - (5)]), *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, variable))3462 if (context->arrayErrorCheck((yyvsp[(4) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, variable)) 3500 3463 context->recover(); 3501 3464 } … … 3503 3466 break; 3504 3467 3505 case 9 5:3506 3507 { 3508 if (context->structQualifierErrorCheck((yy lsp[(3) - (6)]), (yyvsp[(1) - (6)].interm).type))3509 context->recover(); 3510 3511 if (context->nonInitConstErrorCheck((yy lsp[(3) - (6)]), *(yyvsp[(3) - (6)].lex).string, (yyvsp[(1) - (6)].interm).type, true))3468 case 94: 3469 3470 { 3471 if (context->structQualifierErrorCheck((yyvsp[(3) - (6)].lex).line, (yyvsp[(1) - (6)].interm).type)) 3472 context->recover(); 3473 3474 if (context->nonInitConstErrorCheck((yyvsp[(3) - (6)].lex).line, *(yyvsp[(3) - (6)].lex).string, (yyvsp[(1) - (6)].interm).type, true)) 3512 3475 context->recover(); 3513 3476 3514 3477 (yyval.interm) = (yyvsp[(1) - (6)].interm); 3515 3478 3516 if (context->arrayTypeErrorCheck((yy lsp[(4) - (6)]), (yyvsp[(1) - (6)].interm).type) || context->arrayQualifierErrorCheck((yylsp[(4) - (6)]), (yyvsp[(1) - (6)].interm).type))3479 if (context->arrayTypeErrorCheck((yyvsp[(4) - (6)].lex).line, (yyvsp[(1) - (6)].interm).type) || context->arrayQualifierErrorCheck((yyvsp[(4) - (6)].lex).line, (yyvsp[(1) - (6)].interm).type)) 3517 3480 context->recover(); 3518 3481 else { 3519 3482 int size; 3520 if (context->arraySizeErrorCheck((yy lsp[(4) - (6)]), (yyvsp[(5) - (6)].interm.intermTypedNode), size))3483 if (context->arraySizeErrorCheck((yyvsp[(4) - (6)].lex).line, (yyvsp[(5) - (6)].interm.intermTypedNode), size)) 3521 3484 context->recover(); 3522 3485 (yyvsp[(1) - (6)].interm).type.setArray(true, size); 3523 3486 TVariable* variable = 0; 3524 if (context->arrayErrorCheck((yy lsp[(4) - (6)]), *(yyvsp[(3) - (6)].lex).string, (yyvsp[(1) - (6)].interm).type, variable))3487 if (context->arrayErrorCheck((yyvsp[(4) - (6)].lex).line, *(yyvsp[(3) - (6)].lex).string, (yyvsp[(1) - (6)].interm).type, variable)) 3525 3488 context->recover(); 3526 3489 TType type = TType((yyvsp[(1) - (6)].interm).type); 3527 3490 type.setArraySize(size); 3528 (yyval.interm).intermAggregate = context->intermediate.growAggregate((yyvsp[(1) - (6)].interm).intermNode, context->intermediate.addSymbol(variable ? variable->getUniqueId() : 0, *(yyvsp[(3) - (6)].lex).string, type, (yy lsp[(3) - (6)])), (yylsp[(3) - (6)]));3529 } 3530 ;} 3531 break; 3532 3533 case 9 6:3534 3535 { 3536 if (context->structQualifierErrorCheck((yy lsp[(3) - (5)]), (yyvsp[(1) - (5)].interm).type))3491 (yyval.interm).intermAggregate = context->intermediate.growAggregate((yyvsp[(1) - (6)].interm).intermNode, context->intermediate.addSymbol(variable ? variable->getUniqueId() : 0, *(yyvsp[(3) - (6)].lex).string, type, (yyvsp[(3) - (6)].lex).line), (yyvsp[(3) - (6)].lex).line); 3492 } 3493 ;} 3494 break; 3495 3496 case 95: 3497 3498 { 3499 if (context->structQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type)) 3537 3500 context->recover(); 3538 3501 … … 3540 3503 3541 3504 TIntermNode* intermNode; 3542 if (!context->executeInitializer((yy lsp[(3) - (5)]), *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, (yyvsp[(5) - (5)].interm.intermTypedNode), intermNode)) {3505 if (!context->executeInitializer((yyvsp[(3) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, (yyvsp[(5) - (5)].interm.intermTypedNode), intermNode)) { 3543 3506 // 3544 3507 // build the intermediate representation 3545 3508 // 3546 3509 if (intermNode) 3547 (yyval.interm).intermAggregate = context->intermediate.growAggregate((yyvsp[(1) - (5)].interm).intermNode, intermNode, (yy lsp[(4) - (5)]));3510 (yyval.interm).intermAggregate = context->intermediate.growAggregate((yyvsp[(1) - (5)].interm).intermNode, intermNode, (yyvsp[(4) - (5)].lex).line); 3548 3511 else 3549 3512 (yyval.interm).intermAggregate = (yyvsp[(1) - (5)].interm).intermAggregate; … … 3555 3518 break; 3556 3519 3520 case 96: 3521 3522 { 3523 (yyval.interm).type = (yyvsp[(1) - (1)].interm.type); 3524 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(context->intermediate.addSymbol(0, "", TType((yyvsp[(1) - (1)].interm.type)), (yyvsp[(1) - (1)].interm.type).line), (yyvsp[(1) - (1)].interm.type).line); 3525 ;} 3526 break; 3527 3557 3528 case 97: 3558 3529 3559 3530 { 3560 (yyval.interm).type = (yyvsp[(1) - (1)].interm.type); 3561 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(context->intermediate.addSymbol(0, "", TType((yyvsp[(1) - (1)].interm.type)), (yylsp[(1) - (1)])), (yylsp[(1) - (1)])); 3562 ;} 3563 break; 3564 3565 case 98: 3566 3567 { 3568 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (2)].lex).string, TType((yyvsp[(1) - (2)].interm.type)), (yylsp[(2) - (2)])); 3569 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yylsp[(2) - (2)])); 3531 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (2)].lex).string, TType((yyvsp[(1) - (2)].interm.type)), (yyvsp[(2) - (2)].lex).line); 3532 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (2)].lex).line); 3570 3533 3571 if (context->structQualifierErrorCheck((yy lsp[(2) - (2)]), (yyval.interm).type))3572 context->recover(); 3573 3574 if (context->nonInitConstErrorCheck((yy lsp[(2) - (2)]), *(yyvsp[(2) - (2)].lex).string, (yyval.interm).type, false))3534 if (context->structQualifierErrorCheck((yyvsp[(2) - (2)].lex).line, (yyval.interm).type)) 3535 context->recover(); 3536 3537 if (context->nonInitConstErrorCheck((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string, (yyval.interm).type, false)) 3575 3538 context->recover(); 3576 3539 … … 3578 3541 3579 3542 TVariable* variable = 0; 3580 if (context->nonInitErrorCheck((yy lsp[(2) - (2)]), *(yyvsp[(2) - (2)].lex).string, (yyval.interm).type, variable))3543 if (context->nonInitErrorCheck((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string, (yyval.interm).type, variable)) 3581 3544 context->recover(); 3582 3545 if (variable && symbol) … … 3585 3548 break; 3586 3549 3550 case 98: 3551 3552 { 3553 context->error((yyvsp[(2) - (4)].lex).line, "unsized array declarations not supported", (yyvsp[(2) - (4)].lex).string->c_str()); 3554 context->recover(); 3555 3556 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (4)].lex).string, TType((yyvsp[(1) - (4)].interm.type)), (yyvsp[(2) - (4)].lex).line); 3557 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (4)].lex).line); 3558 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type); 3559 ;} 3560 break; 3561 3587 3562 case 99: 3588 3589 {3590 context->error((yylsp[(2) - (4)]), "unsized array declarations not supported", (yyvsp[(2) - (4)].lex).string->c_str());3591 context->recover();3592 3593 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (4)].lex).string, TType((yyvsp[(1) - (4)].interm.type)), (yylsp[(2) - (4)]));3594 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yylsp[(2) - (4)]));3595 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);3596 ;}3597 break;3598 3599 case 100:3600 3563 3601 3564 { 3602 3565 TType type = TType((yyvsp[(1) - (5)].interm.type)); 3603 3566 int size; 3604 if (context->arraySizeErrorCheck((yy lsp[(2) - (5)]), (yyvsp[(4) - (5)].interm.intermTypedNode), size))3567 if (context->arraySizeErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size)) 3605 3568 context->recover(); 3606 3569 type.setArraySize(size); 3607 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (5)].lex).string, type, (yy lsp[(2) - (5)]));3608 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yy lsp[(2) - (5)]));3570 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (5)].lex).string, type, (yyvsp[(2) - (5)].lex).line); 3571 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (5)].lex).line); 3609 3572 3610 if (context->structQualifierErrorCheck((yy lsp[(2) - (5)]), (yyvsp[(1) - (5)].interm.type)))3611 context->recover(); 3612 3613 if (context->nonInitConstErrorCheck((yy lsp[(2) - (5)]), *(yyvsp[(2) - (5)].lex).string, (yyvsp[(1) - (5)].interm.type), true))3573 if (context->structQualifierErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type))) 3574 context->recover(); 3575 3576 if (context->nonInitConstErrorCheck((yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(1) - (5)].interm.type), true)) 3614 3577 context->recover(); 3615 3578 3616 3579 (yyval.interm).type = (yyvsp[(1) - (5)].interm.type); 3617 3580 3618 if (context->arrayTypeErrorCheck((yy lsp[(3) - (5)]), (yyvsp[(1) - (5)].interm.type)) || context->arrayQualifierErrorCheck((yylsp[(3) - (5)]), (yyvsp[(1) - (5)].interm.type)))3581 if (context->arrayTypeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)) || context->arrayQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type))) 3619 3582 context->recover(); 3620 3583 else { 3621 3584 int size; 3622 if (context->arraySizeErrorCheck((yy lsp[(3) - (5)]), (yyvsp[(4) - (5)].interm.intermTypedNode), size))3585 if (context->arraySizeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size)) 3623 3586 context->recover(); 3624 3587 3625 3588 (yyvsp[(1) - (5)].interm.type).setArray(true, size); 3626 3589 TVariable* variable = 0; 3627 if (context->arrayErrorCheck((yy lsp[(3) - (5)]), *(yyvsp[(2) - (5)].lex).string, (yyvsp[(1) - (5)].interm.type), variable))3590 if (context->arrayErrorCheck((yyvsp[(3) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(1) - (5)].interm.type), variable)) 3628 3591 context->recover(); 3629 3592 if (variable && symbol) … … 3633 3596 break; 3634 3597 3635 case 10 1:3636 3637 { 3638 if (context->structQualifierErrorCheck((yy lsp[(2) - (4)]), (yyvsp[(1) - (4)].interm.type)))3598 case 100: 3599 3600 { 3601 if (context->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type))) 3639 3602 context->recover(); 3640 3603 … … 3642 3605 3643 3606 TIntermNode* intermNode; 3644 if (!context->executeInitializer((yy lsp[(2) - (4)]), *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode)) {3607 if (!context->executeInitializer((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode)) { 3645 3608 // 3646 3609 // Build intermediate representation 3647 3610 // 3648 3611 if(intermNode) 3649 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(intermNode, (yy lsp[(3) - (4)]));3612 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(intermNode, (yyvsp[(3) - (4)].lex).line); 3650 3613 else 3651 3614 (yyval.interm).intermAggregate = 0; … … 3657 3620 break; 3658 3621 3659 case 10 2:3660 3661 { 3662 VERTEX_ONLY("invariant declaration", (yy lsp[(1) - (2)]));3663 if (context->globalErrorCheck((yy lsp[(1) - (2)]), context->symbolTable.atGlobalLevel(), "invariant varying"))3664 context->recover(); 3665 (yyval.interm).type.setBasic(EbtInvariant, EvqInvariantVaryingOut, (yy lsp[(2) - (2)]));3622 case 101: 3623 3624 { 3625 VERTEX_ONLY("invariant declaration", (yyvsp[(1) - (2)].lex).line); 3626 if (context->globalErrorCheck((yyvsp[(1) - (2)].lex).line, context->symbolTable.atGlobalLevel(), "invariant varying")) 3627 context->recover(); 3628 (yyval.interm).type.setBasic(EbtInvariant, EvqInvariantVaryingOut, (yyvsp[(2) - (2)].lex).line); 3666 3629 if (!(yyvsp[(2) - (2)].lex).symbol) 3667 3630 { 3668 context->error((yy lsp[(2) - (2)]), "undeclared identifier declared as invariant", (yyvsp[(2) - (2)].lex).string->c_str());3631 context->error((yyvsp[(2) - (2)].lex).line, "undeclared identifier declared as invariant", (yyvsp[(2) - (2)].lex).string->c_str()); 3669 3632 context->recover(); 3670 3633 … … 3673 3636 else 3674 3637 { 3675 TIntermSymbol *symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (2)].lex).string, TType((yyval.interm).type), (yylsp[(2) - (2)])); 3676 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yylsp[(2) - (2)])); 3638 TIntermSymbol *symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (2)].lex).string, TType((yyval.interm).type), (yyvsp[(2) - (2)].lex).line); 3639 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (2)].lex).line); 3640 } 3641 ;} 3642 break; 3643 3644 case 102: 3645 3646 { 3647 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); 3648 3649 if ((yyvsp[(1) - (1)].interm.type).array) { 3650 context->error((yyvsp[(1) - (1)].interm.type).line, "not supported", "first-class array"); 3651 context->recover(); 3652 (yyvsp[(1) - (1)].interm.type).setArray(false); 3677 3653 } 3678 3654 ;} … … 3682 3658 3683 3659 { 3684 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);3685 3686 if ((yyvsp[(1) - (1)].interm.type).array) {3687 context->error((yylsp[(1) - (1)]), "not supported", "first-class array");3688 context->recover();3689 (yyvsp[(1) - (1)].interm.type).setArray(false);3690 }3691 ;}3692 break;3693 3694 case 104:3695 3696 {3697 3660 if ((yyvsp[(2) - (2)].interm.type).array) { 3698 context->error((yy lsp[(2) - (2)]), "not supported", "first-class array");3661 context->error((yyvsp[(2) - (2)].interm.type).line, "not supported", "first-class array"); 3699 3662 context->recover(); 3700 3663 (yyvsp[(2) - (2)].interm.type).setArray(false); … … 3703 3666 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqAttribute && 3704 3667 ((yyvsp[(2) - (2)].interm.type).type == EbtBool || (yyvsp[(2) - (2)].interm.type).type == EbtInt)) { 3705 context->error((yy lsp[(2) - (2)]), "cannot be bool or int", getQualifierString((yyvsp[(1) - (2)].interm.type).qualifier));3668 context->error((yyvsp[(2) - (2)].interm.type).line, "cannot be bool or int", getQualifierString((yyvsp[(1) - (2)].interm.type).qualifier)); 3706 3669 context->recover(); 3707 3670 } 3708 3671 if (((yyvsp[(1) - (2)].interm.type).qualifier == EvqVaryingIn || (yyvsp[(1) - (2)].interm.type).qualifier == EvqVaryingOut) && 3709 3672 ((yyvsp[(2) - (2)].interm.type).type == EbtBool || (yyvsp[(2) - (2)].interm.type).type == EbtInt)) { 3710 context->error((yy lsp[(2) - (2)]), "cannot be bool or int", getQualifierString((yyvsp[(1) - (2)].interm.type).qualifier));3673 context->error((yyvsp[(2) - (2)].interm.type).line, "cannot be bool or int", getQualifierString((yyvsp[(1) - (2)].interm.type).qualifier)); 3711 3674 context->recover(); 3712 3675 } … … 3716 3679 break; 3717 3680 3681 case 104: 3682 3683 { 3684 (yyval.interm.type).setBasic(EbtVoid, EvqConst, (yyvsp[(1) - (1)].lex).line); 3685 ;} 3686 break; 3687 3718 3688 case 105: 3719 3689 3720 3690 { 3721 (yyval.interm.type).setBasic(EbtVoid, EvqConst, (yylsp[(1) - (1)])); 3691 VERTEX_ONLY("attribute", (yyvsp[(1) - (1)].lex).line); 3692 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "attribute")) 3693 context->recover(); 3694 (yyval.interm.type).setBasic(EbtVoid, EvqAttribute, (yyvsp[(1) - (1)].lex).line); 3722 3695 ;} 3723 3696 break; … … 3726 3699 3727 3700 { 3728 VERTEX_ONLY("attribute", (yylsp[(1) - (1)])); 3729 if (context->globalErrorCheck((yylsp[(1) - (1)]), context->symbolTable.atGlobalLevel(), "attribute")) 3730 context->recover(); 3731 (yyval.interm.type).setBasic(EbtVoid, EvqAttribute, (yylsp[(1) - (1)])); 3701 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "varying")) 3702 context->recover(); 3703 if (context->shaderType == SH_VERTEX_SHADER) 3704 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingOut, (yyvsp[(1) - (1)].lex).line); 3705 else 3706 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingIn, (yyvsp[(1) - (1)].lex).line); 3732 3707 ;} 3733 3708 break; … … 3736 3711 3737 3712 { 3738 if (context->globalErrorCheck((yy lsp[(1) - (1)]), context->symbolTable.atGlobalLevel(), "varying"))3713 if (context->globalErrorCheck((yyvsp[(1) - (2)].lex).line, context->symbolTable.atGlobalLevel(), "invariant varying")) 3739 3714 context->recover(); 3740 3715 if (context->shaderType == SH_VERTEX_SHADER) 3741 (yyval.interm.type).setBasic(EbtVoid, Evq VaryingOut, (yylsp[(1) - (1)]));3716 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingOut, (yyvsp[(1) - (2)].lex).line); 3742 3717 else 3743 (yyval.interm.type).setBasic(EbtVoid, Evq VaryingIn, (yylsp[(1) - (1)]));3718 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingIn, (yyvsp[(1) - (2)].lex).line); 3744 3719 ;} 3745 3720 break; … … 3748 3723 3749 3724 { 3750 if (context->globalErrorCheck((yylsp[(1) - (2)]), context->symbolTable.atGlobalLevel(), "invariant varying")) 3751 context->recover(); 3752 if (context->shaderType == SH_VERTEX_SHADER) 3753 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingOut, (yylsp[(1) - (2)])); 3754 else 3755 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingIn, (yylsp[(1) - (2)])); 3725 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "uniform")) 3726 context->recover(); 3727 (yyval.interm.type).setBasic(EbtVoid, EvqUniform, (yyvsp[(1) - (1)].lex).line); 3756 3728 ;} 3757 3729 break; 3758 3730 3759 3731 case 109: 3760 3761 {3762 if (context->globalErrorCheck((yylsp[(1) - (1)]), context->symbolTable.atGlobalLevel(), "uniform"))3763 context->recover();3764 (yyval.interm.type).setBasic(EbtVoid, EvqUniform, (yylsp[(1) - (1)]));3765 ;}3766 break;3767 3768 case 110:3769 3732 3770 3733 { … … 3773 3736 if ((yyval.interm.type).precision == EbpUndefined) { 3774 3737 (yyval.interm.type).precision = context->symbolTable.getDefaultPrecision((yyvsp[(1) - (1)].interm.type).type); 3775 if (context->precisionErrorCheck((yy lsp[(1) - (1)]), (yyval.interm.type).precision, (yyvsp[(1) - (1)].interm.type).type)) {3738 if (context->precisionErrorCheck((yyvsp[(1) - (1)].interm.type).line, (yyval.interm.type).precision, (yyvsp[(1) - (1)].interm.type).type)) { 3776 3739 context->recover(); 3777 3740 } … … 3780 3743 break; 3781 3744 3782 case 11 1:3745 case 110: 3783 3746 3784 3747 { … … 3788 3751 break; 3789 3752 3753 case 111: 3754 3755 { 3756 (yyval.interm.precision) = EbpHigh; 3757 ;} 3758 break; 3759 3790 3760 case 112: 3791 3761 3792 3762 { 3793 (yyval.interm.precision) = Ebp High;3763 (yyval.interm.precision) = EbpMedium; 3794 3764 ;} 3795 3765 break; … … 3798 3768 3799 3769 { 3800 (yyval.interm.precision) = Ebp Medium;3770 (yyval.interm.precision) = EbpLow; 3801 3771 ;} 3802 3772 break; … … 3805 3775 3806 3776 { 3807 (yyval.interm. precision) = EbpLow;3777 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); 3808 3778 ;} 3809 3779 break; … … 3812 3782 3813 3783 { 3814 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);3815 ;}3816 break;3817 3818 case 116:3819 3820 {3821 3784 (yyval.interm.type) = (yyvsp[(1) - (4)].interm.type); 3822 3785 3823 if (context->arrayTypeErrorCheck((yy lsp[(2) - (4)]), (yyvsp[(1) - (4)].interm.type)))3786 if (context->arrayTypeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type))) 3824 3787 context->recover(); 3825 3788 else { 3826 3789 int size; 3827 if (context->arraySizeErrorCheck((yy lsp[(2) - (4)]), (yyvsp[(3) - (4)].interm.intermTypedNode), size))3790 if (context->arraySizeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode), size)) 3828 3791 context->recover(); 3829 3792 (yyval.interm.type).setArray(true, size); … … 3832 3795 break; 3833 3796 3797 case 116: 3798 3799 { 3800 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 3801 (yyval.interm.type).setBasic(EbtVoid, qual, (yyvsp[(1) - (1)].lex).line); 3802 ;} 3803 break; 3804 3834 3805 case 117: 3835 3806 3836 3807 { 3837 3808 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 3838 (yyval.interm.type).setBasic(Ebt Void, qual, (yylsp[(1) - (1)]));3809 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line); 3839 3810 ;} 3840 3811 break; … … 3844 3815 { 3845 3816 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 3846 (yyval.interm.type).setBasic(Ebt Float, qual, (yylsp[(1) - (1)]));3817 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line); 3847 3818 ;} 3848 3819 break; … … 3852 3823 { 3853 3824 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 3854 (yyval.interm.type).setBasic(Ebt Int, qual, (yylsp[(1) - (1)]));3825 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line); 3855 3826 ;} 3856 3827 break; … … 3860 3831 { 3861 3832 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 3862 (yyval.interm.type).setBasic(EbtBool, qual, (yylsp[(1) - (1)])); 3833 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line); 3834 (yyval.interm.type).setAggregate(2); 3863 3835 ;} 3864 3836 break; … … 3868 3840 { 3869 3841 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 3870 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)])); 3842 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line); 3843 (yyval.interm.type).setAggregate(3); 3844 ;} 3845 break; 3846 3847 case 122: 3848 3849 { 3850 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 3851 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line); 3852 (yyval.interm.type).setAggregate(4); 3853 ;} 3854 break; 3855 3856 case 123: 3857 3858 { 3859 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 3860 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line); 3871 3861 (yyval.interm.type).setAggregate(2); 3872 3862 ;} 3873 3863 break; 3874 3864 3875 case 12 2:3865 case 124: 3876 3866 3877 3867 { 3878 3868 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 3879 (yyval.interm.type).setBasic(Ebt Float, qual, (yylsp[(1) - (1)]));3869 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line); 3880 3870 (yyval.interm.type).setAggregate(3); 3881 3871 ;} 3882 3872 break; 3883 3873 3884 case 12 3:3874 case 125: 3885 3875 3886 3876 { 3887 3877 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 3888 (yyval.interm.type).setBasic(Ebt Float, qual, (yylsp[(1) - (1)]));3878 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line); 3889 3879 (yyval.interm.type).setAggregate(4); 3890 3880 ;} 3891 3881 break; 3892 3882 3893 case 12 4:3883 case 126: 3894 3884 3895 3885 { 3896 3886 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 3897 (yyval.interm.type).setBasic(Ebt Bool, qual, (yylsp[(1) - (1)]));3887 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line); 3898 3888 (yyval.interm.type).setAggregate(2); 3899 3889 ;} 3900 3890 break; 3901 3891 3902 case 12 5:3892 case 127: 3903 3893 3904 3894 { 3905 3895 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 3906 (yyval.interm.type).setBasic(Ebt Bool, qual, (yylsp[(1) - (1)]));3896 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line); 3907 3897 (yyval.interm.type).setAggregate(3); 3908 3898 ;} 3909 3899 break; 3910 3900 3911 case 12 6:3901 case 128: 3912 3902 3913 3903 { 3914 3904 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 3915 (yyval.interm.type).setBasic(Ebt Bool, qual, (yylsp[(1) - (1)]));3905 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line); 3916 3906 (yyval.interm.type).setAggregate(4); 3917 3907 ;} 3918 3908 break; 3919 3909 3920 case 127: 3921 3922 { 3910 case 129: 3911 3912 { 3913 FRAG_VERT_ONLY("mat2", (yyvsp[(1) - (1)].lex).line); 3923 3914 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 3924 (yyval.interm.type).setBasic(EbtInt, qual, (yylsp[(1) - (1)])); 3925 (yyval.interm.type).setAggregate(2); 3926 ;} 3927 break; 3928 3929 case 128: 3930 3931 { 3915 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line); 3916 (yyval.interm.type).setAggregate(2, true); 3917 ;} 3918 break; 3919 3920 case 130: 3921 3922 { 3923 FRAG_VERT_ONLY("mat3", (yyvsp[(1) - (1)].lex).line); 3932 3924 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 3933 (yyval.interm.type).setBasic(EbtInt, qual, (yylsp[(1) - (1)])); 3934 (yyval.interm.type).setAggregate(3); 3935 ;} 3936 break; 3937 3938 case 129: 3939 3940 { 3925 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line); 3926 (yyval.interm.type).setAggregate(3, true); 3927 ;} 3928 break; 3929 3930 case 131: 3931 3932 { 3933 FRAG_VERT_ONLY("mat4", (yyvsp[(1) - (1)].lex).line); 3941 3934 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 3942 (yyval.interm.type).setBasic(EbtInt, qual, (yylsp[(1) - (1)])); 3943 (yyval.interm.type).setAggregate(4); 3944 ;} 3945 break; 3946 3947 case 130: 3948 3949 { 3935 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line); 3936 (yyval.interm.type).setAggregate(4, true); 3937 ;} 3938 break; 3939 3940 case 132: 3941 3942 { 3943 FRAG_VERT_ONLY("sampler2D", (yyvsp[(1) - (1)].lex).line); 3950 3944 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 3951 (yyval.interm.type).setBasic(Ebt Float, qual, (yylsp[(1) - (1)]));3952 (yyval.interm.type).setAggregate(2, true);3953 ;}3954 break; 3955 3956 case 131: 3957 3958 {3945 (yyval.interm.type).setBasic(EbtSampler2D, qual, (yyvsp[(1) - (1)].lex).line); 3946 ;} 3947 break; 3948 3949 case 133: 3950 3951 { 3952 FRAG_VERT_ONLY("samplerCube", (yyvsp[(1) - (1)].lex).line); 3959 3953 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 3960 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)])); 3961 (yyval.interm.type).setAggregate(3, true); 3962 ;} 3963 break; 3964 3965 case 132: 3966 3967 { 3954 (yyval.interm.type).setBasic(EbtSamplerCube, qual, (yyvsp[(1) - (1)].lex).line); 3955 ;} 3956 break; 3957 3958 case 134: 3959 3960 { 3961 if (!context->supportsExtension("GL_OES_EGL_image_external")) { 3962 context->error((yyvsp[(1) - (1)].lex).line, "unsupported type", "samplerExternalOES"); 3963 context->recover(); 3964 } 3965 FRAG_VERT_ONLY("samplerExternalOES", (yyvsp[(1) - (1)].lex).line); 3968 3966 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 3969 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)])); 3970 (yyval.interm.type).setAggregate(4, true); 3971 ;} 3972 break; 3973 3974 case 133: 3975 3976 { 3967 (yyval.interm.type).setBasic(EbtSamplerExternalOES, qual, (yyvsp[(1) - (1)].lex).line); 3968 ;} 3969 break; 3970 3971 case 135: 3972 3973 { 3974 if (!context->supportsExtension("GL_ARB_texture_rectangle")) { 3975 context->error((yyvsp[(1) - (1)].lex).line, "unsupported type", "sampler2DRect"); 3976 context->recover(); 3977 } 3978 FRAG_VERT_ONLY("sampler2DRect", (yyvsp[(1) - (1)].lex).line); 3977 3979 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 3978 (yyval.interm.type).setBasic(EbtSampler2D, qual, (yylsp[(1) - (1)])); 3979 ;} 3980 break; 3981 3982 case 134: 3983 3984 { 3985 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 3986 (yyval.interm.type).setBasic(EbtSamplerCube, qual, (yylsp[(1) - (1)])); 3987 ;} 3988 break; 3989 3990 case 135: 3991 3992 { 3993 if (!context->supportsExtension("GL_OES_EGL_image_external")) { 3994 context->error((yylsp[(1) - (1)]), "unsupported type", "samplerExternalOES"); 3995 context->recover(); 3996 } 3997 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 3998 (yyval.interm.type).setBasic(EbtSamplerExternalOES, qual, (yylsp[(1) - (1)])); 3980 (yyval.interm.type).setBasic(EbtSampler2DRect, qual, (yyvsp[(1) - (1)].lex).line); 3999 3981 ;} 4000 3982 break; … … 4003 3985 4004 3986 { 4005 if (!context->supportsExtension("GL_ARB_texture_rectangle")) { 4006 context->error((yylsp[(1) - (1)]), "unsupported type", "sampler2DRect"); 4007 context->recover(); 4008 } 4009 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 4010 (yyval.interm.type).setBasic(EbtSampler2DRect, qual, (yylsp[(1) - (1)])); 4011 ;} 4012 break; 4013 4014 case 137: 4015 4016 { 3987 FRAG_VERT_ONLY("struct", (yyvsp[(1) - (1)].interm.type).line); 4017 3988 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); 4018 3989 (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; … … 4020 3991 break; 4021 3992 4022 case 13 8:3993 case 137: 4023 3994 4024 3995 { … … 4029 4000 TType& structure = static_cast<TVariable*>((yyvsp[(1) - (1)].lex).symbol)->getType(); 4030 4001 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; 4031 (yyval.interm.type).setBasic(EbtStruct, qual, (yy lsp[(1) - (1)]));4002 (yyval.interm.type).setBasic(EbtStruct, qual, (yyvsp[(1) - (1)].lex).line); 4032 4003 (yyval.interm.type).userDef = &structure; 4033 4004 ;} 4034 4005 break; 4035 4006 4007 case 138: 4008 4009 { if (context->enterStructDeclaration((yyvsp[(2) - (3)].lex).line, *(yyvsp[(2) - (3)].lex).string)) context->recover(); ;} 4010 break; 4011 4036 4012 case 139: 4037 4013 4038 { if (context->enterStructDeclaration((yylsp[(2) - (3)]), *(yyvsp[(2) - (3)].lex).string)) context->recover(); ;} 4039 break; 4040 4041 case 140: 4042 4043 { 4044 if (context->reservedErrorCheck((yylsp[(2) - (6)]), *(yyvsp[(2) - (6)].lex).string)) 4045 context->recover(); 4046 4047 TType* structure = new TType(new TStructure((yyvsp[(2) - (6)].lex).string, (yyvsp[(5) - (6)].interm.fieldList))); 4014 { 4015 if (context->reservedErrorCheck((yyvsp[(2) - (6)].lex).line, *(yyvsp[(2) - (6)].lex).string)) 4016 context->recover(); 4017 4018 TType* structure = new TType((yyvsp[(5) - (6)].interm.typeList), *(yyvsp[(2) - (6)].lex).string); 4048 4019 TVariable* userTypeDef = new TVariable((yyvsp[(2) - (6)].lex).string, *structure, true); 4049 4020 if (! context->symbolTable.insert(*userTypeDef)) { 4050 context->error((yy lsp[(2) - (6)]), "redefinition", (yyvsp[(2) - (6)].lex).string->c_str(), "struct");4051 context->recover(); 4052 } 4053 (yyval.interm.type).setBasic(EbtStruct, EvqTemporary, (yy lsp[(1) - (6)]));4021 context->error((yyvsp[(2) - (6)].lex).line, "redefinition", (yyvsp[(2) - (6)].lex).string->c_str(), "struct"); 4022 context->recover(); 4023 } 4024 (yyval.interm.type).setBasic(EbtStruct, EvqTemporary, (yyvsp[(1) - (6)].lex).line); 4054 4025 (yyval.interm.type).userDef = structure; 4055 4026 context->exitStructDeclaration(); … … 4057 4028 break; 4058 4029 4030 case 140: 4031 4032 { if (context->enterStructDeclaration((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string)) context->recover(); ;} 4033 break; 4034 4059 4035 case 141: 4060 4036 4061 { if (context->enterStructDeclaration((yylsp[(2) - (2)]), *(yyvsp[(2) - (2)].lex).string)) context->recover(); ;} 4062 break; 4063 4064 case 142: 4065 4066 { 4067 TType* structure = new TType(new TStructure(NewPoolTString(""), (yyvsp[(4) - (5)].interm.fieldList))); 4068 (yyval.interm.type).setBasic(EbtStruct, EvqTemporary, (yylsp[(1) - (5)])); 4037 { 4038 TType* structure = new TType((yyvsp[(4) - (5)].interm.typeList), TString("")); 4039 (yyval.interm.type).setBasic(EbtStruct, EvqTemporary, (yyvsp[(1) - (5)].lex).line); 4069 4040 (yyval.interm.type).userDef = structure; 4070 4041 context->exitStructDeclaration(); … … 4072 4043 break; 4073 4044 4045 case 142: 4046 4047 { 4048 (yyval.interm.typeList) = (yyvsp[(1) - (1)].interm.typeList); 4049 ;} 4050 break; 4051 4074 4052 case 143: 4075 4053 4076 4054 { 4077 (yyval.interm.fieldList) = (yyvsp[(1) - (1)].interm.fieldList); 4078 ;} 4079 break; 4080 4081 case 144: 4082 4083 { 4084 (yyval.interm.fieldList) = (yyvsp[(1) - (2)].interm.fieldList); 4085 for (size_t i = 0; i < (yyvsp[(2) - (2)].interm.fieldList)->size(); ++i) { 4086 TField* field = (*(yyvsp[(2) - (2)].interm.fieldList))[i]; 4087 for (size_t j = 0; j < (yyval.interm.fieldList)->size(); ++j) { 4088 if ((*(yyval.interm.fieldList))[j]->name() == field->name()) { 4089 context->error((yylsp[(2) - (2)]), "duplicate field name in structure:", "struct", field->name().c_str()); 4055 (yyval.interm.typeList) = (yyvsp[(1) - (2)].interm.typeList); 4056 for (unsigned int i = 0; i < (yyvsp[(2) - (2)].interm.typeList)->size(); ++i) { 4057 for (unsigned int j = 0; j < (yyval.interm.typeList)->size(); ++j) { 4058 if ((*(yyval.interm.typeList))[j].type->getFieldName() == (*(yyvsp[(2) - (2)].interm.typeList))[i].type->getFieldName()) { 4059 context->error((*(yyvsp[(2) - (2)].interm.typeList))[i].line, "duplicate field name in structure:", "struct", (*(yyvsp[(2) - (2)].interm.typeList))[i].type->getFieldName().c_str()); 4090 4060 context->recover(); 4091 4061 } 4092 4062 } 4093 (yyval.interm. fieldList)->push_back(field);4094 } 4095 ;} 4096 break; 4097 4098 case 14 5:4099 4100 { 4101 (yyval.interm. fieldList) = (yyvsp[(2) - (3)].interm.fieldList);4102 4103 if (context->voidErrorCheck((yy lsp[(1) - (3)]), (*(yyvsp[(2) - (3)].interm.fieldList))[0]->name(), (yyvsp[(1) - (3)].interm.type))) {4104 context->recover(); 4105 } 4106 for (unsigned int i = 0; i < (yyval.interm. fieldList)->size(); ++i) {4063 (yyval.interm.typeList)->push_back((*(yyvsp[(2) - (2)].interm.typeList))[i]); 4064 } 4065 ;} 4066 break; 4067 4068 case 144: 4069 4070 { 4071 (yyval.interm.typeList) = (yyvsp[(2) - (3)].interm.typeList); 4072 4073 if (context->voidErrorCheck((yyvsp[(1) - (3)].interm.type).line, (*(yyvsp[(2) - (3)].interm.typeList))[0].type->getFieldName(), (yyvsp[(1) - (3)].interm.type))) { 4074 context->recover(); 4075 } 4076 for (unsigned int i = 0; i < (yyval.interm.typeList)->size(); ++i) { 4107 4077 // 4108 4078 // Careful not to replace already known aspects of type, like array-ness 4109 4079 // 4110 TType* type = (*(yyval.interm. fieldList))[i]->type();4080 TType* type = (*(yyval.interm.typeList))[i].type; 4111 4081 type->setBasicType((yyvsp[(1) - (3)].interm.type).type); 4112 4082 type->setNominalSize((yyvsp[(1) - (3)].interm.type).size); … … 4116 4086 // don't allow arrays of arrays 4117 4087 if (type->isArray()) { 4118 if (context->arrayTypeErrorCheck((yy lsp[(1) - (3)]), (yyvsp[(1) - (3)].interm.type)))4088 if (context->arrayTypeErrorCheck((yyvsp[(1) - (3)].interm.type).line, (yyvsp[(1) - (3)].interm.type))) 4119 4089 context->recover(); 4120 4090 } 4121 4091 if ((yyvsp[(1) - (3)].interm.type).array) 4122 4092 type->setArraySize((yyvsp[(1) - (3)].interm.type).arraySize); 4123 if ((yyvsp[(1) - (3)].interm.type).userDef) 4093 if ((yyvsp[(1) - (3)].interm.type).userDef) { 4124 4094 type->setStruct((yyvsp[(1) - (3)].interm.type).userDef->getStruct()); 4125 4126 if (context->structNestingErrorCheck((yylsp[(1) - (3)]), *(*(yyval.interm.fieldList))[i])) 4095 type->setTypeName((yyvsp[(1) - (3)].interm.type).userDef->getTypeName()); 4096 } 4097 4098 if (context->structNestingErrorCheck((yyvsp[(1) - (3)].interm.type).line, *type)) { 4127 4099 context->recover(); 4128 } 4100 } 4101 } 4102 ;} 4103 break; 4104 4105 case 145: 4106 4107 { 4108 (yyval.interm.typeList) = NewPoolTTypeList(); 4109 (yyval.interm.typeList)->push_back((yyvsp[(1) - (1)].interm.typeLine)); 4129 4110 ;} 4130 4111 break; … … 4133 4114 4134 4115 { 4135 (yyval.interm.fieldList) = NewPoolTFieldList(); 4136 (yyval.interm.fieldList)->push_back((yyvsp[(1) - (1)].interm.field)); 4116 (yyval.interm.typeList)->push_back((yyvsp[(3) - (3)].interm.typeLine)); 4137 4117 ;} 4138 4118 break; … … 4141 4121 4142 4122 { 4143 (yyval.interm.fieldList)->push_back((yyvsp[(3) - (3)].interm.field)); 4123 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string)) 4124 context->recover(); 4125 4126 (yyval.interm.typeLine).type = new TType(EbtVoid, EbpUndefined); 4127 (yyval.interm.typeLine).line = (yyvsp[(1) - (1)].lex).line; 4128 (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (1)].lex).string); 4144 4129 ;} 4145 4130 break; … … 4148 4133 4149 4134 { 4150 if (context->reservedErrorCheck((yylsp[(1) - (1)]), *(yyvsp[(1) - (1)].lex).string)) 4151 context->recover(); 4152 4153 TType* type = new TType(EbtVoid, EbpUndefined); 4154 (yyval.interm.field) = new TField(type, (yyvsp[(1) - (1)].lex).string); 4135 if (context->reservedErrorCheck((yyvsp[(1) - (4)].lex).line, *(yyvsp[(1) - (4)].lex).string)) 4136 context->recover(); 4137 4138 (yyval.interm.typeLine).type = new TType(EbtVoid, EbpUndefined); 4139 (yyval.interm.typeLine).line = (yyvsp[(1) - (4)].lex).line; 4140 (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (4)].lex).string); 4141 4142 int size; 4143 if (context->arraySizeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode), size)) 4144 context->recover(); 4145 (yyval.interm.typeLine).type->setArraySize(size); 4155 4146 ;} 4156 4147 break; … … 4158 4149 case 149: 4159 4150 4160 { 4161 if (context->reservedErrorCheck((yylsp[(1) - (4)]), *(yyvsp[(1) - (4)].lex).string)) 4162 context->recover(); 4163 4164 TType* type = new TType(EbtVoid, EbpUndefined); 4165 int size = 0; 4166 if (context->arraySizeErrorCheck((yylsp[(3) - (4)]), (yyvsp[(3) - (4)].interm.intermTypedNode), size)) 4167 context->recover(); 4168 type->setArraySize(size); 4169 4170 (yyval.interm.field) = new TField(type, (yyvsp[(1) - (4)].lex).string); 4171 ;} 4151 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); ;} 4172 4152 break; 4173 4153 4174 4154 case 150: 4175 4155 4176 { (yyval.interm.interm TypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); ;}4156 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); ;} 4177 4157 break; 4178 4158 4179 4159 case 151: 4180 4160 4161 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermAggregate); ;} 4162 break; 4163 4164 case 152: 4165 4181 4166 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); ;} 4182 4167 break; 4183 4168 4184 case 152:4185 4186 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermAggregate); ;}4187 break;4188 4189 4169 case 153: 4190 4170 … … 4214 4194 case 158: 4215 4195 4216 { (yyval.interm.interm Node) = (yyvsp[(1) - (1)].interm.intermNode); ;}4196 { (yyval.interm.intermAggregate) = 0; ;} 4217 4197 break; 4218 4198 4219 4199 case 159: 4220 4200 4221 { (yyval.interm.intermAggregate) = 0; ;}4201 { context->symbolTable.push(); ;} 4222 4202 break; 4223 4203 4224 4204 case 160: 4225 4205 4226 { context->symbolTable.p ush(); ;}4206 { context->symbolTable.pop(); ;} 4227 4207 break; 4228 4208 4229 4209 case 161: 4230 4231 { context->symbolTable.pop(); ;}4232 break;4233 4234 case 162:4235 4210 4236 4211 { 4237 4212 if ((yyvsp[(3) - (5)].interm.intermAggregate) != 0) { 4238 4213 (yyvsp[(3) - (5)].interm.intermAggregate)->setOp(EOpSequence); 4239 (yyvsp[(3) - (5)].interm.intermAggregate)->set Line((yyloc));4214 (yyvsp[(3) - (5)].interm.intermAggregate)->setEndLine((yyvsp[(5) - (5)].lex).line); 4240 4215 } 4241 4216 (yyval.interm.intermAggregate) = (yyvsp[(3) - (5)].interm.intermAggregate); … … 4243 4218 break; 4244 4219 4220 case 162: 4221 4222 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); ;} 4223 break; 4224 4245 4225 case 163: 4246 4226 … … 4250 4230 case 164: 4251 4231 4252 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); ;}4232 { context->symbolTable.push(); ;} 4253 4233 break; 4254 4234 4255 4235 case 165: 4256 4236 4237 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); ;} 4238 break; 4239 4240 case 166: 4241 4257 4242 { context->symbolTable.push(); ;} 4258 4243 break; 4259 4244 4260 case 16 6:4245 case 167: 4261 4246 4262 4247 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); ;} 4263 4248 break; 4264 4249 4265 case 167:4266 4267 { context->symbolTable.push(); ;}4268 break;4269 4270 4250 case 168: 4271 4251 4272 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); ;} 4252 { 4253 (yyval.interm.intermNode) = 0; 4254 ;} 4273 4255 break; 4274 4256 4275 4257 case 169: 4276 4277 {4278 (yyval.interm.intermNode) = 0;4279 ;}4280 break;4281 4282 case 170:4283 4258 4284 4259 { 4285 4260 if ((yyvsp[(2) - (3)].interm.intermAggregate)) { 4286 4261 (yyvsp[(2) - (3)].interm.intermAggregate)->setOp(EOpSequence); 4287 (yyvsp[(2) - (3)].interm.intermAggregate)->set Line((yyloc));4262 (yyvsp[(2) - (3)].interm.intermAggregate)->setEndLine((yyvsp[(3) - (3)].lex).line); 4288 4263 } 4289 4264 (yyval.interm.intermNode) = (yyvsp[(2) - (3)].interm.intermAggregate); … … 4291 4266 break; 4292 4267 4268 case 170: 4269 4270 { 4271 (yyval.interm.intermAggregate) = context->intermediate.makeAggregate((yyvsp[(1) - (1)].interm.intermNode), 0); 4272 ;} 4273 break; 4274 4293 4275 case 171: 4294 4276 4295 4277 { 4296 (yyval.interm.intermAggregate) = context->intermediate. makeAggregate((yyvsp[(1) - (1)].interm.intermNode), (yyloc));4278 (yyval.interm.intermAggregate) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermAggregate), (yyvsp[(2) - (2)].interm.intermNode), 0); 4297 4279 ;} 4298 4280 break; … … 4300 4282 case 172: 4301 4283 4302 { 4303 (yyval.interm.intermAggregate) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermAggregate), (yyvsp[(2) - (2)].interm.intermNode), (yyloc)); 4304 ;} 4284 { (yyval.interm.intermNode) = 0; ;} 4305 4285 break; 4306 4286 4307 4287 case 173: 4308 4288 4309 { (yyval.interm.intermNode) = 0; ;}4289 { (yyval.interm.intermNode) = static_cast<TIntermNode*>((yyvsp[(1) - (2)].interm.intermTypedNode)); ;} 4310 4290 break; 4311 4291 4312 4292 case 174: 4313 4293 4314 { (yyval.interm.intermNode) = static_cast<TIntermNode*>((yyvsp[(1) - (2)].interm.intermTypedNode)); ;} 4294 { 4295 if (context->boolErrorCheck((yyvsp[(1) - (5)].lex).line, (yyvsp[(3) - (5)].interm.intermTypedNode))) 4296 context->recover(); 4297 (yyval.interm.intermNode) = context->intermediate.addSelection((yyvsp[(3) - (5)].interm.intermTypedNode), (yyvsp[(5) - (5)].interm.nodePair), (yyvsp[(1) - (5)].lex).line); 4298 ;} 4315 4299 break; 4316 4300 4317 4301 case 175: 4318 4319 {4320 if (context->boolErrorCheck((yylsp[(1) - (5)]), (yyvsp[(3) - (5)].interm.intermTypedNode)))4321 context->recover();4322 (yyval.interm.intermNode) = context->intermediate.addSelection((yyvsp[(3) - (5)].interm.intermTypedNode), (yyvsp[(5) - (5)].interm.nodePair), (yylsp[(1) - (5)]));4323 ;}4324 break;4325 4326 case 176:4327 4302 4328 4303 { … … 4332 4307 break; 4333 4308 4334 case 17 7:4309 case 176: 4335 4310 4336 4311 { … … 4340 4315 break; 4341 4316 4342 case 17 8:4317 case 177: 4343 4318 4344 4319 { … … 4349 4324 break; 4350 4325 4351 case 17 9:4326 case 178: 4352 4327 4353 4328 { 4354 4329 TIntermNode* intermNode; 4355 if (context->structQualifierErrorCheck((yy lsp[(2) - (4)]), (yyvsp[(1) - (4)].interm.type)))4356 context->recover(); 4357 if (context->boolErrorCheck((yy lsp[(2) - (4)]), (yyvsp[(1) - (4)].interm.type)))4358 context->recover(); 4359 4360 if (!context->executeInitializer((yy lsp[(2) - (4)]), *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode))4330 if (context->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type))) 4331 context->recover(); 4332 if (context->boolErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type))) 4333 context->recover(); 4334 4335 if (!context->executeInitializer((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode)) 4361 4336 (yyval.interm.intermTypedNode) = (yyvsp[(4) - (4)].interm.intermTypedNode); 4362 4337 else { … … 4367 4342 break; 4368 4343 4344 case 179: 4345 4346 { context->symbolTable.push(); ++context->loopNestingLevel; ;} 4347 break; 4348 4369 4349 case 180: 4370 4350 4351 { 4352 context->symbolTable.pop(); 4353 (yyval.interm.intermNode) = context->intermediate.addLoop(ELoopWhile, 0, (yyvsp[(4) - (6)].interm.intermTypedNode), 0, (yyvsp[(6) - (6)].interm.intermNode), (yyvsp[(1) - (6)].lex).line); 4354 --context->loopNestingLevel; 4355 ;} 4356 break; 4357 4358 case 181: 4359 4360 { ++context->loopNestingLevel; ;} 4361 break; 4362 4363 case 182: 4364 4365 { 4366 if (context->boolErrorCheck((yyvsp[(8) - (8)].lex).line, (yyvsp[(6) - (8)].interm.intermTypedNode))) 4367 context->recover(); 4368 4369 (yyval.interm.intermNode) = context->intermediate.addLoop(ELoopDoWhile, 0, (yyvsp[(6) - (8)].interm.intermTypedNode), 0, (yyvsp[(3) - (8)].interm.intermNode), (yyvsp[(4) - (8)].lex).line); 4370 --context->loopNestingLevel; 4371 ;} 4372 break; 4373 4374 case 183: 4375 4371 4376 { context->symbolTable.push(); ++context->loopNestingLevel; ;} 4372 4377 break; 4373 4378 4374 case 18 1:4379 case 184: 4375 4380 4376 4381 { 4377 4382 context->symbolTable.pop(); 4378 (yyval.interm.intermNode) = context->intermediate.addLoop(ELoop While, 0, (yyvsp[(4) - (6)].interm.intermTypedNode), 0, (yyvsp[(6) - (6)].interm.intermNode), (yylsp[(1) - (6)]));4383 (yyval.interm.intermNode) = context->intermediate.addLoop(ELoopFor, (yyvsp[(4) - (7)].interm.intermNode), reinterpret_cast<TIntermTyped*>((yyvsp[(5) - (7)].interm.nodePair).node1), reinterpret_cast<TIntermTyped*>((yyvsp[(5) - (7)].interm.nodePair).node2), (yyvsp[(7) - (7)].interm.intermNode), (yyvsp[(1) - (7)].lex).line); 4379 4384 --context->loopNestingLevel; 4380 4385 ;} 4381 4386 break; 4382 4387 4383 case 182:4384 4385 { ++context->loopNestingLevel; ;}4386 break;4387 4388 case 183:4389 4390 {4391 if (context->boolErrorCheck((yylsp[(8) - (8)]), (yyvsp[(6) - (8)].interm.intermTypedNode)))4392 context->recover();4393 4394 (yyval.interm.intermNode) = context->intermediate.addLoop(ELoopDoWhile, 0, (yyvsp[(6) - (8)].interm.intermTypedNode), 0, (yyvsp[(3) - (8)].interm.intermNode), (yylsp[(4) - (8)]));4395 --context->loopNestingLevel;4396 ;}4397 break;4398 4399 case 184:4400 4401 { context->symbolTable.push(); ++context->loopNestingLevel; ;}4402 break;4403 4404 4388 case 185: 4405 4389 4406 4390 { 4407 context->symbolTable.pop(); 4408 (yyval.interm.intermNode) = context->intermediate.addLoop(ELoopFor, (yyvsp[(4) - (7)].interm.intermNode), reinterpret_cast<TIntermTyped*>((yyvsp[(5) - (7)].interm.nodePair).node1), reinterpret_cast<TIntermTyped*>((yyvsp[(5) - (7)].interm.nodePair).node2), (yyvsp[(7) - (7)].interm.intermNode), (yylsp[(1) - (7)])); 4409 --context->loopNestingLevel; 4391 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); 4410 4392 ;} 4411 4393 break; … … 4421 4403 4422 4404 { 4423 (yyval.interm.interm Node) = (yyvsp[(1) - (1)].interm.intermNode);4405 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); 4424 4406 ;} 4425 4407 break; … … 4428 4410 4429 4411 { 4430 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);4412 (yyval.interm.intermTypedNode) = 0; 4431 4413 ;} 4432 4414 break; 4433 4415 4434 4416 case 189: 4435 4436 {4437 (yyval.interm.intermTypedNode) = 0;4438 ;}4439 break;4440 4441 case 190:4442 4417 4443 4418 { … … 4447 4422 break; 4448 4423 4449 case 19 1:4424 case 190: 4450 4425 4451 4426 { … … 4455 4430 break; 4456 4431 4432 case 191: 4433 4434 { 4435 if (context->loopNestingLevel <= 0) { 4436 context->error((yyvsp[(1) - (2)].lex).line, "continue statement only allowed in loops", ""); 4437 context->recover(); 4438 } 4439 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpContinue, (yyvsp[(1) - (2)].lex).line); 4440 ;} 4441 break; 4442 4457 4443 case 192: 4458 4444 4459 4445 { 4460 4446 if (context->loopNestingLevel <= 0) { 4461 context->error((yy lsp[(1) - (2)]), "continuestatement only allowed in loops", "");4462 context->recover(); 4463 } 4464 (yyval.interm.intermNode) = context->intermediate.addBranch(EOp Continue, (yylsp[(1) - (2)]));4447 context->error((yyvsp[(1) - (2)].lex).line, "break statement only allowed in loops", ""); 4448 context->recover(); 4449 } 4450 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpBreak, (yyvsp[(1) - (2)].lex).line); 4465 4451 ;} 4466 4452 break; … … 4469 4455 4470 4456 { 4471 if (context->loopNestingLevel <= 0) {4472 context->error((yylsp[(1) - (2)]), "break statement only allowed in loops", "");4473 context-> recover();4474 }4475 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpBreak, (yylsp[(1) - (2)]));4457 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(1) - (2)].lex).line); 4458 if (context->currentFunctionType->getBasicType() != EbtVoid) { 4459 context->error((yyvsp[(1) - (2)].lex).line, "non-void function must return a value", "return"); 4460 context->recover(); 4461 } 4476 4462 ;} 4477 4463 break; … … 4480 4466 4481 4467 { 4482 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yylsp[(1) - (2)])); 4483 if (context->currentFunctionType->getBasicType() != EbtVoid) { 4484 context->error((yylsp[(1) - (2)]), "non-void function must return a value", "return"); 4485 context->recover(); 4486 } 4487 ;} 4488 break; 4489 4490 case 195: 4491 4492 { 4493 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(2) - (3)].interm.intermTypedNode), (yylsp[(1) - (3)])); 4468 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(2) - (3)].interm.intermTypedNode), (yyvsp[(1) - (3)].lex).line); 4494 4469 context->functionReturnsValue = true; 4495 4470 if (context->currentFunctionType->getBasicType() == EbtVoid) { 4496 context->error((yy lsp[(1) - (3)]), "void function cannot return a value", "return");4471 context->error((yyvsp[(1) - (3)].lex).line, "void function cannot return a value", "return"); 4497 4472 context->recover(); 4498 4473 } else if (*(context->currentFunctionType) != (yyvsp[(2) - (3)].interm.intermTypedNode)->getType()) { 4499 context->error((yylsp[(1) - (3)]), "function return is not matching type:", "return"); 4500 context->recover(); 4501 } 4474 context->error((yyvsp[(1) - (3)].lex).line, "function return is not matching type:", "return"); 4475 context->recover(); 4476 } 4477 ;} 4478 break; 4479 4480 case 195: 4481 4482 { 4483 FRAG_ONLY("discard", (yyvsp[(1) - (2)].lex).line); 4484 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpKill, (yyvsp[(1) - (2)].lex).line); 4502 4485 ;} 4503 4486 break; 4504 4487 4505 4488 case 196: 4506 4507 {4508 FRAG_ONLY("discard", (yylsp[(1) - (2)]));4509 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpKill, (yylsp[(1) - (2)]));4510 ;}4511 break;4512 4513 case 197:4514 4489 4515 4490 { … … 4519 4494 break; 4520 4495 4496 case 197: 4497 4498 { 4499 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermNode), (yyvsp[(2) - (2)].interm.intermNode), 0); 4500 context->treeRoot = (yyval.interm.intermNode); 4501 ;} 4502 break; 4503 4521 4504 case 198: 4522 4505 4523 4506 { 4524 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermNode), (yyvsp[(2) - (2)].interm.intermNode), (yyloc)); 4525 context->treeRoot = (yyval.interm.intermNode); 4507 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); 4526 4508 ;} 4527 4509 break; … … 4535 4517 4536 4518 case 200: 4537 4538 {4539 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);4540 ;}4541 break;4542 4543 case 201:4544 4519 4545 4520 { … … 4550 4525 if (builtIn) 4551 4526 { 4552 context->error((yy lsp[(1) - (1)]), "built-in functions cannot be redefined", function->getName().c_str());4527 context->error((yyvsp[(1) - (1)].interm).line, "built-in functions cannot be redefined", function->getName().c_str()); 4553 4528 context->recover(); 4554 4529 } … … 4564 4539 // Then this function already has a body. 4565 4540 // 4566 context->error((yy lsp[(1) - (1)]), "function already has a body", function->getName().c_str());4541 context->error((yyvsp[(1) - (1)].interm).line, "function already has a body", function->getName().c_str()); 4567 4542 context->recover(); 4568 4543 } … … 4574 4549 if (function->getName() == "main") { 4575 4550 if (function->getParamCount() > 0) { 4576 context->error((yy lsp[(1) - (1)]), "function cannot take any parameter(s)", function->getName().c_str());4551 context->error((yyvsp[(1) - (1)].interm).line, "function cannot take any parameter(s)", function->getName().c_str()); 4577 4552 context->recover(); 4578 4553 } 4579 4554 if (function->getReturnType().getBasicType() != EbtVoid) { 4580 context->error((yy lsp[(1) - (1)]), "", function->getReturnType().getBasicString(), "main function cannot return a value");4555 context->error((yyvsp[(1) - (1)].interm).line, "", function->getReturnType().getBasicString(), "main function cannot return a value"); 4581 4556 context->recover(); 4582 4557 } … … 4606 4581 // 4607 4582 if (! context->symbolTable.insert(*variable)) { 4608 context->error((yy lsp[(1) - (1)]), "redefinition", variable->getName().c_str());4583 context->error((yyvsp[(1) - (1)].interm).line, "redefinition", variable->getName().c_str()); 4609 4584 context->recover(); 4610 4585 delete variable; … … 4617 4592 paramNodes, 4618 4593 context->intermediate.addSymbol(variable->getUniqueId(), 4619 variable->getName(), 4620 variable->getType(), 4621 (yylsp[(1) - (1)])), 4622 (yylsp[(1) - (1)])); 4594 variable->getName(), 4595 variable->getType(), (yyvsp[(1) - (1)].interm).line), 4596 (yyvsp[(1) - (1)].interm).line); 4623 4597 } else { 4624 paramNodes = context->intermediate.growAggregate(paramNodes, context->intermediate.addSymbol(0, "", *param.type, (yy lsp[(1) - (1)])), (yylsp[(1) - (1)]));4598 paramNodes = context->intermediate.growAggregate(paramNodes, context->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (1)].interm).line), (yyvsp[(1) - (1)].interm).line); 4625 4599 } 4626 4600 } 4627 context->intermediate.setAggregateOperator(paramNodes, EOpParameters, (yy lsp[(1) - (1)]));4601 context->intermediate.setAggregateOperator(paramNodes, EOpParameters, (yyvsp[(1) - (1)].interm).line); 4628 4602 (yyvsp[(1) - (1)].interm).intermAggregate = paramNodes; 4629 4603 context->loopNestingLevel = 0; … … 4631 4605 break; 4632 4606 4633 case 20 2:4607 case 201: 4634 4608 4635 4609 { … … 4637 4611 // May be best done as post process phase on intermediate code 4638 4612 if (context->currentFunctionType->getBasicType() != EbtVoid && ! context->functionReturnsValue) { 4639 context->error((yy lsp[(1) - (3)]), "function does not return a value:", "", (yyvsp[(1) - (3)].interm).function->getName().c_str());4613 context->error((yyvsp[(1) - (3)].interm).line, "function does not return a value:", "", (yyvsp[(1) - (3)].interm).function->getName().c_str()); 4640 4614 context->recover(); 4641 4615 } 4642 4616 4643 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermAggregate, (yyvsp[(3) - (3)].interm.intermNode), (yyloc));4644 context->intermediate.setAggregateOperator((yyval.interm.intermNode), EOpFunction, (yy lsp[(1) - (3)]));4617 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermAggregate, (yyvsp[(3) - (3)].interm.intermNode), 0); 4618 context->intermediate.setAggregateOperator((yyval.interm.intermNode), EOpFunction, (yyvsp[(1) - (3)].interm).line); 4645 4619 (yyval.interm.intermNode)->getAsAggregate()->setName((yyvsp[(1) - (3)].interm).function->getMangledName().c_str()); 4646 4620 (yyval.interm.intermNode)->getAsAggregate()->setType((yyvsp[(1) - (3)].interm).function->getReturnType()); … … 4651 4625 (yyval.interm.intermNode)->getAsAggregate()->setDebug(context->pragma().debug); 4652 4626 4627 if ((yyvsp[(3) - (3)].interm.intermNode) && (yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate()) 4628 (yyval.interm.intermNode)->getAsAggregate()->setEndLine((yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate()->getEndLine()); 4629 4653 4630 context->symbolTable.pop(); 4654 4631 ;} … … 4667 4644 4668 4645 *++yyvsp = yyval; 4669 *++yylsp = yyloc; 4646 4670 4647 4671 4648 /* Now `shift' the result of the reduction. Determine what state … … 4693 4670 ++yynerrs; 4694 4671 #if ! YYERROR_VERBOSE 4695 yyerror ( &yylloc,context, YY_("syntax error"));4672 yyerror (context, YY_("syntax error")); 4696 4673 #else 4697 4674 { … … 4717 4694 { 4718 4695 (void) yysyntax_error (yymsg, yystate, yychar); 4719 yyerror ( &yylloc,context, yymsg);4696 yyerror (context, yymsg); 4720 4697 } 4721 4698 else 4722 4699 { 4723 yyerror ( &yylloc,context, YY_("syntax error"));4700 yyerror (context, YY_("syntax error")); 4724 4701 if (yysize != 0) 4725 4702 goto yyexhaustedlab; … … 4729 4706 } 4730 4707 4731 yyerror_range[0] = yylloc; 4708 4732 4709 4733 4710 if (yyerrstatus == 3) … … 4745 4722 { 4746 4723 yydestruct ("Error: discarding", 4747 yytoken, &yylval, &yylloc,context);4724 yytoken, &yylval, context); 4748 4725 yychar = YYEMPTY; 4749 4726 } … … 4766 4743 goto yyerrorlab; 4767 4744 4768 yyerror_range[0] = yylsp[1-yylen];4769 4745 /* Do not reclaim the symbols of the rule which action triggered 4770 4746 this YYERROR. */ … … 4800 4776 YYABORT; 4801 4777 4802 yyerror_range[0] = *yylsp; 4778 4803 4779 yydestruct ("Error: popping", 4804 yystos[yystate], yyvsp, yylsp,context);4780 yystos[yystate], yyvsp, context); 4805 4781 YYPOPSTACK (1); 4806 4782 yystate = *yyssp; … … 4813 4789 *++yyvsp = yylval; 4814 4790 4815 yyerror_range[1] = yylloc;4816 /* Using YYLLOC is tempting, but would change the location of4817 the look-ahead. YYLOC is available though. */4818 YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);4819 *++yylsp = yyloc;4820 4791 4821 4792 /* Shift the error token. */ … … 4845 4816 `-------------------------------------------------*/ 4846 4817 yyexhaustedlab: 4847 yyerror ( &yylloc,context, YY_("memory exhausted"));4818 yyerror (context, YY_("memory exhausted")); 4848 4819 yyresult = 2; 4849 4820 /* Fall through. */ … … 4853 4824 if (yychar != YYEOF && yychar != YYEMPTY) 4854 4825 yydestruct ("Cleanup: discarding lookahead", 4855 yytoken, &yylval, &yylloc,context);4826 yytoken, &yylval, context); 4856 4827 /* Do not reclaim the symbols of the rule which action triggered 4857 4828 this YYABORT or YYACCEPT. */ … … 4861 4832 { 4862 4833 yydestruct ("Cleanup: popping", 4863 yystos[*yyssp], yyvsp, yylsp,context);4834 yystos[*yyssp], yyvsp, context); 4864 4835 YYPOPSTACK (1); 4865 4836 } … … 4880 4851 4881 4852 4882 void yyerror(YYLTYPE* yylloc, TParseContext* context, const char* reason) {4883 context->error(*yylloc, reason, "");4884 context->recover();4885 }4886 4887 4853 int glslang_parse(TParseContext* context) { 4888 4854 return yyparse(context); -
trunk/Source/ThirdParty/ANGLE/src/compiler/glslang_tab.h
r152821 r152946 87 87 INTCONSTANT = 303, 88 88 BOOLCONSTANT = 304, 89 LEFT_OP = 305, 90 RIGHT_OP = 306, 91 INC_OP = 307, 92 DEC_OP = 308, 93 LE_OP = 309, 94 GE_OP = 310, 95 EQ_OP = 311, 96 NE_OP = 312, 97 AND_OP = 313, 98 OR_OP = 314, 99 XOR_OP = 315, 100 MUL_ASSIGN = 316, 101 DIV_ASSIGN = 317, 102 ADD_ASSIGN = 318, 103 MOD_ASSIGN = 319, 104 LEFT_ASSIGN = 320, 105 RIGHT_ASSIGN = 321, 106 AND_ASSIGN = 322, 107 XOR_ASSIGN = 323, 108 OR_ASSIGN = 324, 109 SUB_ASSIGN = 325, 110 LEFT_PAREN = 326, 111 RIGHT_PAREN = 327, 112 LEFT_BRACKET = 328, 113 RIGHT_BRACKET = 329, 114 LEFT_BRACE = 330, 115 RIGHT_BRACE = 331, 116 DOT = 332, 117 COMMA = 333, 118 COLON = 334, 119 EQUAL = 335, 120 SEMICOLON = 336, 121 BANG = 337, 122 DASH = 338, 123 TILDE = 339, 124 PLUS = 340, 125 STAR = 341, 126 SLASH = 342, 127 PERCENT = 343, 128 LEFT_ANGLE = 344, 129 RIGHT_ANGLE = 345, 130 VERTICAL_BAR = 346, 131 CARET = 347, 132 AMPERSAND = 348, 133 QUESTION = 349 89 FIELD_SELECTION = 305, 90 LEFT_OP = 306, 91 RIGHT_OP = 307, 92 INC_OP = 308, 93 DEC_OP = 309, 94 LE_OP = 310, 95 GE_OP = 311, 96 EQ_OP = 312, 97 NE_OP = 313, 98 AND_OP = 314, 99 OR_OP = 315, 100 XOR_OP = 316, 101 MUL_ASSIGN = 317, 102 DIV_ASSIGN = 318, 103 ADD_ASSIGN = 319, 104 MOD_ASSIGN = 320, 105 LEFT_ASSIGN = 321, 106 RIGHT_ASSIGN = 322, 107 AND_ASSIGN = 323, 108 XOR_ASSIGN = 324, 109 OR_ASSIGN = 325, 110 SUB_ASSIGN = 326, 111 LEFT_PAREN = 327, 112 RIGHT_PAREN = 328, 113 LEFT_BRACKET = 329, 114 RIGHT_BRACKET = 330, 115 LEFT_BRACE = 331, 116 RIGHT_BRACE = 332, 117 DOT = 333, 118 COMMA = 334, 119 COLON = 335, 120 EQUAL = 336, 121 SEMICOLON = 337, 122 BANG = 338, 123 DASH = 339, 124 TILDE = 340, 125 PLUS = 341, 126 STAR = 342, 127 SLASH = 343, 128 PERCENT = 344, 129 LEFT_ANGLE = 345, 130 RIGHT_ANGLE = 346, 131 VERTICAL_BAR = 347, 132 CARET = 348, 133 AMPERSAND = 349, 134 QUESTION = 350 134 135 }; 135 136 #endif … … 182 183 #define INTCONSTANT 303 183 184 #define BOOLCONSTANT 304 184 #define LEFT_OP 305 185 #define RIGHT_OP 306 186 #define INC_OP 307 187 #define DEC_OP 308 188 #define LE_OP 309 189 #define GE_OP 310 190 #define EQ_OP 311 191 #define NE_OP 312 192 #define AND_OP 313 193 #define OR_OP 314 194 #define XOR_OP 315 195 #define MUL_ASSIGN 316 196 #define DIV_ASSIGN 317 197 #define ADD_ASSIGN 318 198 #define MOD_ASSIGN 319 199 #define LEFT_ASSIGN 320 200 #define RIGHT_ASSIGN 321 201 #define AND_ASSIGN 322 202 #define XOR_ASSIGN 323 203 #define OR_ASSIGN 324 204 #define SUB_ASSIGN 325 205 #define LEFT_PAREN 326 206 #define RIGHT_PAREN 327 207 #define LEFT_BRACKET 328 208 #define RIGHT_BRACKET 329 209 #define LEFT_BRACE 330 210 #define RIGHT_BRACE 331 211 #define DOT 332 212 #define COMMA 333 213 #define COLON 334 214 #define EQUAL 335 215 #define SEMICOLON 336 216 #define BANG 337 217 #define DASH 338 218 #define TILDE 339 219 #define PLUS 340 220 #define STAR 341 221 #define SLASH 342 222 #define PERCENT 343 223 #define LEFT_ANGLE 344 224 #define RIGHT_ANGLE 345 225 #define VERTICAL_BAR 346 226 #define CARET 347 227 #define AMPERSAND 348 228 #define QUESTION 349 185 #define FIELD_SELECTION 305 186 #define LEFT_OP 306 187 #define RIGHT_OP 307 188 #define INC_OP 308 189 #define DEC_OP 309 190 #define LE_OP 310 191 #define GE_OP 311 192 #define EQ_OP 312 193 #define NE_OP 313 194 #define AND_OP 314 195 #define OR_OP 315 196 #define XOR_OP 316 197 #define MUL_ASSIGN 317 198 #define DIV_ASSIGN 318 199 #define ADD_ASSIGN 319 200 #define MOD_ASSIGN 320 201 #define LEFT_ASSIGN 321 202 #define RIGHT_ASSIGN 322 203 #define AND_ASSIGN 323 204 #define XOR_ASSIGN 324 205 #define OR_ASSIGN 325 206 #define SUB_ASSIGN 326 207 #define LEFT_PAREN 327 208 #define RIGHT_PAREN 328 209 #define LEFT_BRACKET 329 210 #define RIGHT_BRACKET 330 211 #define LEFT_BRACE 331 212 #define RIGHT_BRACE 332 213 #define DOT 333 214 #define COMMA 334 215 #define COLON 335 216 #define EQUAL 336 217 #define SEMICOLON 337 218 #define BANG 338 219 #define DASH 339 220 #define TILDE 340 221 #define PLUS 341 222 #define STAR 342 223 #define SLASH 343 224 #define PERCENT 344 225 #define LEFT_ANGLE 345 226 #define RIGHT_ANGLE 346 227 #define VERTICAL_BAR 347 228 #define CARET 348 229 #define AMPERSAND 349 230 #define QUESTION 350 229 231 230 232 … … 235 237 236 238 { 237 #define YYLTYPE TSourceLoc238 #define YYLTYPE_IS_DECLARED 1239 239 struct { 240 TSourceLoc line; 240 241 union { 241 242 TString *string; … … 247 248 } lex; 248 249 struct { 250 TSourceLoc line; 249 251 TOperator op; 250 252 union { … … 260 262 TFunction* function; 261 263 TParameter param; 262 T Field* field;263 T FieldList* fieldList;264 TTypeLine typeLine; 265 TTypeList* typeList; 264 266 }; 265 267 } interm; … … 275 277 276 278 277 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED278 typedef struct YYLTYPE279 {280 int first_line;281 int first_column;282 int last_line;283 int last_column;284 } YYLTYPE;285 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */286 # define YYLTYPE_IS_DECLARED 1287 # define YYLTYPE_IS_TRIVIAL 1288 #endif289 290 -
trunk/Source/ThirdParty/ANGLE/src/compiler/intermOut.cpp
r152755 r152946 190 190 case EOpAll: out << "all"; break; 191 191 192 default: 193 out.prefix(EPrefixError); 194 out << "Bad unary op"; 192 default: out.message(EPrefixError, "Bad unary op"); 195 193 } 196 194 … … 207 205 208 206 if (node->getOp() == EOpNull) { 209 out.prefix(EPrefixError); 210 out << "node is still EOpNull!"; 207 out.message(EPrefixError, "node is still EOpNull!"); 211 208 return true; 212 209 } … … 267 264 case EOpDeclaration: out << "Declaration: "; break; 268 265 269 default: 270 out.prefix(EPrefixError); 271 out << "Bad aggregation op"; 266 default: out.message(EPrefixError, "Bad aggregation op"); 272 267 } 273 268 … … 317 312 TInfoSinkBase& out = sink; 318 313 319 size_t size = node->getType().getObjectSize();320 321 for ( size_t i = 0; i < size; i++) {314 int size = node->getType().getObjectSize(); 315 316 for (int i = 0; i < size; i++) { 322 317 OutputTreeText(out, node, depth); 323 318 switch (node->getUnionArrayPointer()[i].getType()) { … … 340 335 break; 341 336 default: 342 out.message(EPrefixInternalError, node->getLine(), "Unknown constant");337 out.message(EPrefixInternalError, "Unknown constant", node->getLine()); 343 338 break; 344 339 } -
trunk/Source/ThirdParty/ANGLE/src/compiler/intermediate.h
r152755 r152946 1 1 // 2 // Copyright (c) 2002-201 3The ANGLE Project Authors. All rights reserved.2 // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. 3 3 // Use of this source code is governed by a BSD-style license that can be 4 4 // found in the LICENSE file. … … 19 19 #include "GLSLANG/ShaderLang.h" 20 20 21 #include <algorithm>22 21 #include "compiler/Common.h" 23 22 #include "compiler/Types.h" … … 208 207 POOL_ALLOCATOR_NEW_DELETE(GlobalPoolAllocator) 209 208 210 TIntermNode() { 211 // TODO: Move this to TSourceLoc constructor 212 // after getting rid of TPublicType. 213 line.first_file = line.last_file = 0; 214 line.first_line = line.last_line = 0; 215 } 216 virtual ~TIntermNode() { } 217 218 const TSourceLoc& getLine() const { return line; } 219 void setLine(const TSourceLoc& l) { line = l; } 209 TIntermNode() : line(0) {} 210 211 TSourceLoc getLine() const { return line; } 212 void setLine(TSourceLoc l) { line = l; } 220 213 221 214 virtual void traverse(TIntermTraverser*) = 0; … … 228 221 virtual TIntermSymbol* getAsSymbolNode() { return 0; } 229 222 virtual TIntermLoop* getAsLoopNode() { return 0; } 223 virtual ~TIntermNode() { } 230 224 231 225 protected: … … 365 359 366 360 ConstantUnion* getUnionArrayPointer() const { return unionArrayPointer; } 367 368 int getIConst(int index) const { return unionArrayPointer ? unionArrayPointer[index].getIConst() : 0; } 369 float getFConst(int index) const { return unionArrayPointer ? unionArrayPointer[index].getFConst() : 0.0f; } 370 bool getBConst(int index) const { return unionArrayPointer ? unionArrayPointer[index].getBConst() : false; } 361 void setUnionArrayPointer(ConstantUnion *c) { unionArrayPointer = c; } 371 362 372 363 virtual TIntermConstantUnion* getAsConstantUnion() { return this; } … … 457 448 class TIntermAggregate : public TIntermOperator { 458 449 public: 459 TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), useEmulatedFunction(false) { }450 TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), endLine(0), useEmulatedFunction(false) { } 460 451 TIntermAggregate(TOperator o) : TIntermOperator(o), useEmulatedFunction(false) { } 461 452 ~TIntermAggregate() { } … … 476 467 void setDebug(bool d) { debug = d; } 477 468 bool getDebug() { return debug; } 469 470 void setEndLine(TSourceLoc line) { endLine = line; } 471 TSourceLoc getEndLine() const { return endLine; } 478 472 479 473 void setUseEmulatedFunction() { useEmulatedFunction = true; } … … 489 483 bool optimize; 490 484 bool debug; 485 TSourceLoc endLine; 491 486 492 487 // If set to true, replace the built-in function call with an emulated one … … 544 539 postVisit(postVisit), 545 540 rightToLeft(rightToLeft), 546 depth(0), 547 maxDepth(0) {} 541 depth(0) {} 548 542 virtual ~TIntermTraverser() {}; 549 543 … … 557 551 virtual bool visitBranch(Visit visit, TIntermBranch*) {return true;} 558 552 559 int getMaxDepth() const {return maxDepth;} 560 void incrementDepth() {depth++; maxDepth = std::max(maxDepth, depth); } 553 void incrementDepth() {depth++;} 561 554 void decrementDepth() {depth--;} 562 555 … … 572 565 protected: 573 566 int depth; 574 int maxDepth;575 567 }; 576 568 -
trunk/Source/ThirdParty/ANGLE/src/compiler/localintermediate.h
r152755 r152946 26 26 27 27 TIntermediate(TInfoSink& i) : infoSink(i) { } 28 TIntermSymbol* addSymbol(int Id, const TString&, const TType&, const TSourceLoc&);28 TIntermSymbol* addSymbol(int Id, const TString&, const TType&, TSourceLoc); 29 29 TIntermTyped* addConversion(TOperator, const TType&, TIntermTyped*); 30 TIntermTyped* addBinaryMath(TOperator op, TIntermTyped* left, TIntermTyped* right, const TSourceLoc&, TSymbolTable&);31 TIntermTyped* addAssign(TOperator op, TIntermTyped* left, TIntermTyped* right, const TSourceLoc&);32 TIntermTyped* addIndex(TOperator op, TIntermTyped* base, TIntermTyped* index, const TSourceLoc&);33 TIntermTyped* addUnaryMath(TOperator op, TIntermNode* child, const TSourceLoc&, TSymbolTable&);34 TIntermAggregate* growAggregate(TIntermNode* left, TIntermNode* right, const TSourceLoc&);35 TIntermAggregate* makeAggregate(TIntermNode* node, const TSourceLoc&);36 TIntermAggregate* setAggregateOperator(TIntermNode*, TOperator, const TSourceLoc&);37 TIntermNode* addSelection(TIntermTyped* cond, TIntermNodePair code, const TSourceLoc&);38 TIntermTyped* addSelection(TIntermTyped* cond, TIntermTyped* trueBlock, TIntermTyped* falseBlock, const TSourceLoc&);39 TIntermTyped* addComma(TIntermTyped* left, TIntermTyped* right, const TSourceLoc&);40 TIntermConstantUnion* addConstantUnion(ConstantUnion*, const TType&, const TSourceLoc&);30 TIntermTyped* addBinaryMath(TOperator op, TIntermTyped* left, TIntermTyped* right, TSourceLoc, TSymbolTable&); 31 TIntermTyped* addAssign(TOperator op, TIntermTyped* left, TIntermTyped* right, TSourceLoc); 32 TIntermTyped* addIndex(TOperator op, TIntermTyped* base, TIntermTyped* index, TSourceLoc); 33 TIntermTyped* addUnaryMath(TOperator op, TIntermNode* child, TSourceLoc, TSymbolTable&); 34 TIntermAggregate* growAggregate(TIntermNode* left, TIntermNode* right, TSourceLoc); 35 TIntermAggregate* makeAggregate(TIntermNode* node, TSourceLoc); 36 TIntermAggregate* setAggregateOperator(TIntermNode*, TOperator, TSourceLoc); 37 TIntermNode* addSelection(TIntermTyped* cond, TIntermNodePair code, TSourceLoc); 38 TIntermTyped* addSelection(TIntermTyped* cond, TIntermTyped* trueBlock, TIntermTyped* falseBlock, TSourceLoc); 39 TIntermTyped* addComma(TIntermTyped* left, TIntermTyped* right, TSourceLoc); 40 TIntermConstantUnion* addConstantUnion(ConstantUnion*, const TType&, TSourceLoc); 41 41 TIntermTyped* promoteConstantUnion(TBasicType, TIntermConstantUnion*) ; 42 bool parseConstTree( const TSourceLoc&, TIntermNode*, ConstantUnion*, TOperator, TSymbolTable&, TType, bool singleConstantParam = false);43 TIntermNode* addLoop(TLoopType, TIntermNode*, TIntermTyped*, TIntermTyped*, TIntermNode*, const TSourceLoc&);44 TIntermBranch* addBranch(TOperator, const TSourceLoc&);45 TIntermBranch* addBranch(TOperator, TIntermTyped*, const TSourceLoc&);46 TIntermTyped* addSwizzle(TVectorFields&, const TSourceLoc&);42 bool parseConstTree(TSourceLoc, TIntermNode*, ConstantUnion*, TOperator, TSymbolTable&, TType, bool singleConstantParam = false); 43 TIntermNode* addLoop(TLoopType, TIntermNode*, TIntermTyped*, TIntermTyped*, TIntermNode*, TSourceLoc); 44 TIntermBranch* addBranch(TOperator, TSourceLoc); 45 TIntermBranch* addBranch(TOperator, TIntermTyped*, TSourceLoc); 46 TIntermTyped* addSwizzle(TVectorFields&, TSourceLoc); 47 47 bool postProcess(TIntermNode*); 48 48 void remove(TIntermNode*); 49 49 void outputTree(TIntermNode*); 50 51 protected: 52 TInfoSink& infoSink; 50 53 51 54 private: 52 55 void operator=(TIntermediate&); // prevent assignments 53 54 TInfoSink& infoSink;55 56 }; 56 57 -
trunk/Source/ThirdParty/ANGLE/src/compiler/parseConst.cpp
r152755 r152946 39 39 bool visitBranch(Visit visit, TIntermBranch*); 40 40 41 size_t index;41 int index; 42 42 ConstantUnion *unionArray; 43 43 TType type; … … 46 46 TInfoSink& infoSink; 47 47 TSymbolTable& symbolTable; 48 size_t size; // size of the constructor ( 4 for vec4)48 int size; // size of the constructor ( 4 for vec4) 49 49 bool isMatrix; 50 size_t matrixSize; // dimension of the matrix (nominal size and not the instance size)50 int matrixSize; // dimension of the matrix (nominal size and not the instance size) 51 51 }; 52 52 … … 62 62 void TConstTraverser::visitSymbol(TIntermSymbol* node) 63 63 { 64 infoSink.info.message(EPrefixInternalError, node->getLine(), "Symbol Node found in constant constructor");64 infoSink.info.message(EPrefixInternalError, "Symbol Node found in constant constructor", node->getLine()); 65 65 return; 66 66 … … 75 75 buf.append("'constructor' : assigning non-constant to "); 76 76 buf.append(type.getCompleteString()); 77 infoSink.info.message(EPrefixError, node->getLine(), buf.c_str());77 infoSink.info.message(EPrefixError, buf.c_str(), node->getLine()); 78 78 error = true; 79 79 return false; 80 80 } 81 81 82 infoSink.info.message(EPrefixInternalError, node->getLine(), "Binary Node found in constant constructor");82 infoSink.info.message(EPrefixInternalError, "Binary Node found in constant constructor", node->getLine()); 83 83 84 84 return false; … … 90 90 buf.append("'constructor' : assigning non-constant to "); 91 91 buf.append(type.getCompleteString()); 92 infoSink.info.message(EPrefixError, node->getLine(), buf.c_str());92 infoSink.info.message(EPrefixError, buf.c_str(), node->getLine()); 93 93 error = true; 94 94 return false; … … 101 101 buf.append("'constructor' : assigning non-constant to "); 102 102 buf.append(type.getCompleteString()); 103 infoSink.info.message(EPrefixError, node->getLine(), buf.c_str());103 infoSink.info.message(EPrefixError, buf.c_str(), node->getLine()); 104 104 error = true; 105 105 return false; … … 145 145 bool TConstTraverser::visitSelection(Visit visit, TIntermSelection* node) 146 146 { 147 infoSink.info.message(EPrefixInternalError, node->getLine(), "Selection Node found in constant constructor");147 infoSink.info.message(EPrefixInternalError, "Selection Node found in constant constructor", node->getLine()); 148 148 error = true; 149 149 return false; … … 152 152 void TConstTraverser::visitConstantUnion(TIntermConstantUnion* node) 153 153 { 154 if (!node->getUnionArrayPointer())155 {156 // The constant was not initialized, this should already have been logged157 assert(infoSink.info.size() != 0);158 return;159 }160 161 154 ConstantUnion* leftUnionArray = unionArray; 162 size_t instanceSize = type.getObjectSize();155 int instanceSize = type.getObjectSize(); 163 156 164 157 if (index >= instanceSize) … … 166 159 167 160 if (!singleConstantParam) { 168 size_t size = node->getType().getObjectSize();161 int size = node->getType().getObjectSize(); 169 162 170 163 ConstantUnion *rightUnionArray = node->getUnionArrayPointer(); 171 for ( size_t i =0; i < size; i++) {164 for (int i=0; i < size; i++) { 172 165 if (index >= instanceSize) 173 166 return; … … 177 170 } 178 171 } else { 179 size_t totalSize = index + size;172 int totalSize = index + size; 180 173 ConstantUnion *rightUnionArray = node->getUnionArrayPointer(); 181 174 if (!isMatrix) { 182 size_t count = 0;183 for ( size_t i = index; i < totalSize; i++) {175 int count = 0; 176 for (int i = index; i < totalSize; i++) { 184 177 if (i >= instanceSize) 185 178 return; … … 193 186 } 194 187 } else { // for matrix constructors 195 size_t count = 0;196 size_t element = index;197 for ( size_t i = index; i < totalSize; i++) {188 int count = 0; 189 int element = index; 190 for (int i = index; i < totalSize; i++) { 198 191 if (i >= instanceSize) 199 192 return; … … 214 207 bool TConstTraverser::visitLoop(Visit visit, TIntermLoop* node) 215 208 { 216 infoSink.info.message(EPrefixInternalError, node->getLine(), "Loop Node found in constant constructor");209 infoSink.info.message(EPrefixInternalError, "Loop Node found in constant constructor", node->getLine()); 217 210 error = true; 218 211 return false; … … 221 214 bool TConstTraverser::visitBranch(Visit visit, TIntermBranch* node) 222 215 { 223 infoSink.info.message(EPrefixInternalError, node->getLine(), "Branch Node found in constant constructor");216 infoSink.info.message(EPrefixInternalError, "Branch Node found in constant constructor", node->getLine()); 224 217 error = true; 225 218 return false; … … 231 224 // type of node. It's children will still be processed. 232 225 // 233 bool TIntermediate::parseConstTree( const TSourceLoc&line, TIntermNode* root, ConstantUnion* unionArray, TOperator constructorType, TSymbolTable& symbolTable, TType t, bool singleConstantParam)226 bool TIntermediate::parseConstTree(TSourceLoc line, TIntermNode* root, ConstantUnion* unionArray, TOperator constructorType, TSymbolTable& symbolTable, TType t, bool singleConstantParam) 234 227 { 235 228 if (root == 0) -
trunk/Source/ThirdParty/ANGLE/src/compiler/timing/RestrictVertexShaderTiming.cpp
r152755 r152946 11 11 if (IsSampler(node->getBasicType())) { 12 12 ++mNumErrors; 13 mSink. message(EPrefixError,14 node->getLine(),15 "Samplers are not permitted in vertex shaders");13 mSink.prefix(EPrefixError); 14 mSink.location(node->getLine()); 15 mSink << "Samplers are not permitted in vertex shaders.\n"; 16 16 } 17 17 } -
trunk/Source/WebCore/CMakeLists.txt
r152859 r152946 2870 2870 2871 2871 list(APPEND ANGLESupport_SOURCES 2872 ${THIRDPARTY_DIR}/ANGLE/src/compiler/builtin_symbol_table.cpp2873 2872 ${THIRDPARTY_DIR}/ANGLE/src/compiler/BuiltInFunctionEmulator.cpp 2874 2873 ${THIRDPARTY_DIR}/ANGLE/src/compiler/CodeGenGLSL.cpp … … 2881 2880 ${THIRDPARTY_DIR}/ANGLE/src/compiler/depgraph/DependencyGraphOutput.cpp 2882 2881 ${THIRDPARTY_DIR}/ANGLE/src/compiler/depgraph/DependencyGraphTraverse.cpp 2883 ${THIRDPARTY_DIR}/ANGLE/src/compiler/DetectCallDepth.cpp2884 2882 ${THIRDPARTY_DIR}/ANGLE/src/compiler/DetectDiscontinuity.cpp 2883 ${THIRDPARTY_DIR}/ANGLE/src/compiler/DetectRecursion.cpp 2885 2884 ${THIRDPARTY_DIR}/ANGLE/src/compiler/ForLoopUnroll.cpp 2886 2885 ${THIRDPARTY_DIR}/ANGLE/src/compiler/InfoSink.cpp -
trunk/Source/WebCore/ChangeLog
r152943 r152946 1 2013-07-20 Dean Jackson <dino@apple.com> 2 3 Updated ANGLE is leaking like a sieve 4 https://bugs.webkit.org/show_bug.cgi?id=118939 5 6 Rollout 152863, r152821, r152929 and r152755. 7 8 * CMakeLists.txt: 9 1 10 2013-07-19 Jer Noble <jer.noble@apple.com> 2 11
Note:
See TracChangeset
for help on using the changeset viewer.