Next: Programs
Up: The COMIS compiler
Previous: Declarations
Subsections
Arithmetic, logical and character string expressions
The following operations are available:
+ - * / ** //
.LT. or <
.LE. or <=
.EQ. or ==
.NE. or /=
.GE. or >=
.GT. or >
.OR. .AND. .NOT.
The logical operators .EQV. and .NEQV. are not included
in COMIS.
Control statements
Loops
DO loops with index and DO WHILE (logical expression) constructions
are provided.
Loops may have the DO-ENDDO or DO-OD forms or may be labeled
in a Fortran-like manner. For the indexed loops the index may be of
an integer or a real type only.
IF statements
COMIS supports both the standard F77 syntax
and a form ending in FI for the IF statement.
IF...[ELSEIF]...[ELSE]...ENDIF
or
IF...[ELESIF]...[ELSE]...FI
GOTO statements or GO
Jumps to constant labels, assigned GOTOs in connection with
ASSIGN statements, and computed GOTOs are provided.
F77 allows the use of a list with optional labels on an assigned GOTO statement;
this facility is not supported in COMIS.
CALL statement
This statement calls a user or a COMIS routine.
COMIS supports three forms of the CALL statement:
1. CALL subr_name [( arg_list)]
2. subr_name ( arg_list)
3.1 subr_name arg_list
3.2 subr_name;
where subr_name is the name of the subroutine which may be:
- an already defined COMIS routine;
- a user supplied routine: if no COMIS routine with the specified name
is found, then COMIS will search for a user routines with that
name (see also section 3.3).
The semi-colon character ``;'' is significant in case 3.2 above!
INCLUDE directive
An INCLUDE directive is available and has one of the following forms:
1. INCLUDE 'name'
2. INCLUDE name
When name is given between quotes (case 1. above),
then the name is taken literally, while in case 2.
the string name is converted to uppercase.
Note that COMIS does not allow recursive INCLUDE directives.
Other statements
- CONTINUE
- the short form of this statement is CON
- RETURN
- the short form of this statement is RET
- QUIT
- return from COMIS to application program
- END
- the short form of this statement is ``#''
Input/output statements
The full set of F77 input/output statements is implemented.
COMIS provides four types of input/output statements:
- Sequential input/output statements
- Direct access input/output statements
- List directed input/output statements
- Internal data set input/output statements.
A list of COMIS input/output source statements follows:
OPEN, WRITE, PRINT, READ, ENDFILE, BACKSPACE, REWIND, CLOSE, INQUIRE.
The COMIS extentions are:
- INPUT statement - input from a terminal in free format.
- TYPE statement - output to a terminal in free format.
FORMAT statement
The FORMAT statement has the form:
FORMAT( f1 [,f2 [,...,fn]])
where f1,f2,...,fn are format codes.
The current version of COMIS does not support
kP, S, SP, SS, BN and BZ edit descriptors.
The length of a format specification cannot exceed 256 characters.
INQUIRE statement
The INQUIRE statement has one of the forms:
INQUIRE(dsns,iflist)
INQUIRE( ns,iflist)
- dsns
- data set name specifier of the form FILE= dsn;
- ns
- data set reference number of the form UNIT= ns;
- iflist
- list as defined in Fortran 77.
You cannot omit UNIT=ns on a COMIS inquire statement.
INPUT statement or INP
The INPUT statement has the form
INPUT list
This statement inputs values from the terminal; the user is prompted
with the list element name.
If the user press a carriage return key, the current value is not
changed, otherwise the constant
typed in becomes the new value of a list element. If a list element value
is a constant then this constant is simply typed out.
TYPE statement
The TYPE statement has the form
TYPE list
This statement types values of the lists elements in free format.
Example:
If the user runs the next simple COMIS program:
CHARACTER A*4
J=1
INPUT 'CHARACTER *4',A, 'J HAS VALUE 1',J,Z
TYPE A,J,Z
END
The dialogue will be
'CHARACTER*4'
*C A=abcd<cr>
'J HAS VALUE 1'
*I J=<cr>
*R Z=3.14<cr>
*T A = ABCD J = 1 Z = 3.140000
Next: Programs
Up: The COMIS compiler
Previous: Declarations
Back to
CERN
| IT
| ASD
| CERN Program Library Home
MG
(last mod. 1998-08-19)