com.google.javascript.rhino.JSDocInfoBuilder Java Examples

The following examples show how to use com.google.javascript.rhino.JSDocInfoBuilder. 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: Closure_133_JsDocInfoParser_s.java    From coming with MIT License 6 votes vote down vote up
JsDocInfoParser(JsDocTokenStream stream,
                Comment commentNode,
                Node associatedNode,
                Config config,
                ErrorReporter errorReporter) {
  this.stream = stream;
  this.associatedNode = associatedNode;

  // Sometimes this will be null in tests.
  this.sourceFile = associatedNode == null
      ? null : associatedNode.getStaticSourceFile();

  this.jsdocBuilder = new JSDocInfoBuilder(config.parseJsDocDocumentation);
  if (commentNode != null) {
    this.jsdocBuilder.recordOriginalCommentString(commentNode.getValue());
  }
  this.annotationNames = config.annotationNames;
  this.suppressionNames = config.suppressionNames;

  this.errorReporter = errorReporter;
  this.templateNode = this.createTemplateNode();
}
 
Example #2
Source File: 1_JsDocInfoParser.java    From SimFix with GNU General Public License v2.0 6 votes vote down vote up
JsDocInfoParser(JsDocTokenStream stream,
                Comment commentNode,
                String sourceName,
                Config config,
                ErrorReporter errorReporter) {
  this.stream = stream;
  this.sourceName = sourceName;
  this.jsdocBuilder = new JSDocInfoBuilder(config.parseJsDocDocumentation);
  if (commentNode != null) {
    this.jsdocBuilder.recordOriginalCommentString(commentNode.getValue());
  }
  this.annotationNames = config.annotationNames;
  this.suppressionNames = config.suppressionNames;

  this.errorReporter = errorReporter;
  this.templateNode = this.createTemplateNode();
}
 
Example #3
Source File: 1_JsDocInfoParser.java    From SimFix with GNU General Public License v2.0 6 votes vote down vote up
JsDocInfoParser(JsDocTokenStream stream,
                Comment commentNode,
                String sourceName,
                Config config,
                ErrorReporter errorReporter) {
  this.stream = stream;
  this.sourceName = sourceName;
  this.jsdocBuilder = new JSDocInfoBuilder(config.parseJsDocDocumentation);
  if (commentNode != null) {
    this.jsdocBuilder.recordOriginalCommentString(commentNode.getValue());
  }
  this.annotationNames = config.annotationNames;
  this.suppressionNames = config.suppressionNames;

  this.errorReporter = errorReporter;
  this.templateNode = this.createTemplateNode();
}
 
Example #4
Source File: Closure_32_JsDocInfoParser_s.java    From coming with MIT License 6 votes vote down vote up
JsDocInfoParser(JsDocTokenStream stream,
                Comment commentNode,
                Node associatedNode,
                Config config,
                ErrorReporter errorReporter) {
  this.stream = stream;
  this.associatedNode = associatedNode;

  // Sometimes this will be null in tests.
  this.sourceFile = associatedNode == null
      ? null : associatedNode.getStaticSourceFile();

  this.jsdocBuilder = new JSDocInfoBuilder(config.parseJsDocDocumentation);
  if (commentNode != null) {
    this.jsdocBuilder.recordOriginalCommentString(commentNode.getValue());
  }
  this.annotationNames = config.annotationNames;
  this.suppressionNames = config.suppressionNames;

  this.errorReporter = errorReporter;
  this.templateNode = this.createTemplateNode();
}
 
Example #5
Source File: Cardumen_0017_t.java    From coming with MIT License 6 votes vote down vote up
JsDocInfoParser(JsDocTokenStream stream,
                Comment commentNode,
                Node associatedNode,
                Config config,
                ErrorReporter errorReporter) {
  this.stream = stream;
  this.associatedNode = associatedNode;

  // Sometimes this will be null in tests.
  this.sourceFile = associatedNode == null
      ? null : associatedNode.getStaticSourceFile();

  this.jsdocBuilder = new JSDocInfoBuilder(config.parseJsDocDocumentation);
  if (commentNode != null) {
    this.jsdocBuilder.recordOriginalCommentString(commentNode.getValue());
  }
  this.annotationNames = config.annotationNames;
  this.suppressionNames = config.suppressionNames;

  this.errorReporter = errorReporter;
  this.templateNode = this.createTemplateNode();
}
 
