Package org.apache.flex.compiler.filespecs

Examples of org.apache.flex.compiler.filespecs.IFileSpecification


    {
        // Get the DOM-like MXMLData for the file.
        // If its not already in the Workspace's MXMLDataManager,
        // the MXML file will be parsed.
        final IMXMLDataManager mxmlDataManager = getProject().getWorkspace().getMXMLDataManager();
        final IFileSpecification rootFileSpec = getRootFileSpecification();
        final IMXMLData mxmlData = mxmlDataManager.get(rootFileSpec);
        return mxmlData;
    }
View Full Code Here


        // Get the AST dig out the symbol table.
        final FileNode ast = (FileNode)getSyntaxTreeRequest().get().getAST();
        final IASScope scope = ast.getScope();
        assert scope instanceof ASFileScope : "Expect ASFileScope as the top-level scope, but found " + scope.getClass();
       
        IFileSpecification rootSource = getRootFileSpecification();
       
        final ASFileScopeRequestResult result =
            new ASFileScopeRequestResult(getDefinitionPromises(), getDefinitionPriority(),
                Collections.<ICompilerProblem>emptyList(), (ASFileScope)scope, rootSource);
        stopProfile(Operation.GET_FILESCOPE);
View Full Code Here

                 .build();
         }

         private LineNumberReader createReader()
         {
             IFileSpecification fileSpec = workspace.getFileSpecification(fileName);
             Reader reader;
             try
             {
                 reader = fileSpec.createReader();
             }
             catch (FileNotFoundException e)
             {
                 reader = new NullReader(0);
             }
View Full Code Here

                mainUnits.clear();
                unitOrdering.clear();
                problemQuery.clear();
            }

            final IFileSpecification sourceFileSpec = new FileSpecification(sourceFilename);
            workspace.fileAdded(sourceFileSpec);
            final ICompilationUnit cu = ASCompilationUnit.createMainCompilationUnitForASC(
                    applicationProject,
                    sourceFileSpec,
                    this);
View Full Code Here

     * which encapsulates an {@code IFileSpecification} for an MXML file.
     */
    @Override
    protected MXMLData createEntryValue(CacheStoreKeyBase key)
    {
       final IFileSpecification fileSpec = ((MXMLDataCacheKey)key).fileSpec;
   
        // Tokenize the MXML file.
        final MXMLTokenizer tokenizer = new MXMLTokenizer(fileSpec);
        try
        {
            List<MXMLToken> tokens = tokenizer.parseTokens(fileSpec.createReader());
           
            // Build tags and attributes from the tokens.
            final MXMLData mxmlData = new MXMLData(tokens, tokenizer.getPrefixMap(), fileSpec);
            return mxmlData;
        }
View Full Code Here

        assert problems != null;

        StreamingASTokenizer tokenizer = null;
        ASParser parser = null;

        final IFileSpecification textFileSpec = new StringFileSpecification(path, fragment);

        final ScopedBlockNode container = new ScopedBlockNode();
        container.setScope(containingScope);
        try
        {
View Full Code Here

        ScopedBlockNode container = new ScopedBlockNode();
        ASParser parser = null;

        try
        {
            IFileSpecification fileSpec = new StringFileSpecification(CONFIG_AS, fragment, 0);
            IncludeHandler includeHandler = new IncludeHandler(workspace);

            StreamingASTokenizer tokenizer = StreamingASTokenizer.create(fileSpec, includeHandler);
            tokenizer.setReader(new NonLockingStringReader(fragment));
            tokenizer.setPath(CONFIG_AS);
View Full Code Here

            final String sourcePath = FilenameNormalization.normalize(streamingTokenBuffer.getSourcePath());
            if (!new File(sourcePath).isFile())
                return null;

            // try to create a reader from file specification
            final IFileSpecification fileSpec = workspace.getFileSpecification(sourcePath);
            if (fileSpec != null)
            {
                try
                {
                    // success - optimization is available
                    return fileSpec.createReader();
                }
                catch (FileNotFoundException e)
                {
                    return null;
                }
View Full Code Here

            final int line,
            final int column,
            final Collection<ICompilerProblem> problems)
    {
        final long lastModified = workspace.getFileSpecification(sourcePath).getLastModified();
        final IFileSpecification fileSpec = new StringFileSpecification(sourcePath, metadataContent, lastModified);
        final IncludeHandler includeHandler = new IncludeHandler(workspace);
        final ASParser parser = new ASParser(workspace, (IRepairingTokenBuffer)null);

        try
        {
View Full Code Here

    }

    @Override
    public String getSourcePath()
    {
        IFileSpecification fileSpec = getFileSpecification();
        return fileSpec != null ? fileSpec.getPath() : null;
    }
View Full Code Here

TOP

Related Classes of org.apache.flex.compiler.filespecs.IFileSpecification

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.