OLD | NEW |
1 // Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Fletch 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 library servicec.parser; | 5 library servicec.parser; |
6 | 6 |
7 import 'package:compiler/src/scanner/scannerlib.dart' show | 7 import 'package:compiler/src/tokens/token.dart' show |
8 EOF_TOKEN, | |
9 ErrorToken, | 8 ErrorToken, |
10 IDENTIFIER_TOKEN, | |
11 KEYWORD_TOKEN, | |
12 Keyword, | |
13 KeywordToken, | 9 KeywordToken, |
14 Token; | 10 Token; |
15 | 11 |
| 12 import 'package:compiler/src/tokens/token_constants.dart' show |
| 13 EOF_TOKEN, |
| 14 IDENTIFIER_TOKEN, |
| 15 KEYWORD_TOKEN; |
| 16 |
16 import 'listener.dart' show | 17 import 'listener.dart' show |
17 Listener; | 18 Listener; |
18 | 19 |
19 import 'scanner.dart' show | 20 import 'scanner.dart' show |
20 LF_TOKEN; | 21 LF_TOKEN; |
21 | 22 |
22 /// Parser for the Dart service IDL, reusing the dart2js tokens. | 23 /// Parser for the Dart service IDL, reusing the dart2js tokens. |
23 class Parser { | 24 class Parser { |
24 Listener listener; | 25 Listener listener; |
25 Parser(this.listener); | 26 Parser(this.listener); |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 return tokens; | 238 return tokens; |
238 } | 239 } |
239 | 240 |
240 bool valid(Token tokens) { | 241 bool valid(Token tokens) { |
241 tokens = skipNewLines(tokens); | 242 tokens = skipNewLines(tokens); |
242 return tokens.kind != EOF_TOKEN && tokens is! ErrorToken; | 243 return tokens.kind != EOF_TOKEN && tokens is! ErrorToken; |
243 } | 244 } |
244 | 245 |
245 Token next(Token tokens) => skipNewLines(skipNewLines(tokens).next); | 246 Token next(Token tokens) => skipNewLines(skipNewLines(tokens).next); |
246 } | 247 } |
OLD | NEW |