The scan table controls the behaviour of the reader. It can be modified to extend the syntax of PSL or to aid the writing of other parsers. This table contains information about the syntax of each character. It is possible to have several tables describing different syntaxes and to switch from one to another by binding the variable lispscantable*.
The table is a vector of 129 entries, indexed by 0 through 128. The first 128 entries correspond to ASCII character code. Each entry contains an integer between 0 and 21. The meaning of these numbers is given below.
DIGIT: indicates the character is a digit and gives the corresponding numeric value.
LETTER: indicates the character is alphabetic.
DELIMITER: indicates the character is a delimiter, the first character of a diphthong should not be classified as a delimiter.
COMMENT: indicates the character begins a comment, terminated by an end of line.
DIPHTHONG: indicates the character is a delimiter which may be the starting character of a diphthong. A diphthong is a two character sequence read as one token.
IDESCAPE: indicates that the character is an escape character, this character is used within id names to reference a character which is not a digit or alphabetic.
STRINGQUOTE: indicates that the character is used to delimit strings.
PACKAGE: indicates that the character is used to introduce explicit package names.
IGNORE: indicates that the character is to be ignored.
MINUS: indicates that the character represents a minus sign.
PLUS: indicates that the character represents a plus sign.
DECIMAL: indicates that the character represents a decimal point.
IDSURROUND: indicates that the character is to act for identifiers as a string quote for strings.
It may be tedious to insert an idescape character (!), before every delimiter character in the name of an id. By setting the type of a character (for example —), to idsurround this can be avoided. Every character between the vertical bars is taken as part of the ids name, as if ! were written before each. Note that !! corresponds to ! and !— to —.