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

Side by Side Diff: dart/sdk/lib/_internal/compiler/implementation/tree/nodes.dart

Issue 99303004: Remove unused API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years 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 part of tree; 5 part of tree;
6 6
7 abstract class Visitor<R> { 7 abstract class Visitor<R> {
8 const Visitor(); 8 const Visitor();
9 9
10 R visitNode(Node node); 10 R visitNode(Node node);
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 final Token ifToken; 590 final Token ifToken;
591 final Token elseToken; 591 final Token elseToken;
592 592
593 If(this.condition, this.thenPart, this.elsePart, 593 If(this.condition, this.thenPart, this.elsePart,
594 this.ifToken, this.elseToken); 594 this.ifToken, this.elseToken);
595 595
596 If asIf() => this; 596 If asIf() => this;
597 597
598 bool get hasElsePart => elsePart != null; 598 bool get hasElsePart => elsePart != null;
599 599
600 void validate() {
601 // TODO(ahe): Check that condition has size one.
602 }
603
604 accept(Visitor visitor) => visitor.visitIf(this); 600 accept(Visitor visitor) => visitor.visitIf(this);
605 601
606 visitChildren(Visitor visitor) { 602 visitChildren(Visitor visitor) {
607 if (condition != null) condition.accept(visitor); 603 if (condition != null) condition.accept(visitor);
608 if (thenPart != null) thenPart.accept(visitor); 604 if (thenPart != null) thenPart.accept(visitor);
609 if (elsePart != null) elsePart.accept(visitor); 605 if (elsePart != null) elsePart.accept(visitor);
610 } 606 }
611 607
612 Token getBeginToken() => ifToken; 608 Token getBeginToken() => ifToken;
613 609
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 /** Non-null on validated string literals. */ 907 /** Non-null on validated string literals. */
912 final DartString dartString; 908 final DartString dartString;
913 909
914 LiteralString(this.token, this.dartString); 910 LiteralString(this.token, this.dartString);
915 911
916 LiteralString asLiteralString() => this; 912 LiteralString asLiteralString() => this;
917 913
918 void visitChildren(Visitor visitor) {} 914 void visitChildren(Visitor visitor) {}
919 915
920 bool get isInterpolation => false; 916 bool get isInterpolation => false;
921 bool isValidated() => dartString != null;
922 917
923 Token getBeginToken() => token; 918 Token getBeginToken() => token;
924 Token getEndToken() => token; 919 Token getEndToken() => token;
925 920
926 accept(Visitor visitor) => visitor.visitLiteralString(this); 921 accept(Visitor visitor) => visitor.visitLiteralString(this);
927 } 922 }
928 923
929 class LiteralNull extends Literal<String> { 924 class LiteralNull extends Literal<String> {
930 LiteralNull(Token token) : super(token, null); 925 LiteralNull(Token token) : super(token, null);
931 926
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
1718 visitChildren(Visitor visitor) { 1713 visitChildren(Visitor visitor) {
1719 labels.accept(visitor); 1714 labels.accept(visitor);
1720 statement.accept(visitor); 1715 statement.accept(visitor);
1721 } 1716 }
1722 1717
1723 Token getBeginToken() => labels.getBeginToken(); 1718 Token getBeginToken() => labels.getBeginToken();
1724 1719
1725 Token getEndToken() => statement.getEndToken(); 1720 Token getEndToken() => statement.getEndToken();
1726 1721
1727 bool isValidContinueTarget() => statement.isValidContinueTarget(); 1722 bool isValidContinueTarget() => statement.isValidContinueTarget();
1728
1729 Node getBody() => statement;
1730 } 1723 }
1731 1724
1732 abstract class LibraryTag extends Node { 1725 abstract class LibraryTag extends Node {
1733 final Link<MetadataAnnotation> metadata; 1726 final Link<MetadataAnnotation> metadata;
1734 1727
1735 LibraryTag(this.metadata); 1728 LibraryTag(this.metadata);
1736 1729
1737 bool get isLibraryName => false; 1730 bool get isLibraryName => false;
1738 bool get isImport => false; 1731 bool get isImport => false;
1739 bool get isExport => false; 1732 bool get isExport => false;
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
2090 * argument). 2083 * argument).
2091 * 2084 *
2092 * TODO(ahe): This method is controversial, the team needs to discuss 2085 * TODO(ahe): This method is controversial, the team needs to discuss
2093 * if top-level methods are acceptable and what naming conventions to 2086 * if top-level methods are acceptable and what naming conventions to
2094 * use. 2087 * use.
2095 */ 2088 */
2096 initializerDo(Node node, f(Node node)) { 2089 initializerDo(Node node, f(Node node)) {
2097 SendSet send = node.asSendSet(); 2090 SendSet send = node.asSendSet();
2098 if (send != null) return f(send.arguments.head); 2091 if (send != null) return f(send.arguments.head);
2099 } 2092 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698