OLD | NEW |
1 // | 1 // |
2 // Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved. | 2 // Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 // | 5 // |
6 | 6 |
7 #include "compiler/ParseHelper.h" | 7 #include "compiler/ParseHelper.h" |
8 | 8 |
9 #include <stdarg.h> | 9 #include <stdarg.h> |
10 #include <stdio.h> | 10 #include <stdio.h> |
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
918 } | 918 } |
919 | 919 |
920 if (!symbol->isFunction()) { | 920 if (!symbol->isFunction()) { |
921 error(line, "function name expected", call->getName().c_str()); | 921 error(line, "function name expected", call->getName().c_str()); |
922 return 0; | 922 return 0; |
923 } | 923 } |
924 | 924 |
925 return static_cast<const TFunction*>(symbol); | 925 return static_cast<const TFunction*>(symbol); |
926 } | 926 } |
927 | 927 |
| 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 been |
| 932 // 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 |
928 // | 949 // |
929 // Initializers show up in several places in the grammar. Have one set of | 950 // Initializers show up in several places in the grammar. Have one set of |
930 // code to handle them here. | 951 // code to handle them here. |
931 // | 952 // |
932 bool TParseContext::executeInitializer(const TSourceLoc& line, TString& identifi
er, TPublicType& pType,· | 953 bool TParseContext::executeInitializer(const TSourceLoc& line, TString& identifi
er, TPublicType& pType,· |
933 TIntermTyped* initializer, TIntermNode*&
intermNode, TVariable* variable) | 954 TIntermTyped* initializer, TIntermNode*&
intermNode, TVariable* variable) |
934 { | 955 { |
935 TType type = TType(pType); | 956 TType type = TType(pType); |
936 | 957 |
937 if (variable == 0) { | 958 if (variable == 0) { |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1443 if (!error) | 1464 if (!error) |
1444 error = glslang_parse(context); | 1465 error = glslang_parse(context); |
1445 | 1466 |
1446 glslang_finalize(context); | 1467 glslang_finalize(context); |
1447 | 1468 |
1448 return (error == 0) && (context->numErrors() == 0) ? 0 : 1; | 1469 return (error == 0) && (context->numErrors() == 0) ? 0 : 1; |
1449 } | 1470 } |
1450 | 1471 |
1451 | 1472 |
1452 | 1473 |
OLD | NEW |