Using Alternative Compilers

In order to create program object items that will run on an earlier Northgate system, you need to use a different compiler from that provided by the default version of the BASIC command. This topic describes the compilers available and how to load and use them.

Overview

Alternative compilers are held in the file BASIC-COMPILERS. They create object items that will run on their target release, and on any equivalent or earlier release. However, they only recognise and compile DataBasic elements that are part of the subset defined for the target release.

There are two reasons why you might want to use an alternative compiler:

The following compilers are provided with Reality V14.0:

Compiler Reality version
BASIC*14 V14.0
BASIC*11 (default) V11.0, V12.0
BASIC*10 V10.0
BASIC*09 V9.1
BASIC*08 V9.0 and earlier

Procedure

To use compilers other than the default, or to change the default, logon to the SYSPROG account and do the following:

  1. Select a compiler. First list the items in BASIC-COMPILERS,OPTOM and in BASIC-COMPILERS (default data section). BASIC-COMPILERS,OPTOM contains object items for the available compilers. Their item-ids indicate the main release for which they are suitable. BASIC-COMPILERS contains loaded compilers together with synonym items (showing Q in attribute 1) whose item-ids indicate other releases for which the associated OPTOM item (shown in attribute 2) is suitable.
  2. If the compiler you need is not already loaded (the corresponding OPTOM item is not present in the default section of BASIC-COMPILERS), load it using the LOAD-BNF command as follows:

    LOAD-BNF BASIC-COMPILERS,OPTOM compiler
    DESTINATION FILE: BASIC-COMPILERS

    where compiler is the item-id of the OPTOM item. For example, BASIC*SEQUEL*1.2 is suitable for compiling programs to run on systems with REALITY Release 1.2/4.3 (in fact, this compiler should also be used to compile for any earlier release).

  3. Once the required compiler is loaded, you can run it as follows:

    • For frequent use, create a new command to run it. To do this, copy the BASIC MD item to a new item with a suitable name (such as OLD-BASIC). Modify attribute 1 of this item to change the 'tag' (the character B) to some other single character (not G, O, or Q). For example, change attribute 1 from PB to PX. Now create an item in BASIC-COMPILERS with the new tag as its item-id, Q as attribute 1, and the item-id of the loaded compiler item in attribute 2. For example:

          X
      001 Q
      002 BASIC*SEQUEL*1.2

      You can now use the new command to compile using the selected compiler.

    • For infrequent use, use the BASIC command with option C. See below for a description of syntax and prompts.

      Note: If you are using Procs or programs to drive multiple compilers, you should also use BASIC with option C so that you can specify exactly which compiler will be used.

Default Compiler

To change the default compiler for the database or system, edit item BASIC*DEFAULT in BASIC-COMPILERS to replace the contents of attribute 2 with the item-id of the loaded compiler item required. The standard BASIC command will then call that compiler.

Using the BASIC Command with the C option

To use an alternative DataBasic compiler, enter the BASIC command with the C option as shown below:

BASIC file-name prog-name (C

file-name is the name of the file that contains the program you want to compile.

prog-name is the name of the program you want to compile.

(C prompts for the compiler name.

At the prompt

Compiler name :

enter the name of the compiler you want to use. The names of the compilers are listed in the BASIC-COMPILERS file. For example, at the Compiler name prompt, enter:

BASIC*SEQUEL*1.2    for SEQUEL 1.2 and REALITY 4.2 systems
BASIC*ROS*7.0       for systems on Release 7.0 
BASIC*SPIRIT*2.2    for SPIRIT 2.2 systems

Previous Releases

On RealityX 3.1 loaded compilers are stored in POINTER-FILE, and alternative compilers are made available by using the LOADBNF command to create a new command to execute the chosen compiler. The LOADBNF command is not available on Release 4.0 and later.

Go to top button