com.google.javascript.jscomp.Compiler.getTypeRegistry()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 JavaScript  
字(5.9k)|赞(0)|评价(0)|浏览(240)

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

Compiler.getTypeRegistry介绍

暂无

代码示例

代码示例来源:origin: org.scala-js/closure-compiler-java-6

@Override
public TypeIRegistry getTypeIRegistry() {
 return getTypeRegistry();
}

代码示例来源:origin: org.apache.royale.compiler/compiler-externc

public final JSType evaluate(JSTypeExpression expression)
{
  JSType jsType = null;
  if (expression != null)
  {
    try
    {
      jsType = expression.evaluate(null, jscompiler.getTypeRegistry());
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
  }
  return jsType;
}

代码示例来源:origin: org.apache.flex.flexjs.compiler/compiler-jx

public final JSType evaluate(JSTypeExpression expression)
{
  JSType jsType = null;
  if (expression != null)
  {
    try
    {
      jsType = expression.evaluate(null, jscompiler.getTypeRegistry());
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
  }
  return jsType;
}

代码示例来源:origin: com.google.javascript/closure-compiler

@Override
public ReverseAbstractInterpreter getReverseAbstractInterpreter() {
 if (abstractInterpreter == null) {
  ChainableReverseAbstractInterpreter interpreter =
    new SemanticReverseAbstractInterpreter(getTypeRegistry());
  if (options.closurePass) {
   interpreter = new ClosureReverseAbstractInterpreter(getTypeRegistry())
     .append(interpreter).getFirst();
  }
  abstractInterpreter = interpreter;
 }
 return abstractInterpreter;
}

代码示例来源:origin: org.scala-js/closure-compiler-java-6

@Override
public ReverseAbstractInterpreter getReverseAbstractInterpreter() {
 if (abstractInterpreter == null) {
  ChainableReverseAbstractInterpreter interpreter =
    new SemanticReverseAbstractInterpreter(getTypeRegistry());
  if (options.closurePass) {
   interpreter = new ClosureReverseAbstractInterpreter(getTypeRegistry())
     .append(interpreter).getFirst();
  }
  abstractInterpreter = interpreter;
 }
 return abstractInterpreter;
}

代码示例来源:origin: apache/royale-compiler

public final JSType evaluate(JSTypeExpression expression)
{
  JSType jsType = null;
  if (expression != null)
  {
    try
    {
      jsType = expression.evaluate(null, jscompiler.getTypeRegistry());
      if (jsType.isTemplatizedType())
      {
        jsType = ((TemplatizedType)jsType).getReferencedType();
      }
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
  }
  return jsType;
}

代码示例来源:origin: org.scala-js/closure-compiler-java-6

@Override
void forwardDeclareType(String typeName) {
 // Always add it to the old type registry, since OTI runs after NTI to
 // provide types for the remaining passes.
 // TODO(dimvar): change this when we stop running OTI after NTI.
 getTypeRegistry().forwardDeclareType(typeName);
 if (this.options.getNewTypeInference()) {
  getSymbolTable().addUnknownTypeName(typeName);
 }
}

代码示例来源:origin: org.scala-js/closure-compiler-java-6

private void processNewScript(JsAst ast, Node originalRoot) {
 Node js = ast.getAstRoot(this);
 Preconditions.checkNotNull(js);
 runHotSwap(originalRoot, js, this.getCleanupPassConfig());
 // NOTE: If hot swap passes that use GlobalNamespace are added, we will need
 // to revisit this approach to clearing GlobalNamespaces
 runHotSwapPass(null, null, ensureDefaultPassConfig().garbageCollectChecks);
 this.getTypeRegistry().clearNamedTypes();
 this.removeSyntheticVarsInput();
 runHotSwap(originalRoot, js, this.ensureDefaultPassConfig());
}

代码示例来源:origin: com.google.javascript/closure-compiler

private void processNewScript(JsAst ast, Node originalRoot) {
 setFeatureSet(options.getLanguageIn().toFeatureSet());
 Node js = checkNotNull(ast.getAstRoot(this));
 runHotSwap(originalRoot, js, this.getCleanupPassConfig());
 // NOTE: If hot swap passes that use GlobalNamespace are added, we will need
 // to revisit this approach to clearing GlobalNamespaces
 runHotSwapPass(null, null, ensureDefaultPassConfig().garbageCollectChecks);
 // Type information is not reliable for hotswap runs.
 this.getTypeRegistry().clearNamedTypes();
 this.typeCheckingHasRun = false;
 this.removeSyntheticVarsInput();
 runHotSwap(originalRoot, js, this.ensureDefaultPassConfig());
}

代码示例来源:origin: com.google.javascript/closure-compiler

/**
 * Generates JavaScript source code for an AST.
 */
private String toSource(Node n, SourceMap sourceMap, boolean firstOutput) {
 CodePrinter.Builder builder = new CodePrinter.Builder(n);
 builder.setTypeRegistry(getTypeRegistry());
 builder.setCompilerOptions(options);
 builder.setSourceMap(sourceMap);
 builder.setTagAsTypeSummary(!n.isFromExterns() && options.shouldGenerateTypedExterns());
 builder.setTagAsStrict(firstOutput && options.shouldEmitUseStrict());
 return builder.build();
}

代码示例来源:origin: apache/royale-compiler

protected JSType evaluateParam(MethodReference method, String paramName)
{
  JSType jsType = method.getComment().getParameterType(paramName).evaluate(null,
      client.getCompiler().getJSCompiler().getTypeRegistry());
  return jsType;
}

代码示例来源:origin: org.scala-js/closure-compiler-java-6

void orderInputs() {
 hoistExterns();
 // Check if the sources need to be re-ordered.
 boolean staleInputs = false;
 if (options.dependencyOptions.needsManagement()) {
  for (CompilerInput input : inputs) {
   // Forward-declare all the provided types, so that they
   // are not flagged even if they are dropped from the process.
   for (String provide : input.getProvides()) {
    getTypeRegistry().forwardDeclareType(provide);
   }
  }
  try {
   inputs =
     (moduleGraph == null ? new JSModuleGraph(modules) : moduleGraph)
     .manageDependencies(options.dependencyOptions, inputs);
   staleInputs = true;
  } catch (MissingProvideException e) {
   report(JSError.make(
     MISSING_ENTRY_ERROR, e.getMessage()));
  } catch (JSModuleGraph.MissingModuleException e) {
   report(JSError.make(
     MISSING_MODULE_ERROR, e.getMessage()));
  }
 }
 hoistNoCompileFiles();
 if (staleInputs) {
  repartitionInputs();
 }
}

代码示例来源:origin: angular/clutz

new CodePrinter.Builder(file)
  .setCompilerOptions(opts.getCompilerOptions())
  .setTypeRegistry(compiler.getTypeRegistry())
  .setCodeGeneratorFactory(factory)
  .setPrettyPrint(true)

代码示例来源:origin: org.scala-js/closure-compiler-java-6

public SymbolTable buildKnownSymbolTable() {
 SymbolTable symbolTable = new SymbolTable(getTypeRegistry());

代码示例来源:origin: com.google.javascript/closure-compiler

public SymbolTable buildKnownSymbolTable() {
 SymbolTable symbolTable = new SymbolTable(this, getTypeRegistry());

相关文章

Compiler类方法