code: public List<AstNode> getStatements() {
          List<AstNode> stmts = new ArrayList<AstNode>();
          Node n = getFirstChild();
          while (n != null) {
              stmts.add((AstNode)n);
              n = n.getNext();
          }
          return stmts;
      }
docs: Returns a copy of the child list, with each child cast to an
  {@link AstNode}.
  @throws ClassCastException if any non-{@code AstNode} objects are
  in the child list, e.g. if this method is called after the code
  generator begins the tree transformation.