Examples of IMemberAccessExpressionNode


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

    @Override
    @Test
    public void testVisitLanguageIdentifierNode_SuperMember()
    {
        // (erikdebruin) this test doesn't make sense in FlexJS context
        IMemberAccessExpressionNode node = (IMemberAccessExpressionNode) getNode(
                "if (a) super.foo;", IMemberAccessExpressionNode.class);
        asBlockWalker.visitMemberAccessExpression(node);
        assertOut("super.foo");
    }
View Full Code Here

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

                ICompilerProblem p = null;
                // Look for the special case of "something." (empty right hand side).
                // Return a less perplexing error for this case.
                if (iNode instanceof IMemberAccessExpressionNode)
                {
                    IMemberAccessExpressionNode maen = (IMemberAccessExpressionNode)iNode;
                    IExpressionNode right = maen.getRightOperandNode();
                    if (right instanceof IIdentifierNode)
                    {
                        if (((IIdentifierNode)right).getName().isEmpty())
                        {
                            p = new MissingPropertyNameProblem(right);
View Full Code Here

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

        // More importantly, we need to make destination functions for the really gnarly cases.
        // Once we do that, we may decide to remove this...
       
        if (node instanceof IMemberAccessExpressionNode)
        {
            IMemberAccessExpressionNode maNode = (IMemberAccessExpressionNode)node;
            IExpressionNode left = maNode.getLeftOperandNode();
            IExpressionNode right = maNode.getRightOperandNode();
           if (left instanceof IIdentifierNode && right instanceof IIdentifierNode)
           {
               ret = ((IIdentifierNode) left).getName() + "." + ((IIdentifierNode) right).getName();
           }
           else
View Full Code Here

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

            return false;

        if (allowMembers && base instanceof IMemberAccessExpressionNode)
        {
            //  foo.super()
            IMemberAccessExpressionNode mnode = (IMemberAccessExpressionNode) base;
            if (mnode.getLeftOperandNode().getNodeID() == ASTNodeID.SuperID)
                return true;
        }

        return false;
    }
View Full Code Here

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

            ICompilerProject project)
    {
        // added super.foo(), wanted to 'this' behind foo
        if (node.getParent() instanceof IMemberAccessExpressionNode)
        {
            IMemberAccessExpressionNode mnode = (IMemberAccessExpressionNode) node
                    .getParent();
            if (mnode.getLeftOperandNode().getNodeID() == ASTNodeID.SuperID)
                return false;

            IExpressionNode indentFromThis = getIndentFromThis(node);
            if (node == indentFromThis)
                return true;

            // test that this is the base expression
            ExpressionNodeBase enode = (ExpressionNodeBase) node;
            ExpressionNodeBase baseExpression = enode.getBaseExpression();
            if (indentFromThis == null && baseExpression != null
                    && baseExpression != node)
                return false;

            // check to see if the left is a type
            ITypeDefinition type = mnode.getLeftOperandNode().resolveType(
                    project);

            // A.{foo} : Left is a Type
            // XXX going to have to test packgeName to com.acme.A
            if (type instanceof ClassTraitsDefinition
                    && mnode.getLeftOperandNode() == node)
            {
                return false;
            }
            // this.{foo} : explicit 'this', in js we are ignoring explicit this identifiers
            // because we are inserting all of them with the emitter
View Full Code Here

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

    private static boolean isThisLeftOf(IIdentifierNode node)
    {
        if (node.getParent() instanceof IMemberAccessExpressionNode)
        {
            IMemberAccessExpressionNode parent = (IMemberAccessExpressionNode) node
                    .getParent();
            if (parent.getLeftOperandNode() instanceof ILanguageIdentifierNode
                    && ((ILanguageIdentifierNode) parent.getLeftOperandNode())
                            .getKind() == LanguageIdentifierKind.THIS)
                return true;
        }
        return false;
    }
View Full Code Here

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

    private static IExpressionNode getIndentFromThis(IIdentifierNode node)
    {
        if (node.getParent() instanceof IMemberAccessExpressionNode)
        {
            IMemberAccessExpressionNode parent = (IMemberAccessExpressionNode) node
                    .getParent();
            if (parent.getLeftOperandNode() instanceof ILanguageIdentifierNode
                    && ((ILanguageIdentifierNode) parent.getLeftOperandNode())
                            .getKind() == LanguageIdentifierKind.THIS)
                return parent.getRightOperandNode();
        }
        return null;
    }
View Full Code Here

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

                if (NativeUtils.isNative(name))
                    exportWriter.addDependency(name, name, true, false);

                if (node.getParent() instanceof IMemberAccessExpressionNode)
                {
                    IMemberAccessExpressionNode mnode = (IMemberAccessExpressionNode) node
                            .getParent();
                    if (mnode.getLeftOperandNode().getNodeID() == ASTNodeID.SuperID)
                    {
                        IIdentifierNode lnode = (IIdentifierNode) mnode
                                .getRightOperandNode();

                        IClassNode cnode = (IClassNode) node
                                .getAncestorOfType(IClassNode.class);
View Full Code Here

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

    @Override
    @Test
    public void testVisitLanguageIdentifierNode_SuperMember()
    {
        // (erikdebruin) this test doesn't make sense in FlexJS context
        IMemberAccessExpressionNode node = (IMemberAccessExpressionNode) getNode(
                "if (a) super.foo;", IMemberAccessExpressionNode.class);
        asBlockWalker.visitMemberAccessExpression(node);
        assertOut("super.foo");
    }
View Full Code Here

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

{

    @Test
    public void testVisitLanguageIdentifierNode_This()
    {
        IMemberAccessExpressionNode node = (IMemberAccessExpressionNode) getNode(
                "if (a) this.a;", IMemberAccessExpressionNode.class);
        asBlockWalker.visitMemberAccessExpression(node);
        assertOut("this.a");
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.