checkpoint
[sbp.git] / src / edu / berkeley / sbp / misc / ReflectiveWalker.java
index c22e81c..c99a463 100644 (file)
@@ -5,6 +5,7 @@ import java.io.*;
 import java.util.*;
 import java.lang.reflect.*;
 
+/** use of this class is not recommended; it can handle only S-attributed grammars */
 public class ReflectiveWalker extends StringWalker {
     public ReflectiveWalker()              { this.target = this; }
     public ReflectiveWalker(Object target) { this.target = target; }
@@ -66,6 +67,10 @@ public class ReflectiveWalker extends StringWalker {
         return super.walk(tree);
     }
     */
+    public void walk(String tag) {
+        Member m = member(normalize(tag), 0, false);
+        if (m!=null) Reflection.fuzzyInvoke(target, m);
+    }
     public Object walk(String tag, Object[] argo) {
         if (argo.length==0) return super.walk(tag, argo);
         if (argo==null) return tag;