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

Side by Side Diff: pkg/analyzer/lib/dart/ast/token.dart

Issue 1693083004: Move scanner out of generated and clean up imports (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: clean up Created 4 years, 10 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
« no previous file with comments | « pkg/analyzer/lib/dart/ast/ast.dart ('k') | pkg/analyzer/lib/src/dart/ast/ast.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * Defines the tokens that are produced by the scanner, used by the parser, and 6 * Defines the tokens that are produced by the scanner, used by the parser, and
7 * referenced from the [AST structure](ast.dart). 7 * referenced from the [AST structure](ast.dart).
8 */ 8 */
9 library analyzer.dart.ast.token; 9 library analyzer.dart.ast.token;
10 10
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 first = token; 360 first = token;
361 offset = token.offset; 361 offset = token.offset;
362 } 362 }
363 } 363 }
364 return first; 364 return first;
365 } 365 }
366 } 366 }
367 367
368 /** 368 /**
369 * The types of tokens that can be returned by the scanner. 369 * The types of tokens that can be returned by the scanner.
370 *
371 * Clients may not extend, implement or mix-in this class.
370 */ 372 */
371 class TokenType { 373 class TokenType {
372 /** 374 /**
373 * The type of the token that marks the end of the input. 375 * The type of the token that marks the start or end of the input.
374 */ 376 */
375 static const TokenType EOF = const _EndOfFileTokenType(); 377 static const TokenType EOF = const _EndOfFileTokenType();
376 378
377 static const TokenType DOUBLE = const TokenType._('DOUBLE'); 379 static const TokenType DOUBLE = const TokenType._('DOUBLE');
378 380
379 static const TokenType HEXADECIMAL = const TokenType._('HEXADECIMAL'); 381 static const TokenType HEXADECIMAL = const TokenType._('HEXADECIMAL');
380 382
381 static const TokenType IDENTIFIER = const TokenType._('IDENTIFIER'); 383 static const TokenType IDENTIFIER = const TokenType._('IDENTIFIER');
382 384
383 static const TokenType INT = const TokenType._('INT'); 385 static const TokenType INT = const TokenType._('INT');
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 * The name of the token type. 593 * The name of the token type.
592 */ 594 */
593 final String name; 595 final String name;
594 596
595 /** 597 /**
596 * The lexeme that defines this type of token, or `null` if there is more than 598 * The lexeme that defines this type of token, or `null` if there is more than
597 * one possible lexeme for this type of token. 599 * one possible lexeme for this type of token.
598 */ 600 */
599 final String lexeme; 601 final String lexeme;
600 602
603 /**
604 * Initialize a newly created token type to have the given [name],
605 * [_tokenClass] and [lexeme].
606 */
601 const TokenType._(this.name, 607 const TokenType._(this.name,
602 [this._tokenClass = TokenClass.NO_CLASS, this.lexeme = null]); 608 [this._tokenClass = TokenClass.NO_CLASS, this.lexeme = null]);
603 609
604 /** 610 /**
605 * Return `true` if this type of token represents an additive operator. 611 * Return `true` if this type of token represents an additive operator.
606 */ 612 */
607 bool get isAdditiveOperator => _tokenClass == TokenClass.ADDITIVE_OPERATOR; 613 bool get isAdditiveOperator => _tokenClass == TokenClass.ADDITIVE_OPERATOR;
608 614
609 /** 615 /**
610 * Return `true` if this type of token represents an assignment operator. 616 * Return `true` if this type of token represents an assignment operator.
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 */ 729 */
724 class _EndOfFileTokenType extends TokenType { 730 class _EndOfFileTokenType extends TokenType {
725 /** 731 /**
726 * Initialize a newly created token. 732 * Initialize a newly created token.
727 */ 733 */
728 const _EndOfFileTokenType() : super._('EOF', TokenClass.NO_CLASS, ''); 734 const _EndOfFileTokenType() : super._('EOF', TokenClass.NO_CLASS, '');
729 735
730 @override 736 @override
731 String toString() => '-eof-'; 737 String toString() => '-eof-';
732 } 738 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/dart/ast/ast.dart ('k') | pkg/analyzer/lib/src/dart/ast/ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698