Annotation of 43BSD/contrib/emacs/src/syntax.h, revision 1.1.1.1

1.1       root        1: /* Declarations having to do with GNU Emacs syntax tables.
                      2:    Copyright (C) 1985 Richard M. Stallman.
                      3: 
                      4: This file is part of GNU Emacs.
                      5: 
                      6: GNU Emacs is distributed in the hope that it will be useful,
                      7: but WITHOUT ANY WARRANTY.  No author or distributor
                      8: accepts responsibility to anyone for the consequences of using it
                      9: or for whether it serves any particular purpose or works at all,
                     10: unless he says so in writing.  Refer to the GNU Emacs General Public
                     11: License for full details.
                     12: 
                     13: Everyone is granted permission to copy, modify and redistribute
                     14: GNU Emacs, but only under the conditions described in the
                     15: GNU Emacs General Public License.   A copy of this license is
                     16: supposed to have been given to you along with GNU Emacs so you
                     17: can know your rights and responsibilities.  It should be in a
                     18: file named COPYING.  Among other things, the copyright notice
                     19: and this notice must be preserved on all copies.  */
                     20: 
                     21: 
                     22: extern Lisp_Object Qsyntax_table_p;
                     23: extern Lisp_Object Fsyntax_table_p (), Fsyntax_table (), Fset_syntax_table ();
                     24: 
                     25: extern Lisp_Object Vstandard_syntax_table;
                     26: 
                     27: /* A syntax table is a Lisp vector of length 0400, whose elements are integers.
                     28: 
                     29: The low 8 bits of the integer is a code, as follows:
                     30: */
                     31: 
                     32: enum syntaxcode
                     33:   {
                     34:     Swhitespace, /* for a whitespace character */
                     35:     Spunct,     /* for random punctuation characters */
                     36:     Sword,      /* for a word constituent */
                     37:     Ssymbol,    /* symbol constituent but not word constituent */
                     38:     Sopen,      /* for a beginning delimiter */
                     39:     Sclose,      /* for an ending delimiter */
                     40:     Squote,     /* for a prefix character like Lisp ' */
                     41:     Sstring,    /* for a string-grouping character like Lisp " */
                     42:     Smath,      /* for delimiters like $ in Tex. */
                     43:     Sescape,    /* for a character that begins a C-style escape */
                     44:     Scharquote,  /* for a character that quotes the following character */
                     45:     Scomment,    /* for a comment-starting character */
                     46:     Sendcomment, /* for a comment-ending character */
                     47:     Smax        /* Upper bound on codes that are meaningful */
                     48:   };
                     49: 
                     50: #define SYNTAX(c) \
                     51:   ((enum syntaxcode) (XINT (bf_cur->syntax_table_v->contents[c]) & 0377))
                     52: 
                     53: /* The next 8 bits of the number is a character,
                     54:  the matching delimiter in the case of Sopen or Sclose. */
                     55: 
                     56: #define SYNTAX_MATCH(c) \
                     57:   ((XINT (bf_cur->syntax_table_v->contents[c]) >> 8) & 0377)
                     58: 
                     59: /* Then there are four single-bit flags that have the following meanings:
                     60:   1. This character is the first of a two-character comment-start sequence.
                     61:   2. This character is the second of a two-character comment-start sequence.
                     62:   3. This character is the first of a two-character comment-end sequence.
                     63:   4. This character is the second of a two-character comment-end sequence.
                     64:  Note that any two-character sequence whose first character has flag 1
                     65:   and whose second character has flag 2 will be interpreted as a comment start. */
                     66: 
                     67: #define SYNTAX_COMSTART_FIRST(c) \
                     68:   ((XINT (bf_cur->syntax_table_v->contents[c]) >> 16) & 1)
                     69: 
                     70: #define SYNTAX_COMSTART_SECOND(c) \
                     71:   ((XINT (bf_cur->syntax_table_v->contents[c]) >> 17) & 1)
                     72: 
                     73: #define SYNTAX_COMEND_FIRST(c) \
                     74:   ((XINT (bf_cur->syntax_table_v->contents[c]) >> 18) & 1)
                     75: 
                     76: #define SYNTAX_COMEND_SECOND(c) \
                     77:   ((XINT (bf_cur->syntax_table_v->contents[c]) >> 19) & 1)
                     78: 
                     79: /* This array, indexed by a character, contains the syntax code which that
                     80:  character signifies (as a char).  For example,
                     81:  (enum syntaxcode) syntax_spec_code['w'] is Sword. */
                     82: 
                     83: extern char syntax_spec_code[0400];

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.