Examples of FlexProject


Examples of org.apache.flex.compiler.internal.projects.FlexProject

    }

    public MXMLC()
    {
        workspace = new Workspace();
        project = new FlexProject(workspace);
        problems = new ProblemQuery();
    }
View Full Code Here

Examples of org.apache.flex.compiler.internal.projects.FlexProject

            String functionName, String text, ITypeDefinition type)
    {
        MXMLCompilerDirectiveNodeBase result = null;
        if (IMetaAttributeConstants.ATTRIBUTE_EMBED.equals(functionName))
        {
            FlexProject project = builder.getProject();
            ITypeDefinition stringType = (ITypeDefinition)project.getBuiltinType(BuiltinType.STRING);
            ITypeDefinition classType = (ITypeDefinition)project.getBuiltinType(BuiltinType.CLASS);
            ITypeDefinition anyType = (ITypeDefinition)project.getBuiltinType(BuiltinType.ANY_TYPE);

            // @Embed requires that lvalue accept String, Class.
            if (stringType.isInstanceOf(type, project) || classType.isInstanceOf(type, project) ||
                type == anyType)
            {
View Full Code Here

Examples of org.apache.flex.compiler.internal.projects.FlexProject

                                           IMXMLTagAttributeData attribute,
                                           MXMLNodeInfo info)
    {
        super.initializeFromAttribute(builder, attribute, info);

        final FlexProject project = builder.getProject();
        final Workspace workspace = builder.getWorkspace();
        final Collection<ICompilerProblem> problems = builder.getProblems();

        setSourcePath(attribute.getParent().getParent().getFileSpecification().getPath());

        final int startOffsetLocal = attribute.getValueStart();
        final ASFileScope fileScope = builder.getFileScope();
        final OffsetLookup offsetLookup = fileScope.getOffsetLookup();
        assert offsetLookup != null : "Expected OffsetLookup on FileScope.";
        final String filePath = getContainingFilePath();
        final int[] absoluteOffsets =
                offsetLookup.getAbsoluteOffset(filePath, startOffsetLocal);
        final int startOffsetAbsolute = absoluteOffsets[0];
        final IncludeHandler includeHandler =
                IncludeHandler.createForASTBuilding(builder.getFileSpecificationGetter(), filePath, startOffsetLocal, startOffsetAbsolute);
        includeHandler.setProjectAndCompilationUnit(project, builder.getCompilationUnit());
        final String scriptFragment = attribute.getRawValue();
        if (scriptFragment.isEmpty())
        {
            MXMLEmptyEventHandlerProblem problem = new MXMLEmptyEventHandlerProblem(attribute);
            problems.add(problem);
        }
        final ScopedBlockNode node = ASParser.parseFragment2(
                scriptFragment,
                filePath,
                0,
                attribute.getValueLine(),
                attribute.getValueColumn(),
                problems,
                workspace,
                builder.getFileNode(),
                scope,
                project.getProjectConfigVariables(),
                EnumSet.of(PostProcessStep.CALCULATE_OFFSETS, PostProcessStep.POPULATE_SCOPE),
                true, //follow includes
                includeHandler);
        builder.getFileNode().updateIncludeTreeLastModified(includeHandler.getLastModified());
        processHandlerCode(builder, Collections.singletonList(node));
View Full Code Here

Examples of org.apache.flex.compiler.internal.projects.FlexProject

            ICompilerProblem problem = new MXMLDuplicateChildTagProblem(childTag);
            builder.addProblem(problem);
            return ;
        }
       
        FlexProject project = builder.getProject();

        // Handle child tags that are property/style/event specifiers.
        MXMLSpecifierNodeBase childNode = createSpecifierNode(builder, childTag.getShortName());
        if (childNode != null)
        {
View Full Code Here

Examples of org.apache.flex.compiler.internal.projects.FlexProject

     */
    private IVariableDefinition getDefaultPropertyDefinition(MXMLTreeBuilder builder)
    {
        if (!defaultPropertyDefinitionInitialized)
        {
            FlexProject project = builder.getProject();
            String defaultPropertyName = classReference.getDefaultPropertyName(project);
            if (defaultPropertyName != null)
            {
                defaultPropertyDefinition =
                        (IVariableDefinition)project.resolveSpecifier(classReference, defaultPropertyName);
            }

            defaultPropertyDefinitionInitialized = true;
        }

View Full Code Here

Examples of org.apache.flex.compiler.internal.projects.FlexProject

    protected MXMLSpecifierNodeBase createSpecifierNode(MXMLTreeBuilder builder, String specifierName)
    {
        MXMLSpecifierNodeBase specifierNode = null;

        // Check if the attribute is a declared property, style, or event.
        FlexProject project = builder.getProject();
        IDefinition specifierDefinition = project.resolveSpecifier(classReference, specifierName);

        if (specifierDefinition instanceof ISetterDefinition ||
            specifierDefinition instanceof IVariableDefinition)
        {
            specifierNode = new MXMLPropertySpecifierNode(this);
View Full Code Here

Examples of org.apache.flex.compiler.internal.projects.FlexProject

        // If the class references by this node implements mx.core.IContainer,
        // add an expression dependency on mx.core.UIComponentDescriptor
        // because we'll have to codegen descriptors.
        if (isContainer)
        {
            FlexProject project = builder.getProject();
            builder.addExpressionDependency(project.getUIComponentDescriptorClass());
        }
    }
View Full Code Here

Examples of org.apache.flex.compiler.internal.projects.FlexProject

            containedClassDefinitionNode = new MXMLClassDefinitionNode(this);
            handled = true;

            // check also that there is only one child tag and that
            // there are no text units around the child tag
            FlexProject project = builder.getProject();
            IDefinition tagDef = builder.getFileScope().resolveTagToDefinition(childTag);

            // Check that the root tag mapped to a definition.
            if (tagDef == null)
            {
View Full Code Here

Examples of org.apache.flex.compiler.internal.projects.FlexProject

            builder.addProblem(problem);
            includeIn = null;
            excludeFrom = null;
        }

        FlexProject project = builder.getProject();
        IClassDefinition classReference = getClassReference(project);
        if (classReference != null)
        {
            String qname = classReference.getQualifiedName();
            builder.addDependency(qname, DependencyType.EXPRESSION);
View Full Code Here

Examples of org.apache.flex.compiler.internal.projects.FlexProject

    private ITypeDefinition getPropertyType(MXMLTreeBuilder builder)
    {
        IDefinition definition = getDefinition();

        FlexProject project = builder.getProject();

        // If there is no property definition, this is a dynamic property with type "*".
        if (definition == null)
            return (ITypeDefinition)project.getBuiltinType(IASLanguageConstants.BuiltinType.ANY_TYPE);

        return definition.resolveType(project);
    }
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.