Example #6
Source File: Closure_68_JsDocInfoParser_s.java    From coming with MIT License 6 votes vote down vote up
JsDocInfoParser(JsDocTokenStream stream,
                Comment commentNode,
                String sourceName,
                Config config,
                ErrorReporter errorReporter) {
  this.stream = stream;
  this.sourceName = sourceName;
  this.jsdocBuilder = new JSDocInfoBuilder(config.parseJsDocDocumentation);
  if (commentNode != null) {
    this.jsdocBuilder.recordOriginalCommentString(commentNode.getValue());
  }
  this.annotationNames = config.annotationNames;
  this.suppressionNames = config.suppressionNames;

  this.errorReporter = errorReporter;
  this.templateNode = this.createTemplateNode();
}
 
Example #7
Source File: Closure_109_JsDocInfoParser_s.java    From coming with MIT License 6 votes vote down vote up
JsDocInfoParser(JsDocTokenStream stream,
                Comment commentNode,
                Node associatedNode,
                Config config,
                ErrorReporter errorReporter) {
  this.stream = stream;
  this.associatedNode = associatedNode;

  // Sometimes this will be null in tests.
  this.sourceFile = associatedNode == null
      ? null : associatedNode.getStaticSourceFile();

  this.jsdocBuilder = new JSDocInfoBuilder(config.parseJsDocDocumentation);
  if (commentNode != null) {
    this.jsdocBuilder.recordOriginalCommentString(commentNode.getValue());
    this.jsdocBuilder.recordOriginalCommentPosition(commentNode.getPosition());
  }
  this.annotationNames = config.annotationNames;
  this.suppressionNames = config.suppressionNames;

  this.errorReporter = errorReporter;
  this.templateNode = this.createTemplateNode();
}
 
Example #8
Source File: Nopol2017_0025_t.java    From coming with MIT License 6 votes vote down vote up
JsDocInfoParser(JsDocTokenStream stream,
                Comment commentNode,
                Node associatedNode,
                Config config,
                ErrorReporter errorReporter) {
  this.stream = stream;
  this.associatedNode = associatedNode;

  // Sometimes this will be null in tests.
  this.sourceFile = associatedNode == null
      ? null : associatedNode.getStaticSourceFile();

  this.jsdocBuilder = new JSDocInfoBuilder(config.parseJsDocDocumentation);
  if (commentNode != null) {
    this.jsdocBuilder.recordOriginalCommentString(commentNode.getValue());
  }
  this.annotationNames = config.annotationNames;
  this.suppressionNames = config.suppressionNames;

  this.errorReporter = errorReporter;
  this.templateNode = this.createTemplateNode();
}
 
Example #9
Source File: Nopol2017_0025_s.java    From coming with MIT License 6 votes vote down vote up
JsDocInfoParser(JsDocTokenStream stream,
                Comment commentNode,
                Node associatedNode,
                Config config,
                ErrorReporter errorReporter) {
  this.stream = stream;
  this.associatedNode = associatedNode;

  // Sometimes this will be null in tests.
  this.sourceFile = associatedNode == null
      ? null : associatedNode.getStaticSourceFile();

  this.jsdocBuilder = new JSDocInfoBuilder(config.parseJsDocDocumentation);
  if (commentNode != null) {
    this.jsdocBuilder.recordOriginalCommentString(commentNode.getValue());
  }
  this.annotationNames = config.annotationNames;
  this.suppressionNames = config.suppressionNames;

  this.errorReporter = errorReporter;
  this.templateNode = this.createTemplateNode();
}
 
Example #10
Source File: Closure_68_JsDocInfoParser_t.java    From coming with MIT License 6 votes vote down vote up
JsDocInfoParser(JsDocTokenStream stream,
                Comment commentNode,
                String sourceName,
                Config config,
                ErrorReporter errorReporter) {
  this.stream = stream;
  this.sourceName = sourceName;
  this.jsdocBuilder = new JSDocInfoBuilder(config.parseJsDocDocumentation);
  if (commentNode != null) {
    this.jsdocBuilder.recordOriginalCommentString(commentNode.getValue());
  }
  this.annotationNames = config.annotationNames;
  this.suppressionNames = config.suppressionNames;

  this.errorReporter = errorReporter;
  this.templateNode = this.createTemplateNode();
}
 
Example #11
Source File: 1_JsDocInfoParser.java    From SimFix with GNU General Public License v2.0 6 votes vote down vote up
JsDocInfoParser(JsDocTokenStream stream,
                Comment commentNode,
                String sourceName,
                Config config,
                ErrorReporter errorReporter) {
  this.stream = stream;
  this.sourceName = sourceName;
  this.jsdocBuilder = new JSDocInfoBuilder(config.parseJsDocDocumentation);
  if (commentNode != null) {
    this.jsdocBuilder.recordOriginalCommentString(commentNode.getValue());
  }
  this.annotationNames = config.annotationNames;
  this.suppressionNames = config.suppressionNames;

  this.errorReporter = errorReporter;
  this.templateNode = this.createTemplateNode();
}
 
