Skip to content

Commit

Permalink
Added abstract syntax tree browser (using Java ...
Browse files Browse the repository at this point in the history
Added abstract syntax tree browser (using Java Swing).
  • Loading branch information
dragos committed Jul 26, 2005
1 parent 5cf7d39 commit aa78f8e
Show file tree
Hide file tree
Showing 3 changed files with 623 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sources/scala/tools/nsc/Global.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ class Global(val settings: Settings, val reporter: Reporter) extends SymbolTable
}
val treePrinter = treePrinters.create();

object treeBrowsers extends TreeBrowsers {
val global: Global.this.type = Global.this
}
val treeBrowser = treeBrowsers.create();

object treeInfo extends TreeInfo {
val global: Global.this.type = Global.this
}
Expand Down Expand Up @@ -265,6 +270,7 @@ class Global(val settings: Settings, val reporter: Reporter) extends SymbolTable
phase = globalPhase;
globalPhase.run;
if (settings.print contains globalPhase.name) treePrinter.printAll();
if (settings.browse contains globalPhase.name) treeBrowser.browse(units);
informTime(globalPhase.description, startTime);
globalPhase = globalPhase.next;
if (settings.check contains globalPhase.name) {
Expand Down
1 change: 1 addition & 0 deletions sources/scala/tools/nsc/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class Settings(error: String => unit) {
val printer = ChoiceSetting ("-printer", "Printer to use", List("text", "html"), "text");
val printfile = StringSetting ("-printfile", "file", "Specify file in which to print trees", "-");
val graph = PhasesSetting ("-graph", "Graph the program after");
val browse = PhasesSetting ("-browse", "Browse the abstract syntax tree after");
val stop = PhasesSetting ("-stop", "Stop after phase");
val log = PhasesSetting ("-log", "Log operations in");
val version = BooleanSetting("-version", "Print product version and exit");
Expand Down
Loading

0 comments on commit aa78f8e

Please sign in to comment.