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); }
@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); }
public BinaryExpr(Expression left, Expression right, Operator op) { setLeft(left); setRight(right); setOperator(op); }