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_FIELD_H_ 17 #define PANDA_ASSEMBLER_ASSEMBLY_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 panda::pandasm { 27 28 struct Field { 29 Type type; 30 std::string name; 31 std::unique_ptr<FieldMetadata> metadata; 32 size_t line_of_def = 0; 33 std::string whole_line = ""; /* The line in which the field is defined */ 34 /* Or line in which the field is met, if the field is not defined */ 35 size_t bound_left = 0; 36 size_t bound_right = 0; 37 bool is_defined = true; 38 FieldField39 explicit Field(extensions::Language lang) : metadata(extensions::MetadataExtension::CreateFieldMetadata(lang)) {} 40 }; 41 42 } // namespace panda::pandasm 43 44 #endif // PANDA_ASSEMBLER_ASSEMBLY_FIELD_H_ 45