diff view
color-brad8.f color-brad10.f
end of diff view
1. 0 [IF]
2.    Forth to HTML converter
3. 
4.    Main contributors:
5.       Brad Eckert       brad1NO@SPAMtinyboot.com            Original author
6.       Ed Beroset      berosetNO@SPAMmindspring.com          Fixed HTML bugs
7.       Dirk Busch         dirkNO@SPAMschneider-busch.de      Added some features
8. 
1. 0 [IF]
2.    Forth to HTML converter
3. 
4.    Main contributors:
5.       Brad Eckert       brad1NO@SPAMtinyboot.com            Original author
6.       Ed Beroset      berosetNO@SPAMmindspring.com          Fixed HTML bugs
7.       Dirk Busch         dirkNO@SPAMschneider-busch.de      Added some features
8. 
9.    Revision 7. See bottom for revision history.
9.    Revision 10. See bottom for revision history.
10. 
11.    This ANS Forth program is public domain. It translates ANS Forth to colorized
12.    HTML. Hyperlinks to the ANS Forth draft standard are inserted for all ANS
13.    standard words. Hyperlinks to user definitions are included.
14. 
15.    Usage: HTML FileName    Generates HTML file from Forth source.
16.                            Output file is Filename with .HTM extension.
17.           Q [forth code]   Outputs HTML for 1 line to screen
18. 
10. 
11.    This ANS Forth program is public domain. It translates ANS Forth to colorized
12.    HTML. Hyperlinks to the ANS Forth draft standard are inserted for all ANS
13.    standard words. Hyperlinks to user definitions are included.
14. 
15.    Usage: HTML FileName    Generates HTML file from Forth source.
16.                            Output file is Filename with .HTM extension.
17.           Q [forth code]   Outputs HTML for 1 line to screen
18. 
 
19.    Keep in mind that whatever path you use for the input filename will be in the
20.    output files, so don't use a drive letter etc. if the HTML is intended for
21.    distribution on CD or a web site.
22. 
23.    A framed version of the output file has a "_f.htm" extension. The left frame
24.    is an index of words and the words that use them. The right frame is source.
25.    If you open the index file (_i.htm extension) and click on links, source will
26.    be in a separate window. Still usable but frames are easier.
27. 
19.    Q is for debugging. You can use "linenum ?" to show the line number if an
28.    Q is for debugging. You can use "linenum ?" to show the line number if an
20.    ABORT occurs. The HTML is about 7 times as big as the Forth source because of
29.    ABORT occurs. The HTML is about 8 times as big as the Forth source because of
21.    all the links, color changes and whitespace.
22. 
23.    INCLUDEd files produce corresponding HTML pages. If a file can't be found,
24.    it is skipped. Otherwise it is nested.
25. 
26.    When you INCLUDE this file some redefinition complaints may occur. That's
27.    okay since you won't be loading an application on top of this. You can make
28.    a text version of this file by cut-and-paste to a text editor. The browser's
29.    save-as-text function will work too. This file is only 80 columns wide. Note
30.    that the browser may wrap after 80 columns when saving as a text file.
31. 
30.    all the links, color changes and whitespace.
31. 
32.    INCLUDEd files produce corresponding HTML pages. If a file can't be found,
33.    it is skipped. Otherwise it is nested.
34. 
35.    When you INCLUDE this file some redefinition complaints may occur. That's
36.    okay since you won't be loading an application on top of this. You can make
37.    a text version of this file by cut-and-paste to a text editor. The browser's
38.    save-as-text function will work too. This file is only 80 columns wide. Note
39.    that the browser may wrap after 80 columns when saving as a text file.
40. 
32.    Users of specific Forths can extend the hyperlink table to point to words
41.    Users of specific Forths can extend the hyperlink table to point to anchors
33.    in a glossary for that particular Forth.
34. 
42.    in a glossary for that particular Forth.
43. 
 
44.    This code has been tested under Win32forth, SwiftForth, VFX and Gforth.
45. 
35.    You can change the following bold/italic/nestable options:
36. [THEN]
37. 
38. ONLY FORTH ALSO DEFINITIONS
46.    You can change the following bold/italic/nestable options:
47. [THEN]
48. 
49. ONLY FORTH ALSO DEFINITIONS
39. 
 
40. \ ------------------------------------------------------------------------------
41. \ Configuration - You can change the options:
50. \ ------------------------------------------------------------------------------
51. \ Configuration - You can change the options:
42. 1 VALUE bold                                      \ T if bold text
43. 1 VALUE italic                                    \ T if italic comments
52. 0 VALUE bold                                      \ T if bold text
53. 0 VALUE italic                                    \ T if italic comments
44. 1 VALUE nestable                                  \ T if INCLUDE nested files
45. 1 VALUE linksource                                \ T link to the org. file /7/
54. 1 VALUE nestable                                  \ T if INCLUDE nested files
55. 1 VALUE linksource                                \ T link to the org. file /7/
46. CREATE  dpanspath ," .\"                          \ path to the ANS-Files   /7/
47. CREATE  copyright ," "                            \ copyright to output at  /7/
56. 1 VALUE frames                                    \ T if using frames /9/
57. : dpanspath S" .\" ;                              \ path to the ANS-Files   /7/
58. : copyright S" "   ;                              \ copyright to output at  /7/
48.                                                   \ the bottom of the HTML-file
49. 0 CONSTANT scheme ( Color scheme )                \ 0 = light background, 1=dark
50. \ ------------------------------------------------------------------------------
51. 
52. : undefined ( <name> -- f ) BL WORD FIND NIP 0= ;
59.                                                   \ the bottom of the HTML-file
60. 0 CONSTANT scheme ( Color scheme )                \ 0 = light background, 1=dark
61. \ ------------------------------------------------------------------------------
62. 
63. : undefined ( <name> -- f ) BL WORD FIND NIP 0= ;
53. undefined C+!    [IF] : C+! SWAP OVER C@ + SWAP C! ;                      [THEN]
54. undefined BOUNDS [IF] : BOUNDS OVER + SWAP ;                              [THEN]
55. undefined SCAN   [IF] : SCAN            ( addr len char -- addr' len' )
56.    >R
57.    BEGIN DUP WHILE OVER C@ R@ <> WHILE 1 /STRING REPEAT THEN
58.    R> DROP ;                                                              [THEN]
59. undefined SKIP   [IF] : SKIP            ( addr len char -- addr' len' )
60.    >R
61.    BEGIN DUP WHILE OVER C@ R@ = WHILE 1 /STRING REPEAT THEN
62.    R> DROP ;                                                              [THEN]
 
