OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
7 | 7 |
8 library engine.ast; | 8 library engine.ast; |
9 | 9 |
10 import 'dart:collection'; | 10 import 'dart:collection'; |
11 import 'java_core.dart'; | 11 import 'java_core.dart'; |
12 import 'java_engine.dart'; | 12 import 'java_engine.dart'; |
13 import 'source.dart' show LineInfo, Source; | 13 import 'source.dart' show LineInfo, Source; |
14 import 'scanner.dart'; | 14 import 'scanner.dart'; |
15 import 'engine.dart' show AnalysisEngine; | 15 import 'engine.dart' show AnalysisEngine; |
16 import 'utilities_dart.dart'; | 16 import 'utilities_dart.dart'; |
17 import 'utilities_collection.dart' show TokenMap; | 17 import 'utilities_collection.dart' show TokenMap; |
18 import 'element.dart'; | 18 import 'element.dart'; |
| 19 import 'constant.dart'; |
19 | 20 |
20 /** | 21 /** |
21 * Instances of the class `AdjacentStrings` represents two or more string litera
ls that are | 22 * Instances of the class `AdjacentStrings` represents two or more string litera
ls that are |
22 * implicitly concatenated because of being adjacent (separated only by whitespa
ce). | 23 * implicitly concatenated because of being adjacent (separated only by whitespa
ce). |
23 * | 24 * |
24 * While the grammar only allows adjacent strings when all of the strings are of
the same kind | 25 * While the grammar only allows adjacent strings when all of the strings are of
the same kind |
25 * (single line or multi-line), this class doesn't enforce that restriction. | 26 * (single line or multi-line), this class doesn't enforce that restriction. |
26 * | 27 * |
27 * <pre> | 28 * <pre> |
28 * adjacentStrings ::= | 29 * adjacentStrings ::= |
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 MethodElement _propagatedElement; | 784 MethodElement _propagatedElement; |
784 | 785 |
785 /** | 786 /** |
786 * Initialize a newly created assignment expression. | 787 * Initialize a newly created assignment expression. |
787 * | 788 * |
788 * @param leftHandSide the expression used to compute the left hand side | 789 * @param leftHandSide the expression used to compute the left hand side |
789 * @param operator the assignment operator being applied | 790 * @param operator the assignment operator being applied |
790 * @param rightHandSide the expression used to compute the right hand side | 791 * @param rightHandSide the expression used to compute the right hand side |
791 */ | 792 */ |
792 AssignmentExpression(Expression leftHandSide, this.operator, Expression rightH
andSide) { | 793 AssignmentExpression(Expression leftHandSide, this.operator, Expression rightH
andSide) { |
| 794 if (leftHandSide == null || rightHandSide == null) { |
| 795 String message; |
| 796 if (leftHandSide == null) { |
| 797 if (rightHandSide == null) { |
| 798 message = "Both the left-hand and right-hand sides are null"; |
| 799 } else { |
| 800 message = "The left-hand size is null"; |
| 801 } |
| 802 } else { |
| 803 message = "The right-hand size is null"; |
| 804 } |
| 805 AnalysisEngine.instance.logger.logError2(message, new JavaException(messag
e)); |
| 806 } |
793 this._leftHandSide = becomeParentOf(leftHandSide); | 807 this._leftHandSide = becomeParentOf(leftHandSide); |
794 this._rightHandSide = becomeParentOf(rightHandSide); | 808 this._rightHandSide = becomeParentOf(rightHandSide); |
795 } | 809 } |
796 | 810 |
797 @override | 811 @override |
798 accept(AstVisitor visitor) => visitor.visitAssignmentExpression(this); | 812 accept(AstVisitor visitor) => visitor.visitAssignmentExpression(this); |
799 | 813 |
800 @override | 814 @override |
801 Token get beginToken => _leftHandSide.beginToken; | 815 Token get beginToken => _leftHandSide.beginToken; |
802 | 816 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
942 return parameters[0]; | 956 return parameters[0]; |
943 } | 957 } |
944 } | 958 } |
945 | 959 |
946 /** | 960 /** |
947 * Instances of the class `AstCloner` implement an object that will clone any AS
T structure | 961 * Instances of the class `AstCloner` implement an object that will clone any AS
T structure |
948 * that it visits. The cloner will only clone the structure, it will not preserv
e any resolution | 962 * that it visits. The cloner will only clone the structure, it will not preserv
e any resolution |
949 * results or properties associated with the nodes. | 963 * results or properties associated with the nodes. |
950 */ | 964 */ |
951 class AstCloner implements AstVisitor<AstNode> { | 965 class AstCloner implements AstVisitor<AstNode> { |
952 @override | 966 List cloneNodeList(NodeList nodes) { |
953 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => new AdjacentStri
ngs(_cloneNodeList(node.strings)); | 967 int count = nodes.length; |
| 968 List clonedNodes = new List(); |
| 969 for (int i = 0; i < count; i++) { |
| 970 clonedNodes.add((nodes[i]).accept(this) as AstNode); |
| 971 } |
| 972 return clonedNodes; |
| 973 } |
954 | 974 |
955 @override | 975 @override |
956 Annotation visitAnnotation(Annotation node) => new Annotation(node.atSign, _cl
oneNode(node.name), node.period, _cloneNode(node.constructorName), _cloneNode(no
de.arguments)); | 976 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => new AdjacentStri
ngs(cloneNodeList(node.strings)); |
957 | 977 |
958 @override | 978 @override |
959 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList(node.lef
tParenthesis, _cloneNodeList(node.arguments), node.rightParenthesis); | 979 Annotation visitAnnotation(Annotation node) => new Annotation(node.atSign, clo
neNode(node.name), node.period, cloneNode(node.constructorName), cloneNode(node.
arguments)); |
960 | 980 |
961 @override | 981 @override |
962 AsExpression visitAsExpression(AsExpression node) => new AsExpression(_cloneNo
de(node.expression), node.asOperator, _cloneNode(node.type)); | 982 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList(node.lef
tParenthesis, cloneNodeList(node.arguments), node.rightParenthesis); |
963 | 983 |
964 @override | 984 @override |
965 AstNode visitAssertStatement(AssertStatement node) => new AssertStatement(node
.keyword, node.leftParenthesis, _cloneNode(node.condition), node.rightParenthesi
s, node.semicolon); | 985 AsExpression visitAsExpression(AsExpression node) => new AsExpression(cloneNod
e(node.expression), node.asOperator, cloneNode(node.type)); |
966 | 986 |
967 @override | 987 @override |
968 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) => n
ew AssignmentExpression(_cloneNode(node.leftHandSide), node.operator, _cloneNode
(node.rightHandSide)); | 988 AstNode visitAssertStatement(AssertStatement node) => new AssertStatement(node
.keyword, node.leftParenthesis, cloneNode(node.condition), node.rightParenthesis
, node.semicolon); |
969 | 989 |
970 @override | 990 @override |
971 BinaryExpression visitBinaryExpression(BinaryExpression node) => new BinaryExp
ression(_cloneNode(node.leftOperand), node.operator, _cloneNode(node.rightOperan
d)); | 991 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) => n
ew AssignmentExpression(cloneNode(node.leftHandSide), node.operator, cloneNode(n
ode.rightHandSide)); |
972 | 992 |
973 @override | 993 @override |
974 Block visitBlock(Block node) => new Block(node.leftBracket, _cloneNodeList(nod
e.statements), node.rightBracket); | 994 BinaryExpression visitBinaryExpression(BinaryExpression node) => new BinaryExp
ression(cloneNode(node.leftOperand), node.operator, cloneNode(node.rightOperand)
); |
975 | 995 |
976 @override | 996 @override |
977 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => new BlockF
unctionBody(_cloneNode(node.block)); | 997 Block visitBlock(Block node) => new Block(node.leftBracket, cloneNodeList(node
.statements), node.rightBracket); |
| 998 |
| 999 @override |
| 1000 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => new BlockF
unctionBody(cloneNode(node.block)); |
978 | 1001 |
979 @override | 1002 @override |
980 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) => new BooleanLiteral(
node.literal, node.value); | 1003 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) => new BooleanLiteral(
node.literal, node.value); |
981 | 1004 |
982 @override | 1005 @override |
983 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement(
node.keyword, _cloneNode(node.label), node.semicolon); | 1006 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement(
node.keyword, cloneNode(node.label), node.semicolon); |
984 | 1007 |
985 @override | 1008 @override |
986 CascadeExpression visitCascadeExpression(CascadeExpression node) => new Cascad
eExpression(_cloneNode(node.target), _cloneNodeList(node.cascadeSections)); | 1009 CascadeExpression visitCascadeExpression(CascadeExpression node) => new Cascad
eExpression(cloneNode(node.target), cloneNodeList(node.cascadeSections)); |
987 | 1010 |
988 @override | 1011 @override |
989 CatchClause visitCatchClause(CatchClause node) => new CatchClause(node.onKeywo
rd, _cloneNode(node.exceptionType), node.catchKeyword, node.leftParenthesis, _cl
oneNode(node.exceptionParameter), node.comma, _cloneNode(node.stackTraceParamete
r), node.rightParenthesis, _cloneNode(node.body)); | 1012 CatchClause visitCatchClause(CatchClause node) => new CatchClause(node.onKeywo
rd, cloneNode(node.exceptionType), node.catchKeyword, node.leftParenthesis, clon
eNode(node.exceptionParameter), node.comma, cloneNode(node.stackTraceParameter),
node.rightParenthesis, cloneNode(node.body)); |
990 | 1013 |
991 @override | 1014 @override |
992 ClassDeclaration visitClassDeclaration(ClassDeclaration node) { | 1015 ClassDeclaration visitClassDeclaration(ClassDeclaration node) { |
993 ClassDeclaration copy = new ClassDeclaration(_cloneNode(node.documentationCo
mment), _cloneNodeList(node.metadata), node.abstractKeyword, node.classKeyword,
_cloneNode(node.name), _cloneNode(node.typeParameters), _cloneNode(node.extendsC
lause), _cloneNode(node.withClause), _cloneNode(node.implementsClause), node.lef
tBracket, _cloneNodeList(node.members), node.rightBracket); | 1016 ClassDeclaration copy = new ClassDeclaration(cloneNode(node.documentationCom
ment), cloneNodeList(node.metadata), node.abstractKeyword, node.classKeyword, cl
oneNode(node.name), cloneNode(node.typeParameters), cloneNode(node.extendsClause
), cloneNode(node.withClause), cloneNode(node.implementsClause), node.leftBracke
t, cloneNodeList(node.members), node.rightBracket); |
994 copy.nativeClause = _cloneNode(node.nativeClause); | 1017 copy.nativeClause = cloneNode(node.nativeClause); |
995 return copy; | 1018 return copy; |
996 } | 1019 } |
997 | 1020 |
998 @override | 1021 @override |
999 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias(
_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), node.keywo
rd, _cloneNode(node.name), _cloneNode(node.typeParameters), node.equals, node.ab
stractKeyword, _cloneNode(node.superclass), _cloneNode(node.withClause), _cloneN
ode(node.implementsClause), node.semicolon); | 1022 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias(
cloneNode(node.documentationComment), cloneNodeList(node.metadata), node.keyword
, cloneNode(node.name), cloneNode(node.typeParameters), node.equals, node.abstra
ctKeyword, cloneNode(node.superclass), cloneNode(node.withClause), cloneNode(nod
e.implementsClause), node.semicolon); |
1000 | 1023 |
1001 @override | 1024 @override |
1002 Comment visitComment(Comment node) { | 1025 Comment visitComment(Comment node) { |
1003 if (node.isDocumentation) { | 1026 if (node.isDocumentation) { |
1004 return Comment.createDocumentationCommentWithReferences(node.tokens, _clon
eNodeList(node.references)); | 1027 return Comment.createDocumentationCommentWithReferences(node.tokens, clone
NodeList(node.references)); |
1005 } else if (node.isBlock) { | 1028 } else if (node.isBlock) { |
1006 return Comment.createBlockComment(node.tokens); | 1029 return Comment.createBlockComment(node.tokens); |
1007 } | 1030 } |
1008 return Comment.createEndOfLineComment(node.tokens); | 1031 return Comment.createEndOfLineComment(node.tokens); |
1009 } | 1032 } |
1010 | 1033 |
1011 @override | 1034 @override |
1012 CommentReference visitCommentReference(CommentReference node) => new CommentRe
ference(node.newKeyword, _cloneNode(node.identifier)); | 1035 CommentReference visitCommentReference(CommentReference node) => new CommentRe
ference(node.newKeyword, cloneNode(node.identifier)); |
1013 | 1036 |
1014 @override | 1037 @override |
1015 CompilationUnit visitCompilationUnit(CompilationUnit node) { | 1038 CompilationUnit visitCompilationUnit(CompilationUnit node) { |
1016 CompilationUnit clone = new CompilationUnit(node.beginToken, _cloneNode(node
.scriptTag), _cloneNodeList(node.directives), _cloneNodeList(node.declarations),
node.endToken); | 1039 CompilationUnit clone = new CompilationUnit(node.beginToken, cloneNode(node.
scriptTag), cloneNodeList(node.directives), cloneNodeList(node.declarations), no
de.endToken); |
1017 clone.lineInfo = node.lineInfo; | 1040 clone.lineInfo = node.lineInfo; |
1018 return clone; | 1041 return clone; |
1019 } | 1042 } |
1020 | 1043 |
1021 @override | 1044 @override |
1022 ConditionalExpression visitConditionalExpression(ConditionalExpression node) =
> new ConditionalExpression(_cloneNode(node.condition), node.question, _cloneNod
e(node.thenExpression), node.colon, _cloneNode(node.elseExpression)); | 1045 ConditionalExpression visitConditionalExpression(ConditionalExpression node) =
> new ConditionalExpression(cloneNode(node.condition), node.question, cloneNode(
node.thenExpression), node.colon, cloneNode(node.elseExpression)); |
1023 | 1046 |
1024 @override | 1047 @override |
1025 ConstructorDeclaration visitConstructorDeclaration(ConstructorDeclaration node
) => new ConstructorDeclaration(_cloneNode(node.documentationComment), _cloneNod
eList(node.metadata), node.externalKeyword, node.constKeyword, node.factoryKeywo
rd, _cloneNode(node.returnType), node.period, _cloneNode(node.name), _cloneNode(
node.parameters), node.separator, _cloneNodeList(node.initializers), _cloneNode(
node.redirectedConstructor), _cloneNode(node.body)); | 1048 ConstructorDeclaration visitConstructorDeclaration(ConstructorDeclaration node
) => new ConstructorDeclaration(cloneNode(node.documentationComment), cloneNodeL
ist(node.metadata), node.externalKeyword, node.constKeyword, node.factoryKeyword
, cloneNode(node.returnType), node.period, cloneNode(node.name), cloneNode(node.
parameters), node.separator, cloneNodeList(node.initializers), cloneNode(node.re
directedConstructor), cloneNode(node.body)); |
1026 | 1049 |
1027 @override | 1050 @override |
1028 ConstructorFieldInitializer visitConstructorFieldInitializer(ConstructorFieldI
nitializer node) => new ConstructorFieldInitializer(node.keyword, node.period, _
cloneNode(node.fieldName), node.equals, _cloneNode(node.expression)); | 1051 ConstructorFieldInitializer visitConstructorFieldInitializer(ConstructorFieldI
nitializer node) => new ConstructorFieldInitializer(node.keyword, node.period, c
loneNode(node.fieldName), node.equals, cloneNode(node.expression)); |
1029 | 1052 |
1030 @override | 1053 @override |
1031 ConstructorName visitConstructorName(ConstructorName node) => new ConstructorN
ame(_cloneNode(node.type), node.period, _cloneNode(node.name)); | 1054 ConstructorName visitConstructorName(ConstructorName node) => new ConstructorN
ame(cloneNode(node.type), node.period, cloneNode(node.name)); |
1032 | 1055 |
1033 @override | 1056 @override |
1034 ContinueStatement visitContinueStatement(ContinueStatement node) => new Contin
ueStatement(node.keyword, _cloneNode(node.label), node.semicolon); | 1057 ContinueStatement visitContinueStatement(ContinueStatement node) => new Contin
ueStatement(node.keyword, cloneNode(node.label), node.semicolon); |
1035 | 1058 |
1036 @override | 1059 @override |
1037 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => new Dec
laredIdentifier(_cloneNode(node.documentationComment), _cloneNodeList(node.metad
ata), node.keyword, _cloneNode(node.type), _cloneNode(node.identifier)); | 1060 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => new Dec
laredIdentifier(cloneNode(node.documentationComment), cloneNodeList(node.metadat
a), node.keyword, cloneNode(node.type), cloneNode(node.identifier)); |
1038 | 1061 |
1039 @override | 1062 @override |
1040 DefaultFormalParameter visitDefaultFormalParameter(DefaultFormalParameter node
) => new DefaultFormalParameter(_cloneNode(node.parameter), node.kind, node.sepa
rator, _cloneNode(node.defaultValue)); | 1063 DefaultFormalParameter visitDefaultFormalParameter(DefaultFormalParameter node
) => new DefaultFormalParameter(cloneNode(node.parameter), node.kind, node.separ
ator, cloneNode(node.defaultValue)); |
1041 | 1064 |
1042 @override | 1065 @override |
1043 DoStatement visitDoStatement(DoStatement node) => new DoStatement(node.doKeywo
rd, _cloneNode(node.body), node.whileKeyword, node.leftParenthesis, _cloneNode(n
ode.condition), node.rightParenthesis, node.semicolon); | 1066 DoStatement visitDoStatement(DoStatement node) => new DoStatement(node.doKeywo
rd, cloneNode(node.body), node.whileKeyword, node.leftParenthesis, cloneNode(nod
e.condition), node.rightParenthesis, node.semicolon); |
1044 | 1067 |
1045 @override | 1068 @override |
1046 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) => new DoubleLiteral(node
.literal, node.value); | 1069 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) => new DoubleLiteral(node
.literal, node.value); |
1047 | 1070 |
1048 @override | 1071 @override |
1049 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => new EmptyF
unctionBody(node.semicolon); | 1072 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => new EmptyF
unctionBody(node.semicolon); |
1050 | 1073 |
1051 @override | 1074 @override |
1052 EmptyStatement visitEmptyStatement(EmptyStatement node) => new EmptyStatement(
node.semicolon); | 1075 EmptyStatement visitEmptyStatement(EmptyStatement node) => new EmptyStatement(
node.semicolon); |
1053 | 1076 |
1054 @override | 1077 @override |
1055 ExportDirective visitExportDirective(ExportDirective node) { | 1078 ExportDirective visitExportDirective(ExportDirective node) { |
1056 ExportDirective directive = new ExportDirective(_cloneNode(node.documentatio
nComment), _cloneNodeList(node.metadata), node.keyword, _cloneNode(node.uri), _c
loneNodeList(node.combinators), node.semicolon); | 1079 ExportDirective directive = new ExportDirective(cloneNode(node.documentation
Comment), cloneNodeList(node.metadata), node.keyword, cloneNode(node.uri), clone
NodeList(node.combinators), node.semicolon); |
1057 directive.source = node.source; | 1080 directive.source = node.source; |
1058 directive.uriContent = node.uriContent; | 1081 directive.uriContent = node.uriContent; |
1059 return directive; | 1082 return directive; |
1060 } | 1083 } |
1061 | 1084 |
1062 @override | 1085 @override |
1063 ExpressionFunctionBody visitExpressionFunctionBody(ExpressionFunctionBody node
) => new ExpressionFunctionBody(node.functionDefinition, _cloneNode(node.express
ion), node.semicolon); | 1086 ExpressionFunctionBody visitExpressionFunctionBody(ExpressionFunctionBody node
) => new ExpressionFunctionBody(node.functionDefinition, cloneNode(node.expressi
on), node.semicolon); |
1064 | 1087 |
1065 @override | 1088 @override |
1066 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => new
ExpressionStatement(_cloneNode(node.expression), node.semicolon); | 1089 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => new
ExpressionStatement(cloneNode(node.expression), node.semicolon); |
1067 | 1090 |
1068 @override | 1091 @override |
1069 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause(node
.keyword, _cloneNode(node.superclass)); | 1092 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause(node
.keyword, cloneNode(node.superclass)); |
1070 | 1093 |
1071 @override | 1094 @override |
1072 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => new FieldDecl
aration(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), no
de.staticKeyword, _cloneNode(node.fields), node.semicolon); | 1095 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => new FieldDecl
aration(cloneNode(node.documentationComment), cloneNodeList(node.metadata), node
.staticKeyword, cloneNode(node.fields), node.semicolon); |
1073 | 1096 |
1074 @override | 1097 @override |
1075 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => n
ew FieldFormalParameter(_cloneNode(node.documentationComment), _cloneNodeList(no
de.metadata), node.keyword, _cloneNode(node.type), node.thisToken, node.period,
_cloneNode(node.identifier), _cloneNode(node.parameters)); | 1098 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => n
ew FieldFormalParameter(cloneNode(node.documentationComment), cloneNodeList(node
.metadata), node.keyword, cloneNode(node.type), node.thisToken, node.period, clo
neNode(node.identifier), cloneNode(node.parameters)); |
1076 | 1099 |
1077 @override | 1100 @override |
1078 ForEachStatement visitForEachStatement(ForEachStatement node) { | 1101 ForEachStatement visitForEachStatement(ForEachStatement node) { |
1079 DeclaredIdentifier loopVariable = node.loopVariable; | 1102 DeclaredIdentifier loopVariable = node.loopVariable; |
1080 if (loopVariable == null) { | 1103 if (loopVariable == null) { |
1081 return new ForEachStatement.con2(node.forKeyword, node.leftParenthesis, _c
loneNode(node.identifier), node.inKeyword, _cloneNode(node.iterator), node.right
Parenthesis, _cloneNode(node.body)); | 1104 return new ForEachStatement.con2(node.forKeyword, node.leftParenthesis, cl
oneNode(node.identifier), node.inKeyword, cloneNode(node.iterator), node.rightPa
renthesis, cloneNode(node.body)); |
1082 } | 1105 } |
1083 return new ForEachStatement.con1(node.forKeyword, node.leftParenthesis, _clo
neNode(loopVariable), node.inKeyword, _cloneNode(node.iterator), node.rightParen
thesis, _cloneNode(node.body)); | 1106 return new ForEachStatement.con1(node.forKeyword, node.leftParenthesis, clon
eNode(loopVariable), node.inKeyword, cloneNode(node.iterator), node.rightParenth
esis, cloneNode(node.body)); |
1084 } | 1107 } |
1085 | 1108 |
1086 @override | 1109 @override |
1087 FormalParameterList visitFormalParameterList(FormalParameterList node) => new
FormalParameterList(node.leftParenthesis, _cloneNodeList(node.parameters), node.
leftDelimiter, node.rightDelimiter, node.rightParenthesis); | 1110 FormalParameterList visitFormalParameterList(FormalParameterList node) => new
FormalParameterList(node.leftParenthesis, cloneNodeList(node.parameters), node.l
eftDelimiter, node.rightDelimiter, node.rightParenthesis); |
1088 | 1111 |
1089 @override | 1112 @override |
1090 ForStatement visitForStatement(ForStatement node) => new ForStatement(node.for
Keyword, node.leftParenthesis, _cloneNode(node.variables), _cloneNode(node.initi
alization), node.leftSeparator, _cloneNode(node.condition), node.rightSeparator,
_cloneNodeList(node.updaters), node.rightParenthesis, _cloneNode(node.body)); | 1113 ForStatement visitForStatement(ForStatement node) => new ForStatement(node.for
Keyword, node.leftParenthesis, cloneNode(node.variables), cloneNode(node.initial
ization), node.leftSeparator, cloneNode(node.condition), node.rightSeparator, cl
oneNodeList(node.updaters), node.rightParenthesis, cloneNode(node.body)); |
1091 | 1114 |
1092 @override | 1115 @override |
1093 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => new
FunctionDeclaration(_cloneNode(node.documentationComment), _cloneNodeList(node.m
etadata), node.externalKeyword, _cloneNode(node.returnType), node.propertyKeywor
d, _cloneNode(node.name), _cloneNode(node.functionExpression)); | 1116 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => new
FunctionDeclaration(cloneNode(node.documentationComment), cloneNodeList(node.met
adata), node.externalKeyword, cloneNode(node.returnType), node.propertyKeyword,
cloneNode(node.name), cloneNode(node.functionExpression)); |
1094 | 1117 |
1095 @override | 1118 @override |
1096 FunctionDeclarationStatement visitFunctionDeclarationStatement(FunctionDeclara
tionStatement node) => new FunctionDeclarationStatement(_cloneNode(node.function
Declaration)); | 1119 FunctionDeclarationStatement visitFunctionDeclarationStatement(FunctionDeclara
tionStatement node) => new FunctionDeclarationStatement(cloneNode(node.functionD
eclaration)); |
1097 | 1120 |
1098 @override | 1121 @override |
1099 FunctionExpression visitFunctionExpression(FunctionExpression node) => new Fun
ctionExpression(_cloneNode(node.parameters), _cloneNode(node.body)); | 1122 FunctionExpression visitFunctionExpression(FunctionExpression node) => new Fun
ctionExpression(cloneNode(node.parameters), cloneNode(node.body)); |
1100 | 1123 |
1101 @override | 1124 @override |
1102 FunctionExpressionInvocation visitFunctionExpressionInvocation(FunctionExpress
ionInvocation node) => new FunctionExpressionInvocation(_cloneNode(node.function
), _cloneNode(node.argumentList)); | 1125 FunctionExpressionInvocation visitFunctionExpressionInvocation(FunctionExpress
ionInvocation node) => new FunctionExpressionInvocation(cloneNode(node.function)
, cloneNode(node.argumentList)); |
1103 | 1126 |
1104 @override | 1127 @override |
1105 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => new Functi
onTypeAlias(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata)
, node.keyword, _cloneNode(node.returnType), _cloneNode(node.name), _cloneNode(n
ode.typeParameters), _cloneNode(node.parameters), node.semicolon); | 1128 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => new Functi
onTypeAlias(cloneNode(node.documentationComment), cloneNodeList(node.metadata),
node.keyword, cloneNode(node.returnType), cloneNode(node.name), cloneNode(node.t
ypeParameters), cloneNode(node.parameters), node.semicolon); |
1106 | 1129 |
1107 @override | 1130 @override |
1108 FunctionTypedFormalParameter visitFunctionTypedFormalParameter(FunctionTypedFo
rmalParameter node) => new FunctionTypedFormalParameter(_cloneNode(node.document
ationComment), _cloneNodeList(node.metadata), _cloneNode(node.returnType), _clon
eNode(node.identifier), _cloneNode(node.parameters)); | 1131 FunctionTypedFormalParameter visitFunctionTypedFormalParameter(FunctionTypedFo
rmalParameter node) => new FunctionTypedFormalParameter(cloneNode(node.documenta
tionComment), cloneNodeList(node.metadata), cloneNode(node.returnType), cloneNod
e(node.identifier), cloneNode(node.parameters)); |
1109 | 1132 |
1110 @override | 1133 @override |
1111 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator(
node.keyword, _cloneNodeList(node.hiddenNames)); | 1134 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator(
node.keyword, cloneNodeList(node.hiddenNames)); |
1112 | 1135 |
1113 @override | 1136 @override |
1114 IfStatement visitIfStatement(IfStatement node) => new IfStatement(node.ifKeywo
rd, node.leftParenthesis, _cloneNode(node.condition), node.rightParenthesis, _cl
oneNode(node.thenStatement), node.elseKeyword, _cloneNode(node.elseStatement)); | 1137 IfStatement visitIfStatement(IfStatement node) => new IfStatement(node.ifKeywo
rd, node.leftParenthesis, cloneNode(node.condition), node.rightParenthesis, clon
eNode(node.thenStatement), node.elseKeyword, cloneNode(node.elseStatement)); |
1115 | 1138 |
1116 @override | 1139 @override |
1117 ImplementsClause visitImplementsClause(ImplementsClause node) => new Implement
sClause(node.keyword, _cloneNodeList(node.interfaces)); | 1140 ImplementsClause visitImplementsClause(ImplementsClause node) => new Implement
sClause(node.keyword, cloneNodeList(node.interfaces)); |
1118 | 1141 |
1119 @override | 1142 @override |
1120 ImportDirective visitImportDirective(ImportDirective node) { | 1143 ImportDirective visitImportDirective(ImportDirective node) { |
1121 ImportDirective directive = new ImportDirective(_cloneNode(node.documentatio
nComment), _cloneNodeList(node.metadata), node.keyword, _cloneNode(node.uri), no
de.deferredToken, node.asToken, _cloneNode(node.prefix), _cloneNodeList(node.com
binators), node.semicolon); | 1144 ImportDirective directive = new ImportDirective(cloneNode(node.documentation
Comment), cloneNodeList(node.metadata), node.keyword, cloneNode(node.uri), node.
deferredToken, node.asToken, cloneNode(node.prefix), cloneNodeList(node.combinat
ors), node.semicolon); |
1122 directive.source = node.source; | 1145 directive.source = node.source; |
1123 directive.uriContent = node.uriContent; | 1146 directive.uriContent = node.uriContent; |
1124 return directive; | 1147 return directive; |
1125 } | 1148 } |
1126 | 1149 |
1127 @override | 1150 @override |
1128 IndexExpression visitIndexExpression(IndexExpression node) { | 1151 IndexExpression visitIndexExpression(IndexExpression node) { |
1129 Token period = node.period; | 1152 Token period = node.period; |
1130 if (period == null) { | 1153 if (period == null) { |
1131 return new IndexExpression.forTarget(_cloneNode(node.target), node.leftBra
cket, _cloneNode(node.index), node.rightBracket); | 1154 return new IndexExpression.forTarget(cloneNode(node.target), node.leftBrac
ket, cloneNode(node.index), node.rightBracket); |
1132 } else { | 1155 } else { |
1133 return new IndexExpression.forCascade(period, node.leftBracket, _cloneNode
(node.index), node.rightBracket); | 1156 return new IndexExpression.forCascade(period, node.leftBracket, cloneNode(
node.index), node.rightBracket); |
1134 } | 1157 } |
1135 } | 1158 } |
1136 | 1159 |
1137 @override | 1160 @override |
1138 InstanceCreationExpression visitInstanceCreationExpression(InstanceCreationExp
ression node) => new InstanceCreationExpression(node.keyword, _cloneNode(node.co
nstructorName), _cloneNode(node.argumentList)); | 1161 InstanceCreationExpression visitInstanceCreationExpression(InstanceCreationExp
ression node) => new InstanceCreationExpression(node.keyword, cloneNode(node.con
structorName), cloneNode(node.argumentList)); |
1139 | 1162 |
1140 @override | 1163 @override |
1141 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) => new IntegerLiteral(
node.literal, node.value); | 1164 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) => new IntegerLiteral(
node.literal, node.value); |
1142 | 1165 |
1143 @override | 1166 @override |
1144 InterpolationExpression visitInterpolationExpression(InterpolationExpression n
ode) => new InterpolationExpression(node.leftBracket, _cloneNode(node.expression
), node.rightBracket); | 1167 InterpolationExpression visitInterpolationExpression(InterpolationExpression n
ode) => new InterpolationExpression(node.leftBracket, cloneNode(node.expression)
, node.rightBracket); |
1145 | 1168 |
1146 @override | 1169 @override |
1147 InterpolationString visitInterpolationString(InterpolationString node) => new
InterpolationString(node.contents, node.value); | 1170 InterpolationString visitInterpolationString(InterpolationString node) => new
InterpolationString(node.contents, node.value); |
1148 | 1171 |
1149 @override | 1172 @override |
1150 IsExpression visitIsExpression(IsExpression node) => new IsExpression(_cloneNo
de(node.expression), node.isOperator, node.notOperator, _cloneNode(node.type)); | 1173 IsExpression visitIsExpression(IsExpression node) => new IsExpression(cloneNod
e(node.expression), node.isOperator, node.notOperator, cloneNode(node.type)); |
1151 | 1174 |
1152 @override | 1175 @override |
1153 Label visitLabel(Label node) => new Label(_cloneNode(node.label), node.colon); | 1176 Label visitLabel(Label node) => new Label(cloneNode(node.label), node.colon); |
1154 | 1177 |
1155 @override | 1178 @override |
1156 LabeledStatement visitLabeledStatement(LabeledStatement node) => new LabeledSt
atement(_cloneNodeList(node.labels), _cloneNode(node.statement)); | 1179 LabeledStatement visitLabeledStatement(LabeledStatement node) => new LabeledSt
atement(cloneNodeList(node.labels), cloneNode(node.statement)); |
1157 | 1180 |
1158 @override | 1181 @override |
1159 LibraryDirective visitLibraryDirective(LibraryDirective node) => new LibraryDi
rective(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), no
de.libraryToken, _cloneNode(node.name), node.semicolon); | 1182 LibraryDirective visitLibraryDirective(LibraryDirective node) => new LibraryDi
rective(cloneNode(node.documentationComment), cloneNodeList(node.metadata), node
.libraryToken, cloneNode(node.name), node.semicolon); |
1160 | 1183 |
1161 @override | 1184 @override |
1162 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) => new Librar
yIdentifier(_cloneNodeList(node.components)); | 1185 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) => new Librar
yIdentifier(cloneNodeList(node.components)); |
1163 | 1186 |
1164 @override | 1187 @override |
1165 ListLiteral visitListLiteral(ListLiteral node) => new ListLiteral(node.constKe
yword, _cloneNode(node.typeArguments), node.leftBracket, _cloneNodeList(node.ele
ments), node.rightBracket); | 1188 ListLiteral visitListLiteral(ListLiteral node) => new ListLiteral(node.constKe
yword, cloneNode(node.typeArguments), node.leftBracket, cloneNodeList(node.eleme
nts), node.rightBracket); |
1166 | 1189 |
1167 @override | 1190 @override |
1168 MapLiteral visitMapLiteral(MapLiteral node) => new MapLiteral(node.constKeywor
d, _cloneNode(node.typeArguments), node.leftBracket, _cloneNodeList(node.entries
), node.rightBracket); | 1191 MapLiteral visitMapLiteral(MapLiteral node) => new MapLiteral(node.constKeywor
d, cloneNode(node.typeArguments), node.leftBracket, cloneNodeList(node.entries),
node.rightBracket); |
1169 | 1192 |
1170 @override | 1193 @override |
1171 MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) => new MapLiteralEn
try(_cloneNode(node.key), node.separator, _cloneNode(node.value)); | 1194 MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) => new MapLiteralEn
try(cloneNode(node.key), node.separator, cloneNode(node.value)); |
1172 | 1195 |
1173 @override | 1196 @override |
1174 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => new Method
Declaration(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata)
, node.externalKeyword, node.modifierKeyword, _cloneNode(node.returnType), node.
propertyKeyword, node.operatorKeyword, _cloneNode(node.name), _cloneNode(node.pa
rameters), _cloneNode(node.body)); | 1197 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => new Method
Declaration(cloneNode(node.documentationComment), cloneNodeList(node.metadata),
node.externalKeyword, node.modifierKeyword, cloneNode(node.returnType), node.pro
pertyKeyword, node.operatorKeyword, cloneNode(node.name), cloneNode(node.paramet
ers), cloneNode(node.body)); |
1175 | 1198 |
1176 @override | 1199 @override |
1177 MethodInvocation visitMethodInvocation(MethodInvocation node) => new MethodInv
ocation(_cloneNode(node.target), node.period, _cloneNode(node.methodName), _clon
eNode(node.argumentList)); | 1200 MethodInvocation visitMethodInvocation(MethodInvocation node) => new MethodInv
ocation(cloneNode(node.target), node.period, cloneNode(node.methodName), cloneNo
de(node.argumentList)); |
1178 | 1201 |
1179 @override | 1202 @override |
1180 NamedExpression visitNamedExpression(NamedExpression node) => new NamedExpress
ion(_cloneNode(node.name), _cloneNode(node.expression)); | 1203 NamedExpression visitNamedExpression(NamedExpression node) => new NamedExpress
ion(cloneNode(node.name), cloneNode(node.expression)); |
1181 | 1204 |
1182 @override | 1205 @override |
1183 AstNode visitNativeClause(NativeClause node) => new NativeClause(node.keyword,
_cloneNode(node.name)); | 1206 AstNode visitNativeClause(NativeClause node) => new NativeClause(node.keyword,
cloneNode(node.name)); |
1184 | 1207 |
1185 @override | 1208 @override |
1186 NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) => new Nat
iveFunctionBody(node.nativeToken, _cloneNode(node.stringLiteral), node.semicolon
); | 1209 NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) => new Nat
iveFunctionBody(node.nativeToken, cloneNode(node.stringLiteral), node.semicolon)
; |
1187 | 1210 |
1188 @override | 1211 @override |
1189 NullLiteral visitNullLiteral(NullLiteral node) => new NullLiteral(node.literal
); | 1212 NullLiteral visitNullLiteral(NullLiteral node) => new NullLiteral(node.literal
); |
1190 | 1213 |
1191 @override | 1214 @override |
1192 ParenthesizedExpression visitParenthesizedExpression(ParenthesizedExpression n
ode) => new ParenthesizedExpression(node.leftParenthesis, _cloneNode(node.expres
sion), node.rightParenthesis); | 1215 ParenthesizedExpression visitParenthesizedExpression(ParenthesizedExpression n
ode) => new ParenthesizedExpression(node.leftParenthesis, cloneNode(node.express
ion), node.rightParenthesis); |
1193 | 1216 |
1194 @override | 1217 @override |
1195 PartDirective visitPartDirective(PartDirective node) { | 1218 PartDirective visitPartDirective(PartDirective node) { |
1196 PartDirective directive = new PartDirective(_cloneNode(node.documentationCom
ment), _cloneNodeList(node.metadata), node.partToken, _cloneNode(node.uri), node
.semicolon); | 1219 PartDirective directive = new PartDirective(cloneNode(node.documentationComm
ent), cloneNodeList(node.metadata), node.partToken, cloneNode(node.uri), node.se
micolon); |
1197 directive.source = node.source; | 1220 directive.source = node.source; |
1198 directive.uriContent = node.uriContent; | 1221 directive.uriContent = node.uriContent; |
1199 return directive; | 1222 return directive; |
1200 } | 1223 } |
1201 | 1224 |
1202 @override | 1225 @override |
1203 PartOfDirective visitPartOfDirective(PartOfDirective node) => new PartOfDirect
ive(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), node.p
artToken, node.ofToken, _cloneNode(node.libraryName), node.semicolon); | 1226 PartOfDirective visitPartOfDirective(PartOfDirective node) => new PartOfDirect
ive(cloneNode(node.documentationComment), cloneNodeList(node.metadata), node.par
tToken, node.ofToken, cloneNode(node.libraryName), node.semicolon); |
1204 | 1227 |
1205 @override | 1228 @override |
1206 PostfixExpression visitPostfixExpression(PostfixExpression node) => new Postfi
xExpression(_cloneNode(node.operand), node.operator); | 1229 PostfixExpression visitPostfixExpression(PostfixExpression node) => new Postfi
xExpression(cloneNode(node.operand), node.operator); |
1207 | 1230 |
1208 @override | 1231 @override |
1209 PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) => new Pre
fixedIdentifier(_cloneNode(node.prefix), node.period, _cloneNode(node.identifier
)); | 1232 PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) => new Pre
fixedIdentifier(cloneNode(node.prefix), node.period, cloneNode(node.identifier))
; |
1210 | 1233 |
1211 @override | 1234 @override |
1212 PrefixExpression visitPrefixExpression(PrefixExpression node) => new PrefixExp
ression(node.operator, _cloneNode(node.operand)); | 1235 PrefixExpression visitPrefixExpression(PrefixExpression node) => new PrefixExp
ression(node.operator, cloneNode(node.operand)); |
1213 | 1236 |
1214 @override | 1237 @override |
1215 PropertyAccess visitPropertyAccess(PropertyAccess node) => new PropertyAccess(
_cloneNode(node.target), node.operator, _cloneNode(node.propertyName)); | 1238 PropertyAccess visitPropertyAccess(PropertyAccess node) => new PropertyAccess(
cloneNode(node.target), node.operator, cloneNode(node.propertyName)); |
1216 | 1239 |
1217 @override | 1240 @override |
1218 RedirectingConstructorInvocation visitRedirectingConstructorInvocation(Redirec
tingConstructorInvocation node) => new RedirectingConstructorInvocation(node.key
word, node.period, _cloneNode(node.constructorName), _cloneNode(node.argumentLis
t)); | 1241 RedirectingConstructorInvocation visitRedirectingConstructorInvocation(Redirec
tingConstructorInvocation node) => new RedirectingConstructorInvocation(node.key
word, node.period, cloneNode(node.constructorName), cloneNode(node.argumentList)
); |
1219 | 1242 |
1220 @override | 1243 @override |
1221 RethrowExpression visitRethrowExpression(RethrowExpression node) => new Rethro
wExpression(node.keyword); | 1244 RethrowExpression visitRethrowExpression(RethrowExpression node) => new Rethro
wExpression(node.keyword); |
1222 | 1245 |
1223 @override | 1246 @override |
1224 ReturnStatement visitReturnStatement(ReturnStatement node) => new ReturnStatem
ent(node.keyword, _cloneNode(node.expression), node.semicolon); | 1247 ReturnStatement visitReturnStatement(ReturnStatement node) => new ReturnStatem
ent(node.keyword, cloneNode(node.expression), node.semicolon); |
1225 | 1248 |
1226 @override | 1249 @override |
1227 ScriptTag visitScriptTag(ScriptTag node) => new ScriptTag(node.scriptTag); | 1250 ScriptTag visitScriptTag(ScriptTag node) => new ScriptTag(node.scriptTag); |
1228 | 1251 |
1229 @override | 1252 @override |
1230 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator(
node.keyword, _cloneNodeList(node.shownNames)); | 1253 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator(
node.keyword, cloneNodeList(node.shownNames)); |
1231 | 1254 |
1232 @override | 1255 @override |
1233 SimpleFormalParameter visitSimpleFormalParameter(SimpleFormalParameter node) =
> new SimpleFormalParameter(_cloneNode(node.documentationComment), _cloneNodeLis
t(node.metadata), node.keyword, _cloneNode(node.type), _cloneNode(node.identifie
r)); | 1256 SimpleFormalParameter visitSimpleFormalParameter(SimpleFormalParameter node) =
> new SimpleFormalParameter(cloneNode(node.documentationComment), cloneNodeList(
node.metadata), node.keyword, cloneNode(node.type), cloneNode(node.identifier)); |
1234 | 1257 |
1235 @override | 1258 @override |
1236 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) => new SimpleIde
ntifier(node.token); | 1259 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) => new SimpleIde
ntifier(node.token); |
1237 | 1260 |
1238 @override | 1261 @override |
1239 SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) => new
SimpleStringLiteral(node.literal, node.value); | 1262 SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) => new
SimpleStringLiteral(node.literal, node.value); |
1240 | 1263 |
1241 @override | 1264 @override |
1242 StringInterpolation visitStringInterpolation(StringInterpolation node) => new
StringInterpolation(_cloneNodeList(node.elements)); | 1265 StringInterpolation visitStringInterpolation(StringInterpolation node) => new
StringInterpolation(cloneNodeList(node.elements)); |
1243 | 1266 |
1244 @override | 1267 @override |
1245 SuperConstructorInvocation visitSuperConstructorInvocation(SuperConstructorInv
ocation node) => new SuperConstructorInvocation(node.keyword, node.period, _clon
eNode(node.constructorName), _cloneNode(node.argumentList)); | 1268 SuperConstructorInvocation visitSuperConstructorInvocation(SuperConstructorInv
ocation node) => new SuperConstructorInvocation(node.keyword, node.period, clone
Node(node.constructorName), cloneNode(node.argumentList)); |
1246 | 1269 |
1247 @override | 1270 @override |
1248 SuperExpression visitSuperExpression(SuperExpression node) => new SuperExpress
ion(node.keyword); | 1271 SuperExpression visitSuperExpression(SuperExpression node) => new SuperExpress
ion(node.keyword); |
1249 | 1272 |
1250 @override | 1273 @override |
1251 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase(_cloneNodeList(n
ode.labels), node.keyword, _cloneNode(node.expression), node.colon, _cloneNodeLi
st(node.statements)); | 1274 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase(cloneNodeList(no
de.labels), node.keyword, cloneNode(node.expression), node.colon, cloneNodeList(
node.statements)); |
1252 | 1275 |
1253 @override | 1276 @override |
1254 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault(_clo
neNodeList(node.labels), node.keyword, node.colon, _cloneNodeList(node.statement
s)); | 1277 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault(clon
eNodeList(node.labels), node.keyword, node.colon, cloneNodeList(node.statements)
); |
1255 | 1278 |
1256 @override | 1279 @override |
1257 SwitchStatement visitSwitchStatement(SwitchStatement node) => new SwitchStatem
ent(node.keyword, node.leftParenthesis, _cloneNode(node.expression), node.rightP
arenthesis, node.leftBracket, _cloneNodeList(node.members), node.rightBracket); | 1280 SwitchStatement visitSwitchStatement(SwitchStatement node) => new SwitchStatem
ent(node.keyword, node.leftParenthesis, cloneNode(node.expression), node.rightPa
renthesis, node.leftBracket, cloneNodeList(node.members), node.rightBracket); |
1258 | 1281 |
1259 @override | 1282 @override |
1260 SymbolLiteral visitSymbolLiteral(SymbolLiteral node) => new SymbolLiteral(node
.poundSign, node.components); | 1283 SymbolLiteral visitSymbolLiteral(SymbolLiteral node) => new SymbolLiteral(node
.poundSign, node.components); |
1261 | 1284 |
1262 @override | 1285 @override |
1263 ThisExpression visitThisExpression(ThisExpression node) => new ThisExpression(
node.keyword); | 1286 ThisExpression visitThisExpression(ThisExpression node) => new ThisExpression(
node.keyword); |
1264 | 1287 |
1265 @override | 1288 @override |
1266 ThrowExpression visitThrowExpression(ThrowExpression node) => new ThrowExpress
ion(node.keyword, _cloneNode(node.expression)); | 1289 ThrowExpression visitThrowExpression(ThrowExpression node) => new ThrowExpress
ion(node.keyword, cloneNode(node.expression)); |
1267 | 1290 |
1268 @override | 1291 @override |
1269 TopLevelVariableDeclaration visitTopLevelVariableDeclaration(TopLevelVariableD
eclaration node) => new TopLevelVariableDeclaration(_cloneNode(node.documentatio
nComment), _cloneNodeList(node.metadata), _cloneNode(node.variables), node.semic
olon); | 1292 TopLevelVariableDeclaration visitTopLevelVariableDeclaration(TopLevelVariableD
eclaration node) => new TopLevelVariableDeclaration(cloneNode(node.documentation
Comment), cloneNodeList(node.metadata), cloneNode(node.variables), node.semicolo
n); |
1270 | 1293 |
1271 @override | 1294 @override |
1272 TryStatement visitTryStatement(TryStatement node) => new TryStatement(node.try
Keyword, _cloneNode(node.body), _cloneNodeList(node.catchClauses), node.finallyK
eyword, _cloneNode(node.finallyBlock)); | 1295 TryStatement visitTryStatement(TryStatement node) => new TryStatement(node.try
Keyword, cloneNode(node.body), cloneNodeList(node.catchClauses), node.finallyKey
word, cloneNode(node.finallyBlock)); |
1273 | 1296 |
1274 @override | 1297 @override |
1275 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => new TypeArgum
entList(node.leftBracket, _cloneNodeList(node.arguments), node.rightBracket); | 1298 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => new TypeArgum
entList(node.leftBracket, cloneNodeList(node.arguments), node.rightBracket); |
1276 | 1299 |
1277 @override | 1300 @override |
1278 TypeName visitTypeName(TypeName node) => new TypeName(_cloneNode(node.name), _
cloneNode(node.typeArguments)); | 1301 TypeName visitTypeName(TypeName node) => new TypeName(cloneNode(node.name), cl
oneNode(node.typeArguments)); |
1279 | 1302 |
1280 @override | 1303 @override |
1281 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter(_clo
neNode(node.documentationComment), _cloneNodeList(node.metadata), _cloneNode(nod
e.name), node.keyword, _cloneNode(node.bound)); | 1304 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter(clon
eNode(node.documentationComment), cloneNodeList(node.metadata), cloneNode(node.n
ame), node.keyword, cloneNode(node.bound)); |
1282 | 1305 |
1283 @override | 1306 @override |
1284 TypeParameterList visitTypeParameterList(TypeParameterList node) => new TypePa
rameterList(node.leftBracket, _cloneNodeList(node.typeParameters), node.rightBra
cket); | 1307 TypeParameterList visitTypeParameterList(TypeParameterList node) => new TypePa
rameterList(node.leftBracket, cloneNodeList(node.typeParameters), node.rightBrac
ket); |
1285 | 1308 |
1286 @override | 1309 @override |
1287 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => new
VariableDeclaration(null, _cloneNodeList(node.metadata), _cloneNode(node.name),
node.equals, _cloneNode(node.initializer)); | 1310 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => new
VariableDeclaration(null, cloneNodeList(node.metadata), cloneNode(node.name), no
de.equals, cloneNode(node.initializer)); |
1288 | 1311 |
1289 @override | 1312 @override |
1290 VariableDeclarationList visitVariableDeclarationList(VariableDeclarationList n
ode) => new VariableDeclarationList(null, _cloneNodeList(node.metadata), node.ke
yword, _cloneNode(node.type), _cloneNodeList(node.variables)); | 1313 VariableDeclarationList visitVariableDeclarationList(VariableDeclarationList n
ode) => new VariableDeclarationList(null, cloneNodeList(node.metadata), node.key
word, cloneNode(node.type), cloneNodeList(node.variables)); |
1291 | 1314 |
1292 @override | 1315 @override |
1293 VariableDeclarationStatement visitVariableDeclarationStatement(VariableDeclara
tionStatement node) => new VariableDeclarationStatement(_cloneNode(node.variable
s), node.semicolon); | 1316 VariableDeclarationStatement visitVariableDeclarationStatement(VariableDeclara
tionStatement node) => new VariableDeclarationStatement(cloneNode(node.variables
), node.semicolon); |
1294 | 1317 |
1295 @override | 1318 @override |
1296 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement(
node.keyword, node.leftParenthesis, _cloneNode(node.condition), node.rightParent
hesis, _cloneNode(node.body)); | 1319 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement(
node.keyword, node.leftParenthesis, cloneNode(node.condition), node.rightParenth
esis, cloneNode(node.body)); |
1297 | 1320 |
1298 @override | 1321 @override |
1299 WithClause visitWithClause(WithClause node) => new WithClause(node.withKeyword
, _cloneNodeList(node.mixinTypes)); | 1322 WithClause visitWithClause(WithClause node) => new WithClause(node.withKeyword
, cloneNodeList(node.mixinTypes)); |
1300 | 1323 |
1301 AstNode _cloneNode(AstNode node) { | 1324 AstNode cloneNode(AstNode node) { |
1302 if (node == null) { | 1325 if (node == null) { |
1303 return null; | 1326 return null; |
1304 } | 1327 } |
1305 return node.accept(this) as AstNode; | 1328 return node.accept(this) as AstNode; |
1306 } | 1329 } |
1307 | |
1308 List _cloneNodeList(NodeList nodes) { | |
1309 int count = nodes.length; | |
1310 List clonedNodes = new List(); | |
1311 for (int i = 0; i < count; i++) { | |
1312 clonedNodes.add((nodes[i]).accept(this) as AstNode); | |
1313 } | |
1314 return clonedNodes; | |
1315 } | |
1316 } | 1330 } |
1317 | 1331 |
1318 /** | 1332 /** |
1319 * Instances of the class `AstComparator` compare the structure of two ASTNodes
to see whether | 1333 * Instances of the class `AstComparator` compare the structure of two ASTNodes
to see whether |
1320 * they are equal. | 1334 * they are equal. |
1321 */ | 1335 */ |
1322 class AstComparator implements AstVisitor<bool> { | 1336 class AstComparator implements AstVisitor<bool> { |
1323 /** | 1337 /** |
1324 * Return `true` if the two AST nodes are equal. | 1338 * Return `true` if the two AST nodes are equal. |
1325 * | 1339 * |
(...skipping 8340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9666 */ | 9680 */ |
9667 ArgumentList _argumentList; | 9681 ArgumentList _argumentList; |
9668 | 9682 |
9669 /** | 9683 /** |
9670 * The element associated with the constructor based on static type informatio
n, or `null` | 9684 * The element associated with the constructor based on static type informatio
n, or `null` |
9671 * if the AST structure has not been resolved or if the constructor could not
be resolved. | 9685 * if the AST structure has not been resolved or if the constructor could not
be resolved. |
9672 */ | 9686 */ |
9673 ConstructorElement staticElement; | 9687 ConstructorElement staticElement; |
9674 | 9688 |
9675 /** | 9689 /** |
| 9690 * The result of evaluating this expression, if it is constant. |
| 9691 */ |
| 9692 EvaluationResultImpl _result; |
| 9693 |
| 9694 /** |
9676 * Initialize a newly created instance creation expression. | 9695 * Initialize a newly created instance creation expression. |
9677 * | 9696 * |
9678 * @param keyword the keyword used to indicate how an object should be created | 9697 * @param keyword the keyword used to indicate how an object should be created |
9679 * @param constructorName the name of the constructor to be invoked | 9698 * @param constructorName the name of the constructor to be invoked |
9680 * @param argumentList the list of arguments to the constructor | 9699 * @param argumentList the list of arguments to the constructor |
9681 */ | 9700 */ |
9682 InstanceCreationExpression(this.keyword, ConstructorName constructorName, Argu
mentList argumentList) { | 9701 InstanceCreationExpression(this.keyword, ConstructorName constructorName, Argu
mentList argumentList) { |
9683 this.constructorName = becomeParentOf(constructorName); | 9702 this.constructorName = becomeParentOf(constructorName); |
9684 this._argumentList = becomeParentOf(argumentList); | 9703 this._argumentList = becomeParentOf(argumentList); |
9685 } | 9704 } |
9686 | 9705 |
9687 @override | 9706 @override |
9688 accept(AstVisitor visitor) => visitor.visitInstanceCreationExpression(this); | 9707 accept(AstVisitor visitor) => visitor.visitInstanceCreationExpression(this); |
9689 | 9708 |
9690 /** | 9709 /** |
9691 * Return the list of arguments to the constructor. | 9710 * Return the list of arguments to the constructor. |
9692 * | 9711 * |
9693 * @return the list of arguments to the constructor | 9712 * @return the list of arguments to the constructor |
9694 */ | 9713 */ |
9695 ArgumentList get argumentList => _argumentList; | 9714 ArgumentList get argumentList => _argumentList; |
9696 | 9715 |
9697 @override | 9716 @override |
9698 Token get beginToken => keyword; | 9717 Token get beginToken => keyword; |
9699 | 9718 |
9700 @override | 9719 @override |
9701 Token get endToken => _argumentList.endToken; | 9720 Token get endToken => _argumentList.endToken; |
9702 | 9721 |
| 9722 /** |
| 9723 * Return the result of evaluating this constant as a compile-time constant ex
pression, or |
| 9724 * `null` if this variable is not a 'const' expression or an error prevented t
he result from |
| 9725 * being computed. |
| 9726 * |
| 9727 * @return the result of evaluating this constant |
| 9728 */ |
| 9729 EvaluationResultImpl get evaluationResult => _result; |
| 9730 |
9703 @override | 9731 @override |
9704 int get precedence => 15; | 9732 int get precedence => 15; |
9705 | 9733 |
9706 /** | 9734 /** |
9707 * Return `true` if this creation expression is used to invoke a constant cons
tructor. | 9735 * Return `true` if this creation expression is used to invoke a constant cons
tructor. |
9708 * | 9736 * |
9709 * @return `true` if this creation expression is used to invoke a constant con
structor | 9737 * @return `true` if this creation expression is used to invoke a constant con
structor |
9710 */ | 9738 */ |
9711 bool get isConst => keyword is KeywordToken && (keyword as KeywordToken).keywo
rd == Keyword.CONST; | 9739 bool get isConst => keyword is KeywordToken && (keyword as KeywordToken).keywo
rd == Keyword.CONST; |
9712 | 9740 |
9713 /** | 9741 /** |
9714 * Set the list of arguments to the constructor to the given list. | 9742 * Set the list of arguments to the constructor to the given list. |
9715 * | 9743 * |
9716 * @param argumentList the list of arguments to the constructor | 9744 * @param argumentList the list of arguments to the constructor |
9717 */ | 9745 */ |
9718 void set argumentList(ArgumentList argumentList) { | 9746 void set argumentList(ArgumentList argumentList) { |
9719 this._argumentList = becomeParentOf(argumentList); | 9747 this._argumentList = becomeParentOf(argumentList); |
9720 } | 9748 } |
9721 | 9749 |
| 9750 /** |
| 9751 * Set the result of evaluating this expression as a compile-time constant exp
ression to the given |
| 9752 * result. |
| 9753 * |
| 9754 * @param result the result of evaluating this expression |
| 9755 */ |
| 9756 void set evaluationResult(EvaluationResultImpl result) { |
| 9757 this._result = result; |
| 9758 } |
| 9759 |
9722 @override | 9760 @override |
9723 void visitChildren(AstVisitor visitor) { | 9761 void visitChildren(AstVisitor visitor) { |
9724 safelyVisitChild(constructorName, visitor); | 9762 safelyVisitChild(constructorName, visitor); |
9725 safelyVisitChild(_argumentList, visitor); | 9763 safelyVisitChild(_argumentList, visitor); |
9726 } | 9764 } |
9727 } | 9765 } |
9728 | 9766 |
9729 /** | 9767 /** |
9730 * Instances of the class `IntegerLiteral` represent an integer literal expressi
on. | 9768 * Instances of the class `IntegerLiteral` represent an integer literal expressi
on. |
9731 * | 9769 * |
(...skipping 7932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17664 _elements[index] = node; | 17702 _elements[index] = node; |
17665 } | 17703 } |
17666 void clear() { | 17704 void clear() { |
17667 _elements = <E> []; | 17705 _elements = <E> []; |
17668 } | 17706 } |
17669 int get length => _elements.length; | 17707 int get length => _elements.length; |
17670 void set length(int value) { | 17708 void set length(int value) { |
17671 throw new UnsupportedError("Cannot resize NodeList."); | 17709 throw new UnsupportedError("Cannot resize NodeList."); |
17672 } | 17710 } |
17673 } | 17711 } |
OLD | NEW |