OLD | NEW |
1 #!/usr/bin/env dart | 1 #!/usr/bin/env dart |
2 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 2 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
3 // for details. All rights reserved. Use of this source code is governed by a | 3 // for details. All rights reserved. Use of this source code is governed by a |
4 // BSD-style license that can be found in the LICENSE file. | 4 // BSD-style license that can be found in the LICENSE file. |
5 | 5 |
6 import 'dart:io'; | 6 import 'dart:io'; |
7 | 7 |
8 import 'package:analyzer/dart/ast/ast.dart'; | 8 import 'package:analyzer/dart/ast/ast.dart'; |
9 import 'package:analyzer/dart/ast/visitor.dart'; | 9 import 'package:analyzer/dart/ast/visitor.dart'; |
| 10 import 'package:analyzer/src/dart/scanner/reader.dart'; |
| 11 import 'package:analyzer/src/dart/scanner/scanner.dart'; |
10 import 'package:analyzer/src/generated/error.dart'; | 12 import 'package:analyzer/src/generated/error.dart'; |
11 import 'package:analyzer/src/generated/parser.dart'; | 13 import 'package:analyzer/src/generated/parser.dart'; |
12 import 'package:analyzer/src/generated/scanner.dart'; | |
13 | 14 |
14 main(List<String> args) { | 15 main(List<String> args) { |
15 print('working dir ${new File('.').resolveSymbolicLinksSync()}'); | 16 print('working dir ${new File('.').resolveSymbolicLinksSync()}'); |
16 | 17 |
17 if (args.length == 0) { | 18 if (args.length == 0) { |
18 print('Usage: parser_driver [files_to_parse]'); | 19 print('Usage: parser_driver [files_to_parse]'); |
19 exit(0); | 20 exit(0); |
20 } | 21 } |
21 | 22 |
22 for (var arg in args) { | 23 for (var arg in args) { |
(...skipping 23 matching lines...) Expand all Loading... |
46 print('${node.runtimeType} : <"$node">'); | 47 print('${node.runtimeType} : <"$node">'); |
47 return super.visitNode(node); | 48 return super.visitNode(node); |
48 } | 49 } |
49 } | 50 } |
50 | 51 |
51 class _ErrorCollector extends AnalysisErrorListener { | 52 class _ErrorCollector extends AnalysisErrorListener { |
52 List<AnalysisError> errors; | 53 List<AnalysisError> errors; |
53 _ErrorCollector() : errors = new List<AnalysisError>(); | 54 _ErrorCollector() : errors = new List<AnalysisError>(); |
54 onError(error) => errors.add(error); | 55 onError(error) => errors.add(error); |
55 } | 56 } |
OLD | NEW |