Java Code Examples for com.google.javascript.rhino.Node#getStaticSourceFile()

The following examples show how to use com.google.javascript.rhino.Node#getStaticSourceFile() . 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_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 2
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 3
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 4
Source File: Cardumen_0017_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: 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 6
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 7
Source File: Closure_119_GlobalNamespace_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Creates a reference at the current node.
 */
Ref(JSModule module, Scope scope, Node node, Name name, Type type, int index) {
  this.node = node;
  this.name = name;
  this.module = module;
  this.source = node.getStaticSourceFile();
  this.type = type;
  this.scope = scope;
  this.preOrderIndex = index;
}
 
Example 8
Source File: Closure_120_ReferenceCollectingCallback_t.java    From coming with MIT License 5 votes vote down vote up
private Reference(Node nameNode,
    BasicBlock basicBlock, Scope scope, InputId inputId) {
  this.nameNode = nameNode;
  this.basicBlock = basicBlock;
  this.scope = scope;
  this.inputId = inputId;
  this.sourceFile = nameNode.getStaticSourceFile();
}
 
Example 9
Source File: Closure_120_ReferenceCollectingCallback_s.java    From coming with MIT License 5 votes vote down vote up
private Reference(Node nameNode,
    BasicBlock basicBlock, Scope scope, InputId inputId) {
  this.nameNode = nameNode;
  this.basicBlock = basicBlock;
  this.scope = scope;
  this.inputId = inputId;
  this.sourceFile = nameNode.getStaticSourceFile();
}
 
Example 10
Source File: jMutRepair_003_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * @param n The node.
 * @return The source name property on the node or its ancestors.
 */
public static StaticSourceFile getSourceFile(Node n) {
  StaticSourceFile sourceName = null;
  while (sourceName == null && n != null) {
    sourceName = n.getStaticSourceFile();
    n = n.getParent();
  }
  return sourceName;
}
 
Example 11
Source File: jKali_003_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * @param n The node.
 * @return The source name property on the node or its ancestors.
 */
public static StaticSourceFile getSourceFile(Node n) {
  StaticSourceFile sourceName = null;
  while (sourceName == null && n != null) {
    sourceName = n.getStaticSourceFile();
    n = n.getParent();
  }
  return sourceName;
}
 
Example 12
Source File: jKali_003_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * @param n The node.
 * @return The source name property on the node or its ancestors.
 */
public static StaticSourceFile getSourceFile(Node n) {
  StaticSourceFile sourceName = null;
  while (sourceName == null && n != null) {
    sourceName = n.getStaticSourceFile();
    n = n.getParent();
  }
  return sourceName;
}
 
Example 13
Source File: Nopol2017_0014_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Creates a reference at the current node.
 */
Ref(JSModule module, Scope scope, Node node, Name name, Type type, int index) {
  this.node = node;
  this.name = name;
  this.module = module;
  this.source = node.getStaticSourceFile();
  this.type = type;
  this.scope = scope;
  this.preOrderIndex = index;
}
 
Example 14
Source File: Cardumen_0087_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * @param n The node.
 * @return The source name property on the node or its ancestors.
 */
public static StaticSourceFile getSourceFile(Node n) {
  StaticSourceFile sourceName = null;
  while (sourceName == null && n != null) {
    sourceName = n.getStaticSourceFile();
    n = n.getParent();
  }
  return sourceName;
}
 
Example 15
Source File: Cardumen_0087_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * @param n The node.
 * @return The source name property on the node or its ancestors.
 */
public static StaticSourceFile getSourceFile(Node n) {
  StaticSourceFile sourceName = null;
  while (sourceName == null && n != null) {
    sourceName = n.getStaticSourceFile();
    n = n.getParent();
  }
  return sourceName;
}
 
Example 16
Source File: Cardumen_0014_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * @param n The node.
 * @return The source name property on the node or its ancestors.
 */
public static StaticSourceFile getSourceFile(Node n) {
  StaticSourceFile sourceName = null;
  while (sourceName == null && n != null) {
    sourceName = n.getStaticSourceFile();
    n = n.getParent();
  }
  return sourceName;
}
 
Example 17
Source File: NodeUtil.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param n The node.
 * @return The source name property on the node or its ancestors.
 */
public static StaticSourceFile getSourceFile(Node n) {
  StaticSourceFile sourceName = null;
  while (sourceName == null && n != null) {
    sourceName = n.getStaticSourceFile();
    n = n.getParent();
  }
  return sourceName;
}
 
Example 18
Source File: Cardumen_00149_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * @param n The node.
 * @return The source name property on the node or its ancestors.
 */
public static StaticSourceFile getSourceFile(Node n) {
  StaticSourceFile sourceName = null;
  while (sourceName == null && n != null) {
    sourceName = n.getStaticSourceFile();
    n = n.getParent();
  }
  return sourceName;
}
 
Example 19
Source File: Closure_10_NodeUtil_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * @param n The node.
 * @return The source name property on the node or its ancestors.
 */
public static StaticSourceFile getSourceFile(Node n) {
  StaticSourceFile sourceName = null;
  while (sourceName == null && n != null) {
    sourceName = n.getStaticSourceFile();
    n = n.getParent();
  }
  return sourceName;
}
 
Example 20
Source File: ReferenceCollectingCallback.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
private Reference(Node nameNode,
    BasicBlock basicBlock, Scope scope, InputId inputId) {
  this.nameNode = nameNode;
  this.basicBlock = basicBlock;
  this.scope = scope;
  this.inputId = inputId;
  this.sourceFile = nameNode.getStaticSourceFile();
}