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

Unified Diff: pkg/analyzer_experimental/example/resolver_driver.dart

Issue 45573002: Rename analyzer_experimental to analyzer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweaks before publishing. Created 7 years, 2 months 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer_experimental/example/resolver_driver.dart
diff --git a/pkg/analyzer_experimental/example/resolver_driver.dart b/pkg/analyzer_experimental/example/resolver_driver.dart
deleted file mode 100644
index 2207cf1131de503dda6cd516ca8b87fda335c2dd..0000000000000000000000000000000000000000
--- a/pkg/analyzer_experimental/example/resolver_driver.dart
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/usr/bin/env dart
-
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:analyzer_experimental/src/generated/java_io.dart';
-import 'package:analyzer_experimental/src/generated/source_io.dart';
-import 'package:analyzer_experimental/src/generated/ast.dart';
-import 'package:analyzer_experimental/src/generated/sdk.dart' show DartSdk;
-import 'package:analyzer_experimental/src/generated/sdk_io.dart' show DirectoryBasedDartSdk;
-import 'package:analyzer_experimental/src/generated/element.dart';
-import 'package:analyzer_experimental/src/generated/engine.dart';
-
-import 'dart:io';
-
-main() {
- print('working dir ${new File('.').fullPathSync()}');
-
- var args = new Options().arguments;
- if (args.length != 2) {
- print('Usage: resolve_driver [path_to_sdk] [file_to_resolve]');
- exit(0);
- }
-
- JavaSystemIO.setProperty("com.google.dart.sdk", args[0]);
- DartSdk sdk = DirectoryBasedDartSdk.defaultSdk;
-
- AnalysisContext context = AnalysisEngine.instance.createAnalysisContext();
- context.sourceFactory = new SourceFactory.con2([new DartUriResolver(sdk), new FileUriResolver()]);
- Source source = new FileBasedSource.con1(context.sourceFactory.contentCache, new JavaFile(args[1]));
- //
- ChangeSet changeSet = new ChangeSet();
- changeSet.added(source);
- context.applyChanges(changeSet);
- LibraryElement libElement = context.computeLibraryElement(source);
- print("libElement: $libElement");
-
- CompilationUnit resolvedUnit = context.resolveCompilationUnit(source, libElement);
- var visitor = new _ASTVisitor();
- resolvedUnit.accept(visitor);
-}
-
-class _ASTVisitor extends GeneralizingASTVisitor {
- visitNode(ASTNode node) {
- String text = '${node.runtimeType} : <"${node.toString()}">';
- if (node is SimpleIdentifier) {
- Element element = (node as SimpleIdentifier).staticElement;
- if (element != null) {
- text += " element: ${element.runtimeType}";
- LibraryElement library = element.library;
- if (library != null) {
- text += " from ${element.library.definingCompilationUnit.source.fullName}";
- }
- }
- }
- print(text);
- return super.visitNode(node);
- }
-}
-
« no previous file with comments | « pkg/analyzer_experimental/example/parser_driver.dart ('k') | pkg/analyzer_experimental/example/scanner_driver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698