From: Dirk B. <db...@us...> - 2005-12-20 18:10:24
|
Update of /cvsroot/win32forth/win32forth/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23718/doc Modified Files: p-index.htm p-structures.htm Added Files: p-dexh.htm Removed Files: p-advanced.htm Log Message: DexH documentation added, and moved the "Advanced" topics into p-index.htm Index: p-structures.htm =================================================================== RCS file: /cvsroot/win32forth/win32forth/doc/p-structures.htm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** p-structures.htm 21 Dec 2004 00:18:57 -0000 1.1 --- p-structures.htm 20 Dec 2005 18:10:15 -0000 1.2 *************** *** 30,34 **** makes it easy to implement custom structures tailored to your application. Nevertheless WIN32FORTH contains some words to help with this process as ! well as an optional structure package ( STRUCT.F )</p> <h3> Using FIELD+</h3> <p>FIELD+ is a defining word that creates a new word that adds an offset to --- 30,34 ---- makes it easy to implement custom structures tailored to your application. Nevertheless WIN32FORTH contains some words to help with this process as ! well as three optional structure packages ( ExtStruct.f, Struct.f and eStruct.f )</p> <h3> Using FIELD+</h3> <p>FIELD+ is a defining word that creates a new word that adds an offset to --- p-advanced.htm DELETED --- Index: p-index.htm =================================================================== RCS file: /cvsroot/win32forth/win32forth/doc/p-index.htm,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** p-index.htm 1 Oct 2005 09:06:50 -0000 1.5 --- p-index.htm 20 Dec 2005 18:10:15 -0000 1.6 *************** *** 90,93 **** --- 90,94 ---- <li><a href="ForthForm/ForthForm.htm">ForthForm</a> (Win32Forth Dialog-Editor)</li> <li><a href="ProMgr/ProjectManager.htm">ForthProject</a> (Win32Forth Project Manager)</li> + <li><a href="p-dexh.htm">Dex</a>Document Extractor</li> </ul> *************** *** 122,130 **** requirements of the ANS Forth Standard</a></li> </ul> ! <p>Once you've got to grips with the basics, it's time to move on to the</p> <ul> ! <li><a href="p-advanced.htm">Advanced Topics</a></li> <li><a href="p-relnotes.6.12.htm">Release Notes</a></li> </ul> <h3>Distributions</h3> <dir> --- 123,153 ---- requirements of the ANS Forth Standard</a></li> </ul> ! ! <p>Once you've got to grips with the basics, it's time to move on to the:</p> ! ! <h3>Advanced Topics</h3> ! ! <p>Advanced topics aren't really that advanced, but if you're just starting out ! with Win32Forth, these are best revisited once you've got to grips with the ! basics. Oh, go on then. Read them anyhow...</p> <ul> ! <li><a href="p-debugging.htm">Debugging in Win32Forth</a></li> ! <li><a href="p-windlls.htm">Calling Windows Procedures</a></li> ! <li><a href="p-objects.htm">Object Oriented Programming</a></li> ! <li><a href="p-classes.htm">Win32Forth Classes</a></li> ! <li><a href="p-module.htm">Using the Module Wordset</a></li> ! <li><a href="p-random.htm">The Random Number Generator</a></li> ! <li><a href="p-switch.htm">Using Switches</a></li> ! <li><a href="p-chains.htm">Chains and how to use them</a></li> ! <li><a href="p-locals.htm">Named input parameters and local variables</a></li> ! <li><a href="p-486asm.htm">Documentation for 486ASM.F</a> (the assembler)</li> ! <li><a href="p-imageman.htm">Building and saving an application</a></li> ! <li><a href="p-arch1.htm">The Internal Architecture of Win32Forth</a></li> ! <li><a href="p-using-if.htm">Using -IF</a></li> ! <li><a href="p-structures.htm">Structures in Win32Forth</a></li> ! <li><a href="p-numconv.htm">Number Conversion</a></li> <li><a href="p-relnotes.6.12.htm">Release Notes</a></li> </ul> + <h3>Distributions</h3> <dir> --- NEW FILE: p-dexh.htm --- <?xml version="1.0"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/xml; charset=iso-8859-1" /> <meta name="GENERATOR" content="DexH v03" /> <style type="text/css"> </style> <title> DexH</title> </head> <body> <hr /><h1>DexH -- Document Extractor, HTML output </h1><hr /><h3><i>Version 3 </i></h3><p>Primary contributors: Brad Eckert br...@SP... </p><h3><i>Abstract </i></h3><p>DexH is a simple literate programming tool inspired by MPE's DOCGEN. DexH can also be used to write articles about Forth featuring a mixture of documentation and source code. DexH is a standalone program that processes a Forth source file. The following command does the conversion: <br /> <b>DEX input_filename</b> </p><h2>Commands </h2><p>Commands are embedded within comments. You can use the following formats, with either starting at the first column. </p><ul><li>( ?? ... ) where ?? is the command, or </li><li>\ ?? ... </li></ul><p>You can append HTML to created files by DEXing any number of source files but you should use a *Z command to complete the HTML. </p><table border="1"><tr><td>Command </td> <td>Effect </td> </tr> <tr><td>** </td> <td>continuation of G, E or P </td> </tr> <tr><td>*! </td> <td>create and select a new output file </td> </tr> <tr><td>*> </td> <td>select an existing file to add text to </td> </tr> <tr><td>*T </td> <td>Title </td> </tr> <tr><td>*Q </td> <td>Quotation or abstract </td> </tr> <tr><td>*S </td> <td>Section </td> </tr> <tr><td>*N </td> <td>Sub-section </td> </tr> <tr><td>*P </td> <td>Paragraph </td> </tr> <tr><td>*E </td> <td>Paragraph which is a code example </td> </tr> <tr><td>*B </td> <td>Bullet entry </td> </tr> <tr><td>*G </td> <td>Glossary entry for the previous line </td> </tr> <tr><td>*R </td> <td>raw LaTeX </td> </tr> <tr><td>*W </td> <td>raw HTML </td> </tr> <tr><td>*Z </td> <td>End output </td> </tr> <tr><td>*+ </td> <td>Include source code as document text </td> </tr> <tr><td>*- </td> <td>Turn off source code inclusion </td> </tr> </table><p>DexH is ANS Forth except for the need for BOUNDS, SCAN, SKIP and LCOUNT. They are commonly used words but redefined here for completeness. </p><pre>\ : BOUNDS OVER + SWAP ; \ : SCAN ( addr len char -- addr' len' ) \ >R BEGIN DUP WHILE OVER C@ R@ <> \ WHILE 1 /STRING REPEAT THEN R> DROP ; \ : SKIP ( addr len char -- addr' len' ) \ >R BEGIN DUP WHILE OVER C@ R@ = \ WHILE 1 /STRING REPEAT THEN R> DROP ; \ : LCOUNT ( addr -- addr' len ) DUP CELL+ SWAP @ ; </pre><p>Some files use very long lines, which is desirable for long sections of documentation. You can allocate buffers for lines longer than 2000 chars by changing the following line: </p><pre>2000 CHARS CONSTANT max$ </pre><pre></pre><p>HTML needs some canned boilerplate. This is created by ,| since HTML doesn't use | characters. </p><pre>: (,$) ( a len -- ) DUP C, 0 ?DO COUNT C, LOOP DROP ; : ,| ( <text> -- ) [CHAR] | WORD COUNT -TRAILING (,$) ; CREATE DexHTMLheader ,| <?xml version="1.0"?> | ,| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | ,| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ,| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | ,| <head> | ,| <meta http-equiv="Content-Type" content="text/xml; charset=iso-8859-1" />| ,| <meta name="GENERATOR" content="DexH v03" /> | ,| <style type="text/css"> | ,| </style> | ,| <title> | 0 C, </pre><p>All output is via OUT and OUTLN, which can be sent to the screen for debugging purposes. </p><pre>0 VALUE testing \ screen is for testing : werr ( n -- ) ABORT" Error writing file" ; : out ( a len -- ) testing IF TYPE ELSE outfile WRITE-FILE werr THEN ; : outln ( a len -- ) testing IF TYPE CR ELSE outfile WRITE-LINE werr THEN ; </pre><p>Some characters are replaced by special strings so they can't be interpreted as tags. Also, runs of blanks need special treatment. Some escape sequences are supported: </p><table border="1"><tr><td><b>seq</b> </td> <td><b>Escape command </b> </td> </tr> <tr><td>\i </td> <td>Italics </td> </tr> <tr><td>\b </td> <td>Bold </td> </tr> <tr><td>\t </td> <td>Typewriter </td> </tr> <tr><td>\^ </td> <td>Superscript (i.e. ax\^2\d+bx+c=0) </td> </tr> <tr><td>\_ </td> <td>Subscript </td> </tr> <tr><td>\d </td> <td>Default font (ends italic, superscript, etc.) </td> </tr> <tr><td>\n </td> <td>Line break </td> </tr> <tr><td>\r </td> <td>Horizontal rule </td> </tr> <tr><td>\p </td> <td>Page break </td> </tr> <tr><td>\\ </td> <td>\ </td> </tr> </table><p>Sample usage: "ax\^2\d + bx + w\_0\d = 0" displays ax<sup>2</sup> + bx + w<sub>0</sub> = 0 </p><p>"Try \bbold, \iitalic \dand \ttypewriter.\d" displays "Try <b>bold, </b><i>italic </i>and <code>typewriter</code>." </p><pre>: new-font ( n -- ) \ switch to a new font thisfont @ SWAP thisfont ! CASE [CHAR] i OF S" </i>" out ENDOF [CHAR] b OF S" </b>" out ENDOF [CHAR] t OF S" </code>" out ENDOF [CHAR] ^ OF S" </sup>" out ENDOF [CHAR] _ OF S" </sub>" out ENDOF ENDCASE ; : outh ( addr len -- ) \ HTMLized text output 999 bltally ! BOUNDS ?DO I C@ escape @ IF CASE [CHAR] \ OF S" \" out ENDOF [CHAR] n OF S" <br />" out ENDOF [CHAR] r OF hr ENDOF [CHAR] i OF I C@ new-font S" <i>" out ENDOF [CHAR] b OF I C@ new-font S" <b>" out ENDOF [CHAR] t OF I C@ new-font S" <code>" out ENDOF [CHAR] ^ OF I C@ new-font S" <sup>" out ENDOF [CHAR] _ OF I C@ new-font S" <sub>" out ENDOF [CHAR] d OF 0 new-font ENDOF no-escape I 1 out ENDCASE 0 escape ! ELSE CASE [CHAR] \ OF captive @ IF no-escape ELSE 1 escape ! THEN ENDOF [CHAR] & OF S" &amp;" out ENDOF [CHAR] < OF S" &lt;" out ENDOF [CHAR] > OF S" &gt;" out ENDOF [CHAR] " OF S" &quot;" out ENDOF [CHAR] © OF S" &copy;" out ENDOF BL OF bltally @ IF S" &nbsp;" ELSE S" " THEN out 1 bltally +! ENDOF I 1 out 0 bltally ! ENDCASE THEN LOOP escape @ IF no-escape THEN \ trailing \ S" " outln ; </pre><p>The fields in a table are separated by | (vertical bar) and end in |. </p><pre><b><a name="0">: gl-open ( -- ) </a></b></pre><p>Open glossary File </p><pre><b><a name="0">: gl-close ( -- ) </a></b></pre><p>Close glossary File </p><pre><b><a name="0">: gl-ancor ( -- ) </a></b></pre><p>Write ancor number </p><pre><b><a name="0">\ cr ." gl-create-entry: " prevline LCOUNT type </a></b></pre><p>Create a glossary entry </p><hr /> <h2>Glossary </h2><pre><b><a name="0">:noname ( <filename> -- ) </a></b></pre><p>Convert a file or files to HTML. Output filenames are included in the source file. </p><pre><b><a name="0">: q ( <string> -- ) </a></b></pre><p>Test a single line of text, outputting to the screen. </p><hr /><p>This file generated by <a href="dexh03.F">DexH</a></p> <hr /> </body></html> |