Diff for /gforth/prims2x.fs between versions 1.65 and 1.66

version 1.65, 2001/01/18 14:57:37 version 1.66, 2001/01/18 16:44:15
Line 104  struct% Line 104  struct%
  cell%    field item-stack  \ descriptor for the stack used, 0 is default   cell%    field item-stack  \ descriptor for the stack used, 0 is default
  cell%    field item-type   \ descriptor for the item type   cell%    field item-type   \ descriptor for the item type
  cell%    field item-offset \ offset in stack items, 0 for the deepest element   cell%    field item-offset \ offset in stack items, 0 for the deepest element
    cell%    field item-first  \ true if this is the first occurence of the item
 end-struct item%  end-struct item%
   
 struct%  struct%
Line 502  does> ( item -- ) Line 503  does> ( item -- )
     typ item item-type !      typ item item-type !
     typ type-stack @ item item-stack !default      typ type-stack @ item item-stack !default
     item item-name 2@ items @ search-wordlist 0= if \ new name      item item-name 2@ items @ search-wordlist 0= if \ new name
         item item-name 2@ 2dup nextname item declare          item item-name 2@ nextname item declare
         typ type-c-name 2@ type space type  ." ;" cr          item item-first on
           \ typ type-c-name 2@ type space type  ." ;" cr
     else      else
         drop          drop
           item item-first off
     endif ;      endif ;
   
 : execute-prefix ( item addr1 u1 -- )  : execute-prefix ( item addr1 u1 -- )
Line 532  does> ( item -- ) Line 535  does> ( item -- )
  effect-in effect-in-end @ declaration-list   effect-in effect-in-end @ declaration-list
  effect-out effect-out-end @ declaration-list ;   effect-out effect-out-end @ declaration-list ;
   
   : print-declaration { item -- }
       item item-first @ if
           item item-type @ type-c-name 2@ type space
           item item-name 2@ type ." ;" cr
       endif ;
   
   : print-declarations ( -- )
       effect-in  effect-in-end  @ ['] print-declaration map-items
       effect-out effect-out-end @ ['] print-declaration map-items ;
       
 : stack-prefix ( stack "prefix" -- )  : stack-prefix ( stack "prefix" -- )
     name tuck nextname create ( stack length ) 2,      name tuck nextname create ( stack length ) 2,
 does> ( item -- )  does> ( item -- )
Line 666  does> ( item -- ) Line 679  does> ( item -- )
  ." DEF_CA" cr   ." DEF_CA" cr
  declarations   declarations
  compute-offsets \ for everything else   compute-offsets \ for everything else
    print-declarations
  ." NEXT_P0;" cr   ." NEXT_P0;" cr
  flush-tos   flush-tos
  fetches   fetches
Line 753  does> ( item -- ) Line 767  does> ( item -- )
     ." {" cr      ." {" cr
     declarations      declarations
     compute-offsets \ for everything else      compute-offsets \ for everything else
       print-declarations
     inst-stream  stack-used? IF ." Cell *ip=IP;" cr THEN      inst-stream  stack-used? IF ." Cell *ip=IP;" cr THEN
     data-stack   stack-used? IF ." Cell *sp=SP;" cr THEN      data-stack   stack-used? IF ." Cell *sp=SP;" cr THEN
     fp-stack     stack-used? IF ." Cell *fp=*FP;" cr THEN      fp-stack     stack-used? IF ." Cell *fp=*FP;" cr THEN

Removed from v.1.65  
changed lines
  Added in v.1.66


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>