home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rc321.zip / REXXCC.CMD < prev    next >
OS/2 REXX Batch file  |  1997-12-06  |  58KB  |  782 lines

  1. /* ------------------------------------------------------------------ */
  2. /* REXXCC.CMD - a tiny REXX "compiler" (c) Bernd Schemmer 1994,1997   */
  3. /*                                                                    */
  4. /* Usage: REXXCC source TO target {WITH copyrightfile}                */
  5. /*               {/IExt} {/IDate} {/IVer} {/Overwrite}                */
  6. /*               {/UseSource} {/LineCount=n} {/Compress}              */
  7. /*               {/AddCode} {/CMode} {/ShowDate} {/NoDate}            */
  8. /*               {/LOG=logfilename} {/Sound} {/NoColors} {/?} {/HELP} */
  9. /*                                                                    */
  10. /* Author                                                             */
  11. /*   Bernd Schemmer                                                   */
  12. /*   Baeckerweg 48                                                    */
  13. /*   60316 Frankfurt                                                  */
  14. /*   Germany                                                          */
  15. /*   CompuServe: 100104,613                                           */
  16. /*   Internet: 100104.613@compuserve.com                              */
  17. /*                                                                    */
  18. /* /================================================================\ */
  19. /* | IMPORTANT:                                                     | */
  20. /* |                                                                | */
  21. /* | This program will only work if the Extended Attributes are OK! | */
  22. /* \================================================================/ */
  23. /*                                                                    */
  24. /* Description:                                                       */
  25. /* ============                                                       */
  26. /*                                                                    */
  27. /* REXXCC knows two modes:                                            */
  28. /*                                                                    */
  29. /*   "compiling"                                                      */
  30. /*                                                                    */
  31. /* and                                                                */
  32. /*                                                                    */
  33. /*   "compressing" (you can also call it  "packing")                  */
  34. /*                                                                    */
  35. /* REXXCC "compiles" an OS/2 REXX program by substituting the source  */
  36. /* code with mostly any text. This is possible because the OS/2 REXX  */
  37. /* interpreter stores a tokenized copy of each executed REXX program  */
  38. /* in the EAs of the program. If you execute an OS/2 REXX program,    */
  39. /* the OS/2 REXX interpreter first checks if the tokenized copy in    */
  40. /* the EAs is still valid and, if so, executes the tokenized copy     */
  41. /* and ignores the source code.                                       */
  42. /*                                                                    */
  43. /* REXXCC "compresses" an OS/2 REXX program by deleting mostly all    */
  44. /* superfluous whitespaces, all linefeeds and all comments from the   */
  45. /* sourcefile.                                                        */
  46. /*                                                                    */
  47. /*                                                                    */
  48. /* Compatiblity                                                       */
  49. /* ============                                                       */
  50. /*                                                                    */
  51. /* "Compiling" tested with OS/2 v2.1, OS/2 v2.1 and the Service Pak,  */
  52. /* OS/2 v2.11, OS/2 v2.99 WARP BETA II, OS/2 Version 3 WARP for       */
  53. /* Windows, OS/2 Version 3 WARP Fullpack and OS/2 WARP Connect        */
  54. /* and OS/2 WARP Version 4 (with Classic REXX as default REXX         */
  55. /* interpreter).                                                      */
  56. /* The REXX interpreter version of all of these OS/2 Versions is 4.00.*/
  57. /* If you're using Object REXX, please see the notes in the section   */
  58. /* 'Known limitations' below.                                         */
  59. /*                                                                    */
  60. /* "Compressed" REXX programs will work using ANY REXX interpreter.   */
  61. /*                                                                    */
  62. /*                                                                    */
  63. /* Usage                                                              */
  64. /* =====                                                              */
  65. /*                                                                    */
  66. /* 1. execute your REXX file to get the token image of the program.   */
  67. /*                                                                    */
  68. /* Note: You may call your program with the switch '//t' (yes, there  */
  69. /*       are two slashes!) to force the creation of the token         */
  70. /*       image of the program without executing it.                   */
  71. /*                                                                    */
  72. /* Further note:  This step is only neccessary, if you want to        */
  73. /*                "compile" your REXX program.                        */
  74. /*                                                                    */
  75. /* 2. call REXXCC to "compile" or "compress" your REXX file.          */
  76. /* The syntax for REXXCC is:                                          */
  77. /*                                                                    */
  78. /*   REXXCC source TO target {WITH copyrightFile} {option} {voption}  */
  79. /*                                                                    */
  80. /* with:                                                              */
  81. /*   source                                                           */
  82. /*     is the name of the sourcefile                                  */
  83. /*     The extension of the sourcefile must be '.CMD'.                */
  84. /*     If you ommit the extension, REXXCC appends '.CMD' to the       */
  85. /*     name of the sourcefile.                                        */
  86. /*                                                                    */
  87. /*   TO                                                               */
  88. /*     this is a neccessary keyword!                                  */
  89. /*                                                                    */
  90. /*   target                                                           */
  91. /*     is the name of the targetfile or directory                     */
  92. /*     The extension for the targetfile must be '.CMD'. If you ommit  */
  93. /*     the extension, REXXCC appends '.CMD' to the name of the target */
  94. /*     file. If you enter a directory name for this parameter, REXXCC */
  95. /*     uses the name of the sourcefile as name for the targetfile.    */
  96. /*                                                                    */
  97. /*   WITH                                                             */
  98. /*     this is a neccessary keyword!                                  */
  99. /*                                                                    */
  100. /*   copyrightfile                                                    */
  101. /*     is the file with the copyright message which replaces the      */
  102. /*     original source code in the "compiled" version of the program. */
  103. /*     If you ommit the parameter copyrightFile, REXXCC uses only its */
  104. /*     copyright message as copyright file. If the copyright file is  */
  105. /*     equal with the sourcefile REXXCC uses only the leading         */
  106. /*     comment lines of the sourcefile as copyright file.             */
  107. /*                                                                    */
  108. /*     Hint: You may use the equal sign (=) as name of the            */
  109. /*           copyright file if you want to use the sourcefile as      */
  110. /*           copyright file.                                          */
  111. /*                                                                    */
  112. /*   options                                                          */
  113. /*     are misc. options for REXXCC. All options are in the format    */
  114. /*                                                                    */
  115. /*       /optionName{=optionValue}                                    */
  116. /*                                                                    */
  117. /*     with optionValue = 1 to turn the option on and optionValue = 0 */
  118. /*     to turn the option off. Any other value for optionValue turns  */
  119. /*     the option on. The default for optionValue if not entered is 1 */
  120. /*     (= turn the option on).                                        */
  121. /*     The only exception to this rule is the option LOG (see below). */
  122. /*     There must be a blank before the leading slash of an option!   */
  123. /*     You may use an option at any position in the parameters.       */
  124. /*                                                                    */
  125. /*     Possible options for REXXCC are:                               */
  126. /*                                                                    */
  127. /*       LOG                                                          */
  128. /*         The value of this option is the name of the logfile.       */
  129. /*         Normally REXXCC appends all messages to an existing        */
  130. /*         logfile.                                                   */
  131. /*         Add a leading exclamation mark to the name of the logfile  */
  132. /*         to change this behaviour to overwrite mode.                */
  133. /*         Example:                                                   */
  134. /*                                                                    */
  135. /*            /LOG=!rexxcc.log                                        */
  136. /*         or                                                         */
  137. /*            /LOG="!rexxcc-00.log"                                   */
  138. /*                                                                    */
  139. /*       IExt                                                         */
  140. /*         if ON : do NOT check                                       */
  141. /*                   - the extension of the sourcefile                */
  142. /*                   - the extension of the targetfile                */
  143. /*                   - the format of the sourcefile                   */
  144. /*                 and                                                */
  145. /*                   - the format of the copyright file               */
  146. /*                 (def.: OFF)                                        */
  147. /*                                                                    */
  148. /*       IVer                                                         */
  149. /*         if ON : do NOT check                                       */
  150. /*                   - the version of the REXX interpreter            */
  151. /*                 and                                                */
  152. /*                   - the version of the token image of the source   */
  153. /*                     file                                           */
  154. /*                 (def.: OFF)                                        */
  155. /*                                                                    */
  156. /*       IDate                                                        */
  157. /*         if ON : do not check the date of the sourcefile            */
  158. /*                 (def.: OFF)                                        */
  159. /*                                                                    */
  160. /*       Overwrite                                                    */
  161. /*         if ON : overwrite an existing targetfile (def.: OFF)       */
  162. /*                                                                    */
  163. /*       UseSource                                                    */
  164. /*         if ON : use the sourcefile as copyright file if the        */
  165. /*                 parameter copyrightfile is missing (def.: OFF)     */
  166. /*                                                                    */
  167. /*       Compress                                                     */
  168. /*         if ON : only compress the source code                      */
  169. /*                 (delete whitespaces & comments, def.: OFF)         */
  170. /*                                                                    */
  171. /*       AddCode                                                      */
  172. /*         if ON : add code to check if the EAs are okay to the       */
  173. /*                 targetfile                                         */
  174. /*                 (def.: OFF, ignored if /Compress is ON)            */
  175. /*                                                                    */
  176. /*       ShowDate                                                     */
  177. /*         if ON : show the execution and changing time stamps        */
  178. /*                 (def.: OFF, ignored if /Compress is ON)            */
  179. /*                                                                    */
  180. /*       NoDate                                                       */
  181. /*         if ON : don't insert the time and date in the copyright    */
  182. /*                 footer of the "compiled" file                      */
  183. /*                 (def.: OFF = include the time and date in the      */
  184. /*                              footer)                               */
  185. /*                                                                    */
  186. /*       CMode                                                        */
  187. /*         if ON : don't process strings in compress mode             */
  188. /*                 CMode is a little faster than the normal mode, but */
  189. /*                 the compression rate is not as good as with the    */
  190. /*                 normal compression mode.                           */
  191. /*                 (def.: OFF, ignored if /Compress is OFF)           */
  192. /*                                                                    */
  193. /*       Sound                                                        */
  194. /*         if ON : use sounds in case of an error (def.: OFF)         */
  195. /*                                                                    */
  196. /*       NoColors                                                     */
  197. /*         if ON : don't use colors for the messages (def.: OFF)      */
  198. /*                                                                    */
  199. /*                                                                    */
  200. /*   voptions                                                         */
  201. /*     are misc. options for REXXCC. All voptions are in the format   */
  202. /*                                                                    */
  203. /*       /voptionName=voptionValue                                    */
  204. /*                                                                    */
  205. /*     vopitonValue can be any integer value greater or equal 0.      */
  206. /*     You may enter a voption at any position in the parameters.     */
  207. /*                                                                    */
  208. /*     Possible voptions for REXXCC are:                              */
  209. /*                                                                    */
  210. /*       LineCount=n                                                  */
  211. /*         n is the number of leading comment lines of the source     */
  212. /*         file which REXXCC should use as copyright file for the     */
  213. /*         targetfile. REXXCC ignores this parameter, if you don't    */
  214. /*         use the sourcefile as copyright file.                      */
  215. /*         (def.: use all leading comment lines of the sourcefile)    */
  216. /*         If n is not a whole number or if n is equal 0, REXXCC      */
  217. /*         ignores n. If there are less than n leading comment lines  */
  218. /*         in the sourcefile, REXXCC ignores the value of n.          */
  219. /*         example:                                                   */
  220. /*                                                                    */
  221. /*           REXXCC TEST.CMD TO PROGS\ WITH TEST.CMD /LineCount=50    */
  222. /*                                                                    */
  223. /*           -> compile the file "TEST.CMD" to "PROGS\TEST.CMD" and   */
  224. /*              use the first 50 comment lines of the sourcefile as   */
  225. /*              copyright file.                                       */
  226. /*                                                                    */
  227. /*         Note that REXXCC counts multi-line comments as *one*       */
  228. /*         comment. Note further, that there's only a restricted      */
  229. /*         handling of nested comments in this part of REXXCC!        */
  230. /*         (means: Depending on how you use this REXX feature it may  */
  231. /*                 or may not work)                                   */
  232. /*                                                                    */
  233. /*                                                                    */
  234. /*     You may also set the defaults for the options and voptions in  */
  235. /*     the environment variable "REXXCC", for example:                */
  236. /*                                                                    */
  237. /*       SET REXXCC="/IExt=1 /Overwrite /LineCount=20 /UseSource"     */
  238. /*                                                                    */
  239. /*     Note that you must use the double quotes if the value for the  */
  240. /*     environment variable contains one or more equal signs.         */
  241. /*     Options and VOptions in the parameters overwrite the values    */
  242. /*     from the environment variable "REXXCC".                        */
  243. /*                                                                    */
  244. /*                                                                    */
  245. /* See also the notes below the history section.                      */
  246. /*                                                                    */
  247. /*                                                                    */
  248. /* History                                                            */
  249. /* =======                                                            */
  250. /*                                                                    */
  251. /*   V1.00  - 05.07.1994 /bs                                          */
  252. /*     - initial release                                              */
  253. /*   V1.01  - 12.07.1994 /bs                                          */
  254. /*     - added code to check if the temporary path exists             */
  255. /*     - change meaning of the 2nd parameter -- now it can            */
  256. /*       be a directory name or a file name                           */
  257. /*     - added code to check if the sourcefile was changed after the  */
  258. /*       last execution                                               */
  259. /*     - added code to check if the current ADDRESS() environment is  */
  260. /*       the CMD                                                      */
  261. /*                                                                    */
  262. /*   V2.00  - 20.08.1994 /bs                                          */
  263. /*     - fixed a bug, where REXXCC did not delete the temporary files */
  264. /*       and the targetfile if an error occured                       */
  265. /*     - added the parameters -IExt, -IVer and -IDate                 */
  266. /*     - added the support for the envrionment variable REXXCC        */
  267. /*     - added the parameter -LineCount                               */
  268. /*     - added the color support                                      */
  269. /*   V2.01  - 01.10.1994 /bs                                          */
  270. /*     - INTERNAL VERSION                                             */
  271. /*   V2.05  - 18.11.1994 /bs                                          */
  272. /*     - advanced the error handling                                  */
  273. /*     - added the abbreviation '=' for the parameter copyrightfile   */
  274. /*     - added the parameter -Overwrite                               */
  275. /*     - added the parameter -UseSource                               */
  276. /*   v2.10  - 08.04.1995 /bs                                          */
  277. /*     - use TEMPLATE v2.52 as base source (1)                        */
  278. /*     - changed the return codes above 250 to 230+. Added the new    */
  279. /*       returncodes from TEMPLATE v2.52 (see below)                  */
  280. /*     - added sounds                                                 */
  281. /*     - added the parameter -Sound                                   */
  282. /*     - extended the color support                                   */
  283. /*     - expanded the version tests                                   */
  284. /*     - added code to distinguish between batch and REXX programs    */
  285. /*                                                                    */
  286. /*   v3.00  - 01.06.1995 /bs                                          */
  287. /*     - added the file REXXCC.EA containing the EAs of REXXCC to the */
  288. /*       archive. This was neccessary, because some users or sysops   */
  289. /*       unpacked REXXCC and packed it again with a program not       */
  290. /*       supporting EAs.                                              */
  291. /*     - added code to compress a REXX program (parameter /compress)  */
  292. /*     - added code to add code to test the EAs to the compiled       */
  293. /*       programs (parameter /AddCode)                                */
  294. /*     - rewrote the WPS frontend and rename it to REXXCC/2.          */
  295. /*       REXXCC/2 uses Rexx Dialog (2) instead of VREXX for the       */
  296. /*       dialog boxes. All neccessary parts of Rexx Dialog for        */
  297. /*       executing REXXCC/2 are included in this package.             */
  298. /*   v3.01  - 01.10.1995 /bs                                          */
  299. /*     - INTERNAL VERSION                                             */
  300. /*   v3.10  - 25.10.1995 /bs                                          */
  301. /*     - in the previous version REXXCC ended with error 2 if the     */
  302. /*       contents of the environment variable TEMP or TMP were in     */
  303. /*       lowercase or mixcase. Fixed.                                 */
  304. /*     - in the previous version REXXCC issued the error 53 if        */
  305. /*       you tried to "compile" a CMD from a FAT partition. Fixed.    */
  306. /*     - in the previous version REXXCC had problems with comments    */
  307. /*       like                                                         */
  308. /*           /*/*/*/* This is a really deep nested comment */*/*/*/   */
  309. /*       Fixed.                                                       */
  310. /*     - added code to suppress the use of ANSI codes if the current  */
  311. /*       environment is not 'CMD'.                                    */
  312. /*     - implement some enhancements for REXXCC/2                     */
  313. /*     - added the program UPCKREXX.CMD to unpack "packed" or         */
  314. /*       "compressed" REXX programs                                   */
  315. /*     - enhanced the "compressing" of REXX cmds                      */
  316. /*     - now you can use tabulators in string constants and nested    */
  317. /*       multi line comments in REXX programs which you want to       */
  318. /*       compress                                                     */
  319. /*     - now REXXCC deletes mostly all superfluous whitespaces within */
  320. /*       REXX statements also                                         */
  321. /*     - added the parameter -ShowDate and -CMode                     */
  322. /*     - added the error code 63 ("comments nested to deep")          */
  323. /*     - added some more technical information                        */
  324. /*   v3.11  - 29.10.1995 /bs                                          */
  325. /*     - INTERNAL VERSION                                             */
  326. /*   v3.20  - 09.09.1997 /bs                                          */
  327. /*     - added the program REXXCCM.CMD: a "compiler" using the        */
  328. /*       macro space                                                  */
  329. /*   v3.21  - 01.12.1997 /bs                                          */
  330. /*     - redesigned major parts of the program to save space in the   */
  331. /*       token image                                                  */
  332. /*     - fixed some minor bugs                                        */
  333. /*     - REXXCC now handles filenames with imbedded special chars.    */
  334. /*       (e.g. -, blanks, etc.)                                       */
  335. /*     - added the option -NoDate                                     */
  336. /*     - deleted the undocumented parameter /L:                       */
  337. /*     - added the new paramter /LOG=logfilename                      */
  338. /*     - added the new paramter /NoColors                             */
  339. /*     - removed the use of the environment variable SOUND            */
  340. /*     - removed the use of the environment variable ANSI             */
  341. /*     - added support for multi-line comments in the text, that      */
  342. /*       replaces the original source code                            */
  343. /*     - added some more technical information                        */
  344. /*                                                                    */
  345. /*                                                                    */
  346. /* (1)  TEMPLATE is a "runtime system" for REXX programs.             */
  347. /*      You can get TEMPLATE at the same source as this file.         */
  348. /*      The name of the archiv with TEMPLATE is "RXTMPnnn.EXE"        */
  349. /*      or "RXTnnn.EXE" where nnn is the version of TEMPLATE          */
  350. /*      (e.g. "306").                                                 */
  351. /*      TEMPLATE is distributed as freeware.                          */
  352. /*                                                                    */
  353. /* (2)  "Rexx Dialog" is an excellent package for using PM dialogs    */
  354. /*      in REXX programs. "Rexx Dialog" was written by Jeff Glatt.    */
  355. /*      You can get the complete "Rexx Dialog" package at every BBS   */
  356. /*      with OS/2 software. The name of the archiv with               */
  357. /*      "Rexx Dialog" is RXDLG10.ZIP (were 10 is the version number   */
  358. /*      I think).                                                     */
  359. /*      "Rexx Dialog" is distributed as freeware.                     */
  360. /*                                                                    */
  361. /*                                                                    */
  362. /*                                                                    */
  363. /* Generell notes                                                     */
  364. /* ==============                                                     */
  365. /*                                                                    */
  366. /* The ADDRESS environment for REXXCC must be 'CMD' (CMD is the       */
  367. /* address environment of CMD.EXE).                                   */
  368. /* REXXCC uses the internal CMD commands TYPE, ECHO, and DEL.         */
  369. /* REXXCC uses these commands with the prefix '@'.                    */
  370. /* If you use another command line processor, you must make sure that */
  371. /* it is compatible to CMD.EXE in the points mentioned above.         */
  372. /* (Note: 4OS2 for example is compatible.)                            */
  373. /*                                                                    */
  374. /* REXXCC also uses the external OS/2 programm ATTRIB.EXE.            */
  375. /*                                                                    */
  376. /* REXXCC uses temporary files to "compile" the REXX programs.        */
  377. /* REXXCC checks the environment variables TEMP and TMP (in this      */
  378. /* order) to find the directory for temporary files. If neither TEMP  */
  379. /* nor TMP is set, REXXCC creates temporary files in the current      */
  380. /* directory.                                                         */
  381. /* REXXCC uses unique filenames for temporary files. Therefore it is  */
  382. /* possible to run multiple copies of REXXCC at the same time.        */
  383. /*                                                                    */
  384. /* To use filenames or directory names with special chars like '-'    */
  385. /* or blanks, enclose them with double quotes '"'.                    */
  386. /*                                                                    */
  387. /* Example:                                                           */
  388. /*                                                                    */
  389. /*   REXXCC "my -Test" TO "-mydir" WITH "my doc" /LOG="test 1.log"    */
  390. /*                                                                    */
  391. /* REXXCC only overwrites existing targetfiles if called with the     */
  392. /* parameter '-Overwrite'.                                            */
  393. /*                                                                    */
  394. /* The sourcefile must begin with a valid REXX comment in line        */
  395. /* 1, column 1. You may suppress this check with the parameter        */
  396. /* '-IExt'.                                                           */
  397. /*                                                                    */
  398. /* The copyright file must begin with a valid REXX comment in line 1  */
  399. /* column 1. You may suppress this check with the parameter '-IExt'.  */
  400. /*                                                                    */
  401. /* You should not use 'TO' or 'WITH' as name for any of the           */
  402. /* parameters for REXXCC.                                             */
  403. /*                                                                    */
  404. /* You should load REXXUTIL before calling REXXCC if you are using    */
  405. /* a CMD window with more or less than 80 columns.                    */
  406. /*                                                                    */
  407. /* REXXCC does not load REXXUTIL but will use it if it's already      */
  408. /* loaded.                                                            */
  409. /*                                                                    */
  410. /* To get a smaller version of REXXCC use the following commands:     */
  411. /*                                                                    */
  412. /*   MD PROGRAM                                                       */
  413. /*   REXXCC REXXCC.CMD to PROGRAM WITH REXCC.CMD /LINECOUNT=16        */
  414. /*                                                                    */
  415. /* Note that you can't change the name of REXXCC. Note also that you  */
  416. /* only get a very short usage description if you use the parameter   */
  417. /* '/?' with the smaller version.                                     */
  418. /* IMPORTANT: YOU MUSTN'T DISTRIBUTE A CHANGED VERSION OF REXXCC!     */
  419. /*                                                                    */
  420. /*                                                                    */
  421. /*                                                                    */
  422. /* "Compiling" notes                                                  */
  423. /* =================                                                  */
  424. /*                                                                    */
  425. /* If you're going to distribute REXX files "compiled" with REXXCC    */
  426. /* I strongly suppose you add an additional file with the EAs to      */
  427. /* the archive with your "compiled" REXX program.                     */
  428. /* This is neccessary because there are many BBS Sysops around who    */
  429. /* unpack all uploaded archives with a DOS unpack program, check the  */
  430. /* files for a virus and pack the files again into an archive with a  */
  431. /* DOS pack program. And that was the last time you've seen the EAs   */
  432. /* of your REXX program :-((.                                         */
  433. /*                                                                    */
  434. /* REXXCC can only "compile" files on a read/write medium. So if you  */
  435. /* want to "compile" a REXX file from a read-only medium (a CD ROM    */
  436. /* for example) you MUST copy it to a read/write medium (e.g. a hard  */
  437. /* disk) and execute it there (!) before "compiling" it!              */
  438. /*                                                                    */
  439. /* The program EAUTIL.EXE is necessary for REXXCC to "compile" a      */
  440. /* REXX program. EAUTIL.EXE must be accessible about the environment  */
  441. /* variable "PATH".                                                   */
  442. /*                                                                    */
  443. /* Note that you must reExecute a sourcefile after you changed it     */
  444. /* before you can "compile" it. You may suppress this check with the  */
  445. /* parameter '-IDate'.                                                */
  446. /*                                                                    */
  447. /*                                                                    */
  448. /* Known limitations for "compiling"                                  */
  449. /* =================================                                  */
  450. /*                                                                    */
  451. /* You can only "compile" REXX files which are less than 64 K in      */
  452. /* tokenized form. 64 K is the maximum length of the EAs in which the */
  453. /* REXX interpreter stores the token image of REXX programs.          */
  454. /* (Note that the second length shown by the dir command on an HPFS   */
  455. /* drive is the length of the EAs. To get the length of the EAs on an */
  456. /* FAT drive use the switch /N for the OS/2 command "DIR".)           */
  457. /*                                                                    */
  458. /* To get around this limitation, you might use the program           */
  459. /* REXXCCM.CMD (which is also part of the REXXCC package).            */
  460. /* But please be aware, that REXXCCM.CMD and the images created with  */
  461. /* REXXCCM need the new REXXUTIL DLL from Object REXX (either as      */
  462. /* default REXXUTIL.DLL or as additional REXXUTIL.DLL - see the       */
  463. /* source code of REXXCCM.CMD)!                                       */
  464. /*                                                                    */
  465. /* You should not use the function "SOURCELINE" in a program          */
  466. /* "compiled" by REXXCC because there is no source code anymore :-).  */
  467. /* If you want to use the function "SOURCELINE" (e.g. in an error     */
  468. /* handler) use the following command sequence (this avoids an error  */
  469. /* if you call the function "SOURCELINE" with a non-existing line     */
  470. /* number):                                                           */
  471. /*                                                                    */
  472. /*  if sourceLine() >= errorLineNo then                               */
  473. /*  do                                                                */
  474. /*    call charOut, " The line reads: "                               */
  475. /*    call charOut, " *-* " || sourceline( errorLineNo )              */
  476. /*  end                                                               */
  477. /*  else                                                              */
  478. /*    call charOut, " The line is not available!"                     */
  479. /*                                                                    */
  480. /* You may use difficult lines in the sourcefile and the copyright    */
  481. /* file to distinguish between the original and the "compiled"        */
  482. /* version using "SOURCELINE" while running your program.             */
  483. /*                                                                    */
  484. /* You can not load a "compiled" program into the REXX macro space.   */
  485. /*                                                                    */
  486. /* To distribute a "compiled" REXX program on a CD-ROM you must       */
  487. /* either add the EAs in an extra file or pack the file with a        */
  488. /* packer which includes the EAs in the archive (like for example     */
  489. /* LH2.) This is neccessary because the CD-ROM filesystem does NOT    */
  490. /* support EAs.                                                       */
  491. /*                                                                    */
  492. /* You must use a local drive (harddisk or diskette) for the target   */
  493. /* file! You can't "compile" a REXX program to a network drive. But   */
  494. /* you can move or copy "compiled" REXX programs to network drives,   */
  495. /* of course.                                                         */
  496. /*                                                                    */
  497. /* You can NOT execute "compiled" programs if you're running          */
  498. /* Object REXX. Object REXX can not handle the token image created by */
  499. /* Classic REXX.                                                      */
  500. /* It is also impossible to "compile" REXX programs tokenized by the  */
  501. /* Object REXX interpreter.                                           */
  502. /* Note that Object REXX contains a program called REXXC.EXE to       */
  503. /* "compile" Object REXX programs. REXXC.EXE stores the token image   */
  504. /* in the CMD file - so there's no 64 K limitation for the size of    */
  505. /* the token image.                                                   */
  506. /*                                                                    */
  507. /*                                                                    */
  508. /* Known limitations for "compressing"                                */
  509. /* ===================================                                */
  510. /*                                                                    */
  511. /* The lines of the REXX programs must end with a CR/LF sequence.     */
  512. /*                                                                    */
  513. /* You _MUST_ use the format                                          */
  514. /*                                                                    */
  515. /*    '/' || '*'                                                      */
  516. /*                                                                    */
  517. /* and                                                                */
  518. /*                                                                    */
  519. /*    '*' || '/'                                                      */
  520. /*                                                                    */
  521. /* (or something similar) if you want to use the REXX comment begin   */
  522. /* and comment end sequences in string constants used in your         */
  523. /* program!                                                           */
  524. /*                                                                    */
  525. /* REXXCC does not parse the source code like the REXX interpreter.   */
  526. /* Therefore it handles a few constructs incorrect.                   */
  527. /*                                                                    */
  528. /* For example: Because REXXCC can't detect if a comment should be    */
  529. /* replaced with a blank, the string concatenator or nothing, it      */
  530. /* deletes ALL comments. This may lead to an error, if you use        */
  531. /* comments as separators in your REXX programs, see examples below.  */
  532. /*                                                                    */
  533. /* The following are examples of REXX statements not handled correct  */
  534. /* by REXXCC:                                                         */
  535. /*                                                                    */
  536. /*  statement                         is converted to                 */
  537. /*  ----------------------------------------------------------------- */
  538. /*  str1 = 'aa'/* comment */'bb'      str1 = 'aa''bb'                 */
  539. /*  if a = b/* */then/* */say 'bb'    if a =bthensay 'bb'             */
  540. /*                                                                    */
  541. /*                                                                    */
  542. /* You should not use the function "SOURCELINE" in a program          */
  543. /* "compressed" by REXXCC because there is normally only one          */
  544. /* sourceline in the "compressed" REXX program.                       */
  545. /*                                                                    */
  546. /* You can add the special comment                                    */
  547. /*                                                                    */
  548. /*    /*!*/                                                           */
  549. /*                                                                    */
  550. /* to the end of a line to insert a CR/LF into the compressed file.   */
  551. /*                                                                    */
  552. /* ------------------------------------------------------------------ */
  553. /* Terms for using this version of REXXCC                             */
  554. /* ======================================                             */
  555. /*                                                                    */
  556. /* This version of REXXCC is Freeware. You can use and share it as    */
  557. /* long as you neither delete nor change any file or program in the   */
  558. /* archiv!                                                            */
  559. /* IT IS VERY IMPORTANT THAT YOU SHARE THIS PROGRAM ONLY WITH IT'S    */
  560. /* EXTENDED ATTRIBUTES (EAs) - BECAUSE WITHOUT THEM IT WILL NOT RUN!  */
  561. /*                                                                    */
  562. /* IMPORTANT !!! IMPORTANT !!! IMPORTANT !!! IMPORTANT !!! IMPORTANT  */
  563. /*  ===============================================================   */
  564. /*    TO DISTRIBUTE REXXCC ON MEDIUMS NOT SUPPORTING EXTENDED         */
  565. /*    ATTRIBUTES LIKE CD-ROMs, BBS or CompuServe YOU MUST USE         */
  566. /*    THE ARCHIVE FILE RCnnn.EXE!!!                                   */
  567. /*  ===============================================================   */
  568. /* IMPORTANT !!! IMPORTANT !!! IMPORTANT !!! IMPORTANT !!! IMPORTANT  */
  569. /*                                                                    */
  570. /* If you find REXXCC useful, your gift in any amount would be        */
  571. /* appreciated.                                                       */
  572. /*                                                                    */
  573. /* Please direct your inquiries, complaints, suggestions, bug lists   */
  574. /* etc. to the address noted above.                                   */
  575. /*                                                                    */
  576. /* If you like and use REXXCC it would be nice if you send me a       */
  577. /* postcard.                                                          */
  578. /*                                                                    */
  579. /* ------------------------------------------------------------------ */
  580. /* Terms for distributing REXXCC                                      */
  581. /* for vendors, sysops and others 'for-profit' distributors           */
  582. /* ========================================================           */
  583. /*                                                                    */
  584. /* I encourage all shareware vendors, BBS sysops and other            */
  585. /* 'for-profit' distributors to copy and distribute this version      */
  586. /* of REXXCC subject to the following restrictions:                   */
  587. /*                                                                    */
  588. /*  The REXXCC freeware package - including all related program files */
  589. /*  and documentation files - cannot be modified in any way (other    */
  590. /*  than that mentioned below) and must be distributed as a complete  */
  591. /*  package, without exception.                                       */
  592. /*                                                                    */
  593. /*  Small additions to the package, such as the introductory or       */
  594. /*  installation batch files used by many shareware disk vendors, are */
  595. /*  acceptable.                                                       */
  596. /*                                                                    */
  597. /*  You may charge a distribution fee for the package, but you must   */
  598. /*  not represent in any way that you are selling the software itself.*/
  599. /*                                                                    */
  600. /*  The disk-based documentation may not be distributed in printed    */
  601. /*  form without the prior written permission of the author.          */
  602. /*                                                                    */
  603. /*  You shall not use, copy, rent, lease, sell, modify, decompile,    */
  604. /*  disassemble, otherwise reverse engineer, or transfer this         */
  605. /*  program except as provided in this agreement. Any such unautho-   */
  606. /*  rized use shall result in immediate and automatic termination of  */
  607. /*  the permission to distribute this program.                        */
  608. /*                                                                    */
  609. /*  I reserve the right to withdraw permission from any vendor to     */
  610. /*  distribute my products at any time and for any reason.            */
  611. /*                                                                    */
  612. /* ------------------------------------------------------------------ */
  613. /* Warranty Disclaimer                                                */
  614. /* ===================                                                */
  615. /*                                                                    */
  616. /* Bernd Schemmer makes no warranty of any kind, expressed or         */
  617. /* implied, including without limitation any warranties of            */
  618. /* merchantability and/or fitness for a particular purpose.           */
  619. /*                                                                    */
  620. /* In no event will Bernd Schemmer be liable to you for any           */
  621. /* additional damages, including any lost profits, lost savings, or   */
  622. /* other incidental or consequential damages arising from the use of, */
  623. /* or inability to use, this software and its accompanying documen-   */
  624. /* tation, even if Bernd Schemmer has been advised of the possibility */
  625. /* of such damages.                                                   */
  626. /*                                                                    */
  627. /* ------------------------------------------------------------------ */
  628. /* Copyright                                                          */
  629. /* =========                                                          */
  630. /*                                                                    */
  631. /* REXXCC, the documentation for REXXCC and all other related files,  */
  632. /* except for the files RXDLG.DLL, RX.EXE and RX.INF, are             */
  633. /* -- Copyright 1994,1997 by Bernd Schemmer. All rights reserved. --  */
  634. /*                                                                    */
  635. /* The files RXDLG.DLL, RX.EXE and RX.INF are                         */
  636. /* -- Copyright 1995 by Jeff Glatt.  --                               */
  637. /* Please see the file RX.INF for the using and redistribution policy */
  638. /* for these files.                                                   */
  639. /*                                                                    */
  640. /*                                                                    */
  641. /* ------------------------------------------------------------------ */
  642. /* Technical information                                              */
  643. /* =====================                                              */
  644. /*                                                                    */
  645. /* Warnings                                                           */
  646. /* --------                                                           */
  647. /*                                                                    */
  648. /* Warning: No time stamp checking possible for files on or from FAT  */
  649. /*          partitions!                                               */
  650. /*                                                                    */
  651. /*   Description:                                                     */
  652. /*      REXXCC can't check if the file was changed after the          */
  653. /*      creation of the token image. If REXXCC shows this warning     */
  654. /*      for a file on an HPFS partition, I suppose you delete and     */
  655. /*      recreate the EAs of the REXX CMD before "compiling" it.       */
  656. /*      You may suppress this warning with the parameter '-IDate'.    */
  657. /*                                                                    */
  658. /*   Background:                                                      */
  659. /*      REXXCC shows this warning, while "compiling" a REXX CMD for   */
  660. /*      which the token image in the EAs was created on a FAT         */
  661. /*      partition. This is independent from the file system of the    */
  662. /*      current drive with the CMD. Note that the execution time      */
  663. /*      stamp for CMDs on FAT partitions is always 0.                 */
  664. /*                                                                    */
  665. /*                                                                    */
  666. /* Warning: Unmatched comment delimiter "/*" in the sourcefile!       */
  667. /* Warning: Unmatched comment delimiter "*/" in the sourcefile!       */
  668. /*                                                                    */
  669. /*   Description:                                                     */
  670. /*      REXXCC found unmatched comment delimiter in the source file.  */
  671. /*      Note that you CAN NOT execute the created target file!        */
  672. /*                                                                    */
  673. /*   Background:                                                      */
  674. /*      REXXCC does not delete the target file, to give you a         */
  675. /*      hint for the position of the unmatched comment delimiter      */
  676. /*      (just load the target file into your favorite editor and      */
  677. /*      do a search for the comment delimiter).                       */
  678. /*                                                                    */
  679. /* Warning: Unmatched string delimiter <'> in the sourcefile!         */
  680. /* Warning: Unmatched string delimiter <"> in the sourcefile!         */
  681. /*                                                                    */
  682. /*   Description:                                                     */
  683. /*      REXXCC found unmatched string delimiter in the source file.   */
  684. /*      Note that you CAN NOT execute the created target file!        */
  685. /*                                                                    */
  686. /*   Background:                                                      */
  687. /*      REXXCC does not delete the target file, to give you a         */
  688. /*      hint for the position of the unmatched string delimiter       */
  689. /*      (just load the target file into your favorite editor and      */
  690. /*      do a search for the string delimiter).                        */
  691. /*                                                                    */
  692. /* Returncodes and error messages                                     */
  693. /* ------------------------------                                     */
  694. /*                                                                    */
  695. /* Note: If you get one of the errors marked with a plus (+) in the   */
  696. /*       table below - please contact the author!                     */
  697. /*                                                                    */
  698. /*    RC  Error message                                               */
  699. /*   ---------------------------------------------------------------- */
  700. /*     0  ok, targetfile successfully created (NO ERROR)              */
  701. /*     1  parameter for usage help detected, usage shown (NO ERROR)   */
  702. /*     2  Can not find a name for a temporary file (Check the         */
  703. /*        variable "TEMP" or "TMP")                                   */
  704. /*     3  Can not find the program EAUTIL.EXE                         */
  705. /*        (Check the variable "PATH")                                 */
  706. /*     4  Can not find the program ATTRIB.EXE                         */
  707. /*        (Check the variable "PATH")                                 */
  708. /*    11  Parameter missing or invalid parameter found                */
  709. /*    12  The sourcefile "%1" does not exist                          */
  710. /*    13  The extension of the sourcefile must be ".CMD"              */
  711. /*    14  The extension for the targetfile must be ".CMD"             */
  712. /*    15  The targetfile "%1" already exist                           */
  713. /*    16  The copyrightFile "%1" does not exist                       */
  714. /*    17  The copyrightFile can not be a device                       */
  715. /*    18  The targetfile can not be equal with the source file        */
  716. /*    19  The drive %1 is not ready                                   */
  717. /*    31  The copyrightFile must begin with a REXX comment in         */
  718. /*        line 1 column 1                                             */
  719. /*        Note: This error also occurs, if REXXCC can *not* read the  */
  720. /*              copyright file (for example if it's opened by another */
  721. /*              program)                                              */
  722. /* +  32  OS Error %1 deleting the temporary file "%2"                */
  723. /* +  33  OS Error %1 deleting the existing targetfile "%2"           */
  724. /* +  34  OS Error %1 compiling the sourcefile "%2"                   */
  725. /*    35  You must first execute the sourcefile "%1" before           */
  726. /*        compiling it                                                */
  727. /*        Note: If you have already executed the sourcefile, your     */
  728. /*              REXX program is to big to fit in the EAs.             */
  729. /*              In this case no "compiling" is possible.              */
  730. /*              You might use REXXCCM.CMD to compile your REXX        */
  731. /*              program using the macro space.                        */
  732. /*    36  Can not find a name for a temporary file (Check the         */
  733. /*        environment variable "TEMP" or "TMP")                       */
  734. /* +  37  OS Error %1 creating the targetfile "%2"                    */
  735. /* +  38  OS Error %1 creating the targetfile "%2"                    */
  736. /* +  39  OS Error %1 creating the targetfile "%2"                    */
  737. /* +  40  OS Error %1 creating the targetfile "%2"                    */
  738. /* +  41  OS Error %1 creating the targetfile "%2"                    */
  739. /* +  42  OS Error %1 creating the targetfile "%2"                    */
  740. /*    51  You must first execute the sourcefile "%1" before           */
  741. /*        compiling it                                                */
  742. /*        Note: see error number 35.                                  */
  743. /*    52  You must first execute the sourcefile "%1" before           */
  744. /*        compiling it                                                */
  745. /*        Note: see error number 35                                   */
  746. /*    53  You must reExecute the sourcefile after every               */
  747. /*        change before you can compile it                            */
  748. /*        Note: See error number 35                                   */
  749. /* +  54  Internal error E1                                           */
  750. /* +  55  Unknown format of the token image                           */
  751. /*    56  Unknown REXX interpreter version (%1)                       */
  752. /*    57  The file "%1" is NOT a REXX program                         */
  753. /*    60  Invalid switches "%1" in the environment variable "REXXCC"! */
  754. /*    61  The string "%1" in the environment variable "REXXCC" is     */
  755. /*        not a valid option                                          */
  756. /*    62  The string "%1" in the parameters is not a valid option     */
  757. /*    63  The comments in the source file nested to deep (max. is 40) */
  758. /*        Note:                                                       */
  759. /*        This limitation is there, because REXXCC uses a recursive   */
  760. /*        algorithm to compress a REXX cmd and the number of nested   */
  761. /*        control structs in REXX is 100.                             */
  762. /*                                                                    */
  763. /* + 232  This is a patched version of the program. It won't work     */
  764. /* + 233  Invalid REXX interpreter version                            */
  765. /* + 234  Internal error OTFT                                         */
  766. /* + 234  Internal error FTOT                                         */
  767. /* + 234  Internal error ODFD                                         */
  768. /* + 234  Internal error FDOD                                         */
  769. /*   235  You can only execute this program in a CMD session!         */
  770. /*        Note: Try using 'CMD /C REXXCC ...'                         */
  771. /*   254  user break (CTRL-C)                                         */
  772. /*   255  internal runtime system error                               */
  773. /*                                                                    */
  774. /* ------------------------------------------------------------------ */
  775. /* Based on TEMPLATE.CMD v2.52, TEMPLATE is (c) Bernd Schemmer, 1995  */
  776. /* Baeckerweg 48, D-60316 Frankfurt, Germany, CompuServe: 100104,613  */
  777. /*                                                                    */
  778. /**********************************************************************/
  779.  
  780.   say "Error: Either you are using an unknown REXX Interpreter version or";say "       this program lost it's extended attributes!" "07"x ;exit 255  
  781. /* created on 12/06/97 at 18:31:05 with REXXCC V3.21  (c) Bernd Schemmer 1997 */ 
  782.