binding = createBinding(varTree);
// don't allow current binding to be used when parsing the expression
// but do use any type supplied for the binding
Expression expr;
expr = ExpressionHelper.createExpression(rule, bindings, exprTree, binding.getType());
// check bindings
expr.bind();
String name = binding.getName();
if (bindings.lookup(name) != null) {
// oops rebinding not allowed
String message = "Event.createBindings : rebinding disallowed for variable " + name + varTree.getPos();
throw new TypeException(message);
}
// if the binding type is undefined and the expression type is defined propagate the
// expression type to the binding
if (binding.getType() == Type.UNDEFINED && expr.getType() != Type.UNDEFINED) {
binding.setType(expr.getType());
}
binding.setValue(expr);
bindings.append(binding);
}