Diff for /gforth/prims2x.fs between versions 1.160 and 1.164

version 1.160, 2005/12/31 15:46:10 version 1.164, 2007/02/18 18:30:51
Line 1 Line 1
 \ converts primitives to, e.g., C code   \ converts primitives to, e.g., C code 
   
 \ Copyright (C) 1995,1996,1997,1998,2000,2003,2004,2005 Free Software Foundation, Inc.  \ Copyright (C) 1995,1996,1997,1998,2000,2003,2004,2005,2006 Free Software Foundation, Inc.
   
 \ This file is part of Gforth.  \ This file is part of Gforth.
   
Line 140  $12340000 immarg ! Line 140  $12340000 immarg !
   
 : ?print-error { f addr u -- }  : ?print-error { f addr u -- }
     f ?not? if      f ?not? if
         outfile-id >r try          stderr >outfile
             stderr to outfile-id          filename 2@ type ." :" line @ 0 .r ." : " addr u type cr
             filename 2@ type ." :" line @ 0 .r ." : " addr u type cr          print-error-line
             print-error-line          outfile<
             0  
         recover endtry  
         r> to outfile-id throw  
         1 (bye) \ abort          1 (bye) \ abort
     endif ;      endif ;
   
Line 205  struct% Line 202  struct%
 end-struct ss% \ stack-state  end-struct ss% \ stack-state
   
 struct%  struct%
       cell%              field state-enabled
     cell%              field state-number      cell%              field state-number
     cell% max-stacks * field state-sss      cell% max-stacks * field state-sss
 end-struct state%  end-struct state%
Line 504  defer inst-stream-f ( -- stack ) Line 502  defer inst-stream-f ( -- stack )
     ." vm_two"      ." vm_two"
     r@ item-stack-type-name type ." 2"      r@ item-stack-type-name type ." 2"
     r@ item-type @ print-type-prefix ." ("      r@ item-type @ print-type-prefix ." ("
     r@ item-in-index r@ item-stack @ 2dup ." (Cell)" stack-read      r@ item-in-index r@ item-stack @ 2dup stack-read
     ." , "                      -1 under+ ." (Cell)" stack-read      ." , "                      -1 under+ stack-read
     ." , " r@ item-name 2@ type      ." , " r@ item-name 2@ type
     ." )" cr      ." )" cr
     rdrop ;      rdrop ;
Line 755  stack inst-stream IP Cell Line 753  stack inst-stream IP Cell
 : state ( "name" -- )  : state ( "name" -- )
     \ create a state initialized with default-sss      \ create a state initialized with default-sss
     create state% %allot { s }      create state% %allot { s }
       s state-enabled on
     next-state-number @ s state-number ! 1 next-state-number +!      next-state-number @ s state-number ! 1 next-state-number +!
     max-stacks 0 ?do      max-stacks 0 ?do
         default-ss s state-sss i th !          default-ss s state-sss i th !
     loop ;      loop ;
   
   : state-disable ( state -- )
       state-enabled off ;
   
   : state-enabled? ( state -- f )
       state-enabled @ ;
   
 : .state ( state -- )  : .state ( state -- )
     0 >body - >name .name ;      0 >body - >name .name ;
   
Line 1462  variable reprocessed-num 0 reprocessed-n Line 1467  variable reprocessed-num 0 reprocessed-n
   
 : state-prim1 { in-state out-state prim -- }  : state-prim1 { in-state out-state prim -- }
     in-state out-state state-default dup d= ?EXIT      in-state out-state state-default dup d= ?EXIT
       in-state state-enabled? out-state state-enabled? and 0= ?EXIT
     in-state  to state-in      in-state  to state-in
     out-state to state-out      out-state to state-out
     prim reprocess-simple ;      prim reprocess-simple ;

Removed from v.1.160  
changed lines
  Added in v.1.164


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