| OLD | NEW |
| 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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 * Return the lexeme for the keyword. | 304 * Return the lexeme for the keyword. |
| 305 * @return the lexeme for the keyword | 305 * @return the lexeme for the keyword |
| 306 */ | 306 */ |
| 307 String get syntax => _syntax; | 307 String get syntax => _syntax; |
| 308 | 308 |
| 309 /** | 309 /** |
| 310 * Return `true` if this keyword is a pseudo-keyword. Pseudo keywords can be u
sed as | 310 * Return `true` if this keyword is a pseudo-keyword. Pseudo keywords can be u
sed as |
| 311 * identifiers. | 311 * identifiers. |
| 312 * @return `true` if this keyword is a pseudo-keyword | 312 * @return `true` if this keyword is a pseudo-keyword |
| 313 */ | 313 */ |
| 314 bool isPseudoKeyword() => _isPseudoKeyword2; | 314 bool get isPseudoKeyword => _isPseudoKeyword2; |
| 315 int compareTo(Keyword other) => ordinal - other.ordinal; | 315 int compareTo(Keyword other) => ordinal - other.ordinal; |
| 316 int get hashCode => ordinal; | 316 int get hashCode => ordinal; |
| 317 String toString() => name; | 317 String toString() => name; |
| 318 } | 318 } |
| 319 /** | 319 /** |
| 320 * The abstract class `AbstractScanner` implements a scanner for Dart code. Subc
lasses are | 320 * The abstract class `AbstractScanner` implements a scanner for Dart code. Subc
lasses are |
| 321 * required to implement the interface used to access the characters being scann
ed. | 321 * required to implement the interface used to access the characters being scann
ed. |
| 322 * | 322 * |
| 323 * The lexical structure of Dart is ambiguous without knowledge of the context i
n which a token is | 323 * The lexical structure of Dart is ambiguous without knowledge of the context i
n which a token is |
| 324 * being scanned. For example, without context we cannot determine whether sourc
e of the form "<<" | 324 * being scanned. For example, without context we cannot determine whether sourc
e of the form "<<" |
| (...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1453 /** | 1453 /** |
| 1454 * Return the type of the token. | 1454 * Return the type of the token. |
| 1455 * @return the type of the token | 1455 * @return the type of the token |
| 1456 */ | 1456 */ |
| 1457 TokenType get type => _type; | 1457 TokenType get type => _type; |
| 1458 | 1458 |
| 1459 /** | 1459 /** |
| 1460 * Return `true` if this token represents an operator. | 1460 * Return `true` if this token represents an operator. |
| 1461 * @return `true` if this token represents an operator | 1461 * @return `true` if this token represents an operator |
| 1462 */ | 1462 */ |
| 1463 bool isOperator() => _type.isOperator(); | 1463 bool get isOperator => _type.isOperator; |
| 1464 | 1464 |
| 1465 /** | 1465 /** |
| 1466 * Return `true` if this token is a synthetic token. A synthetic token is a to
ken that was | 1466 * Return `true` if this token is a synthetic token. A synthetic token is a to
ken that was |
| 1467 * introduced by the parser in order to recover from an error in the code. Syn
thetic tokens always | 1467 * introduced by the parser in order to recover from an error in the code. Syn
thetic tokens always |
| 1468 * have a length of zero (`0`). | 1468 * have a length of zero (`0`). |
| 1469 * @return `true` if this token is a synthetic token | 1469 * @return `true` if this token is a synthetic token |
| 1470 */ | 1470 */ |
| 1471 bool isSynthetic() => length == 0; | 1471 bool get isSynthetic => length == 0; |
| 1472 | 1472 |
| 1473 /** | 1473 /** |
| 1474 * Return `true` if this token represents an operator that can be defined by u
sers. | 1474 * Return `true` if this token represents an operator that can be defined by u
sers. |
| 1475 * @return `true` if this token represents an operator that can be defined by
users | 1475 * @return `true` if this token represents an operator that can be defined by
users |
| 1476 */ | 1476 */ |
| 1477 bool isUserDefinableOperator() => _type.isUserDefinableOperator(); | 1477 bool get isUserDefinableOperator => _type.isUserDefinableOperator; |
| 1478 | 1478 |
| 1479 /** | 1479 /** |
| 1480 * Set the next token in the token stream to the given token. This has the sid
e-effect of setting | 1480 * Set the next token in the token stream to the given token. This has the sid
e-effect of setting |
| 1481 * this token to be the previous token for the given token. | 1481 * this token to be the previous token for the given token. |
| 1482 * @param token the next token in the token stream | 1482 * @param token the next token in the token stream |
| 1483 * @return the token that was passed in | 1483 * @return the token that was passed in |
| 1484 */ | 1484 */ |
| 1485 Token setNext(Token token) { | 1485 Token setNext(Token token) { |
| 1486 _next = token; | 1486 _next = token; |
| 1487 token.previous = this; | 1487 token.previous = this; |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1955 /** | 1955 /** |
| 1956 * Return the precedence of the token, or `0` if the token does not represent
an operator. | 1956 * Return the precedence of the token, or `0` if the token does not represent
an operator. |
| 1957 * @return the precedence of the token | 1957 * @return the precedence of the token |
| 1958 */ | 1958 */ |
| 1959 int get precedence => _tokenClass.precedence; | 1959 int get precedence => _tokenClass.precedence; |
| 1960 | 1960 |
| 1961 /** | 1961 /** |
| 1962 * Return `true` if this type of token represents an additive operator. | 1962 * Return `true` if this type of token represents an additive operator. |
| 1963 * @return `true` if this type of token represents an additive operator | 1963 * @return `true` if this type of token represents an additive operator |
| 1964 */ | 1964 */ |
| 1965 bool isAdditiveOperator() => identical(_tokenClass, TokenClass.ADDITIVE_OPERAT
OR); | 1965 bool get isAdditiveOperator => identical(_tokenClass, TokenClass.ADDITIVE_OPER
ATOR); |
| 1966 | 1966 |
| 1967 /** | 1967 /** |
| 1968 * Return `true` if this type of token represents an assignment operator. | 1968 * Return `true` if this type of token represents an assignment operator. |
| 1969 * @return `true` if this type of token represents an assignment operator | 1969 * @return `true` if this type of token represents an assignment operator |
| 1970 */ | 1970 */ |
| 1971 bool isAssignmentOperator() => identical(_tokenClass, TokenClass.ASSIGNMENT_OP
ERATOR); | 1971 bool get isAssignmentOperator => identical(_tokenClass, TokenClass.ASSIGNMENT_
OPERATOR); |
| 1972 | 1972 |
| 1973 /** | 1973 /** |
| 1974 * Return `true` if this type of token represents an associative operator. An
associative | 1974 * Return `true` if this type of token represents an associative operator. An
associative |
| 1975 * operator is an operator for which the following equality is true:`(a * b) *
c == a * (b * c)`. In other words, if the result of applying the operator to | 1975 * operator is an operator for which the following equality is true:`(a * b) *
c == a * (b * c)`. In other words, if the result of applying the operator to |
| 1976 * multiple operands does not depend on the order in which those applications
occur. | 1976 * multiple operands does not depend on the order in which those applications
occur. |
| 1977 * | 1977 * |
| 1978 * Note: This method considers the logical-and and logical-or operators to be
associative, even | 1978 * Note: This method considers the logical-and and logical-or operators to be
associative, even |
| 1979 * though the order in which the application of those operators can have an ef
fect because | 1979 * though the order in which the application of those operators can have an ef
fect because |
| 1980 * evaluation of the right-hand operand is conditional. | 1980 * evaluation of the right-hand operand is conditional. |
| 1981 * @return `true` if this type of token represents an associative operator | 1981 * @return `true` if this type of token represents an associative operator |
| 1982 */ | 1982 */ |
| 1983 bool isAssociativeOperator() => identical(this, AMPERSAND) || identical(this,
AMPERSAND_AMPERSAND) || identical(this, BAR) || identical(this, BAR_BAR) || iden
tical(this, CARET) || identical(this, PLUS) || identical(this, STAR); | 1983 bool get isAssociativeOperator => identical(this, AMPERSAND) || identical(this
, AMPERSAND_AMPERSAND) || identical(this, BAR) || identical(this, BAR_BAR) || id
entical(this, CARET) || identical(this, PLUS) || identical(this, STAR); |
| 1984 | 1984 |
| 1985 /** | 1985 /** |
| 1986 * Return `true` if this type of token represents an equality operator. | 1986 * Return `true` if this type of token represents an equality operator. |
| 1987 * @return `true` if this type of token represents an equality operator | 1987 * @return `true` if this type of token represents an equality operator |
| 1988 */ | 1988 */ |
| 1989 bool isEqualityOperator() => identical(_tokenClass, TokenClass.EQUALITY_OPERAT
OR); | 1989 bool get isEqualityOperator => identical(_tokenClass, TokenClass.EQUALITY_OPER
ATOR); |
| 1990 | 1990 |
| 1991 /** | 1991 /** |
| 1992 * Return `true` if this type of token represents an increment operator. | 1992 * Return `true` if this type of token represents an increment operator. |
| 1993 * @return `true` if this type of token represents an increment operator | 1993 * @return `true` if this type of token represents an increment operator |
| 1994 */ | 1994 */ |
| 1995 bool isIncrementOperator() => identical(_lexeme, "++") || identical(_lexeme, "
--"); | 1995 bool get isIncrementOperator => identical(_lexeme, "++") || identical(_lexeme,
"--"); |
| 1996 | 1996 |
| 1997 /** | 1997 /** |
| 1998 * Return `true` if this type of token represents a multiplicative operator. | 1998 * Return `true` if this type of token represents a multiplicative operator. |
| 1999 * @return `true` if this type of token represents a multiplicative operator | 1999 * @return `true` if this type of token represents a multiplicative operator |
| 2000 */ | 2000 */ |
| 2001 bool isMultiplicativeOperator() => identical(_tokenClass, TokenClass.MULTIPLIC
ATIVE_OPERATOR); | 2001 bool get isMultiplicativeOperator => identical(_tokenClass, TokenClass.MULTIPL
ICATIVE_OPERATOR); |
| 2002 | 2002 |
| 2003 /** | 2003 /** |
| 2004 * Return `true` if this token type represents an operator. | 2004 * Return `true` if this token type represents an operator. |
| 2005 * @return `true` if this token type represents an operator | 2005 * @return `true` if this token type represents an operator |
| 2006 */ | 2006 */ |
| 2007 bool isOperator() => _tokenClass != TokenClass.NO_CLASS && this != OPEN_PAREN
&& this != OPEN_SQUARE_BRACKET && this != PERIOD; | 2007 bool get isOperator => _tokenClass != TokenClass.NO_CLASS && this != OPEN_PARE
N && this != OPEN_SQUARE_BRACKET && this != PERIOD; |
| 2008 | 2008 |
| 2009 /** | 2009 /** |
| 2010 * Return `true` if this type of token represents a relational operator. | 2010 * Return `true` if this type of token represents a relational operator. |
| 2011 * @return `true` if this type of token represents a relational operator | 2011 * @return `true` if this type of token represents a relational operator |
| 2012 */ | 2012 */ |
| 2013 bool isRelationalOperator() => identical(_tokenClass, TokenClass.RELATIONAL_OP
ERATOR); | 2013 bool get isRelationalOperator => identical(_tokenClass, TokenClass.RELATIONAL_
OPERATOR); |
| 2014 | 2014 |
| 2015 /** | 2015 /** |
| 2016 * Return `true` if this type of token represents a shift operator. | 2016 * Return `true` if this type of token represents a shift operator. |
| 2017 * @return `true` if this type of token represents a shift operator | 2017 * @return `true` if this type of token represents a shift operator |
| 2018 */ | 2018 */ |
| 2019 bool isShiftOperator() => identical(_tokenClass, TokenClass.SHIFT_OPERATOR); | 2019 bool get isShiftOperator => identical(_tokenClass, TokenClass.SHIFT_OPERATOR); |
| 2020 | 2020 |
| 2021 /** | 2021 /** |
| 2022 * Return `true` if this type of token represents a unary postfix operator. | 2022 * Return `true` if this type of token represents a unary postfix operator. |
| 2023 * @return `true` if this type of token represents a unary postfix operator | 2023 * @return `true` if this type of token represents a unary postfix operator |
| 2024 */ | 2024 */ |
| 2025 bool isUnaryPostfixOperator() => identical(_tokenClass, TokenClass.UNARY_POSTF
IX_OPERATOR); | 2025 bool get isUnaryPostfixOperator => identical(_tokenClass, TokenClass.UNARY_POS
TFIX_OPERATOR); |
| 2026 | 2026 |
| 2027 /** | 2027 /** |
| 2028 * Return `true` if this type of token represents a unary prefix operator. | 2028 * Return `true` if this type of token represents a unary prefix operator. |
| 2029 * @return `true` if this type of token represents a unary prefix operator | 2029 * @return `true` if this type of token represents a unary prefix operator |
| 2030 */ | 2030 */ |
| 2031 bool isUnaryPrefixOperator() => identical(_tokenClass, TokenClass.UNARY_PREFIX
_OPERATOR); | 2031 bool get isUnaryPrefixOperator => identical(_tokenClass, TokenClass.UNARY_PREF
IX_OPERATOR); |
| 2032 | 2032 |
| 2033 /** | 2033 /** |
| 2034 * Return `true` if this token type represents an operator that can be defined
by users. | 2034 * Return `true` if this token type represents an operator that can be defined
by users. |
| 2035 * @return `true` if this token type represents an operator that can be define
d by users | 2035 * @return `true` if this token type represents an operator that can be define
d by users |
| 2036 */ | 2036 */ |
| 2037 bool isUserDefinableOperator() => identical(_lexeme, "==") || identical(_lexem
e, "~") || identical(_lexeme, "[]") || identical(_lexeme, "[]=") || identical(_l
exeme, "*") || identical(_lexeme, "/") || identical(_lexeme, "%") || identical(_
lexeme, "~/") || identical(_lexeme, "+") || identical(_lexeme, "-") || identical
(_lexeme, "<<") || identical(_lexeme, ">>") || identical(_lexeme, ">=") || ident
ical(_lexeme, ">") || identical(_lexeme, "<=") || identical(_lexeme, "<") || ide
ntical(_lexeme, "&") || identical(_lexeme, "^") || identical(_lexeme, "|"); | 2037 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, "|"); |
| 2038 int compareTo(TokenType other) => ordinal - other.ordinal; | 2038 int compareTo(TokenType other) => ordinal - other.ordinal; |
| 2039 int get hashCode => ordinal; | 2039 int get hashCode => ordinal; |
| 2040 String toString() => name; | 2040 String toString() => name; |
| 2041 } | 2041 } |
| 2042 class TokenType_EOF extends TokenType { | 2042 class TokenType_EOF extends TokenType { |
| 2043 TokenType_EOF(String name, int ordinal, TokenClass arg0, String arg1) : super.
con2(name, ordinal, arg0, arg1); | 2043 TokenType_EOF(String name, int ordinal, TokenClass arg0, String arg1) : super.
con2(name, ordinal, arg0, arg1); |
| 2044 String toString() => "-eof-"; | 2044 String toString() => "-eof-"; |
| 2045 } | 2045 } |
| OLD | NEW |