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

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

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

JavaCompiler.desugar介绍

[英]Prepare attributed parse trees, in conjunction with their attribution contexts, for source or code generation. If the file was not listed on the command line, the current implicitSourcePolicy is taken into account. The preparation stops as soon as an error is found.
[中]为源代码或代码生成准备属性解析树及其属性上下文。如果该文件未列在命令行上,则将考虑当前隐式资源策略。一旦发现错误,准备工作就会停止。

代码示例

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

public void process(Env<AttrContext> env) {
    compiler.generate(compiler.desugar(ListBuffer.of(env)), results);
  }
};

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

/**
 * Prepare attributed parse trees, in conjunction with their attribution contexts,
 * for source or code generation.
 * If any errors occur, an empty list will be returned.
 * @returns a list containing the classes to be generated
 */
public Queue<Pair<Env<AttrContext>, JCClassDecl>> desugar(Queue<Env<AttrContext>> envs) {
  ListBuffer<Pair<Env<AttrContext>, JCClassDecl>> results = new ListBuffer<>();
  for (Env<AttrContext> env: envs)
    desugar(env, results);
  return stopIfError(CompileState.FLOW, results);
}

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

/**
 * Prepare attributed parse trees, in conjunction with their attribution contexts,
 * for source or code generation.
 * If any errors occur, an empty list will be returned.
 * @returns a list containing the classes to be generated
 */
public Queue<Pair<Env<AttrContext>, JCClassDecl>> desugar(Queue<Env<AttrContext>> envs) {
  ListBuffer<Pair<Env<AttrContext>, JCClassDecl>> results = lb();
  for (Env<AttrContext> env: envs)
    desugar(env, results);
  return stopIfError(CompileState.FLOW, results);
}

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

/**
 * Prepare attributed parse trees, in conjunction with their attribution contexts,
 * for source or code generation.
 * If any errors occur, an empty list will be returned.
 * @returns a list containing the classes to be generated
 */
public Queue<Pair<Env<AttrContext>, JCClassDecl>> desugar(Queue<Env<AttrContext>> envs) {
  ListBuffer<Pair<Env<AttrContext>, JCClassDecl>> results = new ListBuffer<>();
  for (Env<AttrContext> env: envs)
    desugar(env, results);
  return stopIfError(CompileState.FLOW, results);
}

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

public void process(Env<AttrContext> env) {
    compiler.generate(compiler.desugar(List.of(env)), results);
  }
};

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

public void process(Env<AttrContext> env) {
    compiler.generate(compiler.desugar(ListBuffer.of(env)), results);
  }
};

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

public void process(Env<AttrContext> env) {
    compiler.generate(compiler.desugar(ListBuffer.of(env)), results);
  }
};

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

/**
 * Prepare attributed parse trees, in conjunction with their attribution contexts,
 * for source or code generation.
 * If any errors occur, an empty list will be returned.
 * @returns a list containing the classes to be generated
 */
public List<Pair<Env<AttrContext>, JCClassDecl>> desugar(List<Env<AttrContext>> envs) {
  ListBuffer<Pair<Env<AttrContext>, JCClassDecl>> results = lb();
  for (List<Env<AttrContext>> l = envs; l.nonEmpty(); l = l.tail)
    desugar(l.head, results);
  return stopIfError(results);
}

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

generate(desugar(flow(attribute(todo))));
break;
  Queue<Queue<Env<AttrContext>>> q = todo.groupByFile();
  while (!q.isEmpty() && !shouldStop(CompileState.ATTR)) {
    generate(desugar(flow(attribute(q.remove()))));
  generate(desugar(flow(attribute(todo.remove()))));
break;

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

generate(desugar(flow(attribute(todo))));
break;
  Queue<Queue<Env<AttrContext>>> q = todo.groupByFile();
  while (!q.isEmpty() && !shouldStop(CompileState.ATTR)) {
    generate(desugar(flow(attribute(q.remove()))));
  generate(desugar(flow(attribute(todo.remove()))));
break;

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

generate(desugar(flow(attribute(todo))));
break;
  generate(desugar(list));
break;
  generate(desugar(flow(attribute(todo.next()))));
break;

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

generate(desugar(flow(attribute(todo))));
break;
  Queue<Queue<Env<AttrContext>>> q = todo.groupByFile();
  while (!q.isEmpty() && !shouldStop(CompileState.ATTR)) {
    generate(desugar(flow(attribute(q.remove()))));
  generate(desugar(flow(attribute(todo.remove()))));
break;

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

compiler.generate(compiler.desugar(genList), results);
genList.clear();

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

compiler.generate(compiler.desugar(genList), results);
genList.clear();

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

compiler.generate(compiler.desugar(genList), results);
genList.clear();

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

compiler.generate(compiler.desugar(genList.toList()), results);
genList.clear();

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

for (Env<AttrContext> dep: scanner.dependencies) {
if (!compileStates.isDone(dep, CompileState.FLOW))
  desugaredEnvs.put(dep, desugar(flow(attribute(dep))));

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

for (Env<AttrContext> dep: scanner.dependencies) {
if (!compileStates.isDone(dep, CompileState.FLOW))
  desugaredEnvs.put(dep, desugar(flow(attribute(dep))));

相关文章