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

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


    private boolean needsBindableDefinition()
    {
        if (hasEmptyBindableMetadata(getMetaTagsNode()))
            return true;

        INamespaceDecorationNode nsNode = getNamespaceNode();
        if (nsNode != null && nsNode.getName() == INamespaceConstants.public_)
        {
            ClassNode cls = (ClassNode)getAncestorOfType(ClassNode.class);
            if (cls != null && hasEmptyBindableMetadata(cls.getMetaTags()))
                return true;
        }
View Full Code Here


    }
   
    @Override
    public INamespaceDecorationNode getNamespaceNode()
    {
        INamespaceDecorationNode namespaceNode = super.getNamespaceNode();
       
        if (isConstructor())
        {
            if (namespaceNode != null && namespaceNode.getName().equals(INamespaceConstants.public_))
                return namespaceNode;
            NamespaceIdentifierNode pub = new NamespaceIdentifierNode(INamespaceConstants.public_);
            pub.span(-1, -1, -1, -1);
            pub.setDecorationTarget(this);
            return pub;
View Full Code Here

    }
   
    @Override
    public String getNamespace()
    {
        INamespaceDecorationNode ns = getNamespaceNode();
        if (ns != null)
        {
            String nameString = ns.getName();
            // If public, just return it.
            if (nameString.equals(INamespaceConstants.public_))
                return nameString;

            // Otherwise, check to see if we are a constructor.
View Full Code Here

        // to the CM Implicit namespace.
        // This happens for code like:  private::foo
        // when the code is outside of a class (so there is no private).
        if( qualifier == NamespaceDefinition.getCodeModelImplicitDefinitionNamespace() )
        {
            INamespaceDecorationNode nsNode = (INamespaceDecorationNode)iNode;
            String nsString = nsNode.getName();
            if( nsString == IASKeywordConstants.PUBLIC )
            {
                addProblem(new InvalidPublicNamespaceProblem(nsNode) );
            }
            else if( nsString == IASKeywordConstants.PROTECTED )
View Full Code Here

            // This should only happen if an invalid access namespace was specified
            // e.g. private outside of a class
            BaseDefinitionNode bdn = iNode instanceof BaseDefinitionNode ? (BaseDefinitionNode)iNode : null;
            if( bdn != null )
            {
                INamespaceDecorationNode nsNode = bdn.getNamespaceNode();
                if( nsNode != null )
                {
                    String nsString = nsNode.getName();
                    if( nsString == IASKeywordConstants.PUBLIC )
                    {
                        addProblem(new InvalidPublicNamespaceAttrProblem(nsNode) );
                    }
                    else if( nsString == IASKeywordConstants.PROTECTED )
View Full Code Here

        * @param func is the function node do be analyzed
        * @param func_def is the definition for func
        */
    private void verifyFunctionNamespace(FunctionNode func, FunctionDefinition func_def)
    {
        INamespaceDecorationNode nsNode = func.getActualNamespaceNode();
       
        // if we have no "actual" node, then there is no namespace in front of our function
        if (nsNode != null)
        {
            boolean isLanguateNS = false;
           
            // We need a special check for "internal", because tree building has already munged innternal to
            // make it just look like the default. But here we need to know what it really is
            if (INamespaceConstants.internal_.equals(nsNode.getName()))
            {
                isLanguateNS = true;
            }
           
            else
View Full Code Here

       
        // Internal namespaces have a start of -1.  Not sure if modifiers can have a -1 value too
        // but it can't hurt to check.  -gse
        ModifiersSet modifiers = getModifiers();
       
        INamespaceDecorationNode namespace = decorationPart != null ? decorationPart.getNamespace() : null;
       
        if (modifiers != null && modifiers.getStart() < result && modifiers.getStart() >= 0)
            result = modifiers.getStart();
       
        if (namespace != null && namespace.getAbsoluteStart() < result && namespace.getAbsoluteStart() >= 0)
            result = namespace.getAbsoluteStart();
       
        return result;
    }
View Full Code Here

    }

    @Override
    public String getNamespace()
    {
        INamespaceDecorationNode namespace = decorationPart.getNamespace();
        return namespace != null ? namespace.getName() : INamespaceConstants.internal_;
    }
View Full Code Here

    {
        if (node == null)       // if we don't have a node, it means we didn't come from source code, so there is no point
                                // in doing a semantic check
            return;
        INamespaceReference nsref = definition.getNamespaceReference();
        INamespaceDecorationNode dec = node.getNamespaceNode();
        if ((dec ==null) &&(nsref instanceof INamespaceDefinition.IInternalNamespaceDefinition))
        {
            String type = "declaration";        // should never see this string...
            if (definition instanceof IFunctionDefinition)
                type = "function";
View Full Code Here

TOP

Related Classes of org.apache.flex.compiler.tree.as.INamespaceDecorationNode

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.