Example #12
Source File: Closure_133_JsDocInfoParser_t.java    From coming with MIT License 6 votes vote down vote up
JsDocInfoParser(JsDocTokenStream stream,
                Comment commentNode,
                Node associatedNode,
                Config config,
                ErrorReporter errorReporter) {
  this.stream = stream;
  this.associatedNode = associatedNode;

  // Sometimes this will be null in tests.
  this.sourceFile = associatedNode == null
      ? null : associatedNode.getStaticSourceFile();

  this.jsdocBuilder = new JSDocInfoBuilder(config.parseJsDocDocumentation);
  if (commentNode != null) {
    this.jsdocBuilder.recordOriginalCommentString(commentNode.getValue());
  }
  this.annotationNames = config.annotationNames;
  this.suppressionNames = config.suppressionNames;

  this.errorReporter = errorReporter;
  this.templateNode = this.createTemplateNode();
}
 
Example #13
Source File: JsDocInfoParser.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
JsDocInfoParser(JsDocTokenStream stream,
                Comment commentNode,
                Node associatedNode,
                Config config,
                ErrorReporter errorReporter) {
  this.stream = stream;
  this.associatedNode = associatedNode;

  // Sometimes this will be null in tests.
  this.sourceFile = associatedNode == null
      ? null : associatedNode.getStaticSourceFile();

  this.jsdocBuilder = new JSDocInfoBuilder(config.parseJsDocDocumentation);
  if (commentNode != null) {
    this.jsdocBuilder.recordOriginalCommentString(commentNode.getValue());
  }
  this.annotationNames = config.annotationNames;
  this.suppressionNames = config.suppressionNames;

  this.errorReporter = errorReporter;
  this.templateNode = this.createTemplateNode();
}
 
Example #14
Source File: jMutRepair_005_s.java    From coming with MIT License 5 votes vote down vote up
private void addExtern() {
  Node name = IR.name(PROTECTOR_FN);
  name.putBooleanProp(Node.IS_CONSTANT_NAME, true);
  Node var = IR.var(name);
  // Add "@noalias" so we can strip the method when AliasExternals is enabled.
  JSDocInfoBuilder builder = new JSDocInfoBuilder(false);
  builder.recordNoAlias();
  var.setJSDocInfo(builder.build(var));
  CompilerInput input = compiler.getSynthesizedExternsInput();
  input.getAstRoot(compiler).addChildrenToBack(var);
  compiler.reportCodeChange();
}
 
Example #15
Source File: Closure_21_CheckSideEffects_s.java    From coming with MIT License 5 votes vote down vote up
private void addExtern() {
  Node name = IR.name(PROTECTOR_FN);
  name.putBooleanProp(Node.IS_CONSTANT_NAME, true);
  Node var = IR.var(name);
  // Add "@noalias" so we can strip the method when AliasExternals is enabled.
  JSDocInfoBuilder builder = new JSDocInfoBuilder(false);
  builder.recordNoAlias();
  var.setJSDocInfo(builder.build(var));
  CompilerInput input = compiler.getSynthesizedExternsInput();
  input.getAstRoot(compiler).addChildrenToBack(var);
  compiler.reportCodeChange();
}
 
Example #16
Source File: jMutRepair_0031_t.java    From coming with MIT License 5 votes vote down vote up
private void addExtern() {
  Node name = IR.name(PROTECTOR_FN);
  name.putBooleanProp(Node.IS_CONSTANT_NAME, true);
  Node var = IR.var(name);
  // Add "@noalias" so we can strip the method when AliasExternals is enabled.
  JSDocInfoBuilder builder = new JSDocInfoBuilder(false);
  builder.recordNoAlias();
  var.setJSDocInfo(builder.build(var));
  CompilerInput input = compiler.getSynthesizedExternsInput();
  input.getAstRoot(compiler).addChildrenToBack(var);
  compiler.reportCodeChange();
}
 
Example #17
Source File: jMutRepair_0048_s.java    From coming with MIT License 5 votes vote down vote up
private void addExtern() {
  Node name = IR.name(PROTECTOR_FN);
  name.putBooleanProp(Node.IS_CONSTANT_NAME, true);
  Node var = IR.var(name);
  // Add "@noalias" so we can strip the method when AliasExternals is enabled.
  JSDocInfoBuilder builder = new JSDocInfoBuilder(false);
  builder.recordNoAlias();
  var.setJSDocInfo(builder.build(var));
  CompilerInput input = compiler.getSynthesizedExternsInput();
  input.getAstRoot(compiler).addChildrenToBack(var);
  compiler.reportCodeChange();
}
 
