OLD | NEW |
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 elements; |
6 | 6 |
7 import 'dart:uri'; | 7 import 'dart:uri'; |
8 | 8 |
9 import 'modelx.dart'; | 9 import 'modelx.dart'; |
10 import '../tree/tree.dart'; | 10 import '../tree/tree.dart'; |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 MessageKind get messageKind; | 514 MessageKind get messageKind; |
515 Map get messageArguments; | 515 Map get messageArguments; |
516 Element get existingElement; | 516 Element get existingElement; |
517 Element get newElement; | 517 Element get newElement; |
518 } | 518 } |
519 | 519 |
520 // TODO(kasperl): This probably shouldn't be called an element. It's | 520 // TODO(kasperl): This probably shouldn't be called an element. It's |
521 // just an interface shared by classes and libraries. | 521 // just an interface shared by classes and libraries. |
522 abstract class ScopeContainerElement { | 522 abstract class ScopeContainerElement { |
523 Element localLookup(SourceString elementName); | 523 Element localLookup(SourceString elementName); |
| 524 |
| 525 void forEachLocalMember(f(Element element)); |
524 } | 526 } |
525 | 527 |
526 abstract class CompilationUnitElement extends Element { | 528 abstract class CompilationUnitElement extends Element { |
527 Script get script; | 529 Script get script; |
528 PartOf get partTag; | 530 PartOf get partTag; |
529 | 531 |
530 void addMember(Element element, DiagnosticListener listener); | 532 void addMember(Element element, DiagnosticListener listener); |
531 void setPartOf(PartOf tag, DiagnosticListener listener); | 533 void setPartOf(PartOf tag, DiagnosticListener listener); |
532 bool get hasMembers; | 534 bool get hasMembers; |
533 } | 535 } |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 | 584 |
583 // TODO(kasperl): Get rid of this method. | 585 // TODO(kasperl): Get rid of this method. |
584 Iterable<Element> getNonPrivateElementsInScope(); | 586 Iterable<Element> getNonPrivateElementsInScope(); |
585 | 587 |
586 void setExports(Iterable<Element> exportedElements); | 588 void setExports(Iterable<Element> exportedElements); |
587 | 589 |
588 Element find(SourceString elementName); | 590 Element find(SourceString elementName); |
589 Element findLocal(SourceString elementName); | 591 Element findLocal(SourceString elementName); |
590 void forEachExport(f(Element element)); | 592 void forEachExport(f(Element element)); |
591 | 593 |
592 void forEachLocalMember(f(Element element)); | |
593 | |
594 bool hasLibraryName(); | 594 bool hasLibraryName(); |
595 String getLibraryOrScriptName(); | 595 String getLibraryOrScriptName(); |
596 } | 596 } |
597 | 597 |
598 abstract class PrefixElement extends Element { | 598 abstract class PrefixElement extends Element { |
599 Map<SourceString, Element> get imported; | 599 Map<SourceString, Element> get imported; |
600 Element lookupLocalMember(SourceString memberName); | 600 Element lookupLocalMember(SourceString memberName); |
601 } | 601 } |
602 | 602 |
603 abstract class TypedefElement extends Element | 603 abstract class TypedefElement extends Element |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 [Element noMatch(Element)]); | 798 [Element noMatch(Element)]); |
799 | 799 |
800 void forEachMember(void f(ClassElement enclosingClass, Element member), | 800 void forEachMember(void f(ClassElement enclosingClass, Element member), |
801 {includeBackendMembers: false, | 801 {includeBackendMembers: false, |
802 includeSuperMembers: false}); | 802 includeSuperMembers: false}); |
803 | 803 |
804 void forEachInstanceField(void f(ClassElement enclosingClass, Element field), | 804 void forEachInstanceField(void f(ClassElement enclosingClass, Element field), |
805 {includeBackendMembers: false, | 805 {includeBackendMembers: false, |
806 includeSuperMembers: false}); | 806 includeSuperMembers: false}); |
807 | 807 |
808 void forEachLocalMember(void f(Element member)); | |
809 void forEachBackendMember(void f(Element member)); | 808 void forEachBackendMember(void f(Element member)); |
810 } | 809 } |
811 | 810 |
812 abstract class MixinApplicationElement extends ClassElement { | 811 abstract class MixinApplicationElement extends ClassElement { |
813 ClassElement get mixin; | 812 ClassElement get mixin; |
814 void set mixin(ClassElement value); | 813 void set mixin(ClassElement value); |
815 } | 814 } |
816 | 815 |
817 abstract class LabelElement extends Element { | 816 abstract class LabelElement extends Element { |
818 Label get label; | 817 Label get label; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
859 int get resolutionState; | 858 int get resolutionState; |
860 Token get beginToken; | 859 Token get beginToken; |
861 Token get endToken; | 860 Token get endToken; |
862 | 861 |
863 // TODO(kasperl): Try to get rid of these. | 862 // TODO(kasperl): Try to get rid of these. |
864 void set annotatedElement(Element value); | 863 void set annotatedElement(Element value); |
865 void set resolutionState(int value); | 864 void set resolutionState(int value); |
866 | 865 |
867 MetadataAnnotation ensureResolved(Compiler compiler); | 866 MetadataAnnotation ensureResolved(Compiler compiler); |
868 } | 867 } |
OLD | NEW |