home *** CD-ROM | disk | FTP | other *** search
Modula Definition | 1996-06-21 | 2.9 KB | 83 lines | [TEXT/MEDT] |
- DEFINITION MODULE ScanProfile;
-
- (*******************************************************************
-
- Module ScanProfile (Version 1.0)
-
- Copyright ©1991 by Andreas Fischlin and Swiss
- Federal Institute of Technology Zürich ETHZ
-
- Version written for:
- MacMETH_V3.2 (1-Pass Modula-2 implementation)
-
- Purpose Allows to analyze and to retrieve values from
- the so-called User.Profile to customize the
- user environment.
-
- Remarks The User.Profile is a simple text file, which
- may edited by means of any text editor. Typically
- it consists of several sections containing values
- assocated with particular key words. The EBNF:
-
- START = { section } EOF.
- section = key { key [string] value }.
- key = string.
- value = string.
- string = word | ( "'" charThread "'" ) | ( '"' charThread '"' ).
- word = char {char}. char > " " (ASCII ordering)
- charThread = char {char}. char >= " " (ASCII ordering)
-
- where
- visChar = any character > " " (ASCII ordering)
- EOF means End Of File.
-
- Example: 2 sections, a "System" and an "Alias" section.
- The first specifies values (keep, resp. nokeep) for
- the keys 'Compiler' and 'Editor'. The second
- section specifies the string 'MyEdit 1.2' as an
- alias for the key 'Editor2'.
-
- "System"
- 'Compiler' keep
- 'Editor' nokeep
-
- "Alias"
- 'Editor2' = 'MyEdit 1.2'
-
- Programming
-
- • Design
- A. Fischlin 6/2/92
-
- • Implementation
- A. Fischlin 6/2/92
-
-
- Swiss Federal Institute of Technology Zurich ETHZ
- Department of Environmental Sciences
- Systems Ecology Group
- ETH-Zentrum
- CH-8092 Zurich
- Switzerland
-
- Last revision of definition: 6/2/92 AF
-
- *******************************************************************)
-
-
- PROCEDURE GetValue(sectionKey, key: ARRAY OF CHAR; skipNextStr: BOOLEAN;
- VAR valueStr: ARRAY OF CHAR);
- (* Scan and find in the user profile the section marked with
- sectionKey, then the entry marked with key key, and return the
- next string following the key in valueStr. In case skipNextStr
- is TRUE, don't return the next, but the second next string. For
- EBNF see above. *)
-
- PROCEDURE SetProfileName (fn: ARRAY OF CHAR);
- (* Override the profile's current file name with fn *)
- PROCEDURE ResetProfileName;
- (* Resets the profile's file name to its initial default
- 'User.Profile' *)
-
- END ScanProfile.
-