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 | 3 |
4 library engine.scanner; | 4 library engine.scanner; |
5 | 5 |
6 import 'dart:collection'; | 6 import 'dart:collection'; |
7 import 'java_core.dart'; | 7 import 'java_core.dart'; |
8 import 'source.dart'; | 8 import 'source.dart'; |
9 import 'error.dart'; | 9 import 'error.dart'; |
10 import 'instrumentation.dart'; | 10 import 'instrumentation.dart'; |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 result[keyword._syntax] = keyword; | 248 result[keyword._syntax] = keyword; |
249 } | 249 } |
250 return result; | 250 return result; |
251 } | 251 } |
252 /** | 252 /** |
253 * Initialize a newly created keyword to have the given syntax. The keyword is
not a | 253 * Initialize a newly created keyword to have the given syntax. The keyword is
not a |
254 * pseudo-keyword. | 254 * pseudo-keyword. |
255 * @param syntax the lexeme for the keyword | 255 * @param syntax the lexeme for the keyword |
256 */ | 256 */ |
257 Keyword.con1(String ___name, int ___ordinal, String syntax) { | 257 Keyword.con1(String ___name, int ___ordinal, String syntax) { |
258 _jtd_constructor_265_impl(___name, ___ordinal, syntax); | 258 _jtd_constructor_276_impl(___name, ___ordinal, syntax); |
259 } | 259 } |
260 _jtd_constructor_265_impl(String ___name, int ___ordinal, String syntax) { | 260 _jtd_constructor_276_impl(String ___name, int ___ordinal, String syntax) { |
261 _jtd_constructor_266_impl(___name, ___ordinal, syntax, false); | 261 _jtd_constructor_277_impl(___name, ___ordinal, syntax, false); |
262 } | 262 } |
263 /** | 263 /** |
264 * Initialize a newly created keyword to have the given syntax. The keyword is
a pseudo-keyword if | 264 * Initialize a newly created keyword to have the given syntax. The keyword is
a pseudo-keyword if |
265 * the given flag is {@code true}. | 265 * the given flag is {@code true}. |
266 * @param syntax the lexeme for the keyword | 266 * @param syntax the lexeme for the keyword |
267 * @param isPseudoKeyword {@code true} if this keyword is a pseudo-keyword | 267 * @param isPseudoKeyword {@code true} if this keyword is a pseudo-keyword |
268 */ | 268 */ |
269 Keyword.con2(String ___name, int ___ordinal, String syntax2, bool isPseudoKeyw
ord) { | 269 Keyword.con2(String ___name, int ___ordinal, String syntax2, bool isPseudoKeyw
ord) { |
270 _jtd_constructor_266_impl(___name, ___ordinal, syntax2, isPseudoKeyword); | 270 _jtd_constructor_277_impl(___name, ___ordinal, syntax2, isPseudoKeyword); |
271 } | 271 } |
272 _jtd_constructor_266_impl(String ___name, int ___ordinal, String syntax2, bool
isPseudoKeyword) { | 272 _jtd_constructor_277_impl(String ___name, int ___ordinal, String syntax2, bool
isPseudoKeyword) { |
273 __name = ___name; | 273 __name = ___name; |
274 __ordinal = ___ordinal; | 274 __ordinal = ___ordinal; |
275 this._syntax = syntax2; | 275 this._syntax = syntax2; |
276 this._isPseudoKeyword2 = isPseudoKeyword; | 276 this._isPseudoKeyword2 = isPseudoKeyword; |
277 } | 277 } |
278 /** | 278 /** |
279 * Return the lexeme for the keyword. | 279 * Return the lexeme for the keyword. |
280 * @return the lexeme for the keyword | 280 * @return the lexeme for the keyword |
281 */ | 281 */ |
282 String get syntax => _syntax; | 282 String get syntax => _syntax; |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 _groupingStack.add(token); | 427 _groupingStack.add(token); |
428 } | 428 } |
429 void appendCommentToken(TokenType type, String value) { | 429 void appendCommentToken(TokenType type, String value) { |
430 if (_firstComment == null) { | 430 if (_firstComment == null) { |
431 _firstComment = new StringToken(type, value, _tokenStart); | 431 _firstComment = new StringToken(type, value, _tokenStart); |
432 _lastComment = _firstComment; | 432 _lastComment = _firstComment; |
433 } else { | 433 } else { |
434 _lastComment = _lastComment.setNext(new StringToken(type, value, _tokenSta
rt)); | 434 _lastComment = _lastComment.setNext(new StringToken(type, value, _tokenSta
rt)); |
435 } | 435 } |
436 } | 436 } |
437 void appendEndToken(TokenType type32, TokenType beginType) { | 437 void appendEndToken(TokenType type33, TokenType beginType) { |
438 Token token; | 438 Token token; |
439 if (_firstComment == null) { | 439 if (_firstComment == null) { |
440 token = new Token(type32, _tokenStart); | 440 token = new Token(type33, _tokenStart); |
441 } else { | 441 } else { |
442 token = new TokenWithComment(type32, _tokenStart, _firstComment); | 442 token = new TokenWithComment(type33, _tokenStart, _firstComment); |
443 _firstComment = null; | 443 _firstComment = null; |
444 _lastComment = null; | 444 _lastComment = null; |
445 } | 445 } |
446 _tail = _tail.setNext(token); | 446 _tail = _tail.setNext(token); |
447 int last = _groupingStack.length - 1; | 447 int last = _groupingStack.length - 1; |
448 if (last >= 0) { | 448 if (last >= 0) { |
449 BeginToken begin = _groupingStack[last]; | 449 BeginToken begin = _groupingStack[last]; |
450 if (identical(begin.type, beginType)) { | 450 if (identical(begin.type, beginType)) { |
451 begin.endToken = token; | 451 begin.endToken = token; |
452 _groupingStack.removeAt(last); | 452 _groupingStack.removeAt(last); |
(...skipping 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1647 static final List<TokenClass> values = [NO_CLASS, ADDITIVE_OPERATOR, ASSIGNMEN
T_OPERATOR, BITWISE_AND_OPERATOR, BITWISE_OR_OPERATOR, BITWISE_XOR_OPERATOR, CAS
CADE_OPERATOR, CONDITIONAL_OPERATOR, EQUALITY_OPERATOR, LOGICAL_AND_OPERATOR, LO
GICAL_OR_OPERATOR, MULTIPLICATIVE_OPERATOR, RELATIONAL_OPERATOR, SHIFT_OPERATOR,
UNARY_POSTFIX_OPERATOR, UNARY_PREFIX_OPERATOR]; | 1647 static final List<TokenClass> values = [NO_CLASS, ADDITIVE_OPERATOR, ASSIGNMEN
T_OPERATOR, BITWISE_AND_OPERATOR, BITWISE_OR_OPERATOR, BITWISE_XOR_OPERATOR, CAS
CADE_OPERATOR, CONDITIONAL_OPERATOR, EQUALITY_OPERATOR, LOGICAL_AND_OPERATOR, LO
GICAL_OR_OPERATOR, MULTIPLICATIVE_OPERATOR, RELATIONAL_OPERATOR, SHIFT_OPERATOR,
UNARY_POSTFIX_OPERATOR, UNARY_PREFIX_OPERATOR]; |
1648 String __name; | 1648 String __name; |
1649 int __ordinal = 0; | 1649 int __ordinal = 0; |
1650 int get ordinal => __ordinal; | 1650 int get ordinal => __ordinal; |
1651 /** | 1651 /** |
1652 * The precedence of tokens of this class, or {@code 0} if the such tokens do
not represent an | 1652 * The precedence of tokens of this class, or {@code 0} if the such tokens do
not represent an |
1653 * operator. | 1653 * operator. |
1654 */ | 1654 */ |
1655 int _precedence = 0; | 1655 int _precedence = 0; |
1656 TokenClass.con1(String ___name, int ___ordinal) { | 1656 TokenClass.con1(String ___name, int ___ordinal) { |
1657 _jtd_constructor_275_impl(___name, ___ordinal); | 1657 _jtd_constructor_286_impl(___name, ___ordinal); |
1658 } | 1658 } |
1659 _jtd_constructor_275_impl(String ___name, int ___ordinal) { | 1659 _jtd_constructor_286_impl(String ___name, int ___ordinal) { |
1660 _jtd_constructor_276_impl(___name, ___ordinal, 0); | 1660 _jtd_constructor_287_impl(___name, ___ordinal, 0); |
1661 } | 1661 } |
1662 TokenClass.con2(String ___name, int ___ordinal, int precedence2) { | 1662 TokenClass.con2(String ___name, int ___ordinal, int precedence2) { |
1663 _jtd_constructor_276_impl(___name, ___ordinal, precedence2); | 1663 _jtd_constructor_287_impl(___name, ___ordinal, precedence2); |
1664 } | 1664 } |
1665 _jtd_constructor_276_impl(String ___name, int ___ordinal, int precedence2) { | 1665 _jtd_constructor_287_impl(String ___name, int ___ordinal, int precedence2) { |
1666 __name = ___name; | 1666 __name = ___name; |
1667 __ordinal = ___ordinal; | 1667 __ordinal = ___ordinal; |
1668 this._precedence = precedence2; | 1668 this._precedence = precedence2; |
1669 } | 1669 } |
1670 /** | 1670 /** |
1671 * Return the precedence of tokens of this class, or {@code 0} if the such tok
ens do not represent | 1671 * Return the precedence of tokens of this class, or {@code 0} if the such tok
ens do not represent |
1672 * an operator. | 1672 * an operator. |
1673 * @return the precedence of tokens of this class | 1673 * @return the precedence of tokens of this class |
1674 */ | 1674 */ |
1675 int get precedence => _precedence; | 1675 int get precedence => _precedence; |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1781 /** | 1781 /** |
1782 * The class of the token. | 1782 * The class of the token. |
1783 */ | 1783 */ |
1784 TokenClass _tokenClass; | 1784 TokenClass _tokenClass; |
1785 /** | 1785 /** |
1786 * The lexeme that defines this type of token, or {@code null} if there is mor
e than one possible | 1786 * The lexeme that defines this type of token, or {@code null} if there is mor
e than one possible |
1787 * lexeme for this type of token. | 1787 * lexeme for this type of token. |
1788 */ | 1788 */ |
1789 String _lexeme; | 1789 String _lexeme; |
1790 TokenType.con1(String ___name, int ___ordinal) { | 1790 TokenType.con1(String ___name, int ___ordinal) { |
1791 _jtd_constructor_277_impl(___name, ___ordinal); | 1791 _jtd_constructor_288_impl(___name, ___ordinal); |
1792 } | 1792 } |
1793 _jtd_constructor_277_impl(String ___name, int ___ordinal) { | 1793 _jtd_constructor_288_impl(String ___name, int ___ordinal) { |
1794 _jtd_constructor_278_impl(___name, ___ordinal, TokenClass.NO_CLASS, null); | 1794 _jtd_constructor_289_impl(___name, ___ordinal, TokenClass.NO_CLASS, null); |
1795 } | 1795 } |
1796 TokenType.con2(String ___name, int ___ordinal, TokenClass tokenClass2, String
lexeme2) { | 1796 TokenType.con2(String ___name, int ___ordinal, TokenClass tokenClass2, String
lexeme2) { |
1797 _jtd_constructor_278_impl(___name, ___ordinal, tokenClass2, lexeme2); | 1797 _jtd_constructor_289_impl(___name, ___ordinal, tokenClass2, lexeme2); |
1798 } | 1798 } |
1799 _jtd_constructor_278_impl(String ___name, int ___ordinal, TokenClass tokenClas
s2, String lexeme2) { | 1799 _jtd_constructor_289_impl(String ___name, int ___ordinal, TokenClass tokenClas
s2, String lexeme2) { |
1800 __name = ___name; | 1800 __name = ___name; |
1801 __ordinal = ___ordinal; | 1801 __ordinal = ___ordinal; |
1802 this._tokenClass = tokenClass2 == null ? TokenClass.NO_CLASS : tokenClass2; | 1802 this._tokenClass = tokenClass2 == null ? TokenClass.NO_CLASS : tokenClass2; |
1803 this._lexeme = lexeme2; | 1803 this._lexeme = lexeme2; |
1804 } | 1804 } |
1805 /** | 1805 /** |
1806 * Return the lexeme that defines this type of token, or {@code null} if there
is more than one | 1806 * Return the lexeme that defines this type of token, or {@code null} if there
is more than one |
1807 * possible lexeme for this type of token. | 1807 * possible lexeme for this type of token. |
1808 * @return the lexeme that defines this type of token | 1808 * @return the lexeme that defines this type of token |
1809 */ | 1809 */ |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1878 * Return {@code true} if this token type represents an operator that can be d
efined by users. | 1878 * Return {@code true} if this token type represents an operator that can be d
efined by users. |
1879 * @return {@code true} if this token type represents an operator that can be
defined by users | 1879 * @return {@code true} if this token type represents an operator that can be
defined by users |
1880 */ | 1880 */ |
1881 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, "|"); | 1881 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, "|"); |
1882 String toString() => __name; | 1882 String toString() => __name; |
1883 } | 1883 } |
1884 class TokenType_EOF extends TokenType { | 1884 class TokenType_EOF extends TokenType { |
1885 TokenType_EOF(String ___name, int ___ordinal, TokenClass arg0, String arg1) :
super.con2(___name, ___ordinal, arg0, arg1); | 1885 TokenType_EOF(String ___name, int ___ordinal, TokenClass arg0, String arg1) :
super.con2(___name, ___ordinal, arg0, arg1); |
1886 String toString() => "-eof-"; | 1886 String toString() => "-eof-"; |
1887 } | 1887 } |
OLD | NEW |