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

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


        // 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


       
        // we there are multiple children, then we can't be a simple prop
        if (expressionNodesForGetter.size() != 1)
            return;
       
        IExpressionNode expressionNodeForGetter = expressionNodesForGetter.get(0);
        if (expressionNodeForGetter instanceof IIdentifierNode)
        {
            String name = ((IIdentifierNode)expressionNodeForGetter).getName();
            IReference ref = ReferenceFactory.lexicalReference(project.getWorkspace(), name);
            IDefinition def = ref.resolve(project, scope, DependencyType.EXPRESSION, false);
View Full Code Here

        IExpressionNode[] raw_interfaces = this.interfaceNode.getExtendedInterfaceNodes();
        iinfo.interfaceNames = new Name[raw_interfaces.length];

        for ( int i = 0; i < raw_interfaces.length; i++)
        {
            IExpressionNode extendedInterface = raw_interfaces[i];
            IDefinition extendedDefinition = extendedInterface.resolve(interfaceScope.getProject());
           
            if ( extendedDefinition instanceof IInterfaceDefinition )
            {
                Name interfaceName = ((DefinitionBase)extendedDefinition).getMName(interfaceScope.getProject());
                iinfo.interfaceNames[i] = interfaceName;
View Full Code Here

        ModifiersSet modifiersSet = f.getModifiers();
        if (modifiersSet == null)
            return;

        ASModifier[] modifiers = modifiersSet.getAllModifiers();
        IExpressionNode site = f.getNameExpressionNode();
        for (ASModifier modifier : modifiers)
        {
            if( modifier == ASModifier.STATIC )
            {
                this.interfaceScope.addProblem(new StaticOutsideClassProblem(site));
View Full Code Here

                BindingCodeGenUtils.generateGetter(emitter, ret, bi.getExpressionNodesForGetter(), host.getInstanceScope());
            }
            else
                ret.addInstruction(OP_pushstring, s);
           
            IExpressionNode destNode = bi.getExpressionNodeForDestination();
            if (destNode != null)
                BindingCodeGenUtils.generateSetter(ret, destNode, host.getInstanceScope());
            else
                ret.addInstruction(OP_pushnull);
           
View Full Code Here

   
    private String getSourceStringFromMemberAccessExpressionNode(MemberAccessExpressionNode node)
    {
        String s = "";
       
        IExpressionNode left = node.getLeftOperandNode();
        if (left instanceof FunctionCallNode) //  probably a cast
        {
            IASNode child = ((FunctionCallNode)left).getArgumentsNode().getChild(0);
            if (child instanceof IdentifierNode)
                s = getSourceStringFromIdentifierNode((IdentifierNode)child);
            else if (child instanceof MemberAccessExpressionNode)
                s = getSourceStringFromMemberAccessExpressionNode((MemberAccessExpressionNode)child);
        }
        else if (left instanceof MemberAccessExpressionNode)
            s = getSourceStringFromMemberAccessExpressionNode((MemberAccessExpressionNode)left);
        else if (left instanceof IdentifierNode)
            s = getSourceStringFromIdentifierNode((IdentifierNode)left);
        else if (left instanceof BinaryOperatorAsNode)
        {
            left = (IExpressionNode)((BinaryOperatorAsNode)left).getChild(0);
            if (left instanceof MemberAccessExpressionNode)
                s = getSourceStringFromMemberAccessExpressionNode((MemberAccessExpressionNode)left);
            else if (left instanceof IdentifierNode)
                s = getSourceStringFromIdentifierNode((IdentifierNode)left);
            else
                System.out.println("expected binding BinaryOperatorAsNode left node" + node.toString());
        }
        else
            System.out.println("expected binding member access left node" + node.toString());
        s += ".";
       
        IExpressionNode right = node.getRightOperandNode();
        if (right instanceof FunctionCallNode) //  probably a cast
        {
            IASNode child = ((FunctionCallNode)right).getArgumentsNode().getChild(0);
            if (child instanceof IdentifierNode)
                s += getSourceStringFromIdentifierNode((IdentifierNode)child);
View Full Code Here

    }
   
    private String getSourceStringFromGetter(List<IExpressionNode> nodes)
    {
        String s = "";
        IExpressionNode node = nodes.get(0);
        if (node instanceof MemberAccessExpressionNode)
        {
            s = getSourceStringFromMemberAccessExpressionNode((MemberAccessExpressionNode)node);
        }
        else if (node instanceof IdentifierNode)
View Full Code Here

       
        assert state.functionCallNameDefintion == null;     // we can't nest (yet?)
       
        // First, let's get the node the represents the function name.
        // That's the one that will have the binding metadata
        IExpressionNode nameNode = node.getNameNode();
       
        IDefinition nameDef = nameNode.resolve(project);
       
        // we ignore non-bindable functions
        // we also ignore functions that don't resolve - they are dynamic, and hence
        // not watchable
        if (nameDef!=null && nameDef.isBindable())
View Full Code Here

        final boolean wasChaining = state.chaining;

       
        state.chaining = true;      // member access expressions require chained watcher.
                                    // ex: {a.b} - the watcher for b will be a child of a
        final IExpressionNode left = node.getLeftOperandNode();
        final IExpressionNode right = node.getRightOperandNode();
 
        final IDefinition leftDef = left.resolve(project);
        final IDefinition rightDef = right.resolve(project);
        if (leftDef instanceof IClassDefinition)
        {
            // In this case, is foo.prop, where "foo" is a class name.
            // We can skip over the left side ("foo"), because when we
            // analyze the right side we will still know what it is.
View Full Code Here

     * Do this by walking up and down the tree, building up instruction list
     */
    public  static IExpressionNode makeDestinationFunctionInstructionList(IMXMLDataBindingNode dbnode,
            MXMLClassDirectiveProcessor host)
    {  
        IExpressionNode ret = null;
        final IASNode parent = dbnode.getParent();
       
     
        // We only know how to make dest functions in very specific cases 
        // Case 1: we are in the <fx:Model> tag
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.