version 1.11, 2001/02/24 17:24:45
|
version 1.20, 2007/10/29 15:56:31
|
Line 1
|
Line 1
|
\ Structural Conditionals 12dec92py |
\ Structural Conditionals 12dec92py |
|
|
\ Copyright (C) 1995,1996,1997,2000 Free Software Foundation, Inc. |
\ Copyright (C) 1995,1996,1997,2000,2003,2004 Free Software Foundation, Inc. |
|
|
\ This file is part of Gforth. |
\ This file is part of Gforth. |
|
|
Line 105 variable backedge-locals
|
Line 105 variable backedge-locals
|
|
|
\ Structural Conditionals 12dec92py |
\ Structural Conditionals 12dec92py |
|
|
|
defer other-control-flow ( -- ) |
|
\ hook for control-flow stuff that's not handled by begin-like etc. |
|
|
: ?struc ( flag -- ) abort" unstructured " ; |
: ?struc ( flag -- ) abort" unstructured " ; |
: sys? ( sys -- ) dup 0= ?struc ; |
: sys? ( sys -- ) dup 0= ?struc ; |
: >mark ( -- orig ) |
: >mark ( -- orig ) |
cs-push-orig 0 , ; |
cs-push-orig 0 , other-control-flow ; |
: >resolve ( addr -- ) |
: >resolve ( addr -- ) |
here over - swap ! |
here swap ! |
0 last-compiled ! ; |
basic-block-end ; |
: <resolve ( addr -- ) here - , ; |
: <resolve ( addr -- ) , ; |
|
|
: BUT |
: BUT |
1 cs-roll ; immediate restrict |
1 cs-roll ; immediate restrict |
Line 148 immediate restrict
|
Line 151 immediate restrict
|
\ people who have not been brought up with Forth (or who have been |
\ people who have not been brought up with Forth (or who have been |
\ brought up with fig-Forth). |
\ brought up with fig-Forth). |
|
|
: ELSE ( compilation orig1 -- orig2 ; run-time f -- ) \ core |
: ELSE ( compilation orig1 -- orig2 ; run-time -- ) \ core |
POSTPONE ahead |
POSTPONE ahead |
1 cs-roll |
1 cs-roll |
POSTPONE then ; immediate restrict |
POSTPONE then ; immediate restrict |
Line 158 Defer begin-like ( -- )
|
Line 161 Defer begin-like ( -- )
|
|
|
: BEGIN ( compilation -- dest ; run-time -- ) \ core |
: BEGIN ( compilation -- dest ; run-time -- ) \ core |
begin-like cs-push-part dest |
begin-like cs-push-part dest |
0 last-compiled ! ; immediate restrict |
basic-block-end ; immediate restrict |
|
|
Defer again-like ( dest -- addr ) |
Defer again-like ( dest -- addr ) |
' nip IS again-like |
' nip IS again-like |
Line 302 Defer exit-like ( -- )
|
Line 305 Defer exit-like ( -- )
|
' noop IS exit-like |
' noop IS exit-like |
|
|
: EXIT ( compilation -- ; run-time nest-sys -- ) \ core |
: EXIT ( compilation -- ; run-time nest-sys -- ) \ core |
\G Return to the calling definition; usually used as a way of |
\G Return to the calling definition; usually used as a way of |
\G forcing an early return from a definition. Before |
\G forcing an early return from a definition. Before |
\G @code{EXIT}ing you must clean up the return stack and |
\G @code{EXIT}ing you must clean up the return stack and |
\G @code{UNLOOP} any outstanding @code{?DO}...@code{LOOP}s. |
\G @code{UNLOOP} any outstanding @code{?DO}...@code{LOOP}s. |
exit-like |
exit-like |
POSTPONE ;s |
POSTPONE ;s |
|
basic-block-end |
POSTPONE unreachable ; immediate restrict |
POSTPONE unreachable ; immediate restrict |
|
|
: ?EXIT ( -- ) ( compilation -- ; run-time nest-sys f -- | nest-sys ) \ gforth |
: ?EXIT ( -- ) ( compilation -- ; run-time nest-sys f -- | nest-sys ) \ gforth |