Compiles the compilation unit from sources.
763344
public void compile(int throughPhase) throws CompilationFailedException {
        //
        // To support delta compilations, we always restart
        // the compiler.  The individual passes are responsible
        // for not reprocessing old code.
        gotoPhase(Phases.INITIALIZATION);
        throughPhase = Math.min(throughPhase, Phases.ALL);

        while (throughPhase >= phase && phase <= Phases.ALL) {

            if (phase == Phases.SEMANTIC_ANALYSIS) {
                doPhaseOperation(resolve);
                if (dequeued()) continue;
            }

            processPhaseOperations(phase);
            // Grab processing may have brought in new AST transforms into various phases, process them as well
            processNewPhaseOperations(phase);

            if (progressCallback != null) progressCallback.call(this, phase);
            completePhase();
            applyToSourceUnits(mark);

            if (dequeued()) continue;

            gotoPhase(phase + 1);

            if (phase == Phases.CLASS_GENERATION) {
                sortClasses();
            }
        }

        errorCollector.failIfErrors();
    }
553930
@SuppressWarnings("deprecation")
    public void compile(String[] classNames) {

        ICompilationUnit[] compilationUnits = new CompilationUnit[classNames.length];
        for (int i = 0; i < classNames.length; i++) {
            compilationUnits[i] = new CompilationUnit(classNames[i]);
        }
        IErrorHandlingPolicy policy = DefaultErrorHandlingPolicies.exitOnFirstError();
        IProblemFactory problemFactory = new DefaultProblemFactory(Locale.ENGLISH);

        /**
         * To find types ...
         */
        INameEnvironment nameEnvironment = new INameEnvironment() {

            public NameEnvironmentAnswer findType(final char[][] compoundTypeName) {
                final StringBuffer result = new StringBuffer();
                for (int i = 0; i < compoundTypeName.length; i++) {
                    if (i != 0) {
                        result.append('.');
                    }
                    result.append(compoundTypeName[i]);
                }
                return findType(result.toString());
            }

            public NameEnvironmentAnswer findType(final char[] typeName, final char[][] packageName) {
                final StringBuffer result = new StringBuffer();
                for (int i = 0; i < packageName.length; i++) {
                    result.append(packageName[i]);
                    result.append('.');
                }
                result.append(typeName);
                return findType(result.toString());
            }

            private NameEnvironmentAnswer findStandType(final String name) throws ClassFormatException {
                if (notFoundTypes.contains(name)) {
                    return null;
                }
                RythmEngine engine = engine();
                byte[] bytes = engine.classLoader().getClassDefinition(name);
                if (bytes != null) {
                    ClassFileReader classFileReader = new ClassFileReader(bytes, name.toCharArray(), true);
                    return new NameEnvironmentAnswer(classFileReader, null);
                }
                if (engine.isProdMode()) {
                    notFoundTypes.add(name);
                } else if (name.matches("^(java\\.|play\\.|com\\.greenlaw110\\.).*")) {
                    notFoundTypes.add(name);
                }
                return null;
            }

            private NameEnvironmentAnswer findType(final String name) {
                try {
                    if (!name.contains(TemplateClass.CN_SUFFIX)) {
                        return findStandType(name);
                    }

                    char[] fileName = name.toCharArray();
                    TemplateClass templateClass = classCache.getByClassName(name);

                    // TemplateClass exists
                    if (templateClass != null) {
                        if (templateClass.javaByteCode != null) {
                            ClassFileReader classFileReader = new ClassFileReader(templateClass.javaByteCode, fileName, true);
                            return new NameEnvironmentAnswer(classFileReader, null);
                        }
                        // Cascade compilation
                        ICompilationUnit compilationUnit = new CompilationUnit(name);
                        return new NameEnvironmentAnswer(compilationUnit, null);
                    }

                    // So it's a standard class
                    return findStandType(name);
                } catch (ClassFormatException e) {
                    // Something very very bad
                    throw new RuntimeException(e);
                }
            }

            @Override
            public boolean isPackage(char[][] parentPackageName, char[] packageName) {
                // Rebuild something usable
                StringBuilder sb = new StringBuilder();
                if (parentPackageName != null) {
                    for (char[] p : parentPackageName) {
                        sb.append(new String(p));
                        sb.append(".");
                    }
                }
                sb.append(new String(packageName));
                String name = sb.toString();
                if (packagesCache.containsKey(name)) {
                    return packagesCache.get(name).booleanValue();
                }
                // Check if thera a .java or .class for this resource
                if (engine().classLoader().getClassDefinition(name) != null) {
                    packagesCache.put(name, false);
                    return false;
                }
                if (engine().classes().getByClassName(name) != null) {
                    packagesCache.put(name, false);
                    return false;
                }
                packagesCache.put(name, true);
                return true;
            }

            public void cleanup() {
            }
        };


        /**
         * Compilation result
         */
        ICompilerRequestor compilerRequestor = new ICompilerRequestor() {

            public void acceptResult(CompilationResult result) {
                // If error
                if (result.hasErrors()) {
                    for (IProblem problem : result.getErrors()) {
                        int line = problem.getSourceLineNumber();
                        String message = problem.getMessage();
                        throw CompileException.compilerException(String.valueOf(result.compilationUnit.getMainTypeName()), line, message);
                    }
                }
                // Something has been compiled
                ClassFile[] clazzFiles = result.getClassFiles();
                for (int i = 0; i < clazzFiles.length; i++) {
                    final ClassFile clazzFile = clazzFiles[i];
                    final char[][] compoundName = clazzFile.getCompoundName();
                    final StringBuffer clazzName = new StringBuffer();
                    for (int j = 0; j < compoundName.length; j++) {
                        if (j != 0) {
                            clazzName.append('.');
                        }
                        clazzName.append(compoundName[j]);
                    }

                    if (logger.isTraceEnabled()) {
                        logger.trace("Compiled %s", getTemplateByClassName(clazzName.toString()));
                    }

                    String cn = clazzName.toString();
                    TemplateClass tc = classCache.getByClassName(cn);
                    if (null == tc) {
                        int pos = cn.indexOf("$");
                        if (-1 != pos) {
                            // inner class
                            TemplateClass root = classCache.getByClassName(cn.substring(0, pos));
                            tc = TemplateClass.createInnerClass(cn, clazzFile.getBytes(), root);
                            tc.delayedEnhance(root);
                            classCache.add(tc);
                        } else {
                            throw new RuntimeException("Cannot find class by name: " + cn);
                        }
                    } else {
                        tc.compiled(clazzFile.getBytes());
                    }
                }
            }
        };

        /**
         * The JDT compiler
         */
        Compiler jdtCompiler = new Compiler(nameEnvironment, policy, settings, compilerRequestor, problemFactory) {

            @Override
            protected void handleInternalException(Throwable e, CompilationUnitDeclaration ud, CompilationResult result) {
            }
        };

        // Go !
        jdtCompiler.compile(compilationUnits);

    }
