Go to the first, previous, next, last section, table of contents.


Syntax Table Internals

Lisp programs don't usually work with the elements directly; the Lisp-level syntax table functions usually work with syntax descriptors (see section Syntax Descriptors). Nonetheless, here we document the internal format.

Each element of a syntax table is a cons cell of the form (syntax-code . matching-char). The CAR, syntax-code, is an integer that encodes the syntax class, and any flags. The CDR, matching-char, is non-nil if a character to match was specified.

This table gives the value of syntax-code which corresponds to each syntactic type.

IntegerClassIntegerClassIntegerClass 0 whitespace 5 close parenthesis 10 character quote 1 punctuation 6 expression prefix 11 comment-start 2 word 7 string quote 12 comment-end 3 symbol 8 paired delimiter 13 inherit 4 open parenthesis 9 escape 14 comment-fence 15 string-fence

For example, the usual syntax value for `(' is (4 . 41). (41 is the character code for `)'.)

The flags are encoded in higher order bits, starting 16 bits from the least significant bit. This table gives the power of two which corresponds to each syntax flag.

PrefixFlagPrefixFlagPrefixFlag`1'(lsh 1 16)`3'(lsh 1 18)`p'(lsh 1 20)`2'(lsh 1 17)`4'(lsh 1 19)`b'(lsh 1 21)


Go to the first, previous, next, last section, table of contents.