Index Page
lxidnt
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 

Procedure
Abstract
Required_Reading
Keywords
Declarations
Brief_I/O
Detailed_Input
Detailed_Output
Parameters
Exceptions
Files
Particulars
Examples
Restrictions
Literature_References
Author_and_Institution
Version

Procedure

      LXIDNT ( Lex identifer )
 
      ENTRY LXIDNT ( IDSPEC, STRING, FIRST, LAST, NCHAR )
 

Abstract

     Lex (scan) an identifer,  starting from a specified character
     position.

Required_Reading

     None.

Keywords

     CHARACTER
     PARSING
     SCANNING
     STRING
     UTILITY

Declarations

     INTEGER               LBCELL
     PARAMETER           ( LBCELL = -5 )
 
     INTEGER               IDSPEC ( LBCELL : * )
     CHARACTER*(*)         STRING
     INTEGER               FIRST
     INTEGER               LAST
     INTEGER               NCHAR

Brief_I/O

     Variable  I/O  Description
     --------  ---  --------------------------------------------------
     IDSPEC     I   Identifier character specification.
     STRING     I   String to be scanned.
     FIRST      I   Character position at which to start scanning.
     LAST       O   Character position of end of token.
     NCHAR      O   Number of characters in token.
     LBCELL     P   The SPICELIB cell lower bound.

Detailed_Input

     IDSPEC         is an integer cell containing a specification of
                    the head and tail identifier character sets to be
                    used in scanning the input argument STRING.  IDSPEC
                    should be obtained by calling LXDFID or LXCSID.
                    The structure of IDSPEC is not part of the
                    specification of this routine suite and should not
                    be relied upon by calling code.

     STRING         is a character string that may contain an
                    `identifier' starting at the character position
                    indicated by the input argument FIRST (see
                    below).  Identifier tokens are sequences of
                    characters that represent names.  Syntactically, an
                    identifier is a sequence of characters that begins
                    with a character belonging to a set of valid `head'
                    characters and is followed by zero or more
                    characters belonging to a set of valid `tail'
                    characters.

     FIRST          is the character position at which the routine
                    is to start scanning an identifier.  Note
                    that the character STRING(FIRST:FIRST) must be a
                    valid head character if an identifier is to
                    be found; this routine does *not* attempt to locate
                    the first identifier following the position
                    FIRST.

Detailed_Output

     LAST           is the last character position such that the
                    substring STRING(FIRST:LAST) is an identifier, if
                    such a substring exists.  Otherwise, the
                    returned value of LAST is FIRST-1.

     NCHAR          is the length of the identifier found by this
                    routine, if such a token exists.  If an identifier
                    is not found, the returned value of NCHAR is
                    zero.

Parameters

     LBCELL         is the SPICELIB cell lower bound.

Exceptions

     Error free.

     1) If the input argument FIRST is less than 1 or greater than
        LEN(STRING)-1, the returned value of LAST is FIRST-1, and the
        returned value of NCHAR is zero.

Files

     None.

Particulars

     The default syntax rules for valid identifiers are specified in
     the $Particulars section of the umbrella routine LXNAME.  These
     rules may be overridden by calling LXCSID.

Examples

     See the $Examples section of the umbrella routine LXNAME.

Restrictions

     None.

Literature_References

     None.

Author_and_Institution

     N.J. Bachman       (JPL)
     B.V. Semenov       (JPL)

Version

    Beta Version 1.0.1, 10-FEB-2014 (BVS)

        Added LBCELL to the Declarations, Brief_I/O, and Parameters
        sections.

    Beta Version 1.0.0, 25-OCT-1995 (NJB)
Tue Jul 15 14:24:36 2014