178506
def compile_protos():
  """"""
  # If there's no makefile, we're likely installing from an sdist,
  # so there's no need to compile the protos (they should be already
  # compiled).
  if not os.path.exists(os.path.join(THIS_DIRECTORY, "makefile.py")):
    return

  # Only compile protobufs if we're inside GRR source tree.
  subprocess.check_call(
      ["python", "makefile.py", "--clean"], cwd=THIS_DIRECTORY)
707253
protected Compiler createCompiler(FacesContext context)
    {
        Compiler compiler = new SAXCompiler();

        compiler.setDevelopmentProjectStage(context.isProjectStage(ProjectStage.Development));

        loadLibraries(context, compiler);
        loadDecorators(context, compiler);
        loadOptions(context, compiler);

        return compiler;
    }
1094409
public void compile(final CCTask task, final File outputDir, final String[] sourceFiles, String[] args,
      final String[] endArgs, final boolean relentless, final CommandLineCompilerConfiguration config,
      final ProgressMonitor monitor) throws BuildException {
    BuildException exc = null;
    //
    // determine length of executable name and args
    //
    String command = getCommandWithPath(config);
    if (config.isUseCcache()) {
      // Replace the command with "ccache" and push the old compiler
      // command into the args.
      final String compilerCommand = command;
      command = CCACHE_CMD;
      args = ObjectArrays.concat(compilerCommand, args);
    }
    int baseLength = command.length() + args.length + endArgs.length;
    if (this.libtool) {
      baseLength += 8;
    }
    for (final String arg : args) {
      baseLength += arg.length();
    }
    for (final String endArg : endArgs) {
      baseLength += endArg.length();
    }
    if (baseLength > getMaximumCommandLength()) {
      throw new BuildException("Command line is over maximum length without specifying source file");
    }
    //
    // typically either 1 or Integer.MAX_VALUE
    //
    final int maxInputFilesPerCommand = getMaximumInputFilesPerCommand();
    final int argumentCountPerInputFile = getArgumentCountPerInputFile();
    for (int sourceIndex = 0; sourceIndex < sourceFiles.length;) {
      int cmdLength = baseLength;
      int firstFileNextExec;
      for (firstFileNextExec = sourceIndex; firstFileNextExec < sourceFiles.length
          && firstFileNextExec - sourceIndex < maxInputFilesPerCommand; firstFileNextExec++) {
        cmdLength += getTotalArgumentLengthForInputFile(outputDir, sourceFiles[firstFileNextExec]);
        if (cmdLength >= getMaximumCommandLength()) {
          break;
        }
      }
      if (firstFileNextExec == sourceIndex) {
        throw new BuildException("Extremely long file name, can't fit on command line");
      }

      ArrayList<String> commandlinePrefix = new ArrayList<>();
      if (this.libtool) {
        commandlinePrefix.add("libtool");
      }
      if((this.fortifyID !=null) && (!this.fortifyID.equals("")))
      {// If FortifyID attribute was set, run the Fortify framework

        commandlinePrefix.add("sourceanalyzer");
        commandlinePrefix.add("-b");
        commandlinePrefix.add(this.fortifyID);
      }
      commandlinePrefix.add(command);
      Collections.addAll(commandlinePrefix, args);

      int retval = 0;
      for (int j = sourceIndex; j < firstFileNextExec; j++) {
        ArrayList<String> commandlineSuffix = new ArrayList<>();

        for (int k = 0; k < argumentCountPerInputFile; k++) {
          commandlineSuffix.add(getInputFileArgument(outputDir, sourceFiles[j], k));
        }
        Collections.addAll(commandlineSuffix, endArgs);

        ArrayList<String> commandline = new ArrayList<>(commandlinePrefix);
        commandline.addAll(commandlineSuffix);
        final int ret = runCommand(task, workDir,
            commandline.toArray(new String[commandline.size()]));
        if (ret != 0) { retval = ret; }
      }
      if (monitor != null) {
        final String[] fileNames = new String[firstFileNextExec - sourceIndex];

        System.arraycopy(sourceFiles, sourceIndex + 0, fileNames, 0, fileNames.length);
        monitor.progress(fileNames);
      }
      //
      // if the process returned a failure code and
      // we aren't holding an exception from an earlier
      // interation
      if (retval != 0 && exc == null) {
        //
        // construct the exception
        //
        exc = new BuildException(getCommandWithPath(config) + " failed with return code " + retval, task.getLocation());

        //
        // and throw it now unless we are relentless
        //
        if (!relentless) {
          throw exc;
        }
      }
      sourceIndex = firstFileNextExec;
    }
    //
    // if the compiler returned a failure value earlier
    // then throw an exception
    if (exc != null) {
      throw exc;
    }
  }
