Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-19 09:47:48

0001 /*=============================================================================
0002     Copyright (c) 2001-2011 Hartmut Kaiser
0003     Copyright (c) 2001-2011 Joel de Guzman
0004 
0005     Distributed under the Boost Software License, Version 1.0. (See accompanying
0006     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0007 =============================================================================*/
0008 #if !defined(BOOST_SPIRIT_ISO8859_1_APRIL_26_2006_1106PM)
0009 #define BOOST_SPIRIT_ISO8859_1_APRIL_26_2006_1106PM
0010 
0011 #if defined(_MSC_VER)
0012 #pragma once
0013 #endif
0014 
0015 #include <climits>
0016 #include <boost/assert.hpp>
0017 #include <boost/cstdint.hpp>
0018 
0019 ///////////////////////////////////////////////////////////////////////////////
0020 // constants used to classify the single characters
0021 ///////////////////////////////////////////////////////////////////////////////
0022 #define BOOST_CC_DIGIT    0x0001
0023 #define BOOST_CC_XDIGIT   0x0002
0024 #define BOOST_CC_ALPHA    0x0004
0025 #define BOOST_CC_CTRL     0x0008
0026 #define BOOST_CC_LOWER    0x0010
0027 #define BOOST_CC_UPPER    0x0020
0028 #define BOOST_CC_SPACE    0x0040
0029 #define BOOST_CC_PUNCT    0x0080
0030 
0031 namespace boost { namespace spirit { namespace char_encoding
0032 {
0033     // The detection of isgraph(), isprint() and isblank() is done programmatically
0034     // to keep the character type table small. Additionally, these functions are
0035     // rather seldom used and the programmatic detection is very simple.
0036 
0037     ///////////////////////////////////////////////////////////////////////////
0038     // ISO 8859-1 character classification table
0039     //
0040     // the comments intentionally contain non-ascii characters
0041     // boostinspect:noascii
0042     ///////////////////////////////////////////////////////////////////////////
0043     const unsigned char iso8859_1_char_types[] =
0044     {
0045         /* NUL   0   0 */   BOOST_CC_CTRL,
0046         /* SOH   1   1 */   BOOST_CC_CTRL,
0047         /* STX   2   2 */   BOOST_CC_CTRL,
0048         /* ETX   3   3 */   BOOST_CC_CTRL,
0049         /* EOT   4   4 */   BOOST_CC_CTRL,
0050         /* ENQ   5   5 */   BOOST_CC_CTRL,
0051         /* ACK   6   6 */   BOOST_CC_CTRL,
0052         /* BEL   7   7 */   BOOST_CC_CTRL,
0053         /* BS    8   8 */   BOOST_CC_CTRL,
0054         /* HT    9   9 */   BOOST_CC_CTRL|BOOST_CC_SPACE,
0055         /* NL   10   a */   BOOST_CC_CTRL|BOOST_CC_SPACE,
0056         /* VT   11   b */   BOOST_CC_CTRL|BOOST_CC_SPACE,
0057         /* NP   12   c */   BOOST_CC_CTRL|BOOST_CC_SPACE,
0058         /* CR   13   d */   BOOST_CC_CTRL|BOOST_CC_SPACE,
0059         /* SO   14   e */   BOOST_CC_CTRL,
0060         /* SI   15   f */   BOOST_CC_CTRL,
0061         /* DLE  16  10 */   BOOST_CC_CTRL,
0062         /* DC1  17  11 */   BOOST_CC_CTRL,
0063         /* DC2  18  12 */   BOOST_CC_CTRL,
0064         /* DC3  19  13 */   BOOST_CC_CTRL,
0065         /* DC4  20  14 */   BOOST_CC_CTRL,
0066         /* NAK  21  15 */   BOOST_CC_CTRL,
0067         /* SYN  22  16 */   BOOST_CC_CTRL,
0068         /* ETB  23  17 */   BOOST_CC_CTRL,
0069         /* CAN  24  18 */   BOOST_CC_CTRL,
0070         /* EM   25  19 */   BOOST_CC_CTRL,
0071         /* SUB  26  1a */   BOOST_CC_CTRL,
0072         /* ESC  27  1b */   BOOST_CC_CTRL,
0073         /* FS   28  1c */   BOOST_CC_CTRL,
0074         /* GS   29  1d */   BOOST_CC_CTRL,
0075         /* RS   30  1e */   BOOST_CC_CTRL,
0076         /* US   31  1f */   BOOST_CC_CTRL,
0077         /* SP   32  20 */   BOOST_CC_SPACE,
0078         /*  !   33  21 */   BOOST_CC_PUNCT,
0079         /*  "   34  22 */   BOOST_CC_PUNCT,
0080         /*  #   35  23 */   BOOST_CC_PUNCT,
0081         /*  $   36  24 */   BOOST_CC_PUNCT,
0082         /*  %   37  25 */   BOOST_CC_PUNCT,
0083         /*  &   38  26 */   BOOST_CC_PUNCT,
0084         /*  '   39  27 */   BOOST_CC_PUNCT,
0085         /*  (   40  28 */   BOOST_CC_PUNCT,
0086         /*  )   41  29 */   BOOST_CC_PUNCT,
0087         /*  *   42  2a */   BOOST_CC_PUNCT,
0088         /*  +   43  2b */   BOOST_CC_PUNCT,
0089         /*  ,   44  2c */   BOOST_CC_PUNCT,
0090         /*  -   45  2d */   BOOST_CC_PUNCT,
0091         /*  .   46  2e */   BOOST_CC_PUNCT,
0092         /*  /   47  2f */   BOOST_CC_PUNCT,
0093         /*  0   48  30 */   BOOST_CC_DIGIT|BOOST_CC_XDIGIT,
0094         /*  1   49  31 */   BOOST_CC_DIGIT|BOOST_CC_XDIGIT,
0095         /*  2   50  32 */   BOOST_CC_DIGIT|BOOST_CC_XDIGIT,
0096         /*  3   51  33 */   BOOST_CC_DIGIT|BOOST_CC_XDIGIT,
0097         /*  4   52  34 */   BOOST_CC_DIGIT|BOOST_CC_XDIGIT,
0098         /*  5   53  35 */   BOOST_CC_DIGIT|BOOST_CC_XDIGIT,
0099         /*  6   54  36 */   BOOST_CC_DIGIT|BOOST_CC_XDIGIT,
0100         /*  7   55  37 */   BOOST_CC_DIGIT|BOOST_CC_XDIGIT,
0101         /*  8   56  38 */   BOOST_CC_DIGIT|BOOST_CC_XDIGIT,
0102         /*  9   57  39 */   BOOST_CC_DIGIT|BOOST_CC_XDIGIT,
0103         /*  :   58  3a */   BOOST_CC_PUNCT,
0104         /*  ;   59  3b */   BOOST_CC_PUNCT,
0105         /*  <   60  3c */   BOOST_CC_PUNCT,
0106         /*  =   61  3d */   BOOST_CC_PUNCT,
0107         /*  >   62  3e */   BOOST_CC_PUNCT,
0108         /*  ?   63  3f */   BOOST_CC_PUNCT,
0109         /*  @   64  40 */   BOOST_CC_PUNCT,
0110         /*  A   65  41 */   BOOST_CC_ALPHA|BOOST_CC_XDIGIT|BOOST_CC_UPPER,
0111         /*  B   66  42 */   BOOST_CC_ALPHA|BOOST_CC_XDIGIT|BOOST_CC_UPPER,
0112         /*  C   67  43 */   BOOST_CC_ALPHA|BOOST_CC_XDIGIT|BOOST_CC_UPPER,
0113         /*  D   68  44 */   BOOST_CC_ALPHA|BOOST_CC_XDIGIT|BOOST_CC_UPPER,
0114         /*  E   69  45 */   BOOST_CC_ALPHA|BOOST_CC_XDIGIT|BOOST_CC_UPPER,
0115         /*  F   70  46 */   BOOST_CC_ALPHA|BOOST_CC_XDIGIT|BOOST_CC_UPPER,
0116         /*  G   71  47 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0117         /*  H   72  48 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0118         /*  I   73  49 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0119         /*  J   74  4a */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0120         /*  K   75  4b */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0121         /*  L   76  4c */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0122         /*  M   77  4d */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0123         /*  N   78  4e */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0124         /*  O   79  4f */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0125         /*  P   80  50 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0126         /*  Q   81  51 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0127         /*  R   82  52 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0128         /*  S   83  53 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0129         /*  T   84  54 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0130         /*  U   85  55 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0131         /*  V   86  56 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0132         /*  W   87  57 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0133         /*  X   88  58 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0134         /*  Y   89  59 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0135         /*  Z   90  5a */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0136         /*  [   91  5b */   BOOST_CC_PUNCT,
0137         /*  \   92  5c */   BOOST_CC_PUNCT,
0138         /*  ]   93  5d */   BOOST_CC_PUNCT,
0139         /*  ^   94  5e */   BOOST_CC_PUNCT,
0140         /*  _   95  5f */   BOOST_CC_PUNCT,
0141         /*  `   96  60 */   BOOST_CC_PUNCT,
0142         /*  a   97  61 */   BOOST_CC_ALPHA|BOOST_CC_XDIGIT|BOOST_CC_LOWER,
0143         /*  b   98  62 */   BOOST_CC_ALPHA|BOOST_CC_XDIGIT|BOOST_CC_LOWER,
0144         /*  c   99  63 */   BOOST_CC_ALPHA|BOOST_CC_XDIGIT|BOOST_CC_LOWER,
0145         /*  d  100  64 */   BOOST_CC_ALPHA|BOOST_CC_XDIGIT|BOOST_CC_LOWER,
0146         /*  e  101  65 */   BOOST_CC_ALPHA|BOOST_CC_XDIGIT|BOOST_CC_LOWER,
0147         /*  f  102  66 */   BOOST_CC_ALPHA|BOOST_CC_XDIGIT|BOOST_CC_LOWER,
0148         /*  g  103  67 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0149         /*  h  104  68 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0150         /*  i  105  69 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0151         /*  j  106  6a */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0152         /*  k  107  6b */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0153         /*  l  108  6c */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0154         /*  m  109  6d */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0155         /*  n  110  6e */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0156         /*  o  111  6f */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0157         /*  p  112  70 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0158         /*  q  113  71 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0159         /*  r  114  72 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0160         /*  s  115  73 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0161         /*  t  116  74 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0162         /*  u  117  75 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0163         /*  v  118  76 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0164         /*  w  119  77 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0165         /*  x  120  78 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0166         /*  y  121  79 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0167         /*  z  122  7a */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0168         /*  {  123  7b */   BOOST_CC_PUNCT,
0169         /*  |  124  7c */   BOOST_CC_PUNCT,
0170         /*  }  125  7d */   BOOST_CC_PUNCT,
0171         /*  ~  126  7e */   BOOST_CC_PUNCT,
0172         /* DEL 127  7f */   BOOST_CC_CTRL,
0173         /* --  128  80 */   BOOST_CC_CTRL,
0174         /* --  129  81 */   BOOST_CC_CTRL,
0175         /* --  130  82 */   BOOST_CC_CTRL,
0176         /* --  131  83 */   BOOST_CC_CTRL,
0177         /* --  132  84 */   BOOST_CC_CTRL,
0178         /* --  133  85 */   BOOST_CC_CTRL,
0179         /* --  134  86 */   BOOST_CC_CTRL,
0180         /* --  135  87 */   BOOST_CC_CTRL,
0181         /* --  136  88 */   BOOST_CC_CTRL,
0182         /* --  137  89 */   BOOST_CC_CTRL,
0183         /* --  138  8a */   BOOST_CC_CTRL,
0184         /* --  139  8b */   BOOST_CC_CTRL,
0185         /* --  140  8c */   BOOST_CC_CTRL,
0186         /* --  141  8d */   BOOST_CC_CTRL,
0187         /* --  142  8e */   BOOST_CC_CTRL,
0188         /* --  143  8f */   BOOST_CC_CTRL,
0189         /* --  144  90 */   BOOST_CC_CTRL,
0190         /* --  145  91 */   BOOST_CC_CTRL,
0191         /* --  146  92 */   BOOST_CC_CTRL,
0192         /* --  147  93 */   BOOST_CC_CTRL,
0193         /* --  148  94 */   BOOST_CC_CTRL,
0194         /* --  149  95 */   BOOST_CC_CTRL,
0195         /* --  150  96 */   BOOST_CC_CTRL,
0196         /* --  151  97 */   BOOST_CC_CTRL,
0197         /* --  152  98 */   BOOST_CC_CTRL,
0198         /* --  153  99 */   BOOST_CC_CTRL,
0199         /* --  154  9a */   BOOST_CC_CTRL,
0200         /* --  155  9b */   BOOST_CC_CTRL,
0201         /* --  156  9c */   BOOST_CC_CTRL,
0202         /* --  157  9d */   BOOST_CC_CTRL,
0203         /* --  158  9e */   BOOST_CC_CTRL,
0204         /* --  159  9f */   BOOST_CC_CTRL,
0205         /*     160  a0 */   BOOST_CC_SPACE,
0206         /*  �  161  a1 */   BOOST_CC_PUNCT,
0207         /*  �  162  a2 */   BOOST_CC_PUNCT,
0208         /*  �  163  a3 */   BOOST_CC_PUNCT,
0209         /*  �  164  a4 */   BOOST_CC_PUNCT,
0210         /*  �  165  a5 */   BOOST_CC_PUNCT,
0211         /*  �  166  a6 */   BOOST_CC_PUNCT,
0212         /*  �  167  a7 */   BOOST_CC_PUNCT,
0213         /*  �  168  a8 */   BOOST_CC_PUNCT,
0214         /*  �  169  a9 */   BOOST_CC_PUNCT,
0215         /*  �  170  aa */   BOOST_CC_PUNCT,
0216         /*  �  171  ab */   BOOST_CC_PUNCT,
0217         /*  �  172  ac */   BOOST_CC_PUNCT,
0218         /*  �  173  ad */   BOOST_CC_PUNCT,
0219         /*  �  174  ae */   BOOST_CC_PUNCT,
0220         /*  �  175  af */   BOOST_CC_PUNCT,
0221         /*  �  176  b0 */   BOOST_CC_PUNCT,
0222         /*  �  177  b1 */   BOOST_CC_PUNCT,
0223         /*  �  178  b2 */   BOOST_CC_DIGIT|BOOST_CC_PUNCT,
0224         /*  �  179  b3 */   BOOST_CC_DIGIT|BOOST_CC_PUNCT,
0225         /*  �  180  b4 */   BOOST_CC_PUNCT,
0226         /*  �  181  b5 */   BOOST_CC_PUNCT,
0227         /*  �  182  b6 */   BOOST_CC_PUNCT,
0228         /*  �  183  b7 */   BOOST_CC_PUNCT,
0229         /*  �  184  b8 */   BOOST_CC_PUNCT,
0230         /*  �  185  b9 */   BOOST_CC_DIGIT|BOOST_CC_PUNCT,
0231         /*  �  186  ba */   BOOST_CC_PUNCT,
0232         /*  �  187  bb */   BOOST_CC_PUNCT,
0233         /*  �  188  bc */   BOOST_CC_PUNCT,
0234         /*  �  189  bd */   BOOST_CC_PUNCT,
0235         /*  �  190  be */   BOOST_CC_PUNCT,
0236         /*  �  191  bf */   BOOST_CC_PUNCT,
0237         /*  �  192  c0 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0238         /*  �  193  c1 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0239         /*  �  194  c2 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0240         /*  �  195  c3 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0241         /*  �  196  c4 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0242         /*  �  197  c5 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0243         /*  �  198  c6 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0244         /*  �  199  c7 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0245         /*  �  200  c8 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0246         /*  �  201  c9 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0247         /*  �  202  ca */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0248         /*  �  203  cb */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0249         /*  �  204  cc */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0250         /*  �  205  cd */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0251         /*  �  206  ce */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0252         /*  �  207  cf */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0253         /*  �  208  d0 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0254         /*  �  209  d1 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0255         /*  �  210  d2 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0256         /*  �  211  d3 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0257         /*  �  212  d4 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0258         /*  �  213  d5 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0259         /*  �  214  d6 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0260         /*  �  215  d7 */   BOOST_CC_PUNCT,
0261         /*  �  216  d8 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0262         /*  �  217  d9 */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0263         /*  �  218  da */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0264         /*  �  219  db */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0265         /*  �  220  dc */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0266         /*  �  221  dd */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0267         /*  �  222  de */   BOOST_CC_ALPHA|BOOST_CC_UPPER,
0268         /*  �  223  df */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0269         /*  �  224  e0 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0270         /*  �  225  e1 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0271         /*  �  226  e2 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0272         /*  �  227  e3 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0273         /*  �  228  e4 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0274         /*  �  229  e5 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0275         /*  �  230  e6 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0276         /*  �  231  e7 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0277         /*  �  232  e8 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0278         /*  �  233  e9 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0279         /*  �  234  ea */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0280         /*  �  235  eb */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0281         /*  �  236  ec */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0282         /*  �  237  ed */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0283         /*  �  238  ee */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0284         /*  �  239  ef */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0285         /*  �  240  f0 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0286         /*  �  241  f1 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0287         /*  �  242  f2 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0288         /*  �  243  f3 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0289         /*  �  244  f4 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0290         /*  �  245  f5 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0291         /*  �  246  f6 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0292         /*  �  247  f7 */   BOOST_CC_PUNCT,
0293         /*  �  248  f8 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0294         /*  �  249  f9 */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0295         /*  �  250  fa */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0296         /*  �  251  fb */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0297         /*  �  252  fc */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0298         /*  �  253  fd */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0299         /*  �  254  fe */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0300         /*  �  255  ff */   BOOST_CC_ALPHA|BOOST_CC_LOWER,
0301     };
0302 
0303     ///////////////////////////////////////////////////////////////////////////
0304     // ISO 8859-1 character conversion table
0305     ///////////////////////////////////////////////////////////////////////////
0306     const unsigned char iso8859_1_char_conversion[] =
0307     {
0308         /* NUL   0   0 */   '\0',
0309         /* SOH   1   1 */   '\0',
0310         /* STX   2   2 */   '\0',
0311         /* ETX   3   3 */   '\0',
0312         /* EOT   4   4 */   '\0',
0313         /* ENQ   5   5 */   '\0',
0314         /* ACK   6   6 */   '\0',
0315         /* BEL   7   7 */   '\0',
0316         /* BS    8   8 */   '\0',
0317         /* HT    9   9 */   '\0',
0318         /* NL   10   a */   '\0',
0319         /* VT   11   b */   '\0',
0320         /* NP   12   c */   '\0',
0321         /* CR   13   d */   '\0',
0322         /* SO   14   e */   '\0',
0323         /* SI   15   f */   '\0',
0324         /* DLE  16  10 */   '\0',
0325         /* DC1  17  11 */   '\0',
0326         /* DC2  18  12 */   '\0',
0327         /* DC3  19  13 */   '\0',
0328         /* DC4  20  14 */   '\0',
0329         /* NAK  21  15 */   '\0',
0330         /* SYN  22  16 */   '\0',
0331         /* ETB  23  17 */   '\0',
0332         /* CAN  24  18 */   '\0',
0333         /* EM   25  19 */   '\0',
0334         /* SUB  26  1a */   '\0',
0335         /* ESC  27  1b */   '\0',
0336         /* FS   28  1c */   '\0',
0337         /* GS   29  1d */   '\0',
0338         /* RS   30  1e */   '\0',
0339         /* US   31  1f */   '\0',
0340         /* SP   32  20 */   '\0',
0341         /*  !   33  21 */   '\0',
0342         /*  "   34  22 */   '\0',
0343         /*  #   35  23 */   '\0',
0344         /*  $   36  24 */   '\0',
0345         /*  %   37  25 */   '\0',
0346         /*  &   38  26 */   '\0',
0347         /*  '   39  27 */   '\0',
0348         /*  (   40  28 */   '\0',
0349         /*  )   41  29 */   '\0',
0350         /*  *   42  2a */   '\0',
0351         /*  +   43  2b */   '\0',
0352         /*  ,   44  2c */   '\0',
0353         /*  -   45  2d */   '\0',
0354         /*  .   46  2e */   '\0',
0355         /*  /   47  2f */   '\0',
0356         /*  0   48  30 */   '\0',
0357         /*  1   49  31 */   '\0',
0358         /*  2   50  32 */   '\0',
0359         /*  3   51  33 */   '\0',
0360         /*  4   52  34 */   '\0',
0361         /*  5   53  35 */   '\0',
0362         /*  6   54  36 */   '\0',
0363         /*  7   55  37 */   '\0',
0364         /*  8   56  38 */   '\0',
0365         /*  9   57  39 */   '\0',
0366         /*  :   58  3a */   '\0',
0367         /*  ;   59  3b */   '\0',
0368         /*  <   60  3c */   '\0',
0369         /*  =   61  3d */   '\0',
0370         /*  >   62  3e */   '\0',
0371         /*  ?   63  3f */   '\0',
0372         /*  @   64  40 */   '\0',
0373         /*  A   65  41 */   'a',
0374         /*  B   66  42 */   'b',
0375         /*  C   67  43 */   'c',
0376         /*  D   68  44 */   'd',
0377         /*  E   69  45 */   'e',
0378         /*  F   70  46 */   'f',
0379         /*  G   71  47 */   'g',
0380         /*  H   72  48 */   'h',
0381         /*  I   73  49 */   'i',
0382         /*  J   74  4a */   'j',
0383         /*  K   75  4b */   'k',
0384         /*  L   76  4c */   'l',
0385         /*  M   77  4d */   'm',
0386         /*  N   78  4e */   'n',
0387         /*  O   79  4f */   'o',
0388         /*  P   80  50 */   'p',
0389         /*  Q   81  51 */   'q',
0390         /*  R   82  52 */   'r',
0391         /*  S   83  53 */   's',
0392         /*  T   84  54 */   't',
0393         /*  U   85  55 */   'u',
0394         /*  V   86  56 */   'v',
0395         /*  W   87  57 */   'w',
0396         /*  X   88  58 */   'x',
0397         /*  Y   89  59 */   'y',
0398         /*  Z   90  5a */   'z',
0399         /*  [   91  5b */   '\0',
0400         /*  \   92  5c */   '\0',
0401         /*  ]   93  5d */   '\0',
0402         /*  ^   94  5e */   '\0',
0403         /*  _   95  5f */   '\0',
0404         /*  `   96  60 */   '\0',
0405         /*  a   97  61 */   'A',
0406         /*  b   98  62 */   'B',
0407         /*  c   99  63 */   'C',
0408         /*  d  100  64 */   'D',
0409         /*  e  101  65 */   'E',
0410         /*  f  102  66 */   'F',
0411         /*  g  103  67 */   'G',
0412         /*  h  104  68 */   'H',
0413         /*  i  105  69 */   'I',
0414         /*  j  106  6a */   'J',
0415         /*  k  107  6b */   'K',
0416         /*  l  108  6c */   'L',
0417         /*  m  109  6d */   'M',
0418         /*  n  110  6e */   'N',
0419         /*  o  111  6f */   'O',
0420         /*  p  112  70 */   'P',
0421         /*  q  113  71 */   'Q',
0422         /*  r  114  72 */   'R',
0423         /*  s  115  73 */   'S',
0424         /*  t  116  74 */   'T',
0425         /*  u  117  75 */   'U',
0426         /*  v  118  76 */   'V',
0427         /*  w  119  77 */   'W',
0428         /*  x  120  78 */   'X',
0429         /*  y  121  79 */   'Y',
0430         /*  z  122  7a */   'Z',
0431         /*  {  123  7b */   '\0',
0432         /*  |  124  7c */   '\0',
0433         /*  }  125  7d */   '\0',
0434         /*  ~  126  7e */   '\0',
0435         /* DEL 127  7f */   '\0',
0436         /* --  128  80 */   '\0',
0437         /* --  129  81 */   '\0',
0438         /* --  130  82 */   '\0',
0439         /* --  131  83 */   '\0',
0440         /* --  132  84 */   '\0',
0441         /* --  133  85 */   '\0',
0442         /* --  134  86 */   '\0',
0443         /* --  135  87 */   '\0',
0444         /* --  136  88 */   '\0',
0445         /* --  137  89 */   '\0',
0446         /* --  138  8a */   '\0',
0447         /* --  139  8b */   '\0',
0448         /* --  140  8c */   '\0',
0449         /* --  141  8d */   '\0',
0450         /* --  142  8e */   '\0',
0451         /* --  143  8f */   '\0',
0452         /* --  144  90 */   '\0',
0453         /* --  145  91 */   '\0',
0454         /* --  146  92 */   '\0',
0455         /* --  147  93 */   '\0',
0456         /* --  148  94 */   '\0',
0457         /* --  149  95 */   '\0',
0458         /* --  150  96 */   '\0',
0459         /* --  151  97 */   '\0',
0460         /* --  152  98 */   '\0',
0461         /* --  153  99 */   '\0',
0462         /* --  154  9a */   '\0',
0463         /* --  155  9b */   '\0',
0464         /* --  156  9c */   '\0',
0465         /* --  157  9d */   '\0',
0466         /* --  158  9e */   '\0',
0467         /* --  159  9f */   '\0',
0468         /*     160  a0 */   '\0',
0469         /*  �  161  a1 */   '\0',
0470         /*  �  162  a2 */   '\0',
0471         /*  �  163  a3 */   '\0',
0472         /*  �  164  a4 */   '\0',
0473         /*  �  165  a5 */   '\0',
0474         /*  �  166  a6 */   '\0',
0475         /*  �  167  a7 */   '\0',
0476         /*  �  168  a8 */   '\0',
0477         /*  �  169  a9 */   '\0',
0478         /*  �  170  aa */   '\0',
0479         /*  �  171  ab */   '\0',
0480         /*  �  172  ac */   '\0',
0481         /*  �  173  ad */   '\0',
0482         /*  �  174  ae */   '\0',
0483         /*  �  175  af */   '\0',
0484         /*  �  176  b0 */   '\0',
0485         /*  �  177  b1 */   '\0',
0486         /*  �  178  b2 */   '\0',
0487         /*  �  179  b3 */   '\0',
0488         /*  �  180  b4 */   '\0',
0489         /*  �  181  b5 */   '\0',
0490         /*  �  182  b6 */   '\0',
0491         /*  �  183  b7 */   '\0',
0492         /*  �  184  b8 */   '\0',
0493         /*  �  185  b9 */   '\0',
0494         /*  �  186  ba */   '\0',
0495         /*  �  187  bb */   '\0',
0496         /*  �  188  bc */   '\0',
0497         /*  �  189  bd */   '\0',
0498         /*  �  190  be */   '\0',
0499         /*  �  191  bf */   '\0',
0500         /*  �  192  c0 */   0xe0,
0501         /*  �  193  c1 */   0xe1,
0502         /*  �  194  c2 */   0xe2,
0503         /*  �  195  c3 */   0xe3,
0504         /*  �  196  c4 */   0xe4,
0505         /*  �  197  c5 */   0xe5,
0506         /*  �  198  c6 */   0xe6,
0507         /*  �  199  c7 */   0xe7,
0508         /*  �  200  c8 */   0xe8,
0509         /*  �  201  c9 */   0xe9,
0510         /*  �  202  ca */   0xea,
0511         /*  �  203  cb */   0xeb,
0512         /*  �  204  cc */   0xec,
0513         /*  �  205  cd */   0xed,
0514         /*  �  206  ce */   0xee,
0515         /*  �  207  cf */   0xef,
0516         /*  �  208  d0 */   0xf0,
0517         /*  �  209  d1 */   0xf1,
0518         /*  �  210  d2 */   0xf2,
0519         /*  �  211  d3 */   0xf3,
0520         /*  �  212  d4 */   0xf4,
0521         /*  �  213  d5 */   0xf5,
0522         /*  �  214  d6 */   0xf6,
0523         /*  �  215  d7 */   '\0',
0524         /*  �  216  d8 */   0xf8,
0525         /*  �  217  d9 */   0xf9,
0526         /*  �  218  da */   0xfa,
0527         /*  �  219  db */   0xfb,
0528         /*  �  220  dc */   0xfc,
0529         /*  �  221  dd */   0xfd,
0530         /*  �  222  de */   0xfe,
0531         /*  �  223  df */   '\0',
0532         /*  �  224  e0 */   0xc0,
0533         /*  �  225  e1 */   0xc1,
0534         /*  �  226  e2 */   0xc2,
0535         /*  �  227  e3 */   0xc3,
0536         /*  �  228  e4 */   0xc4,
0537         /*  �  229  e5 */   0xc5,
0538         /*  �  230  e6 */   0xc6,
0539         /*  �  231  e7 */   0xc7,
0540         /*  �  232  e8 */   0xc8,
0541         /*  �  233  e9 */   0xc9,
0542         /*  �  234  ea */   0xca,
0543         /*  �  235  eb */   0xcb,
0544         /*  �  236  ec */   0xcc,
0545         /*  �  237  ed */   0xcd,
0546         /*  �  238  ee */   0xce,
0547         /*  �  239  ef */   0xcf,
0548         /*  �  240  f0 */   0xd0,
0549         /*  �  241  f1 */   0xd1,
0550         /*  �  242  f2 */   0xd2,
0551         /*  �  243  f3 */   0xd3,
0552         /*  �  244  f4 */   0xd4,
0553         /*  �  245  f5 */   0xd5,
0554         /*  �  246  f6 */   0xd6,
0555         /*  �  247  f7 */   '\0',
0556         /*  �  248  f8 */   0xd8,
0557         /*  �  249  f9 */   0xd9,
0558         /*  �  250  fa */   0xda,
0559         /*  �  251  fb */   0xdb,
0560         /*  �  252  fc */   0xdc,
0561         /*  �  253  fd */   0xdd,
0562         /*  �  254  fe */   0xde,
0563         /*  �  255  ff */   '\0',
0564     };
0565 
0566     ///////////////////////////////////////////////////////////////////////////
0567     //  Test characters for specified conditions (using iso8859-1)
0568     ///////////////////////////////////////////////////////////////////////////
0569     struct iso8859_1
0570     {
0571         typedef unsigned char char_type;
0572         typedef unsigned char classify_type;
0573 
0574         static bool
0575         isascii_(int ch)
0576         {
0577             return 0 == (ch & ~0x7f);
0578         }
0579 
0580         static bool
0581         ischar(int ch)
0582         {
0583             // iso8859.1 uses all 8 bits
0584             // we have to watch out for sign extensions
0585             return (0 == (ch & ~0xff) || ~0 == (ch | 0xff)) != 0;
0586         }
0587 
0588         // *** Note on assertions: The precondition is that the calls to
0589         // these functions do not violate the required range of ch (type int)
0590         // which is that strict_ischar(ch) should be true. It is the
0591         // responsibility of the caller to make sure this precondition is not
0592         // violated.
0593 
0594         static bool
0595         strict_ischar(int ch)
0596         {
0597             return ch >= 0 && ch <= 255;
0598         }
0599 
0600         static bool
0601         isalnum(int ch)
0602         {
0603             BOOST_ASSERT(strict_ischar(ch));
0604             return (iso8859_1_char_types[ch] & BOOST_CC_ALPHA)
0605                 || (iso8859_1_char_types[ch] & BOOST_CC_DIGIT);
0606         }
0607 
0608         static bool
0609         isalpha(int ch)
0610         {
0611             BOOST_ASSERT(strict_ischar(ch));
0612             return (iso8859_1_char_types[ch] & BOOST_CC_ALPHA) != 0;
0613         }
0614 
0615         static bool
0616         isdigit(int ch)
0617         {
0618             BOOST_ASSERT(strict_ischar(ch));
0619             return (iso8859_1_char_types[ch] & BOOST_CC_DIGIT) != 0;
0620         }
0621 
0622         static bool
0623         isxdigit(int ch)
0624         {
0625             BOOST_ASSERT(strict_ischar(ch));
0626             return (iso8859_1_char_types[ch] & BOOST_CC_XDIGIT) != 0;
0627         }
0628 
0629         static bool
0630         iscntrl(int ch)
0631         {
0632             BOOST_ASSERT(strict_ischar(ch));
0633             return (iso8859_1_char_types[ch] & BOOST_CC_CTRL) != 0;
0634         }
0635 
0636         static bool
0637         isgraph(int ch)
0638         {
0639             return ('\x21' <= ch && ch <= '\x7e') || ('\xa1' <= ch && ch <= '\xff');
0640         }
0641 
0642         static bool
0643         islower(int ch)
0644         {
0645             BOOST_ASSERT(strict_ischar(ch));
0646             return (iso8859_1_char_types[ch] & BOOST_CC_LOWER) != 0;
0647         }
0648 
0649         static bool
0650         isprint(int ch)
0651         {
0652             return ('\x20' <= ch && ch <= '\x7e') || ('\xa0' <= ch && ch <= '\xff');
0653         }
0654 
0655         static bool
0656         ispunct(int ch)
0657         {
0658             BOOST_ASSERT(strict_ischar(ch));
0659             return (iso8859_1_char_types[ch] & BOOST_CC_PUNCT) != 0;
0660         }
0661 
0662         static bool
0663         isspace(int ch)
0664         {
0665             BOOST_ASSERT(strict_ischar(ch));
0666             return (iso8859_1_char_types[ch] & BOOST_CC_SPACE) != 0;
0667         }
0668 
0669         static bool
0670         isblank BOOST_PREVENT_MACRO_SUBSTITUTION (int ch)
0671         {
0672             BOOST_ASSERT(strict_ischar(ch));
0673             return ('\x09' == ch || '\x20' == ch || '\xa0' == ch);
0674         }
0675 
0676         static bool
0677         isupper(int ch)
0678         {
0679             BOOST_ASSERT(strict_ischar(ch));
0680             return (iso8859_1_char_types[ch] & BOOST_CC_UPPER) != 0;
0681         }
0682 
0683     ///////////////////////////////////////////////////////////////////////////
0684     //  Simple character conversions
0685     ///////////////////////////////////////////////////////////////////////////
0686 
0687         static int
0688         tolower(int ch)
0689         {
0690             BOOST_ASSERT(strict_ischar(ch));
0691             return isupper(ch) && '\0' != iso8859_1_char_conversion[ch] ?
0692                 iso8859_1_char_conversion[ch] : ch;
0693         }
0694 
0695         static int
0696         toupper(int ch)
0697         {
0698             BOOST_ASSERT(strict_ischar(ch));
0699             return islower(ch) && '\0' != iso8859_1_char_conversion[ch] ?
0700                 iso8859_1_char_conversion[ch] : ch;
0701         }
0702 
0703         static ::boost::uint32_t
0704         toucs4(int ch)
0705         {
0706             // The first 256 characters in Unicode and the UCS are
0707             // identical to those in ISO/IEC-8859-1.
0708             BOOST_ASSERT(strict_ischar(ch));
0709             return ch;
0710         }
0711     };
0712 
0713 }}}
0714 
0715 ///////////////////////////////////////////////////////////////////////////////
0716 // undefine macros
0717 ///////////////////////////////////////////////////////////////////////////////
0718 #undef BOOST_CC_DIGIT
0719 #undef BOOST_CC_XDIGIT
0720 #undef BOOST_CC_ALPHA
0721 #undef BOOST_CC_CTRL
0722 #undef BOOST_CC_LOWER
0723 #undef BOOST_CC_UPPER
0724 #undef BOOST_CC_PUNCT
0725 #undef BOOST_CC_SPACE
0726 
0727 #endif
0728