version 1.10, 2000/09/23 15:47:09
|
version 1.18, 2004/08/23 14:03:53
|
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 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 -- ) here over - swap ! ; |
: >resolve ( addr -- ) |
: <resolve ( addr -- ) here - , ; |
here swap ! |
|
basic-block-end ; |
|
: <resolve ( addr -- ) , ; |
|
|
: BUT |
: BUT |
1 cs-roll ; immediate restrict |
1 cs-roll ; immediate restrict |
Line 155 Defer begin-like ( -- )
|
Line 160 Defer begin-like ( -- )
|
' noop IS begin-like |
' noop IS begin-like |
|
|
: BEGIN ( compilation -- dest ; run-time -- ) \ core |
: BEGIN ( compilation -- dest ; run-time -- ) \ core |
begin-like cs-push-part dest ; immediate restrict |
begin-like cs-push-part dest |
|
basic-block-end ; immediate restrict |
|
|
Defer again-like ( dest -- addr ) |
Defer again-like ( dest -- addr ) |
' nip IS again-like |
' nip IS again-like |
Line 299 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 |