1085849
public Result compile(SourceFile extern, SourceFile input, CompilerOptions options) {
    return compile(ImmutableList.of(extern), ImmutableList.of(input), options);
  }
383641
public function compile()
	{
		$this->rrmdir($this->config['dir']['site']);
		$this->compilePosts();
		$this->compilePages();
		$this->compileCategories();
		$this->compileAssets();
		$this->compilePaginations();
		$this->compileAuthors();
	}
15953
public Iterable<? extends CompilationUnitTree> parse() throws IOException {
        try {
            prepareCompiler();
            List<JCCompilationUnit> units = compiler.parseFiles(fileObjects);
            for (JCCompilationUnit unit: units) {
                JavaFileObject file = unit.getSourceFile();
                if (notYetEntered.containsKey(file))
                    notYetEntered.put(file, unit);
            }
            return units;
        }
        finally {
            parsed = true;
            if (compiler != null && compiler.log != null)
                compiler.log.flush();
        }
    }
558584
function compile(source) {
    var module = assemblyscript_1.Compiler.compileString(source, {
        target: assemblyscript_1.CompilerTarget.WASM32,
        memoryModel: assemblyscript_1.CompilerMemoryModel.MALLOC,
        silent: true
    });
    var wasmFile;
    if (!module) {
        throw Error('compilation failed');
    }
    module.optimize();
    if (!module.validate()) {
        throw Error('validation failed');
    }
    wasmFile = module.emitBinary();
    module.dispose();
    return new Buffer(wasmFile);
}
756172
function compile( bundleData, bundleFile, config, callback ) {
	var baseDir = config['path'] || path.dirname(bundleFile);
	var encoder, profileEncoder = [], profileLoader = [], bundleLoader;

	// Compile stages
	var openBundle = function( cb ) {
		return function() {

			// Create encoder
			encoder = new BinaryEncoder(
					bundleFile,
					{
						'name' 			: bundleData['name'],
						'base_dir' 		: baseDir,
						'log'			: config['log'] || 0x00,
						'sparse'		: config['sparse'],
					}
				);

			// Add profiles
			for (var i=0; i<profileEncoder.length; i++) {
				encoder.addProfile( profileEncoder[i] );
			}

			// We are ready
			cb();
		}
	}

	var loadBundles = function( cb ) {
		return function() {
			// Load a bundle by specs
			bundleLoader.addBySpecs( bundleData );
			// Solve dependencies and load resources
			bundleLoader.load( cb );
		}
	}

	var compileExports = function( cb ) {
		return function() {
			// Get the bundle to encode
			var bundle = bundleLoader.bundles[ bundleData['name'] ];

			// Encode resources
			for (var k in bundle.resources) {
				encoder.encode( bundle.resources[k], k );
			}

			// Embed blobs
			for (var k in bundle.blobs) {
				encoder.embedBlob( bundle.blobs[k][0], k, bundle.blobs[k][1] );
			}

			// We are done
			cb();
		}
	}

	var closeBundle = function( cb ) {
		return function() {
			// Close & Complete
			encoder.close();
			cb();
		}
	}

	// Check for profileTable/profileLoader
	if (config['profileEncoder'] || config['profileLoader']) {

		// Check for missing arguments
		if (!config['profileEncoder']) {
			callback( "Got 'profileLoader' but missing 'profileEncoder' in the arguments" );
			return;
		}
		if (!config['profileLoader']) {
			callback( "Got 'profileEncoder' but missing 'profileLoader' in the arguments" );
			return;
		}

		// Fetch
		profileEncoder = config['profileEncoder'];
		profileLoader = config['profileLoader'];

		// Make sure it's array
		if (!(profileEncoder instanceof Array))
			profileEncoder = [ profileEncoder ];
		if (!(profileLoader instanceof Array))
			profileLoader = [ profileLoader ];

	} else {

		// Identify some important information
		var profile = config['profile'] || bundleData['profile'];
		if (!profile) {
			callback( "No jbb profile was specified!");
			return;
		}

		// Make sure it's array
		if (typeof profile === 'string')
			profile = [ profile ];

		// Require
		for (var i=0; i<profile.length; i++) {
			var pname = profile[i];
			if (pname[0] == ".") {
				profileEncoder.push( require( path.join(process.cwd(), pname, '/profile-encode') ) );
				profileLoader.push( require( path.join(process.cwd(), pname, "/profile-loader") ) );
			} else {
				profileEncoder.push( require('jbb-profile-'+pname+'/profile-encode') );
				profileLoader.push( require('jbb-profile-'+pname+"/profile-loader") );
			}
		}

	}

	// Load profile table and compiler helper
	bundleLoader = new BundlesLoader( baseDir );
	for (var i=0; i<profileLoader.length; i++) {
		bundleLoader.addProfileLoader( profileLoader[i] );
	}

	// Chained initialization of profile loaders
	var context = { 'remaining': profileLoader.length }
	var init_callback = (function() {
		if (--this.remaining == 0) {
			openBundle(
				loadBundles(
					compileExports(
						closeBundle( callback || function(){} )
						) 
					) 
			)();
		}
	}).bind(context);

	// Initialize profile compiler with the specs file
	for (var i=0; i<profileLoader.length; i++) {
		if (!profileLoader[i].initialize) {
			init_callback();
		} else {
			profileLoader[i].initialize( init_callback, bundleData );
		}
	}

}
1106792
void compile() {
    TypeInfo factoryType = innerClasses.registerInnerClass(FACTORY_CLASS, FACTORY_ACCESS);
    SoyClassWriter cw =
        SoyClassWriter.builder(factoryType)
            .implementing(FACTORY_TYPE)
            .setAccess(FACTORY_ACCESS)
            .sourceFileName(templateNode.getSourceLocation().getFileName())
            .build();
    innerClasses.registerAsInnerClass(cw, factoryType);

    generateStaticInitializer(cw);
    defineDefaultConstructor(cw, factoryType);
    generateCreateMethod(cw, factoryType);
    cw.visitEnd();
    innerClasses.add(cw.toClassData());
  }
