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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart

Issue 2861523003: Add KernelXyzExpression stubs and factory methods. (Closed)
Patch Set: Created 3 years, 8 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/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
index b55184c1e60ce170fb1e76133779bfa1a9c7bb0e..65ac60bca950346e9523955b0131430787b08cfb 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
@@ -23,6 +23,31 @@ import 'package:front_end/src/fasta/type_inference/type_inferrer.dart';
import 'package:front_end/src/fasta/type_inference/type_promotion.dart';
import 'package:kernel/ast.dart';
+/// Shadow object for [AsExpression].
+class KernelAsExpression extends AsExpression implements KernelExpression {
+ KernelAsExpression(Expression operand, DartType type) : super(operand, type);
+
+ @override
+ DartType _inferExpression(
+ KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
+ // TODO(scheglov): implement.
+ return typeNeeded ? const DynamicType() : null;
+ }
+}
+
+/// Shadow object for [AwaitExpression].
+class KernelAwaitExpression extends AwaitExpression
+ implements KernelExpression {
+ KernelAwaitExpression(Expression operand) : super(operand);
+
+ @override
+ DartType _inferExpression(
+ KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
+ // TODO(scheglov): implement.
+ return typeNeeded ? const DynamicType() : null;
+ }
+}
+
/// Concrete shadow object representing a statement block in kernel form.
class KernelBlock extends Block implements KernelStatement {
KernelBlock(List<Statement> statements) : super(statements);
@@ -46,6 +71,95 @@ class KernelBoolLiteral extends BoolLiteral implements KernelExpression {
}
}
+/// Shadow object for [ConditionalExpression].
+class KernelConditionalExpression extends ConditionalExpression
+ implements KernelExpression {
+ KernelConditionalExpression(Expression condition, Expression then,
+ Expression otherwise, DartType staticType)
+ : super(condition, then, otherwise, staticType);
+
+ @override
+ DartType _inferExpression(
+ KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
+ // TODO(scheglov): implement.
+ return typeNeeded ? const DynamicType() : null;
+ }
+}
+
+/// Shadow object for [ConstructorInvocation].
+class KernelConstructorInvocation extends ConstructorInvocation
+ implements KernelExpression {
+ KernelConstructorInvocation(Constructor target, Arguments arguments,
+ {bool isConst: false})
+ : super(target, arguments, isConst: isConst);
+
+ KernelConstructorInvocation.byReference(
+ Reference targetReference, Arguments arguments)
+ : super.byReference(targetReference, arguments);
+
+ @override
+ DartType _inferExpression(
+ KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
+ // TODO(scheglov): implement.
+ return typeNeeded ? const DynamicType() : null;
+ }
+}
+
+/// Shadow object for [DirectMethodInvocation].
+class KernelDirectMethodInvocation extends DirectMethodInvocation
+ implements KernelExpression {
+ KernelDirectMethodInvocation(
+ Expression receiver, Procedure target, Arguments arguments)
+ : super(receiver, target, arguments);
+
+ KernelDirectMethodInvocation.byReference(
+ Expression receiver, Reference targetReference, Arguments arguments)
+ : super.byReference(receiver, targetReference, arguments);
+
+ @override
+ DartType _inferExpression(
+ KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
+ // TODO(scheglov): implement.
+ return typeNeeded ? const DynamicType() : null;
+ }
+}
+
+/// Shadow object for [DirectPropertyGet].
+class KernelDirectPropertyGet extends DirectPropertyGet
+ implements KernelExpression {
+ KernelDirectPropertyGet(Expression receiver, Member target)
+ : super(receiver, target);
+
+ KernelDirectPropertyGet.byReference(
+ Expression receiver, Reference targetReference)
+ : super.byReference(receiver, targetReference);
+
+ @override
+ DartType _inferExpression(
+ KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
+ // TODO(scheglov): implement.
+ return typeNeeded ? const DynamicType() : null;
+ }
+}
+
+/// Shadow object for [DirectPropertySet].
+class KernelDirectPropertySet extends DirectPropertySet
+ implements KernelExpression {
+ KernelDirectPropertySet(Expression receiver, Member target, Expression value)
+ : super(receiver, target, value);
+
+ KernelDirectPropertySet.byReference(
+ Expression receiver, Reference targetReference, Expression value)
+ : super.byReference(receiver, targetReference, value);
+
+ @override
+ DartType _inferExpression(
+ KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
+ // TODO(scheglov): implement.
+ return typeNeeded ? const DynamicType() : null;
+ }
+}
+
/// Concrete shadow object representing a double literal in kernel form.
class KernelDoubleLiteral extends DoubleLiteral implements KernelExpression {
KernelDoubleLiteral(double value) : super(value);
@@ -196,6 +310,67 @@ class KernelListLiteral extends ListLiteral implements KernelExpression {
}
}
+/// Shadow object for [LogicalExpression].
+class KernelLogicalExpression extends LogicalExpression
+ implements KernelExpression {
+ KernelLogicalExpression(Expression left, String operator, Expression right)
+ : super(left, operator, right);
+
+ @override
+ DartType _inferExpression(
+ KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
+ // TODO(scheglov): implement.
+ return typeNeeded ? const DynamicType() : null;
+ }
+}
+
+/// Shadow object for [MapLiteral].
+class KernelMapLiteral extends MapLiteral implements KernelExpression {
+ KernelMapLiteral(List<MapEntry> entries,
+ {DartType keyType: const DynamicType(),
+ DartType valueType: const DynamicType(),
+ bool isConst: false})
+ : super(entries,
+ keyType: keyType, valueType: valueType, isConst: isConst);
+
+ @override
+ DartType _inferExpression(
+ KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
+ // TODO(scheglov): implement.
+ return typeNeeded ? const DynamicType() : null;
+ }
+}
+
+/// Shadow object for [MethodInvocation].
+class KernelMethodInvocation extends MethodInvocation
+ implements KernelExpression {
+ KernelMethodInvocation(Expression receiver, Name name, Arguments arguments)
+ : super(receiver, name, arguments);
+
+ KernelMethodInvocation.byReference(Expression receiver, Name name,
+ Arguments arguments, Reference interfaceTargetReference)
+ : super.byReference(receiver, name, arguments, interfaceTargetReference);
+
+ @override
+ DartType _inferExpression(
+ KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
+ // TODO(scheglov): implement.
+ return typeNeeded ? const DynamicType() : null;
+ }
+}
+
+/// Shadow object for [Not].
+class KernelNot extends Not implements KernelExpression {
+ KernelNot(Expression operand) : super(operand);
+
+ @override
+ DartType _inferExpression(
+ KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
+ // TODO(scheglov): implement.
+ return typeNeeded ? const DynamicType() : null;
+ }
+}
+
/// Concrete shadow object representing a null literal in kernel form.
class KernelNullLiteral extends NullLiteral implements KernelExpression {
@override
@@ -206,6 +381,49 @@ class KernelNullLiteral extends NullLiteral implements KernelExpression {
}
}
+/// Shadow object for [PropertyGet].
+class KernelPropertyGet extends PropertyGet implements KernelExpression {
+ KernelPropertyGet(Expression receiver, Name name) : super(receiver, name);
+
+ KernelPropertyGet.byReference(
+ Expression receiver, Name name, Reference interfaceTargetReference)
+ : super.byReference(receiver, name, interfaceTargetReference);
+
+ @override
+ DartType _inferExpression(
+ KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
+ // TODO(scheglov): implement.
+ return typeNeeded ? const DynamicType() : null;
+ }
+}
+
+/// Shadow object for [PropertyGet].
+class KernelPropertySet extends PropertySet implements KernelExpression {
+ KernelPropertySet(Expression receiver, Name name, Expression value)
+ : super(receiver, name, value);
+
+ KernelPropertySet.byReference(Expression receiver, Name name,
+ Expression value, Reference interfaceTargetReference)
+ : super.byReference(receiver, name, value, interfaceTargetReference);
+
+ @override
+ DartType _inferExpression(
+ KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
+ // TODO(scheglov): implement.
+ return typeNeeded ? const DynamicType() : null;
+ }
+}
+
+/// Shadow object for [Rethrow].
+class KernelRethrow extends Rethrow implements KernelExpression {
+ @override
+ DartType _inferExpression(
+ KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
+ // TODO(scheglov): implement.
+ return typeNeeded ? const DynamicType() : null;
+ }
+}
+
/// Concrete shadow object representing a return statement in kernel form.
class KernelReturnStatement extends ReturnStatement implements KernelStatement {
KernelReturnStatement([KernelExpression expression]) : super(expression);
@@ -236,6 +454,40 @@ class KernelStaticGet extends StaticGet implements KernelExpression {
}
}
+/// Shadow object for [StaticInvocation].
+class KernelStaticInvocation extends StaticInvocation
+ implements KernelExpression {
+ KernelStaticInvocation(Procedure target, Arguments arguments,
+ {bool isConst: false})
+ : super(target, arguments, isConst: isConst);
+
+ KernelStaticInvocation.byReference(
+ Reference targetReference, Arguments arguments)
+ : super.byReference(targetReference, arguments);
+
+ @override
+ DartType _inferExpression(
+ KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
+ // TODO(scheglov): implement.
+ return typeNeeded ? const DynamicType() : null;
+ }
+}
+
+/// Shadow object for [StaticSet].
+class KernelStaticSet extends StaticSet implements KernelExpression {
+ KernelStaticSet(Member target, Expression value) : super(target, value);
+
+ KernelStaticSet.byReference(Reference targetReference, Expression value)
+ : super.byReference(targetReference, value);
+
+ @override
+ DartType _inferExpression(
+ KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
+ // TODO(scheglov): implement.
+ return typeNeeded ? const DynamicType() : null;
+ }
+}
+
/// Concrete shadow object representing a string concatenation in kernel form.
class KernelStringConcatenation extends StringConcatenation
implements KernelExpression {
@@ -260,6 +512,95 @@ class KernelStringLiteral extends StringLiteral implements KernelExpression {
}
}
+/// Shadow object for [SuperMethodInvocation].
+class KernelSuperMethodInvocation extends SuperMethodInvocation
+ implements KernelExpression {
+ KernelSuperMethodInvocation(Name name, Arguments arguments,
+ [Procedure interfaceTarget])
+ : super(name, arguments, interfaceTarget);
+
+ KernelSuperMethodInvocation.byReference(
+ Name name, Arguments arguments, Reference interfaceTargetReference)
+ : super.byReference(name, arguments, interfaceTargetReference);
+
+ @override
+ DartType _inferExpression(
+ KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
+ // TODO(scheglov): implement.
+ return typeNeeded ? const DynamicType() : null;
+ }
+}
+
+/// Shadow object for [SuperPropertyGet].
+class KernelSuperPropertyGet extends SuperPropertyGet
+ implements KernelExpression {
+ KernelSuperPropertyGet(Name name, [Member interfaceTarget])
+ : super(name, interfaceTarget);
+
+ KernelSuperPropertyGet.byReference(
+ Name name, Reference interfaceTargetReference)
+ : super.byReference(name, interfaceTargetReference);
+
+ @override
+ DartType _inferExpression(
+ KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
+ // TODO(scheglov): implement.
+ return typeNeeded ? const DynamicType() : null;
+ }
+}
+
+/// Shadow object for [SuperPropertySet].
+class KernelSuperPropertySet extends SuperPropertySet
+ implements KernelExpression {
+ KernelSuperPropertySet(Name name, Expression value, Member interfaceTarget)
+ : super(name, value, interfaceTarget);
+
+ KernelSuperPropertySet.byReference(
+ Name name, Expression value, Reference interfaceTargetReference)
+ : super.byReference(name, value, interfaceTargetReference);
+
+ @override
+ DartType _inferExpression(
+ KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
+ // TODO(scheglov): implement.
+ return typeNeeded ? const DynamicType() : null;
+ }
+}
+
+/// Shadow object for [SymbolLiteral].
+class KernelSymbolLiteral extends SymbolLiteral implements KernelExpression {
+ KernelSymbolLiteral(String value) : super(value);
+
+ @override
+ DartType _inferExpression(
+ KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
+ // TODO(scheglov): implement.
+ return typeNeeded ? const DynamicType() : null;
+ }
+}
+
+/// Shadow object for [ThisExpression].
+class KernelThisExpression extends ThisExpression implements KernelExpression {
+ @override
+ DartType _inferExpression(
+ KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
+ // TODO(scheglov): implement.
+ return typeNeeded ? const DynamicType() : null;
+ }
+}
+
+/// Shadow object for [Throw].
+class KernelThrow extends Throw implements KernelExpression {
+ KernelThrow(Expression expression) : super(expression);
+
+ @override
+ DartType _inferExpression(
+ KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
+ // TODO(scheglov): implement.
+ return typeNeeded ? const DynamicType() : null;
+ }
+}
+
/// Concrete implementation of [TypeInferenceEngine] specialized to work with
/// kernel objects.
class KernelTypeInferenceEngine extends TypeInferenceEngineImpl<KernelField> {
@@ -397,6 +738,18 @@ class KernelTypeInferrer extends TypeInferrerImpl<Statement, Expression,
}
}
+/// Shadow object for [TypeLiteral].
+class KernelTypeLiteral extends TypeLiteral implements KernelExpression {
+ KernelTypeLiteral(DartType type) : super(type);
+
+ @override
+ DartType _inferExpression(
+ KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
+ // TODO(scheglov): implement.
+ return typeNeeded ? const DynamicType() : null;
+ }
+}
+
/// Concrete implementation of [TypePromoter] specialized to work with kernel
/// objects.
///
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/kernel_ast_factory.dart ('k') | pkg/front_end/lib/src/fasta/parser/listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698