home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / prog / c / sas2ced5.lha / sas2ced.doc < prev    next >
Text File  |  1992-03-21  |  10KB  |  233 lines

  1.  
  2.                                Sas2Ced v2.24
  3.  
  4.                                     By
  5.                                 Doug Keller
  6.  
  7.                    Copyright 1991,1992 Synthetic Technologies
  8.                               March 21, 1992
  9.  
  10.  
  11.      [0] Introduction
  12.  
  13. |    Lines with changes since the last version of Sas2Ced have a | in the
  14. |    left margin.
  15.  
  16.      Sas2Ced is a program to interface SAS/C 5.10b and CygnusEd 2.12.  If
  17.      an error is encountered while compiling, Ced will be pulled to the
  18.      front and the cursor put on the first line with an error.  Sas2Ced has
  19.      been tested on an A3000 under 2.04, SAS/C 5.10b, and CygnusEd 2.12.
  20.      Sas2Ced has been tested with _Enforcer_ and Mungwall.
  21.  
  22.      This version of Sas2Ced also has the ability find a shell in the
  23.      system with a current directory the same as the file in Ced and type
  24.      a command to that shell.
  25.  
  26.  
  27.      [1] Idea behind Sas2Ced
  28.  
  29.      When LC encounters an error and the -E switch is used LC looks for a
  30.      message port called 'Lse', if the port is found LC sends arexx
  31.      messages to the port telling it some information about the errors.  If
  32.      the port is not found Lse is loaded.  Sas2Ced works by opening a port
  33.      called 'Lse' and intercepts all the messages LC sends it.  It then
  34.      sends converted messages to Ced.  Since Sas2Ced opens a message port
  35.      called 'Lse', make sure Lse is not running when Sas2Ced is.
  36.  
  37.      To find a shell with a certain current directory, Sas2Ced uses a new
  38.      2.0 function FindCliProc().  FindCliProc() returns a pointer to a
  39.      shell Process, which contains the current directory of the shell.
  40.      It then checks to make sure a program is not running in the shell,
  41.      sends console packet of ACTION_DISK_INFO which will return a pointer
  42.      to shell's window.  The mouse is then moved over the window for
  43.      sunmouse users, the window is activated and the screen the window is
  44.      on is pulled to the front.  The command is then typed into the input
  45.      stream.
  46.  
  47.  
  48.      [2] Usage
  49.  
  50.      The best place to run Sas2Ced is in the startup-sequence.  Currently
  51.      Sas2Ced does not release itself from the CLI, so you must run it by
  52.      typing:
  53.  
  54.          run >nil: <nil: sas2ced
  55.  
  56.      When Sas2Ced is run it checks to see if Ced is running, if Ced is not
  57.      running it loads a dormant copy of it (ced -r).  This is the only time
  58.      it is checked to see if Ced is in memory, so you must have Ced
  59.      dormant.  Once Sas2Ced is running all you have to do is compile a
  60.      program with LC with the -E option.  If an error is encountered Ced
  61.      will be called to the front and the cursor will be put on the line and
  62.      column position.  A requester will then ask if you want to ReturnToCED
  63.      by pressing Y or go to the NextError with N.  If you return to Ced you
  64.      can get the next error by using the nexterror.s2c arexx program.
  65.  
  66.      Instead of adding -E to all your makefiles it is easier to add an
  67.      environmental variable called 'sascopts' that contains -E.
  68.  
  69.      Sas2Ced has four different command line options.  The first three
  70.      are mutually exclusive
  71.          next - (default)pops up the nexterror requester when an error is
  72.                 found.
  73.          show - pops up the showerrors requester when an error is found.
  74.          quiet- moves the cursor to the first error when an error is found.
  75.          path - path to look for in an include file that has an error and
  76.                 is not in the current dir.
  77.  
  78.      Examples:
  79.          1> sas2ced next   ;nexterror requester
  80.          1> sas2ced        ;same as above
  81.          1> sas2ced show   ;showerrors requester
  82.          1> sas2ced quiet  ;no requester
  83.          1> sas2ced path "lc:/compiler_headers_2.04"
  84.  
  85.      Sas2Ced can be quit three different ways; by running Sas2Ced again, by
  86.      sending an arexx message 'quit' to the port named 'sas2ced', or by
  87.      sending a control-c to the Sas2Ced process (pressing ctrl-c or break
  88.      cli#).
  89.  
  90.  
  91.      [3] AREXX interface
  92.  
  93.      Currently Sas2Ced supports four arexx commands, 'quit', 'nexterror',
  94.      'showerrors', and 'compile'.
  95.          'quit' quits Sas2Ced.
  96.          'nexterror' moves the cursor to the next error and displays the
  97.                      error message, with an okay2 requester.
  98.          'showerrors' displays all the currently cached errors in an okay1
  99.                       requester.
  100.          'compile' takes two parameters, path and command.  The path is the
  101.                    current directory of the shell that Sas2Ced looks for.
  102.                    The path must have quotes around it so it can be parsed.
  103.                    The command is what you want typed in the shell.  If a
  104.                    shell could not be found with the correct current
  105.                    directory a return code of 5 will be return to arexx.
  106.  
  107. |    For simple Arexx programs you can enter the Arexx program right in
  108. |    Ced's string gadget when it ask you to enter the Arexx program to
  109. |    execute.  Select 'Install Dos/Arexx command...', enter the key number,
  110. |    then instead of entering a filename, enter and Arexx program starting
  111. |    with a doublequote.  For example you could enter 'rexx:nexterror.s2c'
  112. |    or '"address SAS2CED nexterror', they both do the same thing.
  113.  
  114.      See the Arexx programs that are included; quit.s2c, nexterror.s2c,
  115.      showerrors.s2c, and compile.s2c.
  116.  
  117.  
  118.      [4] How compile.s2c works
  119.  
  120.      Compile.s2c is the Arexx program that will compile a C program from
  121.      Ced.  Compile.s2c should be attached to a key in Ced (I have it
  122.      attached to f10).  When it is executed it will do the following:
  123.           1.  If the file (current view) has been changed it will save it.
  124.           2.  Looks in the first 10 lines of the file for the string
  125.               'compile:', if it finds this string it will execute what
  126.               follows 'compile:' in the shell, more about this below.
  127.           3.  If it does not find 'compile:' in the file, it checks to
  128.               see if there is a lmkfile or makefile in the directory
  129.               where the .c files is, and executes 'lmk' if either one
  130.               is found.
  131.           4.  If it does not find 'compile:' or a makefile it executes
  132.               'lc -L filename'.
  133.           5.  If there is a shell in the system without a program running
  134.               in it and its current directory is the same as the .c,
  135.               the command will be executed in this shell.  If a shell
  136.               can not be found with the correct current directory a new
  137.               shell is opened with the correct current directory.  Where
  138.               the shell opens and what shell is used can be changed by
  139.               changing the 'UserShell' variable in compile.s2c.
  140.  
  141.      In the 'compile:' line if '$*' is found it is replaced with the
  142.      current filename.  If you use '$*' the file will compile even
  143.      if the filename is changed.  See the example try_me.c file.
  144.  
  145.      Example:
  146.      /*   compile: lc -rr -cusft -v -L $*
  147.      **
  148.      **   This will execute 'lc -rr -cusft -v -L filename'.
  149.      */
  150.  
  151. |    If you are using WShell 2.0 you must use BRKMODE#2 option.  This
  152. |    will allow Sas2Ced to find the console window when it tries to compile
  153. |    a program.  The best thing to do is add BRKMODE#2 to you DHOpts line
  154. |    in you user-startup.
  155. |
  156. |    If you are NOT using WShell 2.0, get it, it is great.  You can order
  157. |    it from: Wishful Thinking Development Corp
  158. |             PO Box 308
  159. |             Maynard, MA  01754
  160. |             (508) 568-8695
  161. |
  162. |    Example:
  163. |        DHOpts CON:0/0/640/200/MENU#CNC-Menus/BRKMODE#2 MENU S:CNC-Menus
  164. |
  165. |    You should change the UserShell variable at the start of compile.s2c,
  166. |    so it opens the shell you are using.  The default it is to open a
  167. |    WShell.
  168.  
  169.      [5] Limitations
  170.  
  171.      When an error is found in a include file the path is not sent to
  172.      Sas2Ced, so it looks for the include file in the following order:
  173.           1.  absolute load
  174.           2.  directory where the .c is
  175.           3.  path you specified on the command line when Sas2Ced was started.
  176.               "lc:/compiler_headers_2.04" is a good path to use.
  177.           4.  opens up a file requester and asks you to load it
  178.  
  179.  
  180.      Sas2Ced tries its best to put the cursor on the error.  Since Sas2Ced
  181.      can only be as good as the output LC sends it, sometimes Sas2Ced puts
  182.      the cursor in the wrong column.
  183.  
  184.  
  185.      [6] What version of 2.0
  186.  
  187.      This release of Sas2Ced only runs under 2.0, Workbench 37.67 and
  188.      Kickstart 37.175, or greater.
  189.  
  190.  
  191.      [7] Legal junk
  192.  
  193.      Permission is granted to distribute this program and its documentation
  194.      for non-commercial purposes as long as the copyright notices are not
  195.      removed.  This program may not be distributed for a profit without
  196.      permission from Doug Keller.  Fred Fish has permission to distribute
  197.      this program as part of the Fred Fish library.
  198.  
  199.  
  200.      [8] Thanks
  201.  
  202.      I would like to thank all the guys at C= that are working on 2.0, keep
  203.      up the good work, Bill Hawes for WShell 2.0, ASDG and CygnusSoft for
  204.      CygnusEd, SAS for their C compiler and for adding sending of the full
  205.      path when an error is encountered.
  206.  
  207.      Thanks to Bryce Nesbitt for _Enforcer_ and Ewout Walraven for
  208.      MungWall, this program would not have been possible with out them.
  209.  
  210.  
  211.      [9] Future version of Sas2Ced
  212.  
  213. |    Here are a few things I would like to add to Sas2Ced for the next
  214. |    version:
  215. |
  216. |      Arexx command to go to the previous error.
  217. |
  218. |      Autodoc and Include support, put the cursor on a word and press
  219. |      a key to load the autodoc or include for the word.
  220. |
  221. |    Any ideas for other enhancements are welcomed.
  222.  
  223.  
  224.      [10] Bugs and Info
  225.  
  226.      If you would like to get in touch with me I can be reached on the
  227.      following
  228.  
  229.                  Bix : dkeller
  230.              Internet: dkeller@lynx.northeastern.edu
  231.                        f303@nuvlsi.coe.northeastern.edu
  232.  
  233.