Parameters

In the grammar, there can be two types of parameters: positional and keyword. Any positional parameters must come before the keywords.

Input strings must either match characters or match character types, depending on the type of parameter in the grammar. In the grammar, characters are letters (A-Z) or digits (0-9), and character types are a, c, d, u, w, x, *, and +, which are described later in this section. The sections on positional parameters and keyword parameters explain how matching characters and character types are used by the grammar for the parameter.

The following are general rules for parameters in the grammar:
  • Define optional parameters in opening and closing brackets: ([]).
    Example:
    Grammar: [C,A]
    Input strings of C,A or nothing
  • Define alternative parameters in opening and closing braces ({}), with a vertical bar (|) being used to delimit the choices. Exactly 1 parameter must be selected for the input string.
    Example:
    Grammar: {A|B}
    Input strings must be either: A or B, but not both
  • Use either a blank ( ), a comma (,), or a slash (/) to delimit parameters.

    A period (.) can be used to delimit parameters that use character types.

    The parser deletes multiple delimiters between parameters. The syntax does not include a null positional parameter.

    Examples:
      A B,C        contains 3 parameters A, B and C
      A , B        contains 2 parameters A and B
      A ,, B       contains 2 parameters A and B.
  • A parameter:
    • Can be abbreviated.

      In the grammar, leading uppercase letters indicate that they must be matched in the input string, and trailing lowercase letters indicate that they are optional for the input string. If you are creating a grammar for a parameter with matching characters, always begin it with an uppercase letter. (In the input string, all letters must be entered in uppercase unless the IPRSE_MIXED_CASE option is specified.)

    • Can be an alphanumeric character string of any length.
    • Can be restricted to the following character types:
      a
      Accepts one alphanumeric character, including uppercase letters (A-Z), digits (0-9), and underscores (_). If the IPRSE_MIXED_CASE option is specified, a also accepts lowercase letters (a-z).
      c
      Accepts one uppercase letter (A-Z). If the IPRSE_MIXED_CASE option is specified, c also accepts lowercase letters (a-z).
      d
      Accepts one decimal digit (0-9).
      n
      Accepts one uppercase letter (A-Z), one decimal digit (0-9), or one of the “national” characters: at sign (@), pound sign (#) or dollar sign ($). If the IPRSE_MIXED_CASE option is specified, n also accepts lowercase letters (a-z).
      u
      Accepts one character of unrestricted type, that is, any character that does not have special meaning for input strings (see Special characters for input string syntax). The characters that have special meaning for input strings when the IPRSE_NOSTRICT option is specified are: period (.), dash (-), equal sign (=), comma (,), slash (/), and spaces. The characters that have special meaning for input strings when the IPRSE_STRICT option is specified are: period (.), dash (-), and spaces.

      Unlike w, u treats asterisks (*) the same as any other character; asterisks in the input string must match us in the grammar one-for-one.

      w
      Accepts one alphanumeric character, the same as the a character type (with the IPRSE_MIXED_CASE option controlling whether or not w accepts lowercase letters). In addition, w can accept one asterisk (*).

      An asterisk (*) in the input string behaves as a wildcard character. In the input string, one asterisk can match any number of w character types in the grammar. If w is coded in a grammar, it cannot be followed by a different character type.

      x
      Accepts one hexadecimal digit (0-F or 0-f).
      *
      After a character type indicates that the character type can be optionally repeated as many times as needed. A * cannot be followed by any other character type. If a grammar parameter begins with *, it matches character type a.
      +
      After a character type indicates that the character type can be optionally repeated as many times as the plus sign (+) appears. A + cannot be followed by any other character type except for another +. If a grammar parameter begins with +, it matches character type a.
  • Parameters can have lists as their values: a regular or wildcard list.
    • A regular list is defined in a grammar by concatenating 2 strings that are made from character types, with a period in between.
      An example of parameters in a list follows:
      Grammar:  ccccccc.ddddd
      Input String:   WARNING.12225
    • A wildcard list is defined in a grammar by enclosing a character type string in parentheses, followed by an asterisk. A wildcard list accepts an input list consisting of any number of strings, each of which matches the character type string, separated by periods (.).
      An example of a wildcard list follows:
      Grammar:   (ccccc)*
      Input String:   PARMA.PARMB.PARMC
    The components of a list can be arbitrarily long when the + or * matching character is coded in a list grammar. You can restrict the total length of a list to a maximum length by coding a colon (:) followed by the maximum length at the end of the grammar for the list parameter. For example, the following grammar:
    a*.a*:20
    accepts an input string consisting of two alphanumeric strings separated by a period. Each alphanumeric string may be of any length as long as the total length of the input list does not exceed 20 characters.
    Similarly, the following grammar:
    (a*)*:42
    accepts an input string consisting of any number of alphanumeric strings separated by periods, as long as the total length of the input list does not exceed 42 characters.