/src/WasmEdge/include/ast/component/import.h
Line | Count | Source (jump to first uncovered line) |
1 | | // SPDX-License-Identifier: Apache-2.0 |
2 | | // SPDX-FileCopyrightText: 2019-2024 Second State INC |
3 | | |
4 | | //===-- wasmedge/ast/component/import.h - Import class definition ---------===// |
5 | | // |
6 | | // Part of the WasmEdge Project. |
7 | | // |
8 | | //===----------------------------------------------------------------------===// |
9 | | /// |
10 | | /// \file |
11 | | /// This file contains the declaration of the Import node class. |
12 | | /// |
13 | | //===----------------------------------------------------------------------===// |
14 | | #pragma once |
15 | | |
16 | | #include "ast/component/sort.h" |
17 | | #include "ast/component/type.h" |
18 | | |
19 | | #include <optional> |
20 | | #include <string> |
21 | | |
22 | | namespace WasmEdge { |
23 | | namespace AST { |
24 | | namespace Component { |
25 | | |
26 | | // import ::= in:<importname'> ed:<externdesc> => (import in ed) |
27 | | // importname' ::= 0x00 len:<u32> in:<importname> => in (if len = |in|) |
28 | | |
29 | | /// AST Component::Import node. |
30 | | class Import { |
31 | | public: |
32 | 0 | std::string &getName() noexcept { return Name; } |
33 | 0 | std::string_view getName() const noexcept { return Name; } |
34 | 0 | ExternDesc &getDesc() noexcept { return Desc; } |
35 | 0 | const ExternDesc &getDesc() const noexcept { return Desc; } |
36 | | |
37 | | private: |
38 | | std::string Name; |
39 | | ExternDesc Desc; |
40 | | }; |
41 | | |
42 | | } // namespace Component |
43 | | } // namespace AST |
44 | | } // namespace WasmEdge |