Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(381)

Side by Side Diff: pkg/compiler/lib/src/elements/elements.dart

Issue 898113002: Add sharedfrontend package (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library elements; 5 library dart2js.elements;
6 6
7 import 'package:sharedfrontend/elements.dart' as shared;
7 8
8 import '../constants/expressions.dart'; 9 import '../constants/expressions.dart';
9 import '../tree/tree.dart'; 10 import '../tree/tree.dart';
10 import '../util/util.dart'; 11 import '../util/util.dart';
11 import '../resolution/resolution.dart'; 12 import '../resolution/resolution.dart';
12 13
13 import '../dart2jslib.dart' show InterfaceType, 14 import '../dart2jslib.dart' show InterfaceType,
14 DartType, 15 DartType,
15 TypeVariableType, 16 TypeVariableType,
16 TypedefType, 17 TypedefType,
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 * code generation. 176 * code generation.
176 * 177 *
177 * The front-end data structures are designed to be reusable by 178 * The front-end data structures are designed to be reusable by
178 * several back-ends. For example, we may want to support emitting 179 * several back-ends. For example, we may want to support emitting
179 * minified Dart and JavaScript code in one go. Also, we're planning 180 * minified Dart and JavaScript code in one go. Also, we're planning
180 * on adding an incremental compilation server that should be able to 181 * on adding an incremental compilation server that should be able to
181 * reuse elements between compilations. So to keep things simple, it 182 * reuse elements between compilations. So to keep things simple, it
182 * is best if the backends avoid setting state directly in elements. 183 * is best if the backends avoid setting state directly in elements.
183 * It is better to keep such state in a table on the side. 184 * It is better to keep such state in a table on the side.
184 */ 185 */
185 abstract class Element implements Entity { 186 abstract class Element implements shared.Element, Entity {
186 String get name; 187 String get name;
187 ElementKind get kind; 188 ElementKind get kind;
188 Element get enclosingElement; 189 Element get enclosingElement;
189 Link<MetadataAnnotation> get metadata; 190 Link<MetadataAnnotation> get metadata;
190 191
191 /// Do not use [computeType] outside of the resolver; instead retrieve the 192 /// Do not use [computeType] outside of the resolver; instead retrieve the
192 /// type from the corresponding field: 193 /// type from the corresponding field:
193 /// - `type` for fields, variables, type variable, and function elements. 194 /// - `type` for fields, variables, type variable, and function elements.
194 /// - `thisType` or `rawType` for [TypeDeclarationElement]s (classes and 195 /// - `thisType` or `rawType` for [TypeDeclarationElement]s (classes and
195 /// typedefs), depending on the use case. 196 /// typedefs), depending on the use case.
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 841
841 void forEachLocalMember(f(Element element)); 842 void forEachLocalMember(f(Element element));
842 void addMember(Element element, DiagnosticListener listener); 843 void addMember(Element element, DiagnosticListener listener);
843 void setPartOf(PartOf tag, DiagnosticListener listener); 844 void setPartOf(PartOf tag, DiagnosticListener listener);
844 bool get hasMembers; 845 bool get hasMembers;
845 846
846 int compareTo(CompilationUnitElement other); 847 int compareTo(CompilationUnitElement other);
847 } 848 }
848 849
849 abstract class LibraryElement extends Element 850 abstract class LibraryElement extends Element
850 implements ScopeContainerElement, AnalyzableElement { 851 implements ScopeContainerElement, AnalyzableElement, shared.LibraryElement {
851 /** 852 /**
852 * The canonical uri for this library. 853 * The canonical uri for this library.
853 * 854 *
854 * For user libraries the canonical uri is the script uri. For platform 855 * For user libraries the canonical uri is the script uri. For platform
855 * libraries the canonical uri is of the form [:dart:x:]. 856 * libraries the canonical uri is of the form [:dart:x:].
856 */ 857 */
857 Uri get canonicalUri; 858 Uri get canonicalUri;
858 859
859 /// Returns `true` if this library is 'dart:core'. 860 /// Returns `true` if this library is 'dart:core'.
860 bool get isDartCore; 861 bool get isDartCore;
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
1296 List<DartType> get typeVariables; 1297 List<DartType> get typeVariables;
1297 1298
1298 bool get isResolved; 1299 bool get isResolved;
1299 1300
1300 int get resolutionState; 1301 int get resolutionState;
1301 1302
1302 void ensureResolved(Compiler compiler); 1303 void ensureResolved(Compiler compiler);
1303 } 1304 }
1304 1305
1305 abstract class ClassElement extends TypeDeclarationElement 1306 abstract class ClassElement extends TypeDeclarationElement
1306 implements ScopeContainerElement { 1307 implements ScopeContainerElement, shared.ClassElement {
1307 int get id; 1308 int get id;
1308 1309
1309 /// The length of the longest inheritance path from [:Object:]. 1310 /// The length of the longest inheritance path from [:Object:].
1310 int get hierarchyDepth; 1311 int get hierarchyDepth;
1311 1312
1312 InterfaceType get rawType; 1313 InterfaceType get rawType;
1313 InterfaceType get thisType; 1314 InterfaceType get thisType;
1314 ClassElement get superclass; 1315 ClassElement get superclass;
1315 1316
1316 /// The direct supertype of this class. 1317 /// The direct supertype of this class.
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
1621 bool get isDeclaredByField; 1622 bool get isDeclaredByField;
1622 1623
1623 /// Returns `true` if this member is abstract. 1624 /// Returns `true` if this member is abstract.
1624 bool get isAbstract; 1625 bool get isAbstract;
1625 1626
1626 /// If abstract, [implementation] points to the overridden concrete member, 1627 /// If abstract, [implementation] points to the overridden concrete member,
1627 /// if any. Otherwise [implementation] points to the member itself. 1628 /// if any. Otherwise [implementation] points to the member itself.
1628 Member get implementation; 1629 Member get implementation;
1629 } 1630 }
1630 1631
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698