Package org.apache.flex.compiler.internal.tree.as

Examples of org.apache.flex.compiler.internal.tree.as.FunctionNode


            {get: function() {return -1;},
            configurable: true}
         );
        */

        FunctionNode fn = (FunctionNode) node;
        fn.parseFunctionBody(problems);

        // head
        write(JSGoogEmitterTokens.OBJECT);
        write(ASEmitterTokens.MEMBER_ACCESS);
        write(JSEmitterTokens.DEFINE_PROPERTY);
View Full Code Here


    protected void emitAccessor(String kind, IAccessorDefinition definition)
    {
        IFunctionNode fnode = definition.getFunctionNode();

        FunctionNode fn = (FunctionNode) fnode;
        fn.parseFunctionBody(new ArrayList<ICompilerProblem>());

        write(kind + ": function ");
        write(definition.getBaseName() + "$" + kind);
        emitParameters(fnode.getParameterNodes());
        emitMethodScope(fnode.getScopedNode());
View Full Code Here

        {
            emitConstructor(node);
            return;
        }

        FunctionNode fn = (FunctionNode) node;
        fn.parseFunctionBody(new ArrayList<ICompilerProblem>());
        IFunctionDefinition definition = node.getDefinition();

        String name = toPrivateName(definition);
        write(name);
        write(":");
View Full Code Here

    }

    @Override
    public void emitMethod(IFunctionNode node)
    {
        FunctionNode fn = (FunctionNode) node;
        fn.parseFunctionBody(new ArrayList<ICompilerProblem>());

        ICompilerProject project = getWalker().getProject();

        getDoc().emitMethodDoc(node, project);

        boolean isConstructor = node.isConstructor();

        String qname = getTypeDefinition(node).getQualifiedName();
        if (qname != null && !qname.equals(""))
        {
            write(qname);
            if (!isConstructor)
            {
                write(ASEmitterTokens.MEMBER_ACCESS);
                if (!fn.hasModifier(ASModifier.STATIC))
                {
                    write(JSEmitterTokens.PROTOTYPE);
                    write(ASEmitterTokens.MEMBER_ACCESS);
                }
            }
View Full Code Here

    }

    @Override
    protected void emitObjectDefineProperty(IAccessorNode node)
    {
        FunctionNode fn = (FunctionNode) node;
        fn.parseFunctionBody(problems);

        IFunctionDefinition definition = node.getDefinition();
        ITypeDefinition type = (ITypeDefinition) definition.getParent();

        if (project == null)
View Full Code Here

    @Override
    public void emitFunctionObject(IExpressionNode node)
    {
        FunctionObjectNode f = (FunctionObjectNode) node;
       
        FunctionNode fnode = f.getFunctionNode();
       
        write("function");
       
        emitParamters(fnode.getParameterNodes());
      
        emitFunctionScope(fnode.getScopedNode());
    }
View Full Code Here

        else
        {
            emitMethodDocumentation(node);
        }

        FunctionNode fn = (FunctionNode) node;
        fn.parseFunctionBody(problems);

        IFunctionDefinition definition = node.getDefinition();

        emitNamespaceIdentifier(node);
        emitModifiers(definition);
View Full Code Here

    @Override
    public void emitFunctionObject(IExpressionNode node)
    {
        FunctionObjectNode f = (FunctionObjectNode) node;
        FunctionNode fnode = f.getFunctionNode();
        writeToken(IASKeywordConstants.FUNCTION);
        emitParamters(fnode.getParameterNodes());
        emitType(fnode.getTypeNode());
        emitFunctionScope(fnode.getScopedNode());
    }
View Full Code Here

    {
        if (node.isConstructor())
        {
            IClassDefinition definition = getClassDefinition(node);

            FunctionNode fn = (FunctionNode) node;
            fn.parseFunctionBody(new ArrayList<ICompilerProblem>());

            String qname = definition.getQualifiedName();
            write(qname);
            write(" ");
            write("=");
            write(" ");
            write("function");
            emitParamters(node.getParameterNodes());
            emitMethodScope(node.getScopedNode());

            return;
        }

        FunctionNode fn = (FunctionNode) node;
        fn.parseFunctionBody(new ArrayList<ICompilerProblem>());

        String qname = getTypeDefinition(node).getQualifiedName();
        if (qname != null && !qname.equals(""))
        {
            write(qname);
            write(".");
            if (!fn.hasModifier(ASModifier.STATIC))
                write("prototype.");
        }

        emitMemberName(node);
        write(" ");
View Full Code Here

    }

    @Override
    public void emitMethod(IFunctionNode node)
    {
        FunctionNode fn = (FunctionNode) node;
        fn.parseFunctionBody(new ArrayList<ICompilerProblem>());

        ICompilerProject project = getWalker().getProject();
       
        getDoc().emitMethodDoc(node, project);
       
        boolean isConstructor = node.isConstructor();
       
        String qname = getTypeDefinition(node).getQualifiedName();
        if (qname != null && !qname.equals(""))
        {
            write(qname);
            if (!isConstructor)
            {
              write(".");
              if (!fn.hasModifier(ASModifier.STATIC))
              {
                  write("prototype");
                write(".");
              }
            }
View Full Code Here

TOP

Related Classes of org.apache.flex.compiler.internal.tree.as.FunctionNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.