Package macromedia.asc.embedding.avmplus

Examples of macromedia.asc.embedding.avmplus.ActionBlockEmitter


        Context cx = new Context(statics);
    cx.setLanguage(language);
        cx.setPath(pathspec);
        cx.setScriptName(scriptname);
        ActionBlockEmitter emitter =
          new ActionBlockEmitter(cx, scriptname,
                       new StringPrintWriter(),//code_out
                       new StringPrintWriter(),//header_out
                       show_instructions, show_machinecode,
                       show_linenums, emit_debug_info);
       
        // ISSUE: does authoring need the output filename to be filename rather than scriptname?
        cx.setEmitter(emitter)// retrieve emitter using cx.getEmitter();
        cx.setHandler(handler);
       
        cx.config_vars = configs;

        //    #if TRANSLATE_COMPOUND_NAMES
        //    // This is a test
        //    std::vector<String> compound_names;
        //    compound_names.push_back("Foo.bar");
        //    cx.setCompoundNames(compound_names);
        //    #endif // USE_COMPOUND_NAMES

        // Build the global object
        Builder globalBuilder = new GlobalBuilder();
        ObjectValue global = new ObjectValue(cx, globalBuilder, null);

        // Compiler something
        compile(cx, global, in, filename, encoding, includes, swf_options, avmplus_exe, plugs, emit_doc_info, show_parsetrees, show_bytes,
                show_flow, lint_mode, emit_metadata, save_comment_nodes, emit_debug_info, import_filespecs);

        int error_count = status(cx);

        if (error_count == 1)
        {
          System.err.println();
            System.err.println("1 error found");
        }
        else if (error_count > 1)
        {
          System.err.println();
            System.err.println(error_count + " errors found");
        }
        else if (show_parsetrees == false && emit_doc_info == false)
    {
      if (show_instructions)
      {
        printIL(cx, scriptname, emitter);
      }

      if (error_count == 0 && !show_parsetrees)
      {
        ByteList bytes = new ByteList();
        emitter.emit(bytes);            // Emit it
        if (bytes.size() != 0)
        {
                    if( optimize )
                    {
                        bytes = Optimizer.optimize(bytes);
View Full Code Here


    }

    emitter = new ArrayList<ActionBlockEmitter>(file.size());
    for (int i = 0, length = file.size(); i < length; i++)
    {
      emitter.add(new ActionBlockEmitter(cx.get(i), file.get(i).getPath(), new StringPrintWriter(), new StringPrintWriter(), false, false, false, false));
    }

    node = new ArrayList<ProgramNode>(file.size());
    fa = new ArrayList<FlowAnalyzer>(file.size());
    inheritance = new HashSet<Pair>();
View Full Code Here

      int where = file.indexOf(f);
      if (where == -1)
      {
        file.add(f);
        cx.add(context);
        emitter.add(new ActionBlockEmitter(context, f.getPath(), new StringPrintWriter(), new StringPrintWriter(), false, false, false, false));
        where = file.size() - 1;
      }
      return where;
    }
View Full Code Here

                    mainContext = cxFile;
                }

        if (importFlag)
        {
          emitter.add(new ActionBlockEmitter(cxFile, f.getPath(),
                             new StringPrintWriter(),
                             new StringPrintWriter(),
                             false, false, false, debugFlag));
        }
        else
        {
          if (mainEmitter == null)
          {
            mainEmitter = new ActionBlockEmitter(cxFile, f.getPath(),
                               new StringPrintWriter(),
                               new StringPrintWriter(),
                               false, false, false, debugFlag);
          }
          emitter.add(mainEmitter);
View Full Code Here

      int where = file.indexOf(f);
      if (where == -1)
      {
        file.add(f);
        cx.add(context);
        emitter.add(new ActionBlockEmitter(context, f.getPath(), new StringPrintWriter(), new StringPrintWriter(), false, false, false, debugFlag));
        where = file.size() - 1;
      }
      return where;
    }
View Full Code Here

        contextStatics.use_namespaces.addAll(ContextStatics.getRequiredUseNamespaces(swfVersion));
       
        Context context = new Context(contextStatics);
        context.setHandler(new CompilerHandler());
        AbcParser abcParser = new AbcParser(context, tag.abc);
        context.setEmitter(new ActionBlockEmitter(context, tag.name, new StringPrintWriter(),
                              new StringPrintWriter(), false, false, false, false));
        ProgramNode programNode = abcParser.parseAbc();
       
        if (programNode == null)
        {
View Full Code Here

        contextStatics.use_namespaces.addAll(ContextStatics.getRequiredUseNamespaces(swfVersion));
       
        Context context = new Context(contextStatics);
        context.setHandler(new CompilerHandler());
        AbcParser abcParser = new AbcParser(context, tag.abc);
        context.setEmitter(new ActionBlockEmitter(context, tag.name, new StringPrintWriter(),
                              new StringPrintWriter(), false, false, false, false));
        ProgramNode programNode = abcParser.parseAbc();
       
        if (programNode == null)
        {
View Full Code Here

        Context cx = new Context(statics);
    cx.setLanguage(language);
        cx.setPath(pathspec);
        cx.setScriptName(scriptname);
        ActionBlockEmitter emitter =
          new ActionBlockEmitter(cx, scriptname,
                       new StringPrintWriter(),//code_out
                       new StringPrintWriter(),//header_out
                       show_instructions, show_machinecode,
                       show_linenums, emit_debug_info);
       
        // ISSUE: does authoring need the output filename to be filename rather than scriptname?
        cx.setEmitter(emitter)// retrieve emitter using cx.getEmitter();
        cx.setHandler(handler);
       
        cx.config_vars = configs;

        //    #if TRANSLATE_COMPOUND_NAMES
        //    // This is a test
        //    std::vector<String> compound_names;
        //    compound_names.push_back("Foo.bar");
        //    cx.setCompoundNames(compound_names);
        //    #endif // USE_COMPOUND_NAMES

        // Build the global object
        Builder globalBuilder = new GlobalBuilder();
        ObjectValue global = new ObjectValue(cx, globalBuilder, null);

        // Compiler something
        compile(cx, global, in, filename, encoding, includes, swf_options, avmplus_exe, plugs, emit_doc_info, show_parsetrees, show_bytes,
                show_flow, lint_mode, emit_metadata, save_comment_nodes, emit_debug_info, import_filespecs);

        int error_count = status(cx);

        if (error_count == 1)
        {
          System.err.println();
            System.err.println("1 error found");
        }
        else if (error_count > 1)
        {
          System.err.println();
            System.err.println(error_count + " errors found");
        }
        else if (show_parsetrees == false && emit_doc_info == false)
    {
      if (show_instructions)
      {
        printIL(cx, scriptname, emitter);
      }

      if (error_count == 0 && !show_parsetrees)
      {
        ByteList bytes = new ByteList();
        emitter.emit(bytes);            // Emit it
        if (bytes.size() != 0)
        {
                    if( optimize )
                    {
                        bytes = Optimizer.optimize(bytes);
View Full Code Here

TOP

Related Classes of macromedia.asc.embedding.avmplus.ActionBlockEmitter

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.