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

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

Issue 1004683002: Refactor IrBuilder to use SemanticVisitor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Handle local/static constants and index prefix/postfix. Created 5 years, 9 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 dfbb757cd226fab8df0ac283034043dcf6a8b6f3..47846a6538dc2592f6391d1d4b4542748dc93d80 100644
--- a/pkg/compiler/lib/src/resolution/semantic_visitor_mixins.dart
+++ b/pkg/compiler/lib/src/resolution/semantic_visitor_mixins.dart
@@ -479,6 +479,35 @@ abstract class ErrorBulkMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
+ R errorUnresolvedSuperIndex(
+ Send node,
+ Element function,
+ Node index,
+ A arg) {
+ return bulkHandleError(node);
+ }
+
+ @override
+ R errorUnresolvedSuperIndexPostfix(
+ Send node,
+ Element function,
+ Node index,
+ IncDecOperator operator,
+ A arg) {
+ return bulkHandleError(node);
+ }
+
+ @override
+ R errorUnresolvedSuperIndexPrefix(
+ Send node,
+ Element function,
+ Node index,
+ IncDecOperator operator,
+ A arg) {
+ return bulkHandleError(node);
+ }
+
+ @override
R errorUnresolvedSuperIndexSet(
SendSet node,
Element element,
@@ -551,6 +580,16 @@ abstract class PrefixBulkMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
+ R visitIndexPrefix(
+ Send node,
+ Node receiver,
+ Node index,
+ IncDecOperator operator,
+ A arg) {
+ return bulkHandlePrefix(node);
+ }
+
+ @override
R visitLocalVariablePrefix(
Send node,
LocalVariableElement variable,
@@ -647,6 +686,17 @@ abstract class PrefixBulkMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
+ R visitSuperIndexPrefix(
+ Send node,
+ FunctionElement indexFunction,
+ FunctionElement indexSetFunction,
+ Node index,
+ IncDecOperator operator,
+ A arg) {
+ return bulkHandlePrefix(node);
+ }
+
+ @override
R visitSuperMethodSetterPrefix(
Send node,
FunctionElement method,
@@ -720,6 +770,16 @@ abstract class PostfixBulkMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
+ R visitIndexPostfix(
+ Send node,
+ Node receiver,
+ Node index,
+ IncDecOperator operator,
+ A arg) {
+ return bulkHandlePostfix(node);
+ }
+
+ @override
R visitLocalVariablePostfix(
Send node,
LocalVariableElement variable,
@@ -816,6 +876,17 @@ abstract class PostfixBulkMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
+ R visitSuperIndexPostfix(
+ Send node,
+ FunctionElement indexFunction,
+ FunctionElement indexSetFunction,
+ Node index,
+ IncDecOperator operator,
+ A arg) {
+ return bulkHandlePostfix(node);
+ }
+
+ @override
R visitSuperMethodSetterPostfix(
Send node,
FunctionElement method,
@@ -2439,6 +2510,16 @@ class TraversalMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
+ R errorUnresolvedSuperIndex(
+ Send node,
+ Element function,
+ Node index,
+ A arg) {
+ apply(index, arg);
+ return null;
+ }
+
+ @override
R visitAs(
Send node,
Node expression,
@@ -3887,6 +3968,68 @@ class TraversalMixin<R, A> implements SemanticSendVisitor<R, A> {
A arg) {
return null;
}
+
+ @override
+ R errorUnresolvedSuperIndexPostfix(
+ Send node,
+ Element function,
+ Node index,
+ IncDecOperator operator,
+ A arg) {
+ // TODO: implement errorUnresolvedSuperIndexPostfix
+ }
+
+ @override
+ R errorUnresolvedSuperIndexPrefix(
+ Send node,
+ Element function,
+ Node index,
+ IncDecOperator operator,
+ A arg) {
+ // TODO: implement errorUnresolvedSuperIndexPrefix
+ }
+
+ @override
+ R visitIndexPostfix(
+ Send node,
+ Node receiver,
+ Node index,
+ IncDecOperator operator,
+ A arg) {
+ // TODO: implement visitIndexPostfix
+ }
+
+ @override
+ R visitIndexPrefix(
+ Send node,
+ Node receiver,
+ Node index,
+ IncDecOperator operator,
+ A arg) {
+ // TODO: implement visitIndexPrefix
+ }
+
+ @override
+ R visitSuperIndexPostfix(
+ Send node,
+ FunctionElement indexFunction,
+ FunctionElement indexSetFunction,
+ Node index,
+ IncDecOperator operator,
+ A arg) {
+ // TODO: implement visitSuperIndexPostfix
+ }
+
+ @override
+ R visitSuperIndexPrefix(
+ Send node,
+ FunctionElement indexFunction,
+ FunctionElement indexSetFunction,
+ Node index,
+ IncDecOperator operator,
+ A arg) {
+ // TODO: implement visitSuperIndexPrefix
+ }
}
/// AST visitor that visits all normal [Send] and [SendSet] nodes using the
@@ -3947,7 +4090,8 @@ class TraversalVisitor<R, A> extends SemanticVisitor<R, A>
///
/// This mixin is useful for the cases where both top level members and static
/// class members are handled uniformly.
-abstract class GroupStaticMixin<R, A> implements SemanticSendVisitor<R, A> {
+abstract class BaseImplementationOfStaticsMixin<R, A>
+ implements SemanticSendVisitor<R, A> {
R handleStaticFieldCompound(
Send node,
FieldElement field,
@@ -4388,7 +4532,8 @@ abstract class GroupStaticMixin<R, A> implements SemanticSendVisitor<R, A> {
///
/// This mixin is useful for the cases where both parameters, local variables,
/// and local functions, captured or not, are handled uniformly.
-abstract class GroupLocalMixin<R, A> implements SemanticSendVisitor<R, A> {
+abstract class BaseImplementationOfLocalsMixin<R, A>
+ implements SemanticSendVisitor<R, A> {
R handleLocalCompound(
Send node,
LocalElement element,
@@ -4559,7 +4704,8 @@ abstract class GroupLocalMixin<R, A> implements SemanticSendVisitor<R, A> {
///
/// This mixin is useful for the cases where expressions on constants are
/// handled uniformly.
-abstract class GroupConstantMixin<R, A> implements SemanticSendVisitor<R, A> {
+abstract class BaseImplementationOfConstantsMixin<R, A>
+ implements SemanticSendVisitor<R, A> {
R handleConstantGet(
Send node,
ConstantExpression constant,
@@ -4651,7 +4797,8 @@ abstract class GroupConstantMixin<R, A> implements SemanticSendVisitor<R, A> {
///
/// This mixin is useful for the cases where dynamic and this properties are
/// handled uniformly.
-abstract class GroupDynamicMixin<R, A> implements SemanticSendVisitor<R, A> {
+abstract class BaseImplementationOfDynamicsMixin<R, A>
+ implements SemanticSendVisitor<R, A> {
R handleDynamicCompound(
Send node,
Node receiver,
@@ -4690,6 +4837,14 @@ abstract class GroupDynamicMixin<R, A> implements SemanticSendVisitor<R, A> {
Node rhs,
A arg);
+ R handleDynamicIndexPostfixPrefix(
+ Send node,
+ Node receiver,
+ Node index,
+ IncDecOperator operator,
+ A arg,
+ {bool isPrefix});
+
@override
R visitDynamicPropertyCompound(
Send node,
@@ -4819,6 +4974,28 @@ abstract class GroupDynamicMixin<R, A> implements SemanticSendVisitor<R, A> {
A arg) {
return handleDynamicSet(node, null, selector, rhs, arg);
}
+
+ @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);
+ }
}
/// Mixin that groups all `visitSuperXPrefix`, `visitSuperXPostfix` methods for
@@ -4826,7 +5003,8 @@ abstract class GroupDynamicMixin<R, A> implements SemanticSendVisitor<R, A> {
///
/// This mixin is useful for the cases where super prefix/postfix expression are
/// handled uniformly.
-abstract class GroupSuperMixin<R, A> implements SemanticSendVisitor<R, A> {
+abstract class BaseImplementationOfSuperIncDecsMixin<R, A>
+ implements SemanticSendVisitor<R, A> {
R handleSuperFieldFieldPostfixPrefix(
Send node,
FieldElement readField,
@@ -4867,6 +5045,15 @@ abstract class GroupSuperMixin<R, A> implements SemanticSendVisitor<R, A> {
A arg,
{bool isPrefix});
+ R handleSuperIndexPostfixPrefix(
+ Send node,
+ FunctionElement indexFunction,
+ FunctionElement indexSetFunction,
+ Node index,
+ IncDecOperator operator,
+ A arg,
+ {bool isPrefix});
+
@override
R visitSuperFieldFieldPostfix(
Send node,
@@ -4996,4 +5183,30 @@ abstract class GroupSuperMixin<R, A> implements SemanticSendVisitor<R, A> {
return handleSuperMethodSetterPostfixPrefix(
node, method, setter, operator, arg, isPrefix: true);
}
+
+ @override
+ R visitSuperIndexPostfix(
+ Send node,
+ FunctionElement indexFunction,
+ FunctionElement indexSetFunction,
+ Node index,
+ IncDecOperator operator,
+ A arg) {
+ return handleSuperIndexPostfixPrefix(
+ node, indexFunction, indexSetFunction,
+ index, operator, arg, isPrefix: false);
+ }
+
+ @override
+ R visitSuperIndexPrefix(
+ Send node,
+ FunctionElement indexFunction,
+ FunctionElement indexSetFunction,
+ Node index,
+ IncDecOperator operator,
+ A arg) {
+ return handleSuperIndexPostfixPrefix(
+ node, indexFunction, indexSetFunction,
+ index, operator, arg, isPrefix: true);
+ }
}
« 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