Package flex2.compiler.as3.binding

Examples of flex2.compiler.as3.binding.BindableSecondPassEvaluator


        assert (configuration != null);

        //TODO It would be nice to cache this; it cannot (?) be static, however,
        //     as the Configuration changes. Solution would be a static Map or some fancy logic?
        // temporary compiler to get a syntax tree, for signature generation
        final As3Compiler asc = new As3Compiler(configuration.getCompilerConfiguration());
        asc.addCompilerExtension(SignatureExtension.getInstance());

        // create a new CompilationUnit if no error occur
        // then grab the signature if no signature error occur
        CompilationUnit u = null;

        // this is needed by Source.Resolver.resolve().
        ThreadLocalToolkit.setCompatibilityVersion(configuration.getCompatibilityVersion());

        // this swallows any parse errors -- they will get thrown when the file is
        // officially reparsed for compilation
        final Logger original = ThreadLocalToolkit.getLogger();
        ThreadLocalToolkit.setLogger(new LocalLogger(null));
        {
            final Source tmpSource = asc.preprocess(
                           Source.newSource(source.getBackingFile(),      source.getFileTime(),
                                            source.getPathRoot(),         source.getRelativePath(),
                                            source.getShortName(),        source.getOwner(),
                                            source.isInternal(),          source.isRoot(),
                                            source.isDebuggable(),        source.getFileIncludesSet(),
                                            source.getFileIncludeTimes(), source.getLogger()));

            // HACK: Forcefully disable any chance of signatures getting emitted to
            //       the filesystem -- since this code should be as fast as possible.
            //       Don't worry though, it WILL happen later during re-compilation.
            final String tmp = SignatureExtension.signatureDirectory;
            SignatureExtension.signatureDirectory = null;
            {
                u = asc.parse1(tmpSource, new SymbolTable(configuration));
            }
            SignatureExtension.signatureDirectory = tmp;
        }
        ThreadLocalToolkit.setLogger(original);
