Package org.mozilla.javascript

Examples of org.mozilla.javascript.IRFactory


      if (compilationErrorReporter == null) {
        compilationErrorReporter = compilerEnv.getErrorReporter();
      }
      Parser p = new Parser(compilerEnv, compilationErrorReporter);
      AstRoot ast = p.parse(in, file.toString(), 1);
      IRFactory irf = new IRFactory(compilerEnv, compilationErrorReporter);
      ScriptNode tree = irf.transformTree(ast);
      Object[] nameBytesPair = (Object[]) (Object[]) compiler.compile(
          compilerEnv, tree, tree.getEncodedSource(), false);
      String className = (String) nameBytesPair[0];
      byte[] classBytes = (byte[]) (byte[]) nameBytesPair[1];
      File outFile = new File(className.replace('.', File.separatorChar)
View Full Code Here


            compilerEnv.initFromContext(cx);
            ErrorReporter compilationErrorReporter = compilerEnv
                    .getErrorReporter();
            Parser p = new Parser(compilerEnv, compilationErrorReporter);
            AstRoot ast = p.parse(source.toString(), "<eval>", 1);
            IRFactory irf = new IRFactory(compilerEnv);
            ScriptNode tree = irf.transformTree(ast);

            Codegen codegen = new Codegen();
            codegen.setMainMethodClass(mainMethodClassName);
            codegen.compileToClassFile(compilerEnv, scriptClassName, tree,
                    tree.getEncodedSource(), false);
View Full Code Here

TOP

Related Classes of org.mozilla.javascript.IRFactory

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.