diff options
author | paltherr <paltherr@epfl.ch> | 2003-04-30 07:44:06 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2003-04-30 07:44:06 +0000 |
commit | fa72586d0b7c8fef92643d1d1402c8d94bea9c3d (patch) | |
tree | b6deef5e7f28373abe0f5157f55fc27d39fd7a0e /sources/meta/scalac/ast/MetaTraverser.java | |
parent | 4d1dfaffedbe38038fcfe2fc3af01f1c949a53fe (diff) | |
download | scala-fa72586d0b7c8fef92643d1d1402c8d94bea9c3d.tar.gz scala-fa72586d0b7c8fef92643d1d1402c8d94bea9c3d.tar.bz2 scala-fa72586d0b7c8fef92643d1d1402c8d94bea9c3d.zip |
- Added methods which take a symbol in TreeFact...
- Added methods which take a symbol in TreeFactories and TreeCopiers.
Diffstat (limited to 'sources/meta/scalac/ast/MetaTraverser.java')
-rw-r--r-- | sources/meta/scalac/ast/MetaTraverser.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sources/meta/scalac/ast/MetaTraverser.java b/sources/meta/scalac/ast/MetaTraverser.java index 4e00b924c9..0f166510db 100644 --- a/sources/meta/scalac/ast/MetaTraverser.java +++ b/sources/meta/scalac/ast/MetaTraverser.java @@ -8,6 +8,8 @@ package meta.scalac.ast; +import meta.java.Type; + public class MetaTraverser extends AbstractTreeCaseExpander { //######################################################################## @@ -21,5 +23,22 @@ public class MetaTraverser extends AbstractTreeCaseExpander { writer.println("return;"); } + public void printTraverseArrays() { + int max = tree.arrays; + for (int i = 0; i < tree.nodes.length; i++) + max = Math.max(max, tree.nodes[i].arrays); + for (int i = 1; i <= max; i++) + printTraverseArray(tree.getType(i)); + } + + public void printTraverseArray(Type type) { + writer.print("public void traverse"). + print("(").print(type).print(" trees)").lbrace(); + writer.print("for (int i = 0; i < trees.length; i++) "). + println("traverse(trees[i]);"); + writer.rbrace(); + writer.line(); + } + //######################################################################## } |