Chromium Code Reviews| Index: pkg/sharedfrontend/lib/elements.dart |
| diff --git a/pkg/sharedfrontend/lib/elements.dart b/pkg/sharedfrontend/lib/elements.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f18b67f58bf8121f703274da51a20d73e157c23f |
| --- /dev/null |
| +++ b/pkg/sharedfrontend/lib/elements.dart |
| @@ -0,0 +1,37 @@ |
| +// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +/// Shared element model between the dart analyzer and dart2js. |
| + |
| +library elements; |
| + |
| +/// The interface `Element` defines the behavior common to all of the elements |
| +/// in the element * model. Generally speaking, the element model is a semantic |
|
Brian Wilkerson
2015/02/05 17:09:37
nit: Remove the '*'
Johnni Winther
2015/02/10 10:13:03
Done.
|
| +/// model of the program that represents things that are declared with a name |
| +/// and hence can be referenced elsewhere in the code. |
| +abstract class Element { |
| + // TODO(johnniwinther): Semantic difference. Setter names from the analyzer |
| + // contain '=' but doesn't in dart2js. |
| + // TODO(johnniwinther,paulberry,brianwilkerson): What about privacy? Maybe |
| + // name should be the `Name` class in |
| + // 'package:compiler/src/elements/names.dart'. |
| + /// The name of this element, or `null` if this element does not have a name. |
| + String get name; |
| + |
| + /// The library that contains this element. This will be the element itself if |
| + /// it is a library element. |
| + LibraryElement get library; |
| +} |
| + |
| +/// The interface `LibraryElement` defines the behavior of elements representing |
| +/// a library. |
| +abstract class LibraryElement extends Element { |
| + |
| +} |
| + |
| +/// The interface `ClassElement` defines the behavior of elements that represent |
| +/// a class. |
| +abstract class ClassElement extends Element { |
| + |
| +} |