Category : Modula II Source Code
Archive   : PATTERN.ZIP
Filename : FAINPUT.TXT

 
Output of file : FAINPUT.TXT contained in archive : PATTERN.ZIP



N.Kitiyakara FAInput


DEFINITION MODULE FAInput;
(*
This module provides the character level input for both DFAPattern
and NFAPattern. It uses a double buffer input system to hold lex-
emes of up to 1024 characters in length. Care should be taken
when altering the current position, as it may confuse the pattern
matching modules. Only one file may be in use at a time.
*)

TYPE
Position;
(*
This type is used to denote a position in the input buffer. It may
be used to hold a place while implementing a look-ahead operator,
or something of that nature.
*)

PROCEDURE BackTrackPosition (VAR pos : Position);
(*
This procedure may be used to move the given Position variable one
unit to the left. It does not, however, affect the current posi-
tion in the input buffer.
*)

PROCEDURE CloseInputFile;
(*
This procedure closes the file from which input is taken. If it is
called when there is no current input file, the program will ter-
minate with an appropriate error.
*)

PROCEDURE DeterminePosition (VAR pos : Position);
(*
Returns the current position in the input buffer.
*)

PROCEDURE OpenInputFile (name : ARRAY OF CHAR; VAR done : BOOLEAN);
(*
This procedure is used to open the input file. If an error occurs,
'done' will be FALSE, and no input will take place. If there is
already an open input file, the program will terminate with an ap-
propriate error.
*)

PROCEDURE NextChar () : CHAR;
(*
This procedure returns the next character in the input file, advanc-
ing the current position. If an attempt to read beyond the end of
the file is made, 32C (the MS-DOS end of file marker) will be re-
turned.
*)






FAInput - 1





N.Kitiyakara FAInput


PROCEDURE ReturnLexeme (start,end : Position; VAR lex : ARRAY OF CHAR);
(*
Returns the lexeme starting at position 'start' and ending at the
position one character before 'end.'
*)

PROCEDURE SetPosition (pos : Position);
(*
Sets the current position in the input buffer. If an invalid posi-
tion is set, the program will probably crash when one of the pat-
tern matchers attempts to read from the input.
*)
END FAInput.












































FAInput - 2


  3 Responses to “Category : Modula II Source Code
Archive   : PATTERN.ZIP
Filename : FAINPUT.TXT

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/