[project @ 1998-12-02 13:17:09 by simonm]
[ghc-hetmet.git] / ghc / interpreter / charset.h
1 /* --------------------------------------------------------------------------
2  * Character set handling:
3  *
4  * Hugs follows Haskell 1.3 in assuming that input uses the ISO-8859-1
5  * character set.  The following code provides methods for classifying
6  * input characters according to the lexical structure specified by the
7  * report.  Hugs should still accept older programs because ASCII is
8  * essentially just a subset of the ISO character set.
9  *
10  * Notes: If you want to port Hugs to a machine that uses something
11  * substantially different from the ISO character set, then you will need
12  * to insert additional code to map between character sets.
13  *
14  * Relies, implicitly but for this comment, on assumption that NUM_CHARS=256.
15  * ------------------------------------------------------------------------*/
16
17 extern  unsigned char   ctable[NUM_CHARS];
18
19 #define isIn(c,x)       (ctable[(Int)(c)]&(x))
20 #define isISO(c)        (0<=(c) && (c)<NUM_CHARS)
21
22 #define DIGIT           0x01
23 #define SMALL           0x02
24 #define LARGE           0x04
25 #define SYMBOL          0x08
26 #define IDAFTER         0x10
27 #define SPACE           0x20
28 #define PRINT           0x40
29
30 extern Void local initCharTab Args(( Void ));
31