![]() |
Section 8.10.3.10: |
![]() |
This class implements a source of logical text lines from which all comments, blank lines and escaped linemarks have been eliminated. A further source of conditional pre-processing is available to eliminate unwanted lines. This is done in a similar manner to the pre-processing of 'if', 'elseif' etc directives done by the C language compiler pre-processing pass.
The following reader routine shall be provided -
This creation routine presumes that the string argument is the name of a file to be opened as source for text data.
This routine attempts to open the file with the given name for reading and, if successful, reads its contents and closes the file. If the file is not found or may not be read then void is returned after issuing an error message.
This creation routine presumes that the file path identifies the file to be opened as source for text data.
This routine attempts to open the file with the given path for reading and, if successful, reads its contents and closes the file. If the file is not found or may not be read then void is returned after issuing an error message.
This creation routine presumes that the file path identifies the file which has been passed as the source for data.
This routine assumes that the given path is the source name of the open file presented as the first argument. In creating the source the file given is closed.
This routine returns the value most recently set for the start of line comment string.
Since a default value is provided on creation, the pre-condition is vacuously true.
This routine returns the string currently in use as the start of line comment marker.
This routine sets its argument as the start of line comment for further use until a subsequent call of this routine.
comment | ( |
chars : STR | |
) |
This routine establishes the first two characters of the argument as the comment characters to be used henceforth in analysing this source text.
This routine returns the value most recently set for the escape character.
Since a default value is provided on creation, the pre-condition is vacuously true.
This routine returns the character currently in use as the escape character.
This routine sets its argument as the escape character for further use until a subsequent call of this routine.
This routine establishes the argument character as the escape character to be used henceforth in analysing this source text.
This predicate returns true if and only if there are no more text lines in the source.
Since this is a predicate, the pre-condition is true.
This predicate returns true if and only if there are no more lines to be returned from this source, otherwise false.
This iter yields a cursor indicating the next logical line in self. All blank and comment lines are removed and an escaped line-mark is ignored, allowing text to flow on as a continuation of what preceded it.
Note that the formal name of the iter has been changed to replace the exclamation mark iter symbol to a name acceptable to vdm tools.
This iter effectively has a true pre-condition since it has no arguments. If the iter is called after the last line has been yielded than, of course, it quits.
This post-condition makes use of the history concept from vdm++ (see the vdm dialect notes).
For quit actions see the specification of the quit statement.
This iter assembles one or more source lines into a logical line without conditional pre-processing, omitting comment lines and blank lines - stripping unwanted line marks at the end as necessary.
This routine returns a cursor indicating the next logical line in self. All blank and comment lines are removed and an escaped line-mark is ignored, allowing text to flow on as a continuation of what preceded it.
This routine assembles and returns one or more source lines into a logical line without conditional pre-processing, omitting comment lines and blank lines - stripping unwanted line marks at the end as necessary.
This iter yields a cursor indicating the next logical line in self. All blank and comment lines are removed and an escaped line-mark is ignored, allowing text to flow on as a continuation of what preceded it. Pre-processing is carried out on the source in accordance with the semantics defined for the pre-processing tags in the class CONDITIONALS.
Note that the formal name of the iter has been changed to replace the exclamation mark iter symbol to a name acceptable to vdm tools.
This iter effectively has a true pre-condition since it has no arguments. If the iter is called after the last line has been yielded than, of course, it quits.
This post-condition makes use of the history concept from vdm++ (see the vdm dialect notes).
For quit actions see the specification of the quit statement.
This iter yields a sequence of logical lines, each formed by assembling one or more source lines into a logical line with conditional pre-processing as defined by the semantics attached to the pre-processing tags defined in the class CONDITIONALS, omitting comment lines and blank lines - stripping unwanted line marks at the end as necessary.
This routine returns the next single pre-processed line in the source. See the class CONDITIONALS for pre-processing details.
This routine assembles and returns one or more source lines into a logical line with conditional pre-processing as defined by the semantics attached to the pre-processing tags defined in the class CONDITIONALS, omitting comment lines and blank lines - stripping unwanted line marks at the end as necessary. If there is no more valid text in the source then void shall be returned.
![]() |
Language Index | ![]() |
Library Index | ![]() |
Input/Output Index |
Comments or enquiries should be made to
Keith
Hopper. Page last modified: Friday, 24 November 2000. |
![]() |