Example #1
0
 public String getTerminal() {
   ParseNode pn = children.elementAt(0);
   if (pn == null) {
     return null;
   } else {
     return pn.getLabel();
   }
 }
Example #2
0
  public ParseNodeVector getChildren(String label) {
    int i;
    ParseNodeVector v = new ParseNodeVector();

    for (i = 0; i < children.size(); i++) {
      ParseNode pn = children.elementAt(i);
      if (pn.getLabel().equals(label)) v.addElement(pn);
    }

    return v;
  }
Example #3
0
  public ParseNode getChild(String label) {
    int i;
    ParseNode p;

    for (i = 0; i < children.size(); i++) {
      p = children.elementAt(i);
      if (p.getLabel().equals(label)) {
        return p;
      }
    }

    return null;
  }