}
public Calc compileCall(ResolvedFunCall call, ExpCompiler compiler) {
final MemberCalc memberCalc =
compiler.compileMember(call.getArg(0));
final IntegerCalc integerCalc =
compiler.compileInteger(call.getArg(1));
final boolean lag = call.getFunName().equals("Lag");
return new AbstractMemberCalc(
call,
new Calc[] {memberCalc, integerCalc})
{
public Member evaluateMember(Evaluator evaluator) {
Member member = memberCalc.evaluateMember(evaluator);
int n = integerCalc.evaluateInteger(evaluator);
if (lag) {
if (n == Integer.MIN_VALUE) {
// Bump up lagValue by one, otherwise -n (used
// in the getLeadMember call below) is out of
// range because Integer.MAX_VALUE ==