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

Side by Side Diff: pkg/analyzer/test/generated/ast_test.dart

Issue 109853003: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes for review comments. Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer/pubspec.yaml ('k') | pkg/analyzer/test/generated/element_test.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 // This code was auto-generated, is not intended to be edited, and is subject to 1 // This code was auto-generated, is not intended to be edited, and is subject to
2 // significant change. Please see the README file for more information. 2 // significant change. Please see the README file for more information.
3 3
4 library engine.ast_test; 4 library engine.ast_test;
5 5
6 import 'package:analyzer/src/generated/java_core.dart'; 6 import 'package:analyzer/src/generated/java_core.dart';
7 import 'package:analyzer/src/generated/java_junit.dart'; 7 import 'package:analyzer/src/generated/java_junit.dart';
8 import 'package:analyzer/src/generated/scanner.dart'; 8 import 'package:analyzer/src/generated/scanner.dart';
9 import 'package:analyzer/src/generated/ast.dart'; 9 import 'package:analyzer/src/generated/ast.dart';
10 import 'package:analyzer/src/generated/utilities_dart.dart'; 10 import 'package:analyzer/src/generated/utilities_dart.dart';
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 runJUnitTest(__test, __test.test_inSetterContext_prefix_minusMinus); 204 runJUnitTest(__test, __test.test_inSetterContext_prefix_minusMinus);
205 }); 205 });
206 _ut.test('test_inSetterContext_prefix_plusPlus', () { 206 _ut.test('test_inSetterContext_prefix_plusPlus', () {
207 final __test = new IndexExpressionTest(); 207 final __test = new IndexExpressionTest();
208 runJUnitTest(__test, __test.test_inSetterContext_prefix_plusPlus); 208 runJUnitTest(__test, __test.test_inSetterContext_prefix_plusPlus);
209 }); 209 });
210 }); 210 });
211 } 211 }
212 } 212 }
213 213
214 class ClassDeclarationTest extends ParserTestCase {
215 void test_getField() {
216 VariableDeclaration aVar = ASTFactory.variableDeclaration("a");
217 VariableDeclaration bVar = ASTFactory.variableDeclaration("b");
218 VariableDeclaration cVar = ASTFactory.variableDeclaration("c");
219 ClassDeclaration clazz = ASTFactory.classDeclaration(null, "Test", null, nul l, null, null, [
220 ASTFactory.fieldDeclaration2(false, null, [aVar]),
221 ASTFactory.fieldDeclaration2(false, null, [bVar, cVar])]);
222 JUnitTestCase.assertSame(aVar, clazz.getField("a"));
223 JUnitTestCase.assertSame(bVar, clazz.getField("b"));
224 JUnitTestCase.assertSame(cVar, clazz.getField("c"));
225 JUnitTestCase.assertSame(null, clazz.getField("noSuchField"));
226 }
227
228 static dartSuite() {
229 _ut.group('ClassDeclarationTest', () {
230 _ut.test('test_getField', () {
231 final __test = new ClassDeclarationTest();
232 runJUnitTest(__test, __test.test_getField);
233 });
234 });
235 }
236 }
237
214 class VariableDeclarationTest extends ParserTestCase { 238 class VariableDeclarationTest extends ParserTestCase {
215 void test_getDocumentationComment_onGrandParent() { 239 void test_getDocumentationComment_onGrandParent() {
216 VariableDeclaration varDecl = ASTFactory.variableDeclaration("a"); 240 VariableDeclaration varDecl = ASTFactory.variableDeclaration("a");
217 TopLevelVariableDeclaration decl = ASTFactory.topLevelVariableDeclaration2(K eyword.VAR, [varDecl]); 241 TopLevelVariableDeclaration decl = ASTFactory.topLevelVariableDeclaration2(K eyword.VAR, [varDecl]);
218 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); 242 Comment comment = Comment.createDocumentationComment(new List<Token>(0));
219 JUnitTestCase.assertNull(varDecl.documentationComment); 243 JUnitTestCase.assertNull(varDecl.documentationComment);
220 decl.documentationComment = comment; 244 decl.documentationComment = comment;
221 JUnitTestCase.assertNotNull(varDecl.documentationComment); 245 JUnitTestCase.assertNotNull(varDecl.documentationComment);
222 JUnitTestCase.assertNotNull(decl.documentationComment); 246 JUnitTestCase.assertNotNull(decl.documentationComment);
223 } 247 }
(...skipping 25 matching lines...) Expand all
249 * associated with the nodes by a parser are also created, but the token stream is not constructed. 273 * associated with the nodes by a parser are also created, but the token stream is not constructed.
250 * None of the nodes are resolved. 274 * None of the nodes are resolved.
251 * 275 *
252 * The general pattern is for the name of the factory method to be the same as t he name of the class 276 * The general pattern is for the name of the factory method to be the same as t he name of the class
253 * of AST node being created. There are two notable exceptions. The first is for methods creating 277 * of AST node being created. There are two notable exceptions. The first is for methods creating
254 * nodes that are part of a cascade expression. These methods are all prefixed w ith 'cascaded'. The 278 * nodes that are part of a cascade expression. These methods are all prefixed w ith 'cascaded'. The
255 * second is places where a shorter name seemed unambiguous and easier to read, such as using 279 * second is places where a shorter name seemed unambiguous and easier to read, such as using
256 * 'identifier' rather than 'prefixedIdentifier', or 'integer' rather than 'inte gerLiteral'. 280 * 'identifier' rather than 'prefixedIdentifier', or 'integer' rather than 'inte gerLiteral'.
257 */ 281 */
258 class ASTFactory { 282 class ASTFactory {
259 static AdjacentStrings adjacentStrings(List<StringLiteral> strings) => new Adj acentStrings.full(list(strings)); 283 static AdjacentStrings adjacentStrings(List<StringLiteral> strings) => new Adj acentStrings(list(strings));
260 284
261 static Annotation annotation(Identifier name) => new Annotation.full(TokenFact ory.token3(TokenType.AT), name, null, null, null); 285 static Annotation annotation(Identifier name) => new Annotation(TokenFactory.t oken3(TokenType.AT), name, null, null, null);
262 286
263 static Annotation annotation2(Identifier name, SimpleIdentifier constructorNam e, ArgumentList arguments) => new Annotation.full(TokenFactory.token3(TokenType. AT), name, TokenFactory.token3(TokenType.PERIOD), constructorName, arguments); 287 static Annotation annotation2(Identifier name, SimpleIdentifier constructorNam e, ArgumentList arguments) => new Annotation(TokenFactory.token3(TokenType.AT), name, TokenFactory.token3(TokenType.PERIOD), constructorName, arguments);
264 288
265 static ArgumentDefinitionTest argumentDefinitionTest(String identifier) => new ArgumentDefinitionTest.full(TokenFactory.token3(TokenType.QUESTION), identifier 3(identifier)); 289 static ArgumentDefinitionTest argumentDefinitionTest(String identifier) => new ArgumentDefinitionTest(TokenFactory.token3(TokenType.QUESTION), identifier3(ide ntifier));
266 290
267 static ArgumentList argumentList(List<Expression> arguments) => new ArgumentLi st.full(TokenFactory.token3(TokenType.OPEN_PAREN), list(arguments), TokenFactory .token3(TokenType.CLOSE_PAREN)); 291 static ArgumentList argumentList(List<Expression> arguments) => new ArgumentLi st(TokenFactory.token3(TokenType.OPEN_PAREN), list(arguments), TokenFactory.toke n3(TokenType.CLOSE_PAREN));
268 292
269 static AsExpression asExpression(Expression expression, TypeName type) => new AsExpression.full(expression, TokenFactory.token(Keyword.AS), type); 293 static AsExpression asExpression(Expression expression, TypeName type) => new AsExpression(expression, TokenFactory.token(Keyword.AS), type);
270 294
271 static AssertStatement assertStatement(Expression condition) => new AssertStat ement.full(TokenFactory.token(Keyword.ASSERT), TokenFactory.token3(TokenType.OPE N_PAREN), condition, TokenFactory.token3(TokenType.CLOSE_PAREN), TokenFactory.to ken3(TokenType.SEMICOLON)); 295 static AssertStatement assertStatement(Expression condition) => new AssertStat ement(TokenFactory.token(Keyword.ASSERT), TokenFactory.token3(TokenType.OPEN_PAR EN), condition, TokenFactory.token3(TokenType.CLOSE_PAREN), TokenFactory.token3( TokenType.SEMICOLON));
272 296
273 static AssignmentExpression assignmentExpression(Expression leftHandSide, Toke nType operator, Expression rightHandSide) => new AssignmentExpression.full(leftH andSide, TokenFactory.token3(operator), rightHandSide); 297 static AssignmentExpression assignmentExpression(Expression leftHandSide, Toke nType operator, Expression rightHandSide) => new AssignmentExpression(leftHandSi de, TokenFactory.token3(operator), rightHandSide);
274 298
275 static BinaryExpression binaryExpression(Expression leftOperand, TokenType ope rator, Expression rightOperand) => new BinaryExpression.full(leftOperand, TokenF actory.token3(operator), rightOperand); 299 static BinaryExpression binaryExpression(Expression leftOperand, TokenType ope rator, Expression rightOperand) => new BinaryExpression(leftOperand, TokenFactor y.token3(operator), rightOperand);
276 300
277 static Block block(List<Statement> statements) => new Block.full(TokenFactory. token3(TokenType.OPEN_CURLY_BRACKET), list(statements), TokenFactory.token3(Toke nType.CLOSE_CURLY_BRACKET)); 301 static Block block(List<Statement> statements) => new Block(TokenFactory.token 3(TokenType.OPEN_CURLY_BRACKET), list(statements), TokenFactory.token3(TokenType .CLOSE_CURLY_BRACKET));
278 302
279 static BlockFunctionBody blockFunctionBody(Block block) => new BlockFunctionBo dy.full(block); 303 static BlockFunctionBody blockFunctionBody(Block block) => new BlockFunctionBo dy(block);
280 304
281 static BlockFunctionBody blockFunctionBody2(List<Statement> statements) => new BlockFunctionBody.full(block(statements)); 305 static BlockFunctionBody blockFunctionBody2(List<Statement> statements) => new BlockFunctionBody(block(statements));
282 306
283 static BooleanLiteral booleanLiteral(bool value) => new BooleanLiteral.full(va lue ? TokenFactory.token(Keyword.TRUE) : TokenFactory.token(Keyword.FALSE), valu e); 307 static BooleanLiteral booleanLiteral(bool value) => new BooleanLiteral(value ? TokenFactory.token(Keyword.TRUE) : TokenFactory.token(Keyword.FALSE), value);
284 308
285 static BreakStatement breakStatement() => new BreakStatement.full(TokenFactory .token(Keyword.BREAK), null, TokenFactory.token3(TokenType.SEMICOLON)); 309 static BreakStatement breakStatement() => new BreakStatement(TokenFactory.toke n(Keyword.BREAK), null, TokenFactory.token3(TokenType.SEMICOLON));
286 310
287 static BreakStatement breakStatement2(String label) => new BreakStatement.full (TokenFactory.token(Keyword.BREAK), identifier3(label), TokenFactory.token3(Toke nType.SEMICOLON)); 311 static BreakStatement breakStatement2(String label) => new BreakStatement(Toke nFactory.token(Keyword.BREAK), identifier3(label), TokenFactory.token3(TokenType .SEMICOLON));
288 312
289 static IndexExpression cascadedIndexExpression(Expression index) => new IndexE xpression.forCascade_full(TokenFactory.token3(TokenType.PERIOD_PERIOD), TokenFac tory.token3(TokenType.OPEN_SQUARE_BRACKET), index, TokenFactory.token3(TokenType .CLOSE_SQUARE_BRACKET)); 313 static IndexExpression cascadedIndexExpression(Expression index) => new IndexE xpression.forCascade(TokenFactory.token3(TokenType.PERIOD_PERIOD), TokenFactory. token3(TokenType.OPEN_SQUARE_BRACKET), index, TokenFactory.token3(TokenType.CLOS E_SQUARE_BRACKET));
290 314
291 static MethodInvocation cascadedMethodInvocation(String methodName, List<Expre ssion> arguments) => new MethodInvocation.full(null, TokenFactory.token3(TokenTy pe.PERIOD_PERIOD), identifier3(methodName), argumentList(arguments)); 315 static MethodInvocation cascadedMethodInvocation(String methodName, List<Expre ssion> arguments) => new MethodInvocation(null, TokenFactory.token3(TokenType.PE RIOD_PERIOD), identifier3(methodName), argumentList(arguments));
292 316
293 static PropertyAccess cascadedPropertyAccess(String propertyName) => new Prope rtyAccess.full(null, TokenFactory.token3(TokenType.PERIOD_PERIOD), identifier3(p ropertyName)); 317 static PropertyAccess cascadedPropertyAccess(String propertyName) => new Prope rtyAccess(null, TokenFactory.token3(TokenType.PERIOD_PERIOD), identifier3(proper tyName));
294 318
295 static CascadeExpression cascadeExpression(Expression target, List<Expression> cascadeSections) => new CascadeExpression.full(target, list(cascadeSections)); 319 static CascadeExpression cascadeExpression(Expression target, List<Expression> cascadeSections) => new CascadeExpression(target, list(cascadeSections));
296 320
297 static CatchClause catchClause(String exceptionParameter, List<Statement> stat ements) => catchClause5(null, exceptionParameter, null, statements); 321 static CatchClause catchClause(String exceptionParameter, List<Statement> stat ements) => catchClause5(null, exceptionParameter, null, statements);
298 322
299 static CatchClause catchClause2(String exceptionParameter, String stackTracePa rameter, List<Statement> statements) => catchClause5(null, exceptionParameter, s tackTraceParameter, statements); 323 static CatchClause catchClause2(String exceptionParameter, String stackTracePa rameter, List<Statement> statements) => catchClause5(null, exceptionParameter, s tackTraceParameter, statements);
300 324
301 static CatchClause catchClause3(TypeName exceptionType, List<Statement> statem ents) => catchClause5(exceptionType, null, null, statements); 325 static CatchClause catchClause3(TypeName exceptionType, List<Statement> statem ents) => catchClause5(exceptionType, null, null, statements);
302 326
303 static CatchClause catchClause4(TypeName exceptionType, String exceptionParame ter, List<Statement> statements) => catchClause5(exceptionType, exceptionParamet er, null, statements); 327 static CatchClause catchClause4(TypeName exceptionType, String exceptionParame ter, List<Statement> statements) => catchClause5(exceptionType, exceptionParamet er, null, statements);
304 328
305 static CatchClause catchClause5(TypeName exceptionType, String exceptionParame ter, String stackTraceParameter, List<Statement> statements) => new CatchClause. full(exceptionType == null ? null : TokenFactory.token4(TokenType.IDENTIFIER, "o n"), exceptionType, exceptionParameter == null ? null : TokenFactory.token(Keywo rd.CATCH), exceptionParameter == null ? null : TokenFactory.token3(TokenType.OPE N_PAREN), identifier3(exceptionParameter), stackTraceParameter == null ? null : TokenFactory.token3(TokenType.COMMA), stackTraceParameter == null ? null : ident ifier3(stackTraceParameter), exceptionParameter == null ? null : TokenFactory.to ken3(TokenType.CLOSE_PAREN), block(statements)); 329 static CatchClause catchClause5(TypeName exceptionType, String exceptionParame ter, String stackTraceParameter, List<Statement> statements) => new CatchClause( exceptionType == null ? null : TokenFactory.token4(TokenType.IDENTIFIER, "on"), exceptionType, exceptionParameter == null ? null : TokenFactory.token(Keyword.CA TCH), exceptionParameter == null ? null : TokenFactory.token3(TokenType.OPEN_PAR EN), identifier3(exceptionParameter), stackTraceParameter == null ? null : Token Factory.token3(TokenType.COMMA), stackTraceParameter == null ? null : identifier 3(stackTraceParameter), exceptionParameter == null ? null : TokenFactory.token3( TokenType.CLOSE_PAREN), block(statements));
306 330
307 static ClassDeclaration classDeclaration(Keyword abstractKeyword, String name, TypeParameterList typeParameters, ExtendsClause extendsClause, WithClause withC lause, ImplementsClause implementsClause, List<ClassMember> members) => new Clas sDeclaration.full(null, null, abstractKeyword == null ? null : TokenFactory.toke n(abstractKeyword), TokenFactory.token(Keyword.CLASS), identifier3(name), typePa rameters, extendsClause, withClause, implementsClause, TokenFactory.token3(Token Type.OPEN_CURLY_BRACKET), list(members), TokenFactory.token3(TokenType.CLOSE_CUR LY_BRACKET)); 331 static ClassDeclaration classDeclaration(Keyword abstractKeyword, String name, TypeParameterList typeParameters, ExtendsClause extendsClause, WithClause withC lause, ImplementsClause implementsClause, List<ClassMember> members) => new Clas sDeclaration(null, null, abstractKeyword == null ? null : TokenFactory.token(abs tractKeyword), TokenFactory.token(Keyword.CLASS), identifier3(name), typeParamet ers, extendsClause, withClause, implementsClause, TokenFactory.token3(TokenType. OPEN_CURLY_BRACKET), list(members), TokenFactory.token3(TokenType.CLOSE_CURLY_BR ACKET));
308 332
309 static ClassTypeAlias classTypeAlias(String name, TypeParameterList typeParame ters, Keyword abstractKeyword, TypeName superclass, WithClause withClause, Imple mentsClause implementsClause) => new ClassTypeAlias.full(null, null, TokenFactor y.token(Keyword.CLASS), identifier3(name), typeParameters, TokenFactory.token3(T okenType.EQ), abstractKeyword == null ? null : TokenFactory.token(abstractKeywor d), superclass, withClause, implementsClause, TokenFactory.token3(TokenType.SEMI COLON)); 333 static ClassTypeAlias classTypeAlias(String name, TypeParameterList typeParame ters, Keyword abstractKeyword, TypeName superclass, WithClause withClause, Imple mentsClause implementsClause) => new ClassTypeAlias(null, null, TokenFactory.tok en(Keyword.CLASS), identifier3(name), typeParameters, TokenFactory.token3(TokenT ype.EQ), abstractKeyword == null ? null : TokenFactory.token(abstractKeyword), s uperclass, withClause, implementsClause, TokenFactory.token3(TokenType.SEMICOLON ));
310 334
311 static CompilationUnit compilationUnit() => compilationUnit8(null, null, null) ; 335 static CompilationUnit compilationUnit() => compilationUnit8(null, null, null) ;
312 336
313 static CompilationUnit compilationUnit2(List<CompilationUnitMember> declaratio ns) => compilationUnit8(null, null, list(declarations)); 337 static CompilationUnit compilationUnit2(List<CompilationUnitMember> declaratio ns) => compilationUnit8(null, null, list(declarations));
314 338
315 static CompilationUnit compilationUnit3(List<Directive> directives) => compila tionUnit8(null, list(directives), null); 339 static CompilationUnit compilationUnit3(List<Directive> directives) => compila tionUnit8(null, list(directives), null);
316 340
317 static CompilationUnit compilationUnit4(List<Directive> directives, List<Compi lationUnitMember> declarations) => compilationUnit8(null, directives, declaratio ns); 341 static CompilationUnit compilationUnit4(List<Directive> directives, List<Compi lationUnitMember> declarations) => compilationUnit8(null, directives, declaratio ns);
318 342
319 static CompilationUnit compilationUnit5(String scriptTag) => compilationUnit8( scriptTag, null, null); 343 static CompilationUnit compilationUnit5(String scriptTag) => compilationUnit8( scriptTag, null, null);
320 344
321 static CompilationUnit compilationUnit6(String scriptTag, List<CompilationUnit Member> declarations) => compilationUnit8(scriptTag, null, list(declarations)); 345 static CompilationUnit compilationUnit6(String scriptTag, List<CompilationUnit Member> declarations) => compilationUnit8(scriptTag, null, list(declarations));
322 346
323 static CompilationUnit compilationUnit7(String scriptTag, List<Directive> dire ctives) => compilationUnit8(scriptTag, list(directives), null); 347 static CompilationUnit compilationUnit7(String scriptTag, List<Directive> dire ctives) => compilationUnit8(scriptTag, list(directives), null);
324 348
325 static CompilationUnit compilationUnit8(String scriptTag, List<Directive> dire ctives, List<CompilationUnitMember> declarations) => new CompilationUnit.full(To kenFactory.token3(TokenType.EOF), scriptTag == null ? null : ASTFactory.scriptTa g(scriptTag), directives == null ? new List<Directive>() : directives, declarati ons == null ? new List<CompilationUnitMember>() : declarations, TokenFactory.tok en3(TokenType.EOF)); 349 static CompilationUnit compilationUnit8(String scriptTag, List<Directive> dire ctives, List<CompilationUnitMember> declarations) => new CompilationUnit(TokenFa ctory.token3(TokenType.EOF), scriptTag == null ? null : ASTFactory.scriptTag(scr iptTag), directives == null ? new List<Directive>() : directives, declarations = = null ? new List<CompilationUnitMember>() : declarations, TokenFactory.token3(T okenType.EOF));
326 350
327 static ConditionalExpression conditionalExpression(Expression condition, Expre ssion thenExpression, Expression elseExpression) => new ConditionalExpression.fu ll(condition, TokenFactory.token3(TokenType.QUESTION), thenExpression, TokenFact ory.token3(TokenType.COLON), elseExpression); 351 static ConditionalExpression conditionalExpression(Expression condition, Expre ssion thenExpression, Expression elseExpression) => new ConditionalExpression(co ndition, TokenFactory.token3(TokenType.QUESTION), thenExpression, TokenFactory.t oken3(TokenType.COLON), elseExpression);
328 352
329 static ConstructorDeclaration constructorDeclaration(Identifier returnType, St ring name, FormalParameterList parameters, List<ConstructorInitializer> initiali zers) => new ConstructorDeclaration.full(null, null, TokenFactory.token(Keyword. EXTERNAL), null, null, returnType, name == null ? null : TokenFactory.token3(Tok enType.PERIOD), name == null ? null : identifier3(name), parameters, initializer s == null || initializers.isEmpty ? null : TokenFactory.token3(TokenType.PERIOD) , initializers == null ? new List<ConstructorInitializer>() : initializers, null , emptyFunctionBody()); 353 static ConstructorDeclaration constructorDeclaration(Identifier returnType, St ring name, FormalParameterList parameters, List<ConstructorInitializer> initiali zers) => new ConstructorDeclaration(null, null, TokenFactory.token(Keyword.EXTER NAL), null, null, returnType, name == null ? null : TokenFactory.token3(TokenTyp e.PERIOD), name == null ? null : identifier3(name), parameters, initializers == null || initializers.isEmpty ? null : TokenFactory.token3(TokenType.PERIOD), ini tializers == null ? new List<ConstructorInitializer>() : initializers, null, emp tyFunctionBody());
330 354
331 static ConstructorDeclaration constructorDeclaration2(Keyword constKeyword, Ke yword factoryKeyword, Identifier returnType, String name, FormalParameterList pa rameters, List<ConstructorInitializer> initializers, FunctionBody body) => new C onstructorDeclaration.full(null, null, null, constKeyword == null ? null : Token Factory.token(constKeyword), factoryKeyword == null ? null : TokenFactory.token( factoryKeyword), returnType, name == null ? null : TokenFactory.token3(TokenType .PERIOD), name == null ? null : identifier3(name), parameters, initializers == n ull || initializers.isEmpty ? null : TokenFactory.token3(TokenType.PERIOD), init ializers == null ? new List<ConstructorInitializer>() : initializers, null, body ); 355 static ConstructorDeclaration constructorDeclaration2(Keyword constKeyword, Ke yword factoryKeyword, Identifier returnType, String name, FormalParameterList pa rameters, List<ConstructorInitializer> initializers, FunctionBody body) => new C onstructorDeclaration(null, null, null, constKeyword == null ? null : TokenFacto ry.token(constKeyword), factoryKeyword == null ? null : TokenFactory.token(facto ryKeyword), returnType, name == null ? null : TokenFactory.token3(TokenType.PERI OD), name == null ? null : identifier3(name), parameters, initializers == null | | initializers.isEmpty ? null : TokenFactory.token3(TokenType.PERIOD), initializ ers == null ? new List<ConstructorInitializer>() : initializers, null, body);
332 356
333 static ConstructorFieldInitializer constructorFieldInitializer(bool prefixedWi thThis, String fieldName, Expression expression) => new ConstructorFieldInitiali zer.full(prefixedWithThis ? TokenFactory.token(Keyword.THIS) : null, prefixedWit hThis ? TokenFactory.token3(TokenType.PERIOD) : null, identifier3(fieldName), To kenFactory.token3(TokenType.EQ), expression); 357 static ConstructorFieldInitializer constructorFieldInitializer(bool prefixedWi thThis, String fieldName, Expression expression) => new ConstructorFieldInitiali zer(prefixedWithThis ? TokenFactory.token(Keyword.THIS) : null, prefixedWithThis ? TokenFactory.token3(TokenType.PERIOD) : null, identifier3(fieldName), TokenFa ctory.token3(TokenType.EQ), expression);
334 358
335 static ConstructorName constructorName(TypeName type, String name) => new Cons tructorName.full(type, name == null ? null : TokenFactory.token3(TokenType.PERIO D), name == null ? null : identifier3(name)); 359 static ConstructorName constructorName(TypeName type, String name) => new Cons tructorName(type, name == null ? null : TokenFactory.token3(TokenType.PERIOD), n ame == null ? null : identifier3(name));
336 360
337 static ContinueStatement continueStatement() => new ContinueStatement.full(Tok enFactory.token(Keyword.CONTINUE), null, TokenFactory.token3(TokenType.SEMICOLON )); 361 static ContinueStatement continueStatement() => new ContinueStatement(TokenFac tory.token(Keyword.CONTINUE), null, TokenFactory.token3(TokenType.SEMICOLON));
338 362
339 static ContinueStatement continueStatement2(String label) => new ContinueState ment.full(TokenFactory.token(Keyword.CONTINUE), identifier3(label), TokenFactory .token3(TokenType.SEMICOLON)); 363 static ContinueStatement continueStatement2(String label) => new ContinueState ment(TokenFactory.token(Keyword.CONTINUE), identifier3(label), TokenFactory.toke n3(TokenType.SEMICOLON));
340 364
341 static DeclaredIdentifier declaredIdentifier(Keyword keyword, String identifie r) => declaredIdentifier2(keyword, null, identifier); 365 static DeclaredIdentifier declaredIdentifier(Keyword keyword, String identifie r) => declaredIdentifier2(keyword, null, identifier);
342 366
343 static DeclaredIdentifier declaredIdentifier2(Keyword keyword, TypeName type, String identifier) => new DeclaredIdentifier.full(null, null, keyword == null ? null : TokenFactory.token(keyword), type, identifier3(identifier)); 367 static DeclaredIdentifier declaredIdentifier2(Keyword keyword, TypeName type, String identifier) => new DeclaredIdentifier(null, null, keyword == null ? null : TokenFactory.token(keyword), type, identifier3(identifier));
344 368
345 static DeclaredIdentifier declaredIdentifier3(String identifier) => declaredId entifier2(null, null, identifier); 369 static DeclaredIdentifier declaredIdentifier3(String identifier) => declaredId entifier2(null, null, identifier);
346 370
347 static DeclaredIdentifier declaredIdentifier4(TypeName type, String identifier ) => declaredIdentifier2(null, type, identifier); 371 static DeclaredIdentifier declaredIdentifier4(TypeName type, String identifier ) => declaredIdentifier2(null, type, identifier);
348 372
349 static DoStatement doStatement(Statement body, Expression condition) => new Do Statement.full(TokenFactory.token(Keyword.DO), body, TokenFactory.token(Keyword. WHILE), TokenFactory.token3(TokenType.OPEN_PAREN), condition, TokenFactory.token 3(TokenType.CLOSE_PAREN), TokenFactory.token3(TokenType.SEMICOLON)); 373 static DoStatement doStatement(Statement body, Expression condition) => new Do Statement(TokenFactory.token(Keyword.DO), body, TokenFactory.token(Keyword.WHILE ), TokenFactory.token3(TokenType.OPEN_PAREN), condition, TokenFactory.token3(Tok enType.CLOSE_PAREN), TokenFactory.token3(TokenType.SEMICOLON));
350 374
351 static DoubleLiteral doubleLiteral(double value) => new DoubleLiteral.full(Tok enFactory.token2(value.toString()), value); 375 static DoubleLiteral doubleLiteral(double value) => new DoubleLiteral(TokenFac tory.token2(value.toString()), value);
352 376
353 static EmptyFunctionBody emptyFunctionBody() => new EmptyFunctionBody.full(Tok enFactory.token3(TokenType.SEMICOLON)); 377 static EmptyFunctionBody emptyFunctionBody() => new EmptyFunctionBody(TokenFac tory.token3(TokenType.SEMICOLON));
354 378
355 static EmptyStatement emptyStatement() => new EmptyStatement.full(TokenFactory .token3(TokenType.SEMICOLON)); 379 static EmptyStatement emptyStatement() => new EmptyStatement(TokenFactory.toke n3(TokenType.SEMICOLON));
356 380
357 static ExportDirective exportDirective(List<Annotation> metadata, String uri, List<Combinator> combinators) => new ExportDirective.full(null, metadata, TokenF actory.token(Keyword.EXPORT), string2(uri), list(combinators), TokenFactory.toke n3(TokenType.SEMICOLON)); 381 static ExportDirective exportDirective(List<Annotation> metadata, String uri, List<Combinator> combinators) => new ExportDirective(null, metadata, TokenFactor y.token(Keyword.EXPORT), string2(uri), list(combinators), TokenFactory.token3(To kenType.SEMICOLON));
358 382
359 static ExportDirective exportDirective2(String uri, List<Combinator> combinato rs) => exportDirective(new List<Annotation>(), uri, combinators); 383 static ExportDirective exportDirective2(String uri, List<Combinator> combinato rs) => exportDirective(new List<Annotation>(), uri, combinators);
360 384
361 static ExpressionFunctionBody expressionFunctionBody(Expression expression) => new ExpressionFunctionBody.full(TokenFactory.token3(TokenType.FUNCTION), expres sion, TokenFactory.token3(TokenType.SEMICOLON)); 385 static ExpressionFunctionBody expressionFunctionBody(Expression expression) => new ExpressionFunctionBody(TokenFactory.token3(TokenType.FUNCTION), expression, TokenFactory.token3(TokenType.SEMICOLON));
362 386
363 static ExpressionStatement expressionStatement(Expression expression) => new E xpressionStatement.full(expression, TokenFactory.token3(TokenType.SEMICOLON)); 387 static ExpressionStatement expressionStatement(Expression expression) => new E xpressionStatement(expression, TokenFactory.token3(TokenType.SEMICOLON));
364 388
365 static ExtendsClause extendsClause(TypeName type) => new ExtendsClause.full(To kenFactory.token(Keyword.EXTENDS), type); 389 static ExtendsClause extendsClause(TypeName type) => new ExtendsClause(TokenFa ctory.token(Keyword.EXTENDS), type);
366 390
367 static FieldDeclaration fieldDeclaration(bool isStatic, Keyword keyword, TypeN ame type, List<VariableDeclaration> variables) => new FieldDeclaration.full(null , null, isStatic ? TokenFactory.token(Keyword.STATIC) : null, variableDeclaratio nList(keyword, type, variables), TokenFactory.token3(TokenType.SEMICOLON)); 391 static FieldDeclaration fieldDeclaration(bool isStatic, Keyword keyword, TypeN ame type, List<VariableDeclaration> variables) => new FieldDeclaration(null, nul l, isStatic ? TokenFactory.token(Keyword.STATIC) : null, variableDeclarationList (keyword, type, variables), TokenFactory.token3(TokenType.SEMICOLON));
368 392
369 static FieldDeclaration fieldDeclaration2(bool isStatic, Keyword keyword, List <VariableDeclaration> variables) => fieldDeclaration(isStatic, keyword, null, va riables); 393 static FieldDeclaration fieldDeclaration2(bool isStatic, Keyword keyword, List <VariableDeclaration> variables) => fieldDeclaration(isStatic, keyword, null, va riables);
370 394
371 static FieldFormalParameter fieldFormalParameter(Keyword keyword, TypeName typ e, String identifier) => new FieldFormalParameter.full(null, null, keyword == nu ll ? null : TokenFactory.token(keyword), type, TokenFactory.token(Keyword.THIS), TokenFactory.token3(TokenType.PERIOD), identifier3(identifier), null); 395 static FieldFormalParameter fieldFormalParameter(Keyword keyword, TypeName typ e, String identifier) => new FieldFormalParameter(null, null, keyword == null ? null : TokenFactory.token(keyword), type, TokenFactory.token(Keyword.THIS), Toke nFactory.token3(TokenType.PERIOD), identifier3(identifier), null);
372 396
373 static FieldFormalParameter fieldFormalParameter2(Keyword keyword, TypeName ty pe, String identifier, FormalParameterList parameterList) => new FieldFormalPara meter.full(null, null, keyword == null ? null : TokenFactory.token(keyword), typ e, TokenFactory.token(Keyword.THIS), TokenFactory.token3(TokenType.PERIOD), iden tifier3(identifier), parameterList); 397 static FieldFormalParameter fieldFormalParameter2(Keyword keyword, TypeName ty pe, String identifier, FormalParameterList parameterList) => new FieldFormalPara meter(null, null, keyword == null ? null : TokenFactory.token(keyword), type, To kenFactory.token(Keyword.THIS), TokenFactory.token3(TokenType.PERIOD), identifie r3(identifier), parameterList);
374 398
375 static FieldFormalParameter fieldFormalParameter3(String identifier) => fieldF ormalParameter(null, null, identifier); 399 static FieldFormalParameter fieldFormalParameter3(String identifier) => fieldF ormalParameter(null, null, identifier);
376 400
377 static ForEachStatement forEachStatement(DeclaredIdentifier loopVariable, Expr ession iterator, Statement body) => new ForEachStatement.con1_full(TokenFactory. token(Keyword.FOR), TokenFactory.token3(TokenType.OPEN_PAREN), loopVariable, Tok enFactory.token(Keyword.IN), iterator, TokenFactory.token3(TokenType.CLOSE_PAREN ), body); 401 static ForEachStatement forEachStatement(DeclaredIdentifier loopVariable, Expr ession iterator, Statement body) => new ForEachStatement.con1(TokenFactory.token (Keyword.FOR), TokenFactory.token3(TokenType.OPEN_PAREN), loopVariable, TokenFac tory.token(Keyword.IN), iterator, TokenFactory.token3(TokenType.CLOSE_PAREN), bo dy);
378 402
379 static FormalParameterList formalParameterList(List<FormalParameter> parameter s) => new FormalParameterList.full(TokenFactory.token3(TokenType.OPEN_PAREN), li st(parameters), null, null, TokenFactory.token3(TokenType.CLOSE_PAREN)); 403 static FormalParameterList formalParameterList(List<FormalParameter> parameter s) => new FormalParameterList(TokenFactory.token3(TokenType.OPEN_PAREN), list(pa rameters), null, null, TokenFactory.token3(TokenType.CLOSE_PAREN));
380 404
381 static ForStatement forStatement(Expression initialization, Expression conditi on, List<Expression> updaters, Statement body) => new ForStatement.full(TokenFac tory.token(Keyword.FOR), TokenFactory.token3(TokenType.OPEN_PAREN), null, initia lization, TokenFactory.token3(TokenType.SEMICOLON), condition, TokenFactory.toke n3(TokenType.SEMICOLON), updaters, TokenFactory.token3(TokenType.CLOSE_PAREN), b ody); 405 static ForStatement forStatement(Expression initialization, Expression conditi on, List<Expression> updaters, Statement body) => new ForStatement(TokenFactory. token(Keyword.FOR), TokenFactory.token3(TokenType.OPEN_PAREN), null, initializat ion, TokenFactory.token3(TokenType.SEMICOLON), condition, TokenFactory.token3(To kenType.SEMICOLON), updaters, TokenFactory.token3(TokenType.CLOSE_PAREN), body);
382 406
383 static ForStatement forStatement2(VariableDeclarationList variableList, Expres sion condition, List<Expression> updaters, Statement body) => new ForStatement.f ull(TokenFactory.token(Keyword.FOR), TokenFactory.token3(TokenType.OPEN_PAREN), variableList, null, TokenFactory.token3(TokenType.SEMICOLON), condition, TokenFa ctory.token3(TokenType.SEMICOLON), updaters, TokenFactory.token3(TokenType.CLOSE _PAREN), body); 407 static ForStatement forStatement2(VariableDeclarationList variableList, Expres sion condition, List<Expression> updaters, Statement body) => new ForStatement(T okenFactory.token(Keyword.FOR), TokenFactory.token3(TokenType.OPEN_PAREN), varia bleList, null, TokenFactory.token3(TokenType.SEMICOLON), condition, TokenFactory .token3(TokenType.SEMICOLON), updaters, TokenFactory.token3(TokenType.CLOSE_PARE N), body);
384 408
385 static FunctionDeclaration functionDeclaration(TypeName type, Keyword keyword, String name, FunctionExpression functionExpression) => new FunctionDeclaration. full(null, null, null, type, keyword == null ? null : TokenFactory.token(keyword ), identifier3(name), functionExpression); 409 static FunctionDeclaration functionDeclaration(TypeName type, Keyword keyword, String name, FunctionExpression functionExpression) => new FunctionDeclaration( null, null, null, type, keyword == null ? null : TokenFactory.token(keyword), id entifier3(name), functionExpression);
386 410
387 static FunctionDeclarationStatement functionDeclarationStatement(TypeName type , Keyword keyword, String name, FunctionExpression functionExpression) => new Fu nctionDeclarationStatement.full(functionDeclaration(type, keyword, name, functio nExpression)); 411 static FunctionDeclarationStatement functionDeclarationStatement(TypeName type , Keyword keyword, String name, FunctionExpression functionExpression) => new Fu nctionDeclarationStatement(functionDeclaration(type, keyword, name, functionExpr ession));
388 412
389 static FunctionExpression functionExpression() => new FunctionExpression.full( formalParameterList([]), blockFunctionBody2([])); 413 static FunctionExpression functionExpression() => new FunctionExpression(forma lParameterList([]), blockFunctionBody2([]));
390 414
391 static FunctionExpression functionExpression2(FormalParameterList parameters, FunctionBody body) => new FunctionExpression.full(parameters, body); 415 static FunctionExpression functionExpression2(FormalParameterList parameters, FunctionBody body) => new FunctionExpression(parameters, body);
392 416
393 static FunctionExpressionInvocation functionExpressionInvocation(Expression fu nction, List<Expression> arguments) => new FunctionExpressionInvocation.full(fun ction, argumentList(arguments)); 417 static FunctionExpressionInvocation functionExpressionInvocation(Expression fu nction, List<Expression> arguments) => new FunctionExpressionInvocation(function , argumentList(arguments));
394 418
395 static FunctionTypedFormalParameter functionTypedFormalParameter(TypeName retu rnType, String identifier, List<FormalParameter> parameters) => new FunctionType dFormalParameter.full(null, null, returnType, identifier3(identifier), formalPar ameterList(parameters)); 419 static FunctionTypedFormalParameter functionTypedFormalParameter(TypeName retu rnType, String identifier, List<FormalParameter> parameters) => new FunctionType dFormalParameter(null, null, returnType, identifier3(identifier), formalParamete rList(parameters));
396 420
397 static HideCombinator hideCombinator(List<SimpleIdentifier> identifiers) => ne w HideCombinator.full(TokenFactory.token2("hide"), list(identifiers)); 421 static HideCombinator hideCombinator(List<SimpleIdentifier> identifiers) => ne w HideCombinator(TokenFactory.token2("hide"), list(identifiers));
398 422
399 static HideCombinator hideCombinator2(List<String> identifiers) { 423 static HideCombinator hideCombinator2(List<String> identifiers) {
400 List<SimpleIdentifier> identifierList = new List<SimpleIdentifier>(); 424 List<SimpleIdentifier> identifierList = new List<SimpleIdentifier>();
401 for (String identifier in identifiers) { 425 for (String identifier in identifiers) {
402 identifierList.add(identifier3(identifier)); 426 identifierList.add(identifier3(identifier));
403 } 427 }
404 return new HideCombinator.full(TokenFactory.token2("hide"), identifierList); 428 return new HideCombinator(TokenFactory.token2("hide"), identifierList);
405 } 429 }
406 430
407 static PrefixedIdentifier identifier(SimpleIdentifier prefix, SimpleIdentifier identifier) => new PrefixedIdentifier.full(prefix, TokenFactory.token3(TokenTyp e.PERIOD), identifier); 431 static PrefixedIdentifier identifier(SimpleIdentifier prefix, SimpleIdentifier identifier) => new PrefixedIdentifier(prefix, TokenFactory.token3(TokenType.PER IOD), identifier);
408 432
409 static SimpleIdentifier identifier3(String lexeme) => new SimpleIdentifier.ful l(TokenFactory.token4(TokenType.IDENTIFIER, lexeme)); 433 static SimpleIdentifier identifier3(String lexeme) => new SimpleIdentifier(Tok enFactory.token4(TokenType.IDENTIFIER, lexeme));
410 434
411 static PrefixedIdentifier identifier4(String prefix, SimpleIdentifier identifi er) => new PrefixedIdentifier.full(identifier3(prefix), TokenFactory.token3(Toke nType.PERIOD), identifier); 435 static PrefixedIdentifier identifier4(String prefix, SimpleIdentifier identifi er) => new PrefixedIdentifier(identifier3(prefix), TokenFactory.token3(TokenType .PERIOD), identifier);
412 436
413 static PrefixedIdentifier identifier5(String prefix, String identifier) => new PrefixedIdentifier.full(identifier3(prefix), TokenFactory.token3(TokenType.PERI OD), identifier3(identifier)); 437 static PrefixedIdentifier identifier5(String prefix, String identifier) => new PrefixedIdentifier(identifier3(prefix), TokenFactory.token3(TokenType.PERIOD), identifier3(identifier));
414 438
415 static IfStatement ifStatement(Expression condition, Statement thenStatement) => ifStatement2(condition, thenStatement, null); 439 static IfStatement ifStatement(Expression condition, Statement thenStatement) => ifStatement2(condition, thenStatement, null);
416 440
417 static IfStatement ifStatement2(Expression condition, Statement thenStatement, Statement elseStatement) => new IfStatement.full(TokenFactory.token(Keyword.IF) , TokenFactory.token3(TokenType.OPEN_PAREN), condition, TokenFactory.token3(Toke nType.CLOSE_PAREN), thenStatement, elseStatement == null ? null : TokenFactory.t oken(Keyword.ELSE), elseStatement); 441 static IfStatement ifStatement2(Expression condition, Statement thenStatement, Statement elseStatement) => new IfStatement(TokenFactory.token(Keyword.IF), Tok enFactory.token3(TokenType.OPEN_PAREN), condition, TokenFactory.token3(TokenType .CLOSE_PAREN), thenStatement, elseStatement == null ? null : TokenFactory.token( Keyword.ELSE), elseStatement);
418 442
419 static ImplementsClause implementsClause(List<TypeName> types) => new Implemen tsClause.full(TokenFactory.token(Keyword.IMPLEMENTS), list(types)); 443 static ImplementsClause implementsClause(List<TypeName> types) => new Implemen tsClause(TokenFactory.token(Keyword.IMPLEMENTS), list(types));
420 444
421 static ImportDirective importDirective(List<Annotation> metadata, String uri, String prefix, List<Combinator> combinators) => new ImportDirective.full(null, m etadata, TokenFactory.token(Keyword.IMPORT), string2(uri), prefix == null ? null : TokenFactory.token(Keyword.AS), prefix == null ? null : identifier3(prefix), list(combinators), TokenFactory.token3(TokenType.SEMICOLON)); 445 static ImportDirective importDirective(List<Annotation> metadata, String uri, String prefix, List<Combinator> combinators) => new ImportDirective(null, metada ta, TokenFactory.token(Keyword.IMPORT), string2(uri), prefix == null ? null : To kenFactory.token(Keyword.AS), prefix == null ? null : identifier3(prefix), list( combinators), TokenFactory.token3(TokenType.SEMICOLON));
422 446
423 static ImportDirective importDirective2(String uri, String prefix, List<Combin ator> combinators) => importDirective(new List<Annotation>(), uri, prefix, combi nators); 447 static ImportDirective importDirective2(String uri, String prefix, List<Combin ator> combinators) => importDirective(new List<Annotation>(), uri, prefix, combi nators);
424 448
425 static IndexExpression indexExpression(Expression array, Expression index) => new IndexExpression.forTarget_full(array, TokenFactory.token3(TokenType.OPEN_SQU ARE_BRACKET), index, TokenFactory.token3(TokenType.CLOSE_SQUARE_BRACKET)); 449 static IndexExpression indexExpression(Expression array, Expression index) => new IndexExpression.forTarget(array, TokenFactory.token3(TokenType.OPEN_SQUARE_B RACKET), index, TokenFactory.token3(TokenType.CLOSE_SQUARE_BRACKET));
426 450
427 static InstanceCreationExpression instanceCreationExpression(Keyword keyword, ConstructorName name, List<Expression> arguments) => new InstanceCreationExpress ion.full(keyword == null ? null : TokenFactory.token(keyword), name, argumentLis t(arguments)); 451 static InstanceCreationExpression instanceCreationExpression(Keyword keyword, ConstructorName name, List<Expression> arguments) => new InstanceCreationExpress ion(keyword == null ? null : TokenFactory.token(keyword), name, argumentList(arg uments));
428 452
429 static InstanceCreationExpression instanceCreationExpression2(Keyword keyword, TypeName type, List<Expression> arguments) => instanceCreationExpression3(keywo rd, type, null, arguments); 453 static InstanceCreationExpression instanceCreationExpression2(Keyword keyword, TypeName type, List<Expression> arguments) => instanceCreationExpression3(keywo rd, type, null, arguments);
430 454
431 static InstanceCreationExpression instanceCreationExpression3(Keyword keyword, TypeName type, String identifier, List<Expression> arguments) => instanceCreati onExpression(keyword, new ConstructorName.full(type, identifier == null ? null : TokenFactory.token3(TokenType.PERIOD), identifier == null ? null : identifier3( identifier)), arguments); 455 static InstanceCreationExpression instanceCreationExpression3(Keyword keyword, TypeName type, String identifier, List<Expression> arguments) => instanceCreati onExpression(keyword, new ConstructorName(type, identifier == null ? null : Toke nFactory.token3(TokenType.PERIOD), identifier == null ? null : identifier3(ident ifier)), arguments);
432 456
433 static IntegerLiteral integer(int value) => new IntegerLiteral.full(TokenFacto ry.token4(TokenType.INT, value.toString()), value); 457 static IntegerLiteral integer(int value) => new IntegerLiteral(TokenFactory.to ken4(TokenType.INT, value.toString()), value);
434 458
435 static InterpolationExpression interpolationExpression(Expression expression) => new InterpolationExpression.full(TokenFactory.token3(TokenType.STRING_INTERPO LATION_EXPRESSION), expression, TokenFactory.token3(TokenType.CLOSE_CURLY_BRACKE T)); 459 static InterpolationExpression interpolationExpression(Expression expression) => new InterpolationExpression(TokenFactory.token3(TokenType.STRING_INTERPOLATIO N_EXPRESSION), expression, TokenFactory.token3(TokenType.CLOSE_CURLY_BRACKET));
436 460
437 static InterpolationExpression interpolationExpression2(String identifier) => new InterpolationExpression.full(TokenFactory.token3(TokenType.STRING_INTERPOLAT ION_IDENTIFIER), identifier3(identifier), null); 461 static InterpolationExpression interpolationExpression2(String identifier) => new InterpolationExpression(TokenFactory.token3(TokenType.STRING_INTERPOLATION_I DENTIFIER), identifier3(identifier), null);
438 462
439 static InterpolationString interpolationString(String contents, String value) => new InterpolationString.full(TokenFactory.token2(contents), value); 463 static InterpolationString interpolationString(String contents, String value) => new InterpolationString(TokenFactory.token2(contents), value);
440 464
441 static IsExpression isExpression(Expression expression, bool negated, TypeName type) => new IsExpression.full(expression, TokenFactory.token(Keyword.IS), nega ted ? TokenFactory.token3(TokenType.BANG) : null, type); 465 static IsExpression isExpression(Expression expression, bool negated, TypeName type) => new IsExpression(expression, TokenFactory.token(Keyword.IS), negated ? TokenFactory.token3(TokenType.BANG) : null, type);
442 466
443 static Label label(SimpleIdentifier label) => new Label.full(label, TokenFacto ry.token3(TokenType.COLON)); 467 static Label label(SimpleIdentifier label) => new Label(label, TokenFactory.to ken3(TokenType.COLON));
444 468
445 static Label label2(String label) => ASTFactory.label(identifier3(label)); 469 static Label label2(String label) => ASTFactory.label(identifier3(label));
446 470
447 static LabeledStatement labeledStatement(List<Label> labels, Statement stateme nt) => new LabeledStatement.full(labels, statement); 471 static LabeledStatement labeledStatement(List<Label> labels, Statement stateme nt) => new LabeledStatement(labels, statement);
448 472
449 static LibraryDirective libraryDirective(List<Annotation> metadata, LibraryIde ntifier libraryName) => new LibraryDirective.full(null, metadata, TokenFactory.t oken(Keyword.LIBRARY), libraryName, TokenFactory.token3(TokenType.SEMICOLON)); 473 static LibraryDirective libraryDirective(List<Annotation> metadata, LibraryIde ntifier libraryName) => new LibraryDirective(null, metadata, TokenFactory.token( Keyword.LIBRARY), libraryName, TokenFactory.token3(TokenType.SEMICOLON));
450 474
451 static LibraryDirective libraryDirective2(String libraryName) => libraryDirect ive(new List<Annotation>(), libraryIdentifier2([libraryName])); 475 static LibraryDirective libraryDirective2(String libraryName) => libraryDirect ive(new List<Annotation>(), libraryIdentifier2([libraryName]));
452 476
453 static LibraryIdentifier libraryIdentifier(List<SimpleIdentifier> components) => new LibraryIdentifier.full(list(components)); 477 static LibraryIdentifier libraryIdentifier(List<SimpleIdentifier> components) => new LibraryIdentifier(list(components));
454 478
455 static LibraryIdentifier libraryIdentifier2(List<String> components) { 479 static LibraryIdentifier libraryIdentifier2(List<String> components) {
456 List<SimpleIdentifier> componentList = new List<SimpleIdentifier>(); 480 List<SimpleIdentifier> componentList = new List<SimpleIdentifier>();
457 for (String component in components) { 481 for (String component in components) {
458 componentList.add(identifier3(component)); 482 componentList.add(identifier3(component));
459 } 483 }
460 return new LibraryIdentifier.full(componentList); 484 return new LibraryIdentifier(componentList);
461 } 485 }
462 486
463 static List list(List<Object> elements) { 487 static List list(List<Object> elements) {
464 List elementList = new List(); 488 List elementList = new List();
465 for (Object element in elements) { 489 for (Object element in elements) {
466 elementList.add(element); 490 elementList.add(element);
467 } 491 }
468 return elementList; 492 return elementList;
469 } 493 }
470 494
471 static ListLiteral listLiteral(List<Expression> elements) => listLiteral2(null , null, elements); 495 static ListLiteral listLiteral(List<Expression> elements) => listLiteral2(null , null, elements);
472 496
473 static ListLiteral listLiteral2(Keyword keyword, TypeArgumentList typeArgument s, List<Expression> elements) => new ListLiteral.full(keyword == null ? null : T okenFactory.token(keyword), null, TokenFactory.token3(TokenType.OPEN_SQUARE_BRAC KET), list(elements), TokenFactory.token3(TokenType.CLOSE_SQUARE_BRACKET)); 497 static ListLiteral listLiteral2(Keyword keyword, TypeArgumentList typeArgument s, List<Expression> elements) => new ListLiteral(keyword == null ? null : TokenF actory.token(keyword), null, TokenFactory.token3(TokenType.OPEN_SQUARE_BRACKET), list(elements), TokenFactory.token3(TokenType.CLOSE_SQUARE_BRACKET));
474 498
475 static MapLiteral mapLiteral(Keyword keyword, TypeArgumentList typeArguments, List<MapLiteralEntry> entries) => new MapLiteral.full(keyword == null ? null : T okenFactory.token(keyword), typeArguments, TokenFactory.token3(TokenType.OPEN_CU RLY_BRACKET), list(entries), TokenFactory.token3(TokenType.CLOSE_CURLY_BRACKET)) ; 499 static MapLiteral mapLiteral(Keyword keyword, TypeArgumentList typeArguments, List<MapLiteralEntry> entries) => new MapLiteral(keyword == null ? null : TokenF actory.token(keyword), typeArguments, TokenFactory.token3(TokenType.OPEN_CURLY_B RACKET), list(entries), TokenFactory.token3(TokenType.CLOSE_CURLY_BRACKET));
476 500
477 static MapLiteral mapLiteral2(List<MapLiteralEntry> entries) => mapLiteral(nul l, null, entries); 501 static MapLiteral mapLiteral2(List<MapLiteralEntry> entries) => mapLiteral(nul l, null, entries);
478 502
479 static MapLiteralEntry mapLiteralEntry(String key, Expression value) => new Ma pLiteralEntry.full(string2(key), TokenFactory.token3(TokenType.COLON), value); 503 static MapLiteralEntry mapLiteralEntry(String key, Expression value) => new Ma pLiteralEntry(string2(key), TokenFactory.token3(TokenType.COLON), value);
480 504
481 static MethodDeclaration methodDeclaration(Keyword modifier, TypeName returnTy pe, Keyword property, Keyword operator, SimpleIdentifier name, FormalParameterLi st parameters) => new MethodDeclaration.full(null, null, TokenFactory.token(Keyw ord.EXTERNAL), modifier == null ? null : TokenFactory.token(modifier), returnTyp e, property == null ? null : TokenFactory.token(property), operator == null ? nu ll : TokenFactory.token(operator), name, parameters, emptyFunctionBody()); 505 static MethodDeclaration methodDeclaration(Keyword modifier, TypeName returnTy pe, Keyword property, Keyword operator, SimpleIdentifier name, FormalParameterLi st parameters) => new MethodDeclaration(null, null, TokenFactory.token(Keyword.E XTERNAL), modifier == null ? null : TokenFactory.token(modifier), returnType, pr operty == null ? null : TokenFactory.token(property), operator == null ? null : TokenFactory.token(operator), name, parameters, emptyFunctionBody());
482 506
483 static MethodDeclaration methodDeclaration2(Keyword modifier, TypeName returnT ype, Keyword property, Keyword operator, SimpleIdentifier name, FormalParameterL ist parameters, FunctionBody body) => new MethodDeclaration.full(null, null, nul l, modifier == null ? null : TokenFactory.token(modifier), returnType, property == null ? null : TokenFactory.token(property), operator == null ? null : TokenFa ctory.token(operator), name, parameters, body); 507 static MethodDeclaration methodDeclaration2(Keyword modifier, TypeName returnT ype, Keyword property, Keyword operator, SimpleIdentifier name, FormalParameterL ist parameters, FunctionBody body) => new MethodDeclaration(null, null, null, mo difier == null ? null : TokenFactory.token(modifier), returnType, property == nu ll ? null : TokenFactory.token(property), operator == null ? null : TokenFactory .token(operator), name, parameters, body);
484 508
485 static MethodInvocation methodInvocation(Expression target, String methodName, List<Expression> arguments) => new MethodInvocation.full(target, target == null ? null : TokenFactory.token3(TokenType.PERIOD), identifier3(methodName), argume ntList(arguments)); 509 static MethodInvocation methodInvocation(Expression target, String methodName, List<Expression> arguments) => new MethodInvocation(target, target == null ? nu ll : TokenFactory.token3(TokenType.PERIOD), identifier3(methodName), argumentLis t(arguments));
486 510
487 static MethodInvocation methodInvocation2(String methodName, List<Expression> arguments) => methodInvocation(null, methodName, arguments); 511 static MethodInvocation methodInvocation2(String methodName, List<Expression> arguments) => methodInvocation(null, methodName, arguments);
488 512
489 static NamedExpression namedExpression(Label label, Expression expression) => new NamedExpression.full(label, expression); 513 static NamedExpression namedExpression(Label label, Expression expression) => new NamedExpression(label, expression);
490 514
491 static NamedExpression namedExpression2(String label, Expression expression) = > namedExpression(label2(label), expression); 515 static NamedExpression namedExpression2(String label, Expression expression) = > namedExpression(label2(label), expression);
492 516
493 static DefaultFormalParameter namedFormalParameter(NormalFormalParameter param eter, Expression expression) => new DefaultFormalParameter.full(parameter, Param eterKind.NAMED, expression == null ? null : TokenFactory.token3(TokenType.COLON) , expression); 517 static DefaultFormalParameter namedFormalParameter(NormalFormalParameter param eter, Expression expression) => new DefaultFormalParameter(parameter, ParameterK ind.NAMED, expression == null ? null : TokenFactory.token3(TokenType.COLON), exp ression);
494 518
495 static NativeClause nativeClause(String nativeCode) => new NativeClause.full(T okenFactory.token2("native"), string2(nativeCode)); 519 static NativeClause nativeClause(String nativeCode) => new NativeClause(TokenF actory.token2("native"), string2(nativeCode));
496 520
497 static NativeFunctionBody nativeFunctionBody(String nativeMethodName) => new N ativeFunctionBody.full(TokenFactory.token2("native"), string2(nativeMethodName), TokenFactory.token3(TokenType.SEMICOLON)); 521 static NativeFunctionBody nativeFunctionBody(String nativeMethodName) => new N ativeFunctionBody(TokenFactory.token2("native"), string2(nativeMethodName), Toke nFactory.token3(TokenType.SEMICOLON));
498 522
499 static NullLiteral nullLiteral() => new NullLiteral.full(TokenFactory.token(Ke yword.NULL)); 523 static NullLiteral nullLiteral() => new NullLiteral(TokenFactory.token(Keyword .NULL));
500 524
501 static ParenthesizedExpression parenthesizedExpression(Expression expression) => new ParenthesizedExpression.full(TokenFactory.token3(TokenType.OPEN_PAREN), e xpression, TokenFactory.token3(TokenType.CLOSE_PAREN)); 525 static ParenthesizedExpression parenthesizedExpression(Expression expression) => new ParenthesizedExpression(TokenFactory.token3(TokenType.OPEN_PAREN), expres sion, TokenFactory.token3(TokenType.CLOSE_PAREN));
502 526
503 static PartDirective partDirective(List<Annotation> metadata, String url) => n ew PartDirective.full(null, metadata, TokenFactory.token(Keyword.PART), string2( url), TokenFactory.token3(TokenType.SEMICOLON)); 527 static PartDirective partDirective(List<Annotation> metadata, String url) => n ew PartDirective(null, metadata, TokenFactory.token(Keyword.PART), string2(url), TokenFactory.token3(TokenType.SEMICOLON));
504 528
505 static PartDirective partDirective2(String url) => partDirective(new List<Anno tation>(), url); 529 static PartDirective partDirective2(String url) => partDirective(new List<Anno tation>(), url);
506 530
507 static PartOfDirective partOfDirective(LibraryIdentifier libraryName) => partO fDirective2(new List<Annotation>(), libraryName); 531 static PartOfDirective partOfDirective(LibraryIdentifier libraryName) => partO fDirective2(new List<Annotation>(), libraryName);
508 532
509 static PartOfDirective partOfDirective2(List<Annotation> metadata, LibraryIden tifier libraryName) => new PartOfDirective.full(null, metadata, TokenFactory.tok en(Keyword.PART), TokenFactory.token2("of"), libraryName, TokenFactory.token3(To kenType.SEMICOLON)); 533 static PartOfDirective partOfDirective2(List<Annotation> metadata, LibraryIden tifier libraryName) => new PartOfDirective(null, metadata, TokenFactory.token(Ke yword.PART), TokenFactory.token2("of"), libraryName, TokenFactory.token3(TokenTy pe.SEMICOLON));
510 534
511 static DefaultFormalParameter positionalFormalParameter(NormalFormalParameter parameter, Expression expression) => new DefaultFormalParameter.full(parameter, ParameterKind.POSITIONAL, expression == null ? null : TokenFactory.token3(TokenT ype.EQ), expression); 535 static DefaultFormalParameter positionalFormalParameter(NormalFormalParameter parameter, Expression expression) => new DefaultFormalParameter(parameter, Param eterKind.POSITIONAL, expression == null ? null : TokenFactory.token3(TokenType.E Q), expression);
512 536
513 static PostfixExpression postfixExpression(Expression expression, TokenType op erator) => new PostfixExpression.full(expression, TokenFactory.token3(operator)) ; 537 static PostfixExpression postfixExpression(Expression expression, TokenType op erator) => new PostfixExpression(expression, TokenFactory.token3(operator));
514 538
515 static PrefixExpression prefixExpression(TokenType operator, Expression expres sion) => new PrefixExpression.full(TokenFactory.token3(operator), expression); 539 static PrefixExpression prefixExpression(TokenType operator, Expression expres sion) => new PrefixExpression(TokenFactory.token3(operator), expression);
516 540
517 static PropertyAccess propertyAccess(Expression target, SimpleIdentifier prope rtyName) => new PropertyAccess.full(target, TokenFactory.token3(TokenType.PERIOD ), propertyName); 541 static PropertyAccess propertyAccess(Expression target, SimpleIdentifier prope rtyName) => new PropertyAccess(target, TokenFactory.token3(TokenType.PERIOD), pr opertyName);
518 542
519 static PropertyAccess propertyAccess2(Expression target, String propertyName) => new PropertyAccess.full(target, TokenFactory.token3(TokenType.PERIOD), identi fier3(propertyName)); 543 static PropertyAccess propertyAccess2(Expression target, String propertyName) => new PropertyAccess(target, TokenFactory.token3(TokenType.PERIOD), identifier3 (propertyName));
520 544
521 static RedirectingConstructorInvocation redirectingConstructorInvocation(List< Expression> arguments) => redirectingConstructorInvocation2(null, arguments); 545 static RedirectingConstructorInvocation redirectingConstructorInvocation(List< Expression> arguments) => redirectingConstructorInvocation2(null, arguments);
522 546
523 static RedirectingConstructorInvocation redirectingConstructorInvocation2(Stri ng constructorName, List<Expression> arguments) => new RedirectingConstructorInv ocation.full(TokenFactory.token(Keyword.THIS), constructorName == null ? null : TokenFactory.token3(TokenType.PERIOD), constructorName == null ? null : identifi er3(constructorName), argumentList(arguments)); 547 static RedirectingConstructorInvocation redirectingConstructorInvocation2(Stri ng constructorName, List<Expression> arguments) => new RedirectingConstructorInv ocation(TokenFactory.token(Keyword.THIS), constructorName == null ? null : Token Factory.token3(TokenType.PERIOD), constructorName == null ? null : identifier3(c onstructorName), argumentList(arguments));
524 548
525 static RethrowExpression rethrowExpression() => new RethrowExpression.full(Tok enFactory.token(Keyword.RETHROW)); 549 static RethrowExpression rethrowExpression() => new RethrowExpression(TokenFac tory.token(Keyword.RETHROW));
526 550
527 static ReturnStatement returnStatement() => returnStatement2(null); 551 static ReturnStatement returnStatement() => returnStatement2(null);
528 552
529 static ReturnStatement returnStatement2(Expression expression) => new ReturnSt atement.full(TokenFactory.token(Keyword.RETURN), expression, TokenFactory.token3 (TokenType.SEMICOLON)); 553 static ReturnStatement returnStatement2(Expression expression) => new ReturnSt atement(TokenFactory.token(Keyword.RETURN), expression, TokenFactory.token3(Toke nType.SEMICOLON));
530 554
531 static ScriptTag scriptTag(String scriptTag) => new ScriptTag.full(TokenFactor y.token2(scriptTag)); 555 static ScriptTag scriptTag(String scriptTag) => new ScriptTag(TokenFactory.tok en2(scriptTag));
532 556
533 static ShowCombinator showCombinator(List<SimpleIdentifier> identifiers) => ne w ShowCombinator.full(TokenFactory.token2("show"), list(identifiers)); 557 static ShowCombinator showCombinator(List<SimpleIdentifier> identifiers) => ne w ShowCombinator(TokenFactory.token2("show"), list(identifiers));
534 558
535 static ShowCombinator showCombinator2(List<String> identifiers) { 559 static ShowCombinator showCombinator2(List<String> identifiers) {
536 List<SimpleIdentifier> identifierList = new List<SimpleIdentifier>(); 560 List<SimpleIdentifier> identifierList = new List<SimpleIdentifier>();
537 for (String identifier in identifiers) { 561 for (String identifier in identifiers) {
538 identifierList.add(identifier3(identifier)); 562 identifierList.add(identifier3(identifier));
539 } 563 }
540 return new ShowCombinator.full(TokenFactory.token2("show"), identifierList); 564 return new ShowCombinator(TokenFactory.token2("show"), identifierList);
541 } 565 }
542 566
543 static SimpleFormalParameter simpleFormalParameter(Keyword keyword, String par ameterName) => simpleFormalParameter2(keyword, null, parameterName); 567 static SimpleFormalParameter simpleFormalParameter(Keyword keyword, String par ameterName) => simpleFormalParameter2(keyword, null, parameterName);
544 568
545 static SimpleFormalParameter simpleFormalParameter2(Keyword keyword, TypeName type, String parameterName) => new SimpleFormalParameter.full(null, null, keywor d == null ? null : TokenFactory.token(keyword), type, identifier3(parameterName) ); 569 static SimpleFormalParameter simpleFormalParameter2(Keyword keyword, TypeName type, String parameterName) => new SimpleFormalParameter(null, null, keyword == null ? null : TokenFactory.token(keyword), type, identifier3(parameterName));
546 570
547 static SimpleFormalParameter simpleFormalParameter3(String parameterName) => s impleFormalParameter2(null, null, parameterName); 571 static SimpleFormalParameter simpleFormalParameter3(String parameterName) => s impleFormalParameter2(null, null, parameterName);
548 572
549 static SimpleFormalParameter simpleFormalParameter4(TypeName type, String para meterName) => simpleFormalParameter2(null, type, parameterName); 573 static SimpleFormalParameter simpleFormalParameter4(TypeName type, String para meterName) => simpleFormalParameter2(null, type, parameterName);
550 574
551 static StringInterpolation string(List<InterpolationElement> elements) => new StringInterpolation.full(list(elements)); 575 static StringInterpolation string(List<InterpolationElement> elements) => new StringInterpolation(list(elements));
552 576
553 static SimpleStringLiteral string2(String content) => new SimpleStringLiteral. full(TokenFactory.token2("'${content}'"), content); 577 static SimpleStringLiteral string2(String content) => new SimpleStringLiteral( TokenFactory.token2("'${content}'"), content);
554 578
555 static SuperConstructorInvocation superConstructorInvocation(List<Expression> arguments) => superConstructorInvocation2(null, arguments); 579 static SuperConstructorInvocation superConstructorInvocation(List<Expression> arguments) => superConstructorInvocation2(null, arguments);
556 580
557 static SuperConstructorInvocation superConstructorInvocation2(String name, Lis t<Expression> arguments) => new SuperConstructorInvocation.full(TokenFactory.tok en(Keyword.SUPER), name == null ? null : TokenFactory.token3(TokenType.PERIOD), name == null ? null : identifier3(name), argumentList(arguments)); 581 static SuperConstructorInvocation superConstructorInvocation2(String name, Lis t<Expression> arguments) => new SuperConstructorInvocation(TokenFactory.token(Ke yword.SUPER), name == null ? null : TokenFactory.token3(TokenType.PERIOD), name == null ? null : identifier3(name), argumentList(arguments));
558 582
559 static SuperExpression superExpression() => new SuperExpression.full(TokenFact ory.token(Keyword.SUPER)); 583 static SuperExpression superExpression() => new SuperExpression(TokenFactory.t oken(Keyword.SUPER));
560 584
561 static SwitchCase switchCase(Expression expression, List<Statement> statements ) => switchCase2(new List<Label>(), expression, statements); 585 static SwitchCase switchCase(Expression expression, List<Statement> statements ) => switchCase2(new List<Label>(), expression, statements);
562 586
563 static SwitchCase switchCase2(List<Label> labels, Expression expression, List< Statement> statements) => new SwitchCase.full(labels, TokenFactory.token(Keyword .CASE), expression, TokenFactory.token3(TokenType.COLON), list(statements)); 587 static SwitchCase switchCase2(List<Label> labels, Expression expression, List< Statement> statements) => new SwitchCase(labels, TokenFactory.token(Keyword.CASE ), expression, TokenFactory.token3(TokenType.COLON), list(statements));
564 588
565 static SwitchDefault switchDefault(List<Label> labels, List<Statement> stateme nts) => new SwitchDefault.full(labels, TokenFactory.token(Keyword.DEFAULT), Toke nFactory.token3(TokenType.COLON), list(statements)); 589 static SwitchDefault switchDefault(List<Label> labels, List<Statement> stateme nts) => new SwitchDefault(labels, TokenFactory.token(Keyword.DEFAULT), TokenFact ory.token3(TokenType.COLON), list(statements));
566 590
567 static SwitchDefault switchDefault2(List<Statement> statements) => switchDefau lt(new List<Label>(), statements); 591 static SwitchDefault switchDefault2(List<Statement> statements) => switchDefau lt(new List<Label>(), statements);
568 592
569 static SwitchStatement switchStatement(Expression expression, List<SwitchMembe r> members) => new SwitchStatement.full(TokenFactory.token(Keyword.SWITCH), Toke nFactory.token3(TokenType.OPEN_PAREN), expression, TokenFactory.token3(TokenType .CLOSE_PAREN), TokenFactory.token3(TokenType.OPEN_CURLY_BRACKET), list(members), TokenFactory.token3(TokenType.CLOSE_CURLY_BRACKET)); 593 static SwitchStatement switchStatement(Expression expression, List<SwitchMembe r> members) => new SwitchStatement(TokenFactory.token(Keyword.SWITCH), TokenFact ory.token3(TokenType.OPEN_PAREN), expression, TokenFactory.token3(TokenType.CLOS E_PAREN), TokenFactory.token3(TokenType.OPEN_CURLY_BRACKET), list(members), Toke nFactory.token3(TokenType.CLOSE_CURLY_BRACKET));
570 594
571 static SymbolLiteral symbolLiteral(List<String> components) { 595 static SymbolLiteral symbolLiteral(List<String> components) {
572 List<Token> identifierList = new List<Token>(); 596 List<Token> identifierList = new List<Token>();
573 for (String component in components) { 597 for (String component in components) {
574 identifierList.add(TokenFactory.token4(TokenType.IDENTIFIER, component)); 598 identifierList.add(TokenFactory.token4(TokenType.IDENTIFIER, component));
575 } 599 }
576 return new SymbolLiteral.full(TokenFactory.token3(TokenType.HASH), new List. from(identifierList)); 600 return new SymbolLiteral(TokenFactory.token3(TokenType.HASH), new List.from( identifierList));
577 } 601 }
578 602
579 static ThisExpression thisExpression() => new ThisExpression.full(TokenFactory .token(Keyword.THIS)); 603 static ThisExpression thisExpression() => new ThisExpression(TokenFactory.toke n(Keyword.THIS));
580 604
581 static ThrowExpression throwExpression() => throwExpression2(null); 605 static ThrowExpression throwExpression() => throwExpression2(null);
582 606
583 static ThrowExpression throwExpression2(Expression expression) => new ThrowExp ression.full(TokenFactory.token(Keyword.THROW), expression); 607 static ThrowExpression throwExpression2(Expression expression) => new ThrowExp ression(TokenFactory.token(Keyword.THROW), expression);
584 608
585 static TopLevelVariableDeclaration topLevelVariableDeclaration(Keyword keyword , TypeName type, List<VariableDeclaration> variables) => new TopLevelVariableDec laration.full(null, null, variableDeclarationList(keyword, type, variables), Tok enFactory.token3(TokenType.SEMICOLON)); 609 static TopLevelVariableDeclaration topLevelVariableDeclaration(Keyword keyword , TypeName type, List<VariableDeclaration> variables) => new TopLevelVariableDec laration(null, null, variableDeclarationList(keyword, type, variables), TokenFac tory.token3(TokenType.SEMICOLON));
586 610
587 static TopLevelVariableDeclaration topLevelVariableDeclaration2(Keyword keywor d, List<VariableDeclaration> variables) => new TopLevelVariableDeclaration.full( null, null, variableDeclarationList(keyword, null, variables), TokenFactory.toke n3(TokenType.SEMICOLON)); 611 static TopLevelVariableDeclaration topLevelVariableDeclaration2(Keyword keywor d, List<VariableDeclaration> variables) => new TopLevelVariableDeclaration(null, null, variableDeclarationList(keyword, null, variables), TokenFactory.token3(To kenType.SEMICOLON));
588 612
589 static TryStatement tryStatement(Block body, Block finallyClause) => tryStatem ent3(body, new List<CatchClause>(), finallyClause); 613 static TryStatement tryStatement(Block body, Block finallyClause) => tryStatem ent3(body, new List<CatchClause>(), finallyClause);
590 614
591 static TryStatement tryStatement2(Block body, List<CatchClause> catchClauses) => tryStatement3(body, list(catchClauses), null); 615 static TryStatement tryStatement2(Block body, List<CatchClause> catchClauses) => tryStatement3(body, list(catchClauses), null);
592 616
593 static TryStatement tryStatement3(Block body, List<CatchClause> catchClauses, Block finallyClause) => new TryStatement.full(TokenFactory.token(Keyword.TRY), b ody, catchClauses, finallyClause == null ? null : TokenFactory.token(Keyword.FIN ALLY), finallyClause); 617 static TryStatement tryStatement3(Block body, List<CatchClause> catchClauses, Block finallyClause) => new TryStatement(TokenFactory.token(Keyword.TRY), body, catchClauses, finallyClause == null ? null : TokenFactory.token(Keyword.FINALLY) , finallyClause);
594 618
595 static FunctionTypeAlias typeAlias(TypeName returnType, String name, TypeParam eterList typeParameters, FormalParameterList parameters) => new FunctionTypeAlia s.full(null, null, TokenFactory.token(Keyword.TYPEDEF), returnType, identifier3( name), typeParameters, parameters, TokenFactory.token3(TokenType.SEMICOLON)); 619 static FunctionTypeAlias typeAlias(TypeName returnType, String name, TypeParam eterList typeParameters, FormalParameterList parameters) => new FunctionTypeAlia s(null, null, TokenFactory.token(Keyword.TYPEDEF), returnType, identifier3(name) , typeParameters, parameters, TokenFactory.token3(TokenType.SEMICOLON));
596 620
597 static TypeArgumentList typeArgumentList(List<TypeName> typeNames) => new Type ArgumentList.full(TokenFactory.token3(TokenType.LT), list(typeNames), TokenFacto ry.token3(TokenType.GT)); 621 static TypeArgumentList typeArgumentList(List<TypeName> typeNames) => new Type ArgumentList(TokenFactory.token3(TokenType.LT), list(typeNames), TokenFactory.to ken3(TokenType.GT));
598 622
599 /** 623 /**
600 * Create a type name whose name has been resolved to the given element and wh ose type has been 624 * Create a type name whose name has been resolved to the given element and wh ose type has been
601 * resolved to the type of the given element. 625 * resolved to the type of the given element.
602 * 626 *
603 * <b>Note:</b> This method does not correctly handle class elements that have type parameters. 627 * <b>Note:</b> This method does not correctly handle class elements that have type parameters.
604 * 628 *
605 * @param element the element defining the type represented by the type name 629 * @param element the element defining the type represented by the type name
606 * @return the type name that was created 630 * @return the type name that was created
607 */ 631 */
608 static TypeName typeName(ClassElement element, List<TypeName> arguments) { 632 static TypeName typeName(ClassElement element, List<TypeName> arguments) {
609 SimpleIdentifier name = identifier3(element.name); 633 SimpleIdentifier name = identifier3(element.name);
610 name.staticElement = element; 634 name.staticElement = element;
611 TypeName typeName = typeName3(name, arguments); 635 TypeName typeName = typeName3(name, arguments);
612 typeName.type = element.type; 636 typeName.type = element.type;
613 return typeName; 637 return typeName;
614 } 638 }
615 639
616 static TypeName typeName3(Identifier name, List<TypeName> arguments) { 640 static TypeName typeName3(Identifier name, List<TypeName> arguments) {
617 if (arguments.length == 0) { 641 if (arguments.length == 0) {
618 return new TypeName.full(name, null); 642 return new TypeName(name, null);
619 } 643 }
620 return new TypeName.full(name, typeArgumentList(arguments)); 644 return new TypeName(name, typeArgumentList(arguments));
621 } 645 }
622 646
623 static TypeName typeName4(String name, List<TypeName> arguments) { 647 static TypeName typeName4(String name, List<TypeName> arguments) {
624 if (arguments.length == 0) { 648 if (arguments.length == 0) {
625 return new TypeName.full(identifier3(name), null); 649 return new TypeName(identifier3(name), null);
626 } 650 }
627 return new TypeName.full(identifier3(name), typeArgumentList(arguments)); 651 return new TypeName(identifier3(name), typeArgumentList(arguments));
628 } 652 }
629 653
630 static TypeParameter typeParameter(String name) => new TypeParameter.full(null , null, identifier3(name), null, null); 654 static TypeParameter typeParameter(String name) => new TypeParameter(null, nul l, identifier3(name), null, null);
631 655
632 static TypeParameter typeParameter2(String name, TypeName bound) => new TypePa rameter.full(null, null, identifier3(name), TokenFactory.token(Keyword.EXTENDS), bound); 656 static TypeParameter typeParameter2(String name, TypeName bound) => new TypePa rameter(null, null, identifier3(name), TokenFactory.token(Keyword.EXTENDS), boun d);
633 657
634 static TypeParameterList typeParameterList(List<String> typeNames) { 658 static TypeParameterList typeParameterList(List<String> typeNames) {
635 List<TypeParameter> typeParameters = new List<TypeParameter>(); 659 List<TypeParameter> typeParameters = new List<TypeParameter>();
636 for (String typeName in typeNames) { 660 for (String typeName in typeNames) {
637 typeParameters.add(typeParameter(typeName)); 661 typeParameters.add(typeParameter(typeName));
638 } 662 }
639 return new TypeParameterList.full(TokenFactory.token3(TokenType.LT), typePar ameters, TokenFactory.token3(TokenType.GT)); 663 return new TypeParameterList(TokenFactory.token3(TokenType.LT), typeParamete rs, TokenFactory.token3(TokenType.GT));
640 } 664 }
641 665
642 static VariableDeclaration variableDeclaration(String name) => new VariableDec laration.full(null, null, identifier3(name), null, null); 666 static VariableDeclaration variableDeclaration(String name) => new VariableDec laration(null, null, identifier3(name), null, null);
643 667
644 static VariableDeclaration variableDeclaration2(String name, Expression initia lizer) => new VariableDeclaration.full(null, null, identifier3(name), TokenFacto ry.token3(TokenType.EQ), initializer); 668 static VariableDeclaration variableDeclaration2(String name, Expression initia lizer) => new VariableDeclaration(null, null, identifier3(name), TokenFactory.to ken3(TokenType.EQ), initializer);
645 669
646 static VariableDeclarationList variableDeclarationList(Keyword keyword, TypeNa me type, List<VariableDeclaration> variables) => new VariableDeclarationList.ful l(null, null, keyword == null ? null : TokenFactory.token(keyword), type, list(v ariables)); 670 static VariableDeclarationList variableDeclarationList(Keyword keyword, TypeNa me type, List<VariableDeclaration> variables) => new VariableDeclarationList(nul l, null, keyword == null ? null : TokenFactory.token(keyword), type, list(variab les));
647 671
648 static VariableDeclarationList variableDeclarationList2(Keyword keyword, List< VariableDeclaration> variables) => variableDeclarationList(keyword, null, variab les); 672 static VariableDeclarationList variableDeclarationList2(Keyword keyword, List< VariableDeclaration> variables) => variableDeclarationList(keyword, null, variab les);
649 673
650 static VariableDeclarationStatement variableDeclarationStatement(Keyword keywo rd, TypeName type, List<VariableDeclaration> variables) => new VariableDeclarati onStatement.full(variableDeclarationList(keyword, type, variables), TokenFactory .token3(TokenType.SEMICOLON)); 674 static VariableDeclarationStatement variableDeclarationStatement(Keyword keywo rd, TypeName type, List<VariableDeclaration> variables) => new VariableDeclarati onStatement(variableDeclarationList(keyword, type, variables), TokenFactory.toke n3(TokenType.SEMICOLON));
651 675
652 static VariableDeclarationStatement variableDeclarationStatement2(Keyword keyw ord, List<VariableDeclaration> variables) => variableDeclarationStatement(keywor d, null, variables); 676 static VariableDeclarationStatement variableDeclarationStatement2(Keyword keyw ord, List<VariableDeclaration> variables) => variableDeclarationStatement(keywor d, null, variables);
653 677
654 static WhileStatement whileStatement(Expression condition, Statement body) => new WhileStatement.full(TokenFactory.token(Keyword.WHILE), TokenFactory.token3(T okenType.OPEN_PAREN), condition, TokenFactory.token3(TokenType.CLOSE_PAREN), bod y); 678 static WhileStatement whileStatement(Expression condition, Statement body) => new WhileStatement(TokenFactory.token(Keyword.WHILE), TokenFactory.token3(TokenT ype.OPEN_PAREN), condition, TokenFactory.token3(TokenType.CLOSE_PAREN), body);
655 679
656 static WithClause withClause(List<TypeName> types) => new WithClause.full(Toke nFactory.token(Keyword.WITH), list(types)); 680 static WithClause withClause(List<TypeName> types) => new WithClause(TokenFact ory.token(Keyword.WITH), list(types));
657 } 681 }
658 682
659 class SimpleIdentifierTest extends ParserTestCase { 683 class SimpleIdentifierTest extends ParserTestCase {
660 void test_inDeclarationContext_argumentDefinition() { 684 void test_inDeclarationContext_argumentDefinition() {
661 SimpleIdentifier identifier = ASTFactory.argumentDefinitionTest("p").identif ier; 685 SimpleIdentifier identifier = ASTFactory.argumentDefinitionTest("p").identif ier;
662 JUnitTestCase.assertFalse(identifier.inDeclarationContext()); 686 JUnitTestCase.assertFalse(identifier.inDeclarationContext());
663 } 687 }
664 688
665 void test_inDeclarationContext_catch_exception() { 689 void test_inDeclarationContext_catch_exception() {
666 SimpleIdentifier identifier = ASTFactory.catchClause("e", []).exceptionParam eter; 690 SimpleIdentifier identifier = ASTFactory.catchClause("e", []).exceptionParam eter;
(...skipping 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after
2056 2080
2057 void test_visitClassTypeAlias_parameters_implements() { 2081 void test_visitClassTypeAlias_parameters_implements() {
2058 assertSource("class C<E> = S with M1 implements I;", ASTFactory.classTypeAli as("C", ASTFactory.typeParameterList(["E"]), null, ASTFactory.typeName4("S", []) , ASTFactory.withClause([ASTFactory.typeName4("M1", [])]), ASTFactory.implements Clause([ASTFactory.typeName4("I", [])]))); 2082 assertSource("class C<E> = S with M1 implements I;", ASTFactory.classTypeAli as("C", ASTFactory.typeParameterList(["E"]), null, ASTFactory.typeName4("S", []) , ASTFactory.withClause([ASTFactory.typeName4("M1", [])]), ASTFactory.implements Clause([ASTFactory.typeName4("I", [])])));
2059 } 2083 }
2060 2084
2061 void test_visitComment() { 2085 void test_visitComment() {
2062 assertSource("", Comment.createBlockComment(<Token> [TokenFactory.token2("/* comment */")])); 2086 assertSource("", Comment.createBlockComment(<Token> [TokenFactory.token2("/* comment */")]));
2063 } 2087 }
2064 2088
2065 void test_visitCommentReference() { 2089 void test_visitCommentReference() {
2066 assertSource("", new CommentReference.full(null, ASTFactory.identifier3("a") )); 2090 assertSource("", new CommentReference(null, ASTFactory.identifier3("a")));
2067 } 2091 }
2068 2092
2069 void test_visitCompilationUnit_declaration() { 2093 void test_visitCompilationUnit_declaration() {
2070 assertSource("var a;", ASTFactory.compilationUnit2([ASTFactory.topLevelVaria bleDeclaration2(Keyword.VAR, [ASTFactory.variableDeclaration("a")])])); 2094 assertSource("var a;", ASTFactory.compilationUnit2([ASTFactory.topLevelVaria bleDeclaration2(Keyword.VAR, [ASTFactory.variableDeclaration("a")])]));
2071 } 2095 }
2072 2096
2073 void test_visitCompilationUnit_directive() { 2097 void test_visitCompilationUnit_directive() {
2074 assertSource("library l;", ASTFactory.compilationUnit3([ASTFactory.libraryDi rective2("l")])); 2098 assertSource("library l;", ASTFactory.compilationUnit3([ASTFactory.libraryDi rective2("l")]));
2075 } 2099 }
2076 2100
(...skipping 1869 matching lines...) Expand 10 before | Expand all | Expand 10 after
3946 }); 3970 });
3947 }); 3971 });
3948 } 3972 }
3949 } 3973 }
3950 3974
3951 main() { 3975 main() {
3952 ConstantEvaluatorTest.dartSuite(); 3976 ConstantEvaluatorTest.dartSuite();
3953 NodeLocatorTest.dartSuite(); 3977 NodeLocatorTest.dartSuite();
3954 ToSourceVisitorTest.dartSuite(); 3978 ToSourceVisitorTest.dartSuite();
3955 BreadthFirstVisitorTest.dartSuite(); 3979 BreadthFirstVisitorTest.dartSuite();
3980 ClassDeclarationTest.dartSuite();
3956 IndexExpressionTest.dartSuite(); 3981 IndexExpressionTest.dartSuite();
3957 NodeListTest.dartSuite(); 3982 NodeListTest.dartSuite();
3958 SimpleIdentifierTest.dartSuite(); 3983 SimpleIdentifierTest.dartSuite();
3959 VariableDeclarationTest.dartSuite(); 3984 VariableDeclarationTest.dartSuite();
3960 } 3985 }
OLDNEW
« no previous file with comments | « pkg/analyzer/pubspec.yaml ('k') | pkg/analyzer/test/generated/element_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698