openMSX
rapidsax.cc
Go to the documentation of this file.
1 #include "rapidsax.hh"
2 
3 namespace rapidsax::internal {
4 
5 // Character class lookup table
6 // bit 0: \0
7 // bit 1: \t \r \r space
8 // bit 2: <
9 // bit 3: &
10 // bit 4: '
11 // bit 5: "
12 // bit 6: / > ?
13 // bit 7: ! =
14 const uint8_t lutChar[256] =
15 {
16  // 0 1 2 3 4 5 6 7 8 9 A B C D E F
17  0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x02,0x00,0x00,0x02,0x00,0x00, // 0
18  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 1
19  0x02,0x80,0x20,0x00,0x00,0x00,0x08,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40, // 2
20  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x80,0x40,0x40, // 3
21  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 4
22  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 5
23  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 6
24  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 7
25  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 8
26  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 9
27  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // A
28  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // B
29  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // C
30  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // D
31  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // E
32  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // F
33 };
34 
35 // Digits (dec and hex, 255 denotes end of numeric character reference)
36 const uint8_t lutDigits[256] =
37 {
38  // 0 1 2 3 4 5 6 7 8 9 A B C D E F
39  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 0
40  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 1
41  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 2
42  0, 1, 2, 3, 4, 5, 6, 7, 8, 9,255,255,255,255,255,255, // 3
43  255, 10, 11, 12, 13, 14, 15,255,255,255,255,255,255,255,255,255, // 4
44  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 5
45  255, 10, 11, 12, 13, 14, 15,255,255,255,255,255,255,255,255,255, // 6
46  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 7
47  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 8
48  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 9
49  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // A
50  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // B
51  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // C
52  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // D
53  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // E
54  255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255 // F
55 };
56 
57 } // namespace rapidsax::internal
rapidsax::internal::lutChar
const uint8_t lutChar[256]
Definition: rapidsax.cc:14
rapidsax::internal::lutDigits
const uint8_t lutDigits[256]
Definition: rapidsax.cc:36
rapidsax::internal
Definition: rapidsax.cc:3
rapidsax.hh