1/**
2 * Copyright (c) 2021-2022 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 ASSEMBLER_ASSEMBLY_PROGRAM_H
17#define 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
30namespace panda::pandasm {
31
32struct Program {
33    panda::panda_file::SourceLang lang {panda::panda_file::SourceLang::PANDA_ASSEMBLY};
34    std::map<std::string, panda::pandasm::Record> record_table;
35    std::map<std::string, panda::pandasm::Function> function_table;
36    std::unordered_map<std::string, std::vector<std::string>> function_synonyms;
37    std::map<std::string, panda::pandasm::LiteralArray> literalarray_table;
38    std::set<std::string> strings;
39    std::unordered_set<Type> array_types;
40
41    /*
42     * Returns a JSON string with the program structure and scopes locations
43     */
44    std::string JsonDump() const;
45};
46
47}  // namespace panda::pandasm
48
49#endif  // ASSEMBLER_ASSEMBLY_PROGRAM_H
50