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 part of scanner; | |
6 | |
7 abstract class Scanner { | 5 abstract class Scanner { |
8 Token tokenize(); | 6 Token tokenize(); |
9 } | 7 } |
10 | 8 |
11 /** | 9 /** |
12 * Common base class for a Dart scanner. | 10 * Common base class for a Dart scanner. |
13 */ | 11 */ |
14 abstract class AbstractScanner<T extends SourceString> implements Scanner { | 12 abstract class AbstractScanner<T extends SourceString> implements Scanner { |
15 abstract int advance(); | 13 abstract int advance(); |
16 abstract int nextByte(); | 14 abstract int nextByte(); |
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
866 next = advance(); | 864 next = advance(); |
867 } | 865 } |
868 return error(const SourceString("unterminated string literal")); | 866 return error(const SourceString("unterminated string literal")); |
869 } | 867 } |
870 | 868 |
871 int error(SourceString message) { | 869 int error(SourceString message) { |
872 appendByteStringToken(BAD_INPUT_INFO, message); | 870 appendByteStringToken(BAD_INPUT_INFO, message); |
873 return advance(); // Ensure progress. | 871 return advance(); // Ensure progress. |
874 } | 872 } |
875 } | 873 } |
OLD | NEW |