rexxliterate.rex source

00001 /*----------------------------------------------------------------------------*/
00002 /*                                                                            */
00003 /*   Copyright (c) 2004-2009 William  Data  Systems Ltd. and Geoff Stevens.   */
00004 /*   All rights reserved.                                                     */
00005 /*                                                                            */
00006 /*   This program and the  accompanying  materials are made available under   */
00007 /*   the terms of the  Common  Public  License  v1.0 which accompanies this   */
00008 /*   distribution. A  copy  is  also  available  at  the following address:   */
00009 /*   http://www.opensource.org/licenses/cpl1.0.php                            */
00010 /*                                                                            */
00011 /*   Redistribution and use in  source  and  binary  forms, with or without   */
00012 /*   modification, are  permitted  provided  that  the following conditions   */
00013 /*   are met:                                                                 */
00014 /*                                                                            */
00015 /*   Redistributions  of  source  code  must  retain  the  above  copyright   */
00016 /*   notice, this list of conditions and the following disclaimer.            */
00017 /*                                                                            */
00018 /*   Redistributions in  binary  form  must  reproduce  the above copyright   */
00019 /*   notice, this list of  conditions  and  the following disclaimer in the   */
00020 /*   documentation and/or other materials provided with the distribution.     */
00021 /*                                                                            */
00022 /*   Neither the name or trademarks  of  William Data Systems nor the names   */
00023 /*   of its  contributors  may  be  used  to  endorse  or  promote products   */
00024 /*   derived from this software without specific prior written permission.    */
00025 /*                                                                            */
00026 /*   DISCLAIMER                                                               */
00027 /*                                                                            */
00028 /*   THIS SOFTWARE IS PROVIDED  BY  THE  COPYRIGHT HOLDERS AND CONTRIBUTORS   */
00029 /*   "AS IS" AND  ANY  EXPRESS  OR  IMPLIED  WARRANTIES, INCLUDING, BUT NOT   */
00030 /*   LIMITED TO, THE IMPLIED WARRANTIES  OF MERCHANTABILITY AND FITNESS FOR   */
00031 /*   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN  NO EVENT SHALL THE COPYRIGHT   */
00032 /*   OWNER OR CONTRIBUTORS BE LIABLE  FOR ANY DIRECT, INDIRECT, INCIDENTAL,   */
00033 /*   SPECIAL,  EXEMPLARY,  OR  CONSEQUENTIAL  DAMAGES  (INCLUDING,  BUT NOT   */
00034 /*   LIMITED TO, PROCUREMENT OF SUBSTITUTE  GOODS OR SERVICES; LOSS OF USE,   */
00035 /*   DATA, OR PROFITS; OR BUSINESS  INTERRUPTION) HOWEVER CAUSED AND ON ANY   */
00036 /*   THEORY OF LIABILITY, WHETHER  IN  CONTRACT,  STRICT LIABILITY, OR TORT   */
00037 /*   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN  ANY WAY OUT OF THE USE   */
00038 /*   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.     */
00039 /*                                                                            */
00040 /*----------------------------------------------------------------------------*/
00041  
00042 /**
00043   test harness program for rexxliterate
00044  
00045   edit rsource and htarget to point at rexx source
00046   and html output folders respectively.
00047  
00048   Note that '.\' does not work as a source folder.
00049  
00050  
00051 */
00052  
00053 /**
00054   test harness program for rexxdoc
00055  
00056   edit rsource and hdest to point at rexx source
00057   and html output folders respectively.
00058  
00059   Note that '.\' does not work as a source folder.
00060  
00061  
00062 */
00063  
00064 signal on any name oops
00065  
00066  
00067  
00068 -- decide on source and dest
00069 rsource = '..\trunk'
00070 hdest   = '.\v001doc\'
00071  
00072 -- what to call the documentation
00073 title = 'RexxLiterate'
00074  
00075 -- whether to recursively search rsource subfolders
00076 recurse = .false
00077  
00078  
00079  
00080 -- rexx source must not end with a separator
00081 if rsource~right(1) = '\'
00082   then rsource = rsource~left(rsource~length - 1)
00083 if hdest~right(1) <> '\'
00084   then hdest = hdest||'\'
00085  
00086 -- get canonical rexx source path
00087 rc = SysFileTree(.pathsep~localpath(rsource), 'rs.', 'D')
00088 if rs.0 <> 1
00089   then do
00090          say 'cannot canonicalize' rsource
00091          exit
00092        end
00093 parse var rs.1 . . . . rpath
00094 rpath = rpath'\'
00095  
00096 -- create the array of prefix comments to remove in docs
00097 pf = prefixcomment()
00098  
00099 -- set up rexxliterate configuration
00100 config = .rexxliterateconfig~new
00101 config~rsource = .pathsep~localpath(rpath)
00102 config~hdest = .pathsep~localpath(hdest)
00103 config~title = title
00104 config~recurse = recurse
00105 config~prefixcomment = pf
00106 config~trailericon = '<a href="http://sourceforge.net/projects/rexxliterate"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=266417&amp;type=10" width="80" height="15" alt="Get RexxLiterate at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a>'
00107  
00108 -- parse the files
00109 hrexx = .rexxliterate~new(config)
00110  
00111 -- emit HTML
00112 hrexx~emit(.true)
00113  
00114 exit
00115  
00116 oops:
00117 call conditionhandler condition('O'), sigl, sourceline(sigl)
00118 exit
00119  
00120 prefixcomment: procedure
00121 c = .queue~new
00122 c~queue('----------------------------------------------------------------------------')
00123 c~queue('                                                                            ')
00124 c~queue('   Copyright (c) 2004-2009 William  Data  Systems Ltd. and Geoff Stevens.   ')
00125 c~queue('   All rights reserved.                                                     ')
00126 c~queue('                                                                            ')
00127 c~queue('   This program and the  accompanying  materials are made available under   ')
00128 c~queue('   the terms of the  Common  Public  License  v1.0 which accompanies this   ')
00129 c~queue('   distribution. A  copy  is  also  available  at  the following address:   ')
00130 c~queue('   http://www.opensource.org/licenses/cpl1.0.php                            ')
00131 c~queue('                                                                            ')
00132 c~queue('   Redistribution and use in  source  and  binary  forms, with or without   ')
00133 c~queue('   modification, are  permitted  provided  that  the following conditions   ')
00134 c~queue('   are met:                                                                 ')
00135 c~queue('                                                                            ')
00136 c~queue('   Redistributions  of  source  code  must  retain  the  above  copyright   ')
00137 c~queue('   notice, this list of conditions and the following disclaimer.            ')
00138 c~queue('                                                                            ')
00139 c~queue('   Redistributions in  binary  form  must  reproduce  the above copyright   ')
00140 c~queue('   notice, this list of  conditions  and  the following disclaimer in the   ')
00141 c~queue('   documentation and/or other materials provided with the distribution.     ')
00142 c~queue('                                                                            ')
00143 c~queue('   Neither the name or trademarks  of  William Data Systems nor the names   ')
00144 c~queue('   of its  contributors  may  be  used  to  endorse  or  promote products   ')
00145 c~queue('   derived from this software without specific prior written permission.    ')
00146 c~queue('                                                                            ')
00147 c~queue('   DISCLAIMER                                                               ')
00148 c~queue('                                                                            ')
00149 c~queue('   THIS SOFTWARE IS PROVIDED  BY  THE  COPYRIGHT HOLDERS AND CONTRIBUTORS   ')
00150 c~queue('   "AS IS" AND  ANY  EXPRESS  OR  IMPLIED  WARRANTIES, INCLUDING, BUT NOT   ')
00151 c~queue('   LIMITED TO, THE IMPLIED WARRANTIES  OF MERCHANTABILITY AND FITNESS FOR   ')
00152 c~queue('   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN  NO EVENT SHALL THE COPYRIGHT   ')
00153 c~queue('   OWNER OR CONTRIBUTORS BE LIABLE  FOR ANY DIRECT, INDIRECT, INCIDENTAL,   ')
00154 c~queue('   SPECIAL,  EXEMPLARY,  OR  CONSEQUENTIAL  DAMAGES  (INCLUDING,  BUT NOT   ')
00155 c~queue('   LIMITED TO, PROCUREMENT OF SUBSTITUTE  GOODS OR SERVICES; LOSS OF USE,   ')
00156 c~queue('   DATA, OR PROFITS; OR BUSINESS  INTERRUPTION) HOWEVER CAUSED AND ON ANY   ')
00157 c~queue('   THEORY OF LIABILITY, WHETHER  IN  CONTRACT,  STRICT LIABILITY, OR TORT   ')
00158 c~queue('   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN  ANY WAY OUT OF THE USE   ')
00159 c~queue('   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.     ')
00160 c~queue('                                                                            ')
00161 c~queue('----------------------------------------------------------------------------')
00162 return c
00163  
00164 ::REQUIRES 'condhandler.cls'
00165 ::REQUIRES 'rexxliterate.cls'
00166 ::REQUIRES 'pathsep.cls'
00167  

Get RexxLiterate at SourceForge.net. Fast, secure and Free Open Source software downloads
Generated on 31 Aug 2010 05:20:33 for RexxLiterate by rexxliterate  0.0.1