OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013, the Dart project authors. | 2 * Copyright (c) 2013, the Dart project authors. |
3 * | 3 * |
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except | 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except |
5 * in compliance with the License. You may obtain a copy of the License at | 5 * in compliance with the License. You may obtain a copy of the License at |
6 * | 6 * |
7 * http://www.eclipse.org/legal/epl-v10.html | 7 * http://www.eclipse.org/legal/epl-v10.html |
8 * | 8 * |
9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License | 9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License |
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express | 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 public ScopedVisitor(LibraryElement definingLibrary, Source source, TypeProvid
er typeProvider, | 131 public ScopedVisitor(LibraryElement definingLibrary, Source source, TypeProvid
er typeProvider, |
132 AnalysisErrorListener errorListener) { | 132 AnalysisErrorListener errorListener) { |
133 this.definingLibrary = definingLibrary; | 133 this.definingLibrary = definingLibrary; |
134 this.source = source; | 134 this.source = source; |
135 this.errorListener = errorListener; | 135 this.errorListener = errorListener; |
136 this.nameScope = new LibraryScope(definingLibrary, errorListener); | 136 this.nameScope = new LibraryScope(definingLibrary, errorListener); |
137 this.typeProvider = typeProvider; | 137 this.typeProvider = typeProvider; |
138 } | 138 } |
139 | 139 |
140 /** | 140 /** |
| 141 * Initialize a newly created visitor to resolve the nodes in a compilation un
it. |
| 142 * |
| 143 * @param definingLibrary the element for the library containing the compilati
on unit being |
| 144 * visited |
| 145 * @param source the source representing the compilation unit being visited |
| 146 * @param typeProvider the object used to access the types from the core libra
ry |
| 147 * @param nameScope the scope used to resolve identifiers in the node that wil
l first be visited |
| 148 * @param errorListener the error listener that will be informed of any errors
that are found |
| 149 * during resolution |
| 150 */ |
| 151 public ScopedVisitor(LibraryElement definingLibrary, Source source, TypeProvid
er typeProvider, |
| 152 Scope nameScope, AnalysisErrorListener errorListener) { |
| 153 this.definingLibrary = definingLibrary; |
| 154 this.source = source; |
| 155 this.errorListener = errorListener; |
| 156 this.nameScope = nameScope; |
| 157 this.typeProvider = typeProvider; |
| 158 } |
| 159 |
| 160 /** |
141 * Return the library element for the library containing the compilation unit
being resolved. | 161 * Return the library element for the library containing the compilation unit
being resolved. |
142 * | 162 * |
143 * @return the library element for the library containing the compilation unit
being resolved | 163 * @return the library element for the library containing the compilation unit
being resolved |
144 */ | 164 */ |
145 public LibraryElement getDefiningLibrary() { | 165 public LibraryElement getDefiningLibrary() { |
146 return definingLibrary; | 166 return definingLibrary; |
147 } | 167 } |
148 | 168 |
149 /** | 169 /** |
150 * Return the object used to access the types from the core library. | 170 * Return the object used to access the types from the core library. |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 } | 641 } |
622 } | 642 } |
623 if (statement instanceof FunctionDeclarationStatement) { | 643 if (statement instanceof FunctionDeclarationStatement) { |
624 FunctionDeclarationStatement fds = (FunctionDeclarationStatement) statem
ent; | 644 FunctionDeclarationStatement fds = (FunctionDeclarationStatement) statem
ent; |
625 Element element = fds.getFunctionDeclaration().getElement(); | 645 Element element = fds.getFunctionDeclaration().getElement(); |
626 scope.hide(element); | 646 scope.hide(element); |
627 } | 647 } |
628 } | 648 } |
629 } | 649 } |
630 } | 650 } |
OLD | NEW |