Example #18
Source File: jMutRepair_0048_t.java    From coming with MIT License 5 votes vote down vote up
private void addExtern() {
  Node name = IR.name(PROTECTOR_FN);
  name.putBooleanProp(Node.IS_CONSTANT_NAME, true);
  Node var = IR.var(name);
  // Add "@noalias" so we can strip the method when AliasExternals is enabled.
  JSDocInfoBuilder builder = new JSDocInfoBuilder(false);
  builder.recordNoAlias();
  var.setJSDocInfo(builder.build(var));
  CompilerInput input = compiler.getSynthesizedExternsInput();
  input.getAstRoot(compiler).addChildrenToBack(var);
  compiler.reportCodeChange();
}
 
Example #19
Source File: jMutRepair_0023_s.java    From coming with MIT License 5 votes vote down vote up
private void addExtern() {
  Node name = IR.name(PROTECTOR_FN);
  name.putBooleanProp(Node.IS_CONSTANT_NAME, true);
  Node var = IR.var(name);
  // Add "@noalias" so we can strip the method when AliasExternals is enabled.
  JSDocInfoBuilder builder = new JSDocInfoBuilder(false);
  builder.recordNoAlias();
  var.setJSDocInfo(builder.build(var));
  CompilerInput input = compiler.getSynthesizedExternsInput();
  input.getAstRoot(compiler).addChildrenToBack(var);
  compiler.reportCodeChange();
}
 
Example #20
Source File: jMutRepair_0023_t.java    From coming with MIT License 5 votes vote down vote up
private void addExtern() {
  Node name = IR.name(PROTECTOR_FN);
  name.putBooleanProp(Node.IS_CONSTANT_NAME, true);
  Node var = IR.var(name);
  // Add "@noalias" so we can strip the method when AliasExternals is enabled.
  JSDocInfoBuilder builder = new JSDocInfoBuilder(false);
  builder.recordNoAlias();
  var.setJSDocInfo(builder.build(var));
  CompilerInput input = compiler.getSynthesizedExternsInput();
  input.getAstRoot(compiler).addChildrenToBack(var);
  compiler.reportCodeChange();
}
 
Example #21
Source File: jKali_006_t.java    From coming with MIT License 5 votes vote down vote up
private void addExtern() {
  Node name = IR.name(PROTECTOR_FN);
  name.putBooleanProp(Node.IS_CONSTANT_NAME, true);
  Node var = IR.var(name);
  // Add "@noalias" so we can strip the method when AliasExternals is enabled.
  JSDocInfoBuilder builder = new JSDocInfoBuilder(false);
  builder.recordNoAlias();
  var.setJSDocInfo(builder.build(var));
  CompilerInput input = compiler.getSynthesizedExternsInput();
  input.getAstRoot(compiler).addChildrenToBack(var);
  compiler.reportCodeChange();
}
 
Example #22
Source File: 1_JsDocInfoParser.java    From SimFix with GNU General Public License v2.0 5 votes vote down vote up
JsDocInfoParser(JsDocTokenStream stream,
                String sourceName,
                Config config,
                ErrorReporter errorReporter) {
  this.stream = stream;
  this.sourceName = sourceName;
  this.typeRegistry = config.registry;
  this.jsdocBuilder = new JSDocInfoBuilder(config.parseJsDocDocumentation);
  this.annotationNames = buildAnnotationNames(config);

  this.errorReporter = errorReporter;
}
 
Example #23
Source File: jKali_006_s.java    From coming with MIT License 5 votes vote down vote up
private void addExtern() {
  Node name = IR.name(PROTECTOR_FN);
  name.putBooleanProp(Node.IS_CONSTANT_NAME, true);
  Node var = IR.var(name);
  // Add "@noalias" so we can strip the method when AliasExternals is enabled.
  JSDocInfoBuilder builder = new JSDocInfoBuilder(false);
  builder.recordNoAlias();
  var.setJSDocInfo(builder.build(var));
  CompilerInput input = compiler.getSynthesizedExternsInput();
  input.getAstRoot(compiler).addChildrenToBack(var);
  compiler.reportCodeChange();
}
 
