1
0

funny.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. #include "e.h"
  10. #include "y.tab.h"
  11. extern int Funnyps;
  12. extern double Funnyht, Funnybase;
  13. void funny(int n)
  14. {
  15. char *f = 0;
  16. yyval = salloc();
  17. switch (n) {
  18. case SUM:
  19. f = lookup(deftbl, "sum_def")->cval; break;
  20. case UNION:
  21. f = lookup(deftbl, "union_def")->cval; break;
  22. case INTER: /* intersection */
  23. f = lookup(deftbl, "inter_def")->cval; break;
  24. case PROD:
  25. f = lookup(deftbl, "prod_def")->cval; break;
  26. default:
  27. ERROR "funny type %d in funny", n FATAL;
  28. }
  29. printf(".ds %d %s\n", yyval, f);
  30. eht[yyval] = EM(1.0, ps+Funnyps) - EM(Funnyht, ps);
  31. ebase[yyval] = EM(Funnybase, ps);
  32. dprintf(".\tS%d <- %s; h=%g b=%g\n",
  33. yyval, f, eht[yyval], ebase[yyval]);
  34. lfont[yyval] = rfont[yyval] = ROM;
  35. }