org.mozilla.javascript.ast.UnaryExpression.setBounds()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 JavaScript  
字(3.5k)|赞(0)|评价(0)|浏览(122)

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

UnaryExpression.setBounds介绍

暂无

代码示例

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

/**
 * Constructs a new UnaryExpression with the specified operator
 * and operand.  It sets the parent of the operand, and sets its own bounds
 * to encompass the operator and operand.
 * @param operator the node type
 * @param operatorPosition the absolute position of the operator.
 * @param operand the operand expression
 * @param postFix true if the operator follows the operand.  Int
 * @throws IllegalArgumentException} if {@code operand} is {@code null}
 */
public UnaryExpression(int operator, int operatorPosition,
            AstNode operand, boolean postFix) {
  assertNotNull(operand);
  int beg = postFix ? operand.getPosition() : operatorPosition;
  // JavaScript only has ++ and -- postfix operators, so length is 2
  int end = postFix
       ? operatorPosition + 2
       : operand.getPosition() + operand.getLength();
  setBounds(beg, end);
  setOperator(operator);
  setOperand(operand);
  isPostfix = postFix;
}

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

/**
 * Constructs a new UnaryExpression with the specified operator
 * and operand.  It sets the parent of the operand, and sets its own bounds
 * to encompass the operator and operand.
 * @param operator the node type
 * @param operatorPosition the absolute position of the operator.
 * @param operand the operand expression
 * @param postFix true if the operator follows the operand.  Int
 * @throws IllegalArgumentException} if {@code operand} is {@code null}
 */
public UnaryExpression(int operator, int operatorPosition,
            AstNode operand, boolean postFix) {
  assertNotNull(operand);
  int beg = postFix ? operand.getPosition() : operatorPosition;
  // JavaScript only has ++ and -- postfix operators, so length is 2
  int end = postFix
       ? operatorPosition + 2
       : operand.getPosition() + operand.getLength();
  setBounds(beg, end);
  setOperator(operator);
  setOperand(operand);
  isPostfix = postFix;
}

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

/**
 * Constructs a new UnaryExpression with the specified operator
 * and operand.  It sets the parent of the operand, and sets its own bounds
 * to encompass the operator and operand.
 * @param operator the node type
 * @param operatorPosition the absolute position of the operator.
 * @param operand the operand expression
 * @param postFix true if the operator follows the operand.  Int
 * @throws IllegalArgumentException} if {@code operand} is {@code null}
 */
public UnaryExpression(int operator, int operatorPosition,
            AstNode operand, boolean postFix) {
  assertNotNull(operand);
  int beg = postFix ? operand.getPosition() : operatorPosition;
  // JavaScript only has ++ and -- postfix operators, so length is 2
  int end = postFix
       ? operatorPosition + 2
       : operand.getPosition() + operand.getLength();
  setBounds(beg, end);
  setOperator(operator);
  setOperand(operand);
  isPostfix = postFix;
}

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

/**
 * Constructs a new UnaryExpression with the specified operator
 * and operand.  It sets the parent of the operand, and sets its own bounds
 * to encompass the operator and operand.
 * @param operator the node type
 * @param operatorPosition the absolute position of the operator.
 * @param operand the operand expression
 * @param postFix true if the operator follows the operand.  Int
 * @throws IllegalArgumentException} if {@code operand} is {@code null}
 */
public UnaryExpression(int operator, int operatorPosition,
            AstNode operand, boolean postFix) {
  assertNotNull(operand);
  int beg = postFix ? operand.getPosition() : operatorPosition;
  // JavaScript only has ++ and -- postfix operators, so length is 2
  int end = postFix
       ? operatorPosition + 2
       : operand.getPosition() + operand.getLength();
  setBounds(beg, end);
  setOperator(operator);
  setOperand(operand);
  isPostfix = postFix;
}

相关文章