home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_08_05 / 8n05131a < prev    next >
Text File  |  1990-04-18  |  1KB  |  39 lines

  1.  
  2. ---------------listing 6----------------
  3. typedef struct A*B,*(*C)();struct A{C(*d)();B e;}*v(),*b;C n[256];
  4. # include <stdio.h>
  5. #define a (d->e)
  6. #define o (B)printf
  7. #define X(_){return _;}
  8. #define Y(_,A)B _(d,e)B d,e;X(A)
  9. #define Z(P)C P(f,g,h,i)C f,g,h,i;X(P)
  10. #define c(_)(b=(B)malloc(sizeof(*b)),b->d=_,b->e=d,b)
  11. #define _(D,E,F,G,H)B D();Y(D/**/f,E)Y(D/**/g,F)Y(D/**/h,G)Y(D/**/i,H)\
  12.         Y(D,(*(*d->d)(D/**/f,D/**/g,D/**/h,D/**/i))(d,e))
  13. Z(f)
  14. Z(g)
  15. Z(h)
  16. Z(i)
  17. _(j,d,d,j a,j a)
  18. _(k,d,c(h),c(h),c(h))
  19. _(l,c(i),d,c(i),c(i))
  20. _(m,c(g),c(f),l(m a),k(m a))
  21. _(p,d,l(m(d)),k(p a),l(m a))
  22. _(q,l(p(d)),m(d),l a,k(q a))
  23. _(r,m(d),k(mf a),l(r a),k a)
  24. _(s,d,e,o("0",s a),o("1",s a))
  25. _(t,d,p(e),k(t(a,e)),v(k(t(a,e)),e))
  26. _(u,k(e),l(r(e)),k(v(a,e)),l(v(a,e)))
  27. _(v,e,r(e),u(e,a),u(q(e),a))
  28. _(w,o("0"),d,s(d),s(d))
  29. _(x,(*n[getchar()])(d),o("-1"),w(p(d,o("-"))),xh(d))
  30. _(y,xf(mg()),v(d,p(yf())),v(d,yf()),t(d,yf()))
  31. _(z,xf(yf()),(*(*j(d)->d)(w,x))(d),xf(k(d)),xf(l(d)))
  32. main(){
  33. n['(']=zf;n['x']=yi;n['-']=yg;
  34. n['+']=yh;n['0']=zh;n['1']=zi;
  35. n[' ']=xf;n[')']=n['\n']=kf;
  36. o("\n",zg(yf()));}
  37. ----------------end of listing 6--------------------
  38.  
  39.