1 /* 2 * Copyright (c) 2021-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 PANDA_ASSEMBLER_FIELD_H 17 #define PANDA_ASSEMBLER_FIELD_H 18 19 #include <memory> 20 #include <string> 21 22 #include "assembly-type.h" 23 #include "extensions/extensions.h" 24 #include "meta.h" 25 26 namespace ark::pandasm { 27 28 // NOLINTBEGIN(misc-non-private-member-variables-in-classes) 29 struct Field { 30 Type type; 31 std::string name; 32 std::unique_ptr<FieldMetadata> metadata; 33 size_t lineOfDef = 0; 34 std::string wholeLine; /* The line in which the field is defined */ 35 /* Or line in which the field met, if the field is not defined */ 36 size_t boundLeft = 0; 37 size_t boundRight = 0; 38 bool isDefined = true; 39 Fieldark::pandasm::Field40 explicit Field(ark::panda_file::SourceLang lang) 41 : metadata(extensions::MetadataExtension::CreateFieldMetadata(lang)) 42 { 43 } 44 }; 45 // NOLINTEND(misc-non-private-member-variables-in-classes) 46 47 } // namespace ark::pandasm 48 49 #endif // !PANDA_ASSEMBLER_FIELD_H 50