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

Unified Diff: compiler/java/com/google/dart/compiler/DartCompiler.java

Issue 8566019: Added support for dumping AST to console, text file or dot file (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 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 side-by-side diff with in-line comments
Download patch
Index: compiler/java/com/google/dart/compiler/DartCompiler.java
===================================================================
--- compiler/java/com/google/dart/compiler/DartCompiler.java (revision 1522)
+++ compiler/java/com/google/dart/compiler/DartCompiler.java (working copy)
@@ -18,6 +18,8 @@
import com.google.dart.compiler.ast.LibraryNode;
import com.google.dart.compiler.ast.LibraryUnit;
import com.google.dart.compiler.ast.Modifiers;
+import com.google.dart.compiler.ast.viz.ASTWriterFactory;
+import com.google.dart.compiler.ast.viz.BaseASTWriter;
import com.google.dart.compiler.common.SourceInfo;
import com.google.dart.compiler.metrics.CompilerMetrics;
import com.google.dart.compiler.metrics.DartEventType;
@@ -664,6 +666,9 @@
try {
// Set entry point
setEntryPoint();
+
+ // Dump the compiler parse tree if dump format is set in arguments
+ BaseASTWriter astWriter = ASTWriterFactory.create(config);
// The two following for loops can be parallelized.
for (LibraryUnit lib : libraries.values()) {
@@ -671,6 +676,11 @@
// Compile all the units in this library.
for (DartUnit unit : lib.getUnits()) {
+
+ if(astWriter != null) {
+ astWriter.process(unit);
+ }
+
// Don't compile api-only units.
if (unit.isDiet()) {
continue;

Powered by Google App Engine
This is Rietveld 408576698