Examples of IDefinition


Examples of org.apache.flex.compiler.definitions.IDefinition

        return inlineFunction(accessorDefinition, functionNode, result, isQualified);
    }

    private boolean generateInlineSetterAccess(Binding binding, InstructionList result, boolean isQualified)
    {
        IDefinition def = binding.getDefinition();
        if (!(def instanceof AccessorDefinition && currentScope.getMethodBodySemanticChecker().canSetterBeInlined((AccessorDefinition)def)))
            return false;

        AccessorDefinition accessorDefinition = (AccessorDefinition)def;
        if (accessorDefinition instanceof GetterDefinition)
View Full Code Here

Examples of org.apache.flex.compiler.definitions.IDefinition

        String value = attribute.getRawValue();

        if (attribute.isSpecialAttribute(ATTRIBUTE_TYPE))
        {
            FlexProject project = builder.getProject();
            IDefinition def = resolveElementType(value, project);

            if (def instanceof ITypeDefinition)
            {
                type = (ITypeDefinition)def;
            }
View Full Code Here

Examples of org.apache.flex.compiler.definitions.IDefinition

        return inlineFunction(accessorDefinition, functionNode, result, isQualified);
    }

    private boolean generateInlineFunctionCall(Binding binding, InstructionList result, boolean isQualified, Vector<InstructionList> args)
    {
        IDefinition def = binding.getDefinition();
        if (!(def instanceof FunctionDefinition && (!(def instanceof IAccessorDefinition)) && currentScope.getMethodBodySemanticChecker().canFunctionBeInlined((FunctionDefinition)def)))
            return false;

        FunctionDefinition functionDef = (FunctionDefinition)binding.getDefinition();
        FunctionNode functionNode = (FunctionNode)functionDef.getFunctionNode();
View Full Code Here

Examples of org.apache.flex.compiler.definitions.IDefinition

     * Helper method to convert the type string into an IDefinition. This method
     * will handle nested vectors, like a Vector of Vectors of Vectors of Foo.
     */
    private IDefinition resolveElementType(String value, FlexProject project)
    {
        IDefinition def = null;
        int dotLessIdx = value.indexOf(DOT_LESS_THAN_ESCAPED);
        if (dotLessIdx != -1)
        {
            int endIdx = value.lastIndexOf(GREATER_THAN_ESCAPED);
            if (endIdx != -1)
            {
                // We have something that looks like a parameterized type - pull apart the base name
                // and type arg, and try to resolve them to a Vector.
                // When we add real generic support, we'll need to revisit this code

                // Resolve the element type - it could be yet another Vector, so call this method again
                // e.g. Vector.<Vector.<Vector.<Vector.<Turtles>>>>
                String typeArg = value.substring(dotLessIdx + 5, endIdx);
                IDefinition typeParam = resolveElementType(typeArg, project);

                String baseName = value.substring(0, dotLessIdx);

                IDefinition baseType = null;
                // Get the base type
                if (baseName.equals(IASLanguageConstants.Vector))
                    baseType = project.getBuiltinType(IASLanguageConstants.BuiltinType.VECTOR);
                else
                    baseType = project.getScope().findDefinitionByName(baseName);

                if (baseType instanceof ITypeDefinition && typeParam instanceof ITypeDefinition)
                {
                    IDefinition vectorType = project.getBuiltinType(IASLanguageConstants.BuiltinType.VECTOR);

                    if (baseType == vectorType) //only vectors are parameterizable today
                    {
                        def = AppliedVectorDefinitionFactory.newVector(project, (ITypeDefinition)typeParam);
                    }
View Full Code Here

Examples of org.apache.flex.compiler.definitions.IDefinition

                                   IMXMLTagData childTag,
                                   MXMLNodeInfo info)
    {
        FlexProject project = builder.getProject();
        String tagName = builder.getFileScope().resolveTagToQualifiedName(childTag);
        IDefinition definition = project.getScope().findDefinitionByName(tagName);
        if (definition instanceof ClassDefinition)
        {
            // Check whether the child tag is compatible with the 'type' attribute.
            // Have to get the type from the child tag, in case it's another Vector type,
            // which won't have a simple string type.
View Full Code Here

Examples of org.apache.flex.compiler.definitions.IDefinition

                    scriptNode.initializeFromTag(builder, tag);
                    children.add(scriptNode);
                }
                else
                {
                    IDefinition definition = builder.getFileScope().resolveTagToDefinition(tag);
                    if (definition instanceof IClassDefinition)
                    {
                        MXMLInstanceNode childNode = MXMLInstanceNode.createInstanceNode(
                                builder, definition.getQualifiedName(), this);
                        childNode.setClassReference(project, (ClassDefinition)definition); // TODO Move this logic to initializeFromTag().
                        childNode.initializeFromTag(builder, tag);
                        children.add(childNode);
                    }
                }
View Full Code Here

Examples of org.apache.flex.compiler.definitions.IDefinition

        {
            boolean inlined = generateInlineSetterAccess(target, result, false);

            if (!inlined)
            {
                IDefinition def = target.getDefinition();
                if (def instanceof GetterDefinition)
                {
                    boolean isSuper = target.isSuperQualified();
                    SetterDefinition setter = (SetterDefinition)((GetterDefinition)def).
                                resolveCorrespondingAccessor(currentScope.getProject());
View Full Code Here

Examples of org.apache.flex.compiler.definitions.IDefinition

     *    it's a compile-time constant qualifier.
     */
    int qualifierIsCompileTimeConstant(IASNode iNode)
    {
        IdentifierNode qualifier = (IdentifierNode)SemanticUtils.getNthChild(iNode, 0);
        IDefinition def = qualifier.resolve(currentScope.getProject());

        int result = def instanceof NamespaceDefinition ? 1 : Integer.MAX_VALUE;
        return result;
    }
View Full Code Here

Examples of org.apache.flex.compiler.definitions.IDefinition

        InstructionList result = createInstructionList(iNode);

        if ( unary.isLocal() ) {
            ICompilerProject project = currentScope.getProject();

            IDefinition inType = SemanticUtils.resolveUnaryExprType(iNode, project);

            IDefinition intType = project.getBuiltinType(BuiltinType.INT);
            IDefinition numberType = project.getBuiltinType(BuiltinType.NUMBER);
            if( inType == intType)
            {
                // Decrementing a local, typed as int
                // we can use declocal_i since we know the result will be stored in an int
                if( need_result )
View Full Code Here

Examples of org.apache.flex.compiler.definitions.IDefinition

        InstructionList result = createInstructionList(iNode);

        if ( unary.isLocal() ) {
            ICompilerProject project = currentScope.getProject();

            IDefinition inType = SemanticUtils.resolveUnaryExprType(iNode, project);

            IDefinition intType = project.getBuiltinType(BuiltinType.INT);
            IDefinition numberType = project.getBuiltinType(BuiltinType.NUMBER);
            if( inType == intType)
            {
                // Incrementing a local, typed as int
                // we can use inclocal_i since we know the result will be stored in an int
                if( need_result )
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.