checkpoint
[sbp.git] / src / edu / berkeley / sbp / meta / AnnotationGrammarBindingResolver.java
index 8601ee7..8a469f6 100644 (file)
@@ -50,7 +50,7 @@ public class AnnotationGrammarBindingResolver extends GrammarBindingResolver {
         String prefix = key.indexOf('.')==-1 ? "" : key.substring(0, key.lastIndexOf('.'));
         String suffix = key.indexOf('.')==-1 ? key : key.substring(key.lastIndexOf('.')+1);
 
-        MetaGrammar.Production p = new MetaGrammar.Production(suffix, suffix, els, drops);
+        MetaGrammar.Production p = new MetaGrammar.Production(suffix, els, drops);
         for(Method m : _allMethods.get(prefix))
             if (new MetaGrammar.Target(m).isCompatible(p))
                 return new MetaGrammar.Target(m).makeSequence(p);
@@ -67,7 +67,7 @@ public class AnnotationGrammarBindingResolver extends GrammarBindingResolver {
     }
 
     public Sequence resolveTag(String tag, String nonTerminalName, Element[] els, boolean[] drops) {
-        MetaGrammar.Production p = new MetaGrammar.Production(tag, nonTerminalName, els, drops);
+        MetaGrammar.Production p = new MetaGrammar.Production(tag==null ? nonTerminalName : tag, els, drops);
         Sequence ret = tryResolveTag(tag, nonTerminalName, els, drops);
         if (ret != null) return ret;
         String message = "could not find a Java method/class/ctor matching tag \""+tag+