Beispiel #1
0
 public BinaryExpr(
     int beginLine,
     int beginColumn,
     int endLine,
     int endColumn,
     Expression left,
     Expression right,
     Operator op) {
   super(beginLine, beginColumn, endLine, endColumn);
   setLeft(left);
   setRight(right);
   setOperator(op);
 }
Beispiel #2
0
 @Override
 public boolean replaceChildNode(Node oldChild, Node newChild) {
   boolean updated = false;
   if (left == oldChild) {
     setLeft((Expression) newChild);
     updated = true;
   }
   if (right == oldChild) {
     setRight((Expression) newChild);
     updated = true;
   }
   return updated;
 }
 /*
  * (non-Javadoc)
  *
  * @see org.walkmod.javalang.visitors.VoidVisitorAdapter#visit(org.walkmod.javalang.ast.expr.BinaryExpr,
  * java.lang.Object)
  */
 @Override
 public void visit(BinaryExpr n, VisitorContext arg) {
   Expression e = n.getLeft();
   if (e instanceof BinaryExpr) {
     Expression expression = getMethodCallExpr((BinaryExpr) e);
     if (expression != null) {
       n.setLeft(expression);
     }
   }
   e = n.getRight();
   if (e instanceof BinaryExpr) {
     Expression expression = getMethodCallExpr((BinaryExpr) e);
     if (expression != null) {
       n.setRight(expression);
     }
   }
   super.visit(n, arg);
 }
Beispiel #4
0
 public BinaryExpr(Expression left, Expression right, Operator op) {
   setLeft(left);
   setRight(right);
   setOperator(op);
 }