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

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


     @return a feasible cost (1) if the node is for 'new Array()'
     */
    int isEmptyArrayConstructor(IASNode iNode)
    {
        ICompilerProject project = currentScope.getProject();
        IIdentifierNode identifierNode = (IIdentifierNode)SemanticUtils.getNthChild(iNode, 1);
        if (identifierNode.resolve(project) == project.getBuiltinType(BuiltinType.ARRAY))
            return 1;

        return Integer.MAX_VALUE;
    }
View Full Code Here


     @return a feasible cost (1) if the node is for 'new Object()'
     */
    int isEmptyObjectConstructor(IASNode iNode)
    {
        ICompilerProject project = currentScope.getProject();
        IIdentifierNode identifierNode = (IIdentifierNode)SemanticUtils.getNthChild(iNode, 1);
        if (identifierNode.resolve(project) == project.getBuiltinType(BuiltinType.OBJECT))
            return 1;

        return Integer.MAX_VALUE;
    }
View Full Code Here

        {
            IExpressionNode arrayNode = ((IDynamicAccessNode)iNode).getLeftOperandNode();
            if (arrayNode instanceof ILanguageIdentifierNode &&
                ((ILanguageIdentifierNode)arrayNode).getKind() == LanguageIdentifierKind.SUPER)
            {
                IIdentifierNode superNode = (IIdentifierNode)arrayNode;
                superDef = superNode.resolveType(project);
            }
        }

        Nsset nsSet = superDef != null ?
                      SemanticUtils.getOpenNamespacesForSuper(iNode, project, superDef) :
View Full Code Here

        node.normalize(true);
        IdentifierNode configNamespaceNode = (IdentifierNode)node.getNamespaceNode();
        IDefinitionSet set = configScope.getASScope().getLocalDefinitionSetByName(configNamespaceNode.getName());
        if (set == null)
        {
            IIdentifierNode namespaceNode = (IdentifierNode)node.getNamespaceNode();
            ICompilerProblem problem = new UndefinedConfigNamespaceProblem(namespaceNode, namespaceNode.getName());
            addProblem(problem);
            return false;
        }

        configScope.addItemAfterNormalization(node);
View Full Code Here

    @Override
    public void emitIterationFlow(IIterationFlowNode node)
    {
        write(node.getKind().toString().toLowerCase());
        IIdentifierNode lnode = node.getLabelNode();
        if (lnode != null)
        {
            write(ASEmitterTokens.SPACE);
            getWalker().walk(lnode);
        }
View Full Code Here

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

                        IClassNode cnode = (IClassNode) node
                                .getAncestorOfType(IClassNode.class);

                        initializeInheritenceLevel(cnode.getDefinition());

                        // super.foo();
                        write("this.");

                        write(lnode.getName() + "$" + inheritenceLevel);

                        baseClassCalls.add(resolve);

                        return;
                    }
View Full Code Here

        {
            write("");
        }
        else if (node.getKind() == ILanguageIdentifierNode.LanguageIdentifierKind.SUPER)
        {
            IIdentifierNode inode = (IIdentifierNode) node;
            if (inode.getParent() instanceof IMemberAccessExpressionNode)
            {

            }
            else
            {
View Full Code Here

            // (erikdebruin) rewrite 'a &&= b' to 'a = a && b'
            if (id == ASTNodeID.Op_LogicalAndAssignID
                    || id == ASTNodeID.Op_LogicalOrAssignID)
            {
                IIdentifierNode lnode = (IIdentifierNode) node
                        .getLeftOperandNode();

                writeToken(ASEmitterTokens.EQUAL);
                writeToken(lnode.getName());
                write((id == ASTNodeID.Op_LogicalAndAssignID) ? ASEmitterTokens.LOGICAL_AND
                        : ASEmitterTokens.LOGICAL_OR);
            }
            else
            {
View Full Code Here

      "implements=' I1 '"
    };
    IMXMLImplementsNode node = getMXMLImplementsNode(code);
    assertThat("getChildCount", node.getChildCount(), is(1));
    assertThat("getInterfaceNodes.length", node.getInterfaceNodes().length, is(1));
    IIdentifierNode interfaceNode0 = node.getInterfaceNodes()[0];
    assertThat("interfaceNode0", interfaceNode0, is(node.getChild(0)));
    assertThat("interfaceNode0.getNodeID", interfaceNode0.getNodeID(), is(ASTNodeID.IdentifierID));
    assertThat("interfaceNode0.getName", interfaceNode0.getName(), is("I1"));
  }
View Full Code Here

      "implements=' a.b.I1 , c.d.I2 '"
    };
    IMXMLImplementsNode node = getMXMLImplementsNode(code);
    assertThat("getChildCount", node.getChildCount(), is(2));
    assertThat("getInterfaceNodes.length", node.getInterfaceNodes().length, is(2));
    IIdentifierNode interfaceNode0 = node.getInterfaceNodes()[0];
    assertThat("interfaceNode0", interfaceNode0, is(node.getChild(0)));
    assertThat("interfaceNode0.getNodeID", interfaceNode0.getNodeID(), is(ASTNodeID.FullNameID));
    assertThat("interfaceNode0.getName", interfaceNode0.getName(), is("a.b.I1"));
    IIdentifierNode interfaceNode1 = node.getInterfaceNodes()[1];
    assertThat("interfaceNode1", interfaceNode1, is(node.getChild(1)));
    assertThat("interfaceNode1.getNodeID", interfaceNode1.getNodeID(), is(ASTNodeID.FullNameID));
    assertThat("interfaceNode1.getName", interfaceNode1.getName(), is("c.d.I2"));
  }
View Full Code Here

TOP

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

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.