diff options
Diffstat (limited to 'sources/scalac/ast')
-rw-r--r-- | sources/scalac/ast/Transformer.java.tmpl | 4 | ||||
-rw-r--r-- | sources/scalac/ast/parser/ParserPhase.java | 36 |
2 files changed, 18 insertions, 22 deletions
diff --git a/sources/scalac/ast/Transformer.java.tmpl b/sources/scalac/ast/Transformer.java.tmpl index 9e83e34b18..970ecfa00d 100644 --- a/sources/scalac/ast/Transformer.java.tmpl +++ b/sources/scalac/ast/Transformer.java.tmpl @@ -54,10 +54,6 @@ public class Transformer { //######################################################################## // Public Methods - public void apply() { - apply(global.units); - } - public void apply(Unit[] units) { for (int i = 0; i < units.length; i++) apply(units[i]); } diff --git a/sources/scalac/ast/parser/ParserPhase.java b/sources/scalac/ast/parser/ParserPhase.java index 1a1dde1ffe..1355b3926d 100644 --- a/sources/scalac/ast/parser/ParserPhase.java +++ b/sources/scalac/ast/parser/ParserPhase.java @@ -9,31 +9,31 @@ package scalac.ast.parser; import scalac.Global; -import scalac.Unit; +import scalac.Phase; import scalac.PhaseDescriptor; +import scalac.Unit; -public class ParserPhase extends PhaseDescriptor { - - public String name() { - return "parse"; - } +public class ParserPhase extends Phase { - public String description () { - return "parse source files"; - } + //######################################################################## + // Public Constructors - public String taskDescription() { - return "parsed"; + /** Initializes this instance. */ + public ParserPhase(Global global, PhaseDescriptor descriptor) { + super(global, descriptor); } - public void apply(Global global) { - for (int i = 0; i < global.units.length; i++) apply(global.units[i]); - } + //######################################################################## + // Public Methods - public void apply(Unit unit) { - unit.global.start(); - unit.body = new Parser(unit).parse(); - unit.global.stop("parsed " + unit.source); + /** Applies this phase to the given compilation units. */ + public void apply(Unit[] units) { + for (int i = 0; i < units.length; i++) { + global.start(); + units[i].body = new Parser(units[i]).parse(); + global.stop("parsed " + units[i].source); + } } + //######################################################################## } |