short BiArithCount::codeGen(Generator * generator)
{
  Attributes ** attr;
  ExpGenerator * eg = generator->getExpGenerator();
  
  if (eg->genItemExpr(this, &attr, (1+getArity()), -1) == 1)
    return 0;

  // if temp space is needed for this operation, set it.
  if (attr[0]->isComplexType())
    {
      eg->addTempsLength(((ComplexType *)attr[0])->setTempSpaceInfo(getOperatorType(),
#pragma nowarn(1506)   // warning elimination 
								    eg->getTempsLength()));
#pragma warn(1506)  // warning elimination 
    }
			      
  ex_arith_count_clause * arith_clause =
    new(generator->getSpace()) 
    ex_arith_count_clause(getOperatorType(), 
			  attr, 
			  generator->getSpace());
  
  generator->getExpGenerator()->linkClause(this, arith_clause);

  return 0;
}
short BiArith::codeGen(Generator * generator)
{
  Attributes ** attr;
  ExpGenerator * eg = generator->getExpGenerator();
  
  if (eg->genItemExpr(this, &attr, (1+getArity()), -1) == 1)
    return 0;

  // if temp space is needed for this operation, set it.
  if (attr[0]->isComplexType())
    {
      eg->addTempsLength(((ComplexType *)attr[0])->setTempSpaceInfo(getOperatorType(),
#pragma nowarn(1506)   // warning elimination 
								    eg->getTempsLength()));
#pragma warn(1506)  // warning elimination 
    }
			      
  attr[0]->resetlastdaymonthflag();
  attr[0]->resetlastdayonerrflag();

// Check to see which type of rounding is needed for add_months, date_add
// functions.  Set flags here for use in executor datetime.cpp.
  if (isStandardNormalization())
     attr[0]->setlastdayonerrflag();
  if (isKeepLastDay())
     attr[0]->setlastdaymonthflag();

  ex_arith_clause * arith_clause =
    new(generator->getSpace()) 
    ex_arith_clause(getOperatorType(), attr, generator->getSpace(),
		    (short)getRoundingMode(),
		    getDivToDownscale());

  generator->getExpGenerator()->linkClause(this, arith_clause);

  return 0;
}