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

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


        return result;
    }

    public InstructionList reduce_typedVariableDecl(IASNode iNode, Name var_name, Binding var_type, Vector<InstructionList> chained_decls)
    {
        BaseVariableNode var_node = (BaseVariableNode)iNode;
        currentScope.getMethodBodySemanticChecker().checkVariableDeclaration(iNode);

        // Must check for this before we call makeVariable, but need to emit the instructions after
        // makeVariable so that Bindings are set up correctly with the right local register indexes.
        boolean needsHoistedInitInsns = currentScope.needsHoistedInitInsns(var_name, false);

        Binding var = currentScope.resolveName((IdentifierNode)var_node.getNameExpressionNode());
        currentScope.makeVariable(var, var_type.getName(), ((BaseDefinitionNode)iNode).getMetaInfos());

        // Now that makeVariable is done, emit the hoisted instructions if we needed them.
        if(needsHoistedInitInsns)
            addHoistedInstructionsForVarDecl(var_name, var_type);
View Full Code Here


        }
    }

    public InstructionList reduce_typedVariableDeclWithInitializer(IASNode iNode, Name var_name, Binding var_type, InstructionList var_initializer, Vector<InstructionList> chained_decls)
    {
        BaseVariableNode var_node = (BaseVariableNode)iNode;

        currentScope.getMethodBodySemanticChecker().checkVariableDeclaration(iNode);

        // Must check for this before we call makeVariable, but need to emit the instructions after
        // makeVariable so that Bindings are set up correctly with the right local register indexes.
        boolean refedBeforeInited = currentScope.needsHoistedInitInsns(var_name, true);
       
        Binding var = currentScope.resolveName((IdentifierNode)var_node.getNameExpressionNode());
        currentScope.makeVariable(var, var_type.getName(), ((BaseDefinitionNode)iNode).getMetaInfos());

        // If the binding has already been referenced, then we need to emit some hoisted init instructions
        // so that the initial value will be correct.
        if( refedBeforeInited )
View Full Code Here

        return result;
    }

    public InstructionList reduce_typedVariableDeclWithConstantInitializer(IASNode iNode, Name var_name, Binding var_type, Object constant_var_initializer, Vector<InstructionList> chained_decls)
    {
        BaseVariableNode var_node = (BaseVariableNode)iNode;
        PooledValue transformed_constant_initializer =
            currentScope.getMethodBodySemanticChecker().checkInitialValue(var_node, var_type, new PooledValue(constant_var_initializer));

        // if this definition isn't a const, then just use the normal variable initialization, as
        // we only initialize the const slots and not var slots
        if (!SemanticUtils.isConst(iNode, currentScope.getProject()))
        {
            InstructionList var_initializer = transform_pooled_value(iNode, transformed_constant_initializer);
            return reduce_typedVariableDeclWithInitializer(iNode, var_name, var_type, var_initializer, chained_decls);
        }

        currentScope.getMethodBodySemanticChecker().checkVariableDeclaration(iNode);
        InstructionList result = createInstructionList(iNode);
        Binding var = currentScope.resolveName((IdentifierNode)var_node.getNameExpressionNode());
        currentScope.makeVariable(var, var_type.getName(), ((BaseDefinitionNode)iNode).getMetaInfos(), transformed_constant_initializer.getValue());

        //  If the variable is in a local, then it needs to be initialized at the start of the method.
        if ( var.isLocal() )
        {
View Full Code Here

        return result;
    }

    public InstructionList reduce_typedBindableVariableDecl(IASNode iNode, Name name, Binding var_type, Vector<InstructionList> chained_decls)
    {
        BaseVariableNode vn = (BaseVariableNode)iNode;
        currentScope.getMethodBodySemanticChecker().checkBindableVariableDeclaration(iNode, vn.getDefinition());
        InstructionList result = createInstructionList(iNode);
        Binding var = currentScope.resolveName((IdentifierNode)vn.getNameExpressionNode());
        currentScope.makeBindableVariable(var, var_type.getName(), vn.getMetaInfos());
        for ( InstructionList decl: chained_decls )
             result.addAll(decl);

        return result;
    }
View Full Code Here

        return result;
    }
    public InstructionList reduce_typedBindableVariableDeclWithInitializer(IASNode iNode, Name var_name, Binding var_type, InstructionList var_initializer, Vector<InstructionList> chained_decls)
    {
        BaseVariableNode vn = (BaseVariableNode)iNode;
        currentScope.getMethodBodySemanticChecker().checkBindableVariableDeclaration(iNode, vn.getDefinition());
        Binding var = currentScope.resolveName((IdentifierNode)vn.getNameExpressionNode());
        currentScope.makeBindableVariable(var, var_type.getName(), vn.getMetaInfos());
        // pass in null as definition so the assignment goes to the backing var and not the setter
        // maybe we'll have to get the actual var def someday.
        InstructionList result = generateAssignment(iNode, new Binding(iNode, BindableHelper.getBackingPropertyName(var_name), null), var_initializer);
        for ( InstructionList decl: chained_decls )
             result.addAll(decl);
View Full Code Here

        return result;
    }
    public Binding reduce_typedVariableExpression(IASNode iNode, Name var_name, Binding var_type)
    {
        VariableExpressionNode var_expr_node = (VariableExpressionNode)iNode;
        BaseVariableNode var_node = (BaseVariableNode) var_expr_node.getTargetVariable();
        currentScope.getMethodBodySemanticChecker().checkVariableDeclaration(SemanticUtils.getNthChild(iNode, 0));
        Binding var = currentScope.resolveName((IdentifierNode)var_node.getNameExpressionNode());
        currentScope.makeVariable(var, var_type.getName(), var_node.getMetaInfos());

        return var;
    }
View Full Code Here

TOP

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

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.