version 1.29, 2007/07/06 12:54:56
|
version 1.30, 2007/10/22 20:11:43
|
Line 23 require struct.fs
|
Line 23 require struct.fs
|
$10 Value maxvp \ current size of search order stack |
$10 Value maxvp \ current size of search order stack |
$400 Value maxvp-limit \ upper limit for resizing search order stack |
$400 Value maxvp-limit \ upper limit for resizing search order stack |
0 AValue vp \ will be initialized later (dynamic) |
0 AValue vp \ will be initialized later (dynamic) |
|
\ the first cell at vp contains the search order depth, the others |
|
\ contain the wordlists, starting with the last-searched one. |
|
|
: get-current ( -- wid ) \ search |
: get-current ( -- wid ) \ search |
\G @i{wid} is the identifier of the current compilation word list. |
\G @i{wid} is the identifier of the current compilation word list. |
Line 96 Variable slowvoc 0 slowvoc !
|
Line 98 Variable slowvoc 0 slowvoc !
|
|
|
: (vocfind) ( addr count wid -- nfa|false ) |
: (vocfind) ( addr count wid -- nfa|false ) |
\ !! generalize this to be independent of vp |
\ !! generalize this to be independent of vp |
drop vp dup @ 1- cells over + |
drop 0 vp @ -DO ( addr count ) \ note that the loop does not reach 0 |
DO 2dup I 2@ over <> |
2dup vp i cells + @ (search-wordlist) dup if ( addr count nt ) |
IF (search-wordlist) dup |
nip nip unloop exit then |
IF nip nip UNLOOP EXIT |
drop 1 -loop |
THEN drop |
|
ELSE drop 2drop THEN |
|
[ -1 cells ] Literal +LOOP |
|
2drop false ; |
2drop false ; |
|
|
0 value locals-wordlist |
0 value locals-wordlist |
Line 203 lookup ! \ our dictionary search order b
|
Line 202 lookup ! \ our dictionary search order b
|
THEN |
THEN |
dup check-maxvp |
dup check-maxvp |
dup vp! |
dup vp! |
?dup IF 1- FOR vp cell+ I cells + ! NEXT THEN ; |
0 swap -DO ( wid1 ... widi ) |
|
vp i cells + ! \ note that the loop does not reach 0 |
|
1 -loop ; |
|
|
: seal ( -- ) \ gforth |
: seal ( -- ) \ gforth |
\G Remove all word lists from the search order stack other than the word |
\G Remove all word lists from the search order stack other than the word |