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

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


        final IASNode node = binding.getNode();
        if ( name.isTypeName() )
        {
            // a type names node should always be a ITypedExpressionNode
            ITypedExpressionNode typeNode = (ITypedExpressionNode)node;
            IExpressionNode collectionNode = typeNode.getCollectionNode();
            IDefinition collectionDefinition = SemanticUtils.getDefinition(collectionNode, currentScope.getProject());
            Binding collectionBinding = currentScope.getBinding(collectionNode, name.getTypeNameBase(), collectionDefinition);
            generateAccess(collectionBinding, is_super, AccessType.Strict, result);

            IExpressionNode typeTypeNode = typeNode.getTypeNode();
            IDefinition typeDefinition = SemanticUtils.getDefinition(typeTypeNode, currentScope.getProject());
            Binding typeBinding = currentScope.getBinding(typeTypeNode, name.getTypeNameParameter(), typeDefinition);
            generateTypeNameParameter(typeBinding, result);

            result.addInstruction(OP_applytype, 1);
View Full Code Here


        {
            return reduce_trivial_switchStmt(iNode, switch_expr);
        }
        else
        {
            IExpressionNode conditional = ((SwitchNode)iNode).getConditionalNode();
            LookupSwitchInfo lookupSwitchInfo = getLookupSwitchInfo(conditional, cases);

            if (lookupSwitchInfo != null)
                return reduce_lookup_switchStmt(iNode, switch_expr, cases, lookupSwitchInfo);
            else
View Full Code Here

        ITypeDefinition destinationType = null;
        if (isBracketAssign)
            destinationType = binaryNode.getLeftOperandNode().resolveType(currentScope.getProject());
        TernaryOperatorNode ternaryNode = (TernaryOperatorNode)iNode;
       
        IExpressionNode valueNode;       
        IDefinition type_def; //= valueNode.resolveType(currentScope.getProject()); //SemanticUtils.getDefinitionOfUnderlyingType(,
                           // true, currentScope.getProject());
        boolean need_coerce = false;
       
        InstructionList result = createInstructionList(iNode, test.size() + when_true.size() + when_false.size() + 2);
        Label tail = new Label();

        result.addAll(test);
        result.addInstruction(OP_iffalse, when_false.getLabel());
        result.addAll(when_true);
        valueNode = ternaryNode.getLeftOperandNode();
        type_def = valueNode.resolveType(currentScope.getProject());
        need_coerce = type_def != null && !type_def.equals(destinationType);
        if (need_coerce && isBracketAssign)
            coerce(result, destinationType);
        result.addInstruction(OP_jump, tail);
        result.addAll(when_false);
        valueNode = ternaryNode.getRightOperandNode();
        type_def = valueNode.resolveType(currentScope.getProject());
        need_coerce = type_def != null && !type_def.equals(destinationType);
        if (need_coerce && isBracketAssign)
            coerce(result, destinationType);
        result.labelNext(tail);
View Full Code Here

        // If so, the namespace set will be slightly different; it will have
        // ProtectedNs(thisClass) instead of ProtectedNs(superClass>.
        IDefinition superDef = null;
        if (iNode instanceof IDynamicAccessNode)
        {
            IExpressionNode arrayNode = ((IDynamicAccessNode)iNode).getLeftOperandNode();
            if (arrayNode instanceof ILanguageIdentifierNode &&
                ((ILanguageIdentifierNode)arrayNode).getKind() == LanguageIdentifierKind.SUPER)
            {
                IIdentifierNode superNode = (IIdentifierNode)arrayNode;
                superDef = superNode.resolveType(project);
View Full Code Here

            return;
       
        if (isChildrenAsDataCodeGen(classNode, context))
            context.addInstruction(OP_pushtrue); // simple type

        IExpressionNode expressionNode = (IExpressionNode)classNode.getExpressionNode();
        if (expressionNode != null)
        {
            InstructionList init_expression = classScope.getGenerator().generateInstructions(
                expressionNode, CmcEmitter.__expression_NT, this.classScope);
            context.addAll(init_expression);
View Full Code Here

            return;
       
        if (isChildrenAsDataCodeGen(functionNode, context))
            context.addInstruction(OP_pushtrue); // simple type

        IExpressionNode expressionNode = (IExpressionNode)functionNode.getExpressionNode();
        if (expressionNode != null)
        {
            InstructionList init_expression = classScope.getGenerator().generateInstructions(
                expressionNode, CmcEmitter.__expression_NT, this.classScope);
            context.addAll(init_expression);
View Full Code Here

        // Don't call skipCodegen() because a parameterless RegExp is represented
        // by the expression node being null.
        if (isDataBindingNode(regexpNode))
            return;
       
        IExpressionNode expressionNode = (IExpressionNode)regexpNode.getExpressionNode();
        if (expressionNode != null )
        {
            InstructionList init_expression = classScope.getGenerator().generateInstructions(
                expressionNode, CmcEmitter.__expression_NT, this.classScope);
            context.addAll(init_expression);
View Full Code Here

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

        ASModifier[] modifiers = modifiersSet.getAllModifiers();
        IExpressionNode site = f.getNameExpressionNode();
        for (ASModifier modifier : modifiers)
        {
            verifyModifier(site, modifier);
        }
        currentScope.getMethodBodySemanticChecker().checkForDuplicateModifiers(f);
View Full Code Here

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

        ASModifier[] modifiers = modifiersSet.getAllModifiers();
        IExpressionNode site = v.getNameExpressionNode();
        for (ASModifier modifier : modifiers)
        {
            // native on a variable generates a different error
            if (modifier == ASModifier.NATIVE)
            {
View Full Code Here

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

        ASModifier[] modifiers = modifiersSet.getAllModifiers();
        IExpressionNode site = c.getNameExpressionNode();
        for (ASModifier modifier : modifiers)
        {
            // final allowed on a class
            if( modifier == ASModifier.FINAL || modifier == ASModifier.DYNAMIC)
            {
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.