OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SKSL_SYMBOLTABLE | 8 #ifndef SKSL_SYMBOLTABLE |
9 #define SKSL_SYMBOLTABLE | 9 #define SKSL_SYMBOLTABLE |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 , fErrorReporter(errorReporter) {} | 32 , fErrorReporter(errorReporter) {} |
33 | 33 |
34 const Symbol* operator[](const std::string& name); | 34 const Symbol* operator[](const std::string& name); |
35 | 35 |
36 void add(const std::string& name, std::unique_ptr<Symbol> symbol); | 36 void add(const std::string& name, std::unique_ptr<Symbol> symbol); |
37 | 37 |
38 void addWithoutOwnership(const std::string& name, const Symbol* symbol); | 38 void addWithoutOwnership(const std::string& name, const Symbol* symbol); |
39 | 39 |
40 Symbol* takeOwnership(Symbol* s); | 40 Symbol* takeOwnership(Symbol* s); |
41 | 41 |
| 42 void markAllFunctionsBuiltin(); |
| 43 |
42 const std::shared_ptr<SymbolTable> fParent; | 44 const std::shared_ptr<SymbolTable> fParent; |
43 | 45 |
44 private: | 46 private: |
45 static std::vector<const FunctionDeclaration*> GetFunctions(const Symbol& s)
; | 47 static std::vector<const FunctionDeclaration*> GetFunctions(const Symbol& s)
; |
46 | 48 |
47 std::vector<std::unique_ptr<Symbol>> fOwnedPointers; | 49 std::vector<std::unique_ptr<Symbol>> fOwnedPointers; |
48 | 50 |
49 std::unordered_map<std::string, const Symbol*> fSymbols; | 51 std::unordered_map<std::string, const Symbol*> fSymbols; |
50 | 52 |
51 ErrorReporter& fErrorReporter; | 53 ErrorReporter& fErrorReporter; |
52 }; | 54 }; |
53 | 55 |
54 } // namespace | 56 } // namespace |
55 | 57 |
56 #endif | 58 #endif |
OLD | NEW |