llvm-project
80 строк · 4.0 Кб
1//===--- CharInfo.cpp - Static Data for Classifying ASCII Characters ------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "clang/Basic/CharInfo.h"10
11using namespace clang::charinfo;12
13// Statically initialize CharInfo table based on ASCII character set
14// Reference: FreeBSD 7.2 /usr/share/misc/ascii
15const uint16_t clang::charinfo::InfoTable[256] = {16// 0 NUL 1 SOH 2 STX 3 ETX17// 4 EOT 5 ENQ 6 ACK 7 BEL180 , 0 , 0 , 0 ,190 , 0 , 0 , 0 ,20// 8 BS 9 HT 10 NL 11 VT21//12 NP 13 CR 14 SO 15 SI220 , CHAR_HORZ_WS, CHAR_VERT_WS, CHAR_HORZ_WS,23CHAR_HORZ_WS, CHAR_VERT_WS, 0 , 0 ,24//16 DLE 17 DC1 18 DC2 19 DC325//20 DC4 21 NAK 22 SYN 23 ETB260 , 0 , 0 , 0 ,270 , 0 , 0 , 0 ,28//24 CAN 25 EM 26 SUB 27 ESC29//28 FS 29 GS 30 RS 31 US300 , 0 , 0 , 0 ,310 , 0 , 0 , 0 ,32//32 SP 33 ! 34 " 35 #33//36 $ 37 % 38 & 39 '34CHAR_SPACE , CHAR_PUNCT , CHAR_PUNCT , CHAR_PUNCT ,35CHAR_PUNCT , CHAR_PUNCT , CHAR_PUNCT , CHAR_PUNCT ,36//40 ( 41 ) 42 * 43 +37//44 , 45 - 46 . 47 /38CHAR_PUNCT , CHAR_PUNCT , CHAR_PUNCT , CHAR_PUNCT ,39CHAR_PUNCT , CHAR_PUNCT , CHAR_PERIOD , CHAR_PUNCT ,40//48 0 49 1 50 2 51 341//52 4 53 5 54 6 55 742CHAR_DIGIT , CHAR_DIGIT , CHAR_DIGIT , CHAR_DIGIT ,43CHAR_DIGIT , CHAR_DIGIT , CHAR_DIGIT , CHAR_DIGIT ,44//56 8 57 9 58 : 59 ;45//60 < 61 = 62 > 63 ?46CHAR_DIGIT , CHAR_DIGIT , CHAR_PUNCT , CHAR_PUNCT ,47CHAR_PUNCT , CHAR_PUNCT , CHAR_PUNCT , CHAR_PUNCT ,48//64 @ 65 A 66 B 67 C49//68 D 69 E 70 F 71 G50CHAR_PUNCT , CHAR_XUPPER , CHAR_XUPPER , CHAR_XUPPER ,51CHAR_XUPPER , CHAR_XUPPER , CHAR_XUPPER , CHAR_UPPER ,52//72 H 73 I 74 J 75 K53//76 L 77 M 78 N 79 O54CHAR_UPPER , CHAR_UPPER , CHAR_UPPER , CHAR_UPPER ,55CHAR_UPPER , CHAR_UPPER , CHAR_UPPER , CHAR_UPPER ,56//80 P 81 Q 82 R 83 S57//84 T 85 U 86 V 87 W58CHAR_UPPER , CHAR_UPPER , CHAR_UPPER , CHAR_UPPER ,59CHAR_UPPER , CHAR_UPPER , CHAR_UPPER , CHAR_UPPER ,60//88 X 89 Y 90 Z 91 [61//92 \ 93 ] 94 ^ 95 _62CHAR_UPPER , CHAR_UPPER , CHAR_UPPER , CHAR_PUNCT ,63CHAR_PUNCT , CHAR_PUNCT , CHAR_PUNCT , CHAR_UNDER ,64//96 ` 97 a 98 b 99 c65//100 d 101 e 102 f 103 g66CHAR_PUNCT , CHAR_XLOWER , CHAR_XLOWER , CHAR_XLOWER ,67CHAR_XLOWER , CHAR_XLOWER , CHAR_XLOWER , CHAR_LOWER ,68//104 h 105 i 106 j 107 k69//108 l 109 m 110 n 111 o70CHAR_LOWER , CHAR_LOWER , CHAR_LOWER , CHAR_LOWER ,71CHAR_LOWER , CHAR_LOWER , CHAR_LOWER , CHAR_LOWER ,72//112 p 113 q 114 r 115 s73//116 t 117 u 118 v 119 w74CHAR_LOWER , CHAR_LOWER , CHAR_LOWER , CHAR_LOWER ,75CHAR_LOWER , CHAR_LOWER , CHAR_LOWER , CHAR_LOWER ,76//120 x 121 y 122 z 123 {77//124 | 125 } 126 ~ 127 DEL78CHAR_LOWER , CHAR_LOWER , CHAR_LOWER , CHAR_PUNCT ,79CHAR_PUNCT , CHAR_PUNCT , CHAR_PUNCT , 080};81