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

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

Issue 18129004: Simplify constructors translation, improve code style. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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.scanner; 3 library engine.scanner;
4 import 'dart:collection'; 4 import 'dart:collection';
5 import 'java_core.dart'; 5 import 'java_core.dart';
6 import 'java_engine.dart'; 6 import 'java_engine.dart';
7 import 'source.dart'; 7 import 'source.dart';
8 import 'error.dart'; 8 import 'error.dart';
9 import 'instrumentation.dart'; 9 import 'instrumentation.dart';
10 /** 10 /**
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 } 287 }
288 return result; 288 return result;
289 } 289 }
290 290
291 /** 291 /**
292 * Initialize a newly created keyword to have the given syntax. The keyword is not a 292 * Initialize a newly created keyword to have the given syntax. The keyword is not a
293 * pseudo-keyword. 293 * pseudo-keyword.
294 * 294 *
295 * @param syntax the lexeme for the keyword 295 * @param syntax the lexeme for the keyword
296 */ 296 */
297 Keyword.con1(this.name, this.ordinal, String syntax) { 297 Keyword.con1(String name, int ordinal, String syntax) : this.con2(name, ordina l, syntax, false);
298 _jtd_constructor_323_impl(syntax);
299 }
300 _jtd_constructor_323_impl(String syntax) {
301 _jtd_constructor_324_impl(syntax, false);
302 }
303 298
304 /** 299 /**
305 * Initialize a newly created keyword to have the given syntax. The keyword is a pseudo-keyword if 300 * Initialize a newly created keyword to have the given syntax. The keyword is a pseudo-keyword if
306 * the given flag is `true`. 301 * the given flag is `true`.
307 * 302 *
308 * @param syntax the lexeme for the keyword 303 * @param syntax the lexeme for the keyword
309 * @param isPseudoKeyword `true` if this keyword is a pseudo-keyword 304 * @param isPseudoKeyword `true` if this keyword is a pseudo-keyword
310 */ 305 */
311 Keyword.con2(this.name, this.ordinal, String syntax2, bool isPseudoKeyword) { 306 Keyword.con2(this.name, this.ordinal, String syntax, bool isPseudoKeyword) {
312 _jtd_constructor_324_impl(syntax2, isPseudoKeyword); 307 this._syntax = syntax;
313 }
314 _jtd_constructor_324_impl(String syntax2, bool isPseudoKeyword) {
315 this._syntax = syntax2;
316 this._isPseudoKeyword2 = isPseudoKeyword; 308 this._isPseudoKeyword2 = isPseudoKeyword;
317 } 309 }
318 310
319 /** 311 /**
320 * Return the lexeme for the keyword. 312 * Return the lexeme for the keyword.
321 * 313 *
322 * @return the lexeme for the keyword 314 * @return the lexeme for the keyword
323 */ 315 */
324 String get syntax => _syntax; 316 String get syntax => _syntax;
325 317
(...skipping 1514 matching lines...) Expand 10 before | Expand all | Expand 10 after
1840 final String name; 1832 final String name;
1841 1833
1842 /// The position in the enum declaration. 1834 /// The position in the enum declaration.
1843 final int ordinal; 1835 final int ordinal;
1844 1836
1845 /** 1837 /**
1846 * The precedence of tokens of this class, or `0` if the such tokens do not re present an 1838 * The precedence of tokens of this class, or `0` if the such tokens do not re present an
1847 * operator. 1839 * operator.
1848 */ 1840 */
1849 int _precedence = 0; 1841 int _precedence = 0;
1850 TokenClass.con1(this.name, this.ordinal) { 1842 TokenClass.con1(String name, int ordinal) : this.con2(name, ordinal, 0);
1851 _jtd_constructor_333_impl(); 1843 TokenClass.con2(this.name, this.ordinal, int precedence) {
1852 } 1844 this._precedence = precedence;
1853 _jtd_constructor_333_impl() {
1854 _jtd_constructor_334_impl(0);
1855 }
1856 TokenClass.con2(this.name, this.ordinal, int precedence2) {
1857 _jtd_constructor_334_impl(precedence2);
1858 }
1859 _jtd_constructor_334_impl(int precedence2) {
1860 this._precedence = precedence2;
1861 } 1845 }
1862 1846
1863 /** 1847 /**
1864 * Return the precedence of tokens of this class, or `0` if the such tokens do not represent 1848 * Return the precedence of tokens of this class, or `0` if the such tokens do not represent
1865 * an operator. 1849 * an operator.
1866 * 1850 *
1867 * @return the precedence of tokens of this class 1851 * @return the precedence of tokens of this class
1868 */ 1852 */
1869 int get precedence => _precedence; 1853 int get precedence => _precedence;
1870 int compareTo(TokenClass other) => ordinal - other.ordinal; 1854 int compareTo(TokenClass other) => ordinal - other.ordinal;
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1987 /** 1971 /**
1988 * The class of the token. 1972 * The class of the token.
1989 */ 1973 */
1990 TokenClass _tokenClass; 1974 TokenClass _tokenClass;
1991 1975
1992 /** 1976 /**
1993 * The lexeme that defines this type of token, or `null` if there is more than one possible 1977 * The lexeme that defines this type of token, or `null` if there is more than one possible
1994 * lexeme for this type of token. 1978 * lexeme for this type of token.
1995 */ 1979 */
1996 String _lexeme; 1980 String _lexeme;
1997 TokenType.con1(this.name, this.ordinal) { 1981 TokenType.con1(String name, int ordinal) : this.con2(name, ordinal, TokenClass .NO_CLASS, null);
1998 _jtd_constructor_335_impl(); 1982 TokenType.con2(this.name, this.ordinal, TokenClass tokenClass, String lexeme) {
1999 } 1983 this._tokenClass = tokenClass == null ? TokenClass.NO_CLASS : tokenClass;
2000 _jtd_constructor_335_impl() { 1984 this._lexeme = lexeme;
2001 _jtd_constructor_336_impl(TokenClass.NO_CLASS, null);
2002 }
2003 TokenType.con2(this.name, this.ordinal, TokenClass tokenClass2, String lexeme2 ) {
2004 _jtd_constructor_336_impl(tokenClass2, lexeme2);
2005 }
2006 _jtd_constructor_336_impl(TokenClass tokenClass2, String lexeme2) {
2007 this._tokenClass = tokenClass2 == null ? TokenClass.NO_CLASS : tokenClass2;
2008 this._lexeme = lexeme2;
2009 } 1985 }
2010 1986
2011 /** 1987 /**
2012 * Return the lexeme that defines this type of token, or `null` if there is mo re than one 1988 * Return the lexeme that defines this type of token, or `null` if there is mo re than one
2013 * possible lexeme for this type of token. 1989 * possible lexeme for this type of token.
2014 * 1990 *
2015 * @return the lexeme that defines this type of token 1991 * @return the lexeme that defines this type of token
2016 */ 1992 */
2017 String get lexeme => _lexeme; 1993 String get lexeme => _lexeme;
2018 1994
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
2114 */ 2090 */
2115 bool get isUserDefinableOperator => identical(_lexeme, "==") || identical(_lex eme, "~") || identical(_lexeme, "[]") || identical(_lexeme, "[]=") || identical( _lexeme, "*") || identical(_lexeme, "/") || identical(_lexeme, "%") || identical (_lexeme, "~/") || identical(_lexeme, "+") || identical(_lexeme, "-") || identic al(_lexeme, "<<") || identical(_lexeme, ">>") || identical(_lexeme, ">=") || ide ntical(_lexeme, ">") || identical(_lexeme, "<=") || identical(_lexeme, "<") || i dentical(_lexeme, "&") || identical(_lexeme, "^") || identical(_lexeme, "|"); 2091 bool get isUserDefinableOperator => identical(_lexeme, "==") || identical(_lex eme, "~") || identical(_lexeme, "[]") || identical(_lexeme, "[]=") || identical( _lexeme, "*") || identical(_lexeme, "/") || identical(_lexeme, "%") || identical (_lexeme, "~/") || identical(_lexeme, "+") || identical(_lexeme, "-") || identic al(_lexeme, "<<") || identical(_lexeme, ">>") || identical(_lexeme, ">=") || ide ntical(_lexeme, ">") || identical(_lexeme, "<=") || identical(_lexeme, "<") || i dentical(_lexeme, "&") || identical(_lexeme, "^") || identical(_lexeme, "|");
2116 int compareTo(TokenType other) => ordinal - other.ordinal; 2092 int compareTo(TokenType other) => ordinal - other.ordinal;
2117 int get hashCode => ordinal; 2093 int get hashCode => ordinal;
2118 String toString() => name; 2094 String toString() => name;
2119 } 2095 }
2120 class TokenType_EOF extends TokenType { 2096 class TokenType_EOF extends TokenType {
2121 TokenType_EOF(String name, int ordinal, TokenClass arg0, String arg1) : super. con2(name, ordinal, arg0, arg1); 2097 TokenType_EOF(String name, int ordinal, TokenClass arg0, String arg1) : super. con2(name, ordinal, arg0, arg1);
2122 String toString() => "-eof-"; 2098 String toString() => "-eof-";
2123 } 2099 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698