home *** CD-ROM | disk | FTP | other *** search
Text File | 1986-10-21 | 3.7 KB | 174 lines | [TEXT/MACA] |
- \ words -- sorted and a unsorted WORDS that may be echoed to the printer
- \ 11/30/84 SSG Version 1.0
- \ 12/17/84 SSG Moved selectors to select1; modified sortnfas:
- \ 12/17/84 SSG Modified w; deleted .h and .d
- \ 12/19/84 SSG Commented-out method words:
- \ 12/29/84 SSG Added page: and lastPage: to WordsClass
- \ 12/31/84 SSG Made theList an ordered-col in theList (mod)
- \ Changed WordsClass methods to NEON words.
- \ 2/17/85 SSG Made compatible with Neon release 0.95
- \ 1/05/86 cdn Made compatible with Neon release 1.5
- \ 8/20/86 cdn Replaced initFmarkers with x
-
- // Alert
- // Ctl
- // CtlWind
- // Dialog
- // Drvr
- // fInfo
- // Interval
- // QD1
- // Struct1
- // vScroll
- // Serial
- // Radio
- // date
- // vol
-
- 0 value cnt
- : k 2drop 1 ++> cnt ;
- 'c k 0 trav
-
- cnt Ordered-Col theList
- 50 Ordered-Col fileMarkers \ first NFA's of source files
-
- : x here add: fileMarkers
- @pfa nfa ,
- tib in + bl enclose (LCword)
- here c@ 1+ align allot ;
-
- clear: fileMarkers
- x fwind nucleus
- x \ Base
- x inparms Args
- x ^class Class
- x nullcfa Struct
- x basicstr BasicStr
- x string String
- x dirfind Files
- x 2** Ovl
- x from Mod
- x aboutmod Imports
- x srccopy QD
- x menubar Event
- x thewindow Window
- x mydoc objInit
- x pstartlen Proc
- x ?new Menu
- x execword fltMem
- x (fcmp2) fpCode
- x @fp0 fArgs
- x stringer fpI/O
- x fnumber fInterpret
- x flt@ fValue
- x ln elCode
- x 1.0 fpExtra
- x getflt Float
- x pathlist PathList
- x frontend FrontEnd
- x alert Alert
- x get-ctl-obj Ctl
- x ctlexec CtlWind
- x closer Dialog
- x pbdrvr Drvr
- x fin fInfo
- x timer Interval
- x +pair QD1
- x warray Struct1
- x myctl vScroll
- x port Serial
- x radioset Radio
- x secs2date date
- x volInfo vol
-
- \ ( NFA -- previousNFA )
- : nextNfa
- pfa lfa @ ;
-
- \ ( fldWid -- ) Pads with blanks to field-width using current out
-
- : padBlanks
- out - spaces 0 -> out ;
-
- \ Prints name of source file which contains the word.
- : .word { theNfa \ index before after -- }
- 0 -> after
- 5 spaces
- theNfa 6 .r space
- 0 -> out \ Initialize system output count value.
- theNfa id. 16 padBlanks
- size: fileMarkers 0 over -> index ( size 0 )
- DO theNfa i at: fileMarkers @ <
- IF i -> index leave THEN
- LOOP
- index 1- at: fileMarkers 4+ count type
- 20 padBlanks \ file name
- context @ -> after \ last dictionary entry
- theNfa after =
- IF ." last entry"
- ELSE after nextNfa -> before \ previous entry
- BEGIN
- theNfa before <
- WHILE
- before -> after
- after nextNfa -> before
- REPEAT
- theNfa nextNfa -> before
- before id. 16 padblanks
- after id. 16 padblanks
- THEN
- CR
- ;
-
- \ Prints page number and issues formfeed if 58 lines out.
- : page { len -- }
- len 58 /mod swap not \ 58 lines printed out?
- IF CR
- 38 spaces ." Page" .d CR
- np \ Send a form feed.
- ELSE drop \ number of pages
- THEN
- ;
-
- \ Prints last page number and number of entries.
- : lastPage { len -- }
- CR CR
- 5 spaces ." There are" size: theList .d ." entries in the dictionary."
- CR 3 ++> len
- len 58 /mod 1+ ( lines-on-last-page page# )
- 58 rot - 0 DO CR LOOP \ Linefeed to end of page.
- 38 spaces ." Page" .d CR np \ Print last page number.
- ;
-
- \ ( nfa1 nfa2 -- result ) Compares the name strings pointed to by two NFAs.
- : nfaComp
- count $ 1F and rot
- count $ 1F and 2swap ( addr1 len1 addr2 len2 )
- $= ;
-
- \ ( -- ) Puts all nfa's in dictionary into theList.
- : getNfas
- clear: theList
- last: fileMarkers @ pfa lfa @
- BEGIN
- dup add: theList
- pfa lfa @ -dup 0=
- UNTIL
- ;
-
- \ Prints names of all word and the source files that contain them
- : sources { \ len -- }
- getnfas
- CR ." Sorting…"
- ixAddr: theList size: theList 'c nfaComp sort
- 0 -> len +print
- base >R hex
- size: theList 0
- DO i at: theList .word
- 1 ++> len len page
- ?pause
- LOOP
- len lastPage
- R> -> base -print
- ;
-