com.sun.tools.javac.main.JavaCompiler.enterTrees()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(182)

本文整理了Java中com.sun.tools.javac.main.JavaCompiler.enterTrees()方法的一些代码示例,展示了JavaCompiler.enterTrees()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JavaCompiler.enterTrees()方法的具体详情如下:
包路径:com.sun.tools.javac.main.JavaCompiler
类名称:JavaCompiler
方法名:enterTrees

JavaCompiler.enterTrees介绍

[英]Enter the symbols found in a list of parse trees. As a side-effect, this puts elements on the "todo" list. Also stores a list of all top level classes in rootClasses.
[中]输入在解析树列表中找到的符号。作为副作用,这会将元素放在“待办事项”列表上。还存储根类中所有顶级类的列表。

代码示例

代码示例来源:origin: cincheo/jsweet

/**
 * Parses and attributes the given files within this compilation
 * environment.
 */
public List<JCCompilationUnit> parseAndAttributeJavaFiles(List<File> javaFiles) throws IOException {
  List<JavaFileObject> sources = toJavaFileObjects(fileManager, javaFiles);
  List<JCCompilationUnit> compilationUnits = compiler.enterTrees(compiler.parseFiles(sources));
  compiler.attribute(compiler.todo);
  return compilationUnits;
}

代码示例来源:origin: cincheo/jsweet

transpilationHandler.setDisabled(isIgnoreJavaErrors());
List<JCCompilationUnit> compilationUnits = compiler.enterTrees(compiler.parseFiles(fileObjects));
if (transpilationHandler.getErrorCount() > 0) {
  logger.warn("errors during parse tree");

代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac

/** Enter a set of syntax trees. */
private void enterTrees(List<JCCompilationUnit> roots) {
  compiler.enterTrees(roots);
}

代码示例来源:origin: konsoletyper/teavm-javac

/** Enter a set of syntax trees. */
private void enterTrees(List<JCCompilationUnit> roots) {
  compiler.enterTrees(roots);
}

代码示例来源:origin: cincheo/jsweet

List<JCCompilationUnit> compilationUnits = compiler.enterTrees(compiler.parseFiles(fileObjects));
MainMethodFinder mainMethodFinder = new MainMethodFinder();
try {

代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac

/**
 * Enter the symbols found in a list of parse trees if the compilation
 * is expected to proceed beyond anno processing into attr.
 * As a side-effect, this puts elements on the "todo" list.
 * Also stores a list of all top level classes in rootClasses.
 */
public List<JCCompilationUnit> enterTreesIfNeeded(List<JCCompilationUnit> roots) {
  if (shouldStop(CompileState.ATTR))
    return List.nil();
  return enterTrees(roots);
}

代码示例来源:origin: konsoletyper/teavm-javac

/**
 * Enter the symbols found in a list of parse trees if the compilation
 * is expected to proceed beyond anno processing into attr.
 * As a side-effect, this puts elements on the "todo" list.
 * Also stores a list of all top level classes in rootClasses.
 */
public List<JCCompilationUnit> enterTreesIfNeeded(List<JCCompilationUnit> roots) {
  if (shouldStop(CompileState.ATTR))
    return List.nil();
  return enterTrees(roots);
}

代码示例来源:origin: org.jvnet.sorcerer/sorcerer-javac

delegateCompiler = processAnnotations(enterTrees(stopIfError(parseFiles(sourceFileObjects))),
                   classnames);

代码示例来源:origin: sc.fiji/javac

enterTrees(stopIfError(CompileState.PARSE, parseFiles(sourceFileObjects))),
classnames);

代码示例来源:origin: org.jvnet.sorcerer/sorcerer-javac

List<JCCompilationUnit> units = compiler.enterTrees(roots.toList());

代码示例来源:origin: sc.fiji/javac

List<JCCompilationUnit> units = compiler.enterTrees(roots.toList());

代码示例来源:origin: konsoletyper/teavm-javac

List<JCCompilationUnit> units = compiler.enterTrees(roots.toList());

代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac

List<JCCompilationUnit> units = compiler.enterTrees(roots.toList());

代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac

enterTrees(stopIfError(CompileState.PARSE, parseFiles(sourceFileObjects))),
classnames);

代码示例来源:origin: konsoletyper/teavm-javac

enterTrees(stopIfError(CompileState.PARSE, parseFiles(sourceFileObjects))),
classnames);

代码示例来源:origin: sc.fiji/javac

} else {
      List<ClassSymbol> newClasses = enterNewClassFiles(currentContext);
      compiler.enterTrees(roots);
  compiler.enterTrees(cleanTrees(roots));
} else {
  List<JavaFileObject> fileObjects = List.nil();
    fileObjects = fileObjects.prepend(unit.getSourceFile());
  roots = null;
  compiler.enterTrees(compiler.parseFiles(fileObjects.reverse()));

代码示例来源:origin: org.jvnet.sorcerer/sorcerer-javac

} else {
      ListBuffer<ClassSymbol> classes = enterNewClassFiles(currentContext);
      compiler.enterTrees(roots);
  compiler.enterTrees(cleanTrees(roots));
} else {
  List<JavaFileObject> fileObjects = List.nil();
    fileObjects = fileObjects.prepend(unit.getSourceFile());
  roots = null;
  compiler.enterTrees(compiler.parseFiles(fileObjects.reverse()));

相关文章