Beispiel #1
0
 private void processCompiledSource(ProcessingContext input, String source, CompilationUnit unit) {
   InputFile file = input.getFile();
   if (closureQueue != null) {
     closureQueue.addProcessedName(FileUtil.getQualifiedMainTypeName(file, unit));
   }
   com.google.devtools.j2objc.ast.CompilationUnit convertedUnit =
       TreeConverter.convertCompilationUnit(
           unit,
           input.getOriginalSourcePath(),
           FileUtil.getMainTypeName(file),
           source,
           nameTableFactory);
   processConvertedTree(input, convertedUnit);
 }
Beispiel #2
0
  private void processInput(ProcessingContext input) {
    InputFile file = input.getFile();

    if (isBatchable(file)) {
      batchInputs.add(input);
      if (batchInputs.size() == batchSize) {
        processBatch();
      }
      return;
    }

    logger.finest("parsing " + file);

    String source = null;
    CompilationUnit compilationUnit = null;
    try {
      source = FileUtil.readFile(file);
      compilationUnit = parser.parseWithBindings(file.getUnitName(), source);
    } catch (IOException e) {
      ErrorUtil.error(e.getMessage());
    }

    if (compilationUnit == null) {
      handleError(input);
      return;
    }

    processCompiledSource(input, source, compilationUnit);
  }