C+ C Title: IPCOMM C Author: T. R. Wyant C Date: 05-Sep-84 C Modified: C Remarks: C IPCOMM describes the common area required for the C Fortran parser package IPARSE. This package is C intended to provide much of the functionality of C the TPARS package, in a Fortran environment. The C IPARSE code would be invoked as follows: C C Load the common as follows: C IPBUF - The string you want parsed. C IPSLEN - The length of the string. C IPSLOC - 1. C IPSKFG - .TRUE. if you want to skip blanks and C tabs when parsing; .FALSE. if C you want to treat them as syntax C elements. C C Code the parsing subroutines as needed. Each subroutine C returns a value of .TRUE. if it finds its expected C syntax type at the current location, and updates the C current string location. C C The subroutines in this package are: C C IPALFA(MXLEN) ! Alphabetic match. C MXLEN is the max. string len. (0 = none). C C IPANUM(MXLEN) ! Alphanumeric match. C MXLEN is the max. string len. (0 = none). C C IPANY() ! Match any character. C False only if at EOS. IPMCH gets the character. C C IPCHAR(CHAR) ! Character match. C CHAR is the LOGICAL*1 character to match. C If IPCHAR is true, the matching character is returned C in IPMCH; if IPCHAR is .FALSE., IPMCH is C unaffected. C C IPEOS() ! End-of-string match. C C IPMSET(MXLEN,BITMSK) ! Character set match. C MXLEN is the max. string len. (0 = none). C BITMSK as an INTEGER*2 array, 8 words long. The bits C in the array correspond to the acceptable C characters. C C IPNUM(IRDIX) ! Unsigned number match. C IRDIX is the radix of the number, in the range 2 to 36. C If IRDIX is negated, IPNUM will match a null C string (which is interpreted as a zero). C If IPNUM is .TRUE., the INTEGER*4 value of the number C is returned in IPVALU. If IPNUM is .FALSE., C IPVALU is unaffected. C C IPR50(MXLEN) ! RAD-50 match. C MXLEN is the max. string len. (0 = none). C C IPSTR(LEN,STRING,MINABR) ! String match. C LEN is the number of characters in the string. C STRING is the ASCII string to match. C MINABR is the minimum abbreviation. If zero, an C exact match is required. C C If any of the above returns .TRUE., IPLOC will contain the C location of the current syntax element, and IPLEN C will contain its length. If the return is .FALSE., C IPLOC contains the current string location, and C IPLEN is zero. C- PARAMETER IPBLEN = 256 ! Buffer length. INTEGER*2 IPALFA ! Alphabetic match. INTEGER*2 IPANUM ! Alphanumeric match. INTEGER*2 IPCHAR ! Character match. INTEGER*2 IPEOS ! End-of-string match. INTEGER*2 IPMSET ! Character set match. INTEGER*2 IPNUM ! Unsigned number match. INTEGER*2 IPR50 ! RAD-50 match. INTEGER*2 IPSTR ! String match. INTEGER*2 IPLEN ! Length of syntax element. INTEGER*2 IPLOC ! Location of syntax element. INTEGER*2 IPSLEN ! Bytes remaining to parse. INTEGER*2 IPSLOC ! Current location in buffer. INTEGER*2 IPSKFG ! .TRUE. to skip blanks and tabs INTEGER*4 IPVALU ! Value of current number. LOGICAL*1 IPBUF(IPBLEN) ! Data buffer. LOGICAL*1 IPMCH ! Char matched by IPCHAR, IPANY. COMMON /IPCOMM/ IPLEN,IPLOC,IPSLEN,IPSLOC, 1 IPSKFG,IPVALU,IPBUF,IPMCH