com.google.javascript.jscomp.type.SemanticReverseAbstractInterpreter Java Examples

The following examples show how to use com.google.javascript.jscomp.type.SemanticReverseAbstractInterpreter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RemoveUnusedNamesTest.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected CompilerPass getProcessor(final Compiler compiler) {
  return new CompilerPass() {

    @Override
    public void process(Node externs, Node root) {
      new TypeCheck(compiler,
          new SemanticReverseAbstractInterpreter(
              compiler.getCodingConvention(),
              compiler.getTypeRegistry()),
          compiler.getTypeRegistry(),
          CheckLevel.ERROR,
          CheckLevel.ERROR).processForTesting(externs, root);

      new RemoveUnusedNames(
          compiler, canRemoveExterns).process(externs, root);

      // Use to remove side-effect-free artifacts that are left over.
      new UnreachableCodeElimination(compiler, true).process(externs, root);
    }
  };
}
 
Example #2
Source File: Closure_18_Compiler_t.java    From coming with MIT License 5 votes vote down vote up
@Override
public ReverseAbstractInterpreter getReverseAbstractInterpreter() {
  if (abstractInterpreter == null) {
    ChainableReverseAbstractInterpreter interpreter =
        new SemanticReverseAbstractInterpreter(
            getCodingConvention(), getTypeRegistry());
    if (options.closurePass) {
      interpreter = new ClosureReverseAbstractInterpreter(
          getCodingConvention(), getTypeRegistry())
          .append(interpreter).getFirst();
    }
    abstractInterpreter = interpreter;
  }
  return abstractInterpreter;
}
 
Example #3
Source File: Closure_18_Compiler_s.java    From coming with MIT License 5 votes vote down vote up
@Override
public ReverseAbstractInterpreter getReverseAbstractInterpreter() {
  if (abstractInterpreter == null) {
    ChainableReverseAbstractInterpreter interpreter =
        new SemanticReverseAbstractInterpreter(
            getCodingConvention(), getTypeRegistry());
    if (options.closurePass) {
      interpreter = new ClosureReverseAbstractInterpreter(
          getCodingConvention(), getTypeRegistry())
          .append(interpreter).getFirst();
    }
    abstractInterpreter = interpreter;
  }
  return abstractInterpreter;
}
 
Example #4
Source File: Closure_31_Compiler_s.java    From coming with MIT License 5 votes vote down vote up
@Override
public ReverseAbstractInterpreter getReverseAbstractInterpreter() {
  if (abstractInterpreter == null) {
    ChainableReverseAbstractInterpreter interpreter =
        new SemanticReverseAbstractInterpreter(
            getCodingConvention(), getTypeRegistry());
    if (options.closurePass) {
      interpreter = new ClosureReverseAbstractInterpreter(
          getCodingConvention(), getTypeRegistry())
          .append(interpreter).getFirst();
    }
    abstractInterpreter = interpreter;
  }
  return abstractInterpreter;
}
 
Example #5
Source File: Closure_31_Compiler_t.java    From coming with MIT License 5 votes vote down vote up
@Override
public ReverseAbstractInterpreter getReverseAbstractInterpreter() {
  if (abstractInterpreter == null) {
    ChainableReverseAbstractInterpreter interpreter =
        new SemanticReverseAbstractInterpreter(
            getCodingConvention(), getTypeRegistry());
    if (options.closurePass) {
      interpreter = new ClosureReverseAbstractInterpreter(
          getCodingConvention(), getTypeRegistry())
          .append(interpreter).getFirst();
    }
    abstractInterpreter = interpreter;
  }
  return abstractInterpreter;
}
 
Example #6
Source File: Compiler.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
@Override
public ReverseAbstractInterpreter getReverseAbstractInterpreter() {
  if (abstractInterpreter == null) {
    ChainableReverseAbstractInterpreter interpreter =
        new SemanticReverseAbstractInterpreter(
            getCodingConvention(), getTypeRegistry());
    if (options.closurePass) {
      interpreter = new ClosureReverseAbstractInterpreter(
          getCodingConvention(), getTypeRegistry())
          .append(interpreter).getFirst();
    }
    abstractInterpreter = interpreter;
  }
  return abstractInterpreter;
}
 
Example #7
Source File: SemanticReverseAbstractInterpreterTest.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void setUp() throws Exception {
  super.setUp();

  interpreter = new SemanticReverseAbstractInterpreter(
      codingConvention, registry);
}
 
Example #8
Source File: CompilerTestCase.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/** Returns a newly created TypeCheck. */
private static TypeCheck createTypeCheck(Compiler compiler,
    CheckLevel level) {
  ReverseAbstractInterpreter rai =
      new SemanticReverseAbstractInterpreter(compiler.getCodingConvention(),
          compiler.getTypeRegistry());

  return new TypeCheck(compiler, rai, compiler.getTypeRegistry(),
      level, CheckLevel.OFF);
}
 
Example #9
Source File: CompilerTestCase.java    From ng-closure-runner with MIT License 5 votes vote down vote up
/** Returns a newly created TypeCheck. */
private static TypeCheck createTypeCheck(Compiler compiler,
    CheckLevel level) {
  ReverseAbstractInterpreter rai =
      new SemanticReverseAbstractInterpreter(compiler.getCodingConvention(),
          compiler.getTypeRegistry());

  return new TypeCheck(compiler, rai, compiler.getTypeRegistry(), level);
}