home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 6
/
FreshFish_September1994.bin
/
new
/
dev
/
obero
/
oberon-a
/
docs
/
obrn-a_rexx.doc
< prev
next >
Wrap
Text File
|
1994-08-08
|
9KB
|
232 lines
$RCSfile: Obrn-A_rexx.doc $
Created by: fjc (Frank Copeland)
$Revision: 1.2 $
$Author: fjc $
$Date: 1994/08/08 21:14:57 $
________________________________________________________________________
This archive contains several scripts written in ARexx and the AmokEd
command language. They allow the programmer to call the compiler,
pre-linker and linker from within the AmokEd editor, and to insert
error messages directly into the source code. They are intended to be a
demonstration, hopefully inspiring others to improve them and to adapt
them for use with other editors. At present the error messages only
indicate an error number and a position.
Installation
The files in the rexx directory should be copied to your REXX:
directory. The macros/Oberon-A.aedrc file should be copied to wherever
you keep your AmokEd macro files. Add the following line to your normal
startup file:
'source Oberon-A.aedrc'
The ARexx scripts require RexxDosSupport.library to access environment
variables. This can be found on AmiNet in:
'util/rexx/RexxDosSupport14.lha'
Usage
The Oberon-A.aedrc file sets up a menu called 'Oberon' and creates a
number of new key bindings. The menu items are:
'Main module' (bound to CTRL-ALT-m)
This is a toggle item. It indicates whether the module is a main
program module. If it is not selected, the pre-linker and linker
menu items are disabled.
'Library module' (bound to CTRL-ALT-l)
This is a toggle item. If selected, it indicates that the module
is a library module and that it's symbol and object files should be
output to 'OLIB:'. Otherwise, the files are output to the 'Code'
sub-directory.
The above two items are mutually exclusive.
'Compiler options' (bound to ALT-F1)
This allows the programmer to directly edit the command line
arguments to be passed to the compiler. The DEBUG and NEWSYMFILE
arguments should not be specified (see below).
'New symbol file' (bound to CTRL-ALT-n)
This is a toggle item. If selected, the NEWSYMFILE option is added
to the arguments passed to the compiler.
'Debug symbols' (bound to CTRL-ALT-d)
This is a toggle item. If selected, the DEBUG option is added to
the arguments passed to the compiler.
'Pre-linker options' (bound to ALT-F2)
This allows the programmer to directly edit the command line
arguments to be passed to the pre-linker.
'Linker options' (bound to ALT-F3)
This allows the programmer to directly edit the command line
arguments to be passed to the linker.
'Compile' (bound to F1)
This calls the 'DoOC.rexx' script to compile the file in the active
window. The file is saved first and if any errors are detected the
'ReadErr.aed' script is called to produce error reports (see
below).
'Pre-link' (bound to F2)
This calls the 'DoOL.rexx' script to pre-link the module in the
active window. This option is only active if the 'Main module'
item is selected (see above).
'Link' (bound to F3)
This calls the 'DoLink.rexx' script to link the module in the
active window. This option is only active if the 'Main module'
item is selected (see above).
'Run' (bound to F4)
This runs the program, assuming that the current module is the main
program module. This option is only active if the 'Main module'
item is selected (see above).
'Read Errors' (bound to F6)
This calls the 'ReadErr.aed' script to generate a report of any
compilation errors reported for the module in the active window.
If the default binary error file is produced by the compiler, the
script calls OEL to generate the error report. The output is
redirected to a temporary file and the file is then displayed in a
new window.
If the TEXTERR option is used with the compiler, the script instead
inserts error reports directly into the the active window. Each
error report consists of a seperate line of the form:
^-- err: xxx
This line will be inserted below the line in which the error
occurs. The caret ('^') indicates the location of the error in the
line above. The meaning of the error number can be found in the
file 'OBERON-A:Docs/ErrorCodes.doc'.
If using the TEXTERR option, be careful not to call this script
more than once. The second call will insert error reports in the
wrong places. If this happens, use the 'Clear errors' item (see
below) and start again.
The following key bindings are only useful if the TEXTERR option is
specified for the compiler. If not, they have no effect.
'First error' (bound to F7)
This moves the cursor to the first error report in the file.
'Next error' (bound to F8)
This move the cursor to the next error report.
'Prev error' (bound to SHIFT-F8)
This move the cursor to the previous error report.
'Clear errors' (bound to F9)
This deletes all remaining error reports in the file.
Scripts
Most of the work is done by the ARexx script files. Of these, only
ReadErr.aed contains commands specific to AmokEd, although it is
called directly by 'DoOC.rexx'.
'DoOC.rexx'
This script takes two arguments: the name of the file to be
compiled and the name of the public screen it is to open a console
window on. It gets additional arguments from three environment
variables:
OC_NEWSYMFILE - contains either 'YES' or 'NO'. If 'YES', the
NEWSYMFILE option is included in the compiler's command line.
OC_DEBUG - contains either 'YES' or 'NO'. If 'YES', the DEBUG
option is included in the compiler's command line.
OC_ARGS - contains any other options to be included in the
compiler's command line.
It is the responsibility of the editor to create and set these
environment variables.
The script will open a console window for the compiler's IO and set
the stack. If the compiler returns any code other than 0, it calls
'ReadErr.aed' to insert error reports in the module's source code.
'DoOL.rexx'
This script takes two arguments: the name of the module that is the
program's entry point, and the name of the public screen it is to
open a console window on. It gets additional arguments from an
environment variable:
OL_ARGS - contains any options to be included in the pre-linker's
command line.
It is the responsibility of the editor to create and set these
environment variables.
The script will open a console window for the pre-linker's IO and
set the stack.
'DoLink.rexx'
This script takes two arguments: the name of the module that is the
program's entry point, and the name of the public screen it is to
open a console window on. It gets additional arguments from an
environment variable:
LINK_ARGS - contains any options to be included in the linker's
command line.
It is the responsibility of the editor to create and set these
environment variables.
The script will open a console window for the linker's IO and set
the stack.
'ReadErr.aed'
This script takes no arguments. It is the only one that contains
any AmokEd-specific commands (apart from 'Oberon-A.aedrc'). These
are concentrated in two areas: one to locate the name of the
module, and one to insert the error reports in the file. The rest
of the script is pure ARexx.
The script reads the first four bytes of the error file. If it
finds the 'OAER' tag, it assumes the error file is in binary format
and calls OEL to process the errors. The output of OEL is
redirected to a temporary file, which is displayed in a new window.
If there is no tag, it is assumed that the error file is in human-
readable format as produced by the compiler's TEXTERR option.