Example #24
Source File: jKali_0034_t.java    From coming with MIT License 5 votes vote down vote up
private void addExtern() {
  Node name = IR.name(PROTECTOR_FN);
  name.putBooleanProp(Node.IS_CONSTANT_NAME, true);
  Node var = IR.var(name);
  // Add "@noalias" so we can strip the method when AliasExternals is enabled.
  JSDocInfoBuilder builder = new JSDocInfoBuilder(false);
  builder.recordNoAlias();
  var.setJSDocInfo(builder.build(var));
  CompilerInput input = compiler.getSynthesizedExternsInput();
  input.getAstRoot(compiler).addChildrenToBack(var);
  compiler.reportCodeChange();
}
 
Example #25
Source File: jKali_0042_t.java    From coming with MIT License 5 votes vote down vote up
private void addExtern() {
  Node name = IR.name(PROTECTOR_FN);
  name.putBooleanProp(Node.IS_CONSTANT_NAME, true);
  Node var = IR.var(name);
  // Add "@noalias" so we can strip the method when AliasExternals is enabled.
  JSDocInfoBuilder builder = new JSDocInfoBuilder(false);
  builder.recordNoAlias();
  var.setJSDocInfo(builder.build(var));
  CompilerInput input = compiler.getSynthesizedExternsInput();
  input.getAstRoot(compiler).addChildrenToBack(var);
  compiler.reportCodeChange();
}
 
Example #26
Source File: jKali_0042_s.java    From coming with MIT License 5 votes vote down vote up
private void addExtern() {
  Node name = IR.name(PROTECTOR_FN);
  name.putBooleanProp(Node.IS_CONSTANT_NAME, true);
  Node var = IR.var(name);
  // Add "@noalias" so we can strip the method when AliasExternals is enabled.
  JSDocInfoBuilder builder = new JSDocInfoBuilder(false);
  builder.recordNoAlias();
  var.setJSDocInfo(builder.build(var));
  CompilerInput input = compiler.getSynthesizedExternsInput();
  input.getAstRoot(compiler).addChildrenToBack(var);
  compiler.reportCodeChange();
}
 
Example #27
Source File: jKali_0043_s.java    From coming with MIT License 5 votes vote down vote up
private void addExtern() {
  Node name = IR.name(PROTECTOR_FN);
  name.putBooleanProp(Node.IS_CONSTANT_NAME, true);
  Node var = IR.var(name);
  // Add "@noalias" so we can strip the method when AliasExternals is enabled.
  JSDocInfoBuilder builder = new JSDocInfoBuilder(false);
  builder.recordNoAlias();
  var.setJSDocInfo(builder.build(var));
  CompilerInput input = compiler.getSynthesizedExternsInput();
  input.getAstRoot(compiler).addChildrenToBack(var);
  compiler.reportCodeChange();
}
 
Example #28
Source File: jKali_0043_t.java    From coming with MIT License 5 votes vote down vote up
private void addExtern() {
  Node name = IR.name(PROTECTOR_FN);
  name.putBooleanProp(Node.IS_CONSTANT_NAME, true);
  Node var = IR.var(name);
  // Add "@noalias" so we can strip the method when AliasExternals is enabled.
  JSDocInfoBuilder builder = new JSDocInfoBuilder(false);
  builder.recordNoAlias();
  var.setJSDocInfo(builder.build(var));
  CompilerInput input = compiler.getSynthesizedExternsInput();
  input.getAstRoot(compiler).addChildrenToBack(var);
  compiler.reportCodeChange();
}
 
Example #29
Source File: Closure_22_CheckSideEffects_s.java    From coming with MIT License 5 votes vote down vote up
private void addExtern() {
  Node name = IR.name(PROTECTOR_FN);
  name.putBooleanProp(Node.IS_CONSTANT_NAME, true);
  Node var = IR.var(name);
  // Add "@noalias" so we can strip the method when AliasExternals is enabled.
  JSDocInfoBuilder builder = new JSDocInfoBuilder(false);
  builder.recordNoAlias();
  var.setJSDocInfo(builder.build(var));
  CompilerInput input = compiler.getSynthesizedExternsInput();
  input.getAstRoot(compiler).addChildrenToBack(var);
  compiler.reportCodeChange();
}
 
Example #30
Source File: Closure_21_CheckSideEffects_t.java    From coming with MIT License 5 votes vote down vote up
private void addExtern() {
  Node name = IR.name(PROTECTOR_FN);
  name.putBooleanProp(Node.IS_CONSTANT_NAME, true);
  Node var = IR.var(name);
  // Add "@noalias" so we can strip the method when AliasExternals is enabled.
  JSDocInfoBuilder builder = new JSDocInfoBuilder(false);
  builder.recordNoAlias();
  var.setJSDocInfo(builder.build(var));
  CompilerInput input = compiler.getSynthesizedExternsInput();
  input.getAstRoot(compiler).addChildrenToBack(var);
  compiler.reportCodeChange();
}