*/
public class AssignParselet implements InfixParselet {
public Expression parse(Parser parser, Expression left, Token token) {
Expression right = parser.parseExpression(Precedence.ASSIGNMENT - 1);
if (!(left instanceof NameExpression)) throw new ParseException(
"The left-hand side of an assignment must be a name.");
String name = ((NameExpression)left).getName();
return new AssignExpression(name, right);
}