home *** CD-ROM | disk | FTP | other *** search
/ AMIGA PD 1 / AMIGA-PD-1.iso / Programme_zum_Heft / Programmieren / Kurztests / ACE / utils / UppercACEr / UppercACEr.doc < prev    next >
Text File  |  1994-10-23  |  5KB  |  136 lines

  1.                    ********************      15.10.1994
  2.                   *     UppercACEr     *
  3.                    ********************
  4.  
  5. What is it? ---------------------------------------------
  6.  
  7. When  I  moved from AmosPro to ACE (because of the amount
  8. of  BUGS  in  AmosPro) I noticed how ACE listings usually
  9. have  the  reserved words in UPPERCASE.  While this makes
  10. the  sources  more  readable,  I  for one can't type like
  11. that.
  12.  
  13. So I made this program to do it for me.
  14.  
  15. There  are  editors (like "Edge") who can uppercase words
  16. automatically  as  you  type  them, but I found that this
  17. option  does  not work flawlessly.  So, IMO, It's best to
  18. convert(/"autocase") the source separately.
  19.  
  20. UppercACEr  does  NOT  uppercase  reserved words that are
  21. after  a  REM,  on  a  '-comment line, inside strings, or
  22. inside  {block  comments}.  It also handles multiple line
  23. block  comments.   UppercACEr does not change the case of
  24. any  non-reserved  words.   You  can  have variables like
  25. "MaxStrLength".
  26.  
  27. So:        print "print":print{print}: rem pRiNt
  28. becomes        PRINT "print":PRINT{print}: REM pRiNt
  29.  
  30. UppercACEr  also  removes unnecessary spaces and tabs etc
  31. from  the  END  of  lines  - even from the end of comment
  32. lines.  This behaviour can NOT be turned off (yet).  And,
  33. if  UppercACEr  confronts  a  line  consisting  solely of
  34. spaces  and/or  tabs,  it  outputs just a linefeed to the
  35. destination file.  So don't be surprised if the converted
  36. source is smaller than the original.
  37.  
  38. I  made  UppercACEr  work  this  way  because I sometimes
  39. forget unnecessary tabs in my sources.
  40.  
  41.  
  42. Installation --------------------------------------------
  43.  
  44. Copy  the files "UppercACEr" and "UppercACEr.Reserved" to
  45. some   directory.    That's   it.   You  can  rename  the
  46. executable    to    whatever    u    like,    BUT:    the
  47. UppercACEr.Reserved-file may NOT be renamed, or shit will
  48. happen (the program won't work too well).
  49.  
  50.  
  51. Usage ---------------------------------------------------
  52.  
  53. This  template  is printed if you run the program without
  54. parameters:
  55.  
  56. UppercACEr <source>[.b] <destination>[.b] [QUIET]
  57.  
  58. Where  source  and destination must NOT be the same file.
  59. If  the  .b  extension  is  omitted, ACE adds it for you.
  60. Note:   source  file  MUST have the extension of .b!  The
  61. destination  file  WILL  have  the  .b extension added no
  62. matter  what.   UppercACEr  is  for  use with ACE sources
  63. only.   Maybe  I  will  make it more flexible when I have
  64. time.
  65.  
  66.  
  67. UppercACEr.Reserved-file --------------------------------
  68.  
  69. This  file  contains  the  reserved  words  you  wish  to
  70. uppercase.    The  words  can  be  in  either  upper-  or
  71. lowercase.  The list _MUST_ be in alphabetical order.
  72.  
  73. The file can contain comment lines beginning with "'".
  74.  
  75. UppercACEr expects the reserved word file to be in the s:
  76. directory.
  77.  
  78. UppercACEr  thinks that the $-sign does not belong to any
  79. reserved  word.   It  is  unwise  to  have  both INPUT and
  80. INPUT$,  for  example, in the .Reserved-file.  It will do
  81. no harm, but will slow things down a bit and use memory.
  82.  
  83. All  the  words in .Reserved only have ONE part.  So END,
  84. SUB,  END SUB, IF, END IF are all handled by END, SUB and
  85. IF in the .Reserved file.
  86.  
  87. New  versions  of  ACE are able to output a list of their
  88. reserved    words    to   stdout.    Use   the   included
  89. MakeReserved-program  to  modify  the file and remove all
  90. unnecessary stuff.
  91.  
  92. MakeReserved  needs  the  "sort" and "ACE"-commands to be
  93. somewhere   within   command   path.   MakeReserved  will
  94. overwrite 2 files in t:  if they already exist.
  95.  
  96. Easiest  way  to  create  the  .Reserved-file:  cd to the
  97. directory where UppercACEr is located, and type
  98.  
  99. MakeReserved UppercACEr.Reserved
  100.  
  101. MakeReserved will do roughly the following:
  102. ACE words >t:ReservedTemp1
  103. sort t:ReservedTemp1 t:ReservedTemp
  104. delete t:ReservedTemp1
  105. (Convert to <outputfile>)
  106. delete t:ReservedTemp
  107.  
  108. Check MakeReserved.b for info.
  109.  
  110.  
  111. Misc stuff ----------------------------------------------
  112.  
  113. If this program seriously screws up your sources, don't
  114. hunt me down :-) I have tested it, and it seemed to work.
  115. The converted sources compiled fine and looked cleaner.
  116.  
  117. It's  neat  to  add  a few lines in the beginning of your
  118. ACE:bin/bas  script  to  automatically  make sources more
  119. readable when you compile them.  Like this:
  120.  
  121.     UppercACEr <arg2> t:HobbitsRule.b QUIET
  122.     copy t:HobbitsRule.b <arg2>.b
  123.     delete t:HobbitsRule.b
  124.  
  125. Note that the program is slow right now.  I will speed it
  126. up in the (near?) future.  Typical conversion speed on my
  127. 1+2MB  A500Plus  with  Supraturbo28  was  20-30  lines  a
  128. second.
  129.  
  130. UppercACEr  will  warn  you  if the .Reserved-file is not
  131. found, if the source file is not found, or if the program
  132. can't reserve enough memory.
  133.  
  134.                       K.Veijalainen
  135.                     veijalai@cc.lut.fi
  136.