X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2Fmisc%2FStringWalker.java;h=ab54a3974eb9b03f5787e05a887e9b3812f79885;hb=44f1ba1ec309f9be850bd9c9400dfc5289f85dd0;hp=ae150e6150518cd6bc8e5e4b53f7606e6dce1fa7;hpb=0db242407cbae04f1a55086bf2bd31f5ae1bb7a8;p=sbp.git diff --git a/src/edu/berkeley/sbp/misc/StringWalker.java b/src/edu/berkeley/sbp/misc/StringWalker.java index ae150e6..ab54a39 100644 --- a/src/edu/berkeley/sbp/misc/StringWalker.java +++ b/src/edu/berkeley/sbp/misc/StringWalker.java @@ -1,3 +1,5 @@ +// Copyright 2006 all rights reserved; see LICENSE file for BSD-style license + package edu.berkeley.sbp.misc; import edu.berkeley.sbp.*; import edu.berkeley.sbp.util.*; @@ -8,7 +10,9 @@ import java.lang.reflect.*; public abstract class StringWalker extends TreeWalker { public void walk(String tag) { } public Object walk(Tree tree) { - walk(tree.head()); + Object o = tree.head(); + if (!(o instanceof String)) o = null; /* FIXME */ + walk((String)o); return super.walk(tree); } public Object walk(String tag, Object[] tokens) {