/** {@inheritDoc} */
public Object visit(ASTAssignment node, Object data) {
// left contains the reference to assign to
int register = -1;
JexlNode left = node.jjtGetChild(0);
if (left instanceof ASTIdentifier) {
ASTIdentifier var = (ASTIdentifier) left;
register = var.getRegister();
if (register < 0) {
throw new JexlException(left, "unknown variable " + left.image);
}
} else if (!(left instanceof ASTReference)) {
throw new JexlException(left, "illegal assignment form 0");
}
// right is the value expression to assign
Object right = node.jjtGetChild(1).jjtAccept(this, data);
// determine initial object & property:
JexlNode objectNode = null;
Object object = register >= 0 ? registers[register] : null;
JexlNode propertyNode = null;
Object property = null;
boolean isVariable = true;
int v = 0;
StringBuilder variableName = null;
// 1: follow children till penultimate, resolve dot/array