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

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

Issue 24481002: New analyzer_experimental snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 // 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 library engine.parser; 3 library engine.parser;
4 import 'dart:collection'; 4 import 'dart:collection';
5 import 'java_core.dart'; 5 import 'java_core.dart';
6 import 'instrumentation.dart'; 6 import 'instrumentation.dart';
7 import 'error.dart'; 7 import 'error.dart';
8 import 'source.dart'; 8 import 'source.dart';
9 import 'scanner.dart'; 9 import 'scanner.dart';
10 import 'ast.dart'; 10 import 'ast.dart';
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 /** 194 /**
195 * Parse a compilation unit, starting with the given token. 195 * Parse a compilation unit, starting with the given token.
196 * 196 *
197 * @param token the first token of the compilation unit 197 * @param token the first token of the compilation unit
198 * @return the compilation unit that was parsed 198 * @return the compilation unit that was parsed
199 */ 199 */
200 CompilationUnit parseCompilationUnit(Token token) { 200 CompilationUnit parseCompilationUnit(Token token) {
201 InstrumentationBuilder instrumentation = Instrumentation.builder2("dart.engi ne.Parser.parseCompilationUnit"); 201 InstrumentationBuilder instrumentation = Instrumentation.builder2("dart.engi ne.Parser.parseCompilationUnit");
202 try { 202 try {
203 _currentToken = token; 203 _currentToken = token;
204 return parseCompilationUnit2(); 204 CompilationUnit compilationUnit = parseCompilationUnit2();
205 gatherTodoComments(token);
206 return compilationUnit;
205 } finally { 207 } finally {
206 instrumentation.log(); 208 instrumentation.log();
207 } 209 }
208 } 210 }
209 211
210 /** 212 /**
211 * Parse an expression, starting with the given token. 213 * Parse an expression, starting with the given token.
212 * 214 *
213 * @param token the first token of the expression 215 * @param token the first token of the expression
214 * @return the expression that was parsed, or `null` if the tokens do not repr esent a 216 * @return the expression that was parsed, or `null` if the tokens do not repr esent a
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 * 392 *
391 * @return the synthetic string literal that was created 393 * @return the synthetic string literal that was created
392 */ 394 */
393 SimpleStringLiteral createSyntheticStringLiteral() => new SimpleStringLiteral. full(createSyntheticToken2(TokenType.STRING), ""); 395 SimpleStringLiteral createSyntheticStringLiteral() => new SimpleStringLiteral. full(createSyntheticToken2(TokenType.STRING), "");
394 396
395 /** 397 /**
396 * Create a synthetic token representing the given keyword. 398 * Create a synthetic token representing the given keyword.
397 * 399 *
398 * @return the synthetic token that was created 400 * @return the synthetic token that was created
399 */ 401 */
400 Token createSyntheticToken(Keyword keyword) => new KeywordToken_14(keyword, _c urrentToken.offset); 402 Token createSyntheticToken(Keyword keyword) => new KeywordToken_13(keyword, _c urrentToken.offset);
401 403
402 /** 404 /**
403 * Create a synthetic token with the given type. 405 * Create a synthetic token with the given type.
404 * 406 *
405 * @return the synthetic token that was created 407 * @return the synthetic token that was created
406 */ 408 */
407 Token createSyntheticToken2(TokenType type) => new StringToken(type, "", _curr entToken.offset); 409 Token createSyntheticToken2(TokenType type) => new StringToken(type, "", _curr entToken.offset);
408 410
409 /** 411 /**
410 * Check that the given expression is assignable and report an error if it isn 't. 412 * Check that the given expression is assignable and report an error if it isn 't.
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 List<int> findRange(List<List<int>> ranges, int index) { 475 List<int> findRange(List<List<int>> ranges, int index) {
474 for (List<int> range in ranges) { 476 for (List<int> range in ranges) {
475 if (range[0] <= index && index <= range[1]) { 477 if (range[0] <= index && index <= range[1]) {
476 return range; 478 return range;
477 } else if (index < range[0]) { 479 } else if (index < range[0]) {
478 return null; 480 return null;
479 } 481 }
480 } 482 }
481 return null; 483 return null;
482 } 484 }
485 void gatherTodoComments(Token token) {
486 while (token != null && token.type != TokenType.EOF) {
487 Token commentToken = token.precedingComments;
488 while (commentToken != null) {
489 if (identical(commentToken.type, TokenType.SINGLE_LINE_COMMENT) || ident ical(commentToken.type, TokenType.MULTI_LINE_COMMENT)) {
490 scrapeTodoComment(commentToken);
491 }
492 commentToken = commentToken.next;
493 }
494 token = token.next;
495 }
496 }
483 497
484 /** 498 /**
485 * Advance to the next token in the token stream, making it the new current to ken. 499 * Advance to the next token in the token stream, making it the new current to ken.
486 * 500 *
487 * @return the token that was current before this method was invoked 501 * @return the token that was current before this method was invoked
488 */ 502 */
489 Token get andAdvance { 503 Token get andAdvance {
490 Token token = _currentToken; 504 Token token = _currentToken;
491 advance(); 505 advance();
492 return token; 506 return token;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 if (afterReturnType == null) { 593 if (afterReturnType == null) {
580 afterReturnType = _currentToken; 594 afterReturnType = _currentToken;
581 } 595 }
582 Token afterIdentifier = skipSimpleIdentifier(afterReturnType); 596 Token afterIdentifier = skipSimpleIdentifier(afterReturnType);
583 if (afterIdentifier == null) { 597 if (afterIdentifier == null) {
584 afterIdentifier = skipSimpleIdentifier(_currentToken); 598 afterIdentifier = skipSimpleIdentifier(_currentToken);
585 } 599 }
586 if (afterIdentifier == null) { 600 if (afterIdentifier == null) {
587 return false; 601 return false;
588 } 602 }
589 return isFunctionExpression(afterIdentifier); 603 if (isFunctionExpression(afterIdentifier)) {
604 return true;
605 }
606 if (matches(Keyword.GET)) {
607 Token afterName = skipSimpleIdentifier(_currentToken.next);
608 if (afterName == null) {
609 return false;
610 }
611 return matches4(afterName, TokenType.FUNCTION) || matches4(afterName, Toke nType.OPEN_CURLY_BRACKET);
612 }
613 return false;
590 } 614 }
591 615
592 /** 616 /**
593 * Return `true` if the given token appears to be the beginning of a function expression. 617 * Return `true` if the given token appears to be the beginning of a function expression.
594 * 618 *
595 * @param startToken the token that might be the start of a function expressio n 619 * @param startToken the token that might be the start of a function expressio n
596 * @return `true` if the given token appears to be the beginning of a function expression 620 * @return `true` if the given token appears to be the beginning of a function expression
597 */ 621 */
598 bool isFunctionExpression(Token startToken) { 622 bool isFunctionExpression(Token startToken) {
599 Token afterParameters = skipFormalParameterList(startToken); 623 Token afterParameters = skipFormalParameterList(startToken);
(...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after
1634 combinators.add(new ShowCombinator.full(keyword, shownNames)); 1658 combinators.add(new ShowCombinator.full(keyword, shownNames));
1635 } else { 1659 } else {
1636 List<SimpleIdentifier> hiddenNames = parseIdentifierList(); 1660 List<SimpleIdentifier> hiddenNames = parseIdentifierList();
1637 combinators.add(new HideCombinator.full(keyword, hiddenNames)); 1661 combinators.add(new HideCombinator.full(keyword, hiddenNames));
1638 } 1662 }
1639 } 1663 }
1640 return combinators; 1664 return combinators;
1641 } 1665 }
1642 1666
1643 /** 1667 /**
1644 * Parse the documentation comment and metadata preceeding a declaration. This method allows any 1668 * Parse the documentation comment and metadata preceding a declaration. This method allows any
1645 * number of documentation comments to occur before, after or between the meta data, but only 1669 * number of documentation comments to occur before, after or between the meta data, but only
1646 * returns the last (right-most) documentation comment that is found. 1670 * returns the last (right-most) documentation comment that is found.
1647 * 1671 *
1648 * <pre> 1672 * <pre>
1649 * metadata ::= 1673 * metadata ::=
1650 * annotation* 1674 * annotation*
1651 * </pre> 1675 * </pre>
1652 * 1676 *
1653 * @return the documentation comment and metadata that were parsed 1677 * @return the documentation comment and metadata that were parsed
1654 */ 1678 */
(...skipping 22 matching lines...) Expand all
1677 * comment 1701 * comment
1678 * @param sourceOffset the offset of the first character of the reference sour ce 1702 * @param sourceOffset the offset of the first character of the reference sour ce
1679 * @return the comment reference that was parsed, or `null` if no reference co uld be found 1703 * @return the comment reference that was parsed, or `null` if no reference co uld be found
1680 */ 1704 */
1681 CommentReference parseCommentReference(String referenceSource, int sourceOffse t) { 1705 CommentReference parseCommentReference(String referenceSource, int sourceOffse t) {
1682 if (referenceSource.length == 0) { 1706 if (referenceSource.length == 0) {
1683 return null; 1707 return null;
1684 } 1708 }
1685 try { 1709 try {
1686 List<bool> errorFound = [false]; 1710 List<bool> errorFound = [false];
1687 AnalysisErrorListener listener = new AnalysisErrorListener_15(errorFound); 1711 AnalysisErrorListener listener = new AnalysisErrorListener_14(errorFound);
1688 StringScanner scanner = new StringScanner(null, referenceSource, listener) ; 1712 StringScanner scanner = new StringScanner(null, referenceSource, listener) ;
1689 scanner.setSourceStart(1, 1, sourceOffset); 1713 scanner.setSourceStart(1, 1, sourceOffset);
1690 Token firstToken = scanner.tokenize(); 1714 Token firstToken = scanner.tokenize();
1691 if (errorFound[0]) { 1715 if (errorFound[0]) {
1692 return null; 1716 return null;
1693 } 1717 }
1694 Token newKeyword = null; 1718 Token newKeyword = null;
1695 if (matches3(firstToken, Keyword.NEW)) { 1719 if (matches3(firstToken, Keyword.NEW)) {
1696 newKeyword = firstToken; 1720 newKeyword = firstToken;
1697 firstToken = firstToken.next; 1721 firstToken = firstToken.next;
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1826 if (directive is ExportDirective) { 1850 if (directive is ExportDirective) {
1827 reportError9(ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, ((directive as NamespaceDirective)).keyword, []); 1851 reportError9(ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, ((directive as NamespaceDirective)).keyword, []);
1828 } else if (directive is ImportDirective) { 1852 } else if (directive is ImportDirective) {
1829 reportError9(ParserErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, ((directive as NamespaceDirective)).keyword, []); 1853 reportError9(ParserErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, ((directive as NamespaceDirective)).keyword, []);
1830 } 1854 }
1831 } 1855 }
1832 if (directive is PartOfDirective) { 1856 if (directive is PartOfDirective) {
1833 if (partOfDirectiveFound) { 1857 if (partOfDirectiveFound) {
1834 reportError8(ParserErrorCode.MULTIPLE_PART_OF_DIRECTIVES, []); 1858 reportError8(ParserErrorCode.MULTIPLE_PART_OF_DIRECTIVES, []);
1835 } else { 1859 } else {
1836 for (Directive preceedingDirective in directives) { 1860 for (Directive precedingDirective in directives) {
1837 reportError9(ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART, precee dingDirective.keyword, []); 1861 reportError9(ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART, preced ingDirective.keyword, []);
1838 } 1862 }
1839 partOfDirectiveFound = true; 1863 partOfDirectiveFound = true;
1840 } 1864 }
1841 } else { 1865 } else {
1842 if (partOfDirectiveFound) { 1866 if (partOfDirectiveFound) {
1843 reportError9(ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART, directiv e.keyword, []); 1867 reportError9(ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART, directiv e.keyword, []);
1844 } 1868 }
1845 } 1869 }
1846 directives.add(directive); 1870 directives.add(directive);
1847 } else if (matches5(TokenType.SEMICOLON)) { 1871 } else if (matches5(TokenType.SEMICOLON)) {
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
2645 SimpleIdentifier variableName = parseSimpleIdentifier(); 2669 SimpleIdentifier variableName = parseSimpleIdentifier();
2646 variables.add(new VariableDeclaration.full(null, null, variableName, n ull, null)); 2670 variables.add(new VariableDeclaration.full(null, null, variableName, n ull, null));
2647 variableList = new VariableDeclarationList.full(commentAndMetadata.com ment, commentAndMetadata.metadata, null, null, variables); 2671 variableList = new VariableDeclarationList.full(commentAndMetadata.com ment, commentAndMetadata.metadata, null, null, variables);
2648 } else if (isInitializedVariableDeclaration()) { 2672 } else if (isInitializedVariableDeclaration()) {
2649 variableList = parseVariableDeclarationList(commentAndMetadata); 2673 variableList = parseVariableDeclarationList(commentAndMetadata);
2650 } else { 2674 } else {
2651 initialization = parseExpression2(); 2675 initialization = parseExpression2();
2652 } 2676 }
2653 if (matches(Keyword.IN)) { 2677 if (matches(Keyword.IN)) {
2654 DeclaredIdentifier loopVariable = null; 2678 DeclaredIdentifier loopVariable = null;
2679 SimpleIdentifier identifier = null;
2655 if (variableList == null) { 2680 if (variableList == null) {
2656 reportError8(ParserErrorCode.MISSING_VARIABLE_IN_FOR_EACH, []); 2681 reportError8(ParserErrorCode.MISSING_VARIABLE_IN_FOR_EACH, []);
2657 } else { 2682 } else {
2658 NodeList<VariableDeclaration> variables = variableList.variables; 2683 NodeList<VariableDeclaration> variables = variableList.variables;
2659 if (variables.length > 1) { 2684 if (variables.length > 1) {
2660 reportError8(ParserErrorCode.MULTIPLE_VARIABLES_IN_FOR_EACH, [vari ables.length.toString()]); 2685 reportError8(ParserErrorCode.MULTIPLE_VARIABLES_IN_FOR_EACH, [vari ables.length.toString()]);
2661 } 2686 }
2662 VariableDeclaration variable = variables[0]; 2687 VariableDeclaration variable = variables[0];
2663 if (variable.initializer != null) { 2688 if (variable.initializer != null) {
2664 reportError8(ParserErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH, []) ; 2689 reportError8(ParserErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH, []) ;
2665 } 2690 }
2666 loopVariable = new DeclaredIdentifier.full(commentAndMetadata.commen t, commentAndMetadata.metadata, variableList.keyword, variableList.type, variabl e.name); 2691 Token keyword = variableList.keyword;
2692 TypeName type = variableList.type;
2693 if (keyword != null || type != null) {
2694 loopVariable = new DeclaredIdentifier.full(commentAndMetadata.comm ent, commentAndMetadata.metadata, keyword, type, variable.name);
2695 } else {
2696 if (!commentAndMetadata.metadata.isEmpty) {
2697 }
2698 identifier = variable.name;
2699 }
2667 } 2700 }
2668 Token inKeyword = expect(Keyword.IN); 2701 Token inKeyword = expect(Keyword.IN);
2669 Expression iterator = parseExpression2(); 2702 Expression iterator = parseExpression2();
2670 Token rightParenthesis = expect2(TokenType.CLOSE_PAREN); 2703 Token rightParenthesis = expect2(TokenType.CLOSE_PAREN);
2671 Statement body = parseStatement2(); 2704 Statement body = parseStatement2();
2672 return new ForEachStatement.full(forKeyword, leftParenthesis, loopVari able, inKeyword, iterator, rightParenthesis, body); 2705 if (loopVariable == null) {
2706 return new ForEachStatement.con2_full(forKeyword, leftParenthesis, i dentifier, inKeyword, iterator, rightParenthesis, body);
2707 }
2708 return new ForEachStatement.con1_full(forKeyword, leftParenthesis, loo pVariable, inKeyword, iterator, rightParenthesis, body);
2673 } 2709 }
2674 } 2710 }
2675 Token leftSeparator = expect2(TokenType.SEMICOLON); 2711 Token leftSeparator = expect2(TokenType.SEMICOLON);
2676 Expression condition = null; 2712 Expression condition = null;
2677 if (!matches5(TokenType.SEMICOLON)) { 2713 if (!matches5(TokenType.SEMICOLON)) {
2678 condition = parseExpression2(); 2714 condition = parseExpression2();
2679 } 2715 }
2680 Token rightSeparator = expect2(TokenType.SEMICOLON); 2716 Token rightSeparator = expect2(TokenType.SEMICOLON);
2681 List<Expression> updaters = null; 2717 List<Expression> updaters = null;
2682 if (!matches5(TokenType.CLOSE_PAREN)) { 2718 if (!matches5(TokenType.CLOSE_PAREN)) {
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
2816 * <pre> 2852 * <pre>
2817 * functionDeclarationStatement ::= 2853 * functionDeclarationStatement ::=
2818 * functionSignature functionBody 2854 * functionSignature functionBody
2819 * </pre> 2855 * </pre>
2820 * 2856 *
2821 * @param commentAndMetadata the documentation comment and metadata to be asso ciated with the 2857 * @param commentAndMetadata the documentation comment and metadata to be asso ciated with the
2822 * declaration 2858 * declaration
2823 * @param returnType the return type, or `null` if there is no return type 2859 * @param returnType the return type, or `null` if there is no return type
2824 * @return the function declaration statement that was parsed 2860 * @return the function declaration statement that was parsed
2825 */ 2861 */
2826 Statement parseFunctionDeclarationStatement2(CommentAndMetadata commentAndMeta data, TypeName returnType) => new FunctionDeclarationStatement.full(parseFunctio nDeclaration(commentAndMetadata, null, returnType)); 2862 Statement parseFunctionDeclarationStatement2(CommentAndMetadata commentAndMeta data, TypeName returnType) {
2863 FunctionDeclaration declaration = parseFunctionDeclaration(commentAndMetadat a, null, returnType);
2864 Token propertyKeyword = declaration.propertyKeyword;
2865 if (propertyKeyword != null) {
2866 if (identical(((propertyKeyword as KeywordToken)).keyword, Keyword.GET)) {
2867 reportError9(ParserErrorCode.GETTER_IN_FUNCTION, propertyKeyword, []);
2868 } else {
2869 reportError9(ParserErrorCode.SETTER_IN_FUNCTION, propertyKeyword, []);
2870 }
2871 }
2872 return new FunctionDeclarationStatement.full(declaration);
2873 }
2827 2874
2828 /** 2875 /**
2829 * Parse a function expression. 2876 * Parse a function expression.
2830 * 2877 *
2831 * <pre> 2878 * <pre>
2832 * functionExpression ::= 2879 * functionExpression ::=
2833 * formalParameterList functionExpressionBody 2880 * formalParameterList functionExpressionBody
2834 * </pre> 2881 * </pre>
2835 * 2882 *
2836 * @return the function expression that was parsed 2883 * @return the function expression that was parsed
(...skipping 1961 matching lines...) Expand 10 before | Expand all | Expand 10 after
4798 * 4845 *
4799 * @param errorCode the error code of the error to be reported 4846 * @param errorCode the error code of the error to be reported
4800 * @param token the token specifying the location of the error 4847 * @param token the token specifying the location of the error
4801 * @param arguments the arguments to the error, used to compose the error mess age 4848 * @param arguments the arguments to the error, used to compose the error mess age
4802 */ 4849 */
4803 void reportError9(ParserErrorCode errorCode, Token token, List<Object> argumen ts) { 4850 void reportError9(ParserErrorCode errorCode, Token token, List<Object> argumen ts) {
4804 _errorListener.onError(new AnalysisError.con2(_source, token.offset, token.l ength, errorCode, arguments)); 4851 _errorListener.onError(new AnalysisError.con2(_source, token.offset, token.l ength, errorCode, arguments));
4805 } 4852 }
4806 4853
4807 /** 4854 /**
4855 * Look for user defined tasks in comments and convert them into info level an alysis issues.
4856 *
4857 * @param commentToken the comment token to analyze
4858 */
4859 void scrapeTodoComment(Token commentToken) {
4860 JavaPatternMatcher matcher = new JavaPatternMatcher(TodoCode.TODO_REGEX, com mentToken.lexeme);
4861 if (matcher.find()) {
4862 int offset = commentToken.offset + matcher.start() + matcher.group(1).leng th;
4863 int length = matcher.group(2).length;
4864 _errorListener.onError(new AnalysisError.con2(_source, offset, length, Tod oCode.TODO, [matcher.group(2)]));
4865 }
4866 }
4867
4868 /**
4808 * Parse the 'final', 'const', 'var' or type preceding a variable declaration, starting at the 4869 * Parse the 'final', 'const', 'var' or type preceding a variable declaration, starting at the
4809 * given token, without actually creating a type or changing the current token . Return the token 4870 * given token, without actually creating a type or changing the current token . Return the token
4810 * following the type that was parsed, or `null` if the given token is not the first token 4871 * following the type that was parsed, or `null` if the given token is not the first token
4811 * in a valid type. 4872 * in a valid type.
4812 * 4873 *
4813 * <pre> 4874 * <pre>
4814 * finalConstVarOrType ::= 4875 * finalConstVarOrType ::=
4815 * | 'final' type? 4876 * | 'final' type?
4816 * | 'const' type? 4877 * | 'const' type?
4817 * | 'var' 4878 * | 'var'
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
5573 reportError9(ParserErrorCode.EXTERNAL_TYPEDEF, modifiers.externalKeyword, []); 5634 reportError9(ParserErrorCode.EXTERNAL_TYPEDEF, modifiers.externalKeyword, []);
5574 } 5635 }
5575 if (modifiers.finalKeyword != null) { 5636 if (modifiers.finalKeyword != null) {
5576 reportError9(ParserErrorCode.FINAL_TYPEDEF, modifiers.finalKeyword, []); 5637 reportError9(ParserErrorCode.FINAL_TYPEDEF, modifiers.finalKeyword, []);
5577 } 5638 }
5578 if (modifiers.varKeyword != null) { 5639 if (modifiers.varKeyword != null) {
5579 reportError9(ParserErrorCode.VAR_TYPEDEF, modifiers.varKeyword, []); 5640 reportError9(ParserErrorCode.VAR_TYPEDEF, modifiers.varKeyword, []);
5580 } 5641 }
5581 } 5642 }
5582 } 5643 }
5583 class KeywordToken_14 extends KeywordToken { 5644 class KeywordToken_13 extends KeywordToken {
5584 KeywordToken_14(Keyword arg0, int arg1) : super(arg0, arg1); 5645 KeywordToken_13(Keyword arg0, int arg1) : super(arg0, arg1);
5585 int get length => 0; 5646 int get length => 0;
5586 } 5647 }
5587 class AnalysisErrorListener_15 implements AnalysisErrorListener { 5648 class AnalysisErrorListener_14 implements AnalysisErrorListener {
5588 List<bool> errorFound; 5649 List<bool> errorFound;
5589 AnalysisErrorListener_15(this.errorFound); 5650 AnalysisErrorListener_14(this.errorFound);
5590 void onError(AnalysisError error) { 5651 void onError(AnalysisError error) {
5591 errorFound[0] = true; 5652 errorFound[0] = true;
5592 } 5653 }
5593 } 5654 }
5594 /** 5655 /**
5595 * The enumeration `ParserErrorCode` defines the error codes used for errors det ected by the 5656 * The enumeration `ParserErrorCode` defines the error codes used for errors det ected by the
5596 * parser. The convention for this class is for the name of the error code to in dicate the problem 5657 * parser. The convention for this class is for the name of the error code to in dicate the problem
5597 * that caused the error to be generated and for the error message to explain wh at is wrong and, 5658 * that caused the error to be generated and for the error message to explain wh at is wrong and,
5598 * when appropriate, how the problem can be corrected. 5659 * when appropriate, how the problem can be corrected.
5599 * 5660 *
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
5644 static final ParserErrorCode EXTERNAL_TYPEDEF = new ParserErrorCode.con3('EXTE RNAL_TYPEDEF', 41, "Type aliases cannot be declared to be 'external'"); 5705 static final ParserErrorCode EXTERNAL_TYPEDEF = new ParserErrorCode.con3('EXTE RNAL_TYPEDEF', 41, "Type aliases cannot be declared to be 'external'");
5645 static final ParserErrorCode FACTORY_TOP_LEVEL_DECLARATION = new ParserErrorCo de.con3('FACTORY_TOP_LEVEL_DECLARATION', 42, "Top-level declarations cannot be d eclared to be 'factory'"); 5706 static final ParserErrorCode FACTORY_TOP_LEVEL_DECLARATION = new ParserErrorCo de.con3('FACTORY_TOP_LEVEL_DECLARATION', 42, "Top-level declarations cannot be d eclared to be 'factory'");
5646 static final ParserErrorCode FACTORY_WITHOUT_BODY = new ParserErrorCode.con3(' FACTORY_WITHOUT_BODY', 43, "A non-redirecting 'factory' constructor must have a body"); 5707 static final ParserErrorCode FACTORY_WITHOUT_BODY = new ParserErrorCode.con3(' FACTORY_WITHOUT_BODY', 43, "A non-redirecting 'factory' constructor must have a body");
5647 static final ParserErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = new Parse rErrorCode.con3('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', 44, "Field initializers can only be used in a constructor"); 5708 static final ParserErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = new Parse rErrorCode.con3('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', 44, "Field initializers can only be used in a constructor");
5648 static final ParserErrorCode FINAL_AND_VAR = new ParserErrorCode.con3('FINAL_A ND_VAR', 45, "Members cannot be declared to be both 'final' and 'var'"); 5709 static final ParserErrorCode FINAL_AND_VAR = new ParserErrorCode.con3('FINAL_A ND_VAR', 45, "Members cannot be declared to be both 'final' and 'var'");
5649 static final ParserErrorCode FINAL_CLASS = new ParserErrorCode.con3('FINAL_CLA SS', 46, "Classes cannot be declared to be 'final'"); 5710 static final ParserErrorCode FINAL_CLASS = new ParserErrorCode.con3('FINAL_CLA SS', 46, "Classes cannot be declared to be 'final'");
5650 static final ParserErrorCode FINAL_CONSTRUCTOR = new ParserErrorCode.con3('FIN AL_CONSTRUCTOR', 47, "A constructor cannot be declared to be 'final'"); 5711 static final ParserErrorCode FINAL_CONSTRUCTOR = new ParserErrorCode.con3('FIN AL_CONSTRUCTOR', 47, "A constructor cannot be declared to be 'final'");
5651 static final ParserErrorCode FINAL_METHOD = new ParserErrorCode.con3('FINAL_ME THOD', 48, "Getters, setters and methods cannot be declared to be 'final'"); 5712 static final ParserErrorCode FINAL_METHOD = new ParserErrorCode.con3('FINAL_ME THOD', 48, "Getters, setters and methods cannot be declared to be 'final'");
5652 static final ParserErrorCode FINAL_TYPEDEF = new ParserErrorCode.con3('FINAL_T YPEDEF', 49, "Type aliases cannot be declared to be 'final'"); 5713 static final ParserErrorCode FINAL_TYPEDEF = new ParserErrorCode.con3('FINAL_T YPEDEF', 49, "Type aliases cannot be declared to be 'final'");
5653 static final ParserErrorCode FUNCTION_TYPED_PARAMETER_VAR = new ParserErrorCod e.con3('FUNCTION_TYPED_PARAMETER_VAR', 50, "Function typed parameters cannot spe cify 'const', 'final' or 'var' instead of return type"); 5714 static final ParserErrorCode FUNCTION_TYPED_PARAMETER_VAR = new ParserErrorCod e.con3('FUNCTION_TYPED_PARAMETER_VAR', 50, "Function typed parameters cannot spe cify 'const', 'final' or 'var' instead of return type");
5654 static final ParserErrorCode GETTER_WITH_PARAMETERS = new ParserErrorCode.con3 ('GETTER_WITH_PARAMETERS', 51, "Getter should be declared without a parameter li st"); 5715 static final ParserErrorCode GETTER_IN_FUNCTION = new ParserErrorCode.con3('GE TTER_IN_FUNCTION', 51, "Getters cannot be defined within methods or functions");
5655 static final ParserErrorCode ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE = new Parser ErrorCode.con3('ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE', 52, "Illegal assignment t o non-assignable expression"); 5716 static final ParserErrorCode GETTER_WITH_PARAMETERS = new ParserErrorCode.con3 ('GETTER_WITH_PARAMETERS', 52, "Getter should be declared without a parameter li st");
5656 static final ParserErrorCode IMPLEMENTS_BEFORE_EXTENDS = new ParserErrorCode.c on3('IMPLEMENTS_BEFORE_EXTENDS', 53, "The extends clause must be before the impl ements clause"); 5717 static final ParserErrorCode ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE = new Parser ErrorCode.con3('ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE', 53, "Illegal assignment t o non-assignable expression");
5657 static final ParserErrorCode IMPLEMENTS_BEFORE_WITH = new ParserErrorCode.con3 ('IMPLEMENTS_BEFORE_WITH', 54, "The with clause must be before the implements cl ause"); 5718 static final ParserErrorCode IMPLEMENTS_BEFORE_EXTENDS = new ParserErrorCode.c on3('IMPLEMENTS_BEFORE_EXTENDS', 54, "The extends clause must be before the impl ements clause");
5658 static final ParserErrorCode IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE = new Parse rErrorCode.con3('IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE', 55, "Import directives must preceed part directives"); 5719 static final ParserErrorCode IMPLEMENTS_BEFORE_WITH = new ParserErrorCode.con3 ('IMPLEMENTS_BEFORE_WITH', 55, "The with clause must be before the implements cl ause");
5659 static final ParserErrorCode INITIALIZED_VARIABLE_IN_FOR_EACH = new ParserErro rCode.con3('INITIALIZED_VARIABLE_IN_FOR_EACH', 56, "The loop variable in a for-e ach loop cannot be initialized"); 5720 static final ParserErrorCode IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE = new Parse rErrorCode.con3('IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE', 56, "Import directives must preceed part directives");
5660 static final ParserErrorCode INVALID_CODE_POINT = new ParserErrorCode.con3('IN VALID_CODE_POINT', 57, "The escape sequence '%s' is not a valid code point"); 5721 static final ParserErrorCode INITIALIZED_VARIABLE_IN_FOR_EACH = new ParserErro rCode.con3('INITIALIZED_VARIABLE_IN_FOR_EACH', 57, "The loop variable in a for-e ach loop cannot be initialized");
5661 static final ParserErrorCode INVALID_COMMENT_REFERENCE = new ParserErrorCode.c on3('INVALID_COMMENT_REFERENCE', 58, "Comment references should contain a possib ly prefixed identifier and can start with 'new', but should not contain anything else"); 5722 static final ParserErrorCode INVALID_CODE_POINT = new ParserErrorCode.con3('IN VALID_CODE_POINT', 58, "The escape sequence '%s' is not a valid code point");
5662 static final ParserErrorCode INVALID_HEX_ESCAPE = new ParserErrorCode.con3('IN VALID_HEX_ESCAPE', 59, "An escape sequence starting with '\\x' must be followed by 2 hexidecimal digits"); 5723 static final ParserErrorCode INVALID_COMMENT_REFERENCE = new ParserErrorCode.c on3('INVALID_COMMENT_REFERENCE', 59, "Comment references should contain a possib ly prefixed identifier and can start with 'new', but should not contain anything else");
5663 static final ParserErrorCode INVALID_OPERATOR = new ParserErrorCode.con3('INVA LID_OPERATOR', 60, "The string '%s' is not a valid operator"); 5724 static final ParserErrorCode INVALID_HEX_ESCAPE = new ParserErrorCode.con3('IN VALID_HEX_ESCAPE', 60, "An escape sequence starting with '\\x' must be followed by 2 hexidecimal digits");
5664 static final ParserErrorCode INVALID_OPERATOR_FOR_SUPER = new ParserErrorCode. con3('INVALID_OPERATOR_FOR_SUPER', 61, "The operator '%s' cannot be used with 's uper'"); 5725 static final ParserErrorCode INVALID_OPERATOR = new ParserErrorCode.con3('INVA LID_OPERATOR', 61, "The string '%s' is not a valid operator");
5665 static final ParserErrorCode INVALID_UNICODE_ESCAPE = new ParserErrorCode.con3 ('INVALID_UNICODE_ESCAPE', 62, "An escape sequence starting with '\\u' must be f ollowed by 4 hexidecimal digits or from 1 to 6 digits between '{' and '}'"); 5726 static final ParserErrorCode INVALID_OPERATOR_FOR_SUPER = new ParserErrorCode. con3('INVALID_OPERATOR_FOR_SUPER', 62, "The operator '%s' cannot be used with 's uper'");
5666 static final ParserErrorCode LIBRARY_DIRECTIVE_NOT_FIRST = new ParserErrorCode .con3('LIBRARY_DIRECTIVE_NOT_FIRST', 63, "The library directive must appear befo re all other directives"); 5727 static final ParserErrorCode INVALID_UNICODE_ESCAPE = new ParserErrorCode.con3 ('INVALID_UNICODE_ESCAPE', 63, "An escape sequence starting with '\\u' must be f ollowed by 4 hexidecimal digits or from 1 to 6 digits between '{' and '}'");
5667 static final ParserErrorCode LOCAL_FUNCTION_DECLARATION_MODIFIER = new ParserE rrorCode.con3('LOCAL_FUNCTION_DECLARATION_MODIFIER', 64, "Local function declara tions cannot specify any modifier"); 5728 static final ParserErrorCode LIBRARY_DIRECTIVE_NOT_FIRST = new ParserErrorCode .con3('LIBRARY_DIRECTIVE_NOT_FIRST', 64, "The library directive must appear befo re all other directives");
5668 static final ParserErrorCode MISSING_ASSIGNABLE_SELECTOR = new ParserErrorCode .con3('MISSING_ASSIGNABLE_SELECTOR', 65, "Missing selector such as \".<identifie r>\" or \"[0]\""); 5729 static final ParserErrorCode LOCAL_FUNCTION_DECLARATION_MODIFIER = new ParserE rrorCode.con3('LOCAL_FUNCTION_DECLARATION_MODIFIER', 65, "Local function declara tions cannot specify any modifier");
5669 static final ParserErrorCode MISSING_CATCH_OR_FINALLY = new ParserErrorCode.co n3('MISSING_CATCH_OR_FINALLY', 66, "A try statement must have either a catch or finally clause"); 5730 static final ParserErrorCode MISSING_ASSIGNABLE_SELECTOR = new ParserErrorCode .con3('MISSING_ASSIGNABLE_SELECTOR', 66, "Missing selector such as \".<identifie r>\" or \"[0]\"");
5670 static final ParserErrorCode MISSING_CLASS_BODY = new ParserErrorCode.con3('MI SSING_CLASS_BODY', 67, "A class definition must have a body, even if it is empty "); 5731 static final ParserErrorCode MISSING_CATCH_OR_FINALLY = new ParserErrorCode.co n3('MISSING_CATCH_OR_FINALLY', 67, "A try statement must have either a catch or finally clause");
5671 static final ParserErrorCode MISSING_CLOSING_PARENTHESIS = new ParserErrorCode .con3('MISSING_CLOSING_PARENTHESIS', 68, "The closing parenthesis is missing"); 5732 static final ParserErrorCode MISSING_CLASS_BODY = new ParserErrorCode.con3('MI SSING_CLASS_BODY', 68, "A class definition must have a body, even if it is empty ");
5672 static final ParserErrorCode MISSING_CONST_FINAL_VAR_OR_TYPE = new ParserError Code.con3('MISSING_CONST_FINAL_VAR_OR_TYPE', 69, "Variables must be declared usi ng the keywords 'const', 'final', 'var' or a type name"); 5733 static final ParserErrorCode MISSING_CLOSING_PARENTHESIS = new ParserErrorCode .con3('MISSING_CLOSING_PARENTHESIS', 69, "The closing parenthesis is missing");
5673 static final ParserErrorCode MISSING_EXPRESSION_IN_THROW = new ParserErrorCode .con3('MISSING_EXPRESSION_IN_THROW', 70, "Throw expressions must compute the obj ect to be thrown"); 5734 static final ParserErrorCode MISSING_CONST_FINAL_VAR_OR_TYPE = new ParserError Code.con3('MISSING_CONST_FINAL_VAR_OR_TYPE', 70, "Variables must be declared usi ng the keywords 'const', 'final', 'var' or a type name");
5674 static final ParserErrorCode MISSING_FUNCTION_BODY = new ParserErrorCode.con3( 'MISSING_FUNCTION_BODY', 71, "A function body must be provided"); 5735 static final ParserErrorCode MISSING_EXPRESSION_IN_THROW = new ParserErrorCode .con3('MISSING_EXPRESSION_IN_THROW', 71, "Throw expressions must compute the obj ect to be thrown");
5675 static final ParserErrorCode MISSING_FUNCTION_PARAMETERS = new ParserErrorCode .con3('MISSING_FUNCTION_PARAMETERS', 72, "Functions must have an explicit list o f parameters"); 5736 static final ParserErrorCode MISSING_FUNCTION_BODY = new ParserErrorCode.con3( 'MISSING_FUNCTION_BODY', 72, "A function body must be provided");
5676 static final ParserErrorCode MISSING_IDENTIFIER = new ParserErrorCode.con3('MI SSING_IDENTIFIER', 73, "Expected an identifier"); 5737 static final ParserErrorCode MISSING_FUNCTION_PARAMETERS = new ParserErrorCode .con3('MISSING_FUNCTION_PARAMETERS', 73, "Functions must have an explicit list o f parameters");
5677 static final ParserErrorCode MISSING_KEYWORD_OPERATOR = new ParserErrorCode.co n3('MISSING_KEYWORD_OPERATOR', 74, "Operator declarations must be preceeded by t he keyword 'operator'"); 5738 static final ParserErrorCode MISSING_IDENTIFIER = new ParserErrorCode.con3('MI SSING_IDENTIFIER', 74, "Expected an identifier");
5678 static final ParserErrorCode MISSING_NAME_IN_LIBRARY_DIRECTIVE = new ParserErr orCode.con3('MISSING_NAME_IN_LIBRARY_DIRECTIVE', 75, "Library directives must in clude a library name"); 5739 static final ParserErrorCode MISSING_KEYWORD_OPERATOR = new ParserErrorCode.co n3('MISSING_KEYWORD_OPERATOR', 75, "Operator declarations must be preceeded by t he keyword 'operator'");
5679 static final ParserErrorCode MISSING_NAME_IN_PART_OF_DIRECTIVE = new ParserErr orCode.con3('MISSING_NAME_IN_PART_OF_DIRECTIVE', 76, "Library directives must in clude a library name"); 5740 static final ParserErrorCode MISSING_NAME_IN_LIBRARY_DIRECTIVE = new ParserErr orCode.con3('MISSING_NAME_IN_LIBRARY_DIRECTIVE', 76, "Library directives must in clude a library name");
5680 static final ParserErrorCode MISSING_STATEMENT = new ParserErrorCode.con3('MIS SING_STATEMENT', 77, "Expected a statement"); 5741 static final ParserErrorCode MISSING_NAME_IN_PART_OF_DIRECTIVE = new ParserErr orCode.con3('MISSING_NAME_IN_PART_OF_DIRECTIVE', 77, "Library directives must in clude a library name");
5681 static final ParserErrorCode MISSING_TERMINATOR_FOR_PARAMETER_GROUP = new Pars erErrorCode.con3('MISSING_TERMINATOR_FOR_PARAMETER_GROUP', 78, "There is no '%s' to close the parameter group"); 5742 static final ParserErrorCode MISSING_STATEMENT = new ParserErrorCode.con3('MIS SING_STATEMENT', 78, "Expected a statement");
5682 static final ParserErrorCode MISSING_TYPEDEF_PARAMETERS = new ParserErrorCode. con3('MISSING_TYPEDEF_PARAMETERS', 79, "Type aliases for functions must have an explicit list of parameters"); 5743 static final ParserErrorCode MISSING_TERMINATOR_FOR_PARAMETER_GROUP = new Pars erErrorCode.con3('MISSING_TERMINATOR_FOR_PARAMETER_GROUP', 79, "There is no '%s' to close the parameter group");
5683 static final ParserErrorCode MISSING_VARIABLE_IN_FOR_EACH = new ParserErrorCod e.con3('MISSING_VARIABLE_IN_FOR_EACH', 80, "A loop variable must be declared in a for-each loop before the 'in', but none were found"); 5744 static final ParserErrorCode MISSING_TYPEDEF_PARAMETERS = new ParserErrorCode. con3('MISSING_TYPEDEF_PARAMETERS', 80, "Type aliases for functions must have an explicit list of parameters");
5684 static final ParserErrorCode MIXED_PARAMETER_GROUPS = new ParserErrorCode.con3 ('MIXED_PARAMETER_GROUPS', 81, "Cannot have both positional and named parameters in a single parameter list"); 5745 static final ParserErrorCode MISSING_VARIABLE_IN_FOR_EACH = new ParserErrorCod e.con3('MISSING_VARIABLE_IN_FOR_EACH', 81, "A loop variable must be declared in a for-each loop before the 'in', but none were found");
5685 static final ParserErrorCode MULTIPLE_EXTENDS_CLAUSES = new ParserErrorCode.co n3('MULTIPLE_EXTENDS_CLAUSES', 82, "Each class definition can have at most one e xtends clause"); 5746 static final ParserErrorCode MIXED_PARAMETER_GROUPS = new ParserErrorCode.con3 ('MIXED_PARAMETER_GROUPS', 82, "Cannot have both positional and named parameters in a single parameter list");
5686 static final ParserErrorCode MULTIPLE_IMPLEMENTS_CLAUSES = new ParserErrorCode .con3('MULTIPLE_IMPLEMENTS_CLAUSES', 83, "Each class definition can have at most one implements clause"); 5747 static final ParserErrorCode MULTIPLE_EXTENDS_CLAUSES = new ParserErrorCode.co n3('MULTIPLE_EXTENDS_CLAUSES', 83, "Each class definition can have at most one e xtends clause");
5687 static final ParserErrorCode MULTIPLE_LIBRARY_DIRECTIVES = new ParserErrorCode .con3('MULTIPLE_LIBRARY_DIRECTIVES', 84, "Only one library directive may be decl ared in a file"); 5748 static final ParserErrorCode MULTIPLE_IMPLEMENTS_CLAUSES = new ParserErrorCode .con3('MULTIPLE_IMPLEMENTS_CLAUSES', 84, "Each class definition can have at most one implements clause");
5688 static final ParserErrorCode MULTIPLE_NAMED_PARAMETER_GROUPS = new ParserError Code.con3('MULTIPLE_NAMED_PARAMETER_GROUPS', 85, "Cannot have multiple groups of named parameters in a single parameter list"); 5749 static final ParserErrorCode MULTIPLE_LIBRARY_DIRECTIVES = new ParserErrorCode .con3('MULTIPLE_LIBRARY_DIRECTIVES', 85, "Only one library directive may be decl ared in a file");
5689 static final ParserErrorCode MULTIPLE_PART_OF_DIRECTIVES = new ParserErrorCode .con3('MULTIPLE_PART_OF_DIRECTIVES', 86, "Only one part-of directive may be decl ared in a file"); 5750 static final ParserErrorCode MULTIPLE_NAMED_PARAMETER_GROUPS = new ParserError Code.con3('MULTIPLE_NAMED_PARAMETER_GROUPS', 86, "Cannot have multiple groups of named parameters in a single parameter list");
5690 static final ParserErrorCode MULTIPLE_POSITIONAL_PARAMETER_GROUPS = new Parser ErrorCode.con3('MULTIPLE_POSITIONAL_PARAMETER_GROUPS', 87, "Cannot have multiple groups of positional parameters in a single parameter list"); 5751 static final ParserErrorCode MULTIPLE_PART_OF_DIRECTIVES = new ParserErrorCode .con3('MULTIPLE_PART_OF_DIRECTIVES', 87, "Only one part-of directive may be decl ared in a file");
5691 static final ParserErrorCode MULTIPLE_VARIABLES_IN_FOR_EACH = new ParserErrorC ode.con3('MULTIPLE_VARIABLES_IN_FOR_EACH', 88, "A single loop variable must be d eclared in a for-each loop before the 'in', but %s were found"); 5752 static final ParserErrorCode MULTIPLE_POSITIONAL_PARAMETER_GROUPS = new Parser ErrorCode.con3('MULTIPLE_POSITIONAL_PARAMETER_GROUPS', 88, "Cannot have multiple groups of positional parameters in a single parameter list");
5692 static final ParserErrorCode MULTIPLE_WITH_CLAUSES = new ParserErrorCode.con3( 'MULTIPLE_WITH_CLAUSES', 89, "Each class definition can have at most one with cl ause"); 5753 static final ParserErrorCode MULTIPLE_VARIABLES_IN_FOR_EACH = new ParserErrorC ode.con3('MULTIPLE_VARIABLES_IN_FOR_EACH', 89, "A single loop variable must be d eclared in a for-each loop before the 'in', but %s were found");
5693 static final ParserErrorCode NAMED_FUNCTION_EXPRESSION = new ParserErrorCode.c on3('NAMED_FUNCTION_EXPRESSION', 90, "Function expressions cannot be named"); 5754 static final ParserErrorCode MULTIPLE_WITH_CLAUSES = new ParserErrorCode.con3( 'MULTIPLE_WITH_CLAUSES', 90, "Each class definition can have at most one with cl ause");
5694 static final ParserErrorCode NAMED_PARAMETER_OUTSIDE_GROUP = new ParserErrorCo de.con3('NAMED_PARAMETER_OUTSIDE_GROUP', 91, "Named parameters must be enclosed in curly braces ('{' and '}')"); 5755 static final ParserErrorCode NAMED_FUNCTION_EXPRESSION = new ParserErrorCode.c on3('NAMED_FUNCTION_EXPRESSION', 91, "Function expressions cannot be named");
5695 static final ParserErrorCode NATIVE_CLAUSE_IN_NON_SDK_CODE = new ParserErrorCo de.con3('NATIVE_CLAUSE_IN_NON_SDK_CODE', 92, "Native clause can only be used in the SDK and code that is loaded through native extensions"); 5756 static final ParserErrorCode NAMED_PARAMETER_OUTSIDE_GROUP = new ParserErrorCo de.con3('NAMED_PARAMETER_OUTSIDE_GROUP', 92, "Named parameters must be enclosed in curly braces ('{' and '}')");
5696 static final ParserErrorCode NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE = new Parser ErrorCode.con3('NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE', 93, "Native functions can only be declared in the SDK and code that is loaded through native extensions") ; 5757 static final ParserErrorCode NATIVE_CLAUSE_IN_NON_SDK_CODE = new ParserErrorCo de.con3('NATIVE_CLAUSE_IN_NON_SDK_CODE', 93, "Native clause can only be used in the SDK and code that is loaded through native extensions");
5697 static final ParserErrorCode NON_CONSTRUCTOR_FACTORY = new ParserErrorCode.con 3('NON_CONSTRUCTOR_FACTORY', 94, "Only constructors can be declared to be a 'fac tory'"); 5758 static final ParserErrorCode NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE = new Parser ErrorCode.con3('NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE', 94, "Native functions can only be declared in the SDK and code that is loaded through native extensions") ;
5698 static final ParserErrorCode NON_IDENTIFIER_LIBRARY_NAME = new ParserErrorCode .con3('NON_IDENTIFIER_LIBRARY_NAME', 95, "The name of a library must be an ident ifier"); 5759 static final ParserErrorCode NON_CONSTRUCTOR_FACTORY = new ParserErrorCode.con 3('NON_CONSTRUCTOR_FACTORY', 95, "Only constructors can be declared to be a 'fac tory'");
5699 static final ParserErrorCode NON_PART_OF_DIRECTIVE_IN_PART = new ParserErrorCo de.con3('NON_PART_OF_DIRECTIVE_IN_PART', 96, "The part-of directive must be the only directive in a part"); 5760 static final ParserErrorCode NON_IDENTIFIER_LIBRARY_NAME = new ParserErrorCode .con3('NON_IDENTIFIER_LIBRARY_NAME', 96, "The name of a library must be an ident ifier");
5700 static final ParserErrorCode NON_USER_DEFINABLE_OPERATOR = new ParserErrorCode .con3('NON_USER_DEFINABLE_OPERATOR', 97, "The operator '%s' is not user definabl e"); 5761 static final ParserErrorCode NON_PART_OF_DIRECTIVE_IN_PART = new ParserErrorCo de.con3('NON_PART_OF_DIRECTIVE_IN_PART', 97, "The part-of directive must be the only directive in a part");
5701 static final ParserErrorCode NORMAL_BEFORE_OPTIONAL_PARAMETERS = new ParserErr orCode.con3('NORMAL_BEFORE_OPTIONAL_PARAMETERS', 98, "Normal parameters must occ ur before optional parameters"); 5762 static final ParserErrorCode NON_USER_DEFINABLE_OPERATOR = new ParserErrorCode .con3('NON_USER_DEFINABLE_OPERATOR', 98, "The operator '%s' is not user definabl e");
5702 static final ParserErrorCode POSITIONAL_AFTER_NAMED_ARGUMENT = new ParserError Code.con3('POSITIONAL_AFTER_NAMED_ARGUMENT', 99, "Positional arguments must occu r before named arguments"); 5763 static final ParserErrorCode NORMAL_BEFORE_OPTIONAL_PARAMETERS = new ParserErr orCode.con3('NORMAL_BEFORE_OPTIONAL_PARAMETERS', 99, "Normal parameters must occ ur before optional parameters");
5703 static final ParserErrorCode POSITIONAL_PARAMETER_OUTSIDE_GROUP = new ParserEr rorCode.con3('POSITIONAL_PARAMETER_OUTSIDE_GROUP', 100, "Positional parameters m ust be enclosed in square brackets ('[' and ']')"); 5764 static final ParserErrorCode POSITIONAL_AFTER_NAMED_ARGUMENT = new ParserError Code.con3('POSITIONAL_AFTER_NAMED_ARGUMENT', 100, "Positional arguments must occ ur before named arguments");
5704 static final ParserErrorCode REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR = new Pars erErrorCode.con3('REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR', 101, "Only factory co nstructor can specify '=' redirection."); 5765 static final ParserErrorCode POSITIONAL_PARAMETER_OUTSIDE_GROUP = new ParserEr rorCode.con3('POSITIONAL_PARAMETER_OUTSIDE_GROUP', 101, "Positional parameters m ust be enclosed in square brackets ('[' and ']')");
5705 static final ParserErrorCode STATIC_AFTER_CONST = new ParserErrorCode.con3('ST ATIC_AFTER_CONST', 102, "The modifier 'static' should be before the modifier 'co nst'"); 5766 static final ParserErrorCode REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR = new Pars erErrorCode.con3('REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR', 102, "Only factory co nstructor can specify '=' redirection.");
5706 static final ParserErrorCode STATIC_AFTER_FINAL = new ParserErrorCode.con3('ST ATIC_AFTER_FINAL', 103, "The modifier 'static' should be before the modifier 'fi nal'"); 5767 static final ParserErrorCode SETTER_IN_FUNCTION = new ParserErrorCode.con3('SE TTER_IN_FUNCTION', 103, "Setters cannot be defined within methods or functions") ;
5707 static final ParserErrorCode STATIC_AFTER_VAR = new ParserErrorCode.con3('STAT IC_AFTER_VAR', 104, "The modifier 'static' should be before the modifier 'var'") ; 5768 static final ParserErrorCode STATIC_AFTER_CONST = new ParserErrorCode.con3('ST ATIC_AFTER_CONST', 104, "The modifier 'static' should be before the modifier 'co nst'");
5708 static final ParserErrorCode STATIC_CONSTRUCTOR = new ParserErrorCode.con3('ST ATIC_CONSTRUCTOR', 105, "Constructors cannot be static"); 5769 static final ParserErrorCode STATIC_AFTER_FINAL = new ParserErrorCode.con3('ST ATIC_AFTER_FINAL', 105, "The modifier 'static' should be before the modifier 'fi nal'");
5709 static final ParserErrorCode STATIC_GETTER_WITHOUT_BODY = new ParserErrorCode. con3('STATIC_GETTER_WITHOUT_BODY', 106, "A 'static' getter must have a body"); 5770 static final ParserErrorCode STATIC_AFTER_VAR = new ParserErrorCode.con3('STAT IC_AFTER_VAR', 106, "The modifier 'static' should be before the modifier 'var'") ;
5710 static final ParserErrorCode STATIC_OPERATOR = new ParserErrorCode.con3('STATI C_OPERATOR', 107, "Operators cannot be static"); 5771 static final ParserErrorCode STATIC_CONSTRUCTOR = new ParserErrorCode.con3('ST ATIC_CONSTRUCTOR', 107, "Constructors cannot be static");
5711 static final ParserErrorCode STATIC_SETTER_WITHOUT_BODY = new ParserErrorCode. con3('STATIC_SETTER_WITHOUT_BODY', 108, "A 'static' setter must have a body"); 5772 static final ParserErrorCode STATIC_GETTER_WITHOUT_BODY = new ParserErrorCode. con3('STATIC_GETTER_WITHOUT_BODY', 108, "A 'static' getter must have a body");
5712 static final ParserErrorCode STATIC_TOP_LEVEL_DECLARATION = new ParserErrorCod e.con3('STATIC_TOP_LEVEL_DECLARATION', 109, "Top-level declarations cannot be de clared to be 'static'"); 5773 static final ParserErrorCode STATIC_OPERATOR = new ParserErrorCode.con3('STATI C_OPERATOR', 109, "Operators cannot be static");
5713 static final ParserErrorCode SWITCH_HAS_CASE_AFTER_DEFAULT_CASE = new ParserEr rorCode.con3('SWITCH_HAS_CASE_AFTER_DEFAULT_CASE', 110, "The 'default' case shou ld be the last case in a switch statement"); 5774 static final ParserErrorCode STATIC_SETTER_WITHOUT_BODY = new ParserErrorCode. con3('STATIC_SETTER_WITHOUT_BODY', 110, "A 'static' setter must have a body");
5714 static final ParserErrorCode SWITCH_HAS_MULTIPLE_DEFAULT_CASES = new ParserErr orCode.con3('SWITCH_HAS_MULTIPLE_DEFAULT_CASES', 111, "The 'default' case can on ly be declared once"); 5775 static final ParserErrorCode STATIC_TOP_LEVEL_DECLARATION = new ParserErrorCod e.con3('STATIC_TOP_LEVEL_DECLARATION', 111, "Top-level declarations cannot be de clared to be 'static'");
5715 static final ParserErrorCode TOP_LEVEL_OPERATOR = new ParserErrorCode.con3('TO P_LEVEL_OPERATOR', 112, "Operators must be declared within a class"); 5776 static final ParserErrorCode SWITCH_HAS_CASE_AFTER_DEFAULT_CASE = new ParserEr rorCode.con3('SWITCH_HAS_CASE_AFTER_DEFAULT_CASE', 112, "The 'default' case shou ld be the last case in a switch statement");
5716 static final ParserErrorCode UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP = new P arserErrorCode.con3('UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP', 113, "There is no '%s' to open a parameter group"); 5777 static final ParserErrorCode SWITCH_HAS_MULTIPLE_DEFAULT_CASES = new ParserErr orCode.con3('SWITCH_HAS_MULTIPLE_DEFAULT_CASES', 113, "The 'default' case can on ly be declared once");
5717 static final ParserErrorCode UNEXPECTED_TOKEN = new ParserErrorCode.con3('UNEX PECTED_TOKEN', 114, "Unexpected token '%s'"); 5778 static final ParserErrorCode TOP_LEVEL_OPERATOR = new ParserErrorCode.con3('TO P_LEVEL_OPERATOR', 114, "Operators must be declared within a class");
5718 static final ParserErrorCode WITH_BEFORE_EXTENDS = new ParserErrorCode.con3('W ITH_BEFORE_EXTENDS', 115, "The extends clause must be before the with clause"); 5779 static final ParserErrorCode UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP = new P arserErrorCode.con3('UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP', 115, "There is no '%s' to open a parameter group");
5719 static final ParserErrorCode WITH_WITHOUT_EXTENDS = new ParserErrorCode.con3(' WITH_WITHOUT_EXTENDS', 116, "The with clause cannot be used without an extends c lause"); 5780 static final ParserErrorCode UNEXPECTED_TOKEN = new ParserErrorCode.con3('UNEX PECTED_TOKEN', 116, "Unexpected token '%s'");
5720 static final ParserErrorCode WRONG_SEPARATOR_FOR_NAMED_PARAMETER = new ParserE rrorCode.con3('WRONG_SEPARATOR_FOR_NAMED_PARAMETER', 117, "The default value of a named parameter should be preceeded by ':'"); 5781 static final ParserErrorCode WITH_BEFORE_EXTENDS = new ParserErrorCode.con3('W ITH_BEFORE_EXTENDS', 117, "The extends clause must be before the with clause");
5721 static final ParserErrorCode WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER = new Pa rserErrorCode.con3('WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER', 118, "The default value of a positional parameter should be preceeded by '='"); 5782 static final ParserErrorCode WITH_WITHOUT_EXTENDS = new ParserErrorCode.con3(' WITH_WITHOUT_EXTENDS', 118, "The with clause cannot be used without an extends c lause");
5722 static final ParserErrorCode WRONG_TERMINATOR_FOR_PARAMETER_GROUP = new Parser ErrorCode.con3('WRONG_TERMINATOR_FOR_PARAMETER_GROUP', 119, "Expected '%s' to cl ose parameter group"); 5783 static final ParserErrorCode WRONG_SEPARATOR_FOR_NAMED_PARAMETER = new ParserE rrorCode.con3('WRONG_SEPARATOR_FOR_NAMED_PARAMETER', 119, "The default value of a named parameter should be preceeded by ':'");
5723 static final ParserErrorCode VAR_AND_TYPE = new ParserErrorCode.con3('VAR_AND_ TYPE', 120, "Variables cannot be declared using both 'var' and a type name; remo ve the 'var'"); 5784 static final ParserErrorCode WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER = new Pa rserErrorCode.con3('WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER', 120, "The default value of a positional parameter should be preceeded by '='");
5724 static final ParserErrorCode VAR_AS_TYPE_NAME = new ParserErrorCode.con3('VAR_ AS_TYPE_NAME', 121, "The keyword 'var' cannot be used as a type name"); 5785 static final ParserErrorCode WRONG_TERMINATOR_FOR_PARAMETER_GROUP = new Parser ErrorCode.con3('WRONG_TERMINATOR_FOR_PARAMETER_GROUP', 121, "Expected '%s' to cl ose parameter group");
5725 static final ParserErrorCode VAR_CLASS = new ParserErrorCode.con3('VAR_CLASS', 122, "Classes cannot be declared to be 'var'"); 5786 static final ParserErrorCode VAR_AND_TYPE = new ParserErrorCode.con3('VAR_AND_ TYPE', 122, "Variables cannot be declared using both 'var' and a type name; remo ve the 'var'");
5726 static final ParserErrorCode VAR_RETURN_TYPE = new ParserErrorCode.con3('VAR_R ETURN_TYPE', 123, "The return type cannot be 'var'"); 5787 static final ParserErrorCode VAR_AS_TYPE_NAME = new ParserErrorCode.con3('VAR_ AS_TYPE_NAME', 123, "The keyword 'var' cannot be used as a type name");
5727 static final ParserErrorCode VAR_TYPEDEF = new ParserErrorCode.con3('VAR_TYPED EF', 124, "Type aliases cannot be declared to be 'var'"); 5788 static final ParserErrorCode VAR_CLASS = new ParserErrorCode.con3('VAR_CLASS', 124, "Classes cannot be declared to be 'var'");
5728 static final ParserErrorCode VOID_PARAMETER = new ParserErrorCode.con3('VOID_P ARAMETER', 125, "Parameters cannot have a type of 'void'"); 5789 static final ParserErrorCode VAR_RETURN_TYPE = new ParserErrorCode.con3('VAR_R ETURN_TYPE', 125, "The return type cannot be 'var'");
5729 static final ParserErrorCode VOID_VARIABLE = new ParserErrorCode.con3('VOID_VA RIABLE', 126, "Variables cannot have a type of 'void'"); 5790 static final ParserErrorCode VAR_TYPEDEF = new ParserErrorCode.con3('VAR_TYPED EF', 126, "Type aliases cannot be declared to be 'var'");
5791 static final ParserErrorCode VOID_PARAMETER = new ParserErrorCode.con3('VOID_P ARAMETER', 127, "Parameters cannot have a type of 'void'");
5792 static final ParserErrorCode VOID_VARIABLE = new ParserErrorCode.con3('VOID_VA RIABLE', 128, "Variables cannot have a type of 'void'");
5730 static final List<ParserErrorCode> values = [ 5793 static final List<ParserErrorCode> values = [
5731 ABSTRACT_CLASS_MEMBER, 5794 ABSTRACT_CLASS_MEMBER,
5732 ABSTRACT_STATIC_METHOD, 5795 ABSTRACT_STATIC_METHOD,
5733 ABSTRACT_TOP_LEVEL_FUNCTION, 5796 ABSTRACT_TOP_LEVEL_FUNCTION,
5734 ABSTRACT_TOP_LEVEL_VARIABLE, 5797 ABSTRACT_TOP_LEVEL_VARIABLE,
5735 ABSTRACT_TYPEDEF, 5798 ABSTRACT_TYPEDEF,
5736 BREAK_OUTSIDE_OF_LOOP, 5799 BREAK_OUTSIDE_OF_LOOP,
5737 CONST_AND_FINAL, 5800 CONST_AND_FINAL,
5738 CONST_AND_VAR, 5801 CONST_AND_VAR,
5739 CONST_CLASS, 5802 CONST_CLASS,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
5772 EXTERNAL_TYPEDEF, 5835 EXTERNAL_TYPEDEF,
5773 FACTORY_TOP_LEVEL_DECLARATION, 5836 FACTORY_TOP_LEVEL_DECLARATION,
5774 FACTORY_WITHOUT_BODY, 5837 FACTORY_WITHOUT_BODY,
5775 FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, 5838 FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR,
5776 FINAL_AND_VAR, 5839 FINAL_AND_VAR,
5777 FINAL_CLASS, 5840 FINAL_CLASS,
5778 FINAL_CONSTRUCTOR, 5841 FINAL_CONSTRUCTOR,
5779 FINAL_METHOD, 5842 FINAL_METHOD,
5780 FINAL_TYPEDEF, 5843 FINAL_TYPEDEF,
5781 FUNCTION_TYPED_PARAMETER_VAR, 5844 FUNCTION_TYPED_PARAMETER_VAR,
5845 GETTER_IN_FUNCTION,
5782 GETTER_WITH_PARAMETERS, 5846 GETTER_WITH_PARAMETERS,
5783 ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, 5847 ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE,
5784 IMPLEMENTS_BEFORE_EXTENDS, 5848 IMPLEMENTS_BEFORE_EXTENDS,
5785 IMPLEMENTS_BEFORE_WITH, 5849 IMPLEMENTS_BEFORE_WITH,
5786 IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, 5850 IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE,
5787 INITIALIZED_VARIABLE_IN_FOR_EACH, 5851 INITIALIZED_VARIABLE_IN_FOR_EACH,
5788 INVALID_CODE_POINT, 5852 INVALID_CODE_POINT,
5789 INVALID_COMMENT_REFERENCE, 5853 INVALID_COMMENT_REFERENCE,
5790 INVALID_HEX_ESCAPE, 5854 INVALID_HEX_ESCAPE,
5791 INVALID_OPERATOR, 5855 INVALID_OPERATOR,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
5823 NATIVE_CLAUSE_IN_NON_SDK_CODE, 5887 NATIVE_CLAUSE_IN_NON_SDK_CODE,
5824 NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE, 5888 NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE,
5825 NON_CONSTRUCTOR_FACTORY, 5889 NON_CONSTRUCTOR_FACTORY,
5826 NON_IDENTIFIER_LIBRARY_NAME, 5890 NON_IDENTIFIER_LIBRARY_NAME,
5827 NON_PART_OF_DIRECTIVE_IN_PART, 5891 NON_PART_OF_DIRECTIVE_IN_PART,
5828 NON_USER_DEFINABLE_OPERATOR, 5892 NON_USER_DEFINABLE_OPERATOR,
5829 NORMAL_BEFORE_OPTIONAL_PARAMETERS, 5893 NORMAL_BEFORE_OPTIONAL_PARAMETERS,
5830 POSITIONAL_AFTER_NAMED_ARGUMENT, 5894 POSITIONAL_AFTER_NAMED_ARGUMENT,
5831 POSITIONAL_PARAMETER_OUTSIDE_GROUP, 5895 POSITIONAL_PARAMETER_OUTSIDE_GROUP,
5832 REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR, 5896 REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR,
5897 SETTER_IN_FUNCTION,
5833 STATIC_AFTER_CONST, 5898 STATIC_AFTER_CONST,
5834 STATIC_AFTER_FINAL, 5899 STATIC_AFTER_FINAL,
5835 STATIC_AFTER_VAR, 5900 STATIC_AFTER_VAR,
5836 STATIC_CONSTRUCTOR, 5901 STATIC_CONSTRUCTOR,
5837 STATIC_GETTER_WITHOUT_BODY, 5902 STATIC_GETTER_WITHOUT_BODY,
5838 STATIC_OPERATOR, 5903 STATIC_OPERATOR,
5839 STATIC_SETTER_WITHOUT_BODY, 5904 STATIC_SETTER_WITHOUT_BODY,
5840 STATIC_TOP_LEVEL_DECLARATION, 5905 STATIC_TOP_LEVEL_DECLARATION,
5841 SWITCH_HAS_CASE_AFTER_DEFAULT_CASE, 5906 SWITCH_HAS_CASE_AFTER_DEFAULT_CASE,
5842 SWITCH_HAS_MULTIPLE_DEFAULT_CASES, 5907 SWITCH_HAS_MULTIPLE_DEFAULT_CASES,
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
6203 } 6268 }
6204 Object visitFieldFormalParameter(FieldFormalParameter node) { 6269 Object visitFieldFormalParameter(FieldFormalParameter node) {
6205 visit8(node.keyword, " "); 6270 visit8(node.keyword, " ");
6206 visit6(node.type, " "); 6271 visit6(node.type, " ");
6207 _writer.print("this."); 6272 _writer.print("this.");
6208 visit(node.identifier); 6273 visit(node.identifier);
6209 visit(node.parameters); 6274 visit(node.parameters);
6210 return null; 6275 return null;
6211 } 6276 }
6212 Object visitForEachStatement(ForEachStatement node) { 6277 Object visitForEachStatement(ForEachStatement node) {
6278 DeclaredIdentifier loopVariable = node.loopVariable;
6213 _writer.print("for ("); 6279 _writer.print("for (");
6214 visit(node.loopVariable); 6280 if (loopVariable == null) {
6281 visit(node.identifier);
6282 } else {
6283 visit(loopVariable);
6284 }
6215 _writer.print(" in "); 6285 _writer.print(" in ");
6216 visit(node.iterator); 6286 visit(node.iterator);
6217 _writer.print(") "); 6287 _writer.print(") ");
6218 visit(node.body); 6288 visit(node.body);
6219 return null; 6289 return null;
6220 } 6290 }
6221 Object visitFormalParameterList(FormalParameterList node) { 6291 Object visitFormalParameterList(FormalParameterList node) {
6222 String groupEnd = null; 6292 String groupEnd = null;
6223 _writer.print('('); 6293 _writer.print('(');
6224 NodeList<FormalParameter> parameters = node.parameters; 6294 NodeList<FormalParameter> parameters = node.parameters;
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
6845 if ("\n" == separator) { 6915 if ("\n" == separator) {
6846 _writer.print("\n"); 6916 _writer.print("\n");
6847 indent(); 6917 indent();
6848 } else if (i > 0) { 6918 } else if (i > 0) {
6849 _writer.print(separator); 6919 _writer.print(separator);
6850 } 6920 }
6851 _writer.print(tokens[i].lexeme); 6921 _writer.print(tokens[i].lexeme);
6852 } 6922 }
6853 } 6923 }
6854 } 6924 }
OLDNEW
« no previous file with comments | « pkg/analyzer_experimental/lib/src/generated/java_core.dart ('k') | pkg/analyzer_experimental/lib/src/generated/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698