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

Unified Diff: pkg/compiler/lib/src/resolution/semantic_visitor_mixins.dart

Issue 1142293004: Revert "Refactor handling of compounds." (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 months 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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/resolution/semantic_visitor_mixins.dart
diff --git a/pkg/compiler/lib/src/resolution/semantic_visitor_mixins.dart b/pkg/compiler/lib/src/resolution/semantic_visitor_mixins.dart
index c58142f53b00364f2a676c0eae1547d2420368b2..0a4a9e48d455a2f5a621d6b843753945e66bc5bd 100644
--- a/pkg/compiler/lib/src/resolution/semantic_visitor_mixins.dart
+++ b/pkg/compiler/lib/src/resolution/semantic_visitor_mixins.dart
@@ -33,6 +33,34 @@ abstract class ErrorBulkMixin<R, A>
}
@override
+ R errorClassTypeLiteralCompound(
+ Send node,
+ ConstantExpression constant,
+ AssignmentOperator operator,
+ Node rhs,
+ A arg) {
+ return bulkHandleError(node, arg);
+ }
+
+ @override
+ R errorClassTypeLiteralPostfix(
+ Send node,
+ ConstantExpression constant,
+ IncDecOperator operator,
+ A arg) {
+ return bulkHandleError(node, arg);
+ }
+
+ @override
+ R errorClassTypeLiteralPrefix(
+ Send node,
+ ConstantExpression constant,
+ IncDecOperator operator,
+ A arg) {
+ return bulkHandleError(node, arg);
+ }
+
+ @override
R errorClassTypeLiteralSet(
SendSet node,
ConstantExpression constant,
@@ -42,6 +70,34 @@ abstract class ErrorBulkMixin<R, A>
}
@override
+ R errorDynamicTypeLiteralCompound(
+ Send node,
+ ConstantExpression constant,
+ AssignmentOperator operator,
+ Node rhs,
+ A arg) {
+ return bulkHandleError(node, arg);
+ }
+
+ @override
+ R errorDynamicTypeLiteralPostfix(
+ Send node,
+ ConstantExpression constant,
+ IncDecOperator operator,
+ A arg) {
+ return bulkHandleError(node, arg);
+ }
+
+ @override
+ R errorDynamicTypeLiteralPrefix(
+ Send node,
+ ConstantExpression constant,
+ IncDecOperator operator,
+ A arg) {
+ return bulkHandleError(node, arg);
+ }
+
+ @override
R errorDynamicTypeLiteralSet(
SendSet node,
ConstantExpression constant,
@@ -51,6 +107,17 @@ abstract class ErrorBulkMixin<R, A>
}
@override
+ R errorFinalLocalVariableCompound(
+ Send node,
+ LocalVariableElement
+ variable,
+ AssignmentOperator operator,
+ Node rhs,
+ A arg) {
+ return bulkHandleError(node, arg);
+ }
+
+ @override
R errorFinalLocalVariableSet(
SendSet node,
LocalVariableElement variable,
@@ -60,6 +127,16 @@ abstract class ErrorBulkMixin<R, A>
}
@override
+ R errorFinalParameterCompound(
+ Send node,
+ ParameterElement parameter,
+ AssignmentOperator operator,
+ Node rhs,
+ A arg) {
+ return bulkHandleError(node, arg);
+ }
+
+ @override
R errorFinalParameterSet(
SendSet node,
ParameterElement parameter,
@@ -69,6 +146,16 @@ abstract class ErrorBulkMixin<R, A>
}
@override
+ R errorFinalStaticFieldCompound(
+ Send node,
+ FieldElement field,
+ AssignmentOperator operator,
+ Node rhs,
+ A arg) {
+ return bulkHandleError(node, arg);
+ }
+
+ @override
R errorFinalStaticFieldSet(
SendSet node,
FieldElement field,
@@ -78,6 +165,16 @@ abstract class ErrorBulkMixin<R, A>
}
@override
+ R errorFinalSuperFieldCompound(
+ Send node,
+ FieldElement field,
+ AssignmentOperator operator,
+ Node rhs,
+ A arg) {
+ return bulkHandleError(node, arg);
+ }
+
+ @override
R errorFinalSuperFieldSet(
SendSet node,
FieldElement field,
@@ -87,6 +184,16 @@ abstract class ErrorBulkMixin<R, A>
}
@override
+ R errorFinalTopLevelFieldCompound(
+ Send node,
+ FieldElement field,
+ AssignmentOperator operator,
+ Node rhs,
+ A arg) {
+ return bulkHandleError(node, arg);
+ }
+
+ @override
R errorFinalTopLevelFieldSet(
SendSet node,
FieldElement field,
@@ -96,6 +203,34 @@ abstract class ErrorBulkMixin<R, A>
}
@override
+ R errorLocalFunctionCompound(
+ Send node,
+ LocalFunctionElement function,
+ AssignmentOperator operator,
+ Node rhs,
+ A arg) {
+ return bulkHandleError(node, arg);
+ }
+
+ @override
+ R errorLocalFunctionPostfix(
+ Send node,
+ LocalFunctionElement function,
+ IncDecOperator operator,
+ A arg) {
+ return bulkHandleError(node, arg);
+ }
+
+ @override
+ R errorLocalFunctionPrefix(
+ Send node,
+ LocalFunctionElement function,
+ IncDecOperator operator,
+ A arg) {
+ return bulkHandleError(node, arg);
+ }
+
+ @override
R errorLocalFunctionSet(
SendSet node,
LocalFunctionElement function,
@@ -224,6 +359,34 @@ abstract class ErrorBulkMixin<R, A>
}
@override
+ R errorTypeVariableTypeLiteralCompound(
+ Send node,
+ TypeVariableElement element,
+ AssignmentOperator operator,
+ Node rhs,
+ A arg) {
+ return bulkHandleError(node, arg);
+ }
+
+ @override
+ R errorTypeVariableTypeLiteralPostfix(
+ Send node,
+ TypeVariableElement element,
+ IncDecOperator operator,
+ A arg) {
+ return bulkHandleError(node, arg);
+ }
+
+ @override
+ R errorTypeVariableTypeLiteralPrefix(
+ Send node,
+ TypeVariableElement element,
+ IncDecOperator operator,
+ A arg) {
+ return bulkHandleError(node, arg);
+ }
+
+ @override
R errorTypeVariableTypeLiteralSet(
SendSet node,
TypeVariableElement element,
@@ -233,6 +396,34 @@ abstract class ErrorBulkMixin<R, A>
}
@override
+ R errorTypedefTypeLiteralCompound(
+ Send node,
+ ConstantExpression constant,
+ AssignmentOperator operator,
+ Node rhs,
+ A arg) {
+ return bulkHandleError(node, arg);
+ }
+
+ @override
+ R errorTypedefTypeLiteralPostfix(
+ Send node,
+ ConstantExpression constant,
+ IncDecOperator operator,
+ A arg) {
+ return bulkHandleError(node, arg);
+ }
+
+ @override
+ R errorTypedefTypeLiteralPrefix(
+ Send node,
+ ConstantExpression constant,
+ IncDecOperator operator,
+ A arg) {
+ return bulkHandleError(node, arg);
+ }
+
+ @override
R errorTypedefTypeLiteralSet(
SendSet node,
ConstantExpression constant,
@@ -242,6 +433,34 @@ abstract class ErrorBulkMixin<R, A>
}
@override
+ R errorUnresolvedCompound(
+ Send node,
+ Element element,
+ AssignmentOperator operator,
+ Node rhs,
+ A arg) {
+ return bulkHandleError(node, arg);
+ }
+
+ @override
+ R errorUnresolvedPostfix(
+ Send node,
+ Element element,
+ IncDecOperator operator,
+ A arg) {
+ return bulkHandleError(node, arg);
+ }
+
+ @override
+ R errorUnresolvedPrefix(
+ Send node,
+ Element element,
+ IncDecOperator operator,
+ A arg) {
+ return bulkHandleError(node, arg);
+ }
+
+ @override
R errorUnresolvedSet(
Send node,
Element element,
@@ -414,7 +633,6 @@ abstract class PrefixBulkMixin<R, A>
R visitUnresolvedSuperGetterIndexPrefix(
Send node,
Element element,
- MethodElement setter,
Node index,
IncDecOperator operator,
A arg) {
@@ -433,16 +651,6 @@ abstract class PrefixBulkMixin<R, A>
}
@override
- R visitUnresolvedSuperIndexPrefix(
- Send node,
- Element element,
- Node index,
- IncDecOperator operator,
- A arg) {
- return bulkHandlePrefix(node, arg);
- }
-
- @override
R visitSuperMethodSetterPrefix(
Send node,
FunctionElement method,
@@ -490,2914 +698,2959 @@ abstract class PrefixBulkMixin<R, A>
A arg) {
return bulkHandlePrefix(node, arg);
}
+}
+
+/// Mixin that implements all `visitXPostfix` methods of [SemanticSendVisitor]
+/// by delegating to a bulk handler.
+///
+/// Use this mixin to provide a trivial implementation for all `visitXPostfix`
+/// methods.
+abstract class PostfixBulkMixin<R, A>
+ implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
+
+ R bulkHandlePostfix(Send node, A arg) {
+ return bulkHandleNode(node, "Postfix expression `#` unhandled.", arg);
+ }
@override
- R visitClassTypeLiteralPrefix(
+ R visitDynamicPropertyPostfix(
Send node,
- ConstantExpression constant,
+ Node receiver,
IncDecOperator operator,
+ Selector getterSelector,
+ Selector setterSelector,
A arg) {
- return bulkHandlePrefix(node, arg);
+ return bulkHandlePostfix(node, arg);
}
@override
- R visitDynamicTypeLiteralPrefix(
+ R visitIndexPostfix(
Send node,
- ConstantExpression constant,
+ Node receiver,
+ Node index,
IncDecOperator operator,
A arg) {
- return bulkHandlePrefix(node, arg);
+ return bulkHandlePostfix(node, arg);
}
@override
- R visitLocalFunctionPrefix(
+ R visitLocalVariablePostfix(
Send node,
- LocalFunctionElement function,
+ LocalVariableElement variable,
IncDecOperator operator,
A arg) {
- return bulkHandlePrefix(node, arg);
+ return bulkHandlePostfix(node, arg);
}
@override
- R visitTypeVariableTypeLiteralPrefix(
+ R visitParameterPostfix(
Send node,
- TypeVariableElement element,
+ ParameterElement parameter,
IncDecOperator operator,
A arg) {
- return bulkHandlePrefix(node, arg);
+ return bulkHandlePostfix(node, arg);
}
@override
- R visitTypedefTypeLiteralPrefix(
+ R visitStaticFieldPostfix(
Send node,
- ConstantExpression constant,
+ FieldElement field,
IncDecOperator operator,
A arg) {
- return bulkHandlePrefix(node, arg);
+ return bulkHandlePostfix(node, arg);
}
@override
- R visitUnresolvedStaticGetterPrefix(
+ R visitStaticGetterSetterPostfix(
Send node,
- Element element,
- MethodElement setter,
+ FunctionElement getter,
+ FunctionElement setter,
IncDecOperator operator,
A arg) {
- return bulkHandlePrefix(node, arg);
+ return bulkHandlePostfix(node, arg);
}
@override
- R visitUnresolvedTopLevelGetterPrefix(
+ R visitStaticMethodSetterPostfix(
Send node,
- Element element,
- MethodElement setter,
- IncDecOperator operator,
- A arg) {
- return bulkHandlePrefix(node, arg);
- }
-
- @override
- R visitUnresolvedStaticSetterPrefix(
- Send node,
- MethodElement getter,
- Element element,
+ FunctionElement getter,
+ FunctionElement setter,
IncDecOperator operator,
A arg) {
- return bulkHandlePrefix(node, arg);
+ return bulkHandlePostfix(node, arg);
}
@override
- R visitUnresolvedTopLevelSetterPrefix(
+ R visitSuperFieldFieldPostfix(
Send node,
- MethodElement getter,
- Element element,
+ FieldElement readField,
+ FieldElement writtenField,
IncDecOperator operator,
A arg) {
- return bulkHandlePrefix(node, arg);
+ return bulkHandlePostfix(node, arg);
}
@override
- R visitStaticMethodPrefix(
+ R visitSuperFieldPostfix(
Send node,
- MethodElement method,
+ FieldElement field,
IncDecOperator operator,
A arg) {
- return bulkHandlePrefix(node, arg);
+ return bulkHandlePostfix(node, arg);
}
@override
- R visitTopLevelMethodPrefix(
+ R visitSuperFieldSetterPostfix(
Send node,
- MethodElement method,
+ FieldElement field,
+ FunctionElement setter,
IncDecOperator operator,
A arg) {
- return bulkHandlePrefix(node, arg);
+ return bulkHandlePostfix(node, arg);
}
@override
- R visitUnresolvedPrefix(
+ R visitSuperGetterFieldPostfix(
Send node,
- Element element,
+ FunctionElement getter,
+ FieldElement field,
IncDecOperator operator,
A arg) {
- return bulkHandlePrefix(node, arg);
+ return bulkHandlePostfix(node, arg);
}
@override
- R visitFinalLocalVariablePrefix(
+ R visitSuperGetterSetterPostfix(
Send node,
- LocalVariableElement variable,
+ FunctionElement getter,
+ FunctionElement setter,
IncDecOperator operator,
A arg) {
- return bulkHandlePrefix(node, arg);
+ return bulkHandlePostfix(node, arg);
}
@override
- R visitFinalParameterPrefix(
+ R visitSuperIndexPostfix(
Send node,
- ParameterElement parameter,
+ FunctionElement indexFunction,
+ FunctionElement indexSetFunction,
+ Node index,
IncDecOperator operator,
A arg) {
- return bulkHandlePrefix(node, arg);
+ return bulkHandlePostfix(node, arg);
}
@override
- R visitFinalStaticFieldPrefix(
+ R visitUnresolvedSuperGetterIndexPostfix(
Send node,
- FieldElement field,
+ Element element,
+ Node index,
IncDecOperator operator,
A arg) {
- return bulkHandlePrefix(node, arg);
+ return bulkHandlePostfix(node, arg);
}
@override
- R visitFinalSuperFieldPrefix(
+ R visitUnresolvedSuperSetterIndexPostfix(
Send node,
- FieldElement field,
+ MethodElement getter,
+ Element element,
+ Node index,
IncDecOperator operator,
A arg) {
- return bulkHandlePrefix(node, arg);
+ return bulkHandlePostfix(node, arg);
}
@override
- R visitSuperMethodPrefix(
+ R visitSuperMethodSetterPostfix(
Send node,
FunctionElement method,
+ FunctionElement setter,
IncDecOperator operator,
A arg) {
- return bulkHandlePrefix(node, arg);
+ return bulkHandlePostfix(node, arg);
}
@override
- R visitFinalTopLevelFieldPrefix(
+ R visitThisPropertyPostfix(
Send node,
- FieldElement field,
IncDecOperator operator,
+ Selector getterSelector,
+ Selector setterSelector,
A arg) {
- return bulkHandlePrefix(node, arg);
+ return bulkHandlePostfix(node, arg);
}
@override
- R visitUnresolvedSuperPrefix(
+ R visitTopLevelFieldPostfix(
Send node,
- Element element,
+ FieldElement field,
IncDecOperator operator,
A arg) {
- return bulkHandlePrefix(node, arg);
+ return bulkHandlePostfix(node, arg);
}
@override
- R visitUnresolvedSuperGetterPrefix(
+ R visitTopLevelGetterSetterPostfix(
Send node,
- Element element,
- MethodElement setter,
+ FunctionElement getter,
+ FunctionElement setter,
IncDecOperator operator,
A arg) {
- return bulkHandlePrefix(node, arg);
+ return bulkHandlePostfix(node, arg);
}
@override
- R visitUnresolvedSuperSetterPrefix(
+ R visitTopLevelMethodSetterPostfix(
Send node,
- MethodElement getter,
- Element element,
+ FunctionElement method,
+ FunctionElement setter,
IncDecOperator operator,
A arg) {
- return bulkHandlePrefix(node, arg);
+ return bulkHandlePostfix(node, arg);
}
}
-/// Mixin that implements all `visitXPostfix` methods of [SemanticSendVisitor]
+/// Mixin that implements all `visitXCompound` methods of [SemanticSendVisitor]
/// by delegating to a bulk handler.
///
-/// Use this mixin to provide a trivial implementation for all `visitXPostfix`
+/// Use this mixin to provide a trivial implementation for all `xCompound`
/// methods.
-abstract class PostfixBulkMixin<R, A>
+abstract class CompoundBulkMixin<R, A>
implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
- R bulkHandlePostfix(Send node, A arg) {
- return bulkHandleNode(node, "Postfix expression `#` unhandled.", arg);
+ R bulkHandleCompound(Send node, A arg) {
+ return bulkHandleNode(node, "Compound assignment `#` unhandled.", arg);
}
@override
- R visitDynamicPropertyPostfix(
+ R visitDynamicPropertyCompound(
Send node,
Node receiver,
- IncDecOperator operator,
+ AssignmentOperator operator,
+ Node rhs,
Selector getterSelector,
Selector setterSelector,
A arg) {
- return bulkHandlePostfix(node, arg);
- }
-
- @override
- R visitIndexPostfix(
- Send node,
- Node receiver,
- Node index,
- IncDecOperator operator,
- A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleCompound(node, arg);
}
@override
- R visitLocalVariablePostfix(
+ R visitLocalVariableCompound(
Send node,
LocalVariableElement variable,
- IncDecOperator operator,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleCompound(node, arg);
}
@override
- R visitParameterPostfix(
+ R visitParameterCompound(
Send node,
ParameterElement parameter,
- IncDecOperator operator,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleCompound(node, arg);
}
@override
- R visitStaticFieldPostfix(
+ R visitStaticFieldCompound(
Send node,
FieldElement field,
- IncDecOperator operator,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleCompound(node, arg);
}
@override
- R visitStaticGetterSetterPostfix(
+ R visitStaticGetterSetterCompound(
Send node,
FunctionElement getter,
FunctionElement setter,
- IncDecOperator operator,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleCompound(node, arg);
}
@override
- R visitStaticMethodSetterPostfix(
+ R visitStaticMethodSetterCompound(
Send node,
- FunctionElement getter,
+ FunctionElement method,
FunctionElement setter,
- IncDecOperator operator,
- A arg) {
- return bulkHandlePostfix(node, arg);
- }
-
- @override
- R visitSuperFieldFieldPostfix(
- Send node,
- FieldElement readField,
- FieldElement writtenField,
- IncDecOperator operator,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleCompound(node, arg);
}
@override
- R visitSuperFieldPostfix(
+ R visitSuperFieldCompound(
Send node,
FieldElement field,
- IncDecOperator operator,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleCompound(node, arg);
}
@override
- R visitSuperFieldSetterPostfix(
+ R visitSuperFieldSetterCompound(
Send node,
FieldElement field,
FunctionElement setter,
- IncDecOperator operator,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleCompound(node, arg);
}
@override
- R visitSuperGetterFieldPostfix(
+ R visitSuperGetterFieldCompound(
Send node,
FunctionElement getter,
FieldElement field,
- IncDecOperator operator,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleCompound(node, arg);
}
@override
- R visitSuperGetterSetterPostfix(
+ R visitSuperGetterSetterCompound(
Send node,
FunctionElement getter,
FunctionElement setter,
- IncDecOperator operator,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleCompound(node, arg);
}
@override
- R visitSuperIndexPostfix(
+ R visitSuperMethodSetterCompound(
Send node,
- FunctionElement indexFunction,
- FunctionElement indexSetFunction,
- Node index,
- IncDecOperator operator,
+ FunctionElement method,
+ FunctionElement setter,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleCompound(node, arg);
}
@override
- R visitUnresolvedSuperGetterIndexPostfix(
+ R visitThisPropertyCompound(
Send node,
- Element element,
- MethodElement setter,
- Node index,
- IncDecOperator operator,
+ AssignmentOperator operator,
+ Node rhs,
+ Selector getterSelector,
+ Selector setterSelector,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleCompound(node, arg);
}
@override
- R visitUnresolvedSuperSetterIndexPostfix(
+ R visitTopLevelFieldCompound(
Send node,
- MethodElement getter,
- Element element,
- Node index,
- IncDecOperator operator,
+ FieldElement field,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleCompound(node, arg);
}
@override
- R visitUnresolvedSuperIndexPostfix(
+ R visitTopLevelGetterSetterCompound(
Send node,
- Element element,
- Node index,
- IncDecOperator operator,
+ FunctionElement getter,
+ FunctionElement setter,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleCompound(node, arg);
}
@override
- R visitSuperMethodSetterPostfix(
+ R visitTopLevelMethodSetterCompound(
Send node,
FunctionElement method,
FunctionElement setter,
- IncDecOperator operator,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleCompound(node, arg);
}
+}
- @override
- R visitThisPropertyPostfix(
- Send node,
- IncDecOperator operator,
- Selector getterSelector,
- Selector setterSelector,
- A arg) {
- return bulkHandlePostfix(node, arg);
+/// Mixin that implements all `visitXInvoke` methods of [SemanticSendVisitor] by
+/// delegating to a bulk handler.
+///
+/// Use this mixin to provide a trivial implementation for all `visitXInvoke`
+/// methods.
+abstract class InvokeBulkMixin<R, A>
+ implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
+
+ R bulkHandleInvoke(Send node, A arg) {
+ return bulkHandleNode(node, "Invocation `#` unhandled.", arg);
}
@override
- R visitTopLevelFieldPostfix(
+ R visitClassTypeLiteralInvoke(
Send node,
- FieldElement field,
- IncDecOperator operator,
+ ConstantExpression constant,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleInvoke(node, arg);
}
@override
- R visitTopLevelGetterSetterPostfix(
+ R visitDynamicPropertyInvoke(
Send node,
- FunctionElement getter,
- FunctionElement setter,
- IncDecOperator operator,
+ Node receiver,
+ NodeList arguments,
+ Selector selector,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleInvoke(node, arg);
}
@override
- R visitTopLevelMethodSetterPostfix(
+ R visitDynamicTypeLiteralInvoke(
Send node,
- FunctionElement method,
- FunctionElement setter,
- IncDecOperator operator,
+ ConstantExpression constant,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleInvoke(node, arg);
}
@override
- R visitClassTypeLiteralPostfix(
+ R visitExpressionInvoke(
Send node,
- ConstantExpression constant,
- IncDecOperator operator,
+ Node expression,
+ NodeList arguments,
+ Selector selector,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleInvoke(node, arg);
}
@override
- R visitDynamicTypeLiteralPostfix(
+ R visitLocalFunctionInvoke(
Send node,
- ConstantExpression constant,
- IncDecOperator operator,
+ LocalFunctionElement function,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleInvoke(node, arg);
}
@override
- R visitLocalFunctionPostfix(
+ R visitLocalVariableInvoke(
Send node,
- LocalFunctionElement function,
- IncDecOperator operator,
+ LocalVariableElement variable,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleInvoke(node, arg);
}
@override
- R visitTypeVariableTypeLiteralPostfix(
+ R visitParameterInvoke(
Send node,
- TypeVariableElement element,
- IncDecOperator operator,
+ ParameterElement parameter,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleInvoke(node, arg);
}
@override
- R visitTypedefTypeLiteralPostfix(
+ R visitStaticFieldInvoke(
Send node,
- ConstantExpression constant,
- IncDecOperator operator,
+ FieldElement field,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleInvoke(node, arg);
}
@override
- R visitUnresolvedStaticGetterPostfix(
+ R visitStaticFunctionInvoke(
Send node,
- Element element,
- MethodElement setter,
- IncDecOperator operator,
+ MethodElement function,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleInvoke(node, arg);
}
@override
- R visitUnresolvedTopLevelGetterPostfix(
+ R visitStaticFunctionIncompatibleInvoke(
Send node,
- Element element,
- MethodElement setter,
- IncDecOperator operator,
+ MethodElement function,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleInvoke(node, arg);
}
@override
- R visitUnresolvedStaticSetterPostfix(
+ R visitStaticGetterInvoke(
Send node,
- MethodElement getter,
- Element element,
- IncDecOperator operator,
+ FunctionElement getter,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleInvoke(node, arg);
}
@override
- R visitUnresolvedTopLevelSetterPostfix(
+ R visitSuperFieldInvoke(
Send node,
- MethodElement getter,
- Element element,
- IncDecOperator operator,
+ FieldElement field,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleInvoke(node, arg);
}
@override
- R visitStaticMethodPostfix(
+ R visitSuperGetterInvoke(
Send node,
- MethodElement method,
- IncDecOperator operator,
+ FunctionElement getter,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleInvoke(node, arg);
}
- R visitToplevelMethodPostfix(
+ @override
+ R visitSuperMethodInvoke(
Send node,
MethodElement method,
- IncDecOperator operator,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleInvoke(node, arg);
}
@override
- R visitUnresolvedPostfix(
+ R visitSuperMethodIncompatibleInvoke(
Send node,
- Element element,
- IncDecOperator operator,
+ MethodElement method,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleInvoke(node, arg);
}
@override
- R visitFinalLocalVariablePostfix(
+ R visitThisInvoke(
Send node,
- LocalVariableElement variable,
- IncDecOperator operator,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleInvoke(node, arg);
}
@override
- R visitFinalParameterPostfix(
+ R visitThisPropertyInvoke(
Send node,
- ParameterElement parameter,
- IncDecOperator operator,
+ NodeList arguments,
+ Selector selector,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleInvoke(node, arg);
}
@override
- R visitFinalStaticFieldPostfix(
+ R visitTopLevelFieldInvoke(
Send node,
FieldElement field,
- IncDecOperator operator,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleInvoke(node, arg);
}
@override
- R visitFinalSuperFieldPostfix(
+ R visitTopLevelFunctionInvoke(
Send node,
- FieldElement field,
- IncDecOperator operator,
+ MethodElement function,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleInvoke(node, arg);
}
@override
- R visitSuperMethodPostfix(
+ R visitTopLevelFunctionIncompatibleInvoke(
Send node,
- FunctionElement method,
- IncDecOperator operator,
+ MethodElement function,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleInvoke(node, arg);
}
@override
- R visitFinalTopLevelFieldPostfix(
+ R visitTopLevelGetterInvoke(
Send node,
- FieldElement field,
- IncDecOperator operator,
+ FunctionElement getter,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleInvoke(node, arg);
}
@override
- R visitTopLevelMethodPostfix(
+ R visitTypeVariableTypeLiteralInvoke(
Send node,
- MethodElement method,
- IncDecOperator operator,
+ TypeVariableElement element,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleInvoke(node, arg);
}
@override
- R visitUnresolvedSuperPostfix(
+ R visitTypedefTypeLiteralInvoke(
Send node,
- Element element,
- IncDecOperator operator,
+ ConstantExpression constant,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleInvoke(node, arg);
}
@override
- R visitUnresolvedSuperGetterPostfix(
+ R visitConstantInvoke(
Send node,
- Element element,
- MethodElement setter,
- IncDecOperator operator,
+ ConstantExpression constant,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleInvoke(node, arg);
}
@override
- R visitUnresolvedSuperSetterPostfix(
+ R visitUnresolvedInvoke(
Send node,
- MethodElement getter,
Element element,
- IncDecOperator operator,
+ NodeList arguments,
+ Selector selector,
A arg) {
- return bulkHandlePostfix(node, arg);
+ return bulkHandleInvoke(node, arg);
+ }
+
+ @override
+ R visitUnresolvedSuperInvoke(
+ Send node,
+ Element function,
+ NodeList arguments,
+ Selector selector,
+ A arg) {
+ return bulkHandleInvoke(node, arg);
}
}
-/// Mixin that implements all `visitXCompound` methods of [SemanticSendVisitor]
-/// by delegating to a bulk handler.
+/// Mixin that implements all `visitXGet` methods of [SemanticSendVisitor] by
+/// delegating to a bulk handler.
///
-/// Use this mixin to provide a trivial implementation for all `xCompound`
+/// Use this mixin to provide a trivial implementation for all `visitXGet`
/// methods.
-abstract class CompoundBulkMixin<R, A>
+abstract class GetBulkMixin<R, A>
implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
- R bulkHandleCompound(Send node, A arg) {
- return bulkHandleNode(node, "Compound assignment `#` unhandled.", arg);
+ R bulkHandleGet(Node node, A arg) {
+ return bulkHandleNode(node, "Read `#` unhandled.", arg);
}
@override
- R visitDynamicPropertyCompound(
+ R visitClassTypeLiteralGet(
Send node,
- Node receiver,
- AssignmentOperator operator,
- Node rhs,
- Selector getterSelector,
- Selector setterSelector,
+ ConstantExpression constant,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleGet(node, arg);
}
@override
- R visitLocalVariableCompound(
+ R visitDynamicPropertyGet(
Send node,
- LocalVariableElement variable,
- AssignmentOperator operator,
- Node rhs,
+ Node receiver,
+ Selector selector,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleGet(node, arg);
}
@override
- R visitParameterCompound(
+ R visitDynamicTypeLiteralGet(
Send node,
- ParameterElement parameter,
- AssignmentOperator operator,
- Node rhs,
+ ConstantExpression constant,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleGet(node, arg);
}
@override
- R visitStaticFieldCompound(
+ R visitLocalFunctionGet(
Send node,
- FieldElement field,
- AssignmentOperator operator,
- Node rhs,
+ LocalFunctionElement function,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleGet(node, arg);
}
@override
- R visitStaticGetterSetterCompound(
+ R visitLocalVariableGet(
Send node,
- FunctionElement getter,
- FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
+ LocalVariableElement variable,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleGet(node, arg);
}
@override
- R visitStaticMethodSetterCompound(
+ R visitParameterGet(
Send node,
- FunctionElement method,
- FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
+ ParameterElement parameter,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleGet(node, arg);
}
@override
- R visitSuperFieldCompound(
+ R visitStaticFieldGet(
Send node,
FieldElement field,
- AssignmentOperator operator,
- Node rhs,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleGet(node, arg);
}
@override
- R visitSuperFieldSetterCompound(
+ R visitStaticFunctionGet(
Send node,
- FieldElement field,
- FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
+ MethodElement function,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleGet(node, arg);
}
@override
- R visitSuperGetterFieldCompound(
+ R visitStaticGetterGet(
Send node,
FunctionElement getter,
+ A arg) {
+ return bulkHandleGet(node, arg);
+ }
+
+ @override
+ R visitSuperFieldGet(
+ Send node,
FieldElement field,
- AssignmentOperator operator,
- Node rhs,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleGet(node, arg);
}
@override
- R visitSuperGetterSetterCompound(
+ R visitSuperGetterGet(
Send node,
FunctionElement getter,
- FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleGet(node, arg);
}
@override
- R visitSuperMethodSetterCompound(
+ R visitSuperMethodGet(
Send node,
- FunctionElement method,
- FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
+ MethodElement method,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleGet(node, arg);
}
@override
- R visitThisPropertyCompound(
+ R visitThisGet(Identifier node, A arg) {
+ return bulkHandleGet(node, arg);
+ }
+
+ @override
+ R visitThisPropertyGet(
Send node,
- AssignmentOperator operator,
- Node rhs,
- Selector getterSelector,
- Selector setterSelector,
+ Selector selector,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleGet(node, arg);
}
@override
- R visitTopLevelFieldCompound(
+ R visitTopLevelFieldGet(
Send node,
FieldElement field,
- AssignmentOperator operator,
- Node rhs,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleGet(node, arg);
}
@override
- R visitTopLevelGetterSetterCompound(
+ R visitTopLevelFunctionGet(
Send node,
- FunctionElement getter,
- FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
+ MethodElement function,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleGet(node, arg);
}
@override
- R visitTopLevelMethodSetterCompound(
+ R visitTopLevelGetterGet(
Send node,
- FunctionElement method,
- FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
+ FunctionElement getter,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleGet(node, arg);
}
@override
- R visitFinalParameterCompound(
+ R visitTypeVariableTypeLiteralGet(
Send node,
- ParameterElement parameter,
- AssignmentOperator operator,
- Node rhs,
+ TypeVariableElement element,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleGet(node, arg);
}
@override
- R visitClassTypeLiteralCompound(
+ R visitTypedefTypeLiteralGet(
Send node,
ConstantExpression constant,
- AssignmentOperator operator,
- Node rhs,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleGet(node, arg);
}
@override
- R visitDynamicTypeLiteralCompound(
+ R visitConstantGet(
Send node,
ConstantExpression constant,
- AssignmentOperator operator,
- Node rhs,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleGet(node, arg);
}
@override
- R visitFinalLocalVariableCompound(
+ R visitUnresolvedGet(
Send node,
- LocalVariableElement
- variable,
- AssignmentOperator operator,
- Node rhs,
+ Element element,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleGet(node, arg);
}
@override
- R visitFinalStaticFieldCompound(
+ R visitUnresolvedSuperGet(
Send node,
- FieldElement field,
- AssignmentOperator operator,
- Node rhs,
+ Element element,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleGet(node, arg);
}
+}
- @override
- R visitFinalSuperFieldCompound(
- Send node,
- FieldElement field,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- return bulkHandleCompound(node, arg);
+/// Mixin that implements all `visitXSet` methods of [SemanticSendVisitor] by
+/// delegating to a bulk handler.
+///
+/// Use this mixin to provide a trivial implementation for all `visitXSet`
+/// methods.
+abstract class SetBulkMixin<R, A>
+ implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
+
+ R bulkHandleSet(Send node, A arg) {
+ return bulkHandleNode(node, "Assignment `#` unhandled.", arg);
}
@override
- R visitFinalTopLevelFieldCompound(
- Send node,
- FieldElement field,
- AssignmentOperator operator,
+ R visitDynamicPropertySet(
+ SendSet node,
+ Node receiver,
+ Selector selector,
Node rhs,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleSet(node, arg);
}
@override
- R visitLocalFunctionCompound(
- Send node,
- LocalFunctionElement function,
- AssignmentOperator operator,
+ R visitLocalVariableSet(
+ SendSet node,
+ LocalVariableElement variable,
Node rhs,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleSet(node, arg);
}
@override
- R visitTypeVariableTypeLiteralCompound(
- Send node,
- TypeVariableElement element,
- AssignmentOperator operator,
+ R visitParameterSet(
+ SendSet node,
+ ParameterElement parameter,
Node rhs,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleSet(node, arg);
}
@override
- R visitTypedefTypeLiteralCompound(
- Send node,
- ConstantExpression constant,
- AssignmentOperator operator,
+ R visitStaticFieldSet(
+ SendSet node,
+ FieldElement field,
Node rhs,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleSet(node, arg);
}
@override
- R visitUnresolvedStaticGetterCompound(
- Send node,
- Element element,
- MethodElement setter,
- AssignmentOperator operator,
+ R visitStaticSetterSet(
+ SendSet node,
+ FunctionElement setter,
Node rhs,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleSet(node, arg);
}
@override
- R visitUnresolvedTopLevelGetterCompound(
- Send node,
- Element element,
- MethodElement setter,
- AssignmentOperator operator,
+ R visitSuperFieldSet(
+ SendSet node,
+ FieldElement field,
Node rhs,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleSet(node, arg);
}
@override
- R visitUnresolvedStaticSetterCompound(
- Send node,
- MethodElement getter,
- Element element,
- AssignmentOperator operator,
+ R visitSuperSetterSet(
+ SendSet node,
+ FunctionElement setter,
Node rhs,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleSet(node, arg);
}
@override
- R visitUnresolvedTopLevelSetterCompound(
- Send node,
- MethodElement getter,
- Element element,
- AssignmentOperator operator,
+ R visitThisPropertySet(
+ SendSet node,
+ Selector selector,
Node rhs,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleSet(node, arg);
}
@override
- R visitStaticMethodCompound(
- Send node,
- MethodElement method,
- AssignmentOperator operator,
+ R visitTopLevelFieldSet(
+ SendSet node,
+ FieldElement field,
Node rhs,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleSet(node, arg);
}
@override
- R visitTopLevelMethodCompound(
- Send node,
- MethodElement method,
- AssignmentOperator operator,
+ R visitTopLevelSetterSet(
+ SendSet node,
+ FunctionElement setter,
Node rhs,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleSet(node, arg);
}
+}
- @override
- R visitUnresolvedCompound(
- Send node,
- Element element,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- return bulkHandleCompound(node, arg);
+/// Mixin that implements all `visitXIndexSet` methods of [SemanticSendVisitor]
+/// by delegating to a bulk handler.
+///
+/// Use this mixin to provide a trivial implementation for all `visitXIndexSet`
+/// methods.
+abstract class IndexSetBulkMixin<R, A>
+ implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
+
+ R bulkHandleIndexSet(Send node, A arg) {
+ return bulkHandleNode(node, "Index set expression `#` unhandled.", arg);
}
@override
- R visitSuperFieldFieldCompound(
- Send node, FieldElement readField,
- FieldElement writtenField,
+ R visitCompoundIndexSet(
+ SendSet node,
+ Node receiver,
+ Node index,
AssignmentOperator operator,
Node rhs,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleIndexSet(node, arg);
}
@override
- R visitSuperMethodCompound(
- Send node,
- FunctionElement method,
+ R visitIndexSet(
+ SendSet node,
+ Node receiver,
+ Node index,
+ Node rhs,
+ A arg) {
+ return bulkHandleIndexSet(node, arg);
+ }
+
+ @override
+ R visitSuperCompoundIndexSet(
+ SendSet node,
+ FunctionElement getter,
+ FunctionElement setter,
+ Node index,
AssignmentOperator operator,
Node rhs,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleIndexSet(node, arg);
}
@override
- R visitUnresolvedSuperCompound(
- Send node,
+ R visitUnresolvedSuperGetterCompoundIndexSet(
+ SendSet node,
Element element,
+ Node index,
AssignmentOperator operator,
Node rhs,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleIndexSet(node, arg);
}
@override
- R visitUnresolvedSuperGetterCompound(
- Send node, Element element,
- MethodElement setter,
+ R visitUnresolvedSuperSetterCompoundIndexSet(
+ SendSet node,
+ MethodElement getter,
+ Element element,
+ Node index,
AssignmentOperator operator,
Node rhs,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleIndexSet(node, arg);
+ }
+
+ @override
+ R visitSuperIndexSet(
+ SendSet node,
+ FunctionElement function,
+ Node index,
+ Node rhs,
+ A arg) {
+ return bulkHandleIndexSet(node, arg);
}
@override
- R visitUnresolvedSuperSetterCompound(
- Send node, MethodElement getter,
+ R visitUnresolvedSuperIndexSet(
+ SendSet node,
Element element,
- AssignmentOperator operator,
+ Node index,
Node rhs,
A arg) {
- return bulkHandleCompound(node, arg);
+ return bulkHandleIndexSet(node, arg);
}
}
-/// Mixin that implements all `visitXInvoke` methods of [SemanticSendVisitor] by
+/// Mixin that implements all binary visitor methods in [SemanticSendVisitor] by
/// delegating to a bulk handler.
///
-/// Use this mixin to provide a trivial implementation for all `visitXInvoke`
+/// Use this mixin to provide a trivial implementation for all binary visitor
/// methods.
-abstract class InvokeBulkMixin<R, A>
+abstract class BinaryBulkMixin<R, A>
implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
- R bulkHandleInvoke(Send node, A arg) {
- return bulkHandleNode(node, "Invocation `#` unhandled.", arg);
+ R bulkHandleBinary(Send node, A arg) {
+ return bulkHandleNode(node, "Binary expression `#` unhandled.", arg);
}
@override
- R visitClassTypeLiteralInvoke(
+ R visitBinary(
Send node,
- ConstantExpression constant,
- NodeList arguments,
- CallStructure callStructure,
+ Node left,
+ BinaryOperator operator,
+ Node right,
A arg) {
- return bulkHandleInvoke(node, arg);
+ return bulkHandleBinary(node, arg);
}
@override
- R visitDynamicPropertyInvoke(
+ R visitEquals(
Send node,
- Node receiver,
- NodeList arguments,
- Selector selector,
+ Node left,
+ Node right,
A arg) {
- return bulkHandleInvoke(node, arg);
+ return bulkHandleBinary(node, arg);
}
@override
- R visitDynamicTypeLiteralInvoke(
+ R visitNotEquals(
Send node,
- ConstantExpression constant,
- NodeList arguments,
- CallStructure callStructure,
+ Node left,
+ Node right,
A arg) {
- return bulkHandleInvoke(node, arg);
+ return bulkHandleBinary(node, arg);
}
@override
- R visitExpressionInvoke(
+ R visitIndex(
Send node,
- Node expression,
- NodeList arguments,
- Selector selector,
+ Node receiver,
+ Node index,
A arg) {
- return bulkHandleInvoke(node, arg);
+ return bulkHandleBinary(node, arg);
}
@override
- R visitLocalFunctionInvoke(
+ R visitSuperBinary(
Send node,
- LocalFunctionElement function,
- NodeList arguments,
- CallStructure callStructure,
+ FunctionElement function,
+ BinaryOperator operator,
+ Node argument,
A arg) {
- return bulkHandleInvoke(node, arg);
+ return bulkHandleBinary(node, arg);
}
@override
- R visitLocalVariableInvoke(
+ R visitSuperEquals(
Send node,
- LocalVariableElement variable,
- NodeList arguments,
- CallStructure callStructure,
+ FunctionElement function,
+ Node argument,
A arg) {
- return bulkHandleInvoke(node, arg);
+ return bulkHandleBinary(node, arg);
}
@override
- R visitParameterInvoke(
+ R visitSuperNotEquals(
Send node,
- ParameterElement parameter,
- NodeList arguments,
- CallStructure callStructure,
+ FunctionElement function,
+ Node argument,
A arg) {
- return bulkHandleInvoke(node, arg);
+ return bulkHandleBinary(node, arg);
}
@override
- R visitStaticFieldInvoke(
+ R visitSuperIndex(
Send node,
- FieldElement field,
- NodeList arguments,
- CallStructure callStructure,
+ FunctionElement function,
+ Node index,
A arg) {
- return bulkHandleInvoke(node, arg);
+ return bulkHandleBinary(node, arg);
}
@override
- R visitStaticFunctionInvoke(
+ R visitUnresolvedSuperBinary(
Send node,
- MethodElement function,
- NodeList arguments,
- CallStructure callStructure,
+ FunctionElement function,
+ BinaryOperator operator,
+ Node argument,
A arg) {
- return bulkHandleInvoke(node, arg);
+ return bulkHandleBinary(node, arg);
}
@override
- R visitStaticFunctionIncompatibleInvoke(
+ R visitUnresolvedSuperInvoke(
Send node,
- MethodElement function,
+ Element function,
NodeList arguments,
- CallStructure callStructure,
+ Selector selector,
A arg) {
- return bulkHandleInvoke(node, arg);
+ return bulkHandleBinary(node, arg);
}
@override
- R visitStaticGetterInvoke(
+ R visitUnresolvedSuperIndex(
Send node,
- FunctionElement getter,
- NodeList arguments,
- CallStructure callStructure,
+ FunctionElement function,
+ Node index,
A arg) {
- return bulkHandleInvoke(node, arg);
+ return bulkHandleBinary(node, arg);
+ }
+}
+
+/// Mixin that implements all unary visitor methods in [SemanticSendVisitor] by
+/// delegating to a bulk handler.
+///
+/// Use this mixin to provide a trivial implementation for all unary visitor
+/// methods.
+abstract class UnaryBulkMixin<R, A>
+ implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
+
+ R bulkHandleUnary(Send node, A arg) {
+ return bulkHandleNode(node, "Unary expression `#` unhandled.", arg);
}
@override
- R visitSuperFieldInvoke(
+ R visitNot(
Send node,
- FieldElement field,
- NodeList arguments,
- CallStructure callStructure,
+ Node expression,
A arg) {
- return bulkHandleInvoke(node, arg);
+ return bulkHandleUnary(node, arg);
}
@override
- R visitSuperGetterInvoke(
+ R visitSuperUnary(
Send node,
- FunctionElement getter,
- NodeList arguments,
- CallStructure callStructure,
+ UnaryOperator operator,
+ FunctionElement function,
A arg) {
- return bulkHandleInvoke(node, arg);
+ return bulkHandleUnary(node, arg);
}
@override
- R visitSuperMethodInvoke(
+ R visitUnary(
Send node,
- MethodElement method,
- NodeList arguments,
- CallStructure callStructure,
+ UnaryOperator operator,
+ Node expression,
A arg) {
- return bulkHandleInvoke(node, arg);
+ return bulkHandleUnary(node, arg);
}
@override
- R visitSuperMethodIncompatibleInvoke(
+ R visitUnresolvedSuperUnary(
Send node,
- MethodElement method,
- NodeList arguments,
- CallStructure callStructure,
+ UnaryOperator operator,
+ FunctionElement function,
A arg) {
- return bulkHandleInvoke(node, arg);
+ return bulkHandleUnary(node, arg);
}
+}
+
+/// Mixin that implements all purely structural visitor methods in
+/// [SemanticSendVisitor] by delegating to a bulk handler.
+///
+/// Use this mixin to provide a trivial implementation for all purely structural
+/// visitor methods.
+abstract class BaseBulkMixin<R, A>
+ implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
@override
- R visitThisInvoke(
+ R visitAs(
Send node,
- NodeList arguments,
- CallStructure callStructure,
+ Node expression,
+ DartType type,
A arg) {
- return bulkHandleInvoke(node, arg);
+ return bulkHandleNode(node, 'As cast `#` unhandled.', arg);
}
@override
- R visitThisPropertyInvoke(
+ R visitAssert(
Send node,
- NodeList arguments,
- Selector selector,
+ Node expression,
A arg) {
- return bulkHandleInvoke(node, arg);
+ return bulkHandleNode(node, 'Assert `#` unhandled.', arg);
}
@override
- R visitTopLevelFieldInvoke(
+ R visitIs(
Send node,
- FieldElement field,
- NodeList arguments,
- CallStructure callStructure,
+ Node expression,
+ DartType type,
A arg) {
- return bulkHandleInvoke(node, arg);
+ return bulkHandleNode(node, 'Is test `#` unhandled.', arg);
}
@override
- R visitTopLevelFunctionInvoke(
+ R visitIsNot(
Send node,
- MethodElement function,
- NodeList arguments,
- CallStructure callStructure,
+ Node expression,
+ DartType type,
A arg) {
- return bulkHandleInvoke(node, arg);
+ return bulkHandleNode(node, 'Is not test `#` unhandled.', arg);
}
@override
- R visitTopLevelFunctionIncompatibleInvoke(
+ R visitLogicalAnd(
Send node,
- MethodElement function,
- NodeList arguments,
- CallStructure callStructure,
+ Node left,
+ Node right,
A arg) {
- return bulkHandleInvoke(node, arg);
+ return bulkHandleNode(node, 'Lazy and `#` unhandled.', arg);
}
@override
- R visitTopLevelGetterInvoke(
+ R visitLogicalOr(
Send node,
- FunctionElement getter,
- NodeList arguments,
- CallStructure callStructure,
+ Node left,
+ Node right,
A arg) {
- return bulkHandleInvoke(node, arg);
+ return bulkHandleNode(node, 'Lazy or `#` unhandled.', arg);
+ }
+}
+
+/// Mixin that implements all visitor methods for `super` calls in
+/// [SemanticSendVisitor] by delegating to a bulk handler.
+///
+/// Use this mixin to provide a trivial implementation for `super` calls
+/// visitor methods.
+abstract class SuperBulkMixin<R, A>
+ implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
+
+ R bulkHandleSuper(Send node, A arg) {
+ return bulkHandleNode(node, "Super call `#` unhandled.", arg);
}
@override
- R visitTypeVariableTypeLiteralInvoke(
+ R visitSuperBinary(
Send node,
- TypeVariableElement element,
- NodeList arguments,
- CallStructure callStructure,
+ FunctionElement function,
+ BinaryOperator operator,
+ Node argument,
A arg) {
- return bulkHandleInvoke(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitTypedefTypeLiteralInvoke(
- Send node,
- ConstantExpression constant,
- NodeList arguments,
- CallStructure callStructure,
+ R visitSuperCompoundIndexSet(
+ SendSet node,
+ FunctionElement getter,
+ FunctionElement setter,
+ Node index,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return bulkHandleInvoke(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitConstantInvoke(
+ R visitSuperEquals(
Send node,
- ConstantExpression constant,
- NodeList arguments,
- CallStructure callStructure,
+ FunctionElement function,
+ Node argument,
A arg) {
- return bulkHandleInvoke(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitUnresolvedInvoke(
+ R visitSuperFieldCompound(
Send node,
- Element element,
- NodeList arguments,
- Selector selector,
+ FieldElement field,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return bulkHandleInvoke(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitUnresolvedSuperInvoke(
+ R visitSuperFieldFieldPostfix(
Send node,
- Element function,
- NodeList arguments,
- Selector selector,
+ FieldElement readField,
+ FieldElement writtenField,
+ IncDecOperator operator,
A arg) {
- return bulkHandleInvoke(node, arg);
- }
-}
-
-/// Mixin that implements all `visitXGet` methods of [SemanticSendVisitor] by
-/// delegating to a bulk handler.
-///
-/// Use this mixin to provide a trivial implementation for all `visitXGet`
-/// methods.
-abstract class GetBulkMixin<R, A>
- implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
-
- R bulkHandleGet(Node node, A arg) {
- return bulkHandleNode(node, "Read `#` unhandled.", arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitClassTypeLiteralGet(
+ R visitSuperFieldFieldPrefix(
Send node,
- ConstantExpression constant,
+ FieldElement readField,
+ FieldElement writtenField,
+ IncDecOperator operator,
A arg) {
- return bulkHandleGet(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitDynamicPropertyGet(
+ R visitSuperFieldGet(
Send node,
- Node receiver,
- Selector selector,
+ FieldElement field,
A arg) {
- return bulkHandleGet(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitDynamicTypeLiteralGet(
+ R visitSuperFieldInvoke(
Send node,
- ConstantExpression constant,
+ FieldElement field,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandleGet(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitLocalFunctionGet(
+ R visitSuperFieldPostfix(
Send node,
- LocalFunctionElement function,
+ FieldElement field,
+ IncDecOperator operator,
A arg) {
- return bulkHandleGet(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitLocalVariableGet(
+ R visitSuperFieldPrefix(
Send node,
- LocalVariableElement variable,
+ FieldElement field,
+ IncDecOperator operator,
A arg) {
- return bulkHandleGet(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitParameterGet(
- Send node,
- ParameterElement parameter,
+ R visitSuperFieldSet(
+ SendSet node,
+ FieldElement field,
+ Node rhs,
A arg) {
- return bulkHandleGet(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitStaticFieldGet(
+ R visitSuperFieldSetterCompound(
Send node,
FieldElement field,
+ FunctionElement setter,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return bulkHandleGet(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitStaticFunctionGet(
+ R visitSuperFieldSetterPostfix(
Send node,
- MethodElement function,
+ FieldElement field,
+ FunctionElement setter,
+ IncDecOperator operator,
A arg) {
- return bulkHandleGet(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitStaticGetterGet(
+ R visitSuperFieldSetterPrefix(
Send node,
- FunctionElement getter,
+ FieldElement field,
+ FunctionElement setter,
+ IncDecOperator operator,
A arg) {
- return bulkHandleGet(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitSuperFieldGet(
+ R visitSuperGetterFieldCompound(
Send node,
+ FunctionElement getter,
FieldElement field,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return bulkHandleGet(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitSuperGetterGet(
+ R visitSuperGetterFieldPostfix(
Send node,
FunctionElement getter,
+ FieldElement field,
+ IncDecOperator operator,
A arg) {
- return bulkHandleGet(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitSuperMethodGet(
+ R visitSuperGetterFieldPrefix(
Send node,
- MethodElement method,
+ FunctionElement getter,
+ FieldElement field,
+ IncDecOperator operator,
A arg) {
- return bulkHandleGet(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitThisGet(Identifier node, A arg) {
- return bulkHandleGet(node, arg);
+ R visitSuperGetterGet(
+ Send node,
+ FunctionElement getter,
+ A arg) {
+ return bulkHandleSuper(node, arg);
}
@override
- R visitThisPropertyGet(
+ R visitSuperGetterInvoke(
Send node,
- Selector selector,
+ FunctionElement getter,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandleGet(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitTopLevelFieldGet(
+ R visitSuperGetterSetterCompound(
Send node,
- FieldElement field,
+ FunctionElement getter,
+ FunctionElement setter,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return bulkHandleGet(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitTopLevelFunctionGet(
+ R visitSuperGetterSetterPostfix(
Send node,
- MethodElement function,
+ FunctionElement getter,
+ FunctionElement setter,
+ IncDecOperator operator,
A arg) {
- return bulkHandleGet(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitTopLevelGetterGet(
+ R visitSuperGetterSetterPrefix(
Send node,
FunctionElement getter,
+ FunctionElement setter,
+ IncDecOperator operator,
A arg) {
- return bulkHandleGet(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitTypeVariableTypeLiteralGet(
- Send node,
- TypeVariableElement element,
+ R visitSuperIndexSet(
+ SendSet node,
+ FunctionElement function,
+ Node index,
+ Node rhs,
A arg) {
- return bulkHandleGet(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitTypedefTypeLiteralGet(
+ R visitSuperMethodGet(
Send node,
- ConstantExpression constant,
+ MethodElement method,
A arg) {
- return bulkHandleGet(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitConstantGet(
+ R visitSuperMethodInvoke(
Send node,
- ConstantExpression constant,
+ MethodElement method,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandleGet(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitUnresolvedGet(
+ R visitSuperMethodIncompatibleInvoke(
Send node,
- Element element,
+ MethodElement method,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandleGet(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitUnresolvedSuperGet(
+ R visitSuperMethodSetterCompound(
Send node,
- Element element,
+ FunctionElement method,
+ FunctionElement setter,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return bulkHandleGet(node, arg);
- }
-}
-
-/// Mixin that implements all `visitXSet` methods of [SemanticSendVisitor] by
-/// delegating to a bulk handler.
-///
-/// Use this mixin to provide a trivial implementation for all `visitXSet`
-/// methods.
-abstract class SetBulkMixin<R, A>
- implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
-
- R bulkHandleSet(Send node, A arg) {
- return bulkHandleNode(node, "Assignment `#` unhandled.", arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitDynamicPropertySet(
- SendSet node,
- Node receiver,
- Selector selector,
- Node rhs,
+ R visitSuperMethodSetterPostfix(
+ Send node,
+ FunctionElement method,
+ FunctionElement setter,
+ IncDecOperator operator,
A arg) {
- return bulkHandleSet(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitLocalVariableSet(
- SendSet node,
- LocalVariableElement variable,
- Node rhs,
+ R visitSuperMethodSetterPrefix(
+ Send node,
+ FunctionElement method,
+ FunctionElement setter,
+ IncDecOperator operator,
A arg) {
- return bulkHandleSet(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitParameterSet(
- SendSet node,
- ParameterElement parameter,
- Node rhs,
+ R visitSuperNotEquals(
+ Send node,
+ FunctionElement function,
+ Node argument,
A arg) {
- return bulkHandleSet(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitStaticFieldSet(
+ R visitSuperSetterSet(
SendSet node,
- FieldElement field,
+ FunctionElement setter,
Node rhs,
A arg) {
- return bulkHandleSet(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitStaticSetterSet(
- SendSet node,
- FunctionElement setter,
- Node rhs,
+ R visitSuperUnary(
+ Send node,
+ UnaryOperator operator,
+ FunctionElement function,
A arg) {
- return bulkHandleSet(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitSuperFieldSet(
- SendSet node,
- FieldElement field,
- Node rhs,
+ R visitUnresolvedSuperBinary(
+ Send node,
+ Element element,
+ BinaryOperator operator,
+ Node argument,
A arg) {
- return bulkHandleSet(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitSuperSetterSet(
- SendSet node,
- FunctionElement setter,
- Node rhs,
+ R visitUnresolvedSuperGet(
+ Send node,
+ Element element,
A arg) {
- return bulkHandleSet(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitThisPropertySet(
- SendSet node,
+ R visitUnresolvedSuperInvoke(
+ Send node,
+ Element function,
+ NodeList arguments,
Selector selector,
- Node rhs,
A arg) {
- return bulkHandleSet(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitTopLevelFieldSet(
- SendSet node,
- FieldElement field,
- Node rhs,
+ R visitUnresolvedSuperIndex(
+ Send node,
+ Element function,
+ Node index,
A arg) {
- return bulkHandleSet(node, arg);
+ return bulkHandleSuper(node, arg);
}
@override
- R visitTopLevelSetterSet(
- SendSet node,
- FunctionElement setter,
- Node rhs,
+ R visitUnresolvedSuperUnary(
+ Send node,
+ UnaryOperator operator,
+ Element element,
A arg) {
- return bulkHandleSet(node, arg);
+ return bulkHandleSuper(node, arg);
}
}
-/// Mixin that implements all `visitXIndexSet` methods of [SemanticSendVisitor]
-/// by delegating to a bulk handler.
-///
-/// Use this mixin to provide a trivial implementation for all `visitXIndexSet`
-/// methods.
-abstract class IndexSetBulkMixin<R, A>
+abstract class NewBulkMixin<R, A>
implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
- R bulkHandleIndexSet(Send node, A arg) {
- return bulkHandleNode(node, "Index set expression `#` unhandled.", arg);
+ R bulkHandleNew(NewExpression node, A arg) {
+ return bulkHandleNode(
+ node, "Constructor invocation `#` unhandled.", arg);
}
@override
- R visitCompoundIndexSet(
- SendSet node,
- Node receiver,
- Node index,
- AssignmentOperator operator,
- Node rhs,
+ R visitAbstractClassConstructorInvoke(
+ NewExpression node,
+ ConstructorElement element,
+ InterfaceType type,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandleIndexSet(node, arg);
+ return bulkHandleNew(node, arg);
}
@override
- R visitIndexSet(
- SendSet node,
- Node receiver,
- Node index,
- Node rhs,
+ R visitConstConstructorInvoke(
+ NewExpression node,
+ ConstructedConstantExpression constant,
A arg) {
- return bulkHandleIndexSet(node, arg);
+ return bulkHandleNew(node, arg);
}
- @override
- R visitSuperCompoundIndexSet(
- SendSet node,
- FunctionElement getter,
- FunctionElement setter,
- Node index,
- AssignmentOperator operator,
- Node rhs,
+ R visitGenerativeConstructorInvoke(
+ NewExpression node,
+ ConstructorElement constructor,
+ InterfaceType type,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandleIndexSet(node, arg);
+ return bulkHandleNew(node, arg);
}
- @override
- R visitUnresolvedSuperGetterCompoundIndexSet(
- SendSet node,
- Element element,
- MethodElement setter,
- Node index,
- AssignmentOperator operator,
- Node rhs,
+ R visitRedirectingGenerativeConstructorInvoke(
+ NewExpression node,
+ ConstructorElement constructor,
+ InterfaceType type,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandleIndexSet(node, arg);
+ return bulkHandleNew(node, arg);
}
- @override
- R visitUnresolvedSuperSetterCompoundIndexSet(
- SendSet node,
- MethodElement getter,
- Element element,
- Node index,
- AssignmentOperator operator,
- Node rhs,
+ R visitFactoryConstructorInvoke(
+ NewExpression node,
+ ConstructorElement constructor,
+ InterfaceType type,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandleIndexSet(node, arg);
+ return bulkHandleNew(node, arg);
+ }
+
+ R visitRedirectingFactoryConstructorInvoke(
+ NewExpression node,
+ ConstructorElement constructor,
+ InterfaceType type,
+ ConstructorElement effectiveTarget,
+ InterfaceType effectiveTargetType,
+ NodeList arguments,
+ CallStructure callStructure,
+ A arg) {
+ return bulkHandleNew(node, arg);
}
@override
- R visitUnresolvedSuperCompoundIndexSet(
- SendSet node,
+ R visitUnresolvedClassConstructorInvoke(
+ NewExpression node,
Element element,
- Node index,
- AssignmentOperator operator,
- Node rhs,
+ DartType type,
+ NodeList arguments,
+ Selector selector,
A arg) {
- return bulkHandleIndexSet(node, arg);
+ return bulkHandleNew(node, arg);
}
@override
- R visitSuperIndexSet(
- SendSet node,
- FunctionElement function,
- Node index,
- Node rhs,
+ R visitUnresolvedConstructorInvoke(
+ NewExpression node,
+ Element constructor,
+ DartType type,
+ NodeList arguments,
+ Selector selector,
A arg) {
- return bulkHandleIndexSet(node, arg);
+ return bulkHandleNew(node, arg);
}
@override
- R visitUnresolvedSuperIndexSet(
- SendSet node,
- Element element,
- Node index,
- Node rhs,
- A arg) {
- return bulkHandleIndexSet(node, arg);
+ R visitUnresolvedRedirectingFactoryConstructorInvoke(
+ NewExpression node,
+ ConstructorElement constructor,
+ InterfaceType type,
+ NodeList arguments,
+ CallStructure callStructure,
+ A arg) {
+ return bulkHandleNew(node, arg);
}
}
-/// Mixin that implements all binary visitor methods in [SemanticSendVisitor] by
-/// delegating to a bulk handler.
+/// Visitor that implements [SemanticSendVisitor] by the use of `BulkX` mixins.
///
-/// Use this mixin to provide a trivial implementation for all binary visitor
-/// methods.
-abstract class BinaryBulkMixin<R, A>
- implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
-
- R bulkHandleBinary(Send node, A arg) {
- return bulkHandleNode(node, "Binary expression `#` unhandled.", arg);
+/// This class is useful in itself, but shows how to use the `BulkX` mixins and
+/// tests that the union of the `BulkX` mixins implement all `visit` and `error`
+/// methods of [SemanticSendVisitor].
+class BulkSendVisitor<R, A> extends SemanticSendVisitor<R, A>
+ with GetBulkMixin<R, A>,
+ SetBulkMixin<R, A>,
+ ErrorBulkMixin<R, A>,
+ InvokeBulkMixin<R, A>,
+ IndexSetBulkMixin<R, A>,
+ CompoundBulkMixin<R, A>,
+ UnaryBulkMixin<R, A>,
+ BaseBulkMixin<R, A>,
+ BinaryBulkMixin<R, A>,
+ PrefixBulkMixin<R, A>,
+ PostfixBulkMixin<R, A>,
+ NewBulkMixin<R, A> {
+ @override
+ R apply(Node node, A arg) {
+ throw new UnimplementedError("BulkSendVisitor.apply unimplemented");
}
@override
- R visitBinary(
- Send node,
- Node left,
- BinaryOperator operator,
- Node right,
- A arg) {
- return bulkHandleBinary(node, arg);
+ R bulkHandleNode(Node node, String message, A arg) {
+ throw new UnimplementedError(
+ "BulkSendVisitor.bulkHandleNode unimplemented");
+ }
+}
+
+/// Mixin that implements all `visitXParameterDecl` and
+/// `visitXInitializingFormalDecl` methods of [SemanticDeclarationVisitor]
+/// by delegating to a bulk handler.
+///
+/// Use this mixin to provide a trivial implementation for these methods.
+abstract class ParameterBulkMixin<R, A>
+ implements SemanticDeclarationVisitor<R, A>, BulkHandle<R, A> {
+
+ R bulkHandleParameterDeclaration(VariableDefinitions node, A arg) {
+ return bulkHandleNode(
+ node, "Parameter declaration `#` unhandled.", arg);
}
@override
- R visitEquals(
- Send node,
- Node left,
- Node right,
+ R visitInitializingFormalDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ InitializingFormalElement parameter,
+ int index,
A arg) {
- return bulkHandleBinary(node, arg);
+ return bulkHandleParameterDeclaration(node, arg);
}
@override
- R visitNotEquals(
- Send node,
- Node left,
- Node right,
+ R visitNamedInitializingFormalDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ InitializingFormalElement parameter,
+ ConstantExpression defaultValue,
A arg) {
- return bulkHandleBinary(node, arg);
+ return bulkHandleParameterDeclaration(node, arg);
}
@override
- R visitIndex(
- Send node,
- Node receiver,
- Node index,
+ R visitNamedParameterDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ ParameterElement parameter,
+ ConstantExpression defaultValue,
A arg) {
- return bulkHandleBinary(node, arg);
+ return bulkHandleParameterDeclaration(node, arg);
}
@override
- R visitSuperBinary(
- Send node,
- FunctionElement function,
- BinaryOperator operator,
- Node argument,
+ R visitOptionalInitializingFormalDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ InitializingFormalElement parameter,
+ ConstantExpression defaultValue,
+ int index,
A arg) {
- return bulkHandleBinary(node, arg);
+ return bulkHandleParameterDeclaration(node, arg);
}
@override
- R visitSuperEquals(
- Send node,
- FunctionElement function,
- Node argument,
+ R visitOptionalParameterDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ ParameterElement parameter,
+ ConstantExpression defaultValue,
+ int index,
A arg) {
- return bulkHandleBinary(node, arg);
+ return bulkHandleParameterDeclaration(node, arg);
}
@override
- R visitSuperNotEquals(
- Send node,
- FunctionElement function,
- Node argument,
+ R visitParameterDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ ParameterElement parameter,
+ int index,
A arg) {
- return bulkHandleBinary(node, arg);
+ return bulkHandleParameterDeclaration(node, arg);
+ }
+}
+
+/// Mixin that implements all `visitXConstructorDecl` methods of
+/// [SemanticDeclarationVisitor] by delegating to a bulk handler.
+///
+/// Use this mixin to provide a trivial implementation for these methods.
+abstract class ConstructorBulkMixin<R, A>
+ implements SemanticDeclarationVisitor<R, A>, BulkHandle<R, A> {
+
+ R bulkHandleConstructorDeclaration(FunctionExpression node, A arg) {
+ return bulkHandleNode(
+ node, "Constructor declaration `#` unhandled.", arg);
}
@override
- R visitSuperIndex(
- Send node,
- FunctionElement function,
- Node index,
+ R visitFactoryConstructorDeclaration(
+ FunctionExpression node,
+ ConstructorElement constructor,
+ NodeList parameters,
+ Node body,
A arg) {
- return bulkHandleBinary(node, arg);
+ return bulkHandleConstructorDeclaration(node, arg);
}
@override
- R visitUnresolvedSuperBinary(
- Send node,
- FunctionElement function,
- BinaryOperator operator,
- Node argument,
+ R visitGenerativeConstructorDeclaration(
+ FunctionExpression node,
+ ConstructorElement constructor,
+ NodeList parameters,
+ NodeList initializers,
+ Node body,
A arg) {
- return bulkHandleBinary(node, arg);
+ return bulkHandleConstructorDeclaration(node, arg);
}
@override
- R visitUnresolvedSuperInvoke(
- Send node,
- Element function,
- NodeList arguments,
- Selector selector,
+ R visitRedirectingFactoryConstructorDeclaration(
+ FunctionExpression node,
+ ConstructorElement constructor,
+ NodeList parameters,
+ InterfaceType redirectionType,
+ ConstructorElement redirectionTarget,
A arg) {
- return bulkHandleBinary(node, arg);
+ return bulkHandleConstructorDeclaration(node, arg);
}
@override
- R visitUnresolvedSuperIndex(
- Send node,
- FunctionElement function,
- Node index,
+ R visitRedirectingGenerativeConstructorDeclaration(
+ FunctionExpression node,
+ ConstructorElement constructor,
+ NodeList parameters,
+ NodeList initializers,
A arg) {
- return bulkHandleBinary(node, arg);
+ return bulkHandleConstructorDeclaration(node, arg);
}
}
-/// Mixin that implements all unary visitor methods in [SemanticSendVisitor] by
-/// delegating to a bulk handler.
+/// Mixin that implements all constructor initializer visitor methods of
+/// [SemanticDeclarationVisitor] by delegating to a bulk handler.
///
-/// Use this mixin to provide a trivial implementation for all unary visitor
-/// methods.
-abstract class UnaryBulkMixin<R, A>
- implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
+/// Use this mixin to provide a trivial implementation for these methods.
+abstract class InitializerBulkMixin<R, A>
+ implements SemanticDeclarationVisitor<R, A>, BulkHandle<R, A> {
- R bulkHandleUnary(Send node, A arg) {
- return bulkHandleNode(node, "Unary expression `#` unhandled.", arg);
+ R bulkHandleInitializer(Send node, A arg) {
+ return bulkHandleNode(
+ node, "Initializer `#` unhandled.", arg);
}
@override
- R visitNot(
- Send node,
- Node expression,
+ R errorUnresolvedFieldInitializer(
+ SendSet node,
+ Element element,
+ Node initializer,
A arg) {
- return bulkHandleUnary(node, arg);
+ return bulkHandleInitializer(node, arg);
}
@override
- R visitSuperUnary(
+ R errorUnresolvedSuperConstructorInvoke(
Send node,
- UnaryOperator operator,
- FunctionElement function,
+ Element element,
+ NodeList arguments,
+ Selector selector,
A arg) {
- return bulkHandleUnary(node, arg);
+ return bulkHandleInitializer(node, arg);
}
@override
- R visitUnary(
+ R errorUnresolvedThisConstructorInvoke(
Send node,
- UnaryOperator operator,
- Node expression,
+ Element element,
+ NodeList arguments,
+ Selector selector,
A arg) {
- return bulkHandleUnary(node, arg);
+ return bulkHandleInitializer(node, arg);
}
@override
- R visitUnresolvedSuperUnary(
- Send node,
- UnaryOperator operator,
- FunctionElement function,
+ R visitFieldInitializer(
+ SendSet node,
+ FieldElement field,
+ Node initializer,
A arg) {
- return bulkHandleUnary(node, arg);
+ return bulkHandleInitializer(node, arg);
}
-}
-
-/// Mixin that implements all purely structural visitor methods in
-/// [SemanticSendVisitor] by delegating to a bulk handler.
-///
-/// Use this mixin to provide a trivial implementation for all purely structural
-/// visitor methods.
-abstract class BaseBulkMixin<R, A>
- implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
@override
- R visitAs(
+ R visitSuperConstructorInvoke(
Send node,
- Node expression,
- DartType type,
+ ConstructorElement superConstructor,
+ InterfaceType type,
+ NodeList arguments,
+ Selector selector,
A arg) {
- return bulkHandleNode(node, 'As cast `#` unhandled.', arg);
+ return bulkHandleInitializer(node, arg);
}
@override
- R visitAssert(
+ R visitThisConstructorInvoke(
Send node,
- Node expression,
+ ConstructorElement thisConstructor,
+ NodeList arguments,
+ Selector selector,
A arg) {
- return bulkHandleNode(node, 'Assert `#` unhandled.', arg);
+ return bulkHandleInitializer(node, arg);
+ }
+}
+
+/// Mixin that implements all function declaration visitor methods of
+/// [SemanticDeclarationVisitor] by delegating to a bulk handler.
+///
+/// Use this mixin to provide a trivial implementation for these methods.
+abstract class FunctionBulkMixin<R, A>
+ implements SemanticDeclarationVisitor<R, A>, BulkHandle<R, A> {
+
+ R bulkHandleFunctionDeclaration(FunctionExpression node, A arg) {
+ return bulkHandleNode(
+ node, "Function declaration `#` unhandled.", arg);
}
@override
- R visitIs(
- Send node,
- Node expression,
- DartType type,
+ R visitAbstractGetterDeclaration(
+ FunctionExpression node,
+ MethodElement getter,
A arg) {
- return bulkHandleNode(node, 'Is test `#` unhandled.', arg);
+ return bulkHandleFunctionDeclaration(node, arg);
}
@override
- R visitIsNot(
- Send node,
- Node expression,
- DartType type,
+ R visitAbstractMethodDeclaration(
+ FunctionExpression node,
+ MethodElement method,
+ NodeList parameters,
A arg) {
- return bulkHandleNode(node, 'Is not test `#` unhandled.', arg);
+ return bulkHandleFunctionDeclaration(node, arg);
}
@override
- R visitLogicalAnd(
- Send node,
- Node left,
- Node right,
+ R visitAbstractSetterDeclaration(
+ FunctionExpression node,
+ MethodElement setter,
+ NodeList parameters,
A arg) {
- return bulkHandleNode(node, 'Lazy and `#` unhandled.', arg);
+ return bulkHandleFunctionDeclaration(node, arg);
}
@override
- R visitLogicalOr(
- Send node,
- Node left,
- Node right,
+ R visitClosureDeclaration(
+ FunctionExpression node,
+ LocalFunctionElement closure,
+ NodeList parameters,
+ Node body,
A arg) {
- return bulkHandleNode(node, 'Lazy or `#` unhandled.', arg);
+ return bulkHandleFunctionDeclaration(node, arg);
}
-}
-
-/// Mixin that implements all visitor methods for `super` calls in
-/// [SemanticSendVisitor] by delegating to a bulk handler.
-///
-/// Use this mixin to provide a trivial implementation for `super` calls
-/// visitor methods.
-abstract class SuperBulkMixin<R, A>
- implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
- R bulkHandleSuper(Send node, A arg) {
- return bulkHandleNode(node, "Super call `#` unhandled.", arg);
+ @override
+ R visitInstanceGetterDeclaration(
+ FunctionExpression node,
+ MethodElement getter,
+ Node body,
+ A arg) {
+ return bulkHandleFunctionDeclaration(node, arg);
}
@override
- R visitSuperBinary(
- Send node,
- FunctionElement function,
- BinaryOperator operator,
- Node argument,
+ R visitInstanceMethodDeclaration(
+ FunctionExpression node,
+ MethodElement method,
+ NodeList parameters,
+ Node body,
A arg) {
- return bulkHandleSuper(node, arg);
+ return bulkHandleFunctionDeclaration(node, arg);
}
@override
- R visitSuperCompoundIndexSet(
- SendSet node,
- FunctionElement getter,
- FunctionElement setter,
- Node index,
- AssignmentOperator operator,
- Node rhs,
+ R visitInstanceSetterDeclaration(
+ FunctionExpression node,
+ MethodElement setter,
+ NodeList parameters,
+ Node body,
A arg) {
- return bulkHandleSuper(node, arg);
+ return bulkHandleFunctionDeclaration(node, arg);
}
@override
- R visitSuperEquals(
- Send node,
- FunctionElement function,
- Node argument,
+ R visitLocalFunctionDeclaration(
+ FunctionExpression node,
+ LocalFunctionElement function,
+ NodeList parameters,
+ Node body,
A arg) {
- return bulkHandleSuper(node, arg);
+ return bulkHandleFunctionDeclaration(node, arg);
}
@override
- R visitSuperFieldCompound(
- Send node,
- FieldElement field,
- AssignmentOperator operator,
- Node rhs,
+ R visitStaticFunctionDeclaration(
+ FunctionExpression node,
+ MethodElement function,
+ NodeList parameters,
+ Node body,
A arg) {
- return bulkHandleSuper(node, arg);
+ return bulkHandleFunctionDeclaration(node, arg);
}
@override
- R visitSuperFieldFieldPostfix(
- Send node,
- FieldElement readField,
- FieldElement writtenField,
- IncDecOperator operator,
+ R visitStaticGetterDeclaration(
+ FunctionExpression node,
+ MethodElement getter,
+ Node body,
A arg) {
- return bulkHandleSuper(node, arg);
+ return bulkHandleFunctionDeclaration(node, arg);
}
@override
- R visitSuperFieldFieldPrefix(
- Send node,
- FieldElement readField,
- FieldElement writtenField,
- IncDecOperator operator,
+ R visitStaticSetterDeclaration(
+ FunctionExpression node,
+ MethodElement setter,
+ NodeList parameters,
+ Node body,
A arg) {
- return bulkHandleSuper(node, arg);
+ return bulkHandleFunctionDeclaration(node, arg);
}
@override
- R visitSuperFieldGet(
- Send node,
- FieldElement field,
+ R visitTopLevelFunctionDeclaration(
+ FunctionExpression node,
+ MethodElement function,
+ NodeList parameters,
+ Node body,
A arg) {
- return bulkHandleSuper(node, arg);
+ return bulkHandleFunctionDeclaration(node, arg);
}
@override
- R visitSuperFieldInvoke(
- Send node,
- FieldElement field,
- NodeList arguments,
- CallStructure callStructure,
+ R visitTopLevelGetterDeclaration(
+ FunctionExpression node,
+ MethodElement getter,
+ Node body,
A arg) {
- return bulkHandleSuper(node, arg);
+ return bulkHandleFunctionDeclaration(node, arg);
}
@override
- R visitSuperFieldPostfix(
- Send node,
- FieldElement field,
- IncDecOperator operator,
+ R visitTopLevelSetterDeclaration(
+ FunctionExpression node,
+ MethodElement setter,
+ NodeList parameters,
+ Node body,
A arg) {
- return bulkHandleSuper(node, arg);
+ return bulkHandleFunctionDeclaration(node, arg);
+ }
+}
+
+/// Mixin that implements all variable/field declaration visitor methods of
+/// [SemanticDeclarationVisitor] by delegating to a bulk handler.
+///
+/// Use this mixin to provide a trivial implementation for these methods.
+abstract class VariableBulkMixin<R, A>
+ implements SemanticDeclarationVisitor<R, A>, BulkHandle<R, A> {
+
+ R bulkHandleVariableDeclaration(VariableDefinitions node, A arg) {
+ return bulkHandleNode(
+ node, "Variable declaration `#` unhandled.", arg);
}
@override
- R visitSuperFieldPrefix(
- Send node,
+ R visitInstanceFieldDeclaration(
+ VariableDefinitions node,
+ Node definition,
FieldElement field,
- IncDecOperator operator,
+ Node initializer,
A arg) {
- return bulkHandleSuper(node, arg);
+ return bulkHandleVariableDeclaration(node, arg);
}
@override
- R visitSuperFieldSet(
- SendSet node,
- FieldElement field,
- Node rhs,
+ R visitLocalConstantDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ LocalVariableElement variable,
+ ConstantExpression constant,
A arg) {
- return bulkHandleSuper(node, arg);
+ return bulkHandleVariableDeclaration(node, arg);
}
@override
- R visitSuperFieldSetterCompound(
- Send node,
- FieldElement field,
- FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
+ R visitLocalVariableDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ LocalVariableElement variable,
+ Node initializer,
A arg) {
- return bulkHandleSuper(node, arg);
+ return bulkHandleVariableDeclaration(node, arg);
}
@override
- R visitSuperFieldSetterPostfix(
- Send node,
+ R visitStaticConstantDeclaration(
+ VariableDefinitions node,
+ Node definition,
FieldElement field,
- FunctionElement setter,
- IncDecOperator operator,
+ ConstantExpression constant,
A arg) {
- return bulkHandleSuper(node, arg);
+ return bulkHandleVariableDeclaration(node, arg);
}
@override
- R visitSuperFieldSetterPrefix(
- Send node,
+ R visitStaticFieldDeclaration(
+ VariableDefinitions node,
+ Node definition,
FieldElement field,
- FunctionElement setter,
- IncDecOperator operator,
+ Node initializer,
A arg) {
- return bulkHandleSuper(node, arg);
+ return bulkHandleVariableDeclaration(node, arg);
}
@override
- R visitSuperGetterFieldCompound(
- Send node,
- FunctionElement getter,
+ R visitTopLevelConstantDeclaration(
+ VariableDefinitions node,
+ Node definition,
FieldElement field,
- AssignmentOperator operator,
- Node rhs,
+ ConstantExpression constant,
A arg) {
- return bulkHandleSuper(node, arg);
+ return bulkHandleVariableDeclaration(node, arg);
}
@override
- R visitSuperGetterFieldPostfix(
- Send node,
- FunctionElement getter,
+ R visitTopLevelFieldDeclaration(
+ VariableDefinitions node,
+ Node definition,
FieldElement field,
- IncDecOperator operator,
+ Node initializer,
A arg) {
- return bulkHandleSuper(node, arg);
+ return bulkHandleVariableDeclaration(node, arg);
+ }
+}
+
+/// Visitor that implements [SemanticDeclarationVisitor] by the use of `BulkX`
+/// mixins.
+///
+/// This class is useful in itself, but shows how to use the `BulkX` mixins and
+/// tests that the union of the `BulkX` mixins implement all `visit` and `error`
+/// methods of [SemanticDeclarationVisitor].
+class BulkDeclarationVisitor<R, A> extends SemanticDeclarationVisitor<R, A>
+ with ConstructorBulkMixin<R, A>,
+ FunctionBulkMixin<R, A>,
+ VariableBulkMixin<R, A>,
+ ParameterBulkMixin<R, A>,
+ InitializerBulkMixin<R, A> {
+ @override
+ R apply(Node node, A arg) {
+ throw new UnimplementedError("BulkDeclVisitor.apply unimplemented");
}
@override
- R visitSuperGetterFieldPrefix(
- Send node,
- FunctionElement getter,
- FieldElement field,
- IncDecOperator operator,
- A arg) {
- return bulkHandleSuper(node, arg);
+ R bulkHandleNode(Node node, String message, A arg) {
+ throw new UnimplementedError(
+ "BulkDeclVisitor.bulkHandleNode unimplemented");
}
@override
- R visitSuperGetterGet(
- Send node,
- FunctionElement getter,
- A arg) {
- return bulkHandleSuper(node, arg);
+ applyInitializers(NodeList initializers, A arg) {
+ throw new UnimplementedError(
+ "BulkDeclVisitor.applyInitializers unimplemented");
}
@override
- R visitSuperGetterInvoke(
+ applyParameters(NodeList parameters, A arg) {
+ throw new UnimplementedError(
+ "BulkDeclVisitor.applyParameters unimplemented");
+ }
+}
+
+
+/// [SemanticSendVisitor] that visits subnodes.
+class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
+ @override
+ R apply(Node node, A arg) {
+ throw new UnimplementedError("TraversalMixin.apply unimplemented");
+ }
+
+ @override
+ R errorInvalidAssert(
Send node,
- FunctionElement getter,
NodeList arguments,
- CallStructure callStructure,
A arg) {
- return bulkHandleSuper(node, arg);
+ apply(arguments, arg);
+ return null;
}
@override
- R visitSuperGetterSetterCompound(
- Send node,
- FunctionElement getter,
- FunctionElement setter,
- AssignmentOperator operator,
+ R errorClassTypeLiteralSet(
+ SendSet node,
+ ConstantExpression constant,
Node rhs,
A arg) {
- return bulkHandleSuper(node, arg);
+ apply(rhs, arg);
+ return null;
}
@override
- R visitSuperGetterSetterPostfix(
- Send node,
- FunctionElement getter,
- FunctionElement setter,
- IncDecOperator operator,
+ R errorDynamicTypeLiteralSet(
+ SendSet node,
+ ConstantExpression constant,
+ Node rhs,
A arg) {
- return bulkHandleSuper(node, arg);
+ apply(rhs, arg);
+ return null;
}
@override
- R visitSuperGetterSetterPrefix(
+ R errorFinalLocalVariableCompound(
Send node,
- FunctionElement getter,
- FunctionElement setter,
- IncDecOperator operator,
+ LocalVariableElement variable,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return bulkHandleSuper(node, arg);
+ apply(rhs, arg);
+ return null;
}
@override
- R visitSuperIndexSet(
+ R errorFinalLocalVariableSet(
SendSet node,
- FunctionElement function,
- Node index,
+ LocalVariableElement variable,
Node rhs,
A arg) {
- return bulkHandleSuper(node, arg);
+ apply(rhs, arg);
+ return null;
}
@override
- R visitSuperMethodGet(
+ R errorFinalParameterCompound(
Send node,
- MethodElement method,
+ ParameterElement parameter,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return bulkHandleSuper(node, arg);
+ apply(rhs, arg);
+ return null;
}
@override
- R visitSuperMethodInvoke(
- Send node,
- MethodElement method,
- NodeList arguments,
- CallStructure callStructure,
+ R errorFinalParameterSet(
+ SendSet node,
+ ParameterElement parameter,
+ Node rhs,
A arg) {
- return bulkHandleSuper(node, arg);
+ apply(rhs, arg);
+ return null;
}
@override
- R visitSuperMethodIncompatibleInvoke(
+ R errorFinalStaticFieldCompound(
Send node,
- MethodElement method,
- NodeList arguments,
- CallStructure callStructure,
+ FieldElement field,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return bulkHandleSuper(node, arg);
+ apply(rhs, arg);
+ return null;
}
@override
- R visitSuperMethodSetterCompound(
- Send node,
- FunctionElement method,
- FunctionElement setter,
- AssignmentOperator operator,
+ R errorFinalStaticFieldSet(
+ SendSet node,
+ FieldElement field,
Node rhs,
A arg) {
- return bulkHandleSuper(node, arg);
+ apply(rhs, arg);
+ return null;
}
@override
- R visitSuperMethodSetterPostfix(
+ R errorFinalSuperFieldCompound(
Send node,
- FunctionElement method,
- FunctionElement setter,
- IncDecOperator operator,
+ FieldElement field,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return bulkHandleSuper(node, arg);
+ apply(rhs, arg);
+ return null;
}
@override
- R visitSuperMethodSetterPrefix(
- Send node,
- FunctionElement method,
- FunctionElement setter,
- IncDecOperator operator,
+ R errorFinalSuperFieldSet(
+ SendSet node,
+ FieldElement field,
+ Node rhs,
A arg) {
- return bulkHandleSuper(node, arg);
+ apply(rhs, arg);
+ return null;
}
@override
- R visitSuperNotEquals(
+ R errorFinalTopLevelFieldCompound(
Send node,
- FunctionElement function,
- Node argument,
+ FieldElement field,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return bulkHandleSuper(node, arg);
+ apply(rhs, arg);
+ return null;
}
@override
- R visitSuperSetterSet(
+ R errorFinalTopLevelFieldSet(
SendSet node,
- FunctionElement setter,
+ FieldElement field,
Node rhs,
A arg) {
- return bulkHandleSuper(node, arg);
+ apply(rhs, arg);
+ return null;
}
@override
- R visitSuperUnary(
+ R errorLocalFunctionCompound(
Send node,
- UnaryOperator operator,
- FunctionElement function,
+ LocalFunctionElement function,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return bulkHandleSuper(node, arg);
+ apply(rhs, arg);
+ return null;
}
@override
- R visitUnresolvedSuperBinary(
+ R errorLocalFunctionPostfix(
Send node,
- Element element,
- BinaryOperator operator,
- Node argument,
+ LocalFunctionElement function,
+ IncDecOperator operator,
A arg) {
- return bulkHandleSuper(node, arg);
+ return null;
}
@override
- R visitUnresolvedSuperGet(
+ R errorLocalFunctionPrefix(
Send node,
- Element element,
+ LocalFunctionElement function,
+ IncDecOperator operator,
A arg) {
- return bulkHandleSuper(node, arg);
+ return null;
}
@override
- R visitUnresolvedSuperInvoke(
- Send node,
- Element function,
- NodeList arguments,
- Selector selector,
+ R errorLocalFunctionSet(
+ SendSet node,
+ LocalFunctionElement function,
+ Node rhs,
A arg) {
- return bulkHandleSuper(node, arg);
+ apply(rhs, arg);
+ return null;
}
@override
- R visitUnresolvedSuperIndex(
+ R errorStaticFunctionSet(
Send node,
- Element function,
- Node index,
+ MethodElement function,
+ Node rhs,
A arg) {
- return bulkHandleSuper(node, arg);
+ apply(rhs, arg);
+ return null;
}
@override
- R visitUnresolvedSuperUnary(
- Send node,
- UnaryOperator operator,
- Element element,
+ R errorStaticGetterSet(
+ SendSet node,
+ FunctionElement getter,
+ Node rhs,
A arg) {
- return bulkHandleSuper(node, arg);
+ apply(rhs, arg);
+ return null;
}
-}
-abstract class NewBulkMixin<R, A>
- implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
-
- R bulkHandleNew(NewExpression node, A arg) {
- return bulkHandleNode(
- node, "Constructor invocation `#` unhandled.", arg);
+ @override
+ R errorStaticSetterGet(
+ Send node,
+ FunctionElement setter,
+ A arg) {
+ return null;
}
@override
- R visitAbstractClassConstructorInvoke(
- NewExpression node,
- ConstructorElement element,
- InterfaceType type,
+ R errorStaticSetterInvoke(
+ Send node,
+ FunctionElement setter,
NodeList arguments,
CallStructure callStructure,
A arg) {
- return bulkHandleNew(node, arg);
+ apply(arguments, arg);
+ return null;
}
@override
- R visitConstConstructorInvoke(
- NewExpression node,
- ConstructedConstantExpression constant,
+ R errorSuperGetterSet(
+ SendSet node,
+ FunctionElement getter,
+ Node rhs,
A arg) {
- return bulkHandleNew(node, arg);
+ apply(rhs, arg);
+ return null;
}
@override
- R visitGenerativeConstructorInvoke(
- NewExpression node,
- ConstructorElement constructor,
- InterfaceType type,
- NodeList arguments,
- CallStructure callStructure,
+ R errorSuperMethodSet(
+ Send node,
+ MethodElement method,
+ Node rhs,
A arg) {
- return bulkHandleNew(node, arg);
+ apply(rhs, arg);
+ return null;
}
@override
- R visitRedirectingGenerativeConstructorInvoke(
- NewExpression node,
- ConstructorElement constructor,
- InterfaceType type,
- NodeList arguments,
- CallStructure callStructure,
+ R errorSuperSetterGet(
+ Send node,
+ FunctionElement setter,
A arg) {
- return bulkHandleNew(node, arg);
+ return null;
}
@override
- R visitFactoryConstructorInvoke(
- NewExpression node,
- ConstructorElement constructor,
- InterfaceType type,
+ R errorSuperSetterInvoke(
+ Send node,
+ FunctionElement setter,
NodeList arguments,
CallStructure callStructure,
A arg) {
- return bulkHandleNew(node, arg);
+ apply(arguments, arg);
+ return null;
}
@override
- R visitRedirectingFactoryConstructorInvoke(
- NewExpression node,
- ConstructorElement constructor,
- InterfaceType type,
- ConstructorElement effectiveTarget,
- InterfaceType effectiveTargetType,
- NodeList arguments,
- CallStructure callStructure,
+ R errorTopLevelFunctionSet(
+ Send node,
+ MethodElement function,
+ Node rhs,
A arg) {
- return bulkHandleNew(node, arg);
+ apply(rhs, arg);
+ return null;
}
@override
- R visitUnresolvedClassConstructorInvoke(
- NewExpression node,
- Element element,
- DartType type,
- NodeList arguments,
- Selector selector,
+ R errorTopLevelGetterSet(
+ SendSet node,
+ FunctionElement getter,
+ Node rhs,
A arg) {
- return bulkHandleNew(node, arg);
+ apply(rhs, arg);
+ return null;
}
@override
- R visitUnresolvedConstructorInvoke(
- NewExpression node,
- Element constructor,
- DartType type,
- NodeList arguments,
- Selector selector,
+ R errorTopLevelSetterGet(
+ Send node,
+ FunctionElement setter,
A arg) {
- return bulkHandleNew(node, arg);
+ return null;
}
@override
- R visitUnresolvedRedirectingFactoryConstructorInvoke(
- NewExpression node,
- ConstructorElement constructor,
- InterfaceType type,
- NodeList arguments,
- CallStructure callStructure,
- A arg) {
- return bulkHandleNew(node, arg);
+ R errorTopLevelSetterInvoke(
+ Send node,
+ FunctionElement setter,
+ NodeList arguments,
+ CallStructure callStructure,
+ A arg) {
+ apply(arguments, arg);
+ return null;
}
-}
-/// Visitor that implements [SemanticSendVisitor] by the use of `BulkX` mixins.
-///
-/// This class is useful in itself, but shows how to use the `BulkX` mixins and
-/// tests that the union of the `BulkX` mixins implement all `visit` and `error`
-/// methods of [SemanticSendVisitor].
-class BulkSendVisitor<R, A> extends SemanticSendVisitor<R, A>
- with GetBulkMixin<R, A>,
- SetBulkMixin<R, A>,
- ErrorBulkMixin<R, A>,
- InvokeBulkMixin<R, A>,
- IndexSetBulkMixin<R, A>,
- CompoundBulkMixin<R, A>,
- UnaryBulkMixin<R, A>,
- BaseBulkMixin<R, A>,
- BinaryBulkMixin<R, A>,
- PrefixBulkMixin<R, A>,
- PostfixBulkMixin<R, A>,
- NewBulkMixin<R, A> {
@override
- R apply(Node node, A arg) {
- throw new UnimplementedError("BulkSendVisitor.apply unimplemented");
+ R errorTypeVariableTypeLiteralSet(
+ SendSet node,
+ TypeVariableElement element,
+ Node rhs,
+ A arg) {
+ apply(rhs, arg);
+ return null;
}
@override
- R bulkHandleNode(Node node, String message, A arg) {
- throw new UnimplementedError(
- "BulkSendVisitor.bulkHandleNode unimplemented");
- }
-}
-
-/// Mixin that implements all `visitXParameterDecl` and
-/// `visitXInitializingFormalDecl` methods of [SemanticDeclarationVisitor]
-/// by delegating to a bulk handler.
-///
-/// Use this mixin to provide a trivial implementation for these methods.
-abstract class ParameterBulkMixin<R, A>
- implements SemanticDeclarationVisitor<R, A>, BulkHandle<R, A> {
-
- R bulkHandleParameterDeclaration(VariableDefinitions node, A arg) {
- return bulkHandleNode(
- node, "Parameter declaration `#` unhandled.", arg);
+ R errorTypedefTypeLiteralSet(
+ SendSet node,
+ ConstantExpression constant,
+ Node rhs,
+ A arg) {
+ apply(rhs, arg);
+ return null;
}
@override
- R visitInitializingFormalDeclaration(
- VariableDefinitions node,
- Node definition,
- InitializingFormalElement parameter,
- int index,
+ R visitUnresolvedSuperIndex(
+ Send node,
+ Element function,
+ Node index,
A arg) {
- return bulkHandleParameterDeclaration(node, arg);
+ apply(index, arg);
+ return null;
}
@override
- R visitNamedInitializingFormalDeclaration(
- VariableDefinitions node,
- Node definition,
- InitializingFormalElement parameter,
- ConstantExpression defaultValue,
+ R visitUnresolvedSuperGet(
+ Send node,
+ Element element,
A arg) {
- return bulkHandleParameterDeclaration(node, arg);
+ return null;
}
@override
- R visitNamedParameterDeclaration(
- VariableDefinitions node,
- Node definition,
- ParameterElement parameter,
- ConstantExpression defaultValue,
+ R visitUnresolvedSuperInvoke(
+ Send node,
+ Element function,
+ NodeList arguments,
+ Selector selector,
A arg) {
- return bulkHandleParameterDeclaration(node, arg);
+ apply(arguments, arg);
+ return null;
}
@override
- R visitOptionalInitializingFormalDeclaration(
- VariableDefinitions node,
- Node definition,
- InitializingFormalElement parameter,
- ConstantExpression defaultValue,
- int index,
+ R visitAs(
+ Send node,
+ Node expression,
+ DartType type,
A arg) {
- return bulkHandleParameterDeclaration(node, arg);
+ apply(expression, arg);
+ return null;
}
@override
- R visitOptionalParameterDeclaration(
- VariableDefinitions node,
- Node definition,
- ParameterElement parameter,
- ConstantExpression defaultValue,
- int index,
+ R visitAssert(
+ Send node,
+ Node expression,
A arg) {
- return bulkHandleParameterDeclaration(node, arg);
+ apply(expression, arg);
+ return null;
}
@override
- R visitParameterDeclaration(
- VariableDefinitions node,
- Node definition,
- ParameterElement parameter,
- int index,
+ R visitBinary(
+ Send node,
+ Node left,
+ BinaryOperator operator,
+ Node right,
A arg) {
- return bulkHandleParameterDeclaration(node, arg);
- }
-}
-
-/// Mixin that implements all `visitXConstructorDecl` methods of
-/// [SemanticDeclarationVisitor] by delegating to a bulk handler.
-///
-/// Use this mixin to provide a trivial implementation for these methods.
-abstract class ConstructorBulkMixin<R, A>
- implements SemanticDeclarationVisitor<R, A>, BulkHandle<R, A> {
-
- R bulkHandleConstructorDeclaration(FunctionExpression node, A arg) {
- return bulkHandleNode(
- node, "Constructor declaration `#` unhandled.", arg);
+ apply(left, arg);
+ apply(right, arg);
+ return null;
}
@override
- R visitFactoryConstructorDeclaration(
- FunctionExpression node,
- ConstructorElement constructor,
- NodeList parameters,
- Node body,
+ R errorClassTypeLiteralCompound(
+ Send node,
+ ConstantExpression constant,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return bulkHandleConstructorDeclaration(node, arg);
+ apply(rhs, arg);
+ return null;
}
@override
- R visitGenerativeConstructorDeclaration(
- FunctionExpression node,
- ConstructorElement constructor,
- NodeList parameters,
- NodeList initializers,
- Node body,
+ R visitClassTypeLiteralGet(
+ Send node,
+ ConstantExpression constant,
A arg) {
- return bulkHandleConstructorDeclaration(node, arg);
+ return null;
}
@override
- R visitRedirectingFactoryConstructorDeclaration(
- FunctionExpression node,
- ConstructorElement constructor,
- NodeList parameters,
- InterfaceType redirectionType,
- ConstructorElement redirectionTarget,
+ R visitClassTypeLiteralInvoke(
+ Send node,
+ ConstantExpression constant,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandleConstructorDeclaration(node, arg);
+ apply(arguments, arg);
+ return null;
}
@override
- R visitRedirectingGenerativeConstructorDeclaration(
- FunctionExpression node,
- ConstructorElement constructor,
- NodeList parameters,
- NodeList initializers,
+ R errorClassTypeLiteralPostfix(
+ Send node,
+ ConstantExpression constant,
+ IncDecOperator operator,
A arg) {
- return bulkHandleConstructorDeclaration(node, arg);
+ return null;
}
-}
-/// Mixin that implements all constructor initializer visitor methods of
-/// [SemanticDeclarationVisitor] by delegating to a bulk handler.
-///
-/// Use this mixin to provide a trivial implementation for these methods.
-abstract class InitializerBulkMixin<R, A>
- implements SemanticDeclarationVisitor<R, A>, BulkHandle<R, A> {
-
- R bulkHandleInitializer(Send node, A arg) {
- return bulkHandleNode(
- node, "Initializer `#` unhandled.", arg);
+ @override
+ R errorClassTypeLiteralPrefix(
+ Send node,
+ ConstantExpression constant,
+ IncDecOperator operator,
+ A arg) {
+ return null;
}
@override
- R errorUnresolvedFieldInitializer(
+ R visitCompoundIndexSet(
SendSet node,
- Element element,
- Node initializer,
+ Node receiver,
+ Node index,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return bulkHandleInitializer(node, arg);
+ apply(receiver, arg);
+ apply(index, arg);
+ apply(rhs, arg);
+ return null;
}
@override
- R errorUnresolvedSuperConstructorInvoke(
+ R visitConstantGet(
Send node,
- Element element,
- NodeList arguments,
- Selector selector,
+ ConstantExpression constant,
A arg) {
- return bulkHandleInitializer(node, arg);
+ return null;
}
@override
- R errorUnresolvedThisConstructorInvoke(
+ R visitConstantInvoke(
Send node,
- Element element,
+ ConstantExpression constant,
NodeList arguments,
- Selector selector,
+ CallStructure callStructure,
A arg) {
- return bulkHandleInitializer(node, arg);
+ apply(arguments, arg);
+ return null;
}
@override
- R visitFieldInitializer(
- SendSet node,
- FieldElement field,
- Node initializer,
+ R visitDynamicPropertyCompound(
+ Send node,
+ Node receiver,
+ AssignmentOperator operator,
+ Node rhs,
+ Selector getterSelector,
+ Selector setterSelector,
A arg) {
- return bulkHandleInitializer(node, arg);
+ apply(receiver, arg);
+ apply(rhs, arg);
+ return null;
}
@override
- R visitSuperConstructorInvoke(
+ R visitDynamicPropertyGet(
Send node,
- ConstructorElement superConstructor,
- InterfaceType type,
- NodeList arguments,
+ Node receiver,
Selector selector,
A arg) {
- return bulkHandleInitializer(node, arg);
+ apply(receiver, arg);
+ return null;
}
@override
- R visitThisConstructorInvoke(
+ R visitDynamicPropertyInvoke(
Send node,
- ConstructorElement thisConstructor,
+ Node receiver,
NodeList arguments,
Selector selector,
A arg) {
- return bulkHandleInitializer(node, arg);
- }
-}
-
-/// Mixin that implements all function declaration visitor methods of
-/// [SemanticDeclarationVisitor] by delegating to a bulk handler.
-///
-/// Use this mixin to provide a trivial implementation for these methods.
-abstract class FunctionBulkMixin<R, A>
- implements SemanticDeclarationVisitor<R, A>, BulkHandle<R, A> {
-
- R bulkHandleFunctionDeclaration(FunctionExpression node, A arg) {
- return bulkHandleNode(
- node, "Function declaration `#` unhandled.", arg);
+ apply(receiver, arg);
+ apply(arguments, arg);
+ return null;
}
@override
- R visitAbstractGetterDeclaration(
- FunctionExpression node,
- MethodElement getter,
+ R visitDynamicPropertyPostfix(
+ Send node,
+ Node receiver,
+ IncDecOperator operator,
+ Selector getterSelector,
+ Selector setterSelector,
A arg) {
- return bulkHandleFunctionDeclaration(node, arg);
+ apply(receiver, arg);
+ return null;
}
@override
- R visitAbstractMethodDeclaration(
- FunctionExpression node,
- MethodElement method,
- NodeList parameters,
+ R visitDynamicPropertyPrefix(
+ Send node,
+ Node receiver,
+ IncDecOperator operator,
+ Selector getterSelector,
+ Selector setterSelector,
A arg) {
- return bulkHandleFunctionDeclaration(node, arg);
+ apply(receiver, arg);
+ return null;
}
@override
- R visitAbstractSetterDeclaration(
- FunctionExpression node,
- MethodElement setter,
- NodeList parameters,
+ R visitDynamicPropertySet(
+ SendSet node,
+ Node receiver,
+ Selector selector,
+ Node rhs,
A arg) {
- return bulkHandleFunctionDeclaration(node, arg);
+ apply(rhs, arg);
+ return null;
}
@override
- R visitClosureDeclaration(
- FunctionExpression node,
- LocalFunctionElement closure,
- NodeList parameters,
- Node body,
+ R errorDynamicTypeLiteralCompound(
+ Send node,
+ ConstantExpression constant,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return bulkHandleFunctionDeclaration(node, arg);
+ apply(rhs, arg);
+ return null;
}
@override
- R visitInstanceGetterDeclaration(
- FunctionExpression node,
- MethodElement getter,
- Node body,
+ R visitDynamicTypeLiteralGet(
+ Send node,
+ ConstantExpression constant,
A arg) {
- return bulkHandleFunctionDeclaration(node, arg);
+ return null;
}
@override
- R visitInstanceMethodDeclaration(
- FunctionExpression node,
- MethodElement method,
- NodeList parameters,
- Node body,
+ R visitDynamicTypeLiteralInvoke(
+ Send node,
+ ConstantExpression constant,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandleFunctionDeclaration(node, arg);
+ apply(arguments, arg);
+ return null;
}
@override
- R visitInstanceSetterDeclaration(
- FunctionExpression node,
- MethodElement setter,
- NodeList parameters,
- Node body,
+ R errorDynamicTypeLiteralPostfix(
+ Send node,
+ ConstantExpression constant,
+ IncDecOperator operator,
A arg) {
- return bulkHandleFunctionDeclaration(node, arg);
+ return null;
}
@override
- R visitLocalFunctionDeclaration(
- FunctionExpression node,
- LocalFunctionElement function,
- NodeList parameters,
- Node body,
+ R errorDynamicTypeLiteralPrefix(
+ Send node,
+ ConstantExpression constant,
+ IncDecOperator operator,
A arg) {
- return bulkHandleFunctionDeclaration(node, arg);
+ return null;
}
@override
- R visitStaticFunctionDeclaration(
- FunctionExpression node,
- MethodElement function,
- NodeList parameters,
- Node body,
+ R visitEquals(
+ Send node,
+ Node left,
+ Node right,
A arg) {
- return bulkHandleFunctionDeclaration(node, arg);
+ apply(left, arg);
+ apply(right, arg);
+ return null;
}
@override
- R visitStaticGetterDeclaration(
- FunctionExpression node,
- MethodElement getter,
- Node body,
- A arg) {
- return bulkHandleFunctionDeclaration(node, arg);
- }
-
- @override
- R visitStaticSetterDeclaration(
- FunctionExpression node,
- MethodElement setter,
- NodeList parameters,
- Node body,
+ R visitExpressionInvoke(
+ Send node,
+ Node expression,
+ NodeList arguments,
+ Selector selector,
A arg) {
- return bulkHandleFunctionDeclaration(node, arg);
+ apply(expression, arg);
+ apply(arguments, arg);
+ return null;
}
@override
- R visitTopLevelFunctionDeclaration(
- FunctionExpression node,
- MethodElement function,
- NodeList parameters,
- Node body,
+ R visitIndex(
+ Send node,
+ Node receiver,
+ Node index,
A arg) {
- return bulkHandleFunctionDeclaration(node, arg);
+ apply(receiver, arg);
+ apply(index, arg);
+ return null;
}
@override
- R visitTopLevelGetterDeclaration(
- FunctionExpression node,
- MethodElement getter,
- Node body,
+ R visitIndexSet(
+ SendSet node,
+ Node receiver,
+ Node index,
+ Node rhs,
A arg) {
- return bulkHandleFunctionDeclaration(node, arg);
+ apply(receiver, arg);
+ apply(index, arg);
+ apply(rhs, arg);
+ return null;
}
@override
- R visitTopLevelSetterDeclaration(
- FunctionExpression node,
- MethodElement setter,
- NodeList parameters,
- Node body,
+ R visitIs(
+ Send node,
+ Node expression,
+ DartType type,
A arg) {
- return bulkHandleFunctionDeclaration(node, arg);
- }
-}
-
-/// Mixin that implements all variable/field declaration visitor methods of
-/// [SemanticDeclarationVisitor] by delegating to a bulk handler.
-///
-/// Use this mixin to provide a trivial implementation for these methods.
-abstract class VariableBulkMixin<R, A>
- implements SemanticDeclarationVisitor<R, A>, BulkHandle<R, A> {
-
- R bulkHandleVariableDeclaration(VariableDefinitions node, A arg) {
- return bulkHandleNode(
- node, "Variable declaration `#` unhandled.", arg);
+ apply(expression, arg);
+ return null;
}
@override
- R visitInstanceFieldDeclaration(
- VariableDefinitions node,
- Node definition,
- FieldElement field,
- Node initializer,
+ R visitIsNot(
+ Send node,
+ Node expression,
+ DartType type,
A arg) {
- return bulkHandleVariableDeclaration(node, arg);
+ apply(expression, arg);
+ return null;
}
@override
- R visitLocalConstantDeclaration(
- VariableDefinitions node,
- Node definition,
- LocalVariableElement variable,
- ConstantExpression constant,
+ R visitLocalFunctionGet(
+ Send node,
+ LocalFunctionElement function,
A arg) {
- return bulkHandleVariableDeclaration(node, arg);
+ return null;
}
@override
- R visitLocalVariableDeclaration(
- VariableDefinitions node,
- Node definition,
- LocalVariableElement variable,
- Node initializer,
+ R visitLocalFunctionInvoke(
+ Send node,
+ LocalFunctionElement function,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandleVariableDeclaration(node, arg);
+ apply(arguments, arg);
+ return null;
}
@override
- R visitStaticConstantDeclaration(
- VariableDefinitions node,
- Node definition,
- FieldElement field,
- ConstantExpression constant,
+ R visitLocalVariableCompound(
+ Send node,
+ LocalVariableElement variable,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return bulkHandleVariableDeclaration(node, arg);
+ apply(rhs, arg);
+ return null;
}
@override
- R visitStaticFieldDeclaration(
- VariableDefinitions node,
- Node definition,
- FieldElement field,
- Node initializer,
+ R visitLocalVariableGet(
+ Send node,
+ LocalVariableElement variable,
A arg) {
- return bulkHandleVariableDeclaration(node, arg);
+ return null;
}
@override
- R visitTopLevelConstantDeclaration(
- VariableDefinitions node,
- Node definition,
- FieldElement field,
- ConstantExpression constant,
+ R visitLocalVariableInvoke(
+ Send node,
+ LocalVariableElement variable,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return bulkHandleVariableDeclaration(node, arg);
+ apply(arguments, arg);
+ return null;
}
@override
- R visitTopLevelFieldDeclaration(
- VariableDefinitions node,
- Node definition,
- FieldElement field,
- Node initializer,
+ R visitLocalVariablePostfix(
+ Send node,
+ LocalVariableElement variable,
+ IncDecOperator operator,
A arg) {
- return bulkHandleVariableDeclaration(node, arg);
- }
-}
-
-/// Visitor that implements [SemanticDeclarationVisitor] by the use of `BulkX`
-/// mixins.
-///
-/// This class is useful in itself, but shows how to use the `BulkX` mixins and
-/// tests that the union of the `BulkX` mixins implement all `visit` and `error`
-/// methods of [SemanticDeclarationVisitor].
-class BulkDeclarationVisitor<R, A> extends SemanticDeclarationVisitor<R, A>
- with ConstructorBulkMixin<R, A>,
- FunctionBulkMixin<R, A>,
- VariableBulkMixin<R, A>,
- ParameterBulkMixin<R, A>,
- InitializerBulkMixin<R, A> {
- @override
- R apply(Node node, A arg) {
- throw new UnimplementedError("BulkDeclVisitor.apply unimplemented");
- }
-
- @override
- R bulkHandleNode(Node node, String message, A arg) {
- throw new UnimplementedError(
- "BulkDeclVisitor.bulkHandleNode unimplemented");
- }
-
- @override
- applyInitializers(NodeList initializers, A arg) {
- throw new UnimplementedError(
- "BulkDeclVisitor.applyInitializers unimplemented");
- }
-
- @override
- applyParameters(NodeList parameters, A arg) {
- throw new UnimplementedError(
- "BulkDeclVisitor.applyParameters unimplemented");
- }
-}
-
-
-/// [SemanticSendVisitor] that visits subnodes.
-class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
- @override
- R apply(Node node, A arg) {
- throw new UnimplementedError("TraversalMixin.apply unimplemented");
+ return null;
}
@override
- R errorInvalidAssert(
+ R visitLocalVariablePrefix(
Send node,
- NodeList arguments,
+ LocalVariableElement variable,
+ IncDecOperator operator,
A arg) {
- apply(arguments, arg);
return null;
}
@override
- R errorClassTypeLiteralSet(
+ R visitLocalVariableSet(
SendSet node,
- ConstantExpression constant,
+ LocalVariableElement variable,
Node rhs,
A arg) {
apply(rhs, arg);
@@ -3405,51 +3658,52 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R errorDynamicTypeLiteralSet(
- SendSet node,
- ConstantExpression constant,
- Node rhs,
+ R visitLogicalAnd(
+ Send node,
+ Node left,
+ Node right,
A arg) {
- apply(rhs, arg);
+ apply(left, arg);
+ apply(right, arg);
return null;
}
@override
- R visitFinalLocalVariableCompound(
+ R visitLogicalOr(
Send node,
- LocalVariableElement variable,
- AssignmentOperator operator,
- Node rhs,
+ Node left,
+ Node right,
A arg) {
- apply(rhs, arg);
+ apply(left, arg);
+ apply(right, arg);
return null;
}
@override
- R errorFinalLocalVariableSet(
- SendSet node,
- LocalVariableElement variable,
- Node rhs,
+ R visitNot(
+ Send node,
+ Node expression,
A arg) {
- apply(rhs, arg);
+ apply(expression, arg);
return null;
}
@override
- R visitFinalParameterCompound(
+ R visitNotEquals(
Send node,
- ParameterElement parameter,
- AssignmentOperator operator,
- Node rhs,
+ Node left,
+ Node right,
A arg) {
- apply(rhs, arg);
+ apply(left, arg);
+ apply(right, arg);
return null;
}
@override
- R errorFinalParameterSet(
- SendSet node,
+ R visitParameterCompound(
+ Send node,
ParameterElement parameter,
+ AssignmentOperator operator,
Node rhs,
A arg) {
apply(rhs, arg);
@@ -3457,51 +3711,46 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitFinalStaticFieldCompound(
+ R visitParameterGet(
Send node,
- FieldElement field,
- AssignmentOperator operator,
- Node rhs,
+ ParameterElement parameter,
A arg) {
- apply(rhs, arg);
return null;
}
@override
- R errorFinalStaticFieldSet(
- SendSet node,
- FieldElement field,
- Node rhs,
+ R visitParameterInvoke(
+ Send node,
+ ParameterElement parameter,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- apply(rhs, arg);
+ apply(arguments, arg);
return null;
}
@override
- R errorFinalSuperFieldSet(
- SendSet node,
- FieldElement field,
- Node rhs,
+ R visitParameterPostfix(
+ Send node,
+ ParameterElement parameter,
+ IncDecOperator operator,
A arg) {
- apply(rhs, arg);
return null;
}
@override
- R visitFinalTopLevelFieldCompound(
+ R visitParameterPrefix(
Send node,
- FieldElement field,
- AssignmentOperator operator,
- Node rhs,
+ ParameterElement parameter,
+ IncDecOperator operator,
A arg) {
- apply(rhs, arg);
return null;
}
@override
- R errorFinalTopLevelFieldSet(
+ R visitParameterSet(
SendSet node,
- FieldElement field,
+ ParameterElement parameter,
Node rhs,
A arg) {
apply(rhs, arg);
@@ -3509,9 +3758,9 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitLocalFunctionCompound(
+ R visitStaticFieldCompound(
Send node,
- LocalFunctionElement function,
+ FieldElement field,
AssignmentOperator operator,
Node rhs,
A arg) {
@@ -3520,47 +3769,46 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitLocalFunctionPostfix(
+ R visitStaticFieldGet(
Send node,
- LocalFunctionElement function,
- IncDecOperator operator,
+ FieldElement field,
A arg) {
return null;
}
@override
- R visitLocalFunctionPrefix(
+ R visitStaticFieldInvoke(
Send node,
- LocalFunctionElement function,
- IncDecOperator operator,
+ FieldElement field,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
+ apply(arguments, arg);
return null;
}
@override
- R errorLocalFunctionSet(
- SendSet node,
- LocalFunctionElement function,
- Node rhs,
+ R visitStaticFieldPostfix(
+ Send node,
+ FieldElement field,
+ IncDecOperator operator,
A arg) {
- apply(rhs, arg);
return null;
}
@override
- R errorStaticFunctionSet(
+ R visitStaticFieldPrefix(
Send node,
- MethodElement function,
- Node rhs,
+ FieldElement field,
+ IncDecOperator operator,
A arg) {
- apply(rhs, arg);
return null;
}
@override
- R errorStaticGetterSet(
+ R visitStaticFieldSet(
SendSet node,
- FunctionElement getter,
+ FieldElement field,
Node rhs,
A arg) {
apply(rhs, arg);
@@ -3568,17 +3816,17 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R errorStaticSetterGet(
+ R visitStaticFunctionGet(
Send node,
- FunctionElement setter,
+ MethodElement function,
A arg) {
return null;
}
@override
- R errorStaticSetterInvoke(
+ R visitStaticFunctionInvoke(
Send node,
- FunctionElement setter,
+ MethodElement function,
NodeList arguments,
CallStructure callStructure,
A arg) {
@@ -3587,37 +3835,28 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R errorSuperGetterSet(
- SendSet node,
- FunctionElement getter,
- Node rhs,
- A arg) {
- apply(rhs, arg);
- return null;
- }
-
- @override
- R errorSuperMethodSet(
+ R visitStaticFunctionIncompatibleInvoke(
Send node,
- MethodElement method,
- Node rhs,
+ MethodElement function,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- apply(rhs, arg);
+ apply(arguments, arg);
return null;
}
@override
- R errorSuperSetterGet(
+ R visitStaticGetterGet(
Send node,
- FunctionElement setter,
+ FunctionElement getter,
A arg) {
return null;
}
@override
- R errorSuperSetterInvoke(
+ R visitStaticGetterInvoke(
Send node,
- FunctionElement setter,
+ FunctionElement getter,
NodeList arguments,
CallStructure callStructure,
A arg) {
@@ -3626,9 +3865,11 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R errorTopLevelFunctionSet(
+ R visitStaticGetterSetterCompound(
Send node,
- MethodElement function,
+ FunctionElement getter,
+ FunctionElement setter,
+ AssignmentOperator operator,
Node rhs,
A arg) {
apply(rhs, arg);
@@ -3636,137 +3877,144 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R errorTopLevelGetterSet(
- SendSet node,
+ R visitStaticGetterSetterPostfix(
+ Send node,
FunctionElement getter,
- Node rhs,
+ FunctionElement setter,
+ IncDecOperator operator,
A arg) {
- apply(rhs, arg);
return null;
}
@override
- R errorTopLevelSetterGet(
+ R visitStaticGetterSetterPrefix(
Send node,
+ FunctionElement getter,
FunctionElement setter,
+ IncDecOperator operator,
A arg) {
return null;
}
@override
- R errorTopLevelSetterInvoke(
+ R visitStaticMethodSetterCompound(
Send node,
+ FunctionElement method,
FunctionElement setter,
- NodeList arguments,
- CallStructure callStructure,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- apply(arguments, arg);
+ apply(rhs, arg);
return null;
}
@override
- R errorTypeVariableTypeLiteralSet(
- SendSet node,
- TypeVariableElement element,
- Node rhs,
+ R visitStaticMethodSetterPostfix(
+ Send node,
+ FunctionElement getter,
+ FunctionElement setter,
+ IncDecOperator operator,
A arg) {
- apply(rhs, arg);
return null;
}
@override
- R errorTypedefTypeLiteralSet(
- SendSet node,
- ConstantExpression constant,
- Node rhs,
+ R visitStaticMethodSetterPrefix(
+ Send node,
+ FunctionElement getter,
+ FunctionElement setter,
+ IncDecOperator operator,
A arg) {
- apply(rhs, arg);
return null;
}
@override
- R visitUnresolvedSuperIndex(
- Send node,
- Element function,
- Node index,
+ R visitStaticSetterSet(
+ SendSet node,
+ FunctionElement setter,
+ Node rhs,
A arg) {
- apply(index, arg);
+ apply(rhs, arg);
return null;
}
@override
- R visitUnresolvedSuperGet(
+ R visitSuperBinary(
Send node,
- Element element,
+ FunctionElement function,
+ BinaryOperator operator,
+ Node argument,
A arg) {
+ apply(argument, arg);
return null;
}
@override
- R visitUnresolvedSuperInvoke(
- Send node,
- Element function,
- NodeList arguments,
- Selector selector,
+ R visitSuperCompoundIndexSet(
+ SendSet node,
+ FunctionElement getter,
+ FunctionElement setter,
+ Node index,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- apply(arguments, arg);
+ apply(rhs, arg);
return null;
}
@override
- R visitAs(
+ R visitSuperEquals(
Send node,
- Node expression,
- DartType type,
+ FunctionElement function,
+ Node argument,
A arg) {
- apply(expression, arg);
+ apply(argument, arg);
return null;
}
@override
- R visitAssert(
+ R visitSuperFieldCompound(
Send node,
- Node expression,
+ FieldElement field,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- apply(expression, arg);
+ apply(rhs, arg);
return null;
}
@override
- R visitBinary(
+ R visitSuperFieldFieldPostfix(
Send node,
- Node left,
- BinaryOperator operator,
- Node right,
+ FieldElement readField,
+ FieldElement writtenField,
+ IncDecOperator operator,
A arg) {
- apply(left, arg);
- apply(right, arg);
return null;
}
@override
- R visitClassTypeLiteralCompound(
+ R visitSuperFieldFieldPrefix(
Send node,
- ConstantExpression constant,
- AssignmentOperator operator,
- Node rhs,
+ FieldElement readField,
+ FieldElement writtenField,
+ IncDecOperator operator,
A arg) {
- apply(rhs, arg);
return null;
}
@override
- R visitClassTypeLiteralGet(
+ R visitSuperFieldGet(
Send node,
- ConstantExpression constant,
+ FieldElement field,
A arg) {
return null;
}
@override
- R visitClassTypeLiteralInvoke(
+ R visitSuperFieldInvoke(
Send node,
- ConstantExpression constant,
+ FieldElement field,
NodeList arguments,
CallStructure callStructure,
A arg) {
@@ -3775,150 +4023,109 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitClassTypeLiteralPostfix(
+ R visitSuperFieldPostfix(
Send node,
- ConstantExpression constant,
+ FieldElement field,
IncDecOperator operator,
A arg) {
return null;
}
@override
- R visitClassTypeLiteralPrefix(
+ R visitSuperFieldPrefix(
Send node,
- ConstantExpression constant,
+ FieldElement field,
IncDecOperator operator,
A arg) {
return null;
}
@override
- R visitCompoundIndexSet(
+ R visitSuperFieldSet(
SendSet node,
- Node receiver,
- Node index,
- AssignmentOperator operator,
+ FieldElement field,
Node rhs,
A arg) {
- apply(receiver, arg);
- apply(index, arg);
apply(rhs, arg);
return null;
}
@override
- R visitConstantGet(
+ R visitSuperFieldSetterCompound(
Send node,
- ConstantExpression constant,
+ FieldElement field,
+ FunctionElement setter,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
+ apply(rhs, arg);
return null;
}
@override
- R visitConstantInvoke(
+ R visitSuperFieldSetterPostfix(
Send node,
- ConstantExpression constant,
- NodeList arguments,
- CallStructure callStructure,
+ FieldElement field,
+ FunctionElement setter,
+ IncDecOperator operator,
A arg) {
- apply(arguments, arg);
return null;
}
@override
- R visitDynamicPropertyCompound(
+ R visitSuperFieldSetterPrefix(
Send node,
- Node receiver,
- AssignmentOperator operator,
- Node rhs,
- Selector getterSelector,
- Selector setterSelector,
- A arg) {
- apply(receiver, arg);
- apply(rhs, arg);
- return null;
- }
-
- @override
- R visitDynamicPropertyGet(
- Send node,
- Node receiver,
- Selector selector,
+ FieldElement field,
+ FunctionElement setter,
+ IncDecOperator operator,
A arg) {
- apply(receiver, arg);
return null;
}
@override
- R visitDynamicPropertyInvoke(
+ R visitSuperGetterFieldCompound(
Send node,
- Node receiver,
- NodeList arguments,
- Selector selector,
+ FunctionElement getter,
+ FieldElement field,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- apply(receiver, arg);
- apply(arguments, arg);
+ apply(rhs, arg);
return null;
}
@override
- R visitDynamicPropertyPostfix(
+ R visitSuperGetterFieldPostfix(
Send node,
- Node receiver,
+ FunctionElement getter,
+ FieldElement field,
IncDecOperator operator,
- Selector getterSelector,
- Selector setterSelector,
A arg) {
- apply(receiver, arg);
return null;
}
@override
- R visitDynamicPropertyPrefix(
+ R visitSuperGetterFieldPrefix(
Send node,
- Node receiver,
+ FunctionElement getter,
+ FieldElement field,
IncDecOperator operator,
- Selector getterSelector,
- Selector setterSelector,
- A arg) {
- apply(receiver, arg);
- return null;
- }
-
- @override
- R visitDynamicPropertySet(
- SendSet node,
- Node receiver,
- Selector selector,
- Node rhs,
- A arg) {
- apply(rhs, arg);
- return null;
- }
-
- @override
- R visitDynamicTypeLiteralCompound(
- Send node,
- ConstantExpression constant,
- AssignmentOperator operator,
- Node rhs,
A arg) {
- apply(rhs, arg);
return null;
}
@override
- R visitDynamicTypeLiteralGet(
+ R visitSuperGetterGet(
Send node,
- ConstantExpression constant,
+ FunctionElement getter,
A arg) {
return null;
}
@override
- R visitDynamicTypeLiteralInvoke(
+ R visitSuperGetterInvoke(
Send node,
- ConstantExpression constant,
+ FunctionElement getter,
NodeList arguments,
CallStructure callStructure,
A arg) {
@@ -3927,102 +4134,82 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitDynamicTypeLiteralPostfix(
+ R visitSuperGetterSetterCompound(
Send node,
- ConstantExpression constant,
- IncDecOperator operator,
+ FunctionElement getter,
+ FunctionElement setter,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
+ apply(rhs, arg);
return null;
}
@override
- R visitDynamicTypeLiteralPrefix(
+ R visitSuperGetterSetterPostfix(
Send node,
- ConstantExpression constant,
+ FunctionElement getter,
+ FunctionElement setter,
IncDecOperator operator,
A arg) {
return null;
}
@override
- R visitEquals(
- Send node,
- Node left,
- Node right,
- A arg) {
- apply(left, arg);
- apply(right, arg);
- return null;
- }
-
- @override
- R visitExpressionInvoke(
+ R visitSuperGetterSetterPrefix(
Send node,
- Node expression,
- NodeList arguments,
- Selector selector,
+ FunctionElement getter,
+ FunctionElement setter,
+ IncDecOperator operator,
A arg) {
- apply(expression, arg);
- apply(arguments, arg);
return null;
}
@override
- R visitIndex(
+ R visitSuperIndex(
Send node,
- Node receiver,
+ FunctionElement function,
Node index,
A arg) {
- apply(receiver, arg);
apply(index, arg);
return null;
}
@override
- R visitIndexSet(
+ R visitSuperIndexSet(
SendSet node,
- Node receiver,
+ FunctionElement function,
Node index,
Node rhs,
A arg) {
- apply(receiver, arg);
apply(index, arg);
apply(rhs, arg);
return null;
}
@override
- R visitIs(
- Send node,
- Node expression,
- DartType type,
- A arg) {
- apply(expression, arg);
- return null;
- }
-
- @override
- R visitIsNot(
+ R visitSuperMethodGet(
Send node,
- Node expression,
- DartType type,
+ MethodElement method,
A arg) {
- apply(expression, arg);
return null;
}
@override
- R visitLocalFunctionGet(
+ R visitSuperMethodInvoke(
Send node,
- LocalFunctionElement function,
+ MethodElement method,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
+ apply(arguments, arg);
return null;
}
@override
- R visitLocalFunctionInvoke(
+ R visitSuperMethodIncompatibleInvoke(
Send node,
- LocalFunctionElement function,
+ MethodElement method,
NodeList arguments,
CallStructure callStructure,
A arg) {
@@ -4031,9 +4218,10 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitLocalVariableCompound(
+ R visitSuperMethodSetterCompound(
Send node,
- LocalVariableElement variable,
+ FunctionElement method,
+ FunctionElement setter,
AssignmentOperator operator,
Node rhs,
A arg) {
@@ -4042,46 +4230,39 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitLocalVariableGet(
- Send node,
- LocalVariableElement variable,
- A arg) {
- return null;
- }
-
- @override
- R visitLocalVariableInvoke(
+ R visitSuperMethodSetterPostfix(
Send node,
- LocalVariableElement variable,
- NodeList arguments,
- CallStructure callStructure,
+ FunctionElement method,
+ FunctionElement setter,
+ IncDecOperator operator,
A arg) {
- apply(arguments, arg);
return null;
}
@override
- R visitLocalVariablePostfix(
+ R visitSuperMethodSetterPrefix(
Send node,
- LocalVariableElement variable,
+ FunctionElement method,
+ FunctionElement setter,
IncDecOperator operator,
A arg) {
return null;
}
@override
- R visitLocalVariablePrefix(
+ R visitSuperNotEquals(
Send node,
- LocalVariableElement variable,
- IncDecOperator operator,
+ FunctionElement function,
+ Node argument,
A arg) {
+ apply(argument, arg);
return null;
}
@override
- R visitLocalVariableSet(
+ R visitSuperSetterSet(
SendSet node,
- LocalVariableElement variable,
+ FunctionElement setter,
Node rhs,
A arg) {
apply(rhs, arg);
@@ -4089,99 +4270,83 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitLogicalAnd(
- Send node,
- Node left,
- Node right,
- A arg) {
- apply(left, arg);
- apply(right, arg);
- return null;
- }
-
- @override
- R visitLogicalOr(
+ R visitSuperUnary(
Send node,
- Node left,
- Node right,
+ UnaryOperator operator,
+ FunctionElement function,
A arg) {
- apply(left, arg);
- apply(right, arg);
return null;
}
@override
- R visitNot(
- Send node,
- Node expression,
- A arg) {
- apply(expression, arg);
+ R visitThisGet(Identifier node, A arg) {
return null;
}
@override
- R visitNotEquals(
+ R visitThisInvoke(
Send node,
- Node left,
- Node right,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- apply(left, arg);
- apply(right, arg);
+ apply(arguments, arg);
return null;
}
@override
- R visitParameterCompound(
+ R visitThisPropertyCompound(
Send node,
- ParameterElement parameter,
AssignmentOperator operator,
Node rhs,
+ Selector getterSelector,
+ Selector setterSelector,
A arg) {
apply(rhs, arg);
return null;
}
@override
- R visitParameterGet(
+ R visitThisPropertyGet(
Send node,
- ParameterElement parameter,
+ Selector selector,
A arg) {
return null;
}
@override
- R visitParameterInvoke(
+ R visitThisPropertyInvoke(
Send node,
- ParameterElement parameter,
NodeList arguments,
- CallStructure callStructure,
+ Selector selector,
A arg) {
apply(arguments, arg);
return null;
}
@override
- R visitParameterPostfix(
+ R visitThisPropertyPostfix(
Send node,
- ParameterElement parameter,
IncDecOperator operator,
+ Selector getterSelector,
+ Selector setterSelector,
A arg) {
return null;
}
@override
- R visitParameterPrefix(
+ R visitThisPropertyPrefix(
Send node,
- ParameterElement parameter,
IncDecOperator operator,
+ Selector getterSelector,
+ Selector setterSelector,
A arg) {
return null;
}
@override
- R visitParameterSet(
+ R visitThisPropertySet(
SendSet node,
- ParameterElement parameter,
+ Selector selector,
Node rhs,
A arg) {
apply(rhs, arg);
@@ -4189,7 +4354,7 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitStaticFieldCompound(
+ R visitTopLevelFieldCompound(
Send node,
FieldElement field,
AssignmentOperator operator,
@@ -4200,7 +4365,7 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitStaticFieldGet(
+ R visitTopLevelFieldGet(
Send node,
FieldElement field,
A arg) {
@@ -4208,7 +4373,7 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitStaticFieldInvoke(
+ R visitTopLevelFieldInvoke(
Send node,
FieldElement field,
NodeList arguments,
@@ -4219,7 +4384,7 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitStaticFieldPostfix(
+ R visitTopLevelFieldPostfix(
Send node,
FieldElement field,
IncDecOperator operator,
@@ -4228,7 +4393,7 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitStaticFieldPrefix(
+ R visitTopLevelFieldPrefix(
Send node,
FieldElement field,
IncDecOperator operator,
@@ -4237,7 +4402,7 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitStaticFieldSet(
+ R visitTopLevelFieldSet(
SendSet node,
FieldElement field,
Node rhs,
@@ -4247,7 +4412,7 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitStaticFunctionGet(
+ R visitTopLevelFunctionGet(
Send node,
MethodElement function,
A arg) {
@@ -4255,7 +4420,7 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitStaticFunctionInvoke(
+ R visitTopLevelFunctionInvoke(
Send node,
MethodElement function,
NodeList arguments,
@@ -4266,7 +4431,7 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitStaticFunctionIncompatibleInvoke(
+ R visitTopLevelFunctionIncompatibleInvoke(
Send node,
MethodElement function,
NodeList arguments,
@@ -4277,7 +4442,7 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitStaticGetterGet(
+ R visitTopLevelGetterGet(
Send node,
FunctionElement getter,
A arg) {
@@ -4285,7 +4450,7 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitStaticGetterInvoke(
+ R visitTopLevelGetterInvoke(
Send node,
FunctionElement getter,
NodeList arguments,
@@ -4296,7 +4461,7 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitStaticGetterSetterCompound(
+ R visitTopLevelGetterSetterCompound(
Send node,
FunctionElement getter,
FunctionElement setter,
@@ -4308,7 +4473,7 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitStaticGetterSetterPostfix(
+ R visitTopLevelGetterSetterPostfix(
Send node,
FunctionElement getter,
FunctionElement setter,
@@ -4318,7 +4483,7 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitStaticGetterSetterPrefix(
+ R visitTopLevelGetterSetterPrefix(
Send node,
FunctionElement getter,
FunctionElement setter,
@@ -4328,7 +4493,7 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitStaticMethodSetterCompound(
+ R visitTopLevelMethodSetterCompound(
Send node,
FunctionElement method,
FunctionElement setter,
@@ -4340,9 +4505,9 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitStaticMethodSetterPostfix(
+ R visitTopLevelMethodSetterPostfix(
Send node,
- FunctionElement getter,
+ FunctionElement method,
FunctionElement setter,
IncDecOperator operator,
A arg) {
@@ -4350,9 +4515,9 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitStaticMethodSetterPrefix(
+ R visitTopLevelMethodSetterPrefix(
Send node,
- FunctionElement getter,
+ FunctionElement method,
FunctionElement setter,
IncDecOperator operator,
A arg) {
@@ -4360,7 +4525,7 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitStaticSetterSet(
+ R visitTopLevelSetterSet(
SendSet node,
FunctionElement setter,
Node rhs,
@@ -4370,82 +4535,76 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitSuperBinary(
+ R errorTypeVariableTypeLiteralCompound(
Send node,
- FunctionElement function,
- BinaryOperator operator,
- Node argument,
+ TypeVariableElement element,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- apply(argument, arg);
+ apply(rhs, arg);
return null;
}
@override
- R visitSuperCompoundIndexSet(
- SendSet node,
- FunctionElement getter,
- FunctionElement setter,
- Node index,
- AssignmentOperator operator,
- Node rhs,
+ R visitTypeVariableTypeLiteralGet(
+ Send node,
+ TypeVariableElement element,
A arg) {
- apply(rhs, arg);
return null;
}
@override
- R visitSuperEquals(
+ R visitTypeVariableTypeLiteralInvoke(
Send node,
- FunctionElement function,
- Node argument,
+ TypeVariableElement element,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- apply(argument, arg);
+ apply(arguments, arg);
return null;
}
@override
- R visitSuperFieldCompound(
+ R errorTypeVariableTypeLiteralPostfix(
Send node,
- FieldElement field,
- AssignmentOperator operator,
- Node rhs,
+ TypeVariableElement element,
+ IncDecOperator operator,
A arg) {
- apply(rhs, arg);
return null;
}
@override
- R visitSuperFieldFieldPostfix(
+ R errorTypeVariableTypeLiteralPrefix(
Send node,
- FieldElement readField,
- FieldElement writtenField,
+ TypeVariableElement element,
IncDecOperator operator,
A arg) {
return null;
}
@override
- R visitSuperFieldFieldPrefix(
+ R errorTypedefTypeLiteralCompound(
Send node,
- FieldElement readField,
- FieldElement writtenField,
- IncDecOperator operator,
+ ConstantExpression constant,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
+ apply(rhs, arg);
return null;
}
@override
- R visitSuperFieldGet(
+ R visitTypedefTypeLiteralGet(
Send node,
- FieldElement field,
+ ConstantExpression constant,
A arg) {
return null;
}
@override
- R visitSuperFieldInvoke(
+ R visitTypedefTypeLiteralInvoke(
Send node,
- FieldElement field,
+ ConstantExpression constant,
NodeList arguments,
CallStructure callStructure,
A arg) {
@@ -4454,38 +4613,37 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitSuperFieldPostfix(
+ R errorTypedefTypeLiteralPostfix(
Send node,
- FieldElement field,
+ ConstantExpression constant,
IncDecOperator operator,
A arg) {
return null;
}
@override
- R visitSuperFieldPrefix(
+ R errorTypedefTypeLiteralPrefix(
Send node,
- FieldElement field,
+ ConstantExpression constant,
IncDecOperator operator,
A arg) {
return null;
}
@override
- R visitSuperFieldSet(
- SendSet node,
- FieldElement field,
- Node rhs,
+ R visitUnary(
+ Send node,
+ UnaryOperator operator,
+ Node expression,
A arg) {
- apply(rhs, arg);
+ apply(expression, arg);
return null;
}
@override
- R visitSuperFieldSetterCompound(
+ R errorUnresolvedCompound(
Send node,
- FieldElement field,
- FunctionElement setter,
+ Element element,
AssignmentOperator operator,
Node rhs,
A arg) {
@@ -4494,123 +4652,106 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitSuperFieldSetterPostfix(
+ R visitUnresolvedGet(
Send node,
- FieldElement field,
- FunctionElement setter,
- IncDecOperator operator,
+ Element element,
A arg) {
return null;
}
@override
- R visitSuperFieldSetterPrefix(
+ R visitUnresolvedInvoke(
Send node,
- FieldElement field,
- FunctionElement setter,
- IncDecOperator operator,
+ Element element,
+ NodeList arguments,
+ Selector selector,
A arg) {
+ apply(arguments, arg);
return null;
}
@override
- R visitSuperGetterFieldCompound(
+ R errorUnresolvedPostfix(
Send node,
- FunctionElement getter,
- FieldElement field,
- AssignmentOperator operator,
- Node rhs,
+ Element element,
+ IncDecOperator operator,
A arg) {
- apply(rhs, arg);
return null;
}
@override
- R visitSuperGetterFieldPostfix(
+ R errorUnresolvedPrefix(
Send node,
- FunctionElement getter,
- FieldElement field,
+ Element element,
IncDecOperator operator,
A arg) {
return null;
}
@override
- R visitSuperGetterFieldPrefix(
+ R errorUnresolvedSet(
Send node,
- FunctionElement getter,
- FieldElement field,
- IncDecOperator operator,
+ Element element,
+ Node rhs,
A arg) {
+ apply(rhs, arg);
return null;
}
@override
- R visitSuperGetterGet(
+ R errorUndefinedBinaryExpression(
Send node,
- FunctionElement getter,
+ Node left,
+ Operator operator,
+ Node right,
A arg) {
+ apply(left, arg);
+ apply(right, arg);
return null;
}
@override
- R visitSuperGetterInvoke(
+ R errorUndefinedUnaryExpression(
Send node,
- FunctionElement getter,
- NodeList arguments,
- CallStructure callStructure,
+ Operator operator,
+ Node expression,
A arg) {
- apply(arguments, arg);
+ apply(expression, arg);
return null;
}
@override
- R visitSuperGetterSetterCompound(
+ R visitUnresolvedSuperIndexSet(
Send node,
- FunctionElement getter,
- FunctionElement setter,
- AssignmentOperator operator,
+ Element element,
+ Node index,
Node rhs,
A arg) {
+ apply(index, arg);
apply(rhs, arg);
return null;
}
@override
- R visitSuperGetterSetterPostfix(
- Send node,
- FunctionElement getter,
- FunctionElement setter,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitSuperGetterSetterPrefix(
- Send node,
- FunctionElement getter,
- FunctionElement setter,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitSuperIndex(
- Send node,
- FunctionElement function,
+ R visitUnresolvedSuperGetterCompoundIndexSet(
+ SendSet node,
+ Element element,
Node index,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
apply(index, arg);
+ apply(rhs, arg);
return null;
}
@override
- R visitSuperIndexSet(
+ R visitUnresolvedSuperSetterCompoundIndexSet(
SendSet node,
- FunctionElement function,
+ MethodElement getter,
+ Element element,
Node index,
+ AssignmentOperator operator,
Node rhs,
A arg) {
apply(index, arg);
@@ -4619,134 +4760,143 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitSuperMethodGet(
+ R visitUnresolvedSuperBinary(
Send node,
- MethodElement method,
+ Element element,
+ BinaryOperator operator,
+ Node argument,
A arg) {
+ apply(argument, arg);
return null;
}
@override
- R visitSuperMethodInvoke(
+ R visitUnresolvedSuperUnary(
Send node,
- MethodElement method,
- NodeList arguments,
- CallStructure callStructure,
+ UnaryOperator operator,
+ Element element,
A arg) {
- apply(arguments, arg);
return null;
}
@override
- R visitSuperMethodIncompatibleInvoke(
+ R visitUnresolvedSuperGetterIndexPostfix(
Send node,
- MethodElement method,
- NodeList arguments,
- CallStructure callStructure,
+ Element element,
+ Node index,
+ IncDecOperator operator,
A arg) {
- apply(arguments, arg);
+ apply(index, arg);
return null;
}
@override
- R visitSuperMethodSetterCompound(
+ R visitUnresolvedSuperSetterIndexPostfix(
Send node,
- FunctionElement method,
- FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
+ MethodElement getter,
+ Element element,
+ Node index,
+ IncDecOperator operator,
A arg) {
- apply(rhs, arg);
+ apply(index, arg);
return null;
}
@override
- R visitSuperMethodSetterPostfix(
+ R visitUnresolvedSuperGetterIndexPrefix(
Send node,
- FunctionElement method,
- FunctionElement setter,
+ Element element,
+ Node index,
IncDecOperator operator,
A arg) {
+ apply(index, arg);
return null;
}
@override
- R visitSuperMethodSetterPrefix(
+ R visitUnresolvedSuperSetterIndexPrefix(
Send node,
- FunctionElement method,
- FunctionElement setter,
+ MethodElement getter,
+ Element element,
+ Node index,
IncDecOperator operator,
A arg) {
+ apply(index, arg);
return null;
}
@override
- R visitSuperNotEquals(
+ R visitIndexPostfix(
Send node,
- FunctionElement function,
- Node argument,
- A arg) {
- apply(argument, arg);
- return null;
- }
-
- @override
- R visitSuperSetterSet(
- SendSet node,
- FunctionElement setter,
- Node rhs,
+ Node receiver,
+ Node index,
+ IncDecOperator operator,
A arg) {
- apply(rhs, arg);
+ apply(receiver, arg);
+ apply(index, arg);
return null;
}
@override
- R visitSuperUnary(
+ R visitIndexPrefix(
Send node,
- UnaryOperator operator,
- FunctionElement function,
+ Node receiver,
+ Node index,
+ IncDecOperator operator,
A arg) {
+ apply(receiver, arg);
+ apply(index, arg);
return null;
}
@override
- R visitThisGet(Identifier node, A arg) {
+ R visitSuperIndexPostfix(
+ Send node,
+ FunctionElement indexFunction,
+ FunctionElement indexSetFunction,
+ Node index,
+ IncDecOperator operator,
+ A arg) {
+ apply(index, arg);
return null;
}
@override
- R visitThisInvoke(
+ R visitSuperIndexPrefix(
Send node,
- NodeList arguments,
- CallStructure callStructure,
+ FunctionElement indexFunction,
+ FunctionElement indexSetFunction,
+ Node index,
+ IncDecOperator operator,
A arg) {
- apply(arguments, arg);
+ apply(index, arg);
return null;
}
- @override
- R visitThisPropertyCompound(
- Send node,
- AssignmentOperator operator,
- Node rhs,
- Selector getterSelector,
- Selector setterSelector,
+ R visitConstConstructorInvoke(
+ NewExpression node,
+ ConstructedConstantExpression constant,
A arg) {
- apply(rhs, arg);
return null;
}
@override
- R visitThisPropertyGet(
- Send node,
+ R visitUnresolvedClassConstructorInvoke(
+ NewExpression node,
+ Element constructor,
+ DartType type,
+ NodeList arguments,
Selector selector,
A arg) {
+ apply(arguments, arg);
return null;
}
@override
- R visitThisPropertyInvoke(
- Send node,
+ R visitUnresolvedConstructorInvoke(
+ NewExpression node,
+ Element constructor,
+ DartType type,
NodeList arguments,
Selector selector,
A arg) {
@@ -4755,58 +4905,72 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitThisPropertyPostfix(
- Send node,
- IncDecOperator operator,
- Selector getterSelector,
- Selector setterSelector,
+ R visitFactoryConstructorInvoke(
+ NewExpression node,
+ ConstructorElement constructor,
+ InterfaceType type,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
+ apply(arguments, arg);
return null;
}
@override
- R visitThisPropertyPrefix(
- Send node,
- IncDecOperator operator,
- Selector getterSelector,
- Selector setterSelector,
+ R visitGenerativeConstructorInvoke(
+ NewExpression node,
+ ConstructorElement constructor,
+ InterfaceType type,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
+ apply(arguments, arg);
return null;
}
@override
- R visitThisPropertySet(
- SendSet node,
- Selector selector,
- Node rhs,
+ R visitRedirectingFactoryConstructorInvoke(
+ NewExpression node,
+ ConstructorElement constructor,
+ InterfaceType type,
+ ConstructorElement effectiveTarget,
+ InterfaceType effectiveTargetType,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- apply(rhs, arg);
+ apply(arguments, arg);
return null;
}
@override
- R visitTopLevelFieldCompound(
- Send node,
- FieldElement field,
- AssignmentOperator operator,
- Node rhs,
+ R visitRedirectingGenerativeConstructorInvoke(
+ NewExpression node,
+ ConstructorElement constructor,
+ InterfaceType type,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- apply(rhs, arg);
+ apply(arguments, arg);
return null;
}
@override
- R visitTopLevelFieldGet(
- Send node,
- FieldElement field,
+ R visitAbstractClassConstructorInvoke(
+ NewExpression node,
+ ConstructorElement element,
+ InterfaceType type,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
+ apply(arguments, arg);
return null;
}
@override
- R visitTopLevelFieldInvoke(
- Send node,
- FieldElement field,
+ R visitUnresolvedRedirectingFactoryConstructorInvoke(
+ NewExpression node,
+ ConstructorElement constructor,
+ InterfaceType type,
NodeList arguments,
CallStructure callStructure,
A arg) {
@@ -4815,283 +4979,203 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitTopLevelFieldPostfix(
- Send node,
- FieldElement field,
- IncDecOperator operator,
+ R errorNonConstantConstructorInvoke(
+ NewExpression node,
+ Element element,
+ DartType type,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
+ apply(arguments, arg);
return null;
}
+}
+/// [SemanticDeclarationVisitor] that visits subnodes.
+class TraversalDeclarationMixin<R, A>
+ implements SemanticDeclarationVisitor<R, A> {
@override
- R visitTopLevelFieldPrefix(
- Send node,
- FieldElement field,
- IncDecOperator operator,
- A arg) {
- return null;
+ R apply(Node node, A arg) {
+ throw new UnimplementedError("TraversalMixin.apply unimplemented");
}
@override
- R visitTopLevelFieldSet(
- SendSet node,
- FieldElement field,
- Node rhs,
- A arg) {
- apply(rhs, arg);
- return null;
+ applyInitializers(NodeList initializers, A arg) {
+ throw new UnimplementedError(
+ "TraversalMixin.applyInitializers unimplemented");
}
@override
- R visitTopLevelFunctionGet(
- Send node,
- MethodElement function,
- A arg) {
- return null;
+ applyParameters(NodeList parameters, A arg) {
+ throw new UnimplementedError(
+ "TraversalMixin.applyParameters unimplemented");
}
@override
- R visitTopLevelFunctionInvoke(
- Send node,
- MethodElement function,
- NodeList arguments,
- CallStructure callStructure,
+ R visitAbstractMethodDeclaration(
+ FunctionExpression node,
+ MethodElement method,
+ NodeList parameters,
A arg) {
- apply(arguments, arg);
+ applyParameters(parameters, arg);
return null;
}
@override
- R visitTopLevelFunctionIncompatibleInvoke(
- Send node,
- MethodElement function,
- NodeList arguments,
- CallStructure callStructure,
+ R visitClosureDeclaration(
+ FunctionExpression node,
+ LocalFunctionElement function,
+ NodeList parameters,
+ Node body,
A arg) {
- apply(arguments, arg);
+ applyParameters(parameters, arg);
+ apply(body, arg);
return null;
}
@override
- R visitTopLevelGetterGet(
- Send node,
- FunctionElement getter,
+ R visitFactoryConstructorDeclaration(
+ FunctionExpression node,
+ ConstructorElement constructor,
+ NodeList parameters,
+ Node body,
A arg) {
+ applyParameters(parameters, arg);
+ apply(body, arg);
return null;
}
@override
- R visitTopLevelGetterInvoke(
- Send node,
- FunctionElement getter,
- NodeList arguments,
- CallStructure callStructure,
+ R visitFieldInitializer(
+ SendSet node,
+ FieldElement field,
+ Node initializer,
A arg) {
- apply(arguments, arg);
+ apply(initializer, arg);
return null;
}
@override
- R visitTopLevelGetterSetterCompound(
- Send node,
- FunctionElement getter,
- FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
+ R visitGenerativeConstructorDeclaration(
+ FunctionExpression node,
+ ConstructorElement constructor,
+ NodeList parameters,
+ NodeList initializers,
+ Node body,
A arg) {
- apply(rhs, arg);
+ applyParameters(parameters, arg);
+ applyInitializers(initializers, arg);
+ apply(body, arg);
return null;
}
@override
- R visitTopLevelGetterSetterPostfix(
- Send node,
- FunctionElement getter,
- FunctionElement setter,
- IncDecOperator operator,
+ R visitInstanceMethodDeclaration(
+ FunctionExpression node,
+ MethodElement method,
+ NodeList parameters,
+ Node body,
A arg) {
+ applyParameters(parameters, arg);
+ apply(body, arg);
return null;
}
@override
- R visitTopLevelGetterSetterPrefix(
- Send node,
- FunctionElement getter,
- FunctionElement setter,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitTopLevelMethodSetterCompound(
- Send node,
- FunctionElement method,
- FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- apply(rhs, arg);
- return null;
- }
-
- @override
- R visitTopLevelMethodSetterPostfix(
- Send node,
- FunctionElement method,
- FunctionElement setter,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitTopLevelMethodSetterPrefix(
- Send node,
- FunctionElement method,
- FunctionElement setter,
- IncDecOperator operator,
+ R visitLocalFunctionDeclaration(
+ FunctionExpression node,
+ LocalFunctionElement function,
+ NodeList parameters,
+ Node body,
A arg) {
+ applyParameters(parameters, arg);
+ apply(body, arg);
return null;
}
@override
- R visitTopLevelSetterSet(
- SendSet node,
- FunctionElement setter,
- Node rhs,
+ R visitRedirectingFactoryConstructorDeclaration(
+ FunctionExpression node,
+ ConstructorElement constructor,
+ NodeList parameters,
+ InterfaceType redirectionType,
+ ConstructorElement redirectionTarget,
A arg) {
- apply(rhs, arg);
+ applyParameters(parameters, arg);
return null;
}
@override
- R visitTypeVariableTypeLiteralCompound(
- Send node,
- TypeVariableElement element,
- AssignmentOperator operator,
- Node rhs,
+ R visitRedirectingGenerativeConstructorDeclaration(
+ FunctionExpression node,
+ ConstructorElement constructor,
+ NodeList parameters,
+ NodeList initializers,
A arg) {
- apply(rhs, arg);
+ applyParameters(parameters, arg);
+ applyInitializers(initializers, arg);
return null;
}
@override
- R visitTypeVariableTypeLiteralGet(
- Send node,
- TypeVariableElement element,
+ R visitStaticFunctionDeclaration(
+ FunctionExpression node,
+ MethodElement function,
+ NodeList parameters,
+ Node body,
A arg) {
+ applyParameters(parameters, arg);
+ apply(body, arg);
return null;
}
@override
- R visitTypeVariableTypeLiteralInvoke(
+ R visitSuperConstructorInvoke(
Send node,
- TypeVariableElement element,
+ ConstructorElement superConstructor,
+ InterfaceType type,
NodeList arguments,
- CallStructure callStructure,
+ Selector selector,
A arg) {
apply(arguments, arg);
return null;
}
@override
- R visitTypeVariableTypeLiteralPostfix(
- Send node,
- TypeVariableElement element,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitTypeVariableTypeLiteralPrefix(
- Send node,
- TypeVariableElement element,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitTypedefTypeLiteralCompound(
- Send node,
- ConstantExpression constant,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- apply(rhs, arg);
- return null;
- }
-
- @override
- R visitTypedefTypeLiteralGet(
- Send node,
- ConstantExpression constant,
- A arg) {
- return null;
- }
-
- @override
- R visitTypedefTypeLiteralInvoke(
+ R visitThisConstructorInvoke(
Send node,
- ConstantExpression constant,
+ ConstructorElement thisConstructor,
NodeList arguments,
- CallStructure callStructure,
+ Selector selector,
A arg) {
apply(arguments, arg);
return null;
}
@override
- R visitTypedefTypeLiteralPostfix(
- Send node,
- ConstantExpression constant,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitTypedefTypeLiteralPrefix(
- Send node,
- ConstantExpression constant,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitUnary(
- Send node,
- UnaryOperator operator,
- Node expression,
- A arg) {
- apply(expression, arg);
- return null;
- }
-
- @override
- R visitUnresolvedCompound(
- Send node,
- Element element,
- AssignmentOperator operator,
- Node rhs,
+ R visitTopLevelFunctionDeclaration(
+ FunctionExpression node,
+ MethodElement function,
+ NodeList parameters,
+ Node body,
A arg) {
- apply(rhs, arg);
+ applyParameters(parameters, arg);
+ apply(body, arg);
return null;
}
@override
- R visitUnresolvedGet(
- Send node,
+ R errorUnresolvedFieldInitializer(
+ SendSet node,
Element element,
+ Node initializer,
A arg) {
+ apply(initializer, arg);
return null;
}
@override
- R visitUnresolvedInvoke(
+ R errorUnresolvedSuperConstructorInvoke(
Send node,
Element element,
NodeList arguments,
@@ -5102,4484 +5186,1212 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
- R visitUnresolvedPostfix(
- Send node,
- Element element,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitUnresolvedPrefix(
- Send node,
- Element element,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R errorUnresolvedSet(
- Send node,
- Element element,
- Node rhs,
- A arg) {
- apply(rhs, arg);
- return null;
- }
-
- @override
- R errorUndefinedBinaryExpression(
- Send node,
- Node left,
- Operator operator,
- Node right,
- A arg) {
- apply(left, arg);
- apply(right, arg);
- return null;
- }
-
- @override
- R errorUndefinedUnaryExpression(
- Send node,
- Operator operator,
- Node expression,
- A arg) {
- apply(expression, arg);
- return null;
- }
-
- @override
- R visitUnresolvedSuperIndexSet(
+ R errorUnresolvedThisConstructorInvoke(
Send node,
Element element,
- Node index,
- Node rhs,
- A arg) {
- apply(index, arg);
- apply(rhs, arg);
- return null;
- }
-
- @override
- R visitUnresolvedSuperGetterCompoundIndexSet(
- SendSet node,
- Element element,
- MethodElement setter,
- Node index,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- apply(index, arg);
- apply(rhs, arg);
- return null;
- }
-
- @override
- R visitUnresolvedSuperSetterCompoundIndexSet(
- SendSet node,
- MethodElement getter,
- Element element,
- Node index,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- apply(index, arg);
- apply(rhs, arg);
- return null;
- }
-
- @override
- R visitUnresolvedSuperCompoundIndexSet(
- SendSet node,
- Element element,
- Node index,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- apply(index, arg);
- apply(rhs, arg);
- return null;
- }
-
- @override
- R visitUnresolvedSuperBinary(
- Send node,
- Element element,
- BinaryOperator operator,
- Node argument,
- A arg) {
- apply(argument, arg);
- return null;
- }
-
- @override
- R visitUnresolvedSuperUnary(
- Send node,
- UnaryOperator operator,
- Element element,
- A arg) {
- return null;
- }
-
- @override
- R visitUnresolvedSuperGetterIndexPostfix(
- Send node,
- Element element,
- MethodElement setter,
- Node index,
- IncDecOperator operator,
- A arg) {
- apply(index, arg);
- return null;
- }
-
- @override
- R visitUnresolvedSuperSetterIndexPostfix(
- Send node,
- MethodElement getter,
- Element element,
- Node index,
- IncDecOperator operator,
- A arg) {
- apply(index, arg);
- return null;
- }
-
- @override
- R visitUnresolvedSuperIndexPostfix(
- Send node,
- Element element,
- Node index,
- IncDecOperator operator,
- A arg) {
- apply(index, arg);
- return null;
- }
-
- @override
- R visitUnresolvedSuperGetterIndexPrefix(
- Send node,
- Element element,
- MethodElement setter,
- Node index,
- IncDecOperator operator,
- A arg) {
- apply(index, arg);
- return null;
- }
-
- @override
- R visitUnresolvedSuperSetterIndexPrefix(
- Send node,
- MethodElement getter,
- Element element,
- Node index,
- IncDecOperator operator,
- A arg) {
- apply(index, arg);
- return null;
- }
-
- @override
- R visitUnresolvedSuperIndexPrefix(
- Send node,
- Element element,
- Node index,
- IncDecOperator operator,
- A arg) {
- apply(index, arg);
- return null;
- }
-
- @override
- R visitIndexPostfix(
- Send node,
- Node receiver,
- Node index,
- IncDecOperator operator,
- A arg) {
- apply(receiver, arg);
- apply(index, arg);
- return null;
- }
-
- @override
- R visitIndexPrefix(
- Send node,
- Node receiver,
- Node index,
- IncDecOperator operator,
- A arg) {
- apply(receiver, arg);
- apply(index, arg);
- return null;
- }
-
- @override
- R visitSuperIndexPostfix(
- Send node,
- FunctionElement indexFunction,
- FunctionElement indexSetFunction,
- Node index,
- IncDecOperator operator,
- A arg) {
- apply(index, arg);
- return null;
- }
-
- @override
- R visitSuperIndexPrefix(
- Send node,
- FunctionElement indexFunction,
- FunctionElement indexSetFunction,
- Node index,
- IncDecOperator operator,
- A arg) {
- apply(index, arg);
- return null;
- }
-
- @override
- R visitConstConstructorInvoke(
- NewExpression node,
- ConstructedConstantExpression constant,
- A arg) {
- return null;
- }
-
- @override
- R visitUnresolvedClassConstructorInvoke(
- NewExpression node,
- Element constructor,
- DartType type,
- NodeList arguments,
- Selector selector,
- A arg) {
- apply(arguments, arg);
- return null;
- }
-
- @override
- R visitUnresolvedConstructorInvoke(
- NewExpression node,
- Element constructor,
- DartType type,
- NodeList arguments,
- Selector selector,
- A arg) {
- apply(arguments, arg);
- return null;
- }
-
- @override
- R visitFactoryConstructorInvoke(
- NewExpression node,
- ConstructorElement constructor,
- InterfaceType type,
- NodeList arguments,
- CallStructure callStructure,
- A arg) {
- apply(arguments, arg);
- return null;
- }
-
- @override
- R visitGenerativeConstructorInvoke(
- NewExpression node,
- ConstructorElement constructor,
- InterfaceType type,
- NodeList arguments,
- CallStructure callStructure,
- A arg) {
- apply(arguments, arg);
- return null;
- }
-
- @override
- R visitRedirectingFactoryConstructorInvoke(
- NewExpression node,
- ConstructorElement constructor,
- InterfaceType type,
- ConstructorElement effectiveTarget,
- InterfaceType effectiveTargetType,
- NodeList arguments,
- CallStructure callStructure,
- A arg) {
- apply(arguments, arg);
- return null;
- }
-
- @override
- R visitRedirectingGenerativeConstructorInvoke(
- NewExpression node,
- ConstructorElement constructor,
- InterfaceType type,
- NodeList arguments,
- CallStructure callStructure,
- A arg) {
- apply(arguments, arg);
- return null;
- }
-
- @override
- R visitAbstractClassConstructorInvoke(
- NewExpression node,
- ConstructorElement element,
- InterfaceType type,
- NodeList arguments,
- CallStructure callStructure,
- A arg) {
- apply(arguments, arg);
- return null;
- }
-
- @override
- R visitUnresolvedRedirectingFactoryConstructorInvoke(
- NewExpression node,
- ConstructorElement constructor,
- InterfaceType type,
- NodeList arguments,
- CallStructure callStructure,
- A arg) {
- apply(arguments, arg);
- return null;
- }
-
- @override
- R errorNonConstantConstructorInvoke(
- NewExpression node,
- Element element,
- DartType type,
- NodeList arguments,
- CallStructure callStructure,
- A arg) {
- apply(arguments, arg);
- return null;
- }
-
- @override
- R visitUnresolvedStaticGetterCompound(
- Send node,
- Element element,
- MethodElement setter,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- apply(rhs, arg);
- return null;
- }
-
- @override
- R visitUnresolvedTopLevelGetterCompound(
- Send node,
- Element element,
- MethodElement setter,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- apply(rhs, arg);
- return null;
- }
-
- @override
- R visitUnresolvedStaticSetterCompound(
- Send node,
- MethodElement getter,
- Element element,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- apply(rhs, arg);
- return null;
- }
-
- @override
- R visitUnresolvedTopLevelSetterCompound(
- Send node,
- MethodElement getter,
- Element element,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- apply(rhs, arg);
- return null;
- }
-
- @override
- R visitStaticMethodCompound(
- Send node,
- MethodElement method,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- apply(rhs, arg);
- return null;
- }
-
- @override
- R visitUnresolvedStaticGetterPrefix(
- Send node,
- Element element,
- MethodElement setter,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitUnresolvedTopLevelGetterPrefix(
- Send node,
- Element element,
- MethodElement setter,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitUnresolvedStaticSetterPrefix(
- Send node,
- MethodElement getter,
- Element element,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitUnresolvedTopLevelSetterPrefix(
- Send node,
- MethodElement getter,
- Element element,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitStaticMethodPrefix(
- Send node,
- MethodElement method,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitTopLevelMethodPrefix(
- Send node,
- MethodElement method,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitUnresolvedStaticGetterPostfix(
- Send node,
- Element element,
- MethodElement setter,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitUnresolvedTopLevelGetterPostfix(
- Send node,
- Element element,
- MethodElement setter,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitUnresolvedStaticSetterPostfix(
- Send node,
- MethodElement getter,
- Element element,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitUnresolvedTopLevelSetterPostfix(
- Send node,
- MethodElement getter,
- Element element,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitStaticMethodPostfix(
- Send node,
- MethodElement method,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitTopLevelMethodPostfix(
- Send node,
- MethodElement method,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitFinalLocalVariablePostfix(
- Send node,
- LocalVariableElement variable,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitFinalLocalVariablePrefix(
- Send node,
- LocalVariableElement variable,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitFinalParameterPostfix(
- Send node,
- ParameterElement parameter,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitFinalParameterPrefix(
- Send node,
- ParameterElement parameter,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitFinalStaticFieldPostfix(
- Send node,
- FieldElement field,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitFinalStaticFieldPrefix(
- Send node,
- FieldElement field,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitSuperFieldFieldCompound(
- Send node, FieldElement readField,
- FieldElement writtenField,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- apply(rhs, arg);
- return null;
- }
-
- @override
- R visitFinalSuperFieldCompound(
- Send node,
- FieldElement field,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- apply(rhs, arg);
- return null;
- }
-
- @override
- R visitFinalSuperFieldPostfix(
- Send node,
- FieldElement field,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitFinalSuperFieldPrefix(
- Send node,
- FieldElement field,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitSuperMethodCompound(
- Send node,
- FunctionElement method,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- apply(rhs, arg);
- return null;
- }
-
- @override
- R visitSuperMethodPostfix(
- Send node,
- FunctionElement method,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitSuperMethodPrefix(
- Send node,
- FunctionElement method,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitFinalTopLevelFieldPostfix(
- Send node,
- FieldElement field,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitFinalTopLevelFieldPrefix(
- Send node,
- FieldElement field,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitTopLevelMethodCompound(
- Send node,
- FunctionElement method,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- apply(rhs, arg);
- return null;
- }
-
- @override
- R visitUnresolvedSuperCompound(
- Send node,
- Element element,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- apply(rhs, arg);
- return null;
- }
-
- @override
- R visitUnresolvedSuperPostfix(
- Send node,
- Element element,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitUnresolvedSuperPrefix(
- Send node,
- Element element,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitUnresolvedSuperGetterCompound(
- Send node, Element element,
- MethodElement setter,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- apply(rhs, arg);
- return null;
- }
-
- @override
- R visitUnresolvedSuperGetterPostfix(
- Send node,
- Element element,
- MethodElement setter,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitUnresolvedSuperGetterPrefix(
- Send node,
- Element element,
- MethodElement setter,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitUnresolvedSuperSetterCompound(
- Send node, MethodElement getter,
- Element element,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- apply(rhs, arg);
- return null;
- }
-
- @override
- R visitUnresolvedSuperSetterPostfix(
- Send node,
- MethodElement getter,
- Element element,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-
- @override
- R visitUnresolvedSuperSetterPrefix(
- Send node,
- MethodElement getter,
- Element element,
- IncDecOperator operator,
- A arg) {
- return null;
- }
-}
-
-/// [SemanticDeclarationVisitor] that visits subnodes.
-class TraversalDeclarationMixin<R, A>
- implements SemanticDeclarationVisitor<R, A> {
- @override
- R apply(Node node, A arg) {
- throw new UnimplementedError("TraversalMixin.apply unimplemented");
- }
-
- @override
- applyInitializers(NodeList initializers, A arg) {
- throw new UnimplementedError(
- "TraversalMixin.applyInitializers unimplemented");
- }
-
- @override
- applyParameters(NodeList parameters, A arg) {
- throw new UnimplementedError(
- "TraversalMixin.applyParameters unimplemented");
- }
-
- @override
- R visitAbstractMethodDeclaration(
- FunctionExpression node,
- MethodElement method,
- NodeList parameters,
- A arg) {
- applyParameters(parameters, arg);
- return null;
- }
-
- @override
- R visitClosureDeclaration(
- FunctionExpression node,
- LocalFunctionElement function,
- NodeList parameters,
- Node body,
- A arg) {
- applyParameters(parameters, arg);
- apply(body, arg);
- return null;
- }
-
- @override
- R visitFactoryConstructorDeclaration(
- FunctionExpression node,
- ConstructorElement constructor,
- NodeList parameters,
- Node body,
- A arg) {
- applyParameters(parameters, arg);
- apply(body, arg);
- return null;
- }
-
- @override
- R visitFieldInitializer(
- SendSet node,
- FieldElement field,
- Node initializer,
- A arg) {
- apply(initializer, arg);
- return null;
- }
-
- @override
- R visitGenerativeConstructorDeclaration(
- FunctionExpression node,
- ConstructorElement constructor,
- NodeList parameters,
- NodeList initializers,
- Node body,
- A arg) {
- applyParameters(parameters, arg);
- applyInitializers(initializers, arg);
- apply(body, arg);
- return null;
- }
-
- @override
- R visitInstanceMethodDeclaration(
- FunctionExpression node,
- MethodElement method,
- NodeList parameters,
- Node body,
- A arg) {
- applyParameters(parameters, arg);
- apply(body, arg);
- return null;
- }
-
- @override
- R visitLocalFunctionDeclaration(
- FunctionExpression node,
- LocalFunctionElement function,
- NodeList parameters,
- Node body,
- A arg) {
- applyParameters(parameters, arg);
- apply(body, arg);
- return null;
- }
-
- @override
- R visitRedirectingFactoryConstructorDeclaration(
- FunctionExpression node,
- ConstructorElement constructor,
- NodeList parameters,
- InterfaceType redirectionType,
- ConstructorElement redirectionTarget,
- A arg) {
- applyParameters(parameters, arg);
- return null;
- }
-
- @override
- R visitRedirectingGenerativeConstructorDeclaration(
- FunctionExpression node,
- ConstructorElement constructor,
- NodeList parameters,
- NodeList initializers,
- A arg) {
- applyParameters(parameters, arg);
- applyInitializers(initializers, arg);
- return null;
- }
-
- @override
- R visitStaticFunctionDeclaration(
- FunctionExpression node,
- MethodElement function,
- NodeList parameters,
- Node body,
- A arg) {
- applyParameters(parameters, arg);
- apply(body, arg);
- return null;
- }
-
- @override
- R visitSuperConstructorInvoke(
- Send node,
- ConstructorElement superConstructor,
- InterfaceType type,
- NodeList arguments,
- Selector selector,
- A arg) {
- apply(arguments, arg);
- return null;
- }
-
- @override
- R visitThisConstructorInvoke(
- Send node,
- ConstructorElement thisConstructor,
- NodeList arguments,
- Selector selector,
- A arg) {
- apply(arguments, arg);
- return null;
- }
-
- @override
- R visitTopLevelFunctionDeclaration(
- FunctionExpression node,
- MethodElement function,
- NodeList parameters,
- Node body,
- A arg) {
- applyParameters(parameters, arg);
- apply(body, arg);
- return null;
- }
-
- @override
- R errorUnresolvedFieldInitializer(
- SendSet node,
- Element element,
- Node initializer,
- A arg) {
- apply(initializer, arg);
- return null;
- }
-
- @override
- R errorUnresolvedSuperConstructorInvoke(
- Send node,
- Element element,
- NodeList arguments,
- Selector selector,
- A arg) {
- apply(arguments, arg);
- return null;
- }
-
- @override
- R errorUnresolvedThisConstructorInvoke(
- Send node,
- Element element,
- NodeList arguments,
- Selector selector,
- A arg) {
- apply(arguments, arg);
- return null;
- }
-
- @override
- R visitLocalVariableDeclaration(
- VariableDefinitions node,
- Node definition,
- LocalVariableElement variable,
- Node initializer,
- A arg) {
- if (initializer != null) {
- apply(initializer, arg);
- }
- return null;
- }
-
- @override
- R visitOptionalParameterDeclaration(
- VariableDefinitions node,
- Node definition,
- ParameterElement parameter,
- ConstantExpression defaultValue,
- int index,
- A arg) {
- return null;
- }
-
- @override
- R visitParameterDeclaration(
- VariableDefinitions node,
- Node definition,
- ParameterElement parameter,
- int index,
- A arg) {
- return null;
- }
-
- @override
- R visitInitializingFormalDeclaration(
- VariableDefinitions node,
- Node definition,
- InitializingFormalElement initializingFormal,
- int index,
- A arg) {
- return null;
- }
-
- @override
- R visitLocalConstantDeclaration(
- VariableDefinitions node,
- Node definition,
- LocalVariableElement variable,
- ConstantExpression constant,
- A arg) {
- return null;
- }
-
- @override
- R visitNamedInitializingFormalDeclaration(
- VariableDefinitions node,
- Node definition,
- InitializingFormalElement initializingFormal,
- ConstantExpression defaultValue,
- A arg) {
- return null;
- }
-
- @override
- R visitNamedParameterDeclaration(
- VariableDefinitions node,
- Node definition,
- ParameterElement parameter,
- ConstantExpression defaultValue,
- A arg) {
- return null;
- }
-
- @override
- R visitOptionalInitializingFormalDeclaration(
- VariableDefinitions node,
- Node definition,
- InitializingFormalElement initializingFormal,
- ConstantExpression defaultValue,
- int index,
- A arg) {
- return null;
- }
-
- @override
- R visitInstanceFieldDeclaration(
- VariableDefinitions node,
- Node definition,
- FieldElement field,
- Node initializer,
- A arg) {
- if (initializer != null) {
- apply(initializer, arg);
- }
- return null;
- }
-
- @override
- R visitStaticConstantDeclaration(
- VariableDefinitions node,
- Node definition,
- FieldElement field,
- ConstantExpression constant,
- A arg) {
- return null;
- }
-
- @override
- R visitStaticFieldDeclaration(
- VariableDefinitions node,
- Node definition,
- FieldElement field,
- Node initializer,
- A arg) {
- if (initializer != null) {
- apply(initializer, arg);
- }
- return null;
- }
-
- @override
- R visitTopLevelConstantDeclaration(
- VariableDefinitions node,
- Node definition,
- FieldElement field,
- ConstantExpression constant,
- A arg) {
- return null;
- }
-
- @override
- R visitTopLevelFieldDeclaration(
- VariableDefinitions node,
- Node definition,
- FieldElement field,
- Node initializer,
- A arg) {
- if (initializer != null) {
- apply(initializer, arg);
- }
- return null;
- }
-
- @override
- R visitAbstractGetterDeclaration(
- FunctionExpression node,
- MethodElement getter,
- A arg) {
- return null;
- }
-
- @override
- R visitAbstractSetterDeclaration(
- FunctionExpression node,
- MethodElement setter,
- NodeList parameters,
- A arg) {
- applyParameters(parameters, arg);
- return null;
- }
-
- @override
- R visitInstanceGetterDeclaration(
- FunctionExpression node,
- MethodElement getter,
- Node body,
- A arg) {
- apply(body, arg);
- return null;
- }
-
- @override
- R visitInstanceSetterDeclaration(
- FunctionExpression node,
- MethodElement setter,
- NodeList parameters,
- Node body,
- A arg) {
- applyParameters(parameters, arg);
- apply(body, arg);
- return null;
- }
-
- @override
- R visitStaticGetterDeclaration(
- FunctionExpression node,
- MethodElement getter,
- Node body,
- A arg) {
- apply(body, arg);
- return null;
- }
-
- @override
- R visitStaticSetterDeclaration(
- FunctionExpression node,
- MethodElement setter,
- NodeList parameters,
- Node body,
- A arg) {
- applyParameters(parameters, arg);
- apply(body, arg);
- return null;
- }
-
- @override
- R visitTopLevelGetterDeclaration(
- FunctionExpression node,
- MethodElement getter,
- Node body,
- A arg) {
- apply(body, arg);
- return null;
- }
-
- @override
- R visitTopLevelSetterDeclaration(
- FunctionExpression node,
- MethodElement setter,
- NodeList parameters,
- Node body,
- A arg) {
- applyParameters(parameters, arg);
- apply(body, arg);
- return null;
- }
-}
-
-/// AST visitor that visits all normal [Send] and [SendSet] nodes using the
-/// [SemanticVisitor].
-class TraversalVisitor<R, A> extends SemanticVisitor<R, A>
- with TraversalSendMixin<R, A>,
- TraversalDeclarationMixin<R, A> {
- TraversalVisitor(TreeElements elements) : super(elements);
-
- SemanticSendVisitor<R, A> get sendVisitor => this;
-
- SemanticDeclarationVisitor<R, A> get declVisitor => this;
-
- R apply(Node node, A arg) {
- node.accept(this);
- return null;
- }
-
- @override
- applyInitializers(NodeList initializers, A arg) {
- visitInitializers(initializers, arg);
- }
-
- @override
- applyParameters(NodeList parameters, A arg) {
- visitParameters(parameters, arg);
- }
-
- @override
- internalError(Spannable spannable, String message) {
- throw new SpannableAssertionFailure(spannable, message);
- }
-
- @override
- R visitNode(Node node) {
- node.visitChildren(this);
- return null;
- }
-}
-
-/// Mixin that groups all non-compound `visitStaticX` and `visitTopLevelX`
-/// method by delegating calls to `handleStaticX` methods.
-///
-/// This mixin is useful for the cases where both top level members and static
-/// class members are handled uniformly.
-abstract class BaseImplementationOfStaticsMixin<R, A>
- implements SemanticSendVisitor<R, A> {
- R handleStaticFieldGet(
- Send node,
- FieldElement field,
- A arg);
-
- R handleStaticFieldInvoke(
- Send node,
- FieldElement field,
- NodeList arguments,
- CallStructure callStructure,
- A arg);
-
- R handleStaticFieldSet(
- SendSet node,
- FieldElement field,
- Node rhs,
- A arg);
-
- R handleStaticFunctionGet(
- Send node,
- MethodElement function,
- A arg);
-
- R handleStaticFunctionInvoke(
- Send node,
- MethodElement function,
- NodeList arguments,
- CallStructure callStructure,
- A arg);
-
- R handleStaticFunctionIncompatibleInvoke(
- Send node,
- MethodElement function,
- NodeList arguments,
- CallStructure callStructure,
- A arg);
-
- R handleStaticGetterGet(
- Send node,
- FunctionElement getter,
- A arg);
-
- R handleStaticGetterInvoke(
- Send node,
- FunctionElement getter,
- NodeList arguments,
- CallStructure callStructure,
- A arg);
-
- R handleStaticSetterSet(
- SendSet node,
- FunctionElement setter,
- Node rhs,
- A arg);
-
- @override
- R visitStaticFieldGet(
- Send node,
- FieldElement field,
- A arg) {
- return handleStaticFieldGet(node, field, arg);
- }
-
- @override
- R visitStaticFieldInvoke(
- Send node,
- FieldElement field,
- NodeList arguments,
- CallStructure callStructure,
- A arg) {
- return handleStaticFieldInvoke(node, field, arguments, callStructure, arg);
- }
-
- @override
- R visitStaticFieldSet(
- SendSet node,
- FieldElement field,
- Node rhs,
- A arg) {
- return handleStaticFieldSet(node, field, rhs, arg);
- }
-
- @override
- R visitStaticFunctionGet(
- Send node,
- MethodElement function,
- A arg) {
- return handleStaticFunctionGet(node, function, arg);
- }
-
- @override
- R visitStaticFunctionInvoke(
- Send node,
- MethodElement function,
- NodeList arguments,
- CallStructure callStructure,
- A arg) {
- return handleStaticFunctionInvoke(
- node, function, arguments, callStructure, arg);
- }
-
- @override
- R visitStaticFunctionIncompatibleInvoke(
- Send node,
- MethodElement function,
- NodeList arguments,
- CallStructure callStructure,
- A arg) {
- return handleStaticFunctionIncompatibleInvoke(
- node, function, arguments, callStructure, arg);
- }
-
- @override
- R visitStaticGetterGet(
- Send node,
- FunctionElement getter,
- A arg) {
- return handleStaticGetterGet(node, getter, arg);
- }
-
- @override
- R visitStaticGetterInvoke(
- Send node,
- FunctionElement getter,
- NodeList arguments,
- CallStructure callStructure,
- A arg) {
- return handleStaticGetterInvoke(
- node, getter, arguments, callStructure, arg);
- }
-
- @override
- R visitStaticSetterSet(
- SendSet node,
- FunctionElement setter,
- Node rhs,
- A arg) {
- return handleStaticSetterSet(node, setter, rhs, arg);
- }
-
- @override
- R visitTopLevelFieldGet(
- Send node,
- FieldElement field,
- A arg) {
- return handleStaticFieldGet(node, field, arg);
- }
-
- @override
- R visitTopLevelFieldInvoke(
- Send node,
- FieldElement field,
- NodeList arguments,
- CallStructure callStructure,
- A arg) {
- return handleStaticFieldInvoke(node, field, arguments, callStructure, arg);
- }
-
- @override
- R visitTopLevelFieldSet(
- SendSet node,
- FieldElement field,
- Node rhs,
- A arg) {
- return handleStaticFieldSet(node, field, rhs, arg);
- }
-
- @override
- R visitTopLevelFunctionGet(
- Send node,
- MethodElement function,
- A arg) {
- return handleStaticFunctionGet(node, function, arg);
- }
-
- @override
- R visitTopLevelFunctionInvoke(
- Send node,
- MethodElement function,
- NodeList arguments,
- CallStructure callStructure,
- A arg) {
- return handleStaticFunctionInvoke(
- node, function, arguments, callStructure, arg);
- }
-
- @override
- R visitTopLevelFunctionIncompatibleInvoke(
- Send node,
- MethodElement function,
- NodeList arguments,
- CallStructure callStructure,
- A arg) {
- return handleStaticFunctionIncompatibleInvoke(
- node, function, arguments, callStructure, arg);
- }
-
- @override
- R visitTopLevelGetterGet(
- Send node,
- FunctionElement getter,
- A arg) {
- return handleStaticGetterGet(node, getter, arg);
- }
-
- @override
- R visitTopLevelGetterInvoke(
- Send node,
- FunctionElement getter,
- NodeList arguments,
- CallStructure callStructure,
- A arg) {
- return handleStaticGetterInvoke(
- node, getter, arguments, callStructure, arg);
- }
-
- @override
- R visitTopLevelSetterSet(
- SendSet node,
- FunctionElement setter,
- Node rhs,
- A arg) {
- return handleStaticSetterSet(node, setter, rhs, arg);
- }
-}
-
-/// Mixin that groups all compounds visitors `visitStaticX` and `visitTopLevelX`
-/// method by delegating calls to `handleStaticX` methods.
-///
-/// This mixin is useful for the cases where both top level members and static
-/// class members are handled uniformly.
-abstract class BaseImplementationOfStaticCompoundsMixin<R, A>
- implements SemanticSendVisitor<R, A> {
- R handleStaticFieldCompound(
- Send node,
- FieldElement field,
- AssignmentOperator operator,
- Node rhs,
- A arg);
-
- R handleStaticFieldPostfixPrefix(
- Send node,
- FieldElement field,
- IncDecOperator operator,
- A arg,
- {bool isPrefix});
-
- R handleStaticGetterSetterCompound(
- Send node,
- FunctionElement getter,
- FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
- A arg);
-
- R handleStaticGetterSetterPostfixPrefix(
- Send node,
- FunctionElement getter,
- FunctionElement setter,
- IncDecOperator operator,
- A arg,
- {bool isPrefix});
-
- R handleStaticMethodSetterCompound(
- Send node,
- FunctionElement method,
- FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
- A arg);
-
- R handleStaticMethodSetterPostfixPrefix(
- Send node,
- FunctionElement getter,
- FunctionElement setter,
- IncDecOperator operator,
- A arg,
- {bool isPrefix});
-
- R handleFinalStaticFieldCompound(
- Send node,
- FieldElement field,
- AssignmentOperator operator,
- Node rhs,
- A arg);
-
- R handleFinalStaticFieldPostfixPrefix(
- Send node,
- FieldElement field,
- IncDecOperator operator,
- A arg,
- {bool isPrefix});
-
- R handleStaticMethodCompound(
- Send node,
- FunctionElement method,
- AssignmentOperator operator,
- Node rhs,
- A arg);
-
- R handleStaticMethodPostfixPrefix(
- Send node,
- FunctionElement method,
- IncDecOperator operator,
- A arg,
- {bool isPrefix});
-
- R handleUnresolvedStaticGetterCompound(
- Send node,
- Element element,
- FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
- A arg);
-
- R handleUnresolvedStaticGetterPostfixPrefix(
- Send node,
- Element element,
- FunctionElement setter,
- IncDecOperator operator,
- A arg,
- {bool isPrefix});
-
- R handleUnresolvedStaticSetterCompound(
- Send node,
- FunctionElement getter,
- Element element,
- AssignmentOperator operator,
- Node rhs,
- A arg);
-
- R handleUnresolvedStaticSetterPostfixPrefix(
- Send node,
- FunctionElement getter,
- Element element,
- IncDecOperator operator,
- A arg,
- {bool isPrefix});
-
- @override
- R visitStaticFieldCompound(
- Send node,
- FieldElement field,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- return handleStaticFieldCompound(node, field, operator, rhs, arg);
- }
-
- @override
- R visitStaticFieldPostfix(
- Send node,
- FieldElement field,
- IncDecOperator operator,
- A arg) {
- return handleStaticFieldPostfixPrefix(
- node, field, operator, arg, isPrefix: false);
- }
-
- @override
- R visitStaticFieldPrefix(
- Send node,
- FieldElement field,
- IncDecOperator operator,
- A arg) {
- return handleStaticFieldPostfixPrefix(
- node, field, operator, arg, isPrefix: true);
- }
-
- @override
- R visitStaticGetterSetterCompound(
- Send node,
- FunctionElement getter,
- FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- return handleStaticGetterSetterCompound(
- node, getter, setter, operator, rhs, arg);
- }
-
- @override
- R visitStaticGetterSetterPostfix(
- Send node,
- FunctionElement getter,
- FunctionElement setter,
- IncDecOperator operator,
- A arg) {
- return handleStaticGetterSetterPostfixPrefix(
- node, getter, setter, operator, arg, isPrefix: false);
- }
-
- @override
- R visitStaticGetterSetterPrefix(
- Send node,
- FunctionElement getter,
- FunctionElement setter,
- IncDecOperator operator,
- A arg) {
- return handleStaticGetterSetterPostfixPrefix(
- node, getter, setter, operator, arg, isPrefix: true);
- }
-
- @override
- R visitStaticMethodSetterCompound(
- Send node,
- FunctionElement method,
- FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- return handleStaticMethodSetterCompound(
- node, method, setter, operator, rhs, arg);
- }
-
- @override
- R visitStaticMethodSetterPostfix(
- Send node,
- FunctionElement getter,
- FunctionElement setter,
- IncDecOperator operator,
- A arg) {
- return handleStaticMethodSetterPostfixPrefix(
- node, getter, setter, operator, arg, isPrefix: false);
- }
-
- @override
- R visitStaticMethodSetterPrefix(
- Send node,
- FunctionElement getter,
- FunctionElement setter,
- IncDecOperator operator,
- A arg) {
- return handleStaticMethodSetterPostfixPrefix(
- node, getter, setter, operator, arg, isPrefix: true);
- }
-
- @override
- R visitTopLevelFieldCompound(
- Send node,
- FieldElement field,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- return handleStaticFieldCompound(node, field, operator, rhs, arg);
- }
-
- @override
- R visitTopLevelFieldPostfix(
- Send node,
- FieldElement field,
- IncDecOperator operator,
- A arg) {
- return handleStaticFieldPostfixPrefix(
- node, field, operator, arg, isPrefix: false);
- }
-
- @override
- R visitTopLevelFieldPrefix(
- Send node,
- FieldElement field,
- IncDecOperator operator,
- A arg) {
- return handleStaticFieldPostfixPrefix(
- node, field, operator, arg, isPrefix: true);
- }
-
- @override
- R visitTopLevelGetterSetterCompound(
- Send node,
- FunctionElement getter,
- FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- return handleStaticGetterSetterCompound(
- node, getter, setter, operator, rhs, arg);
- }
-
- @override
- R visitTopLevelGetterSetterPostfix(
- Send node,
- FunctionElement getter,
- FunctionElement setter,
- IncDecOperator operator,
- A arg) {
- return handleStaticGetterSetterPostfixPrefix(
- node, getter, setter, operator, arg, isPrefix: false);
- }
-
- @override
- R visitTopLevelGetterSetterPrefix(
- Send node,
- FunctionElement getter,
- FunctionElement setter,
- IncDecOperator operator,
- A arg) {
- return handleStaticGetterSetterPostfixPrefix(
- node, getter, setter, operator, arg, isPrefix: true);
- }
-
- @override
- R visitTopLevelMethodSetterCompound(
- Send node,
- FunctionElement method,
- FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- return handleStaticMethodSetterCompound(
- node, method, setter, operator, rhs, arg);
- }
-
- @override
- R visitTopLevelMethodSetterPostfix(
- Send node,
- FunctionElement method,
- FunctionElement setter,
- IncDecOperator operator,
- A arg) {
- return handleStaticMethodSetterPostfixPrefix(
- node, method, setter, operator, arg, isPrefix: false);
- }
-
- @override
- R visitTopLevelMethodSetterPrefix(
- Send node,
- FunctionElement method,
- FunctionElement setter,
- IncDecOperator operator,
- A arg) {
- return handleStaticMethodSetterPostfixPrefix(
- node, method, setter, operator, arg, isPrefix: true);
- }
-
- @override
- R visitFinalStaticFieldCompound(
- Send node,
- FieldElement field,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- return handleFinalStaticFieldCompound(
- node, field, operator, rhs, arg);
- }
-
- @override
- R visitFinalStaticFieldPostfix(
- Send node,
- FieldElement field,
- IncDecOperator operator,
- A arg) {
- return handleFinalStaticFieldPostfixPrefix(
- node, field, operator, arg, isPrefix: false);
- }
-
- @override
- R visitFinalStaticFieldPrefix(
- Send node,
- FieldElement field,
- IncDecOperator operator,
- A arg) {
- return handleFinalStaticFieldPostfixPrefix(
- node, field, operator, arg, isPrefix: true);
- }
-
- @override
- R visitStaticMethodCompound(
- Send node,
- FunctionElement method,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- return handleStaticMethodCompound(
- node, method, operator, rhs, arg);
- }
-
- @override
- R visitStaticMethodPostfix(
- Send node,
- FunctionElement method,
- IncDecOperator operator,
- A arg) {
- return handleStaticMethodPostfixPrefix(
- node, method, operator, arg, isPrefix: false);
- }
-
- @override
- R visitStaticMethodPrefix(
- Send node,
- FunctionElement method,
- IncDecOperator operator,
- A arg) {
- return handleStaticMethodPostfixPrefix(
- node, method, operator, arg, isPrefix: true);
- }
-
- @override
- R visitUnresolvedStaticGetterCompound(
- Send node,
- Element element,
- FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- return handleUnresolvedStaticGetterCompound(
- node, element, setter, operator, rhs, arg);
- }
-
- @override
- R visitUnresolvedStaticGetterPostfix(
- Send node,
- Element element,
- FunctionElement setter,
- IncDecOperator operator,
- A arg) {
- return handleUnresolvedStaticGetterPostfixPrefix(
- node, element, setter, operator, arg, isPrefix: false);
- }
-
- @override
- R visitUnresolvedStaticGetterPrefix(
- Send node,
- Element element,
- FunctionElement setter,
- IncDecOperator operator,
- A arg) {
- return handleUnresolvedStaticGetterPostfixPrefix(
- node, element, setter, operator, arg, isPrefix: true);
- }
-
- @override
- R visitUnresolvedStaticSetterCompound(
- Send node,
- FunctionElement getter,
- Element element,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- return handleUnresolvedStaticSetterCompound(
- node, getter, element, operator, rhs, arg);
- }
-
- @override
- R visitUnresolvedStaticSetterPostfix(
- Send node,
- FunctionElement getter,
- Element element,
- IncDecOperator operator,
- A arg) {
- return handleUnresolvedStaticSetterPostfixPrefix(
- node, getter, element, operator, arg, isPrefix: false);
- }
-
- @override
- R visitUnresolvedStaticSetterPrefix(
- Send node,
- FunctionElement getter,
- Element element,
- IncDecOperator operator,
- A arg) {
- return handleUnresolvedStaticSetterPostfixPrefix(
- node, getter, element, operator, arg, isPrefix: true);
- }
-}
-
-/// Mixin that groups all non-compound `visitLocalX` and `visitParameterX`
-/// methods by delegating calls to `handleLocalX` methods.
-///
-/// This mixin is useful for the cases where both parameters, local variables,
-/// and local functions, captured or not, are handled uniformly.
-abstract class BaseImplementationOfLocalsMixin<R, A>
- implements SemanticSendVisitor<R, A> {
- R handleLocalGet(
- Send node,
- LocalElement element,
- A arg);
-
- R handleLocalInvoke(
- Send node,
- LocalElement element,
- NodeList arguments,
- CallStructure callStructure,
- A arg);
-
- R handleLocalSet(
- SendSet node,
- LocalElement element,
- Node rhs,
- A arg);
-
- @override
- R visitLocalFunctionGet(
- Send node,
- LocalFunctionElement function,
- A arg) {
- return handleLocalGet(node, function, arg);
- }
-
- @override
- R visitLocalFunctionInvoke(
- Send node,
- LocalFunctionElement function,
- NodeList arguments,
- CallStructure callStructure,
- A arg) {
- return handleLocalInvoke(node, function, arguments, callStructure, arg);
- }
-
- @override
- R visitLocalVariableGet(
- Send node,
- LocalVariableElement variable,
- A arg) {
- return handleLocalGet(node, variable, arg);
- }
-
- @override
- R visitLocalVariableInvoke(
- Send node,
- LocalVariableElement variable,
- NodeList arguments,
- CallStructure callStructure,
- A arg) {
- return handleLocalInvoke(node, variable, arguments, callStructure, arg);
- }
-
- @override
- R visitLocalVariableSet(
- SendSet node,
- LocalVariableElement variable,
- Node rhs,
- A arg) {
- return handleLocalSet(node, variable, rhs, arg);
- }
-
- @override
- R visitParameterGet(
- Send node,
- ParameterElement parameter,
- A arg) {
- return handleLocalGet(node, parameter, arg);
- }
-
- @override
- R visitParameterInvoke(
- Send node,
- ParameterElement parameter,
- NodeList arguments,
- CallStructure callStructure,
- A arg) {
- return handleLocalInvoke(node, parameter, arguments, callStructure, arg);
- }
-
- @override
- R visitParameterSet(
- SendSet node,
- ParameterElement parameter,
- Node rhs,
- A arg) {
- return handleLocalSet(node, parameter, rhs, arg);
- }
-}
-
-/// Mixin that groups all compound `visitLocalX` and `visitParameterX` methods
-/// by delegating calls to `handleLocalX` methods.
-///
-/// This mixin is useful for the cases where both parameters, local variables,
-/// and local functions, captured or not, are handled uniformly.
-abstract class BaseImplementationOfLocalCompoundsMixin<R, A>
- implements SemanticSendVisitor<R, A> {
- R handleLocalCompound(
- Send node,
- LocalElement element,
- AssignmentOperator operator,
- Node rhs,
- A arg);
-
- R handleLocalPostfixPrefix(
- Send node,
- LocalElement element,
- IncDecOperator operator,
- A arg,
- {bool isPrefix});
-
- @override
- R visitLocalVariableCompound(
- Send node,
- LocalVariableElement variable,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- return handleLocalCompound(node, variable, operator, rhs, arg);
- }
-
- @override
- R visitLocalVariablePostfix(
- Send node,
- LocalVariableElement variable,
- IncDecOperator operator,
- A arg) {
- return handleLocalPostfixPrefix(
- node, variable, operator, arg, isPrefix: false);
- }
-
- @override
- R visitLocalVariablePrefix(
- Send node,
- LocalVariableElement variable,
- IncDecOperator operator,
- A arg) {
- return handleLocalPostfixPrefix(
- node, variable, operator, arg, isPrefix: true);
- }
-
- @override
- R visitParameterCompound(
- Send node,
- ParameterElement parameter,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- return handleLocalCompound(node, parameter, operator, rhs, arg);
- }
-
- @override
- R visitParameterPostfix(
- Send node,
- ParameterElement parameter,
- IncDecOperator operator,
- A arg) {
- return handleLocalPostfixPrefix(
- node, parameter, operator, arg, isPrefix: false);
- }
-
- @override
- R visitParameterPrefix(
- Send node,
- ParameterElement parameter,
- IncDecOperator operator,
- A arg) {
- return handleLocalPostfixPrefix(
- node, parameter, operator, arg, isPrefix: true);
- }
-}
-
-/// Mixin that groups all `visitConstantX` and `visitXTypeLiteralY` methods for
-/// constant type literals by delegating calls to `handleConstantX` methods.
-///
-/// This mixin is useful for the cases where expressions on constants are
-/// handled uniformly.
-abstract class BaseImplementationOfConstantsMixin<R, A>
- implements SemanticSendVisitor<R, A> {
- R handleConstantGet(
- Node node,
- ConstantExpression constant,
- A arg);
-
- R handleConstantInvoke(
- Send node,
- ConstantExpression constant,
- NodeList arguments,
- CallStructure callStructure,
- A arg);
-
- @override
- R visitClassTypeLiteralGet(
- Send node,
- ConstantExpression constant,
- A arg) {
- return handleConstantGet(node, constant, arg);
- }
-
- @override
- R visitClassTypeLiteralInvoke(
- Send node,
- ConstantExpression constant,
- NodeList arguments,
- CallStructure callStructure,
- A arg) {
- return handleConstantInvoke(node, constant, arguments, callStructure, arg);
- }
-
- @override
- R visitConstConstructorInvoke(
- NewExpression node,
- ConstructedConstantExpression constant,
- A arg) {
- return handleConstantGet(node, constant, arg);
- }
-
- @override
- R visitConstantGet(
- Send node,
- ConstantExpression constant,
- A arg) {
- return handleConstantGet(node, constant, arg);
- }
-
- @override
- R visitConstantInvoke(
- Send node,
- ConstantExpression constant,
- NodeList arguments,
- CallStructure callStructure,
- A arg) {
- return handleConstantInvoke(node, constant, arguments, callStructure, arg);
- }
-
- @override
- R visitDynamicTypeLiteralGet(
- Send node,
- ConstantExpression constant,
- A arg) {
- return handleConstantGet(node, constant, arg);
- }
-
- @override
- R visitDynamicTypeLiteralInvoke(
- Send node,
- ConstantExpression constant,
- NodeList arguments,
- CallStructure callStructure,
- A arg) {
- return handleConstantInvoke(node, constant, arguments, callStructure, arg);
- }
-
- @override
- R visitTypedefTypeLiteralGet(
- Send node,
- ConstantExpression constant,
- A arg) {
- return handleConstantGet(node, constant, arg);
- }
-
- @override
- R visitTypedefTypeLiteralInvoke(
- Send node,
- ConstantExpression constant,
- NodeList arguments,
- CallStructure callStructure,
- A arg) {
- return handleConstantInvoke(node, constant, arguments, callStructure, arg);
- }
-}
-
-/// Mixin that groups all non-compound `visitDynamicPropertyX` and
-/// `visitThisPropertyY` methods for by delegating calls to `handleDynamicX`
-/// methods, providing `null` as the receiver for the this properties.
-///
-/// This mixin is useful for the cases where dynamic and this properties are
-/// handled uniformly.
-abstract class BaseImplementationOfDynamicsMixin<R, A>
- implements SemanticSendVisitor<R, A> {
- R handleDynamicGet(
- Send node,
- Node receiver,
- Selector selector,
- A arg);
-
- R handleDynamicInvoke(
- Send node,
- Node receiver,
- NodeList arguments,
- Selector selector,
- A arg);
-
- R handleDynamicSet(
- SendSet node,
- Node receiver,
- Selector selector,
- Node rhs,
- A arg);
-
- @override
- R visitDynamicPropertyGet(
- Send node,
- Node receiver,
- Selector selector,
- A arg) {
- return handleDynamicGet(node, receiver, selector, arg);
- }
-
- @override
- R visitDynamicPropertyInvoke(
- Send node,
- Node receiver,
- NodeList arguments,
- Selector selector,
- A arg) {
- return handleDynamicInvoke(node, receiver, arguments, selector, arg);
- }
-
- @override
- R visitDynamicPropertySet(
- SendSet node,
- Node receiver,
- Selector selector,
- Node rhs,
- A arg) {
- return handleDynamicSet(node, receiver, selector, rhs, arg);
- }
-
- @override
- R visitThisPropertyGet(
- Send node,
- Selector selector,
- A arg) {
- return handleDynamicGet(node, null, selector, arg);
- }
-
- @override
- R visitThisPropertyInvoke(
- Send node,
NodeList arguments,
Selector selector,
A arg) {
- return handleDynamicInvoke(node, null, arguments, selector, arg);
- }
-
- @override
- R visitThisPropertySet(
- SendSet node,
- Selector selector,
- Node rhs,
- A arg) {
- return handleDynamicSet(node, null, selector, rhs, arg);
- }
-}
-
-/// Mixin that groups all compounds of `visitDynamicPropertyX` and
-/// `visitThisPropertyY` methods for by delegating calls to `handleDynamicX`
-/// methods, providing `null` as the receiver for the this properties.
-///
-/// This mixin is useful for the cases where dynamic and this properties are
-/// handled uniformly.
-abstract class BaseImplementationOfDynamicCompoundsMixin<R, A>
- implements SemanticSendVisitor<R, A> {
- R handleDynamicCompound(
- Send node,
- Node receiver,
- AssignmentOperator operator,
- Node rhs,
- Selector getterSelector,
- Selector setterSelector,
- A arg);
-
- R handleDynamicPostfixPrefix(
- Send node,
- Node receiver,
- IncDecOperator operator,
- Selector getterSelector,
- Selector setterSelector,
- A arg,
- {bool isPrefix});
-
- R handleDynamicIndexPostfixPrefix(
- Send node,
- Node receiver,
- Node index,
- IncDecOperator operator,
- A arg,
- {bool isPrefix});
-
- @override
- R visitDynamicPropertyCompound(
- Send node,
- Node receiver,
- AssignmentOperator operator,
- Node rhs,
- Selector getterSelector,
- Selector setterSelector,
- A arg) {
- return handleDynamicCompound(
- node, receiver, operator, rhs, getterSelector, setterSelector, arg);
- }
-
- @override
- R visitDynamicPropertyPostfix(
- Send node,
- Node receiver,
- IncDecOperator operator,
- Selector getterSelector,
- Selector setterSelector,
- A arg) {
- return handleDynamicPostfixPrefix(
- node, receiver, operator,
- getterSelector, setterSelector, arg, isPrefix: false);
- }
-
- @override
- R visitDynamicPropertyPrefix(
- Send node,
- Node receiver,
- IncDecOperator operator,
- Selector getterSelector,
- Selector setterSelector,
- A arg) {
- return handleDynamicPostfixPrefix(
- node, receiver, operator,
- getterSelector, setterSelector, arg, isPrefix: true);
- }
-
- @override
- R visitThisPropertyCompound(
- Send node,
- AssignmentOperator operator,
- Node rhs,
- Selector getterSelector,
- Selector setterSelector,
- A arg) {
- return handleDynamicCompound(
- node, null, operator, rhs, getterSelector, setterSelector, arg);
- }
-
- @override
- R visitThisPropertyPostfix(
- Send node,
- IncDecOperator operator,
- Selector getterSelector,
- Selector setterSelector,
- A arg) {
- return handleDynamicPostfixPrefix(
- node, null, operator,
- getterSelector, setterSelector, arg, isPrefix: false);
- }
-
- @override
- R visitThisPropertyPrefix(
- Send node,
- IncDecOperator operator,
- Selector getterSelector,
- Selector setterSelector,
- A arg) {
- return handleDynamicPostfixPrefix(
- node, null, operator,
- getterSelector, setterSelector, arg, isPrefix: true);
- }
-
- @override
- R visitIndexPostfix(
- Send node,
- Node receiver,
- Node index,
- IncDecOperator operator,
- A arg) {
- return handleDynamicIndexPostfixPrefix(
- node, receiver, index, operator, arg, isPrefix: false);
- }
-
- @override
- R visitIndexPrefix(
- Send node,
- Node receiver,
- Node index,
- IncDecOperator operator,
- A arg) {
- return handleDynamicIndexPostfixPrefix(
- node, receiver, index, operator, arg, isPrefix: true);
- }
-}
-
-/// The getter kind for statically resolved compound expressions.
-enum CompoundGetter {
- /// The compound reads from a field.
- FIELD,
-
- /// The compound reads from a getter.
- GETTER,
-
- /// The compound reads (closurizes) a method.
- METHOD,
-
- /// The getter is unresolved. The accompanied element is an erroneous element.
- UNRESOLVED,
-}
-
-/// The setter kind for statically resolved compound expressions.
-enum CompoundSetter {
- /// The compound writes to a field.
- FIELD,
-
- /// The compound writes to a setter.
- SETTER,
-
- /// The setter is unresolved or unassignable. The accompanied element may be
- /// `null`, and erroneous element, or the unassignable element.
- INVALID,
-}
-
-/// The kind of a [CompoundRhs].
-enum CompoundKind {
- /// A prefix expression, like `--a`.
- PREFIX,
-
- /// A postfix expression, like `a++`.
- POSTFIX,
-
- /// A compound assignment, like `a *= b`.
- ASSIGNMENT,
-}
-
-/// The right-hand side of a compound expression.
-abstract class CompoundRhs {
- /// The kind of compound.
- CompoundKind get kind;
-
- /// The binary operator implied by the compound operator.
- BinaryOperator get operator;
-
- /// The explicit right hand side in case of a compound assignment, `null`
- /// otherwise.
- Node get rhs;
-}
-
-/// A prefix or postfix of [incDecOperator].
-class IncDecCompound implements CompoundRhs {
- final CompoundKind kind;
- final IncDecOperator incDecOperator;
-
- IncDecCompound(this.kind, this.incDecOperator);
-
- BinaryOperator get operator => incDecOperator.binaryOperator;
-
- Node get rhs => null;
-}
-
-/// A compound assignment with [assignmentOperator] and [rhs].
-class AssignmentCompound implements CompoundRhs {
- final AssignmentOperator assignmentOperator;
- final Node rhs;
-
- AssignmentCompound(this.assignmentOperator, this.rhs);
-
- CompoundKind get kind => CompoundKind.ASSIGNMENT;
-
- BinaryOperator get operator => assignmentOperator.binaryOperator;
-}
-
-/// Simplified handling of compound assignments and prefix/postfix expressions.
-abstract class BaseImplementationOfCompoundsMixin<R, A>
- implements SemanticSendVisitor<R, A> {
-
- /// Handle a super compounds, like `super.foo += 42` or `--super.bar`.
- R handleSuperCompounds(
- SendSet node,
- Element getter,
- CompoundGetter getterKind,
- Element setter,
- CompoundSetter setterKind,
- CompoundRhs rhs,
- A arg);
-
- /// Handle a static or top level compounds, like `foo += 42` or `--bar`.
- R handleStaticCompounds(
- SendSet node,
- Element getter,
- CompoundGetter getterKind,
- Element setter,
- CompoundSetter setterKind,
- CompoundRhs rhs,
- A arg);
-
- /// Handle a local compounds, like `foo += 42` or `--bar`. If [isSetterValid]
- /// is false [local] is unassignable.
- R handleLocalCompounds(
- SendSet node,
- LocalElement local,
- CompoundRhs rhs,
- A arg,
- {bool isSetterValid});
-
- /// Handle a compounds on a type literal constant, like `Object += 42` or
- /// `--Object`.
- R handleTypeLiteralConstantCompounds(
- SendSet node,
- ConstantExpression constant,
- CompoundRhs rhs,
- A arg);
-
- /// Handle a compounds on a type variable type literal, like `T += 42` or
- /// `--T`.
- R handleTypeVariableTypeLiteralCompounds(
- SendSet node,
- TypeVariableElement typeVariable,
- CompoundRhs rhs,
- A arg);
-
- /// Handle a dynamic compounds, like `o.foo += 42` or `--o.foo`. [receiver] is
- /// `null` for properties on `this`, like `--this.foo` or `--foo`.
- R handleDynamicCompounds(
- Send node,
- Node receiver,
- CompoundRhs rhs,
- Selector getterSelector,
- Selector setterSelector,
- A arg);
-
- R visitDynamicPropertyCompound(
- Send node,
- Node receiver,
- AssignmentOperator operator,
- Node rhs,
- Selector getterSelector,
- Selector setterSelector,
- A arg) {
- return handleDynamicCompounds(
- node,
- receiver,
- new AssignmentCompound(operator, rhs),
- getterSelector,
- setterSelector,
- arg);
- }
-
- @override
- R visitThisPropertyCompound(
- Send node,
- AssignmentOperator operator,
- Node rhs,
- Selector getterSelector,
- Selector setterSelector,
- A arg) {
- return handleDynamicCompounds(
- node,
- null,
- new AssignmentCompound(operator, rhs),
- getterSelector,
- setterSelector,
- arg);
- }
-
- @override
- R visitParameterCompound(
- Send node,
- ParameterElement parameter,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- return handleLocalCompounds(
- node,
- parameter,
- new AssignmentCompound(operator, rhs),
- arg,
- isSetterValid: true);
- }
-
- @override
- R visitFinalParameterCompound(
- Send node,
- ParameterElement parameter,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- return handleLocalCompounds(
- node,
- parameter,
- new AssignmentCompound(operator, rhs),
- arg,
- isSetterValid: false);
+ apply(arguments, arg);
+ return null;
}
@override
- R visitLocalVariableCompound(
- Send node,
+ R visitLocalVariableDeclaration(
+ VariableDefinitions node,
+ Node definition,
LocalVariableElement variable,
- AssignmentOperator operator,
- Node rhs,
+ Node initializer,
A arg) {
- return handleLocalCompounds(
- node,
- variable,
- new AssignmentCompound(operator, rhs),
- arg,
- isSetterValid: true);
+ if (initializer != null) {
+ apply(initializer, arg);
+ }
+ return null;
}
@override
- R visitFinalLocalVariableCompound(
- Send node,
- LocalVariableElement variable,
- AssignmentOperator operator,
- Node rhs,
+ R visitOptionalParameterDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ ParameterElement parameter,
+ ConstantExpression defaultValue,
+ int index,
A arg) {
- return handleLocalCompounds(
- node,
- variable,
- new AssignmentCompound(operator, rhs),
- arg,
- isSetterValid: false);
+ return null;
}
@override
- R visitLocalFunctionCompound(
- Send node,
- LocalFunctionElement function,
- AssignmentOperator operator,
- Node rhs,
+ R visitParameterDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ ParameterElement parameter,
+ int index,
A arg) {
- return handleLocalCompounds(
- node,
- function,
- new AssignmentCompound(operator, rhs),
- arg,
- isSetterValid: false);
+ return null;
}
@override
- R visitStaticFieldCompound(
- Send node,
- FieldElement field,
- AssignmentOperator operator,
- Node rhs,
+ R visitInitializingFormalDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ InitializingFormalElement initializingFormal,
+ int index,
A arg) {
- return handleStaticCompounds(
- node,
- field, CompoundGetter.FIELD,
- field, CompoundSetter.FIELD,
- new AssignmentCompound(operator, rhs),
- arg);
+ return null;
}
@override
- R visitFinalStaticFieldCompound(
- Send node,
- FieldElement field,
- AssignmentOperator operator,
- Node rhs,
+ R visitLocalConstantDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ LocalVariableElement variable,
+ ConstantExpression constant,
A arg) {
- return handleStaticCompounds(
- node,
- field, CompoundGetter.FIELD,
- null, CompoundSetter.INVALID,
- new AssignmentCompound(operator, rhs),
- arg);
+ return null;
}
@override
- R visitStaticGetterSetterCompound(
- Send node,
- FunctionElement getter,
- FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
+ R visitNamedInitializingFormalDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ InitializingFormalElement initializingFormal,
+ ConstantExpression defaultValue,
A arg) {
- return handleStaticCompounds(
- node,
- getter, CompoundGetter.GETTER,
- setter, CompoundSetter.SETTER,
- new AssignmentCompound(operator, rhs),
- arg);
+ return null;
}
@override
- R visitStaticMethodSetterCompound(
- Send node,
- FunctionElement method,
- FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
+ R visitNamedParameterDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ ParameterElement parameter,
+ ConstantExpression defaultValue,
A arg) {
- return handleStaticCompounds(
- node,
- method, CompoundGetter.METHOD,
- setter, CompoundSetter.SETTER,
- new AssignmentCompound(operator, rhs),
- arg);
+ return null;
}
@override
- R visitTopLevelFieldCompound(
- Send node,
- FieldElement field,
- AssignmentOperator operator,
- Node rhs,
+ R visitOptionalInitializingFormalDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ InitializingFormalElement initializingFormal,
+ ConstantExpression defaultValue,
+ int index,
A arg) {
- return handleStaticCompounds(
- node,
- field, CompoundGetter.FIELD,
- field, CompoundSetter.FIELD,
- new AssignmentCompound(operator, rhs),
- arg);
+ return null;
}
@override
- R visitFinalTopLevelFieldCompound(
- Send node,
+ R visitInstanceFieldDeclaration(
+ VariableDefinitions node,
+ Node definition,
FieldElement field,
- AssignmentOperator operator,
- Node rhs,
+ Node initializer,
A arg) {
- return handleStaticCompounds(
- node,
- field, CompoundGetter.FIELD,
- null, CompoundSetter.INVALID,
- new AssignmentCompound(operator, rhs),
- arg);
+ if (initializer != null) {
+ apply(initializer, arg);
+ }
+ return null;
}
@override
- R visitTopLevelGetterSetterCompound(
- Send node,
- FunctionElement getter,
- FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
+ R visitStaticConstantDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ FieldElement field,
+ ConstantExpression constant,
A arg) {
- return handleStaticCompounds(
- node,
- getter, CompoundGetter.GETTER,
- setter, CompoundSetter.SETTER,
- new AssignmentCompound(operator, rhs),
- arg);
+ return null;
}
@override
- R visitTopLevelMethodSetterCompound(
- Send node,
- FunctionElement method,
- FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
+ R visitStaticFieldDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ FieldElement field,
+ Node initializer,
A arg) {
- return handleStaticCompounds(
- node,
- method, CompoundGetter.METHOD,
- setter, CompoundSetter.SETTER,
- new AssignmentCompound(operator, rhs),
- arg);
+ if (initializer != null) {
+ apply(initializer, arg);
+ }
+ return null;
}
@override
- R visitSuperFieldCompound(
- Send node,
+ R visitTopLevelConstantDeclaration(
+ VariableDefinitions node,
+ Node definition,
FieldElement field,
- AssignmentOperator operator,
- Node rhs,
+ ConstantExpression constant,
A arg) {
- return handleSuperCompounds(
- node,
- field, CompoundGetter.FIELD,
- field, CompoundSetter.FIELD,
- new AssignmentCompound(operator, rhs),
- arg);
+ return null;
}
@override
- R visitFinalSuperFieldCompound(
- Send node,
+ R visitTopLevelFieldDeclaration(
+ VariableDefinitions node,
+ Node definition,
FieldElement field,
- AssignmentOperator operator,
- Node rhs,
+ Node initializer,
A arg) {
- return handleSuperCompounds(
- node,
- field, CompoundGetter.FIELD,
- field, CompoundSetter.INVALID,
- new AssignmentCompound(operator, rhs),
- arg);
+ if (initializer != null) {
+ apply(initializer, arg);
+ }
+ return null;
}
@override
- R visitSuperGetterSetterCompound(
- Send node,
- FunctionElement getter,
- FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
+ R visitAbstractGetterDeclaration(
+ FunctionExpression node,
+ MethodElement getter,
A arg) {
- return handleSuperCompounds(
- node,
- getter, CompoundGetter.GETTER,
- setter, CompoundSetter.SETTER,
- new AssignmentCompound(operator, rhs),
- arg);
+ return null;
}
@override
- R visitSuperMethodSetterCompound(
- Send node,
- FunctionElement method,
- FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
+ R visitAbstractSetterDeclaration(
+ FunctionExpression node,
+ MethodElement setter,
+ NodeList parameters,
A arg) {
- return handleSuperCompounds(
- node,
- method, CompoundGetter.METHOD,
- setter, CompoundSetter.SETTER,
- new AssignmentCompound(operator, rhs),
- arg);
+ applyParameters(parameters, arg);
+ return null;
}
@override
- R visitSuperFieldSetterCompound(
- Send node,
- FieldElement field,
- FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
+ R visitInstanceGetterDeclaration(
+ FunctionExpression node,
+ MethodElement getter,
+ Node body,
A arg) {
- return handleSuperCompounds(
- node,
- field, CompoundGetter.FIELD,
- setter, CompoundSetter.SETTER,
- new AssignmentCompound(operator, rhs),
- arg);
+ apply(body, arg);
+ return null;
}
@override
- R visitSuperGetterFieldCompound(
- Send node,
- FunctionElement getter,
- FieldElement field,
- AssignmentOperator operator,
- Node rhs,
+ R visitInstanceSetterDeclaration(
+ FunctionExpression node,
+ MethodElement setter,
+ NodeList parameters,
+ Node body,
A arg) {
- return handleSuperCompounds(
- node,
- getter, CompoundGetter.GETTER,
- field, CompoundSetter.FIELD,
- new AssignmentCompound(operator, rhs),
- arg);
+ applyParameters(parameters, arg);
+ apply(body, arg);
+ return null;
}
@override
- R visitClassTypeLiteralCompound(
- Send node,
- ConstantExpression constant,
- AssignmentOperator operator,
- Node rhs,
+ R visitStaticGetterDeclaration(
+ FunctionExpression node,
+ MethodElement getter,
+ Node body,
A arg) {
- return handleTypeLiteralConstantCompounds(
- node,
- constant,
- new AssignmentCompound(operator, rhs),
- arg);
+ apply(body, arg);
+ return null;
}
@override
- R visitTypedefTypeLiteralCompound(
- Send node,
- ConstantExpression constant,
- AssignmentOperator operator,
- Node rhs,
+ R visitStaticSetterDeclaration(
+ FunctionExpression node,
+ MethodElement setter,
+ NodeList parameters,
+ Node body,
A arg) {
- return handleTypeLiteralConstantCompounds(
- node,
- constant,
- new AssignmentCompound(operator, rhs),
- arg);
+ applyParameters(parameters, arg);
+ apply(body, arg);
+ return null;
}
@override
- R visitTypeVariableTypeLiteralCompound(
- Send node,
- TypeVariableElement element,
- AssignmentOperator operator,
- Node rhs,
+ R visitTopLevelGetterDeclaration(
+ FunctionExpression node,
+ MethodElement getter,
+ Node body,
A arg) {
- return handleTypeVariableTypeLiteralCompounds(
- node,
- element,
- new AssignmentCompound(operator, rhs),
- arg);
+ apply(body, arg);
+ return null;
}
@override
- R visitDynamicTypeLiteralCompound(
- Send node,
- ConstantExpression constant,
- AssignmentOperator operator,
- Node rhs,
+ R visitTopLevelSetterDeclaration(
+ FunctionExpression node,
+ MethodElement setter,
+ NodeList parameters,
+ Node body,
A arg) {
- return handleTypeLiteralConstantCompounds(
- node,
- constant,
- new AssignmentCompound(operator, rhs),
- arg);
+ applyParameters(parameters, arg);
+ apply(body, arg);
+ return null;
}
+}
+/// AST visitor that visits all normal [Send] and [SendSet] nodes using the
+/// [SemanticVisitor].
+class TraversalVisitor<R, A> extends SemanticVisitor<R, A>
+ with TraversalSendMixin<R, A>,
+ TraversalDeclarationMixin<R, A> {
+ TraversalVisitor(TreeElements elements) : super(elements);
- R visitDynamicPropertyPrefix(
- Send node,
- Node receiver,
- IncDecOperator operator,
- Selector getterSelector,
- Selector setterSelector,
- A arg) {
- return handleDynamicCompounds(
- node,
- receiver,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- getterSelector,
- setterSelector,
- arg);
+ SemanticSendVisitor<R, A> get sendVisitor => this;
+
+ SemanticDeclarationVisitor<R, A> get declVisitor => this;
+
+ R apply(Node node, A arg) {
+ node.accept(this);
+ return null;
}
@override
- R visitParameterPrefix(
- Send node,
- ParameterElement parameter,
- IncDecOperator operator,
- A arg) {
- return handleLocalCompounds(
- node,
- parameter,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg,
- isSetterValid: true);
+ applyInitializers(NodeList initializers, A arg) {
+ visitInitializers(initializers, arg);
}
@override
- R visitLocalVariablePrefix(
- Send node,
- LocalVariableElement variable,
- IncDecOperator operator,
- A arg) {
- return handleLocalCompounds(
- node,
- variable,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg,
- isSetterValid: true);
+ applyParameters(NodeList parameters, A arg) {
+ visitParameters(parameters, arg);
}
@override
- R visitLocalFunctionPrefix(
- Send node,
- LocalFunctionElement function,
- IncDecOperator operator,
- A arg) {
- return handleLocalCompounds(
- node,
- function,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg,
- isSetterValid: false);
+ internalError(Spannable spannable, String message) {
+ throw new SpannableAssertionFailure(spannable, message);
}
-
- R visitThisPropertyPrefix(
- Send node,
- IncDecOperator operator,
- Selector getterSelector,
- Selector setterSelector,
- A arg) {
- return handleDynamicCompounds(
- node,
- null,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- getterSelector,
- setterSelector,
- arg);
+ @override
+ R visitNode(Node node) {
+ node.visitChildren(this);
+ return null;
}
+}
- @override
- R visitStaticFieldPrefix(
+/// Mixin that groups all `visitStaticX` and `visitTopLevelX` method by
+/// delegating calls to `handleStaticX` methods.
+///
+/// This mixin is useful for the cases where both top level members and static
+/// class members are handled uniformly.
+abstract class BaseImplementationOfStaticsMixin<R, A>
+ implements SemanticSendVisitor<R, A> {
+ R handleStaticFieldCompound(
Send node,
FieldElement field,
- IncDecOperator operator,
- A arg) {
- return handleStaticCompounds(
- node,
- field, CompoundGetter.FIELD,
- field, CompoundSetter.FIELD,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
- }
+ AssignmentOperator operator,
+ Node rhs,
+ A arg);
- @override
- R visitStaticGetterSetterPrefix(
+ R handleStaticFieldGet(
Send node,
- FunctionElement getter,
- FunctionElement setter,
- IncDecOperator operator,
- A arg) {
- return handleStaticCompounds(
- node,
- getter, CompoundGetter.GETTER,
- setter, CompoundSetter.SETTER,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
- }
-
+ FieldElement field,
+ A arg);
- R visitStaticMethodSetterPrefix(
+ R handleStaticFieldInvoke(
Send node,
- FunctionElement getter,
- FunctionElement setter,
- IncDecOperator operator,
- A arg) {
- return handleStaticCompounds(
- node,
- getter, CompoundGetter.METHOD,
- setter, CompoundSetter.SETTER,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
- }
+ FieldElement field,
+ NodeList arguments,
+ CallStructure callStructure,
+ A arg);
- @override
- R visitTopLevelFieldPrefix(
+ R handleStaticFieldPostfixPrefix(
Send node,
FieldElement field,
IncDecOperator operator,
- A arg) {
- return handleStaticCompounds(
- node,
- field, CompoundGetter.FIELD,
- field, CompoundSetter.FIELD,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
- }
+ A arg,
+ {bool isPrefix});
- @override
- R visitTopLevelGetterSetterPrefix(
- Send node,
- FunctionElement getter,
- FunctionElement setter,
- IncDecOperator operator,
- A arg) {
- return handleStaticCompounds(
- node,
- getter, CompoundGetter.GETTER,
- setter, CompoundSetter.SETTER,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
- }
+ R handleStaticFieldSet(
+ SendSet node,
+ FieldElement field,
+ Node rhs,
+ A arg);
- @override
- R visitTopLevelMethodSetterPrefix(
+ R handleStaticFunctionGet(
Send node,
- FunctionElement method,
- FunctionElement setter,
- IncDecOperator operator,
- A arg) {
- return handleStaticCompounds(
- node,
- method, CompoundGetter.METHOD,
- setter, CompoundSetter.SETTER,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
- }
+ MethodElement function,
+ A arg);
- @override
- R visitSuperFieldPrefix(
+ R handleStaticFunctionInvoke(
Send node,
- FieldElement field,
- IncDecOperator operator,
- A arg) {
- return handleSuperCompounds(
- node,
- field, CompoundGetter.FIELD,
- field, CompoundSetter.FIELD,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
- }
+ MethodElement function,
+ NodeList arguments,
+ CallStructure callStructure,
+ A arg);
- @override
- R visitSuperFieldFieldPrefix(
+ R handleStaticFunctionIncompatibleInvoke(
Send node,
- FieldElement readField,
- FieldElement writtenField,
- IncDecOperator operator,
- A arg) {
- return handleSuperCompounds(
- node,
- readField, CompoundGetter.FIELD,
- writtenField, CompoundSetter.FIELD,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
- }
+ MethodElement function,
+ NodeList arguments,
+ CallStructure callStructure,
+ A arg);
- @override
- R visitSuperFieldSetterPrefix(
+ R handleStaticGetterGet(
Send node,
- FieldElement field,
- FunctionElement setter,
- IncDecOperator operator,
- A arg) {
- return handleSuperCompounds(
- node,
- field, CompoundGetter.FIELD,
- setter, CompoundSetter.SETTER,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
- }
+ FunctionElement getter,
+ A arg);
+ R handleStaticGetterInvoke(
+ Send node,
+ FunctionElement getter,
+ NodeList arguments,
+ CallStructure callStructure,
+ A arg);
- R visitSuperGetterSetterPrefix(
+ R handleStaticGetterSetterCompound(
Send node,
FunctionElement getter,
FunctionElement setter,
- IncDecOperator operator,
- A arg) {
- return handleSuperCompounds(
- node,
- getter, CompoundGetter.GETTER,
- setter, CompoundSetter.SETTER,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
- }
+ AssignmentOperator operator,
+ Node rhs,
+ A arg);
- @override
- R visitSuperGetterFieldPrefix(
+ R handleStaticGetterSetterPostfixPrefix(
Send node,
FunctionElement getter,
- FieldElement field,
+ FunctionElement setter,
IncDecOperator operator,
- A arg) {
- return handleSuperCompounds(
- node,
- getter, CompoundGetter.GETTER,
- field, CompoundSetter.FIELD,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
- }
+ A arg,
+ {bool isPrefix});
- @override
- R visitSuperMethodSetterPrefix(
+ R handleStaticMethodSetterCompound(
Send node,
FunctionElement method,
FunctionElement setter,
- IncDecOperator operator,
- A arg) {
- return handleSuperCompounds(
- node,
- method, CompoundGetter.METHOD,
- setter, CompoundSetter.SETTER,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
- }
+ AssignmentOperator operator,
+ Node rhs,
+ A arg);
- @override
- R visitClassTypeLiteralPrefix(
+ R handleStaticMethodSetterPostfixPrefix(
Send node,
- ConstantExpression constant,
+ FunctionElement getter,
+ FunctionElement setter,
IncDecOperator operator,
- A arg) {
- return handleTypeLiteralConstantCompounds(
- node,
- constant,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
- }
+ A arg,
+ {bool isPrefix});
- @override
- R visitTypedefTypeLiteralPrefix(
- Send node,
- ConstantExpression constant,
- IncDecOperator operator,
- A arg) {
- return handleTypeLiteralConstantCompounds(
- node,
- constant,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
- }
+ R handleStaticSetterSet(
+ SendSet node,
+ FunctionElement setter,
+ Node rhs,
+ A arg);
@override
- R visitTypeVariableTypeLiteralPrefix(
+ R visitStaticFieldCompound(
Send node,
- TypeVariableElement element,
- IncDecOperator operator,
+ FieldElement field,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return handleTypeVariableTypeLiteralCompounds(
- node,
- element,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
+ return handleStaticFieldCompound(node, field, operator, rhs, arg);
}
@override
- R visitDynamicTypeLiteralPrefix(
+ R visitStaticFieldGet(
Send node,
- ConstantExpression constant,
- IncDecOperator operator,
+ FieldElement field,
A arg) {
- return handleTypeLiteralConstantCompounds(
- node,
- constant,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
+ return handleStaticFieldGet(node, field, arg);
}
@override
- R visitDynamicPropertyPostfix(
+ R visitStaticFieldInvoke(
Send node,
- Node receiver,
- IncDecOperator operator,
- Selector getterSelector,
- Selector setterSelector,
+ FieldElement field,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return handleDynamicCompounds(
- node,
- receiver,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- getterSelector,
- setterSelector,
- arg);
+ return handleStaticFieldInvoke(node, field, arguments, callStructure, arg);
}
@override
- R visitParameterPostfix(
+ R visitStaticFieldPostfix(
Send node,
- ParameterElement parameter,
+ FieldElement field,
IncDecOperator operator,
A arg) {
- return handleLocalCompounds(
- node,
- parameter,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg,
- isSetterValid: true);
+ return handleStaticFieldPostfixPrefix(
+ node, field, operator, arg, isPrefix: false);
}
@override
- R visitLocalVariablePostfix(
+ R visitStaticFieldPrefix(
Send node,
- LocalVariableElement variable,
+ FieldElement field,
IncDecOperator operator,
A arg) {
- return handleLocalCompounds(
- node,
- variable,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg,
- isSetterValid: true);
+ return handleStaticFieldPostfixPrefix(
+ node, field, operator, arg, isPrefix: true);
}
@override
- R visitLocalFunctionPostfix(
- Send node,
- LocalFunctionElement function,
- IncDecOperator operator,
- A arg) {
- return handleLocalCompounds(
- node,
- function,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg,
- isSetterValid: false);
- }
-
-
- R visitThisPropertyPostfix(
- Send node,
- IncDecOperator operator,
- Selector getterSelector,
- Selector setterSelector,
+ R visitStaticFieldSet(
+ SendSet node,
+ FieldElement field,
+ Node rhs,
A arg) {
- return handleDynamicCompounds(
- node,
- null,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- getterSelector,
- setterSelector,
- arg);
+ return handleStaticFieldSet(node, field, rhs, arg);
}
@override
- R visitStaticFieldPostfix(
+ R visitStaticFunctionGet(
Send node,
- FieldElement field,
- IncDecOperator operator,
+ MethodElement function,
A arg) {
- return handleStaticCompounds(
- node,
- field, CompoundGetter.FIELD,
- field, CompoundSetter.FIELD,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
+ return handleStaticFunctionGet(node, function, arg);
}
@override
- R visitStaticGetterSetterPostfix(
+ R visitStaticFunctionInvoke(
Send node,
- FunctionElement getter,
- FunctionElement setter,
- IncDecOperator operator,
+ MethodElement function,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return handleStaticCompounds(
- node,
- getter, CompoundGetter.GETTER,
- setter, CompoundSetter.SETTER,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
+ return handleStaticFunctionInvoke(
+ node, function, arguments, callStructure, arg);
}
-
- R visitStaticMethodSetterPostfix(
+ @override
+ R visitStaticFunctionIncompatibleInvoke(
Send node,
- FunctionElement getter,
- FunctionElement setter,
- IncDecOperator operator,
+ MethodElement function,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return handleStaticCompounds(
- node,
- getter, CompoundGetter.METHOD,
- setter, CompoundSetter.SETTER,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
+ return handleStaticFunctionIncompatibleInvoke(
+ node, function, arguments, callStructure, arg);
}
@override
- R visitTopLevelFieldPostfix(
+ R visitStaticGetterGet(
Send node,
- FieldElement field,
- IncDecOperator operator,
+ FunctionElement getter,
A arg) {
- return handleStaticCompounds(
- node,
- field, CompoundGetter.FIELD,
- field, CompoundSetter.FIELD,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
+ return handleStaticGetterGet(node, getter, arg);
}
@override
- R visitTopLevelGetterSetterPostfix(
+ R visitStaticGetterInvoke(
Send node,
FunctionElement getter,
- FunctionElement setter,
- IncDecOperator operator,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return handleStaticCompounds(
- node,
- getter, CompoundGetter.GETTER,
- setter, CompoundSetter.SETTER,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
+ return handleStaticGetterInvoke(
+ node, getter, arguments, callStructure, arg);
}
@override
- R visitTopLevelMethodSetterPostfix(
+ R visitStaticGetterSetterCompound(
Send node,
- FunctionElement method,
+ FunctionElement getter,
FunctionElement setter,
- IncDecOperator operator,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return handleStaticCompounds(
- node,
- method, CompoundGetter.METHOD,
- setter, CompoundSetter.SETTER,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
+ return handleStaticGetterSetterCompound(
+ node, getter, setter, operator, rhs, arg);
}
@override
- R visitSuperFieldPostfix(
+ R visitStaticGetterSetterPostfix(
Send node,
- FieldElement field,
+ FunctionElement getter,
+ FunctionElement setter,
IncDecOperator operator,
A arg) {
- return handleSuperCompounds(
- node,
- field, CompoundGetter.FIELD,
- field, CompoundSetter.FIELD,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
+ return handleStaticGetterSetterPostfixPrefix(
+ node, getter, setter, operator, arg, isPrefix: false);
}
@override
- R visitSuperFieldFieldPostfix(
+ R visitStaticGetterSetterPrefix(
Send node,
- FieldElement readField,
- FieldElement writtenField,
+ FunctionElement getter,
+ FunctionElement setter,
IncDecOperator operator,
A arg) {
- return handleSuperCompounds(
- node,
- readField, CompoundGetter.FIELD,
- writtenField, CompoundSetter.FIELD,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
+ return handleStaticGetterSetterPostfixPrefix(
+ node, getter, setter, operator, arg, isPrefix: true);
}
@override
- R visitSuperFieldSetterPostfix(
+ R visitStaticMethodSetterCompound(
Send node,
- FieldElement field,
+ FunctionElement method,
FunctionElement setter,
- IncDecOperator operator,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return handleSuperCompounds(
- node,
- field, CompoundGetter.FIELD,
- setter, CompoundSetter.SETTER,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
+ return handleStaticMethodSetterCompound(
+ node, method, setter, operator, rhs, arg);
}
-
- R visitSuperGetterSetterPostfix(
+ @override
+ R visitStaticMethodSetterPostfix(
Send node,
FunctionElement getter,
FunctionElement setter,
IncDecOperator operator,
A arg) {
- return handleSuperCompounds(
- node,
- getter, CompoundGetter.GETTER,
- setter, CompoundSetter.SETTER,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
+ return handleStaticMethodSetterPostfixPrefix(
+ node, getter, setter, operator, arg, isPrefix: false);
}
@override
- R visitSuperGetterFieldPostfix(
+ R visitStaticMethodSetterPrefix(
Send node,
FunctionElement getter,
- FieldElement field,
+ FunctionElement setter,
IncDecOperator operator,
A arg) {
- return handleSuperCompounds(
- node,
- getter, CompoundGetter.GETTER,
- field, CompoundSetter.FIELD,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
+ return handleStaticMethodSetterPostfixPrefix(
+ node, getter, setter, operator, arg, isPrefix: true);
}
@override
- R visitSuperMethodSetterPostfix(
- Send node,
- FunctionElement method,
+ R visitStaticSetterSet(
+ SendSet node,
FunctionElement setter,
- IncDecOperator operator,
+ Node rhs,
A arg) {
- return handleSuperCompounds(
- node,
- method, CompoundGetter.METHOD,
- setter, CompoundSetter.SETTER,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
+ return handleStaticSetterSet(node, setter, rhs, arg);
}
@override
- R visitClassTypeLiteralPostfix(
+ R visitTopLevelFieldCompound(
Send node,
- ConstantExpression constant,
- IncDecOperator operator,
+ FieldElement field,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return handleTypeLiteralConstantCompounds(
- node,
- constant,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
+ return handleStaticFieldCompound(node, field, operator, rhs, arg);
}
@override
- R visitTypedefTypeLiteralPostfix(
+ R visitTopLevelFieldGet(
Send node,
- ConstantExpression constant,
- IncDecOperator operator,
+ FieldElement field,
A arg) {
- return handleTypeLiteralConstantCompounds(
- node,
- constant,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
+ return handleStaticFieldGet(node, field, arg);
}
@override
- R visitTypeVariableTypeLiteralPostfix(
+ R visitTopLevelFieldInvoke(
Send node,
- TypeVariableElement element,
- IncDecOperator operator,
+ FieldElement field,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return handleTypeVariableTypeLiteralCompounds(
- node,
- element,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
+ return handleStaticFieldInvoke(node, field, arguments, callStructure, arg);
}
@override
- R visitDynamicTypeLiteralPostfix(
+ R visitTopLevelFieldPostfix(
Send node,
- ConstantExpression constant,
+ FieldElement field,
IncDecOperator operator,
A arg) {
- return handleTypeLiteralConstantCompounds(
- node,
- constant,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
+ return handleStaticFieldPostfixPrefix(
+ node, field, operator, arg, isPrefix: false);
}
@override
- R visitUnresolvedStaticGetterPostfix(
+ R visitTopLevelFieldPrefix(
Send node,
- Element element,
- MethodElement setter,
+ FieldElement field,
IncDecOperator operator,
A arg) {
- return handleStaticCompounds(
- node,
- element,
- CompoundGetter.UNRESOLVED,
- setter,
- CompoundSetter.SETTER,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
+ return handleStaticFieldPostfixPrefix(
+ node, field, operator, arg, isPrefix: true);
}
@override
- R visitUnresolvedTopLevelGetterPostfix(
- Send node,
- Element element,
- MethodElement setter,
- IncDecOperator operator,
+ R visitTopLevelFieldSet(
+ SendSet node,
+ FieldElement field,
+ Node rhs,
A arg) {
- return handleStaticCompounds(
- node,
- element,
- CompoundGetter.UNRESOLVED,
- setter,
- CompoundSetter.SETTER,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
+ return handleStaticFieldSet(node, field, rhs, arg);
}
@override
- R visitUnresolvedStaticSetterPostfix(
+ R visitTopLevelFunctionGet(
Send node,
- MethodElement getter,
- Element element,
- IncDecOperator operator,
+ MethodElement function,
A arg) {
- return handleStaticCompounds(
- node,
- getter,
- CompoundGetter.GETTER,
- element,
- CompoundSetter.INVALID,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
+ return handleStaticFunctionGet(node, function, arg);
}
@override
- R visitUnresolvedTopLevelSetterPostfix(
+ R visitTopLevelFunctionInvoke(
Send node,
- MethodElement getter,
- Element element,
- IncDecOperator operator,
+ MethodElement function,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return handleStaticCompounds(
- node,
- getter,
- CompoundGetter.GETTER,
- element,
- CompoundSetter.INVALID,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
+ return handleStaticFunctionInvoke(
+ node, function, arguments, callStructure, arg);
}
@override
- R visitStaticMethodPostfix(
+ R visitTopLevelFunctionIncompatibleInvoke(
Send node,
- MethodElement method,
- IncDecOperator operator,
+ MethodElement function,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return handleStaticCompounds(
- node,
- method,
- CompoundGetter.METHOD,
- method,
- CompoundSetter.INVALID,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
+ return handleStaticFunctionIncompatibleInvoke(
+ node, function, arguments, callStructure, arg);
}
@override
- R visitTopLevelMethodPostfix(
+ R visitTopLevelGetterGet(
Send node,
- MethodElement method,
- IncDecOperator operator,
+ FunctionElement getter,
A arg) {
- return handleStaticCompounds(
- node,
- method,
- CompoundGetter.METHOD,
- method,
- CompoundSetter.INVALID,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
+ return handleStaticGetterGet(node, getter, arg);
}
@override
- R visitUnresolvedPostfix(
+ R visitTopLevelGetterInvoke(
Send node,
- Element element,
- IncDecOperator operator,
+ FunctionElement getter,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return handleStaticCompounds(
- node,
- element,
- CompoundGetter.UNRESOLVED,
- element,
- CompoundSetter.INVALID,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
+ return handleStaticGetterInvoke(
+ node, getter, arguments, callStructure, arg);
}
@override
- R visitUnresolvedStaticGetterPrefix(
+ R visitTopLevelGetterSetterCompound(
Send node,
- Element element,
- MethodElement setter,
- IncDecOperator operator,
+ FunctionElement getter,
+ FunctionElement setter,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return handleStaticCompounds(
- node,
- element,
- CompoundGetter.UNRESOLVED,
- setter,
- CompoundSetter.SETTER,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
+ return handleStaticGetterSetterCompound(
+ node, getter, setter, operator, rhs, arg);
}
@override
- R visitUnresolvedTopLevelGetterPrefix(
+ R visitTopLevelGetterSetterPostfix(
Send node,
- Element element,
- MethodElement setter,
+ FunctionElement getter,
+ FunctionElement setter,
IncDecOperator operator,
A arg) {
- return handleStaticCompounds(
- node,
- element,
- CompoundGetter.UNRESOLVED,
- setter,
- CompoundSetter.SETTER,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
+ return handleStaticGetterSetterPostfixPrefix(
+ node, getter, setter, operator, arg, isPrefix: false);
}
@override
- R visitUnresolvedStaticSetterPrefix(
+ R visitTopLevelGetterSetterPrefix(
Send node,
- MethodElement getter,
- Element element,
+ FunctionElement getter,
+ FunctionElement setter,
IncDecOperator operator,
A arg) {
- return handleStaticCompounds(
- node,
- getter,
- CompoundGetter.GETTER,
- element,
- CompoundSetter.INVALID,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
+ return handleStaticGetterSetterPostfixPrefix(
+ node, getter, setter, operator, arg, isPrefix: true);
}
@override
- R visitUnresolvedTopLevelSetterPrefix(
+ R visitTopLevelMethodSetterCompound(
Send node,
- MethodElement getter,
- Element element,
- IncDecOperator operator,
+ FunctionElement method,
+ FunctionElement setter,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return handleStaticCompounds(
- node,
- getter,
- CompoundGetter.GETTER,
- element,
- CompoundSetter.INVALID,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
+ return handleStaticMethodSetterCompound(
+ node, method, setter, operator, rhs, arg);
}
@override
- R visitStaticMethodPrefix(
+ R visitTopLevelMethodSetterPostfix(
Send node,
- MethodElement method,
+ FunctionElement method,
+ FunctionElement setter,
IncDecOperator operator,
A arg) {
- return handleStaticCompounds(
- node,
- method,
- CompoundGetter.METHOD,
- method,
- CompoundSetter.INVALID,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
+ return handleStaticMethodSetterPostfixPrefix(
+ node, method, setter, operator, arg, isPrefix: false);
}
@override
- R visitTopLevelMethodPrefix(
+ R visitTopLevelMethodSetterPrefix(
Send node,
- MethodElement method,
+ FunctionElement method,
+ FunctionElement setter,
IncDecOperator operator,
A arg) {
- return handleStaticCompounds(
- node,
- method,
- CompoundGetter.METHOD,
- method,
- CompoundSetter.INVALID,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
+ return handleStaticMethodSetterPostfixPrefix(
+ node, method, setter, operator, arg, isPrefix: true);
}
@override
- R visitUnresolvedPrefix(
- Send node,
- Element element,
- IncDecOperator operator,
+ R visitTopLevelSetterSet(
+ SendSet node,
+ FunctionElement setter,
+ Node rhs,
A arg) {
- return handleStaticCompounds(
- node,
- element,
- CompoundGetter.UNRESOLVED,
- element,
- CompoundSetter.INVALID,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
+ return handleStaticSetterSet(node, setter, rhs, arg);
}
+}
- @override
- R visitUnresolvedStaticGetterCompound(
+/// Mixin that groups all `visitLocalX` and `visitParameterX` method by
+/// delegating calls to `handleLocalX` methods.
+///
+/// This mixin is useful for the cases where both parameters, local variables,
+/// and local functions, captured or not, are handled uniformly.
+abstract class BaseImplementationOfLocalsMixin<R, A>
+ implements SemanticSendVisitor<R, A> {
+ R handleLocalCompound(
Send node,
- Element element,
- MethodElement setter,
+ LocalElement element,
AssignmentOperator operator,
Node rhs,
- A arg) {
- return handleStaticCompounds(
- node,
- element,
- CompoundGetter.UNRESOLVED,
- setter,
- CompoundSetter.SETTER,
- new AssignmentCompound(operator, rhs),
- arg);
- }
+ A arg);
- @override
- R visitUnresolvedTopLevelGetterCompound(
+ R handleLocalGet(
Send node,
- Element element,
- MethodElement setter,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- return handleStaticCompounds(
- node,
- element,
- CompoundGetter.UNRESOLVED,
- setter,
- CompoundSetter.SETTER,
- new AssignmentCompound(operator, rhs),
- arg);
- }
+ LocalElement element,
+ A arg);
- @override
- R visitUnresolvedStaticSetterCompound(
+ R handleLocalInvoke(
Send node,
- MethodElement getter,
- Element element,
- AssignmentOperator operator,
- Node rhs,
- A arg) {
- return handleStaticCompounds(
- node,
- getter,
- CompoundGetter.GETTER,
- element,
- CompoundSetter.INVALID,
- new AssignmentCompound(operator, rhs),
- arg);
- }
+ LocalElement element,
+ NodeList arguments,
+ CallStructure callStructure,
+ A arg);
+
+ R handleLocalPostfixPrefix(
+ Send node,
+ LocalElement element,
+ IncDecOperator operator,
+ A arg,
+ {bool isPrefix});
+
+ R handleLocalSet(
+ SendSet node,
+ LocalElement element,
+ Node rhs,
+ A arg);
@override
- R visitUnresolvedTopLevelSetterCompound(
+ R visitLocalFunctionGet(
Send node,
- MethodElement getter,
- Element element,
- AssignmentOperator operator,
- Node rhs,
+ LocalFunctionElement function,
A arg) {
- return handleStaticCompounds(
- node,
- getter,
- CompoundGetter.GETTER,
- element,
- CompoundSetter.INVALID,
- new AssignmentCompound(operator, rhs),
- arg);
+ return handleLocalGet(node, function, arg);
}
@override
- R visitStaticMethodCompound(
+ R visitLocalFunctionInvoke(
Send node,
- MethodElement method,
- AssignmentOperator operator,
- Node rhs,
+ LocalFunctionElement function,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return handleStaticCompounds(
- node,
- method,
- CompoundGetter.METHOD,
- method,
- CompoundSetter.INVALID,
- new AssignmentCompound(operator, rhs),
- arg);
+ return handleLocalInvoke(node, function, arguments, callStructure, arg);
}
@override
- R visitTopLevelMethodCompound(
+ R visitLocalVariableCompound(
Send node,
- MethodElement method,
+ LocalVariableElement variable,
AssignmentOperator operator,
Node rhs,
A arg) {
- return handleStaticCompounds(
- node,
- method,
- CompoundGetter.METHOD,
- method,
- CompoundSetter.INVALID,
- new AssignmentCompound(operator, rhs),
- arg);
+ return handleLocalCompound(node, variable, operator, rhs, arg);
}
@override
- R visitUnresolvedCompound(
+ R visitLocalVariableGet(
Send node,
- Element element,
- AssignmentOperator operator,
- Node rhs,
+ LocalVariableElement variable,
A arg) {
- return handleStaticCompounds(
- node,
- element,
- CompoundGetter.UNRESOLVED,
- element,
- CompoundSetter.INVALID,
- new AssignmentCompound(operator, rhs),
- arg);
+ return handleLocalGet(node, variable, arg);
}
@override
- R visitFinalLocalVariablePostfix(
+ R visitLocalVariableInvoke(
Send node,
LocalVariableElement variable,
- IncDecOperator operator,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return handleLocalCompounds(
- node,
- variable,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg,
- isSetterValid: false);
+ return handleLocalInvoke(node, variable, arguments, callStructure, arg);
}
@override
- R visitFinalLocalVariablePrefix(
+ R visitLocalVariablePostfix(
Send node,
LocalVariableElement variable,
IncDecOperator operator,
A arg) {
- return handleLocalCompounds(
- node,
- variable,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg,
- isSetterValid: false);
+ return handleLocalPostfixPrefix(
+ node, variable, operator, arg, isPrefix: false);
}
@override
- R visitFinalParameterPostfix(
+ R visitLocalVariablePrefix(
Send node,
- ParameterElement parameter,
+ LocalVariableElement variable,
IncDecOperator operator,
A arg) {
- return handleLocalCompounds(
- node,
- parameter,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg,
- isSetterValid: false);
+ return handleLocalPostfixPrefix(
+ node, variable, operator, arg, isPrefix: true);
}
@override
- R visitFinalParameterPrefix(
- Send node,
- ParameterElement parameter,
- IncDecOperator operator,
+ R visitLocalVariableSet(
+ SendSet node,
+ LocalVariableElement variable,
+ Node rhs,
A arg) {
- return handleLocalCompounds(
- node,
- parameter,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg,
- isSetterValid: false);
+ return handleLocalSet(node, variable, rhs, arg);
}
@override
- R visitFinalStaticFieldPostfix(
+ R visitParameterCompound(
Send node,
- FieldElement field,
- IncDecOperator operator,
+ ParameterElement parameter,
+ AssignmentOperator operator,
+ Node rhs,
A arg) {
- return handleStaticCompounds(
- node,
- field,
- CompoundGetter.FIELD,
- field,
- CompoundSetter.INVALID,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
+ return handleLocalCompound(node, parameter, operator, rhs, arg);
}
@override
- R visitFinalStaticFieldPrefix(
+ R visitParameterGet(
Send node,
- FieldElement field,
- IncDecOperator operator,
+ ParameterElement parameter,
A arg) {
- return handleStaticCompounds(
- node,
- field,
- CompoundGetter.FIELD,
- field,
- CompoundSetter.INVALID,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
+ return handleLocalGet(node, parameter, arg);
}
@override
- R visitSuperFieldFieldCompound(
+ R visitParameterInvoke(
Send node,
- FieldElement readField,
- FieldElement writtenField,
- AssignmentOperator operator,
- Node rhs,
+ ParameterElement parameter,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return handleSuperCompounds(
- node,
- readField,
- CompoundGetter.FIELD,
- writtenField,
- CompoundSetter.FIELD,
- new AssignmentCompound(operator, rhs),
- arg);
+ return handleLocalInvoke(node, parameter, arguments, callStructure, arg);
}
@override
- R visitFinalSuperFieldPostfix(
+ R visitParameterPostfix(
Send node,
- FieldElement field,
+ ParameterElement parameter,
IncDecOperator operator,
A arg) {
- return handleSuperCompounds(
- node,
- field,
- CompoundGetter.FIELD,
- field,
- CompoundSetter.INVALID,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
+ return handleLocalPostfixPrefix(
+ node, parameter, operator, arg, isPrefix: false);
}
@override
- R visitFinalSuperFieldPrefix(
+ R visitParameterPrefix(
Send node,
- FieldElement field,
+ ParameterElement parameter,
IncDecOperator operator,
A arg) {
- return handleSuperCompounds(
- node,
- field,
- CompoundGetter.FIELD,
- field,
- CompoundSetter.INVALID,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
+ return handleLocalPostfixPrefix(
+ node, parameter, operator, arg, isPrefix: true);
}
@override
- R visitSuperMethodCompound(
- Send node,
- FunctionElement method,
- AssignmentOperator operator,
+ R visitParameterSet(
+ SendSet node,
+ ParameterElement parameter,
Node rhs,
A arg) {
- return handleSuperCompounds(
- node,
- method,
- CompoundGetter.METHOD,
- method,
- CompoundSetter.INVALID,
- new AssignmentCompound(operator, rhs),
- arg);
+ return handleLocalSet(node, parameter, rhs, arg);
}
+}
- @override
- R visitSuperMethodPostfix(
+/// Mixin that groups all `visitConstantX` and `visitXTypeLiteralY` methods for
+/// constant type literals by delegating calls to `handleConstantX` methods.
+///
+/// This mixin is useful for the cases where expressions on constants are
+/// handled uniformly.
+abstract class BaseImplementationOfConstantsMixin<R, A>
+ implements SemanticSendVisitor<R, A> {
+ R handleConstantGet(
+ Node node,
+ ConstantExpression constant,
+ A arg);
+
+ R handleConstantInvoke(
Send node,
- FunctionElement method,
- IncDecOperator operator,
- A arg) {
- return handleSuperCompounds(
- node,
- method,
- CompoundGetter.METHOD,
- method,
- CompoundSetter.INVALID,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
- }
+ ConstantExpression constant,
+ NodeList arguments,
+ CallStructure callStructure,
+ A arg);
@override
- R visitSuperMethodPrefix(
+ R visitClassTypeLiteralGet(
Send node,
- FunctionElement method,
- IncDecOperator operator,
+ ConstantExpression constant,
A arg) {
- return handleSuperCompounds(
- node,
- method,
- CompoundGetter.METHOD,
- method,
- CompoundSetter.INVALID,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
+ return handleConstantGet(node, constant, arg);
}
@override
- R visitFinalTopLevelFieldPostfix(
+ R visitClassTypeLiteralInvoke(
Send node,
- FieldElement field,
- IncDecOperator operator,
+ ConstantExpression constant,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return handleStaticCompounds(
- node,
- field,
- CompoundGetter.FIELD,
- field,
- CompoundSetter.INVALID,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
+ return handleConstantInvoke(node, constant, arguments, callStructure, arg);
}
@override
- R visitFinalTopLevelFieldPrefix(
- Send node,
- FieldElement field,
- IncDecOperator operator,
+ R visitConstConstructorInvoke(
+ NewExpression node,
+ ConstructedConstantExpression constant,
A arg) {
- return handleStaticCompounds(
- node,
- field,
- CompoundGetter.FIELD,
- field,
- CompoundSetter.INVALID,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
+ return handleConstantGet(node, constant, arg);
}
@override
- R visitUnresolvedSuperCompound(
+ R visitConstantGet(
Send node,
- Element element,
- AssignmentOperator operator,
- Node rhs,
+ ConstantExpression constant,
A arg) {
- return handleSuperCompounds(
- node,
- element,
- CompoundGetter.UNRESOLVED,
- element,
- CompoundSetter.INVALID,
- new AssignmentCompound(operator, rhs),
- arg);
+ return handleConstantGet(node, constant, arg);
}
@override
- R visitUnresolvedSuperPostfix(
+ R visitConstantInvoke(
Send node,
- Element element,
- IncDecOperator operator,
+ ConstantExpression constant,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return handleSuperCompounds(
- node,
- element,
- CompoundGetter.UNRESOLVED,
- element,
- CompoundSetter.INVALID,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
+ return handleConstantInvoke(node, constant, arguments, callStructure, arg);
}
@override
- R visitUnresolvedSuperPrefix(
+ R visitDynamicTypeLiteralGet(
Send node,
- Element element,
- IncDecOperator operator,
+ ConstantExpression constant,
A arg) {
- return handleSuperCompounds(
- node,
- element,
- CompoundGetter.UNRESOLVED,
- element,
- CompoundSetter.INVALID,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
+ return handleConstantGet(node, constant, arg);
}
@override
- R visitUnresolvedSuperGetterCompound(
- Send node, Element element,
- MethodElement setter,
- AssignmentOperator operator,
- Node rhs,
+ R visitDynamicTypeLiteralInvoke(
+ Send node,
+ ConstantExpression constant,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return handleSuperCompounds(
- node,
- element,
- CompoundGetter.UNRESOLVED,
- setter,
- CompoundSetter.SETTER,
- new AssignmentCompound(operator, rhs),
- arg);
+ return handleConstantInvoke(node, constant, arguments, callStructure, arg);
}
@override
- R visitUnresolvedSuperGetterPostfix(
+ R visitTypedefTypeLiteralGet(
Send node,
- Element element,
- MethodElement setter,
- IncDecOperator operator,
+ ConstantExpression constant,
A arg) {
- return handleSuperCompounds(
- node,
- element,
- CompoundGetter.UNRESOLVED,
- setter,
- CompoundSetter.SETTER,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
+ return handleConstantGet(node, constant, arg);
}
@override
- R visitUnresolvedSuperGetterPrefix(
+ R visitTypedefTypeLiteralInvoke(
Send node,
- Element element,
- MethodElement setter,
- IncDecOperator operator,
+ ConstantExpression constant,
+ NodeList arguments,
+ CallStructure callStructure,
A arg) {
- return handleSuperCompounds(
- node,
- element,
- CompoundGetter.UNRESOLVED,
- setter,
- CompoundSetter.SETTER,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
+ return handleConstantInvoke(node, constant, arguments, callStructure, arg);
}
+}
- @override
- R visitUnresolvedSuperSetterCompound(
+/// Mixin that groups all `visitDynamicPropertyX` and `visitThisPropertyY`
+/// methods for by delegating calls to `handleDynamicX` methods, providing
+/// `null` as the receiver for the this properties.
+///
+/// This mixin is useful for the cases where dynamic and this properties are
+/// handled uniformly.
+abstract class BaseImplementationOfDynamicsMixin<R, A>
+ implements SemanticSendVisitor<R, A> {
+ R handleDynamicCompound(
Send node,
- MethodElement getter,
- Element element,
+ Node receiver,
AssignmentOperator operator,
Node rhs,
- A arg) {
- return handleSuperCompounds(
- node,
- getter,
- CompoundGetter.GETTER,
- element,
- CompoundSetter.INVALID,
- new AssignmentCompound(operator, rhs),
- arg);
- }
+ Selector getterSelector,
+ Selector setterSelector,
+ A arg);
- @override
- R visitUnresolvedSuperSetterPostfix(
+ R handleDynamicGet(
Send node,
- MethodElement getter,
- Element element,
- IncDecOperator operator,
- A arg) {
- return handleSuperCompounds(
- node,
- getter,
- CompoundGetter.GETTER,
- element,
- CompoundSetter.INVALID,
- new IncDecCompound(CompoundKind.POSTFIX, operator),
- arg);
- }
+ Node receiver,
+ Selector selector,
+ A arg);
- @override
- R visitUnresolvedSuperSetterPrefix(
+ R handleDynamicInvoke(
Send node,
- MethodElement getter,
- Element element,
- IncDecOperator operator,
- A arg) {
- return handleSuperCompounds(
- node,
- getter,
- CompoundGetter.GETTER,
- element,
- CompoundSetter.INVALID,
- new IncDecCompound(CompoundKind.PREFIX, operator),
- arg);
- }
-}
-
-/// Simplified handling of indexed compound assignments and prefix/postfix
-/// expressions.
-abstract class BaseImplementationOfIndexCompoundsMixin<R, A>
- implements SemanticSendVisitor<R, A> {
-
- /// Handle a dynamic index compounds, like `receiver[index] += rhs` or
- /// `--receiver[index]`.
- R handleIndexCompounds(
- SendSet node,
Node receiver,
- Node index,
- CompoundRhs rhs,
+ NodeList arguments,
+ Selector selector,
A arg);
- /// Handle a super index compounds, like `super[index] += rhs` or
- /// `--super[index]`.
- R handleSuperIndexCompounds(
- SendSet node,
- Element indexFunction,
- Element indexSetFunction,
- Node index,
- CompoundRhs rhs,
+ R handleDynamicPostfixPrefix(
+ Send node,
+ Node receiver,
+ IncDecOperator operator,
+ Selector getterSelector,
+ Selector setterSelector,
A arg,
- {bool isGetterValid,
- bool isSetterValid});
+ {bool isPrefix});
- @override
- R visitSuperCompoundIndexSet(
- Send node,
- FunctionElement indexFunction,
- FunctionElement indexSetFunction,
- Node index,
- AssignmentOperator operator,
+ R handleDynamicSet(
+ SendSet node,
+ Node receiver,
+ Selector selector,
Node rhs,
- A arg) {
- return handleSuperIndexCompounds(
- node, indexFunction, indexSetFunction, index,
- new AssignmentCompound(operator, rhs), arg,
- isGetterValid: true, isSetterValid: true);
- }
+ A arg);
- @override
- R visitSuperIndexPostfix(
+ R handleDynamicIndexPostfixPrefix(
Send node,
- FunctionElement indexFunction,
- FunctionElement indexSetFunction,
+ Node receiver,
Node index,
IncDecOperator operator,
- A arg) {
- return handleSuperIndexCompounds(
- node, indexFunction, indexSetFunction, index,
- new IncDecCompound(CompoundKind.POSTFIX, operator), arg,
- isGetterValid: true, isSetterValid: true);
- }
+ A arg,
+ {bool isPrefix});
@override
- R visitSuperIndexPrefix(
+ R visitDynamicPropertyCompound(
Send node,
- FunctionElement indexFunction,
- FunctionElement indexSetFunction,
- Node index,
- IncDecOperator operator,
+ Node receiver,
+ AssignmentOperator operator,
+ Node rhs,
+ Selector getterSelector,
+ Selector setterSelector,
A arg) {
- return handleSuperIndexCompounds(
- node, indexFunction, indexSetFunction, index,
- new IncDecCompound(CompoundKind.PREFIX, operator), arg,
- isGetterValid: true, isSetterValid: true);
+ return handleDynamicCompound(
+ node, receiver, operator, rhs, getterSelector, setterSelector, arg);
}
@override
- R visitUnresolvedSuperGetterCompoundIndexSet(
+ R visitDynamicPropertyGet(
Send node,
- Element indexFunction,
- FunctionElement indexSetFunction,
- Node index,
- AssignmentOperator operator,
- Node rhs,
+ Node receiver,
+ Selector selector,
A arg) {
- return handleSuperIndexCompounds(
- node, indexFunction, indexSetFunction, index,
- new AssignmentCompound(operator, rhs), arg,
- isGetterValid: false, isSetterValid: true);
+ return handleDynamicGet(node, receiver, selector, arg);
}
@override
- R visitUnresolvedSuperSetterCompoundIndexSet(
+ R visitDynamicPropertyInvoke(
Send node,
- FunctionElement indexFunction,
- Element indexSetFunction,
- Node index,
- AssignmentOperator operator,
- Node rhs,
+ Node receiver,
+ NodeList arguments,
+ Selector selector,
A arg) {
- return handleSuperIndexCompounds(
- node, indexFunction, indexSetFunction, index,
- new AssignmentCompound(operator, rhs), arg,
- isGetterValid: true, isSetterValid: false);
+ return handleDynamicInvoke(node, receiver, arguments, selector, arg);
}
@override
- R visitUnresolvedSuperCompoundIndexSet(
+ R visitDynamicPropertyPostfix(
Send node,
- Element element,
- Node index,
- AssignmentOperator operator,
- Node rhs,
+ Node receiver,
+ IncDecOperator operator,
+ Selector getterSelector,
+ Selector setterSelector,
A arg) {
- return handleSuperIndexCompounds(
- node, element, element, index,
- new AssignmentCompound(operator, rhs), arg,
- isGetterValid: false, isSetterValid: false);
+ return handleDynamicPostfixPrefix(
+ node, receiver, operator,
+ getterSelector, setterSelector, arg, isPrefix: false);
}
@override
- R visitUnresolvedSuperGetterIndexPostfix(
+ R visitDynamicPropertyPrefix(
Send node,
- Element element,
- FunctionElement indexSetFunction,
- Node index,
+ Node receiver,
IncDecOperator operator,
+ Selector getterSelector,
+ Selector setterSelector,
A arg) {
- return handleSuperIndexCompounds(
- node, element, indexSetFunction, index,
- new IncDecCompound(CompoundKind.POSTFIX, operator), arg,
- isGetterValid: false, isSetterValid: true);
+ return handleDynamicPostfixPrefix(
+ node, receiver, operator,
+ getterSelector, setterSelector, arg, isPrefix: true);
}
@override
- R visitUnresolvedSuperGetterIndexPrefix(
+ R visitDynamicPropertySet(
+ SendSet node,
+ Node receiver,
+ Selector selector,
+ Node rhs,
+ A arg) {
+ return handleDynamicSet(node, receiver, selector, rhs, arg);
+ }
+
+ @override
+ R visitThisPropertyCompound(
Send node,
- Element element,
- FunctionElement indexSetFunction,
- Node index,
- IncDecOperator operator,
+ AssignmentOperator operator,
+ Node rhs,
+ Selector getterSelector,
+ Selector setterSelector,
A arg) {
- return handleSuperIndexCompounds(
- node, element, indexSetFunction, index,
- new IncDecCompound(CompoundKind.PREFIX, operator), arg,
- isGetterValid: false, isSetterValid: true);
+ return handleDynamicCompound(
+ node, null, operator, rhs, getterSelector, setterSelector, arg);
}
@override
- R visitUnresolvedSuperSetterIndexPostfix(
+ R visitThisPropertyGet(
Send node,
- MethodElement indexFunction,
- Element element,
- Node index,
- IncDecOperator operator,
+ Selector selector,
A arg) {
- return handleSuperIndexCompounds(
- node, indexFunction, element, index,
- new IncDecCompound(CompoundKind.POSTFIX, operator), arg,
- isGetterValid: true, isSetterValid: false);
+ return handleDynamicGet(node, null, selector, arg);
}
@override
- R visitUnresolvedSuperSetterIndexPrefix(
+ R visitThisPropertyInvoke(
Send node,
- MethodElement indexFunction,
- Element element,
- Node index,
- IncDecOperator operator,
+ NodeList arguments,
+ Selector selector,
A arg) {
- return handleSuperIndexCompounds(
- node, indexFunction, element, index,
- new IncDecCompound(CompoundKind.PREFIX, operator), arg,
- isGetterValid: true, isSetterValid: false);
+ return handleDynamicInvoke(node, null, arguments, selector, arg);
}
@override
- R visitUnresolvedSuperIndexPostfix(
+ R visitThisPropertyPostfix(
Send node,
- Element element,
- Node index,
IncDecOperator operator,
+ Selector getterSelector,
+ Selector setterSelector,
A arg) {
- return handleSuperIndexCompounds(
- node, element, element, index,
- new IncDecCompound(CompoundKind.POSTFIX, operator), arg,
- isGetterValid: false, isSetterValid: false);
+ return handleDynamicPostfixPrefix(
+ node, null, operator,
+ getterSelector, setterSelector, arg, isPrefix: false);
}
@override
- R visitUnresolvedSuperIndexPrefix(
+ R visitThisPropertyPrefix(
Send node,
- Element element,
- Node index,
IncDecOperator operator,
+ Selector getterSelector,
+ Selector setterSelector,
A arg) {
- return handleSuperIndexCompounds(
- node, element, element, index,
- new IncDecCompound(CompoundKind.PREFIX, operator), arg,
- isGetterValid: false, isSetterValid: false);
+ return handleDynamicPostfixPrefix(
+ node, null, operator,
+ getterSelector, setterSelector, arg, isPrefix: true);
}
@override
- R visitCompoundIndexSet(
+ R visitThisPropertySet(
SendSet node,
- Node receiver,
- Node index,
- AssignmentOperator operator,
+ Selector selector,
Node rhs,
A arg) {
- return handleIndexCompounds(
- node, receiver, index,
- new AssignmentCompound(operator, rhs), arg);
+ return handleDynamicSet(node, null, selector, rhs, arg);
}
@override
@@ -9589,9 +6401,8 @@ abstract class BaseImplementationOfIndexCompoundsMixin<R, A>
Node index,
IncDecOperator operator,
A arg) {
- return handleIndexCompounds(
- node, receiver, index,
- new IncDecCompound(CompoundKind.POSTFIX, operator), arg);
+ return handleDynamicIndexPostfixPrefix(
+ node, receiver, index, operator, arg, isPrefix: false);
}
@override
@@ -9601,14 +6412,11 @@ abstract class BaseImplementationOfIndexCompoundsMixin<R, A>
Node index,
IncDecOperator operator,
A arg) {
- return handleIndexCompounds(
- node, receiver, index,
- new IncDecCompound(CompoundKind.PREFIX, operator), arg);
+ return handleDynamicIndexPostfixPrefix(
+ node, receiver, index, operator, arg, isPrefix: true);
}
}
-
-
/// Mixin that groups all `visitSuperXPrefix`, `visitSuperXPostfix` methods by
/// delegating calls to `handleSuperXPostfixPrefix` methods.
///
@@ -9668,7 +6476,6 @@ abstract class BaseImplementationOfSuperIncDecsMixin<R, A>
R handleUnresolvedSuperGetterIndexPostfixPrefix(
Send node,
Element element,
- MethodElement setter,
Node index,
IncDecOperator operator,
A arg,
@@ -9683,51 +6490,6 @@ abstract class BaseImplementationOfSuperIncDecsMixin<R, A>
A arg,
{bool isPrefix});
- R handleUnresolvedSuperIndexPostfixPrefix(
- Send node,
- Element element,
- Node index,
- IncDecOperator operator,
- A arg,
- {bool isPrefix});
-
- R handleFinalSuperFieldPostfixPrefix(
- Send node,
- FieldElement field,
- IncDecOperator operator,
- A arg,
- {bool isPrefix});
-
- R handleSuperMethodPostfixPrefix(
- Send node,
- MethodElement method,
- IncDecOperator operator,
- A arg,
- {bool isPrefix});
-
- R handleUnresolvedSuperPostfixPrefix(
- Send node,
- Element element,
- IncDecOperator operator,
- A arg,
- {bool isPrefix});
-
- R handleUnresolvedSuperGetterPostfixPrefix(
- Send node,
- Element element,
- MethodElement setter,
- IncDecOperator operator,
- A arg,
- {bool isPrefix});
-
- R handleUnresolvedSuperSetterPostfixPrefix(
- Send node,
- MethodElement getter,
- Element element,
- IncDecOperator operator,
- A arg,
- {bool isPrefix});
-
@override
R visitSuperFieldFieldPostfix(
Send node,
@@ -9888,24 +6650,22 @@ abstract class BaseImplementationOfSuperIncDecsMixin<R, A>
R visitUnresolvedSuperGetterIndexPostfix(
Send node,
Element element,
- MethodElement setter,
Node index,
IncDecOperator operator,
A arg) {
return handleUnresolvedSuperGetterIndexPostfixPrefix(
- node, element, setter, index, operator, arg, isPrefix: false);
+ node, element, index, operator, arg, isPrefix: false);
}
@override
R visitUnresolvedSuperGetterIndexPrefix(
Send node,
Element element,
- MethodElement setter,
Node index,
IncDecOperator operator,
A arg) {
return handleUnresolvedSuperGetterIndexPostfixPrefix(
- node, element, setter, index, operator, arg, isPrefix: true);
+ node, element, index, operator, arg, isPrefix: true);
}
@override
@@ -9931,132 +6691,6 @@ abstract class BaseImplementationOfSuperIncDecsMixin<R, A>
return handleUnresolvedSuperSetterIndexPostfixPrefix(
node, indexFunction, element, index, operator, arg, isPrefix: true);
}
-
- @override
- R visitUnresolvedSuperIndexPostfix(
- Send node,
- Element element,
- Node index,
- IncDecOperator operator,
- A arg) {
- return handleUnresolvedSuperIndexPostfixPrefix(
- node, element, index, operator, arg, isPrefix: false);
- }
-
- @override
- R visitUnresolvedSuperIndexPrefix(
- Send node,
- Element element,
- Node index,
- IncDecOperator operator,
- A arg) {
- return handleUnresolvedSuperIndexPostfixPrefix(
- node, element, index, operator, arg, isPrefix: true);
- }
-
- @override
- R visitFinalSuperFieldPostfix(
- Send node,
- FieldElement field,
- IncDecOperator operator,
- A arg) {
- return handleFinalSuperFieldPostfixPrefix(
- node, field, operator, arg, isPrefix: false);
- }
-
- @override
- R visitFinalSuperFieldPrefix(
- Send node,
- FieldElement field,
- IncDecOperator operator,
- A arg) {
- return handleFinalSuperFieldPostfixPrefix(
- node, field, operator, arg, isPrefix: true);
- }
-
- @override
- R visitSuperMethodPostfix(
- Send node,
- MethodElement method,
- IncDecOperator operator,
- A arg) {
- return handleSuperMethodPostfixPrefix(
- node, method, operator, arg, isPrefix: false);
- }
-
- @override
- R visitSuperMethodPrefix(
- Send node,
- MethodElement method,
- IncDecOperator operator,
- A arg) {
- return handleSuperMethodPostfixPrefix(
- node, method, operator, arg, isPrefix: true);
- }
-
- @override
- R visitUnresolvedSuperPostfix(
- Send node,
- Element element,
- IncDecOperator operator,
- A arg) {
- return handleUnresolvedSuperPostfixPrefix(
- node, element, operator, arg, isPrefix: false);
- }
-
- @override
- R visitUnresolvedSuperPrefix(
- Send node,
- Element element,
- IncDecOperator operator,
- A arg) {
- return handleUnresolvedSuperPostfixPrefix(
- node, element, operator, arg, isPrefix: true);
- }
-
- @override
- R visitUnresolvedSuperGetterPostfix(
- Send node,
- Element element,
- MethodElement setter,
- IncDecOperator operator,
- A arg) {
- return handleUnresolvedSuperGetterPostfixPrefix(
- node, element, setter, operator, arg, isPrefix: false);
- }
-
- @override
- R visitUnresolvedSuperGetterPrefix(
- Send node,
- Element element,
- MethodElement setter,
- IncDecOperator operator,
- A arg) {
- return handleUnresolvedSuperGetterPostfixPrefix(
- node, element, setter, operator, arg, isPrefix: true);
- }
-
- @override
- R visitUnresolvedSuperSetterPostfix(
- Send node,
- MethodElement getter,
- Element element,
- IncDecOperator operator,
- A arg) {
- return handleUnresolvedSuperSetterPostfixPrefix(
- node, getter, element, operator, arg, isPrefix: false);
- }
-
- @override
- R visitUnresolvedSuperSetterPrefix(
- Send node,
- MethodElement getter,
- Element element,
- IncDecOperator operator,
- A arg) {
- return handleUnresolvedSuperSetterPostfixPrefix(
- node, getter, element, operator, arg, isPrefix: true);
- }
}
/// Mixin that groups the non-constant `visitXConstructorInvoke` methods by
@@ -10086,7 +6720,6 @@ abstract class BaseImplementationOfNewMixin<R, A>
node, constructor, type, arguments, callStructure, arg);
}
- @override
R visitRedirectingGenerativeConstructorInvoke(
NewExpression node,
ConstructorElement constructor,
@@ -10098,7 +6731,6 @@ abstract class BaseImplementationOfNewMixin<R, A>
node, constructor, type, arguments, callStructure, arg);
}
- @override
R visitFactoryConstructorInvoke(
NewExpression node,
ConstructorElement constructor,
@@ -10110,7 +6742,6 @@ abstract class BaseImplementationOfNewMixin<R, A>
node, constructor, type, arguments, callStructure, arg);
}
- @override
R visitRedirectingFactoryConstructorInvoke(
NewExpression node,
ConstructorElement constructor,
@@ -10124,7 +6755,6 @@ abstract class BaseImplementationOfNewMixin<R, A>
node, constructor, type, arguments, callStructure, arg);
}
- @override
R visitUnresolvedConstructorInvoke(
NewExpression node,
Element constructor,
@@ -10136,7 +6766,6 @@ abstract class BaseImplementationOfNewMixin<R, A>
node, constructor, type, arguments, selector.callStructure, arg);
}
- @override
R visitUnresolvedClassConstructorInvoke(
NewExpression node,
Element element,
@@ -10148,7 +6777,6 @@ abstract class BaseImplementationOfNewMixin<R, A>
node, element, type, arguments, selector.callStructure, arg);
}
- @override
R visitAbstractClassConstructorInvoke(
NewExpression node,
ConstructorElement constructor,
@@ -10159,8 +6787,6 @@ abstract class BaseImplementationOfNewMixin<R, A>
return handleConstructorInvoke(
node, constructor, type, arguments, callStructure, arg);
}
-
- @override
R visitUnresolvedRedirectingFactoryConstructorInvoke(
NewExpression node,
ConstructorElement constructor,
« no previous file with comments | « pkg/compiler/lib/src/resolution/semantic_visitor.dart ('k') | pkg/compiler/lib/src/resolution/send_resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698