home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / program / compiler / nasm20b / nasm_src / exprfast.h < prev    next >
C/C++ Source or Header  |  1993-01-19  |  1KB  |  38 lines

  1. #ifndef _EXPRFAST_
  2. # define _EXPRFAST_ 1
  3. /* ---------------------------------------------------------------------- */
  4. /*                   Copyright (C) 1991 by Natürlich!                     */
  5. /*                      This file is copyrighted!                         */
  6. /*                Refer to the documentation for details.                 */
  7. /* ---------------------------------------------------------------------- */
  8. # if VERSION
  9.  
  10. # if ! _EXPR_
  11. extern exp_m huge  *ex_h;
  12. extern ref   huge  *rp;
  13. extern expr  huge  *ep;
  14. extern lexpr huge  *lp;
  15. extern buffer huge *bp;
  16. # endif
  17.  
  18. #define refer( l, ex)                                                   \
  19.     (rp = ref_alloc(), rp->line = bp->line, rp->ref = ex,               \
  20.     l->type |= L_REF, rp->next = l->refs, l->refs = rp, rp)
  21.  
  22. #define ival_pl( value)  (ep = exp_alloc(), ep->val = value, ep)
  23.  
  24. #define lex_pl( s, ex)                                                  \
  25.   (lp = lex_alloc(), lp->string = s, lp->expr = ex, lp->next = 0, lp)
  26.  
  27. #define lex_ch( l, r)  (l->next = r, l)
  28.  
  29. /* NOTE THAT this must not be the first exp_alloc call */
  30. #define exp_alloc()                                                     \
  31.    (ex_h->free-- ? ex_h->tab++ : (ex_h->free++, sexp_alloc()))
  32.  
  33. # else
  34. #  define exp_alloc()     sexp_alloc()
  35. #  define lex_ch( x, y)   slex_ch( x, y)
  36. # endif
  37. #endif
  38.