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_AST_RESOLVE_EXPR_H
20 : : #define RUST_AST_RESOLVE_EXPR_H
21 : :
22 : : #include "rust-ast-resolve-base.h"
23 : : #include "rust-ast-resolve-pattern.h"
24 : :
25 : : namespace Rust {
26 : : namespace Resolver {
27 : :
28 : 75831 : class ResolveExpr : public ResolverBase
29 : : {
30 : : using Rust::Resolver::ResolverBase::visit;
31 : :
32 : : public:
33 : : static void go (AST::Expr &expr, const CanonicalPath &prefix,
34 : : const CanonicalPath &canonical_prefix,
35 : : bool funny_error = false);
36 : :
37 : : void visit (AST::TupleIndexExpr &expr) override;
38 : : void visit (AST::TupleExpr &expr) override;
39 : : void visit (AST::PathInExpression &expr) override;
40 : : void visit (AST::QualifiedPathInExpression &expr) override;
41 : : void visit (AST::ReturnExpr &expr) override;
42 : : void visit (AST::CallExpr &expr) override;
43 : : void visit (AST::MethodCallExpr &expr) override;
44 : : void visit (AST::AssignmentExpr &expr) override;
45 : : void visit (AST::IdentifierExpr &expr) override;
46 : : void visit (AST::ArithmeticOrLogicalExpr &expr) override;
47 : : void visit (AST::CompoundAssignmentExpr &expr) override;
48 : : void visit (AST::ComparisonExpr &expr) override;
49 : : void visit (AST::LazyBooleanExpr &expr) override;
50 : : void visit (AST::NegationExpr &expr) override;
51 : : void visit (AST::TypeCastExpr &expr) override;
52 : : void visit (AST::IfExpr &expr) override;
53 : : void visit (AST::IfExprConseqElse &expr) override;
54 : : void visit (AST::IfLetExpr &expr) override;
55 : : void visit (AST::IfLetExprConseqElse &expr) override;
56 : : void visit (AST::BlockExpr &expr) override;
57 : : void visit (AST::UnsafeBlockExpr &expr) override;
58 : : void visit (AST::ArrayElemsValues &elems) override;
59 : : void visit (AST::ArrayExpr &expr) override;
60 : : void visit (AST::ArrayIndexExpr &expr) override;
61 : : void visit (AST::ArrayElemsCopied &elems) override;
62 : : void visit (AST::StructExprStruct &struct_expr) override;
63 : : void visit (AST::StructExprStructFields &struct_expr) override;
64 : : void visit (AST::GroupedExpr &expr) override;
65 : : void visit (AST::FieldAccessExpr &expr) override;
66 : : void visit (AST::LoopExpr &expr) override;
67 : : void visit (AST::BreakExpr &expr) override;
68 : : void visit (AST::WhileLoopExpr &expr) override;
69 : : void visit (AST::ForLoopExpr &expr) override;
70 : : void visit (AST::ContinueExpr &expr) override;
71 : : void visit (AST::BorrowExpr &expr) override;
72 : : void visit (AST::DereferenceExpr &expr) override;
73 : : void visit (AST::MatchExpr &expr) override;
74 : : void visit (AST::RangeFromToExpr &expr) override;
75 : : void visit (AST::RangeFromExpr &expr) override;
76 : : void visit (AST::RangeToExpr &expr) override;
77 : : void visit (AST::RangeFullExpr &expr) override;
78 : : void visit (AST::RangeFromToInclExpr &expr) override;
79 : : void visit (AST::ClosureExprInner &expr) override;
80 : : void visit (AST::ClosureExprInnerTyped &expr) override;
81 : :
82 : : protected:
83 : : void resolve_closure_param (AST::ClosureParam ¶m,
84 : : std::vector<PatternBinding> &bindings);
85 : :
86 : : private:
87 : : ResolveExpr (const CanonicalPath &prefix,
88 : : const CanonicalPath &canonical_prefix, bool funny_error);
89 : :
90 : : const CanonicalPath &prefix;
91 : : const CanonicalPath &canonical_prefix;
92 : : bool funny_error;
93 : : };
94 : :
95 : : } // namespace Resolver
96 : : } // namespace Rust
97 : :
98 : : #endif // RUST_AST_RESOLVE_EXPR_H
|