1 /*
2  * Copyright (c) 2024 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 ABC2PROGRAM_ABC_CLASS_PROCESSOR_H
17 #define ABC2PROGRAM_ABC_CLASS_PROCESSOR_H
18 
19 #include "abc_file_entity_processor.h"
20 #include "abc_module_array_processor.h"
21 #include "class_data_accessor-inl.h"
22 
23 namespace panda::abc2program {
24 
25 class AbcClassProcessor : public AbcFileEntityProcessor {
26 public:
27     AbcClassProcessor(panda_file::File::EntityId entity_id, Abc2ProgramEntityContainer &entity_container);
28     void FillProgramData() override;
29 
30 private:
31     void FillRecord();
32     void FillRecordData();
33     void FillRecordName();
34     void FillRecordSourceFile();
35     void FillRecordMetaData();
36     void FillRecordAttributes();
37     void FillRecordAnnotations();
38     void FillFields();
39     void FillFunctions();
40 
41     void FillLiteralArrayTable();
42     void FillModuleLiteralArrays();
43     void FillUnnestedLiteralArrays();
44     void FillNestedLiteralArrays();
45     void FillModuleLiteralArrayById(uint32_t module_literal_array_id);
46     void FillModuleRequestPhaseById(uint32_t module_literal_array_id);
47     void FillLiteralArrayById(uint32_t literal_array_id);
48 
49     std::unique_ptr<panda_file::ClassDataAccessor> class_data_accessor_;
50     std::unique_ptr<panda_file::LiteralDataAccessor> literal_data_accessor_;
51     pandasm::Record record_;
52 };
53 
54 }  // namespace panda::abc2program
55 
56 #endif  // ABC2PROGRAM_ABC_CLASS_PROCESSOR_H
57