View Full Code Here


    this.ascConfiguration = ascConfiguration;
    this.nameMappings = mappings;
    this.processComments = processComments;
   
    mimeTypes = new String[]{MimeMappings.MXML};
    asc = new As3Compiler(new As3Configuration()
    {
            public boolean optimize() { return true; }
            public boolean verboseStacktraces() { return false; }
            public boolean debug() { return false; }
            public boolean strict() { return ascConfiguration.strict(); }
View Full Code Here

        assert (configuration != null);

        //TODO It would be nice to cache this; it cannot (?) be static, however,
        //     as the Configuration changes. Solution would be a static Map or some fancy logic?
        // temporary compiler to get a syntax tree, for signature generation
        final As3Compiler asc = new As3Compiler(configuration.getCompilerConfiguration());
        asc.addCompilerExtension(SignatureExtension.getInstance());

        // create a new CompilationUnit if no error occur
        // then grab the signature if no signature error occur
        CompilationUnit u = null;

        // this is needed by Source.Resolver.resolve().
        ThreadLocalToolkit.setCompatibilityVersion(configuration.getCompatibilityVersion());

        // this swallows any parse errors -- they will get thrown when the file is
        // officially reparsed for compilation
        final Logger original = ThreadLocalToolkit.getLogger();
        ThreadLocalToolkit.setLogger(new LocalLogger(null));
        {
            final Source tmpSource = asc.preprocess(
                           Source.newSource(source.getBackingFile(),      source.getFileTime(),
                                            source.getPathRoot(),         source.getRelativePath(),
                                            source.getShortName(),        source.getOwner(),
                                            source.isInternal(),          source.isRoot(),
                                            source.isDebuggable(),        source.getFileIncludesSet(),
                                            source.getFileIncludeTimes(), source.getLogger()));

            // HACK: Forcefully disable any chance of signatures getting emitted to
            //       the filesystem -- since this code should be as fast as possible.
            //       Don't worry though, it WILL happen later during re-compilation.
            final String tmp = SignatureExtension.signatureDirectory;
            SignatureExtension.signatureDirectory = null;
            {
                u = asc.parse1(tmpSource, new SymbolTable(configuration));
            }
            SignatureExtension.signatureDirectory = tmp;
        }
        ThreadLocalToolkit.setLogger(original);
View Full Code Here

    {
        private SkeletonCompiler(CompilerConfiguration config)
        {
            // Create an As3Compiler as our delegate sub-compiler for
            // generated ActionScript.
            As3Compiler asc = new As3Compiler(config);
            delegateSubCompiler = asc;
        }
View Full Code Here

    private final class ImplementationCompiler extends AbstractDelegatingSubCompiler
    {
        private ImplementationCompiler(CompilerConfiguration config)
        {
            // Create an As3Compiler as our delegate sub-compiler.
            As3Compiler asc = new As3Compiler(config);
            delegateSubCompiler = asc;
        }
View Full Code Here

        assert (configuration != null);

        //TODO It would be nice to cache this; it cannot (?) be static, however,
        //     as the Configuration changes. Solution would be a static Map or some fancy logic?
        // temporary compiler to get a syntax tree, for signature generation
        final As3Compiler asc = new As3Compiler(configuration.getCompilerConfiguration());
        asc.addCompilerExtension(SignatureExtension.getInstance());

        // create a new CompilationUnit if no error occur
        // then grab the signature if no signature error occur
        CompilationUnit u = null;

        // this is needed by Source.Resolver.resolve().
        ThreadLocalToolkit.setCompatibilityVersion(configuration.getCompatibilityVersion());

        // this swallows any parse errors -- they will get thrown when the file is
        // officially reparsed for compilation
        final Logger original = ThreadLocalToolkit.getLogger();
        ThreadLocalToolkit.setLogger(new LocalLogger(null));
        {
            final Source tmpSource = asc.preprocess(
                           Source.newSource(source.getBackingFile(),      source.getFileTime(),
                                            source.getPathRoot(),         source.getRelativePath(),
                                            source.getShortName(),        source.getOwner(),
                                            source.isInternal(),          source.isRoot(),
                                            source.isDebuggable(),        source.getFileIncludesSet(),
                                            source.getFileIncludeTimes(), source.getLogger()));

            // HACK: Forcefully disable any chance of signatures getting emitted to
            //       the filesystem -- since this code should be as fast as possible.
            //       Don't worry though, it WILL happen later during re-compilation.
            final String tmp = SignatureExtension.signatureDirectory;
            SignatureExtension.signatureDirectory = null;
            {
                u = asc.parse1(tmpSource, new SymbolTable(configuration));
            }
            SignatureExtension.signatureDirectory = tmp;
        }
        ThreadLocalToolkit.setLogger(original);
View Full Code Here

        mimeTypes = new String[]{MimeMappings.CSS};
        nameMappings = mappings;
        String gendir = (configuration.keepGeneratedActionScript()? configuration.getGeneratedDirectory() : null);

        // Create an As3Compiler as our delegate sub-compiler.
        As3Compiler asc = new As3Compiler(configuration);
        asc.addCompilerExtension(new EmbedExtension(transcoders, gendir, configuration.showDeprecationWarnings()));
        delegateSubCompiler = asc;
    }
View Full Code Here

       
    mimeTypes = new String[]{MimeMappings.MXML};
    generateDocComments = ascConfiguration.doc();

    // set up ASC and extensions -- mostly mirrors flex2.tools.WebTierAPI.getCompilers()
    asc = new As3Compiler(ascConfiguration);
       
        // signature generation should occur before other extensions can touch the syntax tree.
        if ((ascConfiguration instanceof CompilerConfiguration)
                // currently, both configs reference same object, and are CompilerConfigurations
                && !((CompilerConfiguration)ascConfiguration).getDisableIncrementalOptimizations())
View Full Code Here

    this.ascConfiguration = ascConfiguration;
    this.nameMappings = mappings;
    this.processComments = processComments;
   
    mimeTypes = new String[]{MimeMappings.MXML};
    asc = new As3Compiler(new As3Configuration()
    {
            public boolean optimize() { return true; }
            public boolean verboseStacktraces() { return false; }
            public boolean debug() { return false; }
            public boolean strict() { return ascConfiguration.strict(); }
View Full Code Here

   */
  public static flex2.compiler.SubCompiler[] getCompilers(CompilerConfiguration compilerConfig, NameMappings mappings,
                             Transcoder[] transcoders)
  {
    // support .AS3
    As3Compiler asc = new As3Compiler(compilerConfig);

    // signature generation should occur before other extensions can touch the syntax tree
    if (!compilerConfig.getDisableIncrementalOptimizations())
    {
      SignatureExtension.init(compilerConfig);
      asc.addCompilerExtension(SignatureExtension.getInstance());
    }
    final String gendir = (compilerConfig.keepGeneratedActionScript()
                  ? compilerConfig.getGeneratedDirectory()
                  : null);
        final boolean generateAbstractSyntaxTree = compilerConfig.getGenerateAbstractSyntaxTree();
    asc.addCompilerExtension(new EmbedExtension(transcoders, gendir, compilerConfig.showDeprecationWarnings()));
    asc.addCompilerExtension(new StyleExtension());
    // IMPORTANT!!!! The HostComponentExtension must run before the BindableExtension!!!!
    asc.addCompilerExtension(new HostComponentExtension(compilerConfig.reportMissingRequiredSkinPartsAsWarnings()));
    asc.addCompilerExtension(new BindableExtension(gendir, generateAbstractSyntaxTree, false));
    asc.addCompilerExtension(new ManagedExtension(gendir, generateAbstractSyntaxTree,
                                                      compilerConfig.getServicesDependencies(), false));
    asc.addCompilerExtension(new SkinPartExtension());
    // asc.addCompilerExtension(new flex2.compiler.util.TraceExtension());
   
    // support MXML
        MxmlCompiler mxmlc = new MxmlCompiler(compilerConfig, compilerConfig,
                                mappings, transcoders);
View Full Code Here

TOP

Related Classes of flex2.compiler.as3.binding.BindableSecondPassEvaluator

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.