| Index: pkg/front_end/lib/src/fasta/kernel/ast_factory.dart
|
| diff --git a/pkg/front_end/lib/src/fasta/kernel/ast_factory.dart b/pkg/front_end/lib/src/fasta/kernel/ast_factory.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..706f1e8ee21d0381eaf2b5cb25120dc1e4cd78dc
|
| --- /dev/null
|
| +++ b/pkg/front_end/lib/src/fasta/kernel/ast_factory.dart
|
| @@ -0,0 +1,43 @@
|
| +import 'package:kernel/ast.dart' show DartType;
|
| +
|
| +import '../builder/ast_factory.dart' as builder;
|
| +import '../builder/shadow_ast.dart' as builder;
|
| +import 'shadow_ast.dart';
|
| +
|
| +class AstFactory implements builder.AstFactory {
|
| + Block block(List<builder.Statement> statements, int charOffset) {
|
| + return new Block(statements)..fileOffset = charOffset;
|
| + }
|
| +
|
| + IntLiteral intLiteral(value, int charOffset) {
|
| + return new IntLiteral(value)..fileOffset = charOffset;
|
| + }
|
| +
|
| + ListLiteral listLiteral(List<builder.Expression> expressions,
|
| + DartType typeArgument, bool isConst, int charOffset) {
|
| + return new ListLiteral(expressions,
|
| + typeArgument: typeArgument, isConst: isConst)..fileOffset = charOffset;
|
| + }
|
| +
|
| + NullLiteral nullLiteral(int charOffset) {
|
| + return new NullLiteral()..fileOffset = charOffset;
|
| + }
|
| +
|
| + ReturnStatement returnStatement(
|
| + builder.Expression expression, int charOffset) {
|
| + return new ReturnStatement(expression)..fileOffset = charOffset;
|
| + }
|
| +
|
| + VariableDeclaration variableDeclaration(String name,
|
| + {DartType type,
|
| + builder.Expression initializer,
|
| + int charOffset,
|
| + bool isFinal: false,
|
| + bool isConst: false}) {
|
| + return new VariableDeclaration(name,
|
| + type: type,
|
| + initializer: initializer,
|
| + isFinal: isFinal,
|
| + isConst: isConst)..fileEqualsOffset = charOffset;
|
| + }
|
| +}
|
|
|