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

Side by Side Diff: pkg/front_end/lib/src/fasta/builder/ast_factory.dart

Issue 2768533002: Fasta type inference prototype #2
Patch Set: Rework atop 415c868589d02e98eb839f48150f4203d5cecdb0 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 unified diff | Download patch
« no previous file with comments | « pkg/front_end/front_end.iml ('k') | pkg/front_end/lib/src/fasta/builder/shadow_ast.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'package:kernel/ast.dart' show DartType, TreeNode; 5 import 'package:kernel/ast.dart' show DartType, TreeNode;
6 6
7 import 'shadow_ast.dart'; 7 import 'shadow_ast.dart';
8 8
9 /// An abstract class containing factory methods that create AST objects. 9 /// An abstract class containing factory methods that create AST objects.
10 /// 10 ///
(...skipping 20 matching lines...) Expand all
31 /// having a `toLocation` method on AstFactory that changes tokens to an 31 /// having a `toLocation` method on AstFactory that changes tokens to an
32 /// abstract type (`int` for kernel, `Token` for analyzer). 32 /// abstract type (`int` for kernel, `Token` for analyzer).
33 /// 33 ///
34 /// TODO(paulberry): in order to interface with analyzer, we'll need to 34 /// TODO(paulberry): in order to interface with analyzer, we'll need to
35 /// shadow-ify [DartType], since analyzer ASTs need to be able to record the 35 /// shadow-ify [DartType], since analyzer ASTs need to be able to record the
36 /// exact tokens that were used to specify a type. 36 /// exact tokens that were used to specify a type.
37 abstract class AstFactory { 37 abstract class AstFactory {
38 /// Creates a statement block. 38 /// Creates a statement block.
39 ShadowBlock block(List<ShadowStatement> statements, int charOffset); 39 ShadowBlock block(List<ShadowStatement> statements, int charOffset);
40 40
41 /// Note: needed because some kernel constructors require us to pass in a
42 /// List<Expression>.
43 List<ShadowExpression> expressionList(int length);
44
41 /// Creates an integer literal. 45 /// Creates an integer literal.
42 ShadowIntLiteral intLiteral(value, int charOffset); 46 ShadowIntLiteral intLiteral(value, int charOffset);
43 47
44 /// Creates a list literal expression. 48 /// Creates a list literal expression.
45 /// 49 ///
46 /// If the list literal did not have an explicitly declared type argument, 50 /// If the list literal did not have an explicitly declared type argument,
47 /// [typeArgument] should be `null`. 51 /// [typeArgument] should be `null`.
48 ShadowListLiteral listLiteral(List<ShadowExpression> expressions, 52 ShadowListLiteral listLiteral(List<ShadowExpression> expressions,
49 DartType typeArgument, bool isConst, int charOffset); 53 DartType typeArgument, bool isConst, int charOffset);
50 54
(...skipping 12 matching lines...) Expand all
63 /// 67 ///
64 /// If the variable declaration did not have an explicitly declared type, 68 /// If the variable declaration did not have an explicitly declared type,
65 /// [type] should be `null`. 69 /// [type] should be `null`.
66 ShadowVariableDeclaration variableDeclaration(String name, 70 ShadowVariableDeclaration variableDeclaration(String name,
67 {DartType type, 71 {DartType type,
68 ShadowExpression initializer, 72 ShadowExpression initializer,
69 int charOffset: TreeNode.noOffset, 73 int charOffset: TreeNode.noOffset,
70 bool isFinal: false, 74 bool isFinal: false,
71 bool isConst: false}); 75 bool isConst: false});
72 } 76 }
OLDNEW
« no previous file with comments | « pkg/front_end/front_end.iml ('k') | pkg/front_end/lib/src/fasta/builder/shadow_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698