Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: pkg/analyzer_experimental/example/scanner_driver.dart

Issue 42863002: New analyzer_experimental snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/env dart 1 #!/usr/bin/env dart
2 2
3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
4 // for details. All rights reserved. Use of this source code is governed by a 4 // for details. All rights reserved. Use of this source code is governed by a
5 // BSD-style license that can be found in the LICENSE file. 5 // BSD-style license that can be found in the LICENSE file.
6 6
7 import 'dart:io';
8
7 import 'package:analyzer_experimental/src/generated/scanner.dart'; 9 import 'package:analyzer_experimental/src/generated/scanner.dart';
8 10 import 'package:analyzer_experimental/src/generated/java_core.dart' show CharSeq uence;
9 import 'dart:io';
10 11
11 main() { 12 main() {
12 13
13 print('working dir ${new File('.').fullPathSync()}'); 14 print('working dir ${new File('.').fullPathSync()}');
14 15
15 var args = new Options().arguments; 16 var args = new Options().arguments;
16 if (args.length == 0) { 17 if (args.length == 0) {
17 print('Usage: scanner_driver [files_to_scan]'); 18 print('Usage: scanner_driver [files_to_scan]');
18 exit(0); 19 exit(0);
19 } 20 }
20 21
21 for (var arg in args) { 22 for (var arg in args) {
22 _scan(new File(arg)); 23 _scan(new File(arg));
23 } 24 }
24 25
25 } 26 }
26 27
27 _scan(File file) { 28 _scan(File file) {
28 var src = file.readAsStringSync(); 29 var src = file.readAsStringSync();
29 var scanner = new StringScanner(null, src, null); 30 var reader = new CharSequenceReader(new CharSequence(src));
31 var scanner = new Scanner(null, reader, null);
30 var token = scanner.tokenize(); 32 var token = scanner.tokenize();
31 while (token.type != TokenType.EOF) { 33 while (token.type != TokenType.EOF) {
32 print(token); 34 print(token);
33 token = token.next; 35 token = token.next;
34 } 36 }
35 } 37 }
OLDNEW
« no previous file with comments | « pkg/analyzer_experimental/example/parser_driver.dart ('k') | pkg/analyzer_experimental/lib/analyzer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698