Diff for /gforth/Attic/prims2y.fs between versions 1.6 and 1.7

version 1.6, 2003/10/05 20:14:09 version 1.7, 2003/10/08 13:17:10
Line 290  variable in-part \ true if processing a Line 290  variable in-part \ true if processing a
  in-part off   in-part off
 0 value state-in  \ state on entering prim  0 value state-in  \ state on entering prim
 0 value state-out \ state on exiting prim  0 value state-out \ state on exiting prim
   0 value state-in-default  \ state on entering prim
   0 value state-out-default \ state on exiting prim
   
 : prim-context ( ... p xt -- ... )  : prim-context ( ... p xt -- ... )
     \ execute xt with prim set to p      \ execute xt with prim set to p
Line 1308  variable tail-nextp2 \ xt to execute for Line 1310  variable tail-nextp2 \ xt to execute for
     output-combined perform ;      output-combined perform ;
   
 \ reprocessing (typically to generate versions for another cache states)  \ reprocessing (typically to generate versions for another cache states)
   \ !! use prim-context
   
 variable reprocessed-num 0 reprocessed-num !  variable reprocessed-num 0 reprocessed-num !
   
Line 1325  variable reprocessed-num 0 reprocessed-n Line 1328  variable reprocessed-num 0 reprocessed-n
     primitives search-wordlist 0= -13 and throw execute ;      primitives search-wordlist 0= -13 and throw execute ;
   
 : state-prim1 { in-state out-state prim -- }  : state-prim1 { in-state out-state prim -- }
       in-state out-state state-in-default state-out-default d= ?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 ;
Line 1357  variable reprocessed-num 0 reprocessed-n Line 1361  variable reprocessed-num 0 reprocessed-n
 : prim-states ( "name" -- )  : prim-states ( "name" -- )
     parse-word lookup-prim gen-prim-states ;      parse-word lookup-prim gen-prim-states ;
   
   : gen-branch-states ( out-state prim -- )
       \ generate versions that produce out-state; useful for branches
       to prim { out-state }
       cache-states 2@ swap { states } ( nstates )
       cache-stack stack-in @ +do
           states i th @ out-state prim state-prim1
       loop ;
   
   : branch-states ( out-state "name" -- )
       parse-word lookup-prim gen-branch-states ;
   
   \ producing state transitions
   
   : gen-transitions ( "name" -- )
       parse-word lookup-prim { prim }
       cache-states 2@ { states nstates }
       nstates 0 +do
           nstates 0 +do
               i j <> if
                   states i th @ states j th @ prim state-prim1
               endif
           loop
       loop ;
   
 \ C output  \ C output
   
 : print-item { n stack -- }  : print-item { n stack -- }

Removed from v.1.6  
changed lines
  Added in v.1.7


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