Debian Codegraph @

gcc/rust/resolve/rust-finalize-imports-2.0.h

raw
1 // Copyright (C) 2020-2024 Free Software Foundation, Inc.
2
3 // This file is part of GCC.
4
5 // GCC is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU General Public License as published by the Free
7 // Software Foundation; either version 3, or (at your option) any later
8 // version.
9
10 // GCC is distributed in the hope that it will be useful, but WITHOUT ANY
11 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 // for more details.
14
15 // You should have received a copy of the GNU General Public License
16 // along with GCC; see the file COPYING3. If not see
17 // <http://www.gnu.org/licenses/>.
18
19 #include "rust-ast.h"
20 #include "rust-expr.h"
21 #include "rust-name-resolution-context.h"
22 #include "rust-toplevel-name-resolver-2.0.h"
23 #include "rust-early-name-resolver-2.0.h"
24
25 namespace Rust {
26 namespace Resolver2_0 {
27
28 class GlobbingVisitor : public AST::DefaultASTVisitor
29 {
30 using AST::DefaultASTVisitor::visit;
31
32 public:
33 GlobbingVisitor (NameResolutionContext &ctx) : ctx (ctx) {}
34
35 void go (AST::Module *module);
36 void visit (AST::Module &module) override;
37 void visit (AST::MacroRulesDefinition &macro) override;
38 void visit (AST::Function &function) override;
39 void visit (AST::StaticItem &static_item) override;
40 void visit (AST::StructStruct &struct_item) override;
41 void visit (AST::TupleStruct &tuple_struct) override;
42 void visit (AST::Enum &enum_item) override;
43 void visit (AST::Union &union_item) override;
44 void visit (AST::ConstantItem &const_item) override;
45 void visit (AST::ExternCrate &crate) override;
46 void visit (AST::UseDeclaration &use) override;
47
48 private:
49 NameResolutionContext &ctx;
50 };
51
52 } // namespace Resolver2_0
53 } // namespace Rust