diff options
author | buraq <buraq@epfl.ch> | 2003-07-04 20:07:20 +0000 |
---|---|---|
committer | buraq <buraq@epfl.ch> | 2003-07-04 20:07:20 +0000 |
commit | fe7e260075dc9c27b31c0ec535a139e3744fdbb7 (patch) | |
tree | 14d717114bffccb6fc8006c6cf8fe574f4b868e6 /sources/scalac/transformer/matching/TestRegTraverser.java | |
parent | a4392e6d759f8c2197d1a72020597cedaff5fd8f (diff) | |
download | scala-fe7e260075dc9c27b31c0ec535a139e3744fdbb7.tar.gz scala-fe7e260075dc9c27b31c0ec535a139e3744fdbb7.tar.bz2 scala-fe7e260075dc9c27b31c0ec535a139e3744fdbb7.zip |
hooking up pattern matcher with sequence matcher
Diffstat (limited to 'sources/scalac/transformer/matching/TestRegTraverser.java')
-rw-r--r-- | sources/scalac/transformer/matching/TestRegTraverser.java | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/sources/scalac/transformer/matching/TestRegTraverser.java b/sources/scalac/transformer/matching/TestRegTraverser.java new file mode 100644 index 0000000000..b9d070ea85 --- /dev/null +++ b/sources/scalac/transformer/matching/TestRegTraverser.java @@ -0,0 +1,39 @@ +package scalac.transformer.matching ; + +import scalac.ast.Tree; +import scalac.util.Name; +import scalac.symtab.Symbol ; +import scalac.ast.Traverser ; + +import Tree.Ident; +import Tree.Bind; + + class TestRegTraverser extends Traverser { + + boolean result; + + public TestRegTraverser() { + super(); + result = false; + } + + public void traverse(Tree tree) { + switch (tree) { + case Alternative(Tree[] ts): + case Bind(_, _): + case Subsequence(_): + result = true; + break; + default: + super.traverse( tree ); + } + } + + static boolean apply( Tree t ) { + TestRegTraverser trt = new TestRegTraverser(); + trt.traverse( t ); + //System.err.println("TestRegTraverser says "+t+" -> "+trt.result); + return trt.result; + } + +} |