| 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 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); |
| 11 | 11 |
| 12 R visitAsyncForIn(AsyncForIn node) => visitLoop(node); |
| 12 R visitAsyncModifier(AsyncModifier node) => visitNode(node); | 13 R visitAsyncModifier(AsyncModifier node) => visitNode(node); |
| 13 R visitAwait(Await node) => visitExpression(node); | 14 R visitAwait(Await node) => visitExpression(node); |
| 14 R visitBlock(Block node) => visitStatement(node); | 15 R visitBlock(Block node) => visitStatement(node); |
| 15 R visitBreakStatement(BreakStatement node) => visitGotoStatement(node); | 16 R visitBreakStatement(BreakStatement node) => visitGotoStatement(node); |
| 16 R visitCascade(Cascade node) => visitExpression(node); | 17 R visitCascade(Cascade node) => visitExpression(node); |
| 17 R visitCascadeReceiver(CascadeReceiver node) => visitExpression(node); | 18 R visitCascadeReceiver(CascadeReceiver node) => visitExpression(node); |
| 18 R visitCaseMatch(CaseMatch node) => visitNode(node); | 19 R visitCaseMatch(CaseMatch node) => visitNode(node); |
| 19 R visitCatchBlock(CatchBlock node) => visitNode(node); | 20 R visitCatchBlock(CatchBlock node) => visitNode(node); |
| 20 R visitClassNode(ClassNode node) => visitNode(node); | 21 R visitClassNode(ClassNode node) => visitNode(node); |
| 21 R visitCombinator(Combinator node) => visitNode(node); | 22 R visitCombinator(Combinator node) => visitNode(node); |
| 22 R visitConditional(Conditional node) => visitExpression(node); | 23 R visitConditional(Conditional node) => visitExpression(node); |
| 23 R visitContinueStatement(ContinueStatement node) => visitGotoStatement(node); | 24 R visitContinueStatement(ContinueStatement node) => visitGotoStatement(node); |
| 24 R visitDoWhile(DoWhile node) => visitLoop(node); | 25 R visitDoWhile(DoWhile node) => visitLoop(node); |
| 25 R visitEmptyStatement(EmptyStatement node) => visitStatement(node); | 26 R visitEmptyStatement(EmptyStatement node) => visitStatement(node); |
| 26 R visitEnum(Enum node) => visitNode(node); | 27 R visitEnum(Enum node) => visitNode(node); |
| 27 R visitExport(Export node) => visitLibraryDependency(node); | 28 R visitExport(Export node) => visitLibraryDependency(node); |
| 28 R visitExpression(Expression node) => visitNode(node); | 29 R visitExpression(Expression node) => visitNode(node); |
| 29 R visitExpressionStatement(ExpressionStatement node) => visitStatement(node); | 30 R visitExpressionStatement(ExpressionStatement node) => visitStatement(node); |
| 30 R visitFor(For node) => visitLoop(node); | 31 R visitFor(For node) => visitLoop(node); |
| 31 R visitForIn(ForIn node) => visitLoop(node); | |
| 32 R visitFunctionDeclaration(FunctionDeclaration node) => visitStatement(node); | 32 R visitFunctionDeclaration(FunctionDeclaration node) => visitStatement(node); |
| 33 R visitFunctionExpression(FunctionExpression node) => visitExpression(node); | 33 R visitFunctionExpression(FunctionExpression node) => visitExpression(node); |
| 34 R visitGotoStatement(GotoStatement node) => visitStatement(node); | 34 R visitGotoStatement(GotoStatement node) => visitStatement(node); |
| 35 R visitIdentifier(Identifier node) => visitExpression(node); | 35 R visitIdentifier(Identifier node) => visitExpression(node); |
| 36 R visitIf(If node) => visitStatement(node); | 36 R visitIf(If node) => visitStatement(node); |
| 37 R visitImport(Import node) => visitLibraryDependency(node); | 37 R visitImport(Import node) => visitLibraryDependency(node); |
| 38 R visitLabel(Label node) => visitNode(node); | 38 R visitLabel(Label node) => visitNode(node); |
| 39 R visitLabeledStatement(LabeledStatement node) => visitStatement(node); | 39 R visitLabeledStatement(LabeledStatement node) => visitStatement(node); |
| 40 R visitLibraryDependency(LibraryDependency node) => visitLibraryTag(node); | 40 R visitLibraryDependency(LibraryDependency node) => visitLibraryTag(node); |
| 41 R visitLibraryName(LibraryName node) => visitLibraryTag(node); | 41 R visitLibraryName(LibraryName node) => visitLibraryTag(node); |
| 42 R visitLibraryTag(LibraryTag node) => visitNode(node); | 42 R visitLibraryTag(LibraryTag node) => visitNode(node); |
| 43 R visitLiteral(Literal node) => visitExpression(node); | 43 R visitLiteral(Literal node) => visitExpression(node); |
| 44 R visitLiteralBool(LiteralBool node) => visitLiteral(node); | 44 R visitLiteralBool(LiteralBool node) => visitLiteral(node); |
| 45 R visitLiteralDouble(LiteralDouble node) => visitLiteral(node); | 45 R visitLiteralDouble(LiteralDouble node) => visitLiteral(node); |
| 46 R visitLiteralInt(LiteralInt node) => visitLiteral(node); | 46 R visitLiteralInt(LiteralInt node) => visitLiteral(node); |
| 47 R visitLiteralList(LiteralList node) => visitExpression(node); | 47 R visitLiteralList(LiteralList node) => visitExpression(node); |
| 48 R visitLiteralMap(LiteralMap node) => visitExpression(node); | 48 R visitLiteralMap(LiteralMap node) => visitExpression(node); |
| 49 R visitLiteralMapEntry(LiteralMapEntry node) => visitNode(node); | 49 R visitLiteralMapEntry(LiteralMapEntry node) => visitNode(node); |
| 50 R visitLiteralNull(LiteralNull node) => visitLiteral(node); | 50 R visitLiteralNull(LiteralNull node) => visitLiteral(node); |
| 51 R visitLiteralString(LiteralString node) => visitStringNode(node); | 51 R visitLiteralString(LiteralString node) => visitStringNode(node); |
| 52 R visitStringJuxtaposition(StringJuxtaposition node) => visitStringNode(node); | 52 R visitStringJuxtaposition(StringJuxtaposition node) => visitStringNode(node); |
| 53 R visitSyncForIn(SyncForIn node) => visitLoop(node); |
| 53 R visitLoop(Loop node) => visitStatement(node); | 54 R visitLoop(Loop node) => visitStatement(node); |
| 54 R visitMetadata(Metadata node) => visitNode(node); | 55 R visitMetadata(Metadata node) => visitNode(node); |
| 55 R visitMixinApplication(MixinApplication node) => visitNode(node); | 56 R visitMixinApplication(MixinApplication node) => visitNode(node); |
| 56 R visitModifiers(Modifiers node) => visitNode(node); | 57 R visitModifiers(Modifiers node) => visitNode(node); |
| 57 R visitNamedArgument(NamedArgument node) => visitExpression(node); | 58 R visitNamedArgument(NamedArgument node) => visitExpression(node); |
| 58 R visitNamedMixinApplication(NamedMixinApplication node) { | 59 R visitNamedMixinApplication(NamedMixinApplication node) { |
| 59 return visitMixinApplication(node); | 60 return visitMixinApplication(node); |
| 60 } | 61 } |
| 61 R visitNewExpression(NewExpression node) => visitExpression(node); | 62 R visitNewExpression(NewExpression node) => visitExpression(node); |
| 62 R visitNodeList(NodeList node) => visitNode(node); | 63 R visitNodeList(NodeList node) => visitNode(node); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 Conditional asConditional() => null; | 159 Conditional asConditional() => null; |
| 159 ContinueStatement asContinueStatement() => null; | 160 ContinueStatement asContinueStatement() => null; |
| 160 DoWhile asDoWhile() => null; | 161 DoWhile asDoWhile() => null; |
| 161 EmptyStatement asEmptyStatement() => null; | 162 EmptyStatement asEmptyStatement() => null; |
| 162 Enum asEnum() => null; | 163 Enum asEnum() => null; |
| 163 ErrorExpression asErrorExpression() => null; | 164 ErrorExpression asErrorExpression() => null; |
| 164 Export asExport() => null; | 165 Export asExport() => null; |
| 165 Expression asExpression() => null; | 166 Expression asExpression() => null; |
| 166 ExpressionStatement asExpressionStatement() => null; | 167 ExpressionStatement asExpressionStatement() => null; |
| 167 For asFor() => null; | 168 For asFor() => null; |
| 169 SyncForIn asSyncForIn() => null; |
| 170 AsyncForIn asAsyncForIn() => null; |
| 168 ForIn asForIn() => null; | 171 ForIn asForIn() => null; |
| 169 FunctionDeclaration asFunctionDeclaration() => null; | 172 FunctionDeclaration asFunctionDeclaration() => null; |
| 170 FunctionExpression asFunctionExpression() => null; | 173 FunctionExpression asFunctionExpression() => null; |
| 171 Identifier asIdentifier() => null; | 174 Identifier asIdentifier() => null; |
| 172 If asIf() => null; | 175 If asIf() => null; |
| 173 Import asImport() => null; | 176 Import asImport() => null; |
| 174 Label asLabel() => null; | 177 Label asLabel() => null; |
| 175 LabeledStatement asLabeledStatement() => null; | 178 LabeledStatement asLabeledStatement() => null; |
| 176 LibraryName asLibraryName() => null; | 179 LibraryName asLibraryName() => null; |
| 177 LibraryDependency asLibraryDependency() => null; | 180 LibraryDependency asLibraryDependency() => null; |
| (...skipping 1590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1768 | 1771 |
| 1769 class ContinueStatement extends GotoStatement { | 1772 class ContinueStatement extends GotoStatement { |
| 1770 ContinueStatement(Identifier target, Token keywordToken, Token semicolonToken) | 1773 ContinueStatement(Identifier target, Token keywordToken, Token semicolonToken) |
| 1771 : super(target, keywordToken, semicolonToken); | 1774 : super(target, keywordToken, semicolonToken); |
| 1772 | 1775 |
| 1773 ContinueStatement asContinueStatement() => this; | 1776 ContinueStatement asContinueStatement() => this; |
| 1774 | 1777 |
| 1775 accept(Visitor visitor) => visitor.visitContinueStatement(this); | 1778 accept(Visitor visitor) => visitor.visitContinueStatement(this); |
| 1776 } | 1779 } |
| 1777 | 1780 |
| 1778 class ForIn extends Loop with StoredTreeElementMixin { | 1781 abstract class ForIn extends Loop { |
| 1779 final Node declaredIdentifier; | 1782 final Node declaredIdentifier; |
| 1780 final Expression expression; | 1783 final Expression expression; |
| 1781 | 1784 |
| 1782 final Token awaitToken; | |
| 1783 final Token forToken; | 1785 final Token forToken; |
| 1784 final Token inToken; | 1786 final Token inToken; |
| 1785 | 1787 |
| 1786 ForIn(this.declaredIdentifier, this.expression, | 1788 ForIn(this.declaredIdentifier, this.expression, |
| 1787 Statement body, this.awaitToken, this.forToken, this.inToken) | 1789 Statement body, this.forToken, this.inToken) |
| 1788 : super(body); | 1790 : super(body); |
| 1789 | 1791 |
| 1790 bool get isAsync => awaitToken != null; | |
| 1791 | |
| 1792 Expression get condition => null; | 1792 Expression get condition => null; |
| 1793 | 1793 |
| 1794 ForIn asForIn() => this; | 1794 ForIn asForIn() => this; |
| 1795 | 1795 |
| 1796 accept(Visitor visitor) => visitor.visitForIn(this); | 1796 Token getEndToken() => body.getEndToken(); |
| 1797 } |
| 1798 |
| 1799 class SyncForIn extends ForIn with StoredTreeElementMixin { |
| 1800 SyncForIn(declaredIdentifier, expression, Statement body, forToken, inToken) |
| 1801 : super(declaredIdentifier, expression, body, forToken, inToken); |
| 1802 |
| 1803 SyncForIn asSyncForIn() => this; |
| 1804 |
| 1805 accept(Visitor visitor) => visitor.visitSyncForIn(this); |
| 1797 | 1806 |
| 1798 visitChildren(Visitor visitor) { | 1807 visitChildren(Visitor visitor) { |
| 1799 declaredIdentifier.accept(visitor); | 1808 declaredIdentifier.accept(visitor); |
| 1800 expression.accept(visitor); | 1809 expression.accept(visitor); |
| 1801 body.accept(visitor); | 1810 body.accept(visitor); |
| 1802 } | 1811 } |
| 1803 | 1812 |
| 1804 Token getBeginToken() => awaitToken != null ? awaitToken : forToken; | 1813 Token getBeginToken() => forToken; |
| 1814 } |
| 1805 | 1815 |
| 1806 Token getEndToken() => body.getEndToken(); | 1816 class AsyncForIn extends ForIn with StoredTreeElementMixin { |
| 1817 final Token awaitToken; |
| 1818 |
| 1819 AsyncForIn(declaredIdentifier, expression, |
| 1820 Statement body, this.awaitToken, forToken, inToken) |
| 1821 : super(declaredIdentifier, expression, body, forToken, inToken); |
| 1822 |
| 1823 AsyncForIn asAsyncForIn() => this; |
| 1824 |
| 1825 accept(Visitor visitor) => visitor.visitAsyncForIn(this); |
| 1826 |
| 1827 visitChildren(Visitor visitor) { |
| 1828 declaredIdentifier.accept(visitor); |
| 1829 expression.accept(visitor); |
| 1830 body.accept(visitor); |
| 1831 } |
| 1832 |
| 1833 Token getBeginToken() => awaitToken; |
| 1807 } | 1834 } |
| 1808 | 1835 |
| 1809 class Label extends Node { | 1836 class Label extends Node { |
| 1810 final Identifier identifier; | 1837 final Identifier identifier; |
| 1811 final Token colonToken; | 1838 final Token colonToken; |
| 1812 | 1839 |
| 1813 Label(this.identifier, this.colonToken); | 1840 Label(this.identifier, this.colonToken); |
| 1814 | 1841 |
| 1815 String get labelName => identifier.source; | 1842 String get labelName => identifier.source; |
| 1816 | 1843 |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2297 | 2324 |
| 2298 // VariableDefinitions. | 2325 // VariableDefinitions. |
| 2299 get metadata => null; | 2326 get metadata => null; |
| 2300 get type => null; | 2327 get type => null; |
| 2301 | 2328 |
| 2302 // Typedef. | 2329 // Typedef. |
| 2303 get typeParameters => null; | 2330 get typeParameters => null; |
| 2304 get formals => null; | 2331 get formals => null; |
| 2305 get typedefKeyword => null; | 2332 get typedefKeyword => null; |
| 2306 } | 2333 } |
| OLD | NEW |