1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef PANDA_ASSEMBLER_ASSEMBLY_PROGRAM_H_ 17 #define PANDA_ASSEMBLER_ASSEMBLY_PROGRAM_H_ 18 19 #include <string> 20 #include <unordered_set> 21 22 #include "assembly-function.h" 23 #include "assembly-record.h" 24 #include "assembly-type.h" 25 #include "assembly-methodhandle.h" 26 #include "assembly-literals.h" 27 #include "extensions/extensions.h" 28 #include "macros.h" 29 30 namespace panda::pandasm { 31 32 struct Program { 33 extensions::Language lang {extensions::Language::PANDA_ASSEMBLY}; 34 std::map<std::string, panda::pandasm::Record> record_table; 35 std::map<std::string, panda::pandasm::Function> function_table; 36 std::map<std::string, panda::pandasm::LiteralArray> literalarray_table; 37 std::set<std::string> strings; 38 std::unordered_set<Type> array_types; 39 40 /* 41 * Returns a JSON string with the program structure and scopes locations 42 */ 43 std::string JsonDump() const; 44 }; 45 46 } // namespace panda::pandasm 47 48 #endif // PANDA_ASSEMBLER_ASSEMBLY_PROGRAM_H_ 49