-- SPY nest threading extension
Copyright (C) Tektronix, Inc. 2000 - 2001. All rights reserved.
description: These words are of old Tek CTE/MPT usage - it is quite useful for debugging, but in a portable environment it just means a minor speed penalty even if SPY_OFF and a great speed penalty if SPY_ON. The default should be to not include it but some special Tek builds.
To use it: enable the SPY' vocabulary when compiling colon words with spy-support. Later on, enable the spy-routine with SPY_ON and disable with SPY_OFF. The default spy-routine will print each word on enter and leave along with the stack contents at that point. You can attach customized entries into VALUEs named SPY-ENTER and SPY-LEAVE. Within a token-threaded environment, the CFA of the current entry can be gotten with R> DUP >R CELL - @ and most entries will give you a good >NAME for it.
EXTENSIONS
SPY-EXIT
( -- )(
)
;
p4:"spy-exit";
will unnest the current colon-word so it will actually return the word calling it. This can be found in the middle of a colon-sequence between : and ;
EXTENSIONS
SPY:
( name -- )(
)
;
p4:"spy-colon";
create a header for a nesting word and go to compiling mode then. This word is usually ended with ; but the execution of the resulting colon-word can also return with EXIT this is the spy-version SPY_ON
EXTENSIONS
;SPY
( -- )(
)
;
p4:"spy-semicolon";
compiles ((;)) which does EXIT the current colon-definition. It does then end compile-mode and returns to execute-mode. See : and :NONAME
EXTENSIONS
SPY_ON
( -- )(
)
;
p4:"spy-on";
change the runtime-code of (NEST) to call a special word that prints info to the screen whenever a colon word is entered. It will print the name and the current stack, and results in a kind of execution trace over SPY' :-colon nested words.
EXTENSIONS
SPY_OFF
( -- )(
)
;
p4:"spy-off";
disable SPY_ON nest-trace.
EXTENSIONS
SPY-ENTER
( .. )(
)
;
as:"spy-minus-enter";
- loader type P4_DVaL SPY-ENTER
spy_enter (no special usage info)
EXTENSIONS
SPY-LEAVE
( .. )(
)
;
as:"spy-minus-leave";
- loader type P4_DVaL SPY-LEAVE
spy_leave (no special usage info)
SPY'
:
( 'name' -- )(
)
;
p4:"colon";
create a header for a nesting word and go to compiling mode then. This word is usually ended with ; but the execution of the resulting colon-word can also return with EXIT
dpANS .6.1.0450 - standard forth word
SPY'
;
( -- )(
)
;
p4:"semicolon";
compiles ((;)) which does EXIT the current colon-definition. It does then end compile-mode and returns to execute-mode. See : and :NONAME
dpANS .6.1.0460 - standard forth word
SPY'
EXIT
( -- )(
)
;
p4:"exit";
will unnest the current colon-word so it will actually return the word calling it. This can be found in the middle of a colon-sequence between : and ;
dpANS .6.1.1380 - standard forth word