63. undefined NOOP   [IF] : NOOP ;                                            [THEN]
64. undefined NOOP   [IF] : NOOP ;                                            [THEN]
64. undefined +PLACE [IF] : +PLACE 2DUP 2>R COUNT CHARS + SWAP MOVE 2R> C+! ; [THEN]
65. undefined PLACE  [IF] : PLACE  0 OVER C! +PLACE ;                         [THEN]
65. undefined BOUNDS [IF] : BOUNDS OVER + SWAP ;                              [THEN]
66. undefined /STRING [IF] : /STRING TUCK - >R CHARS + R> ;                   [THEN]
67. undefined C+!    [IF] : C+! SWAP OVER C@ + SWAP C! ;                      [THEN]
66. undefined FDROP  [IF] : FDROP ;         ( no floating point? fake it )    [THEN]
67. undefined >FLOAT [IF] : >FLOAT DROP C@ [CHAR] 0 [CHAR] 9 1+ WITHIN ;      [THEN]
68. undefined FDROP  [IF] : FDROP ;         ( no floating point? fake it )    [THEN]
69. undefined >FLOAT [IF] : >FLOAT DROP C@ [CHAR] 0 [CHAR] 9 1+ WITHIN ;      [THEN]
68. undefined UPC    [IF] : UPC             ( convert char to upper case )
69.    DUP [CHAR] a [CHAR] z 1+ WITHIN AND IF 32 - THEN ;                     [THEN]
70. undefined SCAN   [IF] : SCAN            ( addr len char -- addr' len' )
71.    >R BEGIN DUP WHILE OVER C@ R@ <> WHILE 1 /STRING REPEAT THEN R> DROP ; [THEN]
72. undefined SKIP   [IF] : SKIP            ( addr len char -- addr' len' )
73.    >R BEGIN DUP WHILE OVER C@ R@ = WHILE 1 /STRING REPEAT THEN R> DROP ;  [THEN]
74. : +PLACE        ( addr len a -- ) 2DUP 2>R COUNT CHARS + SWAP MOVE 2R> C+! ;
75. : PLACE         ( addr len a -- ) 0 OVER C! +PLACE ;
76. : UPC           ( c -- C )  DUP [CHAR] a [CHAR] z 1+ WITHIN IF 32 - THEN ;
70. 
71. 0 VALUE outf                                    \ output to file
72. 1 VALUE screen-only                             \ screen is for testing
73. : werr  ABORT" Error writing file" ;
74. : out   screen-only IF TYPE    ELSE outf WRITE-FILE werr THEN ;
75. : outln screen-only IF TYPE CR ELSE outf WRITE-LINE werr THEN ;
76. 
77. WORDLIST CONSTANT hyperlinks                    \ list of hyperlinks
78. WORDLIST CONSTANT superlinks                    \ hyperlinks that can't change
79. 
80. VARIABLE attrib
81. : /a      ( -- )         attrib @ IF S" </a>" out THEN 0 attrib ! ;
82. : ,$      ( a len -- )   DUP C, BOUNDS ?DO I C@ C, LOOP ; \ text to dictionary
83. : ,|      ( <text> -- )  [CHAR] | WORD COUNT -TRAILING ,$ ;
84. : line    ( a line# -- ) 0 ?DO COUNT + LOOP COUNT out ;   \ output one string
85. : boiler  ( addr -- )    BEGIN COUNT DUP WHILE 2DUP + >R outln R> REPEAT 2DROP ;
86. : ital(   ( -- )         italic IF S" <i>" out THEN ;
87. : )ital   ( -- )         italic IF S" </i>" out THEN ;
77. 
78. 0 VALUE outf                                    \ output to file
79. 1 VALUE screen-only                             \ screen is for testing
80. : werr  ABORT" Error writing file" ;
81. : out   screen-only IF TYPE    ELSE outf WRITE-FILE werr THEN ;
82. : outln screen-only IF TYPE CR ELSE outf WRITE-LINE werr THEN ;
83. 
84. WORDLIST CONSTANT hyperlinks                    \ list of hyperlinks
85. WORDLIST CONSTANT superlinks                    \ hyperlinks that can't change
86. 
87. VARIABLE attrib
88. : /a      ( -- )         attrib @ IF S" </a>" out THEN 0 attrib ! ;
89. : ,$      ( a len -- )   DUP C, BOUNDS ?DO I C@ C, LOOP ; \ text to dictionary
90. : ,|      ( <text> -- )  [CHAR] | WORD COUNT -TRAILING ,$ ;
91. : line    ( a line# -- ) 0 ?DO COUNT + LOOP COUNT out ;   \ output one string
92. : boiler  ( addr -- )    BEGIN COUNT DUP WHILE 2DUP + >R outln R> REPEAT 2DROP ;
93. : ital(   ( -- )         italic IF S" <i>" out THEN ;
94. : )ital   ( -- )         italic IF S" </i>" out THEN ;
 
95. : newline ( -- )         S" <br />" outln ;
96. : xcr     ( -- )         S" " outln ;           \ /9/
88. 
89. CREATE misctext                                 \ various attribute strings
97. 
98. CREATE misctext                                 \ various attribute strings
90.    ,| <a href="                                                                |
99.    ,| <a href="                                                         | \ 0
91.    ,| <a name="x                                                               |
92.    ,| ">                                                                       |
93.    ,| <a href="#x                                                              |
100.    ,| <a name="x                                                               |
101.    ,| ">                                                                       |
102.    ,| <a href="#x                                                              |
94.    ,| ">                                                                       |
103.    ,| "                                                                 |
95.    ,| <span style="color:#                                                     |
96.    ,| <hr /><h1>                                                               |
104.    ,| <span style="color:#                                                     |
105.    ,| <hr /><h1>                                                               |
97.    ,| </h1><hr /><p>                                                           |
106.    ,| </h1><hr />                                                       |
98.    ,| </span>                                                                  |
99.    ,| </a>                                                                     |
107.    ,| </span>                                                                  |
108.    ,| </a>                                                                     |
 
109.    ,| <HEAD><TITLE>                                                     | \ 10
110.    ,| </TITLE></HEAD>                                                   |
111.    ,| <FRAMESET cols="25%,75%">                                         |
112.    ,| <FRAME SRC="                                                      |
113.    ,| " name="idx"  target="_self">                                     |
114.    ,| " name="main" target="_self">                                     |
115.    ,| </FRAMESET>                                                       |
116.    ,| " target="main">                                                  | \ 17
117.    ,| " target="idx">                                                   |
100.    0 C,
101. 
102. VARIABLE color                                  \ current color
103. VARIABLE infont                                 \ within <font> tag
104. 
118.    0 C,
119. 
120. VARIABLE color                                  \ current color
121. VARIABLE infont                                 \ within <font> tag
122. 
105. : fontcolor ( color -- ) BASE @ >R              \ change font color
123. : <href="       misctext 0 line ;
124. : ">            misctext 2 line ;
125. 
126. : fontcolor ( color -- )                        \ change font color
106.    1 infont !
127.    1 infont !
107.    misctext 5 line 0 HEX <# # # # # # # #> out
108.    misctext 2 line       R> BASE ! ;
128.    misctext 5 line 0 HEX <# # # # # # # #> out "> ;
109. 
110. : col ( color <name> -- )                       \ define a font color
111.    CREATE , DOES> @ color ! ;
112. 
113. HEX
114. scheme 0 = [IF]                                 \ light background
115.    808080 col unknown
116.    008000 col commentary
117.    990000 col numeric
118.    FF0000 col errors
119.    990080 col values
120.    000000 col userwords
121.    009999 col userdefiner
122.    CC00CC col variables
123.    0000FF col core_ws                           \ core is slightly lighter blue
124.    0000FF col core_ext_ws
125.    0000FF col block_ws
126.    0000FF col double_ws
127.    0000FF col exception_ws
128.    0000FF col facilities_ws
129.    0000FF col file_ws
130.    0000FF col fp_ws
131.    0000FF col local_ws
132.    0000FF col malloc_ws
133.    0000FF col progtools_ws
134.    0000FF col searchord_ws
135.    0000FF col string_ws
136. [ELSE]                                          \ black background
137.    808080 col unknown
138.    00FF00 col commentary
139.    FF8080 col numeric
140.    FF0000 col errors
141.    FF00FF col values
142.    FFFFFF col userwords
143.    00FFFF col userdefiner
144.    FF80FF col variables
145.    8080FF col core_ws
146.    8080FF col core_ext_ws
147.    0000FF col block_ws
148.    0000FF col double_ws
149.    0000FF col exception_ws
150.    0000FF col facilities_ws
151.    0000FF col file_ws
152.    0000FF col fp_ws
153.    0000FF col local_ws
154.    0000FF col malloc_ws
155.    0000FF col progtools_ws
156.    0000FF col searchord_ws
157.    0000FF col string_ws
158. [THEN]
159. DECIMAL
160. 
161. CREATE begin_header                             \ begin of HTML file part 1
162.    ,| <?xml version="1.0"?>                                                    |
163.    ,| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"                 |
164.    ,|     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">                 |
165.    ,| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">      |
166.    ,| <head>                                                                   |
167.    ,| <meta http-equiv="Content-Type" content="text/xml; charset=iso-8859-1" />|
129. 
130. : col ( color <name> -- )                       \ define a font color
131.    CREATE , DOES> @ color ! ;
132. 
133. HEX
134. scheme 0 = [IF]                                 \ light background
135.    808080 col unknown
136.    008000 col commentary
137.    990000 col numeric
138.    FF0000 col errors
139.    990080 col values
140.    000000 col userwords
141.    009999 col userdefiner
142.    CC00CC col variables
143.    0000FF col core_ws                           \ core is slightly lighter blue
144.    0000FF col core_ext_ws
145.    0000FF col block_ws
146.    0000FF col double_ws
147.    0000FF col exception_ws
148.    0000FF col facilities_ws
149.    0000FF col file_ws
150.    0000FF col fp_ws
151.    0000FF col local_ws
152.    0000FF col malloc_ws
153.    0000FF col progtools_ws
154.    0000FF col searchord_ws
155.    0000FF col string_ws
156. [ELSE]                                          \ black background
157.    808080 col unknown
158.    00FF00 col commentary
159.    FF8080 col numeric
160.    FF0000 col errors
161.    FF00FF col values
162.    FFFFFF col userwords
163.    00FFFF col userdefiner
164.    FF80FF col variables
165.    8080FF col core_ws
166.    8080FF col core_ext_ws
167.    0000FF col block_ws
168.    0000FF col double_ws
169.    0000FF col exception_ws
170.    0000FF col facilities_ws
171.    0000FF col file_ws
172.    0000FF col fp_ws
173.    0000FF col local_ws
174.    0000FF col malloc_ws
175.    0000FF col progtools_ws
176.    0000FF col searchord_ws
177.    0000FF col string_ws
178. [THEN]
179. DECIMAL
180. 
181. CREATE begin_header                             \ begin of HTML file part 1
182.    ,| <?xml version="1.0"?>                                                    |
183.    ,| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"                 |
184.    ,|     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">                 |
185.    ,| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">      |
186.    ,| <head>                                                                   |
187.    ,| <meta http-equiv="Content-Type" content="text/xml; charset=iso-8859-1" />|
168.    ,| <meta name="GENERATOR" content="Forth2HTML 0.8" />                       |
188.    ,| <meta name="GENERATOR" content="Forth2HTML ver 10" />                    |
169.    ,| <style type="text/css">                                                  |
170. scheme 0 = [IF] ,| body {background: #FFFFEE;}  | [THEN]  \ light background
171. scheme 1 = [IF] ,| body {background: #000000;}  | [THEN]  \ black background
172. scheme 0 = [IF] ,| h1 {color: #000000;}         | [THEN]
173. scheme 1 = [IF] ,| h1 {color: #FFFFFF;}         | [THEN]
174.    ,| p {font-family: monospace;}                                              |
175.    ,| a {text-decoration:none;}                                                |
176.    ,| </style>                                                                 |
177.    ,| <title>                                                                  |
178.    0 C,
179. 
189.    ,| <style type="text/css">                                                  |
190. scheme 0 = [IF] ,| body {background: #FFFFEE;}  | [THEN]  \ light background
191. scheme 1 = [IF] ,| body {background: #000000;}  | [THEN]  \ black background
192. scheme 0 = [IF] ,| h1 {color: #000000;}         | [THEN]
193. scheme 1 = [IF] ,| h1 {color: #FFFFFF;}         | [THEN]
194.    ,| p {font-family: monospace;}                                              |
195.    ,| a {text-decoration:none;}                                                |
196.    ,| </style>                                                                 |
197.    ,| <title>                                                                  |
198.    0 C,
199. 
180. \ body defaults: the most common link color (blue) is made the default color
181. \ the most common plain text color (green) is made default.
182. 
 
183. CREATE mid_header                               \ begin of HTML file part 2
184.    ,| </title></head>                                                          |
185.    ,| <body>                                                                   |
186.    0 C,
187. 
188. CREATE end_header_part1                         \ end of HTML file part 1 /7/
200. CREATE mid_header                               \ begin of HTML file part 2
201.    ,| </title></head>                                                          |
202.    ,| <body>                                                                   |
203.    0 C,
204. 
205. CREATE end_header_part1                         \ end of HTML file part 1 /7/
189.    ,| <hr />                                                                   |
206.    ,| </p><hr />                                                               |
190.    ,| <h4 style="color:black">                                                 |
191.    0 C,
192. 
193. CREATE end_header_part2                         \ end of HTML file part 2 /8/
194.    ,| <p><a href="http://www.tinyboot.com/ANS/color.htm"><font color="#C0C0C0">|
207.    ,| <h4 style="color:black">                                                 |
208.    0 C,
209. 
210. CREATE end_header_part2                         \ end of HTML file part 2 /8/
211.    ,| <p><a href="http://www.tinyboot.com/ANS/color.htm"><font color="#C0C0C0">|
195.    ,| HTMLized by <u>Forth2HTML</u> ver 0.8</font></a></p>                     |
212.    ,| HTMLized by <u>Forth2HTML</u> ver 10</font></a></p>                      |
196.    ,| </h4>                                                                    |
197.    ,| </body></html>                                                           |
198.    0 C,
199. 
213.    ,| </h4>                                                                    |
214.    ,| </body></html>                                                           |
215.    0 C,
216. 
200. 
 
201. : setcolor ( -- )                               \ select next color
202.    color @ fontcolor ;
203. 
204. : closefont ( -- )
205.    infont @ IF
206.    misctext 8 line 0 infont ! THEN ;
207.     
217. : setcolor ( -- )                               \ select next color
218.    color @ fontcolor ;
219. 
220. : closefont ( -- )
221.    infont @ IF
222.    misctext 8 line 0 infont ! THEN ;
223.     
 
224. \ In order to represent all ASCII chars as text, some puncuation needs to be
225. \ changed to make it HTML compatible.
208. 
209. VARIABLE bltally
210. : outh    ( a n -- )                            \ HTMLized text output
211.    999 bltally !
212.    BOUNDS ?DO I C@ CASE
213.       [CHAR] & OF S" &amp;"     out ENDOF
214.       [CHAR] < OF S" &lt;"      out ENDOF
215.       [CHAR] > OF S" &gt;"      out ENDOF
216.       [CHAR] " OF S" &quot;"    out ENDOF
217.       [CHAR] © OF S" &copy;"    out ENDOF       \ /7/
218.       BL       OF bltally @ 0= IF S"  " ELSE S" &nbsp;" THEN out
219.                 1 bltally +!     ENDOF
220.       I 1 out   0 bltally !
221.    ENDCASE LOOP ;
222. 
223. : outhattr  ( a n -- )                          \ HTMLized text output
224.    BOUNDS ?DO I C@ CASE
225.       [CHAR] & OF S" amp"       out ENDOF
226.       [CHAR] < OF S" lt"        out ENDOF
227.       [CHAR] > OF S" gt"        out ENDOF
228.       [CHAR] " OF S" quot"      out ENDOF
229.       [CHAR] + OF S" plus"      out ENDOF
230.       [CHAR] ! OF S" bang"      out ENDOF
231.       [CHAR] / OF S" slash"     out ENDOF
232.       [CHAR] \ OF S" backslash" out ENDOF
233.       [CHAR] ' OF S" apos"      out ENDOF
234.       [CHAR] = OF S" equal"     out ENDOF
235.       [CHAR] - OF S" dash"      out ENDOF
236.       [CHAR] @ OF S" at"        out ENDOF
237.       [CHAR] ; OF S" semi"      out ENDOF
238.       [CHAR] * OF S" star"      out ENDOF
239.       [CHAR] ? OF S" question"  out ENDOF
240.       [CHAR] ~ OF S" tilde"     out ENDOF
241.       [CHAR] # OF S" pound"     out ENDOF
242.       [CHAR] , OF S" comma"     out ENDOF
243.       [CHAR] $ OF S" dollar"    out ENDOF
244.       [CHAR] | OF S" bar"       out ENDOF
245.       [CHAR] [ OF S" ltbracket" out ENDOF
246.       [CHAR] ( OF S" ltparen"   out ENDOF
247.       [CHAR] { OF S" ltbrace"   out ENDOF
248.       [CHAR] ] OF S" rtbracket" out ENDOF
249.       [CHAR] ) OF S" rtparen"   out ENDOF
250.       [CHAR] } OF S" rtbrace"   out ENDOF
251.       BL       OF S" _"         out ENDOF
252.       I 1 out
253.    ENDCASE LOOP ;
254. 
255. : end_header ( -- )                             \ output end of HTML file /7/
256.    end_header_part1 boiler
226. 
227. VARIABLE bltally
228. : outh    ( a n -- )                            \ HTMLized text output
229.    999 bltally !
230.    BOUNDS ?DO I C@ CASE
231.       [CHAR] & OF S" &amp;"     out ENDOF
232.       [CHAR] < OF S" &lt;"      out ENDOF
233.       [CHAR] > OF S" &gt;"      out ENDOF
234.       [CHAR] " OF S" &quot;"    out ENDOF
235.       [CHAR] © OF S" &copy;"    out ENDOF       \ /7/
236.       BL       OF bltally @ 0= IF S"  " ELSE S" &nbsp;" THEN out
237.                 1 bltally +!     ENDOF
238.       I 1 out   0 bltally !
239.    ENDCASE LOOP ;
240. 
241. : outhattr  ( a n -- )                          \ HTMLized text output
242.    BOUNDS ?DO I C@ CASE
243.       [CHAR] & OF S" amp"       out ENDOF
244.       [CHAR] < OF S" lt"        out ENDOF
245.       [CHAR] > OF S" gt"        out ENDOF
246.       [CHAR] " OF S" quot"      out ENDOF
247.       [CHAR] + OF S" plus"      out ENDOF
248.       [CHAR] ! OF S" bang"      out ENDOF
249.       [CHAR] / OF S" slash"     out ENDOF
250.       [CHAR] \ OF S" backslash" out ENDOF
251.       [CHAR] ' OF S" apos"      out ENDOF
252.       [CHAR] = OF S" equal"     out ENDOF
253.       [CHAR] - OF S" dash"      out ENDOF
254.       [CHAR] @ OF S" at"        out ENDOF
255.       [CHAR] ; OF S" semi"      out ENDOF
256.       [CHAR] * OF S" star"      out ENDOF
257.       [CHAR] ? OF S" question"  out ENDOF
258.       [CHAR] ~ OF S" tilde"     out ENDOF
259.       [CHAR] # OF S" pound"     out ENDOF
260.       [CHAR] , OF S" comma"     out ENDOF
261.       [CHAR] $ OF S" dollar"    out ENDOF
262.       [CHAR] | OF S" bar"       out ENDOF
263.       [CHAR] [ OF S" ltbracket" out ENDOF
264.       [CHAR] ( OF S" ltparen"   out ENDOF
265.       [CHAR] { OF S" ltbrace"   out ENDOF
266.       [CHAR] ] OF S" rtbracket" out ENDOF
267.       [CHAR] ) OF S" rtparen"   out ENDOF
268.       [CHAR] } OF S" rtbrace"   out ENDOF
269.       BL       OF S" _"         out ENDOF
270.       I 1 out
271.    ENDCASE LOOP ;
272. 
273. : end_header ( -- )                             \ output end of HTML file /7/
274.    end_header_part1 boiler
257.    copyright COUNT ?DUP IF outh ELSE drop THEN
275.    copyright ?DUP IF outh ELSE drop THEN
258.    end_header_part2 boiler ;
259. 
260. : label ( addr len -- ) /a                      \ associate a label with a word
261.    misctext 1 line outhattr
276.    end_header_part2 boiler ;
277. 
278. : label ( addr len -- ) /a                      \ associate a label with a word
279.    misctext 1 line outhattr
262.    misctext 2 line 1 attrib ! ;
280.    "> 1 attrib ! ;
263. 
264. \ Assuming this is running on a PC, we allocate enough storage that crashes from
265. \ string overflows can't happen.                                        
266. 
267. CREATE inbuf 260 CHARS ALLOT                    \ current line from file
268. CREATE token 260 CHARS ALLOT                    \ last blank delimited string
269. CREATE XPAD  260 CHARS ALLOT                    \ temporary pad for word storage
270. CREATE EPAD  260 CHARS ALLOT                    \ temporary pad for evaluation
271. CREATE fn    260 CHARS ALLOT                    \ file name
272. CREATE fn1   260 CHARS ALLOT                    \ file name backup
281. 
282. \ Assuming this is running on a PC, we allocate enough storage that crashes from
283. \ string overflows can't happen.                                        
284. 
285. CREATE inbuf 260 CHARS ALLOT                    \ current line from file
286. CREATE token 260 CHARS ALLOT                    \ last blank delimited string
287. CREATE XPAD  260 CHARS ALLOT                    \ temporary pad for word storage
288. CREATE EPAD  260 CHARS ALLOT                    \ temporary pad for evaluation
289. CREATE fn    260 CHARS ALLOT                    \ file name
290. CREATE fn1   260 CHARS ALLOT                    \ file name backup
 
291. CREATE fn2   260 CHARS ALLOT                    \ global file name
292. CREATE fn3   260 CHARS ALLOT                    \ index file name
273. CREATE "str" 260 CHARS ALLOT                    \ parsed string storage
274. CREATE uname 260 CHARS ALLOT                    \ : definition name
275. 0 VALUE inf
276. VARIABLE nufile                                 \ T if nesting a file
277. VARIABLE utype                                  \ type of defined word
278. VARIABLE hstate
279. VARIABLE linenum
280. VARIABLE special                                \ special action, 0=none
281. 
293. CREATE "str" 260 CHARS ALLOT                    \ parsed string storage
294. CREATE uname 260 CHARS ALLOT                    \ : definition name
295. 0 VALUE inf
296. VARIABLE nufile                                 \ T if nesting a file
297. VARIABLE utype                                  \ type of defined word
298. VARIABLE hstate
299. VARIABLE linenum
300. VARIABLE special                                \ special action, 0=none
301. 
 
302. \ Defining word for hyperlinks to words in HTML standards files.
303. 
282. : std    ( word 2nd_fn color filename label -- )
283.    CREATE ' , ' , BL WORD COUNT ,$ BL WORD COUNT ,$
284.    DOES> /a DUP >R  2 CELLS +
304. : std    ( word 2nd_fn color filename label -- )
305.    CREATE ' , ' , BL WORD COUNT ,$ BL WORD COUNT ,$
306.    DOES> /a DUP >R  2 CELLS +
285.    misctext 0 line                              \ begin hyperlink
286.    dpanspath COUNT out                          \ output path to ANS files /7/
307.    <href="                                      \ begin hyperlink
308.    dpanspath out                                \ output path to ANS files /7/
287.    COUNT 2DUP + >R  out S" #" out               \ output file name
309.    COUNT 2DUP + >R  out S" #" out               \ output file name
288.    R> COUNT out misctext 2 line                 \ and anchor name
310.    R> COUNT out ">                              \ and anchor name
289.    1 attrib !
290.    R> 2@ SWAP EXECUTE EXECUTE ;                 \ extra attributes
291. 
292. : genHTML ( -- )                                \ generate pending HTML
293.    token COUNT DUP IF setcolor THEN outh closefont /a  0 token ! ;
294. 
295. : isnumber? ( addr len -- f )                   \ string converts to number?
296.    0 0 2SWAP >NUMBER NIP NIP NIP 0= ;
297. 
298. : hparse ( a len char -- a' len' )
299.    >R 2DUP R@ SKIP R> SCAN BL SCAN
300.    2SWAP 2 PICK - token +PLACE ;
301. 
302. : >XPAD ( -- ) token COUNT BL SKIP XPAD PLACE ; \ move to temporary pad
303. 
304. : hint  ( addr len -- )                         \ interpret one line...
305.    BEGIN
306.       0 token !  BL hparse token C@
307.    WHILE unknown                                \ default color
308.       >XPAD XPAD COUNT superlinks SEARCH-WORDLIST 0=  \ fixed hyperlink?
309.       IF    XPAD COUNT hyperlinks SEARCH-WORDLIST \ got a hyperlink for this?
310.       ELSE  TRUE
311.       THEN
312.       IF DEPTH >R EXECUTE
313.          R> DEPTH <> ABORT" stack depth change in HTML generator"
314.       ELSE
315.          XPAD COUNT BASE @ 10 = IF
316.             >FLOAT IF FDROP numeric THEN        \ valid float or integer
317.          ELSE
318.             isnumber? IF numeric THEN
319.          THEN
320.       THEN genHTML
311.    1 attrib !
312.    R> 2@ SWAP EXECUTE EXECUTE ;                 \ extra attributes
313. 
314. : genHTML ( -- )                                \ generate pending HTML
315.    token COUNT DUP IF setcolor THEN outh closefont /a  0 token ! ;
316. 
317. : isnumber? ( addr len -- f )                   \ string converts to number?
318.    0 0 2SWAP >NUMBER NIP NIP NIP 0= ;
319. 
320. : hparse ( a len char -- a' len' )
321.    >R 2DUP R@ SKIP R> SCAN BL SCAN
322.    2SWAP 2 PICK - token +PLACE ;
323. 
324. : >XPAD ( -- ) token COUNT BL SKIP XPAD PLACE ; \ move to temporary pad
325. 
326. : hint  ( addr len -- )                         \ interpret one line...
327.    BEGIN
328.       0 token !  BL hparse token C@
329.    WHILE unknown                                \ default color
330.       >XPAD XPAD COUNT superlinks SEARCH-WORDLIST 0=  \ fixed hyperlink?
331.       IF    XPAD COUNT hyperlinks SEARCH-WORDLIST \ got a hyperlink for this?
332.       ELSE  TRUE
333.       THEN
334.       IF DEPTH >R EXECUTE
335.          R> DEPTH <> ABORT" stack depth change in HTML generator"
336.       ELSE
337.          XPAD COUNT BASE @ 10 = IF
338.             >FLOAT IF FDROP numeric THEN        \ valid float or integer
339.          ELSE
340.             isnumber? IF numeric THEN
341.          THEN
342.       THEN genHTML
321.    REPEAT 2DROP
322.    S" <br />" outln ;                           \ new line
343.    REPEAT 2DROP newline ;
344. 
345. : shortname   ( -- )
346.    fn COUNT 2DUP [CHAR] . SCAN NIP - EPAD PLACE ;
323. 
324. : ofn   ( -- addr len )                         \ output file name
347. 
348. : ofn   ( -- addr len )                         \ output file name
325.    fn COUNT 2DUP [CHAR] . SCAN NIP - EPAD PLACE
326.    S" .htm" EPAD +PLACE   EPAD COUNT ;
349.    shortname S" .htm" EPAD +PLACE  EPAD COUNT ;
350. 
351. : mfn    ( -- addr len )                        \ main file name
352.    shortname S" _f.htm" EPAD +PLACE  EPAD COUNT ;
327. 
328. : hcreate ( addr len -- )
329.    DUP 0= IF 2DROP S" fakename" THEN            \ in case the name is missing
330.    S" CREATE " EPAD PLACE  EPAD +PLACE
331.    GET-CURRENT >R hyperlinks SET-CURRENT
332.    EPAD COUNT EVALUATE    R> SET-CURRENT ;      \ create a hyperlink generator
333. 
334. \ The user defined words use the following data structure:
335. \ CELL   xt of coloring word
353. 
354. : hcreate ( addr len -- )
355.    DUP 0= IF 2DROP S" fakename" THEN            \ in case the name is missing
356.    S" CREATE " EPAD PLACE  EPAD +PLACE
357.    GET-CURRENT >R hyperlinks SET-CURRENT
358.    EPAD COUNT EVALUATE    R> SET-CURRENT ;      \ create a hyperlink generator
359. 
360. \ The user defined words use the following data structure:
361. \ CELL   xt of coloring word
 
362. \ CELL   pointer to index                       \ /9/
336. \ STRING name of reference word
337. \ STRING name of file
338. 
363. \ STRING name of reference word
364. \ STRING name of file
365. 
 
366. \ An index is a list of all of the words that call a defined word. The master
367. \ index is a list of indexes.
368. 
369. variable index  0 index !                       \ index is a SLL of SLLs.
370. variable ulast  0 ulast !                       \ last compiled definition name
371. variable tally  0 tally !                       \ tally of defined words
372. 
373. \ Each index entry consists of a pointer to the previous index entry and a SLL.
374. \ The SLL (single linked list) starts out empty so upon creation it is 0.
375. 
376. \ index --> link_to_next
377. \           link_to_usedby_list <-- 'index
378. \           link to defined name structure
379. \           tally
380. 
381. : <idx>     ( n -- )                            \ create link to index n
382.    frames if                                    \ links undesirable if no frames
383.    1 attrib !                                   \ or for W3C HTML validation
384.    <href=" fn3 count out S" #x" out             \ <a href="index.htm#x
385.    HEX 0 <# #S #> out misctext 18 line          \ ..." target="idx">
386.    else drop then ;
387. 
388. : newindex ( -- 'index )                        \ add an index to the list
389.    HERE index @ , HERE SWAP 0 , index ! 0 ,     \ /9/
390.    1 tally +!  tally @ , ;
391. 
392. \ 'index -> link_to_next
393. \           link to usedby name structure
394. 
395. : newlink  ( 'index -- 'index )                 \ add a name to the index /9/
396.    dup @ @ ?dup if                              \ non-empty sublist?
397.       cell+ @ ulast @ = if exit then            \ duplicate entry
398.    then
399.    HERE OVER @ @ , ulast @ , OVER @ ! ;
400. 
401. variable indexing
402. 
339. : deflink ( addr -- )                           \ defined word makes hyperlink
340.    DUP @ EXECUTE CELL+                          \ set color
403. : deflink ( addr -- )                           \ defined word makes hyperlink
404.    DUP @ EXECUTE CELL+                          \ set color
 
405.    ulast @ IF newlink THEN CELL+                \ /9/ optional addition to index
341.    DUP COUNT + COUNT ofn COMPARE                \ in an external file?
406.    DUP COUNT + COUNT ofn COMPARE                \ in an external file?
342.    IF   misctext 0 line DUP COUNT + COUNT out   \ yes, put the file name
343.         S" #" out COUNT outh S" >" out
407.    IF   <href=" DUP COUNT + COUNT out           \ yes, put the file name
408.         S" #x" out COUNT outhattr
344.    ELSE misctext 3 line COUNT outhattr          \ no, just the label name
345.         misctext 4 line
409.    ELSE misctext 3 line COUNT outhattr          \ no, just the label name
410.         misctext 4 line
346.    THEN 1 attrib ! ;
411.    THEN
412.    misctext indexing @ if 17 else 2 then line   \ an index link needs a target
413.    1 attrib ! ;
414. 
415. : showlink ( addr bold? -- )                    \ output hyperlink for index
416.    >R dup deflink
417.    R@ if S" <b>" out then
418.    2 cells + count outh
419.    R> if S" </b>" out then
420.    /a    S"  " out ;
421. 
422. : outdex ( sll -- )                             \ output list of client words
423.    0 ulast !
424.    begin ?dup while  dup cell+ @ 0 showlink  @ repeat ;
425. 
426. : iname ( a -- )                                \ display index root name
427.    @ 1 showlink ;
347. 
348. : defx  ( a len xt -- a' len' )
428. 
429. : defx  ( a len xt -- a' len' )
 
430.    newindex >R
349.    >R genHTML BL hparse >XPAD                   \ output defining word
431.    >R genHTML BL hparse >XPAD                   \ output defining word
350.    XPAD COUNT 2DUP hcreate R> , ,$ ofn ,$
432.    XPAD COUNT 2DUP hcreate R> HERE SWAP ,
433.    R@ CELL+ !                                   \ resolve link to definition name
434.    R> , ,$ ofn ,$                               \ rest of structure
351.    DOES> deflink ;
352. 
435.    DOES> deflink ;
436. 
353. : labelnow   genHTML XPAD COUNT label ;
437. : labelnow   XPAD COUNT label /a tally @ <idx> genHTML /a ;
354. : defdat ['] numeric   defx numeric   labelnow ;
355. : defvar ['] variables defx variables labelnow ;
356. : defusr ['] userwords defx userwords labelnow ;
357. : defval ['] values    defx values    labelnow ;
358. : defdef ['] userdefiner defx userdefiner labelnow ;
359. 
360. : hstate=0 ( -- )             0 hstate ! ;
361. : hstate=1 ( -- )             1 hstate ! ;
362. : spec=zero ( -- )            1 special ! ;
363. : NONE     ( -- )             0 special ! ;     \ plain word
364. : skip)  ( a len -- a' len' ) [CHAR] ) hparse ;
365. : skip}  ( a len -- a' len' ) [CHAR] } hparse ; \ /7/
366. : skipw  ( a len -- a' len' ) BL hparse ;
367. : skipc  ( a len -- a len )   hstate @ 0= IF numeric skipw THEN ;
368. : skip"  ( a len -- a' len' )                   \ copy string to "str"
438. : defdat ['] numeric   defx numeric   labelnow ;
439. : defvar ['] variables defx variables labelnow ;
440. : defusr ['] userwords defx userwords labelnow ;
441. : defval ['] values    defx values    labelnow ;
442. : defdef ['] userdefiner defx userdefiner labelnow ;
443. 
444. : hstate=0 ( -- )             0 hstate ! ;
445. : hstate=1 ( -- )             1 hstate ! ;
446. : spec=zero ( -- )            1 special ! ;
447. : NONE     ( -- )             0 special ! ;     \ plain word
448. : skip)  ( a len -- a' len' ) [CHAR] ) hparse ;
449. : skip}  ( a len -- a' len' ) [CHAR] } hparse ; \ /7/
450. : skipw  ( a len -- a' len' ) BL hparse ;
451. : skipc  ( a len -- a len )   hstate @ 0= IF numeric skipw THEN ;
452. : skip"  ( a len -- a' len' )                   \ copy string to "str"
369.    genHTML [CHAR] " hparse token COUNT 1- "str" PLACE ;
453.    genHTML [CHAR] " hparse token COUNT 1- 0 MAX "str" PLACE ;  \ /10/
370. 
371. \ ------------------------------------------------------------------------------
372. \ ":" definitions might be defining words, so they can't be assumed to be defusr
373. \ types. ":" makes a label and saves the name for later use by ";" which makes
374. \ a hyperlink or a hyperlink defining word.
375. 
376. :NONAME                                         \ normal : definition
454. 
455. \ ------------------------------------------------------------------------------
456. \ ":" definitions might be defining words, so they can't be assumed to be defusr
457. \ types. ":" makes a label and saves the name for later use by ";" which makes
458. \ a hyperlink or a hyperlink defining word.
459. 
460. :NONAME                                         \ normal : definition
 
461.    ulast @ if                                   \ ending a : definition?
377.    uname COUNT ['] userwords defx 2DROP  0 token !
462.    uname COUNT ['] userwords defx 2DROP  0 token !
 
463.    then
378. ; CONSTANT normal_def
379. 
380. :NONAME
464. ; CONSTANT normal_def
465. 
466. :NONAME
381.    uname COUNT 2DUP hcreate ['] userwords , ,$ ofn ,$
467.    newindex >R
468.    uname COUNT 2DUP hcreate HERE ['] userwords , R@ CELL+ ! R> , ,$ ofn ,$
382.    DOES> deflink defdef
383. ; CONSTANT defining_def
384. 
469.    DOES> deflink defdef
470. ; CONSTANT defining_def
471. 
 
472. \ ULAST points to a data structure containing the hyperlink to the word being
473. \ defined. It is used when building the index because it can't wait until ;
474. \ resolves the definition before requiring the hyperlink.
475. 
385. : defunk ( a len -- a' len' )                   \ starting unknown definition
386.    hstate=1  normal_def utype !                 \ save name of : definition
476. : defunk ( a len -- a' len' )                   \ starting unknown definition
477.    hstate=1  normal_def utype !                 \ save name of : definition
387.    genHTML skipw userwords token COUNT BL SKIP 2DUP uname PLACE label ;
478.    genHTML skipw userwords token COUNT BL SKIP
479.    2DUP label /a tally @ 1+ <idx>               \ link to index
480.    2DUP HERE ulast ! ['] NOOP , PAD , ,$ ofn ,$ \ save name of definition /9/
481.    uname PLACE ;
388. 
389. : resunk ( -- )                                 \ resolve unknown defined word
482. 
483. : resunk ( -- )                                 \ resolve unknown defined word
390.    genHTML utype @ EXECUTE hstate=0 ;
484.    genHTML utype @ EXECUTE hstate=0
485.    0 ulast ! ;                                  \ indexing off
391. 
392. : created ( -- ) hstate @
393.    IF   defining_def utype !                    \ make ; create a defining word
394.    ELSE defdat                                  \ not compiling
395.    THEN ;
396. 
397. \ ------------------------------------------------------------------------------
398. 
486. 
487. : created ( -- ) hstate @
488.    IF   defining_def utype !                    \ make ; create a defining word
489.    ELSE defdat                                  \ not compiling
490.    THEN ;
491. 
492. \ ------------------------------------------------------------------------------
493. 
399. : header  ( addr len -- )                       \ output big header text /8/
494. : header  ( -- )                                \ output big header text /8/9/
495.    fn count
400.    misctext 6 line
401.    linksource
496.    misctext 6 line
497.    linksource
402.    IF   misctext 0 line
403.         2dup out misctext 2 line
498.    IF   <href="
499.         2dup out ">
404.         outln  misctext 9 line
405.    ELSE outln
406.    THEN misctext 7 line ;
407. 
408. : _incfil ( addr -- )                           \ trigger file nesting  /4/
409.    nestable 0= IF DROP EXIT THEN                \ don't nest files if disabled
410.    COUNT BL SKIP  2DUP R/O OPEN-FILE            \ can the file be opened?
411.    IF   DROP 2DROP                              \ no
412.    ELSE CLOSE-FILE DROP                         \ yes
413.         fn COUNT fn1 PLACE  fn PLACE 1 nufile !
414.    THEN ;
415. 
416. : incfile ( a len -- a' len' )                  \ include a file
417.    genHTML skipw token _incfil ;
418. 
419. : "incfil ( a len -- a' len' )                  \ include file from S" filename"
420.    skipw "str" _incfil ;
421. 
422. : hfill  ( -- len ior )                         \ read next line of file
423.    inbuf 256 BL FILL
424.    XPAD 256 inf READ-LINE ABORT" Error reading file"
425.    >R >R 0 XPAD R> BOUNDS                       ( idx . . )
426.    ?DO  I C@ 9 = IF 3 RSHIFT 1+ 3 LSHIFT        \ tab
427.         ELSE I C@ OVER 255 AND CHARS inbuf + C!
428.            1+ DUP 256 = IF CR ." Input line too long" THEN
429.         THEN
430.    LOOP R>
431.    1 linenum +! ;
432. 
500.         outln  misctext 9 line
501.    ELSE outln
502.    THEN misctext 7 line ;
503. 
504. : _incfil ( addr -- )                           \ trigger file nesting  /4/
505.    nestable 0= IF DROP EXIT THEN                \ don't nest files if disabled
506.    COUNT BL SKIP  2DUP R/O OPEN-FILE            \ can the file be opened?
507.    IF   DROP 2DROP                              \ no
508.    ELSE CLOSE-FILE DROP                         \ yes
509.         fn COUNT fn1 PLACE  fn PLACE 1 nufile !
510.    THEN ;
511. 
512. : incfile ( a len -- a' len' )                  \ include a file
513.    genHTML skipw token _incfil ;
514. 
515. : "incfil ( a len -- a' len' )                  \ include file from S" filename"
516.    skipw "str" _incfil ;
517. 
518. : hfill  ( -- len ior )                         \ read next line of file
519.    inbuf 256 BL FILL
520.    XPAD 256 inf READ-LINE ABORT" Error reading file"
521.    >R >R 0 XPAD R> BOUNDS                       ( idx . . )
522.    ?DO  I C@ 9 = IF 3 RSHIFT 1+ 3 LSHIFT        \ tab
523.         ELSE I C@ OVER 255 AND CHARS inbuf + C!
524.            1+ DUP 256 = IF CR ." Input line too long" THEN
525.         THEN
526.    LOOP R>
527.    1 linenum +! ;
528. 
433. : open  ( -- ) CR ." Reading " fn COUNT TYPE ."  at line " linenum @ .
529. \ OPEN and CLOSE input files
530. 
531. : open  ( -- ) CR ." Reading " fn COUNT TYPE ."  at line " linenum @ decimal .
434.    0 linenum !
435.    fn COUNT R/O OPEN-FILE ABORT" Error opening source file" TO inf ;
436. 
437. : close  ( -- ) CR ." closing " fn COUNT TYPE
438.    inf CLOSE-FILE ABORT" Error closing file" ;
439. 
440. : .title ( addr len -- )                        \ output as title string
441.    BOUNDS ?DO I C@ BL = IF S" %20" out ELSE I 1 out THEN LOOP ;
442. 
532.    0 linenum !
533.    fn COUNT R/O OPEN-FILE ABORT" Error opening source file" TO inf ;
534. 
535. : close  ( -- ) CR ." closing " fn COUNT TYPE
536.    inf CLOSE-FILE ABORT" Error closing file" ;
537. 
538. : .title ( addr len -- )                        \ output as title string
539.    BOUNDS ?DO I C@ BL = IF S" %20" out ELSE I 1 out THEN LOOP ;
540. 
443. : oopen  ( -- )
444.    ofn W/O CREATE-FILE ABORT" Error creating file" TO outf
445.    begin_header boiler                          \ begin boilerplate
541. \ OPEN and CLOSE output files
542. 
543. : ocreate ( addr len -- )
544.    W/O CREATE-FILE ABORT" Error creating file" TO outf ;
545. 
546. : oopen  ( -- )                                 \ create new output file
547.    ofn ocreate begin_header boiler              \ begin boilerplate
446.    fn COUNT .title  mid_header boiler           \ title and end boilerplate
548.    fn COUNT .title  mid_header boiler           \ title and end boilerplate
447.    bold IF S" <b>" out THEN
448.    fn COUNT header ;
549.    bold IF S" <b>" out THEN ;
550. 
551. : fclose  ( -- )
552.    outf CLOSE-FILE ABORT" Error closing file" ;
553. 
554. : new-output  ( -- )                            \ start a new output file /9/
555.    open oopen header S" <p>" out ;
556. 
557. \ Create index and frame files
558. 
559. : make-index  ( -- )                            \ make index /9/
560.    cr ." building index "
561.    1 indexing !
562.    fn2 count fn place
563.    cr ." Framed version: " mfn type
564.    mfn ocreate                                  \ create the main file
565.    misctext 10 line fn count .title
566.    ofn xpad place
567.    fn3 COUNT fn PLACE                           \ filename for index
568.    misctext 11 line xcr misctext 12 line xcr    \    <FRAMESET>
569.    misctext 13 line ofn out        misctext 14 line xcr \ <FRAME SRC= ...
570.    misctext 13 line xpad count out misctext 15 line xcr \ <FRAME SRC= ...
571.    misctext 16 line xcr                         \    </FRAMESET>
572.    fclose
573.    cr ." Index file " ofn type
574.    oopen S" <p>" out                            \ start the menu frame file
575.    index @ begin ?dup while                     \ for all index entries:
576.       dup cell+  dup cell+  dup cell+ @
577.       misctext 1 line  HEX 0 <# #S #> out       \ <a name="x
578.       ">  misctext 9 line          \ a></a>
579.       iname                \ root name
580.       @ outdex newline                          \ list of client words
581.    @ repeat
582.    S" </p></body></html>" outln                 \ end index
583.    fclose ;
584. 
585. \ Convert Forth source file(s) to HTML
449. 
450. : HTML  ( <infile> -- )
451.    S" /basic-links/" hyperlinks SEARCH-WORDLIST
452.    IF   EXECUTE  THEN                           \ remove user hyperlinks
453.    GET-CURRENT >R hyperlinks SET-CURRENT        \ replace the fence
454.    S" MARKER /basic-links/" EVALUATE
455.    R> SET-CURRENT
586. 
587. : HTML  ( <infile> -- )
588.    S" /basic-links/" hyperlinks SEARCH-WORDLIST
589.    IF   EXECUTE  THEN                           \ remove user hyperlinks
590.    GET-CURRENT >R hyperlinks SET-CURRENT        \ replace the fence
591.    S" MARKER /basic-links/" EVALUATE
592.    R> SET-CURRENT
 
593.    0 TO outf                                    \ no output file yet
456.    0 TO screen-only  0 nufile !  1 linenum !    \ force usage of file
594.    0 TO screen-only  0 nufile !  1 linenum !    \ force usage of file
457.    BL WORD COUNT fn PLACE open oopen            \ open input and output files
595.    0 ulast ! 0 index ! 0 tally !                \ clear index
596.    0 indexing !
597.    BL WORD COUNT  2dup fn2 place                \ save global filename /9/
598.    fn PLACE shortname S" _i.htm" epad +place epad count fn3 place \ index name
599.    new-output                                   \ open input and output files
458.    -1 DUP >R outf >R                            \ file nest uses stacks
459.    hstate=0
460.    BEGIN
461.       BEGIN 0 special !                         \ process line
462.          nufile @                               \ nest a file?
463.          IF   inf outf
600.    -1 DUP >R outf >R                            \ file nest uses stacks
601.    hstate=0
602.    BEGIN
603.       BEGIN 0 special !                         \ process line
604.          nufile @                               \ nest a file?
605.          IF   inf outf
464.               open oopen  outf >R               \ open new files
606.               new-output outf >R                \ open new files
465.               0 nufile !
466.          THEN hfill
467.       WHILE inbuf SWAP hint
468.       REPEAT DROP
469.       close fn1 COUNT fn PLACE                  \ restore file name
470.       DUP -1 <>
471.       IF   TO outf TO inf FALSE                 \ unnest files
472.       ELSE TRUE
473.       THEN
474.    UNTIL DROP
475.    BEGIN R> DUP -1 <>                           \ close all output files
607.               0 nufile !
608.          THEN hfill
609.       WHILE inbuf SWAP hint
610.       REPEAT DROP
611.       close fn1 COUNT fn PLACE                  \ restore file name
612.       DUP -1 <>
613.       IF   TO outf TO inf FALSE                 \ unnest files
614.       ELSE TRUE
615.       THEN
616.    UNTIL DROP
617.    BEGIN R> DUP -1 <>                           \ close all output files
476.    WHILE bold IF S" </b>" out THEN
477.       end_header                                \ finish up HTML   /7/
478.       CLOSE-FILE ABORT" Error closing file"
479.    REPEAT DROP ;
618.    WHILE TO outf
619.          bold IF S" </b>" out THEN end_header
620.          fclose
621.    REPEAT DROP
622.    make-index ;
480. 
481. : q  ( -- ) 1 TO screen-only                    \ single line test
482.    -1 WORD COUNT inbuf PLACE inbuf COUNT hint ;
483. 
484. \ 0 [IF] is often used as a comment. If it is used as a comment, scan the file
485. \ for a [THEN]. [THEN] must be on the next line or beyond.
486. 
487. CREATE terminator 16 CHARS ALLOT                \ multiline comment terminator
488. 
489. : multicomment ( a len searchstring -- a' len' )
490.    terminator PLACE
491.    genHTML commentary ital( setcolor outh       \ finish up this line
623. 
624. : q  ( -- ) 1 TO screen-only                    \ single line test
625.    -1 WORD COUNT inbuf PLACE inbuf COUNT hint ;
626. 
627. \ 0 [IF] is often used as a comment. If it is used as a comment, scan the file
628. \ for a [THEN]. [THEN] must be on the next line or beyond.
629. 
630. CREATE terminator 16 CHARS ALLOT                \ multiline comment terminator
631. 
632. : multicomment ( a len searchstring -- a' len' )
633.    terminator PLACE
634.    genHTML commentary ital( setcolor outh       \ finish up this line
492.    BEGIN hfill      S" <br />" outln
635.    BEGIN hfill newline
493.    WHILE >R inbuf EPAD R@ MOVE
494.       EPAD R@ BOUNDS ?DO I C@ UPC I C! LOOP     \ uppercase for search
495.       EPAD R@ terminator COUNT SEARCH
496.       IF   DROP EPAD - inbuf OVER token PLACE   \ before [THEN] is comment
497.            genHTML
498.            inbuf R> ROT /STRING
499.            )ital closefont EXIT
500.       ELSE 2DROP inbuf R> outh                  \ whole line is comment
501.       THEN
502.    REPEAT inbuf SWAP )ital closefont ;          \ EOF found
503. 
504. : bigif  ( a len -- a len )  special @ 1 =
505.    IF S" [THEN]" multicomment THEN ;
506. 
507. \ =============================================================================
508. 
509. : _DEFINITIONS DEFINITIONS ;
510. \ : _order order ;  : _words words ; : _see see ;
511. 
512. superlinks SET-CURRENT \ These hyperlinks cannot be overridden.
513. 
514. \ The following words are not in the ANS standard but are very common.
515. : VOCABULARY    defusr ;
516. : DEFER         defusr ;
517. : INCLUDE       hstate @ 0= IF incfile THEN ;
518. : FLOAD         hstate @ 0= IF incfile THEN ;
636.    WHILE >R inbuf EPAD R@ MOVE
637.       EPAD R@ BOUNDS ?DO I C@ UPC I C! LOOP     \ uppercase for search
638.       EPAD R@ terminator COUNT SEARCH
639.       IF   DROP EPAD - inbuf OVER token PLACE   \ before [THEN] is comment
640.            genHTML
641.            inbuf R> ROT /STRING
642.            )ital closefont EXIT
643.       ELSE 2DROP inbuf R> outh                  \ whole line is comment
644.       THEN
645.    REPEAT inbuf SWAP )ital closefont ;          \ EOF found
646. 
647. : bigif  ( a len -- a len )  special @ 1 =
648.    IF S" [THEN]" multicomment THEN ;
649. 
650. \ =============================================================================
651. 
652. : _DEFINITIONS DEFINITIONS ;
653. \ : _order order ;  : _words words ; : _see see ;
654. 
655. superlinks SET-CURRENT \ These hyperlinks cannot be overridden.
656. 
657. \ The following words are not in the ANS standard but are very common.
658. : VOCABULARY    defusr ;
659. : DEFER         defusr ;
660. : INCLUDE       hstate @ 0= IF incfile THEN ;
661. : FLOAD         hstate @ 0= IF incfile THEN ;
 
662. : SYS-FLOAD     hstate @ 0= IF incfile THEN ;
519. : BINARY        2 BASE ! ;
520. : OCTAL         8 BASE ! ;
521. : 0             numeric spec=zero ;
522. : 1             numeric  ;
523. : -1            numeric  ;
524. : COMMENT:      S" COMMENT;" multicomment ;
525. : ((            S" ))"       multicomment ;
526. 
527. \ The following words are not in the ANS standard but are used in Win32Forth
528. : ANEW          skipw ;                    \ /7/
529. : CallBack:     defunk ;                   \ /7/
530. : :M            defunk ;                   \ /7/
531. : ;M            resunk ;                   \ /7/
532. : z"            numeric skip" ;
533. 
534. \ Forth Inc uses { for comment while others use it for locals. } on the same
535. \ line indicates locals, which are grayed. Otherwise a multiline comment.
536. 
537. : {             2DUP [CHAR] } SCAN NIP 0=
538.                 IF S" }" multicomment ELSE genHTML skip} THEN ;
539. 
540. \ The rest is ANS Forth standard
541. 
542. : \             commentary genHTML ital( token PLACE genHTML )ital token 0 ;
543. 
544. (   NAME                ACTION  COLOR           FILENAME        REFERENCE )
545. (   ------------------  ------  --------------  -----------     --------- )
546. std (                   skip)   commentary      dpans6.htm      6.1.0080
547. std ."                  skip"   numeric         dpans6.htm      6.1.0190
548. std :                   defunk  core_ws         dpans6.htm      6.1.0450
549. std ;                   resunk  core_ws         dpans6.htm      6.1.0460
550. std ABORT"              skip"   errors          dpans6.htm      6.1.0680
551. std CHAR                skipc   core_ws         dpans6.htm      6.1.0895
552. std CONSTANT            defdat  core_ws         dpans6.htm      6.1.0950
553. std CREATE              created core_ws         dpans6.htm      6.1.1000
554. std DECIMAL             DECIMAL core_ws         dpans6.htm      6.1.1170
555. std S"                  skip"   numeric         dpans6.htm      6.1.2165
556. std VARIABLE            defvar  core_ws         dpans6.htm      6.1.2410
557. std [                  hstate=0 core_ws         dpans6.htm      6.1.2500
558. std [CHAR]              skipw   numeric         dpans6.htm      6.1.2520
559. std ]                  hstate=1 core_ws         dpans6.htm      6.1.2540
560. std .(                  skip)   commentary      dpans6.htm      6.2.0200
561. std C"                  skip"   numeric         dpans6.htm      6.2.0855
562. std FALSE             spec=zero numeric         dpans6.htm      6.2.1485
563. std HEX                 HEX     core_ext_ws     dpans6.htm      6.2.1660
564. std MARKER              defusr  core_ext_ws     dpans6.htm      6.2.1850
565. std VALUE               defval  core_ext_ws     dpans6.htm      6.2.2405
566. std 2CONSTANT           defdat  double_ws       dpans8.htm      8.6.1.0360
567. std 2VARIABLE           defvar  double_ws       dpans8.htm      8.6.1.0440
568. std INCLUDED            "incfil file_ws         dpans11.htm     11.6.1.1718
569. std FCONSTANT           defdat  fp_ws           dpans12.htm     12.6.1.1492
570. std FVARIABLE           defvar  fp_ws           dpans12.htm     12.6.1.1630
571. std ;CODE               resunk  progtools_ws    dpans15.htm     15.6.2.0470
572. std CODE                defusr  progtools_ws    dpans15.htm     15.6.2.0930
573. std [IF]                bigif   progtools_ws    dpans15.htm     15.6.2.2532
574. 
575. hyperlinks SET-CURRENT \ These hyperlinks can be overridden.
576. 
577. std [']                 NONE    numeric         dpans6.htm      6.1.2510
578. std !                   NONE    core_ws         dpans6.htm      6.1.0010
579. std #                   NONE    core_ws         dpans6.htm      6.1.0030
580. std #>                  NONE    core_ws         dpans6.htm      6.1.0040
581. std #S                  NONE    core_ws         dpans6.htm      6.1.0050
582. std '                   NONE    core_ws         dpans6.htm      6.1.0070
583. std *                   NONE    core_ws         dpans6.htm      6.1.0090
584. std */                  NONE    core_ws         dpans6.htm      6.1.0100
585. std */MOD               NONE    core_ws         dpans6.htm      6.1.0110
586. std +                   NONE    core_ws         dpans6.htm      6.1.0120
587. std +!                  NONE    core_ws         dpans6.htm      6.1.0130
588. std +LOOP               NONE    core_ws         dpans6.htm      6.1.0140
589. std ,                   NONE    core_ws         dpans6.htm      6.1.0150
590. std -                   NONE    core_ws         dpans6.htm      6.1.0160
591. std .                   NONE    core_ws         dpans6.htm      6.1.0180
592. std /                   NONE    core_ws         dpans6.htm      6.1.0230
593. std /MOD                NONE    core_ws         dpans6.htm      6.1.0240
594. std 0<                  NONE    core_ws         dpans6.htm      6.1.0250
595. std 0=                  NONE    core_ws         dpans6.htm      6.1.0270
596. std 1+                  NONE    core_ws         dpans6.htm      6.1.0290
597. std 1-                  NONE    core_ws         dpans6.htm      6.1.0300
598. std 2!                  NONE    core_ws         dpans6.htm      6.1.0310
599. std 2*                  NONE    core_ws         dpans6.htm      6.1.0320
600. std 2/                  NONE    core_ws         dpans6.htm      6.1.0330
601. std 2@                  NONE    core_ws         dpans6.htm      6.1.0350
602. std 2DROP               NONE    core_ws         dpans6.htm      6.1.0370
603. std 2DUP                NONE    core_ws         dpans6.htm      6.1.0380
604. std 2OVER               NONE    core_ws         dpans6.htm      6.1.0400
605. std 2SWAP               NONE    core_ws         dpans6.htm      6.1.0430
606. std <                   NONE    core_ws         dpans6.htm      6.1.0480
607. std <#                  NONE    core_ws         dpans6.htm      6.1.0490
608. std =                   NONE    core_ws         dpans6.htm      6.1.0530
609. std >                   NONE    core_ws         dpans6.htm      6.1.0540
610. std >BODY               NONE    core_ws         dpans6.htm      6.1.0550
611. std >IN                 NONE    core_ws         dpans6.htm      6.1.0560
612. std >NUMBER             NONE    core_ws         dpans6.htm      6.1.0570
613. std >R                  NONE    core_ws         dpans6.htm      6.1.0580
614. std ?DUP                NONE    core_ws         dpans6.htm      6.1.0630
615. std @                   NONE    core_ws         dpans6.htm      6.1.0650
616. std ABORT               NONE    core_ws         dpans6.htm      6.1.0670
617. std ABS                 NONE    core_ws         dpans6.htm      6.1.0690
618. std ACCEPT              NONE    core_ws         dpans6.htm      6.1.0695
619. std ALIGN               NONE    core_ws         dpans6.htm      6.1.0705
620. std ALIGNED             NONE    core_ws         dpans6.htm      6.1.0706
621. std ALLOT               NONE    core_ws         dpans6.htm      6.1.0710
622. std AND                 NONE    core_ws         dpans6.htm      6.1.0720
623. std BASE                NONE    core_ws         dpans6.htm      6.1.0750
624. std BEGIN               NONE    core_ws         dpans6.htm      6.1.0760
625. std BL                  NONE    numeric         dpans6.htm      6.1.0770
626. std C!                  NONE    core_ws         dpans6.htm      6.1.0850
627. std C,                  NONE    core_ws         dpans6.htm      6.1.0860
628. std C@                  NONE    core_ws         dpans6.htm      6.1.0870
629. std CELL+               NONE    core_ws         dpans6.htm      6.1.0880
630. std CELLS               NONE    core_ws         dpans6.htm      6.1.0890
631. std CHAR+               NONE    core_ws         dpans6.htm      6.1.0897
632. std CHARS               NONE    core_ws         dpans6.htm      6.1.0898
633. std COUNT               NONE    core_ws         dpans6.htm      6.1.0980
634. std CR                  NONE    core_ws         dpans6.htm      6.1.0990
635. std DEPTH               NONE    core_ws         dpans6.htm      6.1.1200
636. std DO                  NONE    core_ws         dpans6.htm      6.1.1240
637. std DOES>               NONE    core_ws         dpans6.htm      6.1.1250
638. std DROP                NONE    core_ws         dpans6.htm      6.1.1260
639. std DUP                 NONE    core_ws         dpans6.htm      6.1.1290
640. std ELSE                NONE    core_ws         dpans6.htm      6.1.1310
641. std EMIT                NONE    core_ws         dpans6.htm      6.1.1320
642. std ENVIRONMENT?        NONE    core_ws         dpans6.htm      6.1.1345
643. std EVALUATE            NONE    core_ws         dpans6.htm      6.1.1360
644. std EXECUTE             NONE    core_ws         dpans6.htm      6.1.1370
645. std EXIT                NONE    core_ws         dpans6.htm      6.1.1380
646. std FILL                NONE    core_ws         dpans6.htm      6.1.1540
647. std FIND                NONE    core_ws         dpans6.htm      6.1.1550
648. std FM/MOD              NONE    core_ws         dpans6.htm      6.1.1561
649. std HERE                NONE    core_ws         dpans6.htm      6.1.1650
650. std HOLD                NONE    core_ws         dpans6.htm      6.1.1670
651. std I                   NONE    core_ws         dpans6.htm      6.1.1680
652. std IF                  NONE    core_ws         dpans6.htm      6.1.1700
653. std IMMEDIATE           NONE    core_ws         dpans6.htm      6.1.1710
654. std INVERT              NONE    core_ws         dpans6.htm      6.1.1720
655. std J                   NONE    core_ws         dpans6.htm      6.1.1730
656. std KEY                 NONE    core_ws         dpans6.htm      6.1.1750
657. std LEAVE               NONE    core_ws         dpans6.htm      6.1.1760
658. std LITERAL             NONE    core_ws         dpans6.htm      6.1.1780
659. std LOOP                NONE    core_ws         dpans6.htm      6.1.1800
660. std LSHIFT              NONE    core_ws         dpans6.htm      6.1.1805
661. std M*                  NONE    core_ws         dpans6.htm      6.1.1810
662. std MAX                 NONE    core_ws         dpans6.htm      6.1.1870
663. std MIN                 NONE    core_ws         dpans6.htm      6.1.1880
664. std MOD                 NONE    core_ws         dpans6.htm      6.1.1890
665. std MOVE                NONE    core_ws         dpans6.htm      6.1.1900
666. std NEGATE              NONE    core_ws         dpans6.htm      6.1.1910
667. std OR                  NONE    core_ws         dpans6.htm      6.1.1980
668. std OVER                NONE    core_ws         dpans6.htm      6.1.1990
669. std POSTPONE            NONE    core_ws         dpans6.htm      6.1.2033
670. std QUIT                NONE    core_ws         dpans6.htm      6.1.2050
671. std R>                  NONE    core_ws         dpans6.htm      6.1.2060
672. std R@                  NONE    core_ws         dpans6.htm      6.1.2070
673. std RECURSE             NONE    core_ws         dpans6.htm      6.1.2120
674. std REPEAT              NONE    core_ws         dpans6.htm      6.1.2140
675. std ROT                 NONE    core_ws         dpans6.htm      6.1.2160
676. std RSHIFT              NONE    core_ws         dpans6.htm      6.1.2162
677. std S>D                 NONE    core_ws         dpans6.htm      6.1.2170
678. std SIGN                NONE    core_ws         dpans6.htm      6.1.2210
679. std SM/REM              NONE    core_ws         dpans6.htm      6.1.2214
680. std SOURCE              NONE    core_ws         dpans6.htm      6.1.2216
681. std SPACE               NONE    core_ws         dpans6.htm      6.1.2220
682. std SPACES              NONE    core_ws         dpans6.htm      6.1.2230
683. std STATE               NONE    core_ws         dpans6.htm      6.1.2250
684. std SWAP                NONE    core_ws         dpans6.htm      6.1.2260
685. std THEN                NONE    core_ws         dpans6.htm      6.1.2270
686. std TYPE                NONE    core_ws         dpans6.htm      6.1.2310
687. std U.                  NONE    core_ws         dpans6.htm      6.1.2320
688. std U<                  NONE    core_ws         dpans6.htm      6.1.2340
689. std UM*                 NONE    core_ws         dpans6.htm      6.1.2360
690. std UM/MOD              NONE    core_ws         dpans6.htm      6.1.2370
691. std UNLOOP              NONE    core_ws         dpans6.htm      6.1.2380
692. std UNTIL               NONE    core_ws         dpans6.htm      6.1.2390
693. std WHILE               NONE    core_ws         dpans6.htm      6.1.2430
694. std WORD                NONE    core_ws         dpans6.htm      6.1.2450
695. std XOR                 NONE    core_ws         dpans6.htm      6.1.2490
696. std #TIB                NONE    core_ext_ws     dpans6.htm      6.2.0060
697. std .R                  NONE    core_ext_ws     dpans6.htm      6.2.0210
698. std 0<>                 NONE    core_ext_ws     dpans6.htm      6.2.0260
699. std 0>                  NONE    core_ext_ws     dpans6.htm      6.2.0280
700. std 2>R                 NONE    core_ext_ws     dpans6.htm      6.2.0340
701. std 2R>                 NONE    core_ext_ws     dpans6.htm      6.2.0410
702. std 2R@                 NONE    core_ext_ws     dpans6.htm      6.2.0415
703. std :NONAME             NONE    core_ext_ws     dpans6.htm      6.2.0455
704. std <>                  NONE    core_ext_ws     dpans6.htm      6.2.0500
705. std ?DO                 NONE    core_ext_ws     dpans6.htm      6.2.0620
706. std AGAIN               NONE    core_ext_ws     dpans6.htm      6.2.0700
707. std CASE                NONE    core_ext_ws     dpans6.htm      6.2.0873
708. std COMPILE,            NONE    core_ext_ws     dpans6.htm      6.2.0945
709. std CONVERT             NONE    core_ext_ws     dpans6.htm      6.2.0970
710. std ENDCASE             NONE    core_ext_ws     dpans6.htm      6.2.1342
711. std ENDOF               NONE    core_ext_ws     dpans6.htm      6.2.1343
712. std ERASE               NONE    core_ext_ws     dpans6.htm      6.2.1350
713. std EXPECT              NONE    core_ext_ws     dpans6.htm      6.2.1390
714. std NIP                 NONE    core_ext_ws     dpans6.htm      6.2.1930
715. std OF                  NONE    core_ext_ws     dpans6.htm      6.2.1950
716. std PAD                 NONE    core_ext_ws     dpans6.htm      6.2.2000
717. std PARSE               NONE    core_ext_ws     dpans6.htm      6.2.2008
718. std PICK                NONE    core_ext_ws     dpans6.htm      6.2.2030
719. std QUERY               NONE    core_ext_ws     dpans6.htm      6.2.2040
720. std REFILL              NONE    core_ext_ws     dpans6.htm      6.2.2125
721. std RESTORE-INPUT       NONE    core_ext_ws     dpans6.htm      6.2.2148
722. std ROLL                NONE    core_ext_ws     dpans6.htm      6.2.2150
723. std SAVE-INPUT          NONE    core_ext_ws     dpans6.htm      6.2.2182
724. std SOURCE-ID           NONE    core_ext_ws     dpans6.htm      6.2.2218
725. std SPAN                NONE    core_ext_ws     dpans6.htm      6.2.2240
726. std TIB                 NONE    core_ext_ws     dpans6.htm      6.2.2290
727. std TO                  NONE    core_ext_ws     dpans6.htm      6.2.2295
728. std TRUE                NONE    numeric         dpans6.htm      6.2.2298
729. std TUCK                NONE    core_ext_ws     dpans6.htm      6.2.2300
730. std U.R                 NONE    core_ext_ws     dpans6.htm      6.2.2330
731. std U>                  NONE    core_ext_ws     dpans6.htm      6.2.2350
732. std UNUSED              NONE    core_ext_ws     dpans6.htm      6.2.2395
733. std WITHIN              NONE    core_ext_ws     dpans6.htm      6.2.2440
734. std [COMPILE]           NONE    core_ext_ws     dpans6.htm      6.2.2530
735. std BLK                 NONE    block_ws        dpans7.htm      7.6.1.0790
736. std BLOCK               NONE    block_ws        dpans7.htm      7.6.1.0800
737. std BUFFER              NONE    block_ws        dpans7.htm      7.6.1.0820
738. std FLUSH               NONE    block_ws        dpans7.htm      7.6.1.1559
739. std LOAD                NONE    block_ws        dpans7.htm      7.6.1.1790
740. std SAVE-BUFFERS        NONE    block_ws        dpans7.htm      7.6.1.2180
741. std UPDATE              NONE    block_ws        dpans7.htm      7.6.1.2400
742. std EMPTY-BUFFERS       NONE    block_ws        dpans7.htm      7.6.2.1330
743. std LIST                NONE    block_ws        dpans7.htm      7.6.2.1770
744. std SCR                 NONE    block_ws        dpans7.htm      7.6.2.2190
745. std THRU                NONE    block_ws        dpans7.htm      7.6.2.2280
746. std 2LITERAL            NONE    double_ws       dpans8.htm      8.6.1.0390
747. std D+                  NONE    double_ws       dpans8.htm      8.6.1.1040
748. std D-                  NONE    double_ws       dpans8.htm      8.6.1.1050
749. std D.                  NONE    double_ws       dpans8.htm      8.6.1.1060
750. std D.R                 NONE    double_ws       dpans8.htm      8.6.1.1070
751. std D0<                 NONE    double_ws       dpans8.htm      8.6.1.1075
752. std D0=                 NONE    double_ws       dpans8.htm      8.6.1.1080
753. std D2*                 NONE    double_ws       dpans8.htm      8.6.1.1090
754. std D2/                 NONE    double_ws       dpans8.htm      8.6.1.1100
755. std D<                  NONE    double_ws       dpans8.htm      8.6.1.1110
756. std D=                  NONE    double_ws       dpans8.htm      8.6.1.1120
757. std D>S                 NONE    double_ws       dpans8.htm      8.6.1.1140
758. std DABS                NONE    double_ws       dpans8.htm      8.6.1.1160
759. std DMAX                NONE    double_ws       dpans8.htm      8.6.1.1210
760. std DMIN                NONE    double_ws       dpans8.htm      8.6.1.1220
761. std DNEGATE             NONE    double_ws       dpans8.htm      8.6.1.1230
762. std M*/                 NONE    double_ws       dpans8.htm      8.6.1.1820
763. std M+                  NONE    double_ws       dpans8.htm      8.6.1.1830
764. std 2ROT                NONE    double_ws       dpans8.htm      8.6.2.0420
765. std DU<                 NONE    double_ws       dpans8.htm      8.6.2.1270
766. std CATCH               NONE    exception_ws    dpans9.htm      9.6.1.0875
767. std THROW               NONE    exception_ws    dpans9.htm      9.6.1.2275
768. std AT-XY               NONE    facilities_ws   dpans10.htm     10.6.1.0742
769. std KEY?                NONE    facilities_ws   dpans10.htm     10.6.1.1755
770. std PAGE                NONE    facilities_ws   dpans10.htm     10.6.1.2005
771. std EKEY                NONE    facilities_ws   dpans10.htm     10.6.2.1305
772. std EKEY<CHAR           NONE    facilities_ws   dpans10.htm     10.6.2.1306
773. std EKEY?               NONE    facilities_ws   dpans10.htm     10.6.2.1307
774. std EMIT?               NONE    facilities_ws   dpans10.htm     10.6.2.1325
775. std MS                  NONE    facilities_ws   dpans10.htm     10.6.2.1905
776. std TIME&DATE           NONE    facilities_ws   dpans10.htm     10.6.2.2292
777. std BIN                 NONE    file_ws         dpans11.htm     11.6.1.0765
778. std CLOSE-FILE          NONE    file_ws         dpans11.htm     11.6.1.0900
779. std CREATE-FILE         NONE    file_ws         dpans11.htm     11.6.1.1010
780. std DELETE-FILE         NONE    file_ws         dpans11.htm     11.6.1.1190
781. std FILE-POSITION       NONE    file_ws         dpans11.htm     11.6.1.1520
782. std FILE-SIZE           NONE    file_ws         dpans11.htm     11.6.1.1522
783. std INCLUDE-FILE        NONE    file_ws         dpans11.htm     11.6.1.1717
784. std OPEN-FILE           NONE    file_ws         dpans11.htm     11.6.1.1970
785. std R/O                 NONE    file_ws         dpans11.htm     11.6.1.2054
786. std R/W                 NONE    file_ws         dpans11.htm     11.6.1.2056
787. std READ-FILE           NONE    file_ws         dpans11.htm     11.6.1.2080
788. std READ-LINE           NONE    file_ws         dpans11.htm     11.6.1.2090
789. std REPOSITION-FILE     NONE    file_ws         dpans11.htm     11.6.1.2142
790. std RESIZE-FILE         NONE    file_ws         dpans11.htm     11.6.1.2147
791. std W/O                 NONE    file_ws         dpans11.htm     11.6.1.2425
792. std WRITE-FILE          NONE    file_ws         dpans11.htm     11.6.1.2480
793. std WRITE-LINE          NONE    file_ws         dpans11.htm     11.6.1.2485
794. std FILE-STATUS         NONE    file_ws         dpans11.htm     11.6.2.1524
795. std FLUSH-FILE          NONE    file_ws         dpans11.htm     11.6.2.1560
796. std RENAME-FILE         NONE    file_ws         dpans11.htm     11.6.2.2130
797. std >FLOAT              NONE    fp_ws           dpans12.htm     12.6.1.0558
798. std D>F                 NONE    fp_ws           dpans12.htm     12.6.1.1130
799. std F!                  NONE    fp_ws           dpans12.htm     12.6.1.1400
800. std F*                  NONE    fp_ws           dpans12.htm     12.6.1.1410
801. std F+                  NONE    fp_ws           dpans12.htm     12.6.1.1420
802. std F-                  NONE    fp_ws           dpans12.htm     12.6.1.1425
803. std F/                  NONE    fp_ws           dpans12.htm     12.6.1.1430
804. std F0<                 NONE    fp_ws           dpans12.htm     12.6.1.1440
805. std F0=                 NONE    fp_ws           dpans12.htm     12.6.1.1450
806. std F<                  NONE    fp_ws           dpans12.htm     12.6.1.1460
807. std F>D                 NONE    fp_ws           dpans12.htm     12.6.1.1460
808. std F@                  NONE    fp_ws           dpans12.htm     12.6.1.1472
809. std FALIGN              NONE    fp_ws           dpans12.htm     12.6.1.1479
810. std FALIGNED            NONE    fp_ws           dpans12.htm     12.6.1.1483
811. std FDEPTH              NONE    fp_ws           dpans12.htm     12.6.1.1497
812. std FDROP               NONE    fp_ws           dpans12.htm     12.6.1.1500
813. std FDUP                NONE    fp_ws           dpans12.htm     12.6.1.1510
814. std FLITERAL            NONE    fp_ws           dpans12.htm     12.6.1.1552
815. std FLOAT+              NONE    fp_ws           dpans12.htm     12.6.1.1555
816. std FLOATS              NONE    fp_ws           dpans12.htm     12.6.1.1556
817. std FLOOR               NONE    fp_ws           dpans12.htm     12.6.1.1558
818. std FMAX                NONE    fp_ws           dpans12.htm     12.6.1.1562
819. std FMIN                NONE    fp_ws           dpans12.htm     12.6.1.1565
820. std FNEGATE             NONE    fp_ws           dpans12.htm     12.6.1.1567
821. std FOVER               NONE    fp_ws           dpans12.htm     12.6.1.1600
822. std FROT                NONE    fp_ws           dpans12.htm     12.6.1.1610
823. std FROUND              NONE    fp_ws           dpans12.htm     12.6.1.1612
824. std FSWAP               NONE    fp_ws           dpans12.htm     12.6.1.1620
825. std REPRESENT           NONE    fp_ws           dpans12.htm     12.6.1.2143
826. std DF!                 NONE    fp_ws           dpans12.htm     12.6.2.1203
827. std DF@                 NONE    fp_ws           dpans12.htm     12.6.2.1204
828. std DFALIGN             NONE    fp_ws           dpans12.htm     12.6.2.1205
829. std DFALIGNED           NONE    fp_ws           dpans12.htm     12.6.2.1207
830. std DFLOAT+             NONE    fp_ws           dpans12.htm     12.6.2.1208
831. std DFLOATS             NONE    fp_ws           dpans12.htm     12.6.2.1209
832. std F**                 NONE    fp_ws           dpans12.htm     12.6.2.1415
833. std F.                  NONE    fp_ws           dpans12.htm     12.6.2.1427
834. std FABS                NONE    fp_ws           dpans12.htm     12.6.2.1474
835. std FACOS               NONE    fp_ws           dpans12.htm     12.6.2.1476
836. std FACOSH              NONE    fp_ws           dpans12.htm     12.6.2.1477
837. std FALOG               NONE    fp_ws           dpans12.htm     12.6.2.1484
838. std FASIN               NONE    fp_ws           dpans12.htm     12.6.2.1486
839. std FASINH              NONE    fp_ws           dpans12.htm     12.6.2.1487
840. std FATAN               NONE    fp_ws           dpans12.htm     12.6.2.1488
841. std FATAN2              NONE    fp_ws           dpans12.htm     12.6.2.1489
842. std FATANH              NONE    fp_ws           dpans12.htm     12.6.2.1491
843. std FCOS                NONE    fp_ws           dpans12.htm     12.6.2.1493
844. std FCOSH               NONE    fp_ws           dpans12.htm     12.6.2.1494
845. std FE.                 NONE    fp_ws           dpans12.htm     12.6.2.1513
846. std FEXP                NONE    fp_ws           dpans12.htm     12.6.2.1515
847. std FEXPM1              NONE    fp_ws           dpans12.htm     12.6.2.1516
848. std FLN                 NONE    fp_ws           dpans12.htm     12.6.2.1553
849. std FLNP1               NONE    fp_ws           dpans12.htm     12.6.2.1554
850. std FLOG                NONE    fp_ws           dpans12.htm     12.6.2.1557
851. std FS.                 NONE    fp_ws           dpans12.htm     12.6.2.1613
852. std FSIN                NONE    fp_ws           dpans12.htm     12.6.2.1614
853. std FSINCOS             NONE    fp_ws           dpans12.htm     12.6.2.1616
854. std FSINH               NONE    fp_ws           dpans12.htm     12.6.2.1617
855. std FSQRT               NONE    fp_ws           dpans12.htm     12.6.2.1618
856. std FTAN                NONE    fp_ws           dpans12.htm     12.6.2.1625
857. std FTANH               NONE    fp_ws           dpans12.htm     12.6.2.1626
858. std F~                  NONE    fp_ws           dpans12.htm     12.6.2.1640
859. std PRECISION           NONE    fp_ws           dpans12.htm     12.6.2.2035
860. std SET-PRECISION       NONE    fp_ws           dpans12.htm     12.6.2.2200
861. std SF!                 NONE    fp_ws           dpans12.htm     12.6.2.2202
862. std SF@                 NONE    fp_ws           dpans12.htm     12.6.2.2203
863. std SFALIGN             NONE    fp_ws           dpans12.htm     12.6.2.2204
864. std SFALIGNED           NONE    fp_ws           dpans12.htm     12.6.2.2206
865. std SFLOAT+             NONE    fp_ws           dpans12.htm     12.6.2.2207
866. std SFLOATS             NONE    fp_ws           dpans12.htm     12.6.2.2208
867. std (LOCAL)             NONE    local_ws        dpans13.htm     13.6.1.0086
868. std LOCALS|             NONE    local_ws        dpans13.htm     13.6.2.1795
869. std ALLOCATE            NONE    malloc_ws       dpans14.htm     14.6.1.0707
870. std FREE                NONE    malloc_ws       dpans14.htm     14.6.1.1605
871. std RESIZE              NONE    malloc_ws       dpans14.htm     14.6.1.2145
872. std .S                  NONE    progtools_ws    dpans15.htm     15.6.1.0220
873. std ?                   NONE    progtools_ws    dpans15.htm     15.6.1.0600
874. std DUMP                NONE    progtools_ws    dpans15.htm     15.6.1.1280
875. std SEE                 NONE    progtools_ws    dpans15.htm     15.6.1.2194
876. std WORDS               NONE    progtools_ws    dpans15.htm     15.6.1.2465
877. std AHEAD               NONE    progtools_ws    dpans15.htm     15.6.2.0702
878. std ASSEMBLER           NONE    progtools_ws    dpans15.htm     15.6.2.0740
879. std BYE                 NONE    progtools_ws    dpans15.htm     15.6.2.0830
880. std CS-PICK             NONE    progtools_ws    dpans15.htm     15.6.2.1015
881. std CS-ROLL             NONE    progtools_ws    dpans15.htm     15.6.2.1020
882. std EDITOR              NONE    progtools_ws    dpans15.htm     15.6.2.1300
883. std FORGET              NONE    progtools_ws    dpans15.htm     15.6.2.1580
884. std [ELSE]              NONE    progtools_ws    dpans15.htm     15.6.2.2531
885. std [THEN]              NONE    progtools_ws    dpans15.htm     15.6.2.2533
886. std DEFINITIONS         NONE    searchord_ws    dpans16.htm     16.6.1.1180
887. std FORTH-WORDLIST      NONE    searchord_ws    dpans16.htm     16.6.1.1595
888. std GET-CURRENT         NONE    searchord_ws    dpans16.htm     16.6.1.1643
889. std GET-ORDER           NONE    searchord_ws    dpans16.htm     16.6.1.1647
890. std SEARCH-WORDLIST     NONE    searchord_ws    dpans16.htm     16.6.1.2192
891. std SET-CURRENT         NONE    searchord_ws    dpans16.htm     16.6.1.2195
892. std SET-ORDER           NONE    searchord_ws    dpans16.htm     16.6.1.2197
893. std WORDLIST            NONE    searchord_ws    dpans16.htm     16.6.1.2460
894. std ALSO                NONE    searchord_ws    dpans16.htm     16.6.2.0715
895. std FORTH               NONE    searchord_ws    dpans16.htm     16.6.2.1590
896. std ONLY                NONE    searchord_ws    dpans16.htm     16.6.2.1965
897. std ORDER               NONE    searchord_ws    dpans16.htm     16.6.2.1985
898. std PREVIOUS            NONE    searchord_ws    dpans16.htm     16.6.2.2037
899. std -TRAILING           NONE    string_ws       dpans17.htm     17.6.1.0170
900. std /STRING             NONE    string_ws       dpans17.htm     17.6.1.0245
901. std BLANK               NONE    string_ws       dpans17.htm     17.6.1.0780
902. std CMOVE               NONE    string_ws       dpans17.htm     17.6.1.0910
903. std CMOVE>              NONE    string_ws       dpans17.htm     17.6.1.0920
904. std COMPARE             NONE    string_ws       dpans17.htm     17.6.1.0935
905. std SEARCH              NONE    string_ws       dpans17.htm     17.6.1.2191
906. std SLITERAL            NONE    string_ws       dpans17.htm     17.6.1.2212
907. 
908. _DEFINITIONS
909. 
910. \ Revision history
911. \ 0. 1st release to guinea pigs via comp.lang.forth
912. \ 1. (BNE) Added multi-line comment 0 [IF]. Colored CHAR outside definitions.
913. \ 2. (EJB) Added missing definitions for common but nonstandard words
914. \    and cleaned up to account for case sensitivity.
915. \ 3. (EJB) Fixed up to create conforming XHTML 1.0 Strict
916. \ 4. (BNE) File check before nesting, moved file names to the hyperlink table,
917. \    added some option flags, cleared hyperlink list for each run. Added more
918. \    multiline comment words. Expands tabs to spaces. Title uses %20 for blanks.
919. \ 5. (BNE) Added multiline { comment. Replaced -1 WORD with [CHAR] |.
920. \    Put hyperlinks that should not be overridden in a separate wordlist.
921. \ 6. (BNE) Limited this text to 80 columns, cleaned up comments a bit. Added
922. \    option for different color schemes.
923. \ 7. (DBU) Added dpanspath to configure the path to the dpans-files. Added
924. \    linksource to output a hyperlink to the original source file. Added
925. \    some words used in Win32Forth. Added copyright to output a copyright text
926. \    at the bottom of the HTML-file.
927. \ 8. (BNE) Put in Dirk's link to source file in header. Changed ['] to be
928. \    simple colored link. Added Forth2HTML link at bottom.
663. : BINARY        2 BASE ! ;
664. : OCTAL         8 BASE ! ;
665. : 0             numeric spec=zero ;
666. : 1             numeric  ;
667. : -1            numeric  ;
668. : COMMENT:      S" COMMENT;" multicomment ;
669. : ((            S" ))"       multicomment ;
670. 
671. \ The following words are not in the ANS standard but are used in Win32Forth
672. : ANEW          skipw ;                    \ /7/
673. : CallBack:     defunk ;                   \ /7/
674. : :M            defunk ;                   \ /7/
675. : ;M            resunk ;                   \ /7/
676. : z"            numeric skip" ;
677. 
678. \ Forth Inc uses { for comment while others use it for locals. } on the same
679. \ line indicates locals, which are grayed. Otherwise a multiline comment.
680. 
681. : {             2DUP [CHAR] } SCAN NIP 0=
682.                 IF S" }" multicomment ELSE genHTML skip} THEN ;
683. 
684. \ The rest is ANS Forth standard
685. 
686. : \             commentary genHTML ital( token PLACE genHTML )ital token 0 ;
687. 
688. (   NAME                ACTION  COLOR           FILENAME        REFERENCE )
689. (   ------------------  ------  --------------  -----------     --------- )
690. std (                   skip)   commentary      dpans6.htm      6.1.0080
691. std ."                  skip"   numeric         dpans6.htm      6.1.0190
692. std :                   defunk  core_ws         dpans6.htm      6.1.0450
693. std ;                   resunk  core_ws         dpans6.htm      6.1.0460
694. std ABORT"              skip"   errors          dpans6.htm      6.1.0680
695. std CHAR                skipc   core_ws         dpans6.htm      6.1.0895
696. std CONSTANT            defdat  core_ws         dpans6.htm      6.1.0950
697. std CREATE              created core_ws         dpans6.htm      6.1.1000
698. std DECIMAL             DECIMAL core_ws         dpans6.htm      6.1.1170
699. std S"                  skip"   numeric         dpans6.htm      6.1.2165
700. std VARIABLE            defvar  core_ws         dpans6.htm      6.1.2410
701. std [                  hstate=0 core_ws         dpans6.htm      6.1.2500
702. std [CHAR]              skipw   numeric         dpans6.htm      6.1.2520
703. std ]                  hstate=1 core_ws         dpans6.htm      6.1.2540
704. std .(                  skip)   commentary      dpans6.htm      6.2.0200
705. std C"                  skip"   numeric         dpans6.htm      6.2.0855
706. std FALSE             spec=zero numeric         dpans6.htm      6.2.1485
707. std HEX                 HEX     core_ext_ws     dpans6.htm      6.2.1660
708. std MARKER              defusr  core_ext_ws     dpans6.htm      6.2.1850
709. std VALUE               defval  core_ext_ws     dpans6.htm      6.2.2405
710. std 2CONSTANT           defdat  double_ws       dpans8.htm      8.6.1.0360
711. std 2VARIABLE           defvar  double_ws       dpans8.htm      8.6.1.0440
712. std INCLUDED            "incfil file_ws         dpans11.htm     11.6.1.1718
713. std FCONSTANT           defdat  fp_ws           dpans12.htm     12.6.1.1492
714. std FVARIABLE           defvar  fp_ws           dpans12.htm     12.6.1.1630
715. std ;CODE               resunk  progtools_ws    dpans15.htm     15.6.2.0470
716. std CODE                defusr  progtools_ws    dpans15.htm     15.6.2.0930
717. std [IF]                bigif   progtools_ws    dpans15.htm     15.6.2.2532
718. 
719. hyperlinks SET-CURRENT \ These hyperlinks can be overridden.
720. 
721. std [']                 NONE    numeric         dpans6.htm      6.1.2510
722. std !                   NONE    core_ws         dpans6.htm      6.1.0010
723. std #                   NONE    core_ws         dpans6.htm      6.1.0030
724. std #>                  NONE    core_ws         dpans6.htm      6.1.0040
725. std #S                  NONE    core_ws         dpans6.htm      6.1.0050
726. std '                   NONE    core_ws         dpans6.htm      6.1.0070
727. std *                   NONE    core_ws         dpans6.htm      6.1.0090
728. std */                  NONE    core_ws         dpans6.htm      6.1.0100
729. std */MOD               NONE    core_ws         dpans6.htm      6.1.0110
730. std +                   NONE    core_ws         dpans6.htm      6.1.0120
731. std +!                  NONE    core_ws         dpans6.htm      6.1.0130
732. std +LOOP               NONE    core_ws         dpans6.htm      6.1.0140
733. std ,                   NONE    core_ws         dpans6.htm      6.1.0150
734. std -                   NONE    core_ws         dpans6.htm      6.1.0160
735. std .                   NONE    core_ws         dpans6.htm      6.1.0180
736. std /                   NONE    core_ws         dpans6.htm      6.1.0230
737. std /MOD                NONE    core_ws         dpans6.htm      6.1.0240
738. std 0<                  NONE    core_ws         dpans6.htm      6.1.0250
739. std 0=                  NONE    core_ws         dpans6.htm      6.1.0270
740. std 1+                  NONE    core_ws         dpans6.htm      6.1.0290
741. std 1-                  NONE    core_ws         dpans6.htm      6.1.0300
742. std 2!                  NONE    core_ws         dpans6.htm      6.1.0310
743. std 2*                  NONE    core_ws         dpans6.htm      6.1.0320
744. std 2/                  NONE    core_ws         dpans6.htm      6.1.0330
745. std 2@                  NONE    core_ws         dpans6.htm      6.1.0350
746. std 2DROP               NONE    core_ws         dpans6.htm      6.1.0370
747. std 2DUP                NONE    core_ws         dpans6.htm      6.1.0380
748. std 2OVER               NONE    core_ws         dpans6.htm      6.1.0400
749. std 2SWAP               NONE    core_ws         dpans6.htm      6.1.0430
750. std <                   NONE    core_ws         dpans6.htm      6.1.0480
751. std <#                  NONE    core_ws         dpans6.htm      6.1.0490
752. std =                   NONE    core_ws         dpans6.htm      6.1.0530
753. std >                   NONE    core_ws         dpans6.htm      6.1.0540
754. std >BODY               NONE    core_ws         dpans6.htm      6.1.0550
755. std >IN                 NONE    core_ws         dpans6.htm      6.1.0560
756. std >NUMBER             NONE    core_ws         dpans6.htm      6.1.0570
757. std >R                  NONE    core_ws         dpans6.htm      6.1.0580
758. std ?DUP                NONE    core_ws         dpans6.htm      6.1.0630
759. std @                   NONE    core_ws         dpans6.htm      6.1.0650
760. std ABORT               NONE    core_ws         dpans6.htm      6.1.0670
761. std ABS                 NONE    core_ws         dpans6.htm      6.1.0690
762. std ACCEPT              NONE    core_ws         dpans6.htm      6.1.0695
763. std ALIGN               NONE    core_ws         dpans6.htm      6.1.0705
764. std ALIGNED             NONE    core_ws         dpans6.htm      6.1.0706
765. std ALLOT               NONE    core_ws         dpans6.htm      6.1.0710
766. std AND                 NONE    core_ws         dpans6.htm      6.1.0720
767. std BASE                NONE    core_ws         dpans6.htm      6.1.0750
768. std BEGIN               NONE    core_ws         dpans6.htm      6.1.0760
769. std BL                  NONE    numeric         dpans6.htm      6.1.0770
770. std C!                  NONE    core_ws         dpans6.htm      6.1.0850
771. std C,                  NONE    core_ws         dpans6.htm      6.1.0860
772. std C@                  NONE    core_ws         dpans6.htm      6.1.0870
773. std CELL+               NONE    core_ws         dpans6.htm      6.1.0880
774. std CELLS               NONE    core_ws         dpans6.htm      6.1.0890
775. std CHAR+               NONE    core_ws         dpans6.htm      6.1.0897
776. std CHARS               NONE    core_ws         dpans6.htm      6.1.0898
777. std COUNT               NONE    core_ws         dpans6.htm      6.1.0980
778. std CR                  NONE    core_ws         dpans6.htm      6.1.0990
779. std DEPTH               NONE    core_ws         dpans6.htm      6.1.1200
780. std DO                  NONE    core_ws         dpans6.htm      6.1.1240
781. std DOES>               NONE    core_ws         dpans6.htm      6.1.1250
782. std DROP                NONE    core_ws         dpans6.htm      6.1.1260
783. std DUP                 NONE    core_ws         dpans6.htm      6.1.1290
784. std ELSE                NONE    core_ws         dpans6.htm      6.1.1310
785. std EMIT                NONE    core_ws         dpans6.htm      6.1.1320
786. std ENVIRONMENT?        NONE    core_ws         dpans6.htm      6.1.1345
787. std EVALUATE            NONE    core_ws         dpans6.htm      6.1.1360
788. std EXECUTE             NONE    core_ws         dpans6.htm      6.1.1370
789. std EXIT                NONE    core_ws         dpans6.htm      6.1.1380
790. std FILL                NONE    core_ws         dpans6.htm      6.1.1540
791. std FIND                NONE    core_ws         dpans6.htm      6.1.1550
792. std FM/MOD              NONE    core_ws         dpans6.htm      6.1.1561
793. std HERE                NONE    core_ws         dpans6.htm      6.1.1650
794. std HOLD                NONE    core_ws         dpans6.htm      6.1.1670
795. std I                   NONE    core_ws         dpans6.htm      6.1.1680
796. std IF                  NONE    core_ws         dpans6.htm      6.1.1700
797. std IMMEDIATE           NONE    core_ws         dpans6.htm      6.1.1710
798. std INVERT              NONE    core_ws         dpans6.htm      6.1.1720
799. std J                   NONE    core_ws         dpans6.htm      6.1.1730
800. std KEY                 NONE    core_ws         dpans6.htm      6.1.1750
801. std LEAVE               NONE    core_ws         dpans6.htm      6.1.1760
802. std LITERAL             NONE    core_ws         dpans6.htm      6.1.1780
803. std LOOP                NONE    core_ws         dpans6.htm      6.1.1800
804. std LSHIFT              NONE    core_ws         dpans6.htm      6.1.1805
805. std M*                  NONE    core_ws         dpans6.htm      6.1.1810
806. std MAX                 NONE    core_ws         dpans6.htm      6.1.1870
807. std MIN                 NONE    core_ws         dpans6.htm      6.1.1880
808. std MOD                 NONE    core_ws         dpans6.htm      6.1.1890
809. std MOVE                NONE    core_ws         dpans6.htm      6.1.1900
810. std NEGATE              NONE    core_ws         dpans6.htm      6.1.1910
811. std OR                  NONE    core_ws         dpans6.htm      6.1.1980
812. std OVER                NONE    core_ws         dpans6.htm      6.1.1990
813. std POSTPONE            NONE    core_ws         dpans6.htm      6.1.2033
814. std QUIT                NONE    core_ws         dpans6.htm      6.1.2050
815. std R>                  NONE    core_ws         dpans6.htm      6.1.2060
816. std R@                  NONE    core_ws         dpans6.htm      6.1.2070
817. std RECURSE             NONE    core_ws         dpans6.htm      6.1.2120
818. std REPEAT              NONE    core_ws         dpans6.htm      6.1.2140
819. std ROT                 NONE    core_ws         dpans6.htm      6.1.2160
820. std RSHIFT              NONE    core_ws         dpans6.htm      6.1.2162
821. std S>D                 NONE    core_ws         dpans6.htm      6.1.2170
822. std SIGN                NONE    core_ws         dpans6.htm      6.1.2210
823. std SM/REM              NONE    core_ws         dpans6.htm      6.1.2214
824. std SOURCE              NONE    core_ws         dpans6.htm      6.1.2216
825. std SPACE               NONE    core_ws         dpans6.htm      6.1.2220
826. std SPACES              NONE    core_ws         dpans6.htm      6.1.2230
827. std STATE               NONE    core_ws         dpans6.htm      6.1.2250
828. std SWAP                NONE    core_ws         dpans6.htm      6.1.2260
829. std THEN                NONE    core_ws         dpans6.htm      6.1.2270
830. std TYPE                NONE    core_ws         dpans6.htm      6.1.2310
831. std U.                  NONE    core_ws         dpans6.htm      6.1.2320
832. std U<                  NONE    core_ws         dpans6.htm      6.1.2340
833. std UM*                 NONE    core_ws         dpans6.htm      6.1.2360
834. std UM/MOD              NONE    core_ws         dpans6.htm      6.1.2370
835. std UNLOOP              NONE    core_ws         dpans6.htm      6.1.2380
836. std UNTIL               NONE    core_ws         dpans6.htm      6.1.2390
837. std WHILE               NONE    core_ws         dpans6.htm      6.1.2430
838. std WORD                NONE    core_ws         dpans6.htm      6.1.2450
839. std XOR                 NONE    core_ws         dpans6.htm      6.1.2490
840. std #TIB                NONE    core_ext_ws     dpans6.htm      6.2.0060
841. std .R                  NONE    core_ext_ws     dpans6.htm      6.2.0210
842. std 0<>                 NONE    core_ext_ws     dpans6.htm      6.2.0260
843. std 0>                  NONE    core_ext_ws     dpans6.htm      6.2.0280
844. std 2>R                 NONE    core_ext_ws     dpans6.htm      6.2.0340
845. std 2R>                 NONE    core_ext_ws     dpans6.htm      6.2.0410
846. std 2R@                 NONE    core_ext_ws     dpans6.htm      6.2.0415
847. std :NONAME             NONE    core_ext_ws     dpans6.htm      6.2.0455
848. std <>                  NONE    core_ext_ws     dpans6.htm      6.2.0500
849. std ?DO                 NONE    core_ext_ws     dpans6.htm      6.2.0620
850. std AGAIN               NONE    core_ext_ws     dpans6.htm      6.2.0700
851. std CASE                NONE    core_ext_ws     dpans6.htm      6.2.0873
852. std COMPILE,            NONE    core_ext_ws     dpans6.htm      6.2.0945
853. std CONVERT             NONE    core_ext_ws     dpans6.htm      6.2.0970
854. std ENDCASE             NONE    core_ext_ws     dpans6.htm      6.2.1342
855. std ENDOF               NONE    core_ext_ws     dpans6.htm      6.2.1343
856. std ERASE               NONE    core_ext_ws     dpans6.htm      6.2.1350
857. std EXPECT              NONE    core_ext_ws     dpans6.htm      6.2.1390
858. std NIP                 NONE    core_ext_ws     dpans6.htm      6.2.1930
859. std OF                  NONE    core_ext_ws     dpans6.htm      6.2.1950
860. std PAD                 NONE    core_ext_ws     dpans6.htm      6.2.2000
861. std PARSE               NONE    core_ext_ws     dpans6.htm      6.2.2008
862. std PICK                NONE    core_ext_ws     dpans6.htm      6.2.2030
863. std QUERY               NONE    core_ext_ws     dpans6.htm      6.2.2040
864. std REFILL              NONE    core_ext_ws     dpans6.htm      6.2.2125
865. std RESTORE-INPUT       NONE    core_ext_ws     dpans6.htm      6.2.2148
866. std ROLL                NONE    core_ext_ws     dpans6.htm      6.2.2150
867. std SAVE-INPUT          NONE    core_ext_ws     dpans6.htm      6.2.2182
868. std SOURCE-ID           NONE    core_ext_ws     dpans6.htm      6.2.2218
869. std SPAN                NONE    core_ext_ws     dpans6.htm      6.2.2240
870. std TIB                 NONE    core_ext_ws     dpans6.htm      6.2.2290
871. std TO                  NONE    core_ext_ws     dpans6.htm      6.2.2295
872. std TRUE                NONE    numeric         dpans6.htm      6.2.2298
873. std TUCK                NONE    core_ext_ws     dpans6.htm      6.2.2300
874. std U.R                 NONE    core_ext_ws     dpans6.htm      6.2.2330
875. std U>                  NONE    core_ext_ws     dpans6.htm      6.2.2350
876. std UNUSED              NONE    core_ext_ws     dpans6.htm      6.2.2395
877. std WITHIN              NONE    core_ext_ws     dpans6.htm      6.2.2440
878. std [COMPILE]           NONE    core_ext_ws     dpans6.htm      6.2.2530
879. std BLK                 NONE    block_ws        dpans7.htm      7.6.1.0790
880. std BLOCK               NONE    block_ws        dpans7.htm      7.6.1.0800
881. std BUFFER              NONE    block_ws        dpans7.htm      7.6.1.0820
882. std FLUSH               NONE    block_ws        dpans7.htm      7.6.1.1559
883. std LOAD                NONE    block_ws        dpans7.htm      7.6.1.1790
884. std SAVE-BUFFERS        NONE    block_ws        dpans7.htm      7.6.1.2180
885. std UPDATE              NONE    block_ws        dpans7.htm      7.6.1.2400
886. std EMPTY-BUFFERS       NONE    block_ws        dpans7.htm      7.6.2.1330
887. std LIST                NONE    block_ws        dpans7.htm      7.6.2.1770
888. std SCR                 NONE    block_ws        dpans7.htm      7.6.2.2190
889. std THRU                NONE    block_ws        dpans7.htm      7.6.2.2280
890. std 2LITERAL            NONE    double_ws       dpans8.htm      8.6.1.0390
891. std D+                  NONE    double_ws       dpans8.htm      8.6.1.1040
892. std D-                  NONE    double_ws       dpans8.htm      8.6.1.1050
893. std D.                  NONE    double_ws       dpans8.htm      8.6.1.1060
894. std D.R                 NONE    double_ws       dpans8.htm      8.6.1.1070
895. std D0<                 NONE    double_ws       dpans8.htm      8.6.1.1075
896. std D0=                 NONE    double_ws       dpans8.htm      8.6.1.1080
897. std D2*                 NONE    double_ws       dpans8.htm      8.6.1.1090
898. std D2/                 NONE    double_ws       dpans8.htm      8.6.1.1100
899. std D<                  NONE    double_ws       dpans8.htm      8.6.1.1110
900. std D=                  NONE    double_ws       dpans8.htm      8.6.1.1120
901. std D>S                 NONE    double_ws       dpans8.htm      8.6.1.1140
902. std DABS                NONE    double_ws       dpans8.htm      8.6.1.1160
903. std DMAX                NONE    double_ws       dpans8.htm      8.6.1.1210
904. std DMIN                NONE    double_ws       dpans8.htm      8.6.1.1220
905. std DNEGATE             NONE    double_ws       dpans8.htm      8.6.1.1230
906. std M*/                 NONE    double_ws       dpans8.htm      8.6.1.1820
907. std M+                  NONE    double_ws       dpans8.htm      8.6.1.1830
908. std 2ROT                NONE    double_ws       dpans8.htm      8.6.2.0420
909. std DU<                 NONE    double_ws       dpans8.htm      8.6.2.1270
910. std CATCH               NONE    exception_ws    dpans9.htm      9.6.1.0875
911. std THROW               NONE    exception_ws    dpans9.htm      9.6.1.2275
912. std AT-XY               NONE    facilities_ws   dpans10.htm     10.6.1.0742
913. std KEY?                NONE    facilities_ws   dpans10.htm     10.6.1.1755
914. std PAGE                NONE    facilities_ws   dpans10.htm     10.6.1.2005
915. std EKEY                NONE    facilities_ws   dpans10.htm     10.6.2.1305
916. std EKEY<CHAR           NONE    facilities_ws   dpans10.htm     10.6.2.1306
917. std EKEY?               NONE    facilities_ws   dpans10.htm     10.6.2.1307
918. std EMIT?               NONE    facilities_ws   dpans10.htm     10.6.2.1325
919. std MS                  NONE    facilities_ws   dpans10.htm     10.6.2.1905
920. std TIME&DATE           NONE    facilities_ws   dpans10.htm     10.6.2.2292
921. std BIN                 NONE    file_ws         dpans11.htm     11.6.1.0765
922. std CLOSE-FILE          NONE    file_ws         dpans11.htm     11.6.1.0900
923. std CREATE-FILE         NONE    file_ws         dpans11.htm     11.6.1.1010
924. std DELETE-FILE         NONE    file_ws         dpans11.htm     11.6.1.1190
925. std FILE-POSITION       NONE    file_ws         dpans11.htm     11.6.1.1520
926. std FILE-SIZE           NONE    file_ws         dpans11.htm     11.6.1.1522
927. std INCLUDE-FILE        NONE    file_ws         dpans11.htm     11.6.1.1717
928. std OPEN-FILE           NONE    file_ws         dpans11.htm     11.6.1.1970
929. std R/O                 NONE    file_ws         dpans11.htm     11.6.1.2054
930. std R/W                 NONE    file_ws         dpans11.htm     11.6.1.2056
931. std READ-FILE           NONE    file_ws         dpans11.htm     11.6.1.2080
932. std READ-LINE           NONE    file_ws         dpans11.htm     11.6.1.2090
933. std REPOSITION-FILE     NONE    file_ws         dpans11.htm     11.6.1.2142
934. std RESIZE-FILE         NONE    file_ws         dpans11.htm     11.6.1.2147
935. std W/O                 NONE    file_ws         dpans11.htm     11.6.1.2425
936. std WRITE-FILE          NONE    file_ws         dpans11.htm     11.6.1.2480
937. std WRITE-LINE          NONE    file_ws         dpans11.htm     11.6.1.2485
938. std FILE-STATUS         NONE    file_ws         dpans11.htm     11.6.2.1524
939. std FLUSH-FILE          NONE    file_ws         dpans11.htm     11.6.2.1560
940. std RENAME-FILE         NONE    file_ws         dpans11.htm     11.6.2.2130
941. std >FLOAT              NONE    fp_ws           dpans12.htm     12.6.1.0558
942. std D>F                 NONE    fp_ws           dpans12.htm     12.6.1.1130
943. std F!                  NONE    fp_ws           dpans12.htm     12.6.1.1400
944. std F*                  NONE    fp_ws           dpans12.htm     12.6.1.1410
945. std F+                  NONE    fp_ws           dpans12.htm     12.6.1.1420
946. std F-                  NONE    fp_ws           dpans12.htm     12.6.1.1425
947. std F/                  NONE    fp_ws           dpans12.htm     12.6.1.1430
948. std F0<                 NONE    fp_ws           dpans12.htm     12.6.1.1440
949. std F0=                 NONE    fp_ws           dpans12.htm     12.6.1.1450
950. std F<                  NONE    fp_ws           dpans12.htm     12.6.1.1460
951. std F>D                 NONE    fp_ws           dpans12.htm     12.6.1.1460
952. std F@                  NONE    fp_ws           dpans12.htm     12.6.1.1472
953. std FALIGN              NONE    fp_ws           dpans12.htm     12.6.1.1479
954. std FALIGNED            NONE    fp_ws           dpans12.htm     12.6.1.1483
955. std FDEPTH              NONE    fp_ws           dpans12.htm     12.6.1.1497
956. std FDROP               NONE    fp_ws           dpans12.htm     12.6.1.1500
957. std FDUP                NONE    fp_ws           dpans12.htm     12.6.1.1510
958. std FLITERAL            NONE    fp_ws           dpans12.htm     12.6.1.1552
959. std FLOAT+              NONE    fp_ws           dpans12.htm     12.6.1.1555
960. std FLOATS              NONE    fp_ws           dpans12.htm     12.6.1.1556
961. std FLOOR               NONE    fp_ws           dpans12.htm     12.6.1.1558
962. std FMAX                NONE    fp_ws           dpans12.htm     12.6.1.1562
963. std FMIN                NONE    fp_ws           dpans12.htm     12.6.1.1565
964. std FNEGATE             NONE    fp_ws           dpans12.htm     12.6.1.1567
965. std FOVER               NONE    fp_ws           dpans12.htm     12.6.1.1600
966. std FROT                NONE    fp_ws           dpans12.htm     12.6.1.1610
967. std FROUND              NONE    fp_ws           dpans12.htm     12.6.1.1612
968. std FSWAP               NONE    fp_ws           dpans12.htm     12.6.1.1620
969. std REPRESENT           NONE    fp_ws           dpans12.htm     12.6.1.2143
970. std DF!                 NONE    fp_ws           dpans12.htm     12.6.2.1203
971. std DF@                 NONE    fp_ws           dpans12.htm     12.6.2.1204
972. std DFALIGN             NONE    fp_ws           dpans12.htm     12.6.2.1205
973. std DFALIGNED           NONE    fp_ws           dpans12.htm     12.6.2.1207
974. std DFLOAT+             NONE    fp_ws           dpans12.htm     12.6.2.1208
975. std DFLOATS             NONE    fp_ws           dpans12.htm     12.6.2.1209
976. std F**                 NONE    fp_ws           dpans12.htm     12.6.2.1415
977. std F.                  NONE    fp_ws           dpans12.htm     12.6.2.1427
978. std FABS                NONE    fp_ws           dpans12.htm     12.6.2.1474
979. std FACOS               NONE    fp_ws           dpans12.htm     12.6.2.1476
980. std FACOSH              NONE    fp_ws           dpans12.htm     12.6.2.1477
981. std FALOG               NONE    fp_ws           dpans12.htm     12.6.2.1484
982. std FASIN               NONE    fp_ws           dpans12.htm     12.6.2.1486
983. std FASINH              NONE    fp_ws           dpans12.htm     12.6.2.1487
984. std FATAN               NONE    fp_ws           dpans12.htm     12.6.2.1488
985. std FATAN2              NONE    fp_ws           dpans12.htm     12.6.2.1489
986. std FATANH              NONE    fp_ws           dpans12.htm     12.6.2.1491
987. std FCOS                NONE    fp_ws           dpans12.htm     12.6.2.1493
988. std FCOSH               NONE    fp_ws           dpans12.htm     12.6.2.1494
989. std FE.                 NONE    fp_ws           dpans12.htm     12.6.2.1513
990. std FEXP                NONE    fp_ws           dpans12.htm     12.6.2.1515
991. std FEXPM1              NONE    fp_ws           dpans12.htm     12.6.2.1516
992. std FLN                 NONE    fp_ws           dpans12.htm     12.6.2.1553
993. std FLNP1               NONE    fp_ws           dpans12.htm     12.6.2.1554
994. std FLOG                NONE    fp_ws           dpans12.htm     12.6.2.1557
995. std FS.                 NONE    fp_ws           dpans12.htm     12.6.2.1613
996. std FSIN                NONE    fp_ws           dpans12.htm     12.6.2.1614
997. std FSINCOS             NONE    fp_ws           dpans12.htm     12.6.2.1616
998. std FSINH               NONE    fp_ws           dpans12.htm     12.6.2.1617
999. std FSQRT               NONE    fp_ws           dpans12.htm     12.6.2.1618
1000. std FTAN                NONE    fp_ws           dpans12.htm     12.6.2.1625
1001. std FTANH               NONE    fp_ws           dpans12.htm     12.6.2.1626
1002. std F~                  NONE    fp_ws           dpans12.htm     12.6.2.1640
1003. std PRECISION           NONE    fp_ws           dpans12.htm     12.6.2.2035
1004. std SET-PRECISION       NONE    fp_ws           dpans12.htm     12.6.2.2200
1005. std SF!                 NONE    fp_ws           dpans12.htm     12.6.2.2202
1006. std SF@                 NONE    fp_ws           dpans12.htm     12.6.2.2203
1007. std SFALIGN             NONE    fp_ws           dpans12.htm     12.6.2.2204
1008. std SFALIGNED           NONE    fp_ws           dpans12.htm     12.6.2.2206
1009. std SFLOAT+             NONE    fp_ws           dpans12.htm     12.6.2.2207
1010. std SFLOATS             NONE    fp_ws           dpans12.htm     12.6.2.2208
1011. std (LOCAL)             NONE    local_ws        dpans13.htm     13.6.1.0086
1012. std LOCALS|             NONE    local_ws        dpans13.htm     13.6.2.1795
1013. std ALLOCATE            NONE    malloc_ws       dpans14.htm     14.6.1.0707
1014. std FREE                NONE    malloc_ws       dpans14.htm     14.6.1.1605
1015. std RESIZE              NONE    malloc_ws       dpans14.htm     14.6.1.2145
1016. std .S                  NONE    progtools_ws    dpans15.htm     15.6.1.0220
1017. std ?                   NONE    progtools_ws    dpans15.htm     15.6.1.0600
1018. std DUMP                NONE    progtools_ws    dpans15.htm     15.6.1.1280
1019. std SEE                 NONE    progtools_ws    dpans15.htm     15.6.1.2194
1020. std WORDS               NONE    progtools_ws    dpans15.htm     15.6.1.2465
1021. std AHEAD               NONE    progtools_ws    dpans15.htm     15.6.2.0702
1022. std ASSEMBLER           NONE    progtools_ws    dpans15.htm     15.6.2.0740
1023. std BYE                 NONE    progtools_ws    dpans15.htm     15.6.2.0830
1024. std CS-PICK             NONE    progtools_ws    dpans15.htm     15.6.2.1015
1025. std CS-ROLL             NONE    progtools_ws    dpans15.htm     15.6.2.1020
1026. std EDITOR              NONE    progtools_ws    dpans15.htm     15.6.2.1300
1027. std FORGET              NONE    progtools_ws    dpans15.htm     15.6.2.1580
1028. std [ELSE]              NONE    progtools_ws    dpans15.htm     15.6.2.2531
1029. std [THEN]              NONE    progtools_ws    dpans15.htm     15.6.2.2533
1030. std DEFINITIONS         NONE    searchord_ws    dpans16.htm     16.6.1.1180
1031. std FORTH-WORDLIST      NONE    searchord_ws    dpans16.htm     16.6.1.1595
1032. std GET-CURRENT         NONE    searchord_ws    dpans16.htm     16.6.1.1643
1033. std GET-ORDER           NONE    searchord_ws    dpans16.htm     16.6.1.1647
1034. std SEARCH-WORDLIST     NONE    searchord_ws    dpans16.htm     16.6.1.2192
1035. std SET-CURRENT         NONE    searchord_ws    dpans16.htm     16.6.1.2195
1036. std SET-ORDER           NONE    searchord_ws    dpans16.htm     16.6.1.2197
1037. std WORDLIST            NONE    searchord_ws    dpans16.htm     16.6.1.2460
1038. std ALSO                NONE    searchord_ws    dpans16.htm     16.6.2.0715
1039. std FORTH               NONE    searchord_ws    dpans16.htm     16.6.2.1590
1040. std ONLY                NONE    searchord_ws    dpans16.htm     16.6.2.1965
1041. std ORDER               NONE    searchord_ws    dpans16.htm     16.6.2.1985
1042. std PREVIOUS            NONE    searchord_ws    dpans16.htm     16.6.2.2037
1043. std -TRAILING           NONE    string_ws       dpans17.htm     17.6.1.0170
1044. std /STRING             NONE    string_ws       dpans17.htm     17.6.1.0245
1045. std BLANK               NONE    string_ws       dpans17.htm     17.6.1.0780
1046. std CMOVE               NONE    string_ws       dpans17.htm     17.6.1.0910
1047. std CMOVE>              NONE    string_ws       dpans17.htm     17.6.1.0920
1048. std COMPARE             NONE    string_ws       dpans17.htm     17.6.1.0935
1049. std SEARCH              NONE    string_ws       dpans17.htm     17.6.1.2191
1050. std SLITERAL            NONE    string_ws       dpans17.htm     17.6.1.2212
1051. 
1052. _DEFINITIONS
1053. 
1054. \ Revision history
1055. \ 0. 1st release to guinea pigs via comp.lang.forth
1056. \ 1. (BNE) Added multi-line comment 0 [IF]. Colored CHAR outside definitions.
1057. \ 2. (EJB) Added missing definitions for common but nonstandard words
1058. \    and cleaned up to account for case sensitivity.
1059. \ 3. (EJB) Fixed up to create conforming XHTML 1.0 Strict
1060. \ 4. (BNE) File check before nesting, moved file names to the hyperlink table,
1061. \    added some option flags, cleared hyperlink list for each run. Added more
1062. \    multiline comment words. Expands tabs to spaces. Title uses %20 for blanks.
1063. \ 5. (BNE) Added multiline { comment. Replaced -1 WORD with [CHAR] |.
1064. \    Put hyperlinks that should not be overridden in a separate wordlist.
1065. \ 6. (BNE) Limited this text to 80 columns, cleaned up comments a bit. Added
1066. \    option for different color schemes.
1067. \ 7. (DBU) Added dpanspath to configure the path to the dpans-files. Added
1068. \    linksource to output a hyperlink to the original source file. Added
1069. \    some words used in Win32Forth. Added copyright to output a copyright text
1070. \    at the bottom of the HTML-file.
1071. \ 8. (BNE) Put in Dirk's link to source file in header. Changed ['] to be
1072. \    simple colored link. Added Forth2HTML link at bottom.
 
1073. \ 9. (BNE) Added index creation, fixed UPC & minor file nesting bug.
1074. \ 10. (BNE) Fixed glass jaw in SKIP". S" etc crashed if nothing else was on the
1075. \    line. Fixed link generation bug in multi-file HTML.
929. 
930. 
1076. 
1077.