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

Examples of org.apache.flex.compiler.tree.as.IExpressionNode


                    begin();
                    emitMethodAccess(node);
                    hasDoc = true;
                }

                IExpressionNode enode = pnode.getNameExpressionNode();
                emitParam(pnode, enode.resolveType(project).getPackageName());
            }

            if (!node.isConstructor())
            {
                // @return
View Full Code Here


     * if it exists, otherwise it will return the function node.
     */
    public static IASNode getFunctionProblemNode(IFunctionNode iNode)
    {
        IASNode result = iNode;
        IExpressionNode nameExpression = iNode.getNameExpressionNode();
        if( nameExpression != null )
            result = nameExpression;
        return result;
    }
View Full Code Here

        // the class generated for embedding has an implicit return type node, which causes our
        // check to think the "user code" has no return type. So skip these kinds of nodes....
        if (node.getStart() == node.getEnd())
            return;
       
        IExpressionNode returnType = node.getReturnTypeNode();
       
        // check for return type declaration
        if (returnType == null)      
        {
            // if none found, derive best source location for problem report
            IASNode sourceLoc = node;
            IExpressionNode nameNode = node.getNameExpressionNode();
            if (nameNode != null)
                sourceLoc = nameNode;
            scope.addProblem(new ReturnValueHasNoTypeDeclarationProblem(sourceLoc, func.getBaseName()));
        }
    }
View Full Code Here

        ITypeDefinition srcType = null;
        if( iNode instanceof BinaryOperatorAssignmentNode)
        {
            if ( iNode.getChildCount() > 1 && iNode.getChild(1) instanceof IExpressionNode)
            {
                IExpressionNode rhs = (IExpressionNode)iNode.getChild(1);
                srcType = rhs.resolveType(project);
            }
        }
        else if(iNode instanceof IVariableNode)
        {
            IExpressionNode rhs = ((IVariableNode)iNode).getAssignedValueNode();
            srcType = rhs != null ? rhs.resolveType(project) : null;
        }
        return srcType;
    }
View Full Code Here

    }

    @Override
    public IDefinition resolveCalledExpression(ICompilerProject project)
    {
        IExpressionNode nameNode = getNameNode();
        return nameNode.resolve(project);
    }
View Full Code Here

            result = new NamespaceAccessExpressionNode(qualifier, op, right);
        }
        else if (left instanceof MemberAccessExpressionNode)
        {
            // In this case, we need to turn the right side into the full qualified bit.
            IExpressionNode maRight = ((MemberAccessExpressionNode)left).getRightOperandNode();
            if (maRight instanceof NamespaceIdentifierNode)
            {
                ((MemberAccessExpressionNode)left).setRightOperandNode(new NamespaceAccessExpressionNode((NamespaceIdentifierNode)maRight, op, right));
            }
            else if (maRight instanceof IdentifierNode)
            {
                ((MemberAccessExpressionNode)left).setRightOperandNode(new NamespaceAccessExpressionNode(new NamespaceIdentifierNode((IdentifierNode)maRight), op, right));
                //this is the @ case, so @x::y
            }
            else if (maRight instanceof UnaryOperatorNodeBase && ((UnaryOperatorNodeBase)maRight).getOperator() == OperatorType.AT)
            {
                ((UnaryOperatorNodeBase)maRight).setExpression(new NamespaceAccessExpressionNode((IdentifierNode)((UnaryOperatorNodeBase)maRight).getOperandNode(), op, right));
            }
            if (maRight.hasParenthesis() && maRight instanceof MemberAccessExpressionNode)
            {
                ((MemberAccessExpressionNode)left).setRightOperandNode(new NamespaceAccessExpressionNode(new QualifiedNamespaceExpressionNode((MemberAccessExpressionNode)maRight), op, right));
            }
            result = left;
        }
View Full Code Here

        writeToken(ASEmitterTokens.CLASS);
        getWalker().walk(node.getNameExpressionNode());
        write(ASEmitterTokens.SPACE);

        IExpressionNode bnode = node.getBaseClassExpressionNode();
        if (bnode != null)
        {
            writeToken(ASEmitterTokens.EXTENDS);
            getWalker().walk(bnode);
            write(ASEmitterTokens.SPACE);
View Full Code Here

        else
        {
            getWalker().walk(node.getNameExpressionNode());
            write(ASEmitterTokens.COLON);
            getWalker().walk(node.getVariableTypeNode());
            IExpressionNode anode = node.getAssignedValueNode();
            if (anode != null)
            {
                write(ASEmitterTokens.SPACE);
                writeToken(ASEmitterTokens.EQUAL);
                getWalker().walk(anode);
View Full Code Here

    @Override
    public void emitReturn(IReturnNode node)
    {
        write(ASEmitterTokens.RETURN);
        IExpressionNode rnode = node.getReturnValueNode();
        if (rnode != null && rnode.getNodeID() != ASTNodeID.NilID)
        {
            write(ASEmitterTokens.SPACE);
            getWalker().walk(rnode);
        }
    }
View Full Code Here

    protected void walkArguments(IExpressionNode[] nodes)
    {
        int len = nodes.length;
        for (int i = 0; i < len; i++)
        {
            IExpressionNode node = nodes[i];
            getWalker().walk(node);
            if (i < len - 1)
            {
                writeToken(ASEmitterTokens.COMMA);
            }
View Full Code Here

TOP

Related Classes of org.apache.flex.compiler.tree.as.IExpressionNode

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.