446149
private void process() {
    if (hasExternsRoot()) {
      sourceKind = SourceKind.EXTERN;
      NodeTraversal.traverse(compiler, externsRoot, new BuildGlobalNamespace());
    }
    sourceKind = SourceKind.CODE;

    NodeTraversal.traverse(compiler, root, new BuildGlobalNamespace());
    generated = true;
    externsScope = null;
  }
927988
def compile_dependencies(self, sourcepath, include_self=True):
        
        return super(SassProjectEventHandler, self).compile_dependencies(
            sourcepath,
            include_self=include_self
        )
1085730
public static CompilationUnit generateAst(String source) throws ParseException {
        return JavaParser.parse(new StringReader(source), true);
    }
402527
def compile(source, options = {})
      source  = prepare_source(source)
      options = prepare_options(options)
      snippet = compilation_snippet \
        method:    "compile#{ "Client" if options[:client] }",
        arguments: [source, options],
        locals:    options.fetch(:locals, {}),
        options:   options
      result  = @execjs.eval(snippet)
      process_result(source, result, options)
    rescue ExecJS::ProgramError => e
      raise engine::CompilationError, e.message
    end
428145
public boolean compile(final Map<String, String> sources, final String... options) {
		final Set<StringSourceFileObject> compUnit = sources.entrySet().stream().map(entry -> new StringSourceFileObject(entry.getKey(), entry.getValue())).collect(Collectors.toSet());
		return compile(compUnit, options);
	}
1203826
public function compile()
	{
		$this->writeToTemplate(($this->picker != 'unit') ? ($this->multiple) ? StringUtil::deserialize($this->data->multiTextField) : $this->data->singleTextField : StringUtil::deserialize($this->data->inputUnit));	
	}