コード例 #1
0
  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;
  }
コード例 #2
0
  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;
  }
コード例 #3
0
  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;
  }
コード例 #4
0
  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;
  }
コード例 #5
0
  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;
  }