public List<ASType> getOutOfPackageTypes() {
    List<ASType> types = new ArrayList<ASType>();

    for (LinkedListTree type : ASTUtils.findChildrenByType(ast, AS3Parser.CLASS_DEF)) {
      types.add(new ASTASClassType(type));
    }

    for (LinkedListTree type : ASTUtils.findChildrenByType(ast, AS3Parser.INTERFACE_DEF)) {
      types.add(new ASTASInterfaceType(type));
    }

    return types;
  }
  public List<ASMethod> getOutOfPackageFunctions() {
    List<ASMethod> functions = new ArrayList<ASMethod>();

    for (LinkedListTree functionAST : ASTUtils.findChildrenByType(ast, AS3Parser.METHOD_DEF)) {
      functions.add(new ASTASMethod(functionAST));
    }

    return functions;
  }
  public List<ASField> getOutOfPackageFields() {
    List<ASField> fields = new ArrayList<ASField>();

    for (LinkedListTree fieldAST : ASTUtils.findChildrenByType(ast, AS3Parser.VAR_DEF)) {
      fields.addAll(new ASTASField(fieldAST).getSubFields());
    }

    return fields;
  }
  public List<ASNamespaceDeclaration> getOutOfPackageNamespaces() {
    List<ASNamespaceDeclaration> namespaces = new ArrayList<ASNamespaceDeclaration>();

    List<LinkedListTree> namespacesAST = ASTUtils.findChildrenByType(ast, AS3Parser.NAMESPACE_DEF);
    for (LinkedListTree namespaceAST : namespacesAST) {
      final LinkedListTree child = namespaceAST.getFirstChild();
      if (child != null) {
        namespaces.add(new ASTASNamespaceDeclaration(namespaceAST));
      }
    }

    return namespaces;
  }
  public List<Statement> getOutOfPackageStatements() {
    List<Statement> statements = new ArrayList<Statement>();

    List<LinkedListTree> statementsAST =
        ASTUtils.findChildrenByType(ast, AS3Parser.OUT_OF_FUNCTION_STMT);
    for (LinkedListTree statementAST : statementsAST) {
      final LinkedListTree child = statementAST.getFirstChild();
      if (child != null) {
        statements.add(StatementBuilder.build(child));
      }
    }

    return statements;
  }