Ejemplo n.º 1
0
int _seze(int elen, double *e, double b, double *h)
{
 double Q, sum, hh, product1, product0, enow, _bvr, _avr, _brn, _arn, c;
 double abig, ahi, alo, bhi, blo, err1, err2, err3;
  int eindex, hindex;

  SPLT(b, bhi, blo);
  TPP(e[0], b, bhi, blo, Q, hh);
  hindex = 0;
  if (hh != 0) {
    h[hindex++] = hh;
  }
  for (eindex = 1; eindex < elen; eindex++) {
    enow = e[eindex];
    TPP(enow, b, bhi, blo, product1, product0);
    TWS(Q, product0, sum, hh);
    if (hh != 0) {
      h[hindex++] = hh;
    }
    FTS(product1, sum, Q, hh);
    if (hh != 0) {
      h[hindex++] = hh;
    }
  }
  if ((Q != 0.0) || (hindex == 0)) {
    h[hindex++] = Q;
  }
  return hindex;
}
Ejemplo n.º 2
0
VOID
PrintLex(LEX * plex)
{
  plex = plex;
#ifdef FOO
  switch (plex->lt)
  {
    case ltConst:
      printf("%d ", plex->val);
      break;
    case ltId:
      printf("%s ", plex->szId);
      break;
      SPLT(ltPoint, ".");
      SPLT(ltPlus, "+");
      SPLT(ltMinus, "-");
      SPLT(ltMult, "*");
      SPLT(ltDiv, "/");
      SPLT(ltMod, "%");
      SPLT(ltLParen, "(");
      SPLT(ltRParen, ")");
      SPLT(ltLBracket, "[");
      SPLT(ltRBracket, "]");
      SPLT(ltLBrace, "{");
      SPLT(ltRBrace, "}");
      SPLT(ltComma, ",");
      SPLT(ltLT, "<");
      SPLT(ltGT, ">");
      SPLT(ltLTE, "<=");
      SPLT(ltGTE, ">=");
      SPLT(ltNE, "<>");
      SPLT(ltEQ, "==");
      SPLT(ltAssign, "=");
      SPLT(ltQuestion, "?");
      SPLT(ltColon, ":");
      SPLT(ltCaret, "^");
  }
#endif
}