Example #1
0
  public Boolean ownsBlock(String name) {
    for (Block child : children) {
      if (child.getName().equals(name)) return true;
    }

    return false;
  }
Example #2
0
  @Override
  public String toString() {

    String str = "";

    for (Statement statement : statements) str += statement.toString();

    for (Block child : children) str += child.getName() + "[" + child.toString() + "]";

    return str;
  }
Example #3
0
  public Block getBlock(String name) {

    for (Block child : children) {
      if (child.getName().equals(name)) return child;
    }

    Block block;

    for (Block child : children) {
      if ((block = child.getBlock(name)) != null) return block;
    }

    return null;
  }