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/src/generated/ast.dart'; | 8 import 'package:analyzer/dart/ast/ast.dart'; |
| 9 import 'package:analyzer/dart/ast/visitor.dart'; |
9 import 'package:analyzer/src/generated/error.dart'; | 10 import 'package:analyzer/src/generated/error.dart'; |
10 import 'package:analyzer/src/generated/parser.dart'; | 11 import 'package:analyzer/src/generated/parser.dart'; |
11 import 'package:analyzer/src/generated/scanner.dart'; | 12 import 'package:analyzer/src/generated/scanner.dart'; |
12 | 13 |
13 main(List<String> args) { | 14 main(List<String> args) { |
14 print('working dir ${new File('.').resolveSymbolicLinksSync()}'); | 15 print('working dir ${new File('.').resolveSymbolicLinksSync()}'); |
15 | 16 |
16 if (args.length == 0) { | 17 if (args.length == 0) { |
17 print('Usage: parser_driver [files_to_parse]'); | 18 print('Usage: parser_driver [files_to_parse]'); |
18 exit(0); | 19 exit(0); |
(...skipping 26 matching lines...) Expand all Loading... |
45 print('${node.runtimeType} : <"$node">'); | 46 print('${node.runtimeType} : <"$node">'); |
46 return super.visitNode(node); | 47 return super.visitNode(node); |
47 } | 48 } |
48 } | 49 } |
49 | 50 |
50 class _ErrorCollector extends AnalysisErrorListener { | 51 class _ErrorCollector extends AnalysisErrorListener { |
51 List<AnalysisError> errors; | 52 List<AnalysisError> errors; |
52 _ErrorCollector() : errors = new List<AnalysisError>(); | 53 _ErrorCollector() : errors = new List<AnalysisError>(); |
53 onError(error) => errors.add(error); | 54 onError(error) => errors.add(error); |
54 } | 55 } |
OLD | NEW |