org.mozilla.javascript.Node.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 JavaScript  
字(4.1k)|赞(0)|评价(0)|浏览(118)

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

Node.<init>介绍

暂无

代码示例

代码示例来源:origin: rhino/js

/**
 * Return
 */
Node createReturn(Node expr, int lineno)
{
  return expr == null
    ? new Node(Token.RETURN, lineno)
    : new Node(Token.RETURN, expr, lineno);
}

代码示例来源:origin: rhino/js

/**
 * Leaf
 */
Node createLeaf(int nodeType)
{
  return new Node(nodeType);
}

代码示例来源:origin: rhino/js

/**
 * Debugger
 */
Node createDebugger(int lineno)
{
  return new Node(Token.DEBUGGER,  lineno);
}

代码示例来源:origin: rhino/js

/**
 * Throw
 */
Node createThrow(Node expr, int lineno)
{
  return new Node(Token.THROW, expr, lineno);
}

代码示例来源:origin: com.sun.phobos/phobos-rhino

/**
 * Leaf
 */
Node createLeaf(int nodeType)
{
  return new Node(nodeType);
}

代码示例来源:origin: com.sun.phobos/phobos-rhino

/**
 * Throw
 */
Node createThrow(Node expr, int lineno)
{
  return new Node(Token.THROW, expr, lineno);
}

代码示例来源:origin: rhino/js

Node createVariables(int token, int lineno)
{
  return new Node(token, lineno);
}

代码示例来源:origin: rhino/js

/**
 * DOTQUERY
 */
public Node createDotQuery (Node obj, Node body, int lineno)
{
  setRequiresActivation();
  Node result = new Node(Token.DOTQUERY, obj, body, lineno);
  return result;
}

代码示例来源:origin: rhino/js

Node createCondExpr(Node cond, Node ifTrue, Node ifFalse)
{
  int condStatus = isAlwaysDefinedBoolean(cond);
  if (condStatus == ALWAYS_TRUE_BOOLEAN) {
    return ifTrue;
  } else if (condStatus == ALWAYS_FALSE_BOOLEAN) {
    return ifFalse;
  }
  return new Node(Token.HOOK, cond, ifTrue, ifFalse);
}

代码示例来源:origin: rhino/js

Node createExprStatement(Node expr, int lineno)
{
  int type;
  if (parser.insideFunction()) {
    type = Token.EXPR_VOID;
  } else {
    type = Token.EXPR_RESULT;
  }
  return new Node(type, expr, lineno);
}

代码示例来源:origin: rhino/js

/**
 * Regular expressions
 */
Node createRegExp(int regexpIndex)
{
  Node n = new Node(Token.REGEXP);
  n.putIntProp(Node.REGEXP_PROP, regexpIndex);
  return n;
}

代码示例来源:origin: io.apigee/rhino

private Node createCondExpr(Node cond, Node ifTrue, Node ifFalse) {
  int condStatus = isAlwaysDefinedBoolean(cond);
  if (condStatus == ALWAYS_TRUE_BOOLEAN) {
    return ifTrue;
  } else if (condStatus == ALWAYS_FALSE_BOOLEAN) {
    return ifFalse;
  }
  return new Node(Token.HOOK, cond, ifTrue, ifFalse);
}

代码示例来源:origin: geogebra/geogebra

private Node createCondExpr(Node cond, Node ifTrue, Node ifFalse) {
  int condStatus = isAlwaysDefinedBoolean(cond);
  if (condStatus == ALWAYS_TRUE_BOOLEAN) {
    return ifTrue;
  } else if (condStatus == ALWAYS_FALSE_BOOLEAN) {
    return ifFalse;
  }
  return new Node(Token.HOOK, cond, ifTrue, ifFalse);
}

代码示例来源:origin: rhino/js

Node createYield(Node child, int lineno)
{
 if (!parser.insideFunction()) {
  parser.reportError("msg.bad.yield");
 }
 setRequiresActivation();
 setIsGenerator();
 if (child != null)
  return new Node(Token.YIELD, child, lineno);
 else
  return new Node(Token.YIELD, lineno);
}

代码示例来源:origin: rhino/js

Node createUseLocal(Node localBlock)
{
  if (Token.LOCAL_BLOCK != localBlock.getType()) throw Kit.codeBug();
  Node result = new Node(Token.LOCAL_LOAD);
  result.putProp(Node.LOCAL_BLOCK_PROP, localBlock);
  return result;
}

代码示例来源:origin: com.github.tntim96/rhino

private Node createUseLocal(Node localBlock) {
  if (Token.LOCAL_BLOCK != localBlock.getType()) throw Kit.codeBug();
  Node result = new Node(Token.LOCAL_LOAD);
  result.putProp(Node.LOCAL_BLOCK_PROP, localBlock);
  return result;
}

代码示例来源:origin: geogebra/geogebra

private Node transformYield(Yield node) {
  decompiler.addToken(Token.YIELD);
  Node kid = node.getValue() == null ? null : transform(node.getValue());
  if (kid != null)
    return new Node(Token.YIELD, kid, node.getLineno());
  else
    return new Node(Token.YIELD, node.getLineno());
}

代码示例来源:origin: geogebra/geogebra

private Node transformThrow(ThrowStatement node) {
  decompiler.addToken(Token.THROW);
  Node value = transform(node.getExpression());
  decompiler.addEOL(Token.SEMI);
  return new Node(Token.THROW, value, node.getLineno());
}

代码示例来源:origin: ro.isdc.wro4j/rhino

private Node transformExprStmt(ExpressionStatement node) {
  Node expr = transform(node.getExpression());
  decompiler.addEOL(Token.SEMI);
  return new Node(node.getType(), expr, node.getLineno());
}

代码示例来源:origin: geogebra/geogebra

private Node transformExprStmt(ExpressionStatement node) {
  Node expr = transform(node.getExpression());
  decompiler.addEOL(Token.SEMI);
  return new Node(node.getType(), expr, node.getLineno());
}

相关文章

微信公众号