Previous Previous chapter · Next Next chapter · Contents Table of Contents

Chapter 7 : PATTERNS AND PATTERN FUNCTIONS

The SNOBOL4 pattern matcher is called the "scanner." The "cursor" is the scanner's pointer into the subject string; it points between subject characters (no relation to your CRT cursor). It is initially zero when positioned to the left of the subject, and is incremented as the scanner moves to the right in the subject.

7.1 PRIMITIVE PATTERNS

These variables initially contain the primitive patterns of the same name. They may be set to other values by a program, and restored to their original value from the corresponding protected keywords. Altering these primitive patterns can produce very confusing programs, unless the new value encompasses the old, like this:
    ARB = &ARB . OUTPUT

7.2 PRIMITIVE PATTERN FUNCTIONS

These functions produce a pattern based on the argument supplied. The argument data type is shown below---other data types or expressions will be converted to the required type if possible.

Pattern functions may be combined with other primitive patterns, functions, and strings using the alternation and concatenation operators to produce larger patterns.


Previous Previous chapter · Next Next chapter · Contents Table of Contents