getFieldName() implementations for other classes
[sbp.git] / src / edu / berkeley / sbp / meta / GrammarAST.java
index 1c1ef3d..66e8323 100644 (file)
@@ -465,6 +465,7 @@ public class GrammarAST {
             if (ret == null) throw new RuntimeException("unknown nonterminal \""+nonTerminal+"\"");
             return ret;
         }
+        public String getFieldName() { return StringUtil.uncapitalize(nonTerminal); }
     }
 
     /** a literal string */
@@ -537,6 +538,7 @@ public class GrammarAST {
         public boolean isDropped(Context cx) { return _e.isDropped(cx); }
         public Atom toAtom(Context cx) { return _e.toAtom(cx); }
         public Element build(Context cx, NonTerminalNode cnt, boolean dropall) { return _e.build(cx, cnt, dropall); }
+        public String getFieldName() { return _e.getFieldName(); }
     }
 
     /** a backtick node indicating that, when building the AST, the node's children should be inserted here */
@@ -561,6 +563,7 @@ public class GrammarAST {
     private class LabelNode extends ElementNodeWrapper {
         public final String label;
         public LabelNode(String label, ElementNode e) { super(e); this.label = label; }
+        public String getFieldName() { return label; }
     }
 
     //////////////////////////////////////////////////////////////////////////////