• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2018 Google Inc. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.google.turbine.binder.bound;
18 
19 import com.google.turbine.binder.lookup.ImportScope;
20 import com.google.turbine.binder.lookup.MemberImportIndex;
21 import com.google.turbine.diag.SourceFile;
22 import com.google.turbine.tree.Tree.ModDecl;
23 
24 /** Wraps a {@link ModDecl} with lookup scopes for the current compilation unit and package. */
25 public class PackageSourceBoundModule {
26 
27   private final ModDecl module;
28   private final ImportScope scope;
29   private final MemberImportIndex memberImports;
30   private final SourceFile source;
31 
PackageSourceBoundModule( ModDecl module, ImportScope scope, MemberImportIndex memberImports, SourceFile source)32   public PackageSourceBoundModule(
33       ModDecl module, ImportScope scope, MemberImportIndex memberImports, SourceFile source) {
34     this.module = module;
35     this.scope = scope;
36     this.memberImports = memberImports;
37     this.source = source;
38   }
39 
module()40   public ModDecl module() {
41     return module;
42   }
43 
scope()44   public ImportScope scope() {
45     return scope;
46   }
47 
memberImports()48   public MemberImportIndex memberImports() {
49     return memberImports;
50   }
51 
source()52   public SourceFile source() {
53     return source;
54   }
55 }
56