-- C-like declaration primitives
Copyright (C) Tektronix, Inc. 1998 - 2001. All rights reserved.
description: some words that mimic partial behaviour of a C compiler especially it's preprocessor.
FORTH
#ELSE
( -- )(
)
;
p4:"sh-else";
The implementation of #ELSE is done in C for speed and being less error prone. Better use the ANSI-compatible [IF] [ELSE] [THEN] construct.
FORTH
#ENDIF
( -- )(
)
;
p4:"sh-endif";
end of #IF #IFDEF #IFNOTDEF and #ELSE contructs
(a dummy word that does actually nothing, but #ELSE may look for it)
FORTH
#IF
( -- )(
)
;
p4:"sh-if";
( -- state-save mfth-if-magic )
prepares for a following #IS_TRUE or #IS_FALSE, does basically switch off compile-mode for the enclosed code. <br> better use the ANSI style [IF] [ELSE] [THEN] construct.
FORTH
#IFDEF
( "word" -- )(
)
;
p4:"sh-ifdef";
better use [DEFINED] word [IF] - the word [IF] is ANSI-conform.
FORTH
#IFNDEF
( .. )(
)
;
as:"sharp-ifndef";
immediate primitive #IFNDEF
an executable word (no special usage info)
or wrapper call around p4_sh_ifnotdef
FORTH
#IFNOTDEF
( "word" -- )(
)
;
p4:"sh-ifnotdef";
better use [DEFINED] word [NOT] [IF] - the word [IF] and [ELSE] are ANSI-conform, while #IFDEF #ELSE are not.
FORTH
#IS_TRUE
( flag -- )(
)
;
p4:"sh-is-true";
( state-save mfth-if-magic flag -- )
checks the condition on the CS-STACK. <br> Pairs with #IF <br> better use the ANSI style [IF] [ELSE] [THEN] construct.
FORTH
#IS_FALSE
( flag -- )(
)
;
p4:"sh-is-false";
( state-save mfth-if-magic flag -- )
checks the condition on the CS-STACK. <br> Pairs with #IF <br> better use the ANSI style [IF] [ELSE] [THEN] construct.
FORTH
//
( .. )(
)
;
as:"slash-slash";
immediate synonym //
is doing the same as \\
this word is provided only for compatibility with common forth usage in programs. Thegiven synonym should be preferred however.
FORTH
#DEFINE
( .. )(
)
;
as:"sharp-define";
ordinary primitive #DEFINE
an executable word (no special usage info)
or wrapper call around p4_sh_define
FORTH
#PRAGMA
( .. )(
)
;
as:"sharp-pragma";
ordinary primitive #PRAGMA
an executable word (no special usage info)
or wrapper call around p4_sh_pragma