-------- SIMTEL20 Ada Software Repository Prologue ------------ -- -* -- Unit name : PARSER -- Version : 1.0 -- Author : Richard Conn -- : Texas Instruments, Ada Technology Branch -- : PO Box 801, MS 8007 -- : McKinney, TX 75069 -- DDN Address : RCONN at SIMTEL20 -- Copyright : (c) -- Date created : 21 July 85 -- Release date : 30 July 85 -- Last update : 30 July 85 -- Machine/System Compiled/Run on : DG MV10000 (ROLM ADE) and -- DEC VAX 11/785 (DEC Ada) -- -* --------------------------------------------------------------- -- -* -- Keywords : parser, generic parser, UNIX, ARGC, ARGV ----------------: -- -- Abstract : -- --| PARSER is a generic parser that functions in a manner similar to --| the ARGC/ARGV parser of UNIX. It contains one procedure, PARSE, --| which accepts a string as input and returns ARGC, a count of the number --| of tokens in the string, and ARGV, a vector of strings, each string --| containing a token. --| --| PARSER is instantiated with two strings (DEL for DELIMITER and --| DEL_TOKEN for DELIMITER_TOKEN). The DEL string is composed of characters --| which delimit each token (and are not a part of the token). All --| characters less than space are automatically delimiters, and the DEL --| string should contain at least one character (such as a space). --| DEL_TOKEN is a string composed of characters which delimit tokens and --| which are tokens themselves. If "=" is a DEL_TOKEN, for example, then --| "CAT= DOG" is composed of three tokens, "CAT", "=", and "DOG", where if --| "=" is a DEL, then "CAT= DOG" is composed of two tokens, "CAT" and "DOG". --| This assumes that the space character is a DEL. --| --| PARSER may also be instantiated with ARGC_LIMIT, which indicates the --| maximum number of tokens allowed. If this limit is exceeded, then the --| last ARGV token contains the remainder of the string. The default value --| of ARGC_LIMIT is 20. --| --| ARG_STRING_LENGTH is the last instantiation option for PARSER. It --| indicates the maximum length of an ARGV string, and it defaults to 80. --| -- -* ------------------ Revision history --------------------------- -- -* -- DATE VERSION AUTHOR HISTORY -- 19850730 1.0 Richard Conn Initial Release -- -* ------------------ Distribution and Copyright ----------------- -- -* -- This prologue must be included in all copies of this software. -- -- This software is released to the Ada community. -- This software is released to the Public Domain (note: -- software released to the Public Domain is not subject -- to copyright protection). -- Restrictions on use or distribution: NONE -- -* ------------------ Disclaimer --------------------------------- -- -* -- This software and its documentation are provided "AS IS" and -- without any expressed or implied warranties whatsoever. -- No warranties as to performance, merchantability, or fitness -- for a particular purpose exist. -- -- Because of the diversity of conditions and hardware under -- which this software may be used, no warranty of fitness for -- a particular purpose is offered. The user is advised to -- test the software thoroughly before relying on it. The user -- must assume the entire risk and liability of using this -- software. -- -- In no event shall any person or organization of people be -- held responsible for any direct, indirect, consequential -- or inconsequential damages or lost profits. -- -* -------------------END-PROLOGUE--------------------------------