home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume3 / clover / part01 / lex.yy.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-03-10  |  3.7 KB  |  94 lines

  1. # include "stdio.h"
  2. # define U(x) x
  3. # define NLSTATE yyprevious=YYNEWLINE
  4. # define BEGIN yybgin = yysvec + 1 +
  5. # define INITIAL 0
  6. # define YYLERR yysvec
  7. # define YYSTATE (yyestate-yysvec-1)
  8. # define YYOPTIM 1
  9. # define YYLMAX BUFSIZ
  10. # define output(c) putc(c,yyout)
  11. # define input() (((yytchar=yysptr>yysbuf?U(*--yysptr):getc(yyin))==10?(yylineno++,yytchar):yytchar)==EOF?0:yytchar)
  12. # define unput(c) {yytchar= (c);if(yytchar=='\n')yylineno--;*yysptr++=yytchar;}
  13. # define yymore() (yymorfg=1)
  14. # define ECHO fprintf(yyout, "%s",yytext)
  15. # define REJECT { nstr = yyreject(); goto yyfussy;}
  16. int yyleng; extern char yytext[];
  17. int yymorfg;
  18. extern char *yysptr, yysbuf[];
  19. int yytchar;
  20. FILE *yyin = {stdin}, *yyout = {stdout};
  21. extern int yylineno;
  22. struct yysvf { 
  23.     struct yywork *yystoff;
  24.     struct yysvf *yyother;
  25.     int *yystops;};
  26. struct yysvf *yyestate;
  27. extern struct yysvf yysvec[], *yybgin;
  28.  ;;; -*- Mode: LISP;  Package: hacks; base: 8; lowercase: t -*-
  29.   (multiple-value-bind (nil rem) (floor n d) rem))
  30.   `(as-2-reverse (1+ (ar-2-reverse *color-screen-array* ,x1 ,y1))
  31.          *color-screen-array*
  32.          ,x1
  33.          ,y1))
  34.              &aux (max (max (abs (- xn x0)) (abs (- yn y0)))))
  35.        (draw-sym-subline x0 y0 xn yn 0 max))
  36.                     &aux (max (max (abs (- xn x0)) (abs (- yn y0)))))
  37.        (draw-sym-subline x0 y0 xn yn
  38.              (- (fix (* -1 begfrac max)))
  39.              (fix (* endfrac max))))
  40.        (cond ((> xn x0) (cond ((> yn y0) (cond ((> dx dy) (line-loop #'plot0 x0 y0 dx dy i j))
  41.                            ((line-loop #'plot1 y0 x0 dy dx i j))))
  42.                   ((cond ((> dx dy) (line-loop #'plot7 x0 (- y0) dx dy i j))
  43.                      ((line-loop #'plot6 (- y0) x0 dy dx i j))))))
  44.          ((cond ((> yn y0) (cond ((> dx dy) (line-loop #'plot3 (- x0) y0 dx dy i j))
  45.                      ((line-loop #'plot2 y0 (- x0) dy dx i j))))
  46.             ((cond ((> dx dy) (line-loop #'plot4 (- x0) (- y0) dx dy i j))
  47.                ((line-loop #'plot5 (- y0) (- x0) dy dx i j))))))))
  48.               &aux (num (+ dx (* 2 i dy))))
  49.        (do ((j2 (min j (ash dx -1)))
  50.         (y (+ y0 (truncate num (ash dx 1))))
  51.         (i i (1+ i))
  52.         (x (+ x0 i) (1+ x))
  53.         (f (ash (- (\ num (ash dx 1)) dx) -1) (+ f dy)))
  54.        ((> i j2) (do ((i i (1+ i))
  55.               (x x (1+ x))
  56.               (f f (+ f dy)))
  57.              ((> i j))
  58.              (and (> (+ f f) dx) (setq f (- f dx) y (1+ y)))
  59.              (funcall fun x y)))
  60.        (and ( (+ f f) dx) (setq f (- f dx) y (1+ y)))
  61.        (funcall fun x y)))
  62.                 &optional (dx (abs (- xn x0))) (dy (abs (- yn y0))))
  63.        (cond ((> xn x0) (cond ((> yn y0) (cond ((> dx dy)
  64.                         (line-clip #'plot0 x0 y0 dx dy xe ye xf yf))
  65.                            ((line-clip #'plot1 y0 x0 dy dx ye xe yf xf))))
  66.                   ((cond ((> dx dy)
  67.                       (line-clip #'plot7 x0 (- y0) dx dy xe (- yf) xf (- ye)))
  68.                      ((line-clip #'plot6 (- y0) x0 dy dx (- yf) xe (- ye) xf))))))
  69.          ((cond ((> yn y0)
  70.              (cond ((> dx dy)
  71.                 (line-clip #'plot3 (- x0) y0 dx dy (- xf) ye (- xe) yf))
  72.                ((line-clip #'plot2 y0 (- x0) dy dx ye (- xf) yf (- xe)))))
  73.             ((cond ((> dx dy)
  74.                 (line-clip #'plot4 (- x0) (- y0) dx dy (- xf) (- yf) (- xe) (- ye)))
  75.                ((line-clip #'plot5 (- y0) (- x0) dy dx (- yf) (- xf) (- ye) (- xe)))))))))
  76.               &aux (x (max x0 xe (if (= dy 0) xe (+ x0 (//+ (* dx
  77.                                        (1- (ash (- ye y0) 1)))
  78.                                     (ash dy 1))))))
  79.                    (num (+ dx (* 2 dy (- x x0))))
  80.                (lx (min xf (if (= dy 0) xf (+ x0 (//+ (* dx (1- (ash (- yf y0) 1)))
  81.                                  (ash dy 1)))))))
  82.        (do ((xx (min (+ x0 (ash dx -1)) lx))
  83.         (y (+ y0 (//- num (ash dx 1))))
  84.         (x x (1+ x))
  85.         (f (ash (- (\- num (ash dx 1)) dx) -1) (+ f dy)))
  86.        ((> x xx) (do ((xx lx)
  87.               (x x (1+ x))
  88.               (f f (+ f dy)))
  89.              ((> x xx))
  90.              (and (> (+ f f) dx) (setq f (- f dx) y (1+ y)))
  91.              (funcall fun x y)))
  92.        (and ( (+ f f) dx) (setq f (- f dx) y (1+ y)))
  93.        (funcall fun x y)))
  94.