OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 interface Scanner { | 5 interface Scanner { |
6 Token tokenize(); | 6 Token tokenize(); |
7 } | 7 } |
8 | 8 |
9 /** | 9 /** |
10 * Common base class for a Dart scanner. | 10 * Common base class for a Dart scanner. |
11 */ | 11 */ |
12 class AbstractScanner<T> implements Scanner { | 12 class AbstractScanner<T extends SourceString> implements Scanner { |
13 abstract int advance(); | 13 abstract int advance(); |
14 abstract int nextByte(); | 14 abstract int nextByte(); |
15 abstract int peek(); | 15 abstract int peek(); |
16 abstract int select(int choice, PrecedenceInfo yes, PrecedenceInfo no); | 16 abstract int select(int choice, PrecedenceInfo yes, PrecedenceInfo no); |
17 abstract void appendPrecedenceToken(PrecedenceInfo info); | 17 abstract void appendPrecedenceToken(PrecedenceInfo info); |
18 abstract void appendStringToken(PrecedenceInfo info, String value); | 18 abstract void appendStringToken(PrecedenceInfo info, String value); |
19 abstract void appendByteStringToken(PrecedenceInfo info, T value); | 19 abstract void appendByteStringToken(PrecedenceInfo info, T value); |
20 abstract void appendKeywordToken(Keyword keyword); | 20 abstract void appendKeywordToken(Keyword keyword); |
21 abstract void appendWhiteSpace(int next); | 21 abstract void appendWhiteSpace(int next); |
22 abstract void appendEofToken(); | 22 abstract void appendEofToken(); |
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 charOffset); | 758 charOffset); |
759 } | 759 } |
760 } | 760 } |
761 | 761 |
762 class MalformedInputException { | 762 class MalformedInputException { |
763 final String message; | 763 final String message; |
764 final position; | 764 final position; |
765 MalformedInputException(this.message, this.position); | 765 MalformedInputException(this.message, this.position); |
766 toString() => message; | 766 toString() => message; |
767 } | 767 } |
OLD | NEW |