Examples of IFunctionDefinition


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

            builder.addProblem(problem);
            return;
        }

        // Report a problem is that class's constructor has required parameters.
        IFunctionDefinition constructor = tagDefinition.getConstructor();
        if (constructor != null && constructor.hasRequiredParameters())
        {
            ICompilerProblem problem = new MXMLConstructorHasParametersProblem(rootTag, tagDef.getQualifiedName());
            builder.addProblem(problem);
            return;
        }
View Full Code Here

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

     * and not function expressions.
     * @param funcNode  The node of the nested function
     */
    public void checkNestedFunctionDecl(IFunctionNode funcNode)
    {
        IFunctionDefinition funcDef = funcNode.getDefinition();
        List<IDefinition> defs = SemanticUtils.findPotentialFunctionConflicts(currentScope.getProject(), funcDef);

        // Check for potential dups - functions can be redeclared and won't be ambiguous, but in strict mode
        // we want to issue an error.
        // Don't need to worry about getter/setter pairs as you can't declare nested getter/setters
        if( defs.size() > 1 )
        {
            ICompilerProblem problem = new DuplicateFunctionDefinitionProblem(funcNode, funcDef.getBaseName());
            this.currentScope.addProblem(problem);
        }
    }
View Full Code Here

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

        if ( enclosing_class != null )
        {
            IClassDefinition super_def = enclosing_class.getDefinition().resolveBaseClass(project);
            if (super_def != null)
            {
                IFunctionDefinition ctor = super_def.getConstructor();

                if (ctor instanceof FunctionDefinition)
                {
                    FunctionDefinition func = (FunctionDefinition)ctor;
                    if (func.getParameters() != null && func.getParameters().length != 0)
View Full Code Here

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

        //  Check parameters if possible.
        ClassDefinition super_def = (ClassDefinition) super_node.resolveType(project);

        if (super_def != null)
        {
            IFunctionDefinition ctor = super_def.getConstructor();

            if (ctor instanceof FunctionDefinition)
            {
                checkFormalsVsActuals(super_node, (FunctionDefinition)ctor, args);
            }
View Full Code Here

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

        }
        else if ( def instanceof ClassDefinition )
        {
            ClassDefinition class_def = (ClassDefinition)def;

            IFunctionDefinition ctor = class_def.getConstructor();

            if ( ctor instanceof FunctionDefinition )
            {
                FunctionDefinition func = (FunctionDefinition)ctor;
                checkFormalsVsActuals(iNode, func, args);
View Full Code Here

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

        if (metaTags == null)
            metaTags = new IMetaTag[0];
        if (definition instanceof ClassDefinition)
        {
            ClassDefinition classDef = (ClassDefinition)definition;
            IFunctionDefinition constructor = classDef.getConstructor();
            if (constructor != null)
            {
                IMetaTag ctorGotoDefHelpTag = findMetaTag(IMetaAttributeConstants.ATTRIBUTE_GOTODEFINITION_CTOR_HELP);
                if (ctorGotoDefHelpTag != null)
                    setNameLocation(constructor, ctorGotoDefHelpTag);
View Full Code Here

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

        while (iter.hasNext())
        {
            final IInterfaceDefinition intf = iter.next();

            // In each interface, look for a method matching this one.
            final IFunctionDefinition f = findMatchingMethod(intf, project);
            if (f != null)
                return f;
        }

        return null;
View Full Code Here

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

    {
        boolean match = super.matches(definition);
        if (!match)
            return false;

        IFunctionDefinition functionDefinition = (IFunctionDefinition)definition;

        FunctionClassification classification = functionDefinition.getFunctionClassification();
        if (classification != getFunctionClassification())
            return false;

        // Along with local and file member, name offsets needs to be compared for class/interface members also.
        // This is required to differentiate members having same name belonging to different class/interface
        // within the same AS file - See FBG-3494 for an example.
        if (classification == FunctionClassification.LOCAL || classification == FunctionClassification.FILE_MEMBER
                || classification == FunctionClassification.CLASS_MEMBER || classification == FunctionClassification.INTERFACE_MEMBER)
        {
            if (functionDefinition.getNameStart() != getNameStart() ||
                functionDefinition.getNameEnd() != functionDefinition.getNameEnd())
            {
                return false;
            }
        }
        if (functionDefinition instanceof ISetterDefinition && !(this instanceof ISetterDefinition))
            return false;
        if (functionDefinition instanceof IGetterDefinition && !(this instanceof IGetterDefinition))
            return false;
        if (functionDefinition.isConstructor() && !isConstructor())
            return false;

        //TODO match params?
        if (functionDefinition.getParameters().length != getParameters().length)
            return false;

        return true;
    }
View Full Code Here

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

            if (variable.isStatic())
                return false;
        }
        if (definition instanceof IFunctionDefinition)
        {
            IFunctionDefinition function = (IFunctionDefinition) definition;
            if (function.isStatic())
                return false;
        }

        return true;
    }
View Full Code Here

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

        }

        FunctionNode fn = (FunctionNode) node;
        fn.parseFunctionBody(getProblems());

        IFunctionDefinition definition = node.getDefinition();

        emitNamespaceIdentifier(node);
        emitModifiers(definition);
        emitMemberKeyword(node);
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.