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

Side by Side Diff: pkg/analyzer/lib/src/generated/parser.dart

Issue 247053004: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.parser; 8 library engine.parser;
9 9
10 import 'java_core.dart'; 10 import 'java_core.dart';
(...skipping 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after
1493 InstrumentationBuilder instrumentation = Instrumentation.builder2("dart.engi ne.Parser.parseCompilationUnit"); 1493 InstrumentationBuilder instrumentation = Instrumentation.builder2("dart.engi ne.Parser.parseCompilationUnit");
1494 try { 1494 try {
1495 _currentToken = token; 1495 _currentToken = token;
1496 return parseCompilationUnit2(); 1496 return parseCompilationUnit2();
1497 } finally { 1497 } finally {
1498 instrumentation.log2(2); 1498 instrumentation.log2(2);
1499 } 1499 }
1500 } 1500 }
1501 1501
1502 /** 1502 /**
1503 * Parse the script tag and directives in a compilation unit, starting with th e given token, until
1504 * the first non-directive is encountered. The remainder of the compilation un it will not be
1505 * parsed. Specifically, if there are directives later in the file, they will not be parsed.
1506 *
1507 * @param token the first token of the compilation unit
1508 * @return the compilation unit that was parsed
1509 */
1510 CompilationUnit parseDirectives(Token token) {
1511 InstrumentationBuilder instrumentation = Instrumentation.builder2("dart.engi ne.Parser.parseDirectives");
1512 try {
1513 _currentToken = token;
1514 return _parseDirectives();
1515 } finally {
1516 instrumentation.log2(2);
1517 }
1518 }
1519
1520 /**
1503 * Parse an expression, starting with the given token. 1521 * Parse an expression, starting with the given token.
1504 * 1522 *
1505 * @param token the first token of the expression 1523 * @param token the first token of the expression
1506 * @return the expression that was parsed, or `null` if the tokens do not repr esent a 1524 * @return the expression that was parsed, or `null` if the tokens do not repr esent a
1507 * recognizable expression 1525 * recognizable expression
1508 */ 1526 */
1509 Expression parseExpression(Token token) { 1527 Expression parseExpression(Token token) {
1510 InstrumentationBuilder instrumentation = Instrumentation.builder2("dart.engi ne.Parser.parseExpression"); 1528 InstrumentationBuilder instrumentation = Instrumentation.builder2("dart.engi ne.Parser.parseExpression");
1511 try { 1529 try {
1512 _currentToken = token; 1530 _currentToken = token;
(...skipping 2821 matching lines...) Expand 10 before | Expand all | Expand 10 after
4334 } else if (_matchesKeyword(Keyword.PART)) { 4352 } else if (_matchesKeyword(Keyword.PART)) {
4335 return _parsePartDirective(commentAndMetadata); 4353 return _parsePartDirective(commentAndMetadata);
4336 } else { 4354 } else {
4337 // Internal error: this method should not have been invoked if the current token was something 4355 // Internal error: this method should not have been invoked if the current token was something
4338 // other than one of the above. 4356 // other than one of the above.
4339 throw new IllegalStateException("parseDirective invoked in an invalid stat e; currentToken = ${_currentToken}"); 4357 throw new IllegalStateException("parseDirective invoked in an invalid stat e; currentToken = ${_currentToken}");
4340 } 4358 }
4341 } 4359 }
4342 4360
4343 /** 4361 /**
4362 * Parse the script tag and directives in a compilation unit until the first n on-directive is
4363 * encountered.
4364 *
4365 *
4366 * <pre>
4367 * compilationUnit ::=
4368 * scriptTag? directive*
4369 * </pre>
4370 *
4371 * @return the compilation unit that was parsed
4372 */
4373 CompilationUnit _parseDirectives() {
4374 Token firstToken = _currentToken;
4375 ScriptTag scriptTag = null;
4376 if (_matches(TokenType.SCRIPT_TAG)) {
4377 scriptTag = new ScriptTag(andAdvance);
4378 }
4379 List<Directive> directives = new List<Directive>();
4380 while (!_matches(TokenType.EOF)) {
4381 CommentAndMetadata commentAndMetadata = _parseCommentAndMetadata();
4382 if ((_matchesKeyword(Keyword.IMPORT) || _matchesKeyword(Keyword.EXPORT) || _matchesKeyword(Keyword.LIBRARY) || _matchesKeyword(Keyword.PART)) && !_tokenMa tches(_peek(), TokenType.PERIOD) && !_tokenMatches(_peek(), TokenType.LT) && !_t okenMatches(_peek(), TokenType.OPEN_PAREN)) {
4383 directives.add(_parseDirective(commentAndMetadata));
4384 } else if (_matches(TokenType.SEMICOLON)) {
4385 _advance();
4386 } else {
4387 while (!_matches(TokenType.EOF)) {
4388 _advance();
4389 }
4390 return new CompilationUnit(firstToken, scriptTag, directives, new List<C ompilationUnitMember>(), _currentToken);
4391 }
4392 }
4393 return new CompilationUnit(firstToken, scriptTag, directives, new List<Compi lationUnitMember>(), _currentToken);
4394 }
4395
4396 /**
4344 * Parse a documentation comment. 4397 * Parse a documentation comment.
4345 * 4398 *
4346 * <pre> 4399 * <pre>
4347 * documentationComment ::= 4400 * documentationComment ::=
4348 * multiLineComment? 4401 * multiLineComment?
4349 * | singleLineComment* 4402 * | singleLineComment*
4350 * </pre> 4403 * </pre>
4351 * 4404 *
4352 * @return the documentation comment that was parsed, or `null` if there was n o comment 4405 * @return the documentation comment that was parsed, or `null` if there was n o comment
4353 */ 4406 */
(...skipping 4455 matching lines...) Expand 10 before | Expand all | Expand 10 after
8809 if (first == null) { 8862 if (first == null) {
8810 return second == null; 8863 return second == null;
8811 } else if (second == null) { 8864 } else if (second == null) {
8812 return false; 8865 return false;
8813 } 8866 }
8814 return first.lexeme == second.lexeme; 8867 return first.lexeme == second.lexeme;
8815 } 8868 }
8816 } 8869 }
8817 Map<String, MethodTrampoline> methodTable_Parser = <String, MethodTrampoline> { 8870 Map<String, MethodTrampoline> methodTable_Parser = <String, MethodTrampoline> {
8818 'parseCompilationUnit_1': new MethodTrampoline(1, (Parser target, arg0) => tar get.parseCompilationUnit(arg0)), 8871 'parseCompilationUnit_1': new MethodTrampoline(1, (Parser target, arg0) => tar get.parseCompilationUnit(arg0)),
8872 'parseDirectives_1': new MethodTrampoline(1, (Parser target, arg0) => target.p arseDirectives(arg0)),
8819 'parseExpression_1': new MethodTrampoline(1, (Parser target, arg0) => target.p arseExpression(arg0)), 8873 'parseExpression_1': new MethodTrampoline(1, (Parser target, arg0) => target.p arseExpression(arg0)),
8820 'parseStatement_1': new MethodTrampoline(1, (Parser target, arg0) => target.pa rseStatement(arg0)), 8874 'parseStatement_1': new MethodTrampoline(1, (Parser target, arg0) => target.pa rseStatement(arg0)),
8821 'parseStatements_1': new MethodTrampoline(1, (Parser target, arg0) => target.p arseStatements(arg0)), 8875 'parseStatements_1': new MethodTrampoline(1, (Parser target, arg0) => target.p arseStatements(arg0)),
8822 'parseAnnotation_0': new MethodTrampoline(0, (Parser target) => target.parseAn notation()), 8876 'parseAnnotation_0': new MethodTrampoline(0, (Parser target) => target.parseAn notation()),
8823 'parseArgument_0': new MethodTrampoline(0, (Parser target) => target.parseArgu ment()), 8877 'parseArgument_0': new MethodTrampoline(0, (Parser target) => target.parseArgu ment()),
8824 'parseArgumentList_0': new MethodTrampoline(0, (Parser target) => target.parse ArgumentList()), 8878 'parseArgumentList_0': new MethodTrampoline(0, (Parser target) => target.parse ArgumentList()),
8825 'parseBitwiseOrExpression_0': new MethodTrampoline(0, (Parser target) => targe t.parseBitwiseOrExpression()), 8879 'parseBitwiseOrExpression_0': new MethodTrampoline(0, (Parser target) => targe t.parseBitwiseOrExpression()),
8826 'parseBlock_0': new MethodTrampoline(0, (Parser target) => target.parseBlock() ), 8880 'parseBlock_0': new MethodTrampoline(0, (Parser target) => target.parseBlock() ),
8827 'parseClassMember_1': new MethodTrampoline(1, (Parser target, arg0) => target. parseClassMember(arg0)), 8881 'parseClassMember_1': new MethodTrampoline(1, (Parser target, arg0) => target. parseClassMember(arg0)),
8828 'parseCompilationUnit_0': new MethodTrampoline(0, (Parser target) => target.pa rseCompilationUnit2()), 8882 'parseCompilationUnit_0': new MethodTrampoline(0, (Parser target) => target.pa rseCompilationUnit2()),
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
8898 'parseCombinators_0': new MethodTrampoline(0, (Parser target) => target._parse Combinators()), 8952 'parseCombinators_0': new MethodTrampoline(0, (Parser target) => target._parse Combinators()),
8899 'parseCommentAndMetadata_0': new MethodTrampoline(0, (Parser target) => target ._parseCommentAndMetadata()), 8953 'parseCommentAndMetadata_0': new MethodTrampoline(0, (Parser target) => target ._parseCommentAndMetadata()),
8900 'parseCommentReference_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target._parseCommentReference(arg0, arg1)), 8954 'parseCommentReference_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target._parseCommentReference(arg0, arg1)),
8901 'parseCommentReferences_1': new MethodTrampoline(1, (Parser target, arg0) => t arget._parseCommentReferences(arg0)), 8955 'parseCommentReferences_1': new MethodTrampoline(1, (Parser target, arg0) => t arget._parseCommentReferences(arg0)),
8902 'parseCompilationUnitMember_1': new MethodTrampoline(1, (Parser target, arg0) => target._parseCompilationUnitMember(arg0)), 8956 'parseCompilationUnitMember_1': new MethodTrampoline(1, (Parser target, arg0) => target._parseCompilationUnitMember(arg0)),
8903 'parseConstExpression_0': new MethodTrampoline(0, (Parser target) => target._p arseConstExpression()), 8957 'parseConstExpression_0': new MethodTrampoline(0, (Parser target) => target._p arseConstExpression()),
8904 'parseConstructor_8': new MethodTrampoline(8, (Parser target, arg0, arg1, arg2 , arg3, arg4, arg5, arg6, arg7) => target._parseConstructor(arg0, arg1, arg2, ar g3, arg4, arg5, arg6, arg7)), 8958 'parseConstructor_8': new MethodTrampoline(8, (Parser target, arg0, arg1, arg2 , arg3, arg4, arg5, arg6, arg7) => target._parseConstructor(arg0, arg1, arg2, ar g3, arg4, arg5, arg6, arg7)),
8905 'parseConstructorFieldInitializer_0': new MethodTrampoline(0, (Parser target) => target._parseConstructorFieldInitializer()), 8959 'parseConstructorFieldInitializer_0': new MethodTrampoline(0, (Parser target) => target._parseConstructorFieldInitializer()),
8906 'parseContinueStatement_0': new MethodTrampoline(0, (Parser target) => target. _parseContinueStatement()), 8960 'parseContinueStatement_0': new MethodTrampoline(0, (Parser target) => target. _parseContinueStatement()),
8907 'parseDirective_1': new MethodTrampoline(1, (Parser target, arg0) => target._p arseDirective(arg0)), 8961 'parseDirective_1': new MethodTrampoline(1, (Parser target, arg0) => target._p arseDirective(arg0)),
8962 'parseDirectives_0': new MethodTrampoline(0, (Parser target) => target._parseD irectives()),
8908 'parseDocumentationComment_0': new MethodTrampoline(0, (Parser target) => targ et._parseDocumentationComment()), 8963 'parseDocumentationComment_0': new MethodTrampoline(0, (Parser target) => targ et._parseDocumentationComment()),
8909 'parseDoStatement_0': new MethodTrampoline(0, (Parser target) => target._parse DoStatement()), 8964 'parseDoStatement_0': new MethodTrampoline(0, (Parser target) => target._parse DoStatement()),
8910 'parseEmptyStatement_0': new MethodTrampoline(0, (Parser target) => target._pa rseEmptyStatement()), 8965 'parseEmptyStatement_0': new MethodTrampoline(0, (Parser target) => target._pa rseEmptyStatement()),
8911 'parseEqualityExpression_0': new MethodTrampoline(0, (Parser target) => target ._parseEqualityExpression()), 8966 'parseEqualityExpression_0': new MethodTrampoline(0, (Parser target) => target ._parseEqualityExpression()),
8912 'parseExportDirective_1': new MethodTrampoline(1, (Parser target, arg0) => tar get._parseExportDirective(arg0)), 8967 'parseExportDirective_1': new MethodTrampoline(1, (Parser target, arg0) => tar get._parseExportDirective(arg0)),
8913 'parseExpressionList_0': new MethodTrampoline(0, (Parser target) => target._pa rseExpressionList()), 8968 'parseExpressionList_0': new MethodTrampoline(0, (Parser target) => target._pa rseExpressionList()),
8914 'parseFinalConstVarOrType_1': new MethodTrampoline(1, (Parser target, arg0) => target._parseFinalConstVarOrType(arg0)), 8969 'parseFinalConstVarOrType_1': new MethodTrampoline(1, (Parser target, arg0) => target._parseFinalConstVarOrType(arg0)),
8915 'parseFormalParameter_1': new MethodTrampoline(1, (Parser target, arg0) => tar get._parseFormalParameter(arg0)), 8970 'parseFormalParameter_1': new MethodTrampoline(1, (Parser target, arg0) => tar get._parseFormalParameter(arg0)),
8916 'parseForStatement_0': new MethodTrampoline(0, (Parser target) => target._pars eForStatement()), 8971 'parseForStatement_0': new MethodTrampoline(0, (Parser target) => target._pars eForStatement()),
8917 'parseFunctionBody_3': new MethodTrampoline(3, (Parser target, arg0, arg1, arg 2) => target._parseFunctionBody(arg0, arg1, arg2)), 8972 'parseFunctionBody_3': new MethodTrampoline(3, (Parser target, arg0, arg1, arg 2) => target._parseFunctionBody(arg0, arg1, arg2)),
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
9028 return trampoline(target, arguments[0], arguments[1]); 9083 return trampoline(target, arguments[0], arguments[1]);
9029 case 3: 9084 case 3:
9030 return trampoline(target, arguments[0], arguments[1], arguments[2]); 9085 return trampoline(target, arguments[0], arguments[1], arguments[2]);
9031 case 4: 9086 case 4:
9032 return trampoline(target, arguments[0], arguments[1], arguments[2], argu ments[3]); 9087 return trampoline(target, arguments[0], arguments[1], arguments[2], argu ments[3]);
9033 default: 9088 default:
9034 throw new IllegalArgumentException("Not implemented for > 4 arguments"); 9089 throw new IllegalArgumentException("Not implemented for > 4 arguments");
9035 } 9090 }
9036 } 9091 }
9037 } 9092 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698