Branch data Line data Source code
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 : : #ifndef RUST_LATE_NAME_RESOLVER_2_0_H
20 : : #define RUST_LATE_NAME_RESOLVER_2_0_H
21 : :
22 : : #include "rust-ast-full.h"
23 : : #include "rust-default-resolver.h"
24 : :
25 : : namespace Rust {
26 : : namespace Resolver2_0 {
27 : :
28 : 27 : class Late : public DefaultResolver
29 : : {
30 : : using DefaultResolver::visit;
31 : :
32 : : public:
33 : : Late (NameResolutionContext &ctx);
34 : :
35 : : void go (AST::Crate &crate);
36 : :
37 : : void new_label (Identifier name, NodeId id);
38 : :
39 : : // some more label declarations
40 : : void visit (AST::LetStmt &) override;
41 : : // TODO: Do we need this?
42 : : // void visit (AST::Method &) override;
43 : : void visit (AST::IdentifierPattern &) override;
44 : :
45 : : // resolutions
46 : : void visit (AST::IdentifierExpr &) override;
47 : : void visit (AST::PathInExpression &) override;
48 : : void visit (AST::TypePath &) override;
49 : : void visit (AST::StructExprStructBase &) override;
50 : : void visit (AST::StructExprStructFields &) override;
51 : :
52 : : private:
53 : : /* Setup Rust's builtin types (u8, i32, !...) in the resolver */
54 : : void setup_builtin_types ();
55 : : };
56 : :
57 : : // TODO: Add missing mappings and data structures
58 : :
59 : : } // namespace Resolver2_0
60 : : } // namespace Rust
61 : :
62 : : #endif // ! RUST_LATE_NAME_RESOLVER_2_0_H
|