PARSING


Function

Parsing contains procedures for reading formatted input files.

This module is used by the DYNAMO library in most of the cases where a formatted input file is read.

Dependencies

Module Variables
DEFINITIONS DP, LINE_LENGTH, MAX_UNITS
IO_UNITS OUTPUT
STATUS ERROR
STRING DECODE_INTEGER, DECODE_LOGICAL, DECODE_REAL, TO_UPPER_CASE


Public Variables

There are two public variables in this module.

Variable Type Purpose
WRDLEN Integer The length of the currently parsed word.
WORD Character ( Len = LINE_LENGTH ) The currently parsed word.


Public Procedures

There are a single public function and seven public subroutines in this module.

Function Type Purpose
EMPTY Logical Check to see whether the current input line has been fully parsed.


SubroutinePurpose
GET_INTEGER Interpret the next word on the input line as an integer.
GET_LINE Read in the next line from the input file and process it.
GET_REAL Interpret the next word on the input line as a real number.
GET_WORD Put the next word on the input line into WORD.
PARSE_ERROR Handle an error during the parsing of an input line.
POP_UNIT Remove a stream from the top of the input stream stack.
PUSH_UNIT Add a new stream number to top of the input stream stack.


EMPTY

This function has no arguments.



GET_INTEGER

Argument Type Intent Optional Purpose
NUMBER Integer Out No The integer to be returned by parsing the next word on the current input line.




GET_LINE

Argument Type Intent Optional Purpose
END_OF_FILE Logical Out Yes A flag to indicate whether the end of the current input file has been reached.


Error Meaning
I/O Error. There has been an error reading the next line from the current input file.
End of file reached. There are no more lines in the current input file and the END_OF_FILE argument was not specified.




GET_REAL

Argument Type Intent Optional Purpose
NUMBER Real Out No The real number to be returned by parsing the next word on the current input line.




GET_WORD

There are no arguments for this subroutine.



PARSE_ERROR

Argument Type Intent Optional Purpose
ROUTINE Character In No The name of the procedure from which PARSE_ERROR is called.
MESSAGE Character In No The error message to be printed.




POP_UNIT

There are no arguments for this subroutine.



PUSH_UNIT

Argument Type Intent Optional Purpose
STREAM Integer In No The stream number to be added to the top of stack.




Stability

Stable.



Back to the DYNAMO Home-Page.