modify code
[build-config.git] / src / config / lxrgmr-code / token / chartype.c
blob33d13091f0e8b2e14fd57a5ed086c72198f132e7
2 #include "chartype.h"
4 /*
5 [:alpha:] Ï൱ÓÚ [a-zA-Z]
6 [:lower:] Ï൱ÓÚ [a-z]
7 [:upper:] Ï൱ÓÚ [A-Z]
8 [:digit:] Ï൱ÓÚ [0-9]
9 [:alnum:] Ï൱ÓÚ [a-zA-Z0-9]
10 [:blank:] Æ¥Åä ' '(¿Õ¸ñ)¡¢ '\t'(ÖƱí·û)
11 [:space:] Æ¥Åä ' '(¿Õ¸ñ)¡¢'\t'(ÖƱí·û)¡¢'\n'(ÐÂÐÐ)¡¢'\f'()¡¢'\v'(´¹Ö±ÖƱí·û)¡¢'\r'(»Ø³µ·û)
12 [:cntrl:] Æ¥Åä¿ØÖÆ×Ö·û¡£ÔÚ ASCII ÂëÖУ¬ÕâЩ¿ØÖÆ×Ö·ûÊǴӰ˽øÖÆÊý×Ö 000 µ½ 037, ºÍ 177 (DEL)
13 [:print:] Æ¥Åä Ï൱ÓÚ [:alnum:]¡¢[:punct:] ºÍ ¿Õ¸ñ
14 [:graph:] Æ¥Åä Ï൱ÓÚ [:alnum:] ¡¢ [:punct:]
15 [:punct:] Æ¥Åä `! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ ' µÈ±êµã·ûºÅ
16 [:xdigit:] Æ¥ÅäÊ®Áù½øÖÆ×Ö·û '0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f
19 enum CHARTYPE_MASK1 {
20 CTM_DIGIT = (1<<0),
21 CTM_HEX = (1<<1),
22 CTM_OCT = (1<<2),
23 CTM_ALPHA = (1<<3),
24 CTM_ALNUM = (1<<4),
25 CTM_VNAME = (1<<5),
26 CTM_PORTABLE = (1<<6),
27 CTM_PUNCT = (1<<7),
30 enum CHARTYPE_MASK2 {
31 CTM_BLANK = (1<<0),
32 CTM_SPACE = (1<<1),
33 CTM_PRINT = (1<<2),
34 CTM_GRAPH = (1<<3),
35 CTM_ALNUM = (1<<4),
36 CTM_CNTRL = (1<<5),
37 CTM_LOWER = (1<<6),
38 CTM_UPPER = (1<<7),
42 char chsetmap[128] = {
43 /* 0 1 2 3 4 5 6 7 */
44 /* 8 9 A B C D E F */
45 ________, ________, ________, ________, ________, ________, ________, ________, // 0x0X
46 ________, ________, ________, ________, ________, ________, ________, ________, // 0x0X
48 ________, ________, ________, ________, ________, ________, ________, ________, // 0x1X
49 ________, ________, ________, ________, ________, ________, ________, ________, // 1
51 /* ' ' ! " # $ % & ' */
52 /* ( ) * + , - . / */
53 X_______, X_______, X_______, X_______, X_______, X_______, X_______, X_______, // 2
54 X_______, X_______, X_______, X_______, X_______, XX______, X_______, X_______, // 2
56 /* 0 1 2 3 4 5 6 7 */
57 /* 8 9 : ; < = > ? */
58 _XXX_XXX, _XXX_XXX, _XXX_XXX, _XXX_XXX, _XXX_XXX, _XXX_XXX, _XXX_XXX, _XXX_XXX, // 3
59 ______XX, ______XX, X_______, X_______, X_______, X_______, X_______, X_______, // 3
61 /* @ A B C D E F G */
62 /* H I J K L M N O */
63 X_______, _XXXX_X_, _XXXX_X_, _XXXX_X_, _XXXX_X_, _XXXX_X_, _XXXX_X_, _XXXX___, // 4
64 _XXXX___, _XXXX___, _XXXX___, _XXXX___, _XXXX___, _XXXX___, _XXXX___, _XXXX___, // 4
66 /* P Q R S T U V W */
67 /* X Y Z [ \ ] ^ _ */
68 _XXXX___, _XXXX___, _XXXX___, _XXXX___, _XXXX___, _XXXX___, _XXXX___, _XXXX___, // 5
69 _XXXX___, _XXXX___, _XXXX___, X_______, X_______, X_______, X_______, XXX_____, // 5
71 /* ` a b c d e f g */
72 /* h i j k l m n o */
73 X_______, _XXXX_X_, _XXXX_X_, _XXXX_X_, _XXXX_X_, _XXXX_X_, _XXXX_X_, _XXXX___, // 6
74 _XXXX___, _XXXX___, _XXXX___, _XXXX___, _XXXX___, _XXXX___, _XXXX___, _XXXX___, // 6
76 /* p q r s t u v w */
77 /* x y z { | } ~ 'DEL' */
78 _XXXX___, _XXXX___, _XXXX___, _XXXX___, _XXXX___, _XXXX___, _XXXX___, _XXXX___, // 7
79 _XXXX___, _XXXX___, _XXXX___, X_______, X_______, X_______, X_______, X_______, // 7
82 char chsetmap2[128] = {
83 /* 0 1 2 3 4 5 6 7 */
84 /* 8 9 A B C D E F */
85 ___X____, ___X____, ___X____, ___X____, ___X____, ___X____, ___X____, ___X____, // 0x0X
86 ___X____, ___X____, ___X____, ___X____, ___X____, ___X____, ___X____, ___X____, // 0x0X
88 ___X____, ___X____, ___X____, ___X____, ___X____, ___X____, ___X____, ___X____, // 0x1X
89 ___X____, ___X____, ___X____, ___X____, ___X____, ___X____, ___X____, ___X____, // 1
91 /* ' ' ! " # $ % & ' */
92 /* ( ) * + , - . / */
93 _____XXX, ____XX__, ____XX__, ____XX__, ____XX__, ____XX__, ____XX__, ____XX__, // 2
94 ____XX__, ____XX__, ____XX__, ____XX__, ____XX__, ____XX__, ____XX__, ____XX__, // 2
96 /* 0 1 2 3 4 5 6 7 */
97 /* 8 9 : ; < = > ? */
98 ____XX__, ____XX__, ____XX__, ____XX__, ____XX__, ____XX__, ____XX__, ____XX__, // 3
99 ____XX__, ____XX__, ____XX__, ____XX__, ____XX__, ____XX__, ____XX__, ____XX__, // 3
101 /* @ A B C D E F G */
102 /* H I J K L M N O */
103 ____XX__, __X_XX__, __X_XX__, __X_XX__, __X_XX__, __X_XX__, __X_XX__, __X_XX__, // 4
104 __X_XX__, __X_XX__, __X_XX__, __X_XX__, __X_XX__, __X_XX__, __X_XX__, __X_XX__, // 4
106 /* P Q R S T U V W */
107 /* X Y Z [ \ ] ^ _ */
108 __X_XX__, __X_XX__, __X_XX__, __X_XX__, __X_XX__, __X_XX__, __X_XX__, __X_XX__, // 5
109 __X_XX__, __X_XX__, __X_XX__, ____XX__, ____XX__, ____XX__, ____XX__, ____XX__, // 5
111 /* ` a b c d e f g */
112 /* h i j k l m n o */
113 ____XX__, _X__XX__, _X__XX__, _X__XX__, _X__XX__, _X__XX__, _X__XX__, _X__XX__, // 6
114 _X__XX__, _X__XX__, _X__XX__, _X__XX__, _X__XX__, _X__XX__, _X__XX__, _X__XX__, // 6
116 /* p q r s t u v w */
117 /* x y z { | } ~ 'DEL' */
118 _X__XX__, _X__XX__, _X__XX__, _X__XX__, _X__XX__, _X__XX__, _X__XX__, _X__XX__, // 7
119 _X__XX__, _X__XX__, _X__XX__, ____XX__, ____XX__, ____XX__, ____XX__, ____XX__, // 7
128 char chmap_tbl_bak[128] = {
129 /* 0 1 2 3 4 5 6 7 */
130 /* 8 9 A B C D E F */
131 ________, ________, ________, ________, ________, ________, ________, ________, // 0x0X
132 ________, ________, ________, ________, ________, ________, ________, ________, // 0x0X
134 ________, ________, ________, ________, ________, ________, ________, ________, // 0x1X
135 ________, ________, ________, ________, ________, ________, ________, ________, // 1
137 /* ' ' ! " # $ % & ' */
138 /* ( ) * + , - . / */
139 ________, ________, ________, ________, ________, ________, ________, ________, // 2
140 ________, ________, ________, ________, ________, ________, ________, ________, // 2
142 // 4, 3, 3, 3, 3, 3, 3, 3, // 2
143 // 3, 3, 3, 3, 3, 3, 3, 3, // 2
145 /* 0 1 2 3 4 5 6 7 */
146 /* 8 9 : ; < = > ? */
147 ________, ________, ________, ________, ________, ________, ________, ________, // 3
148 ________, ________, ________, ________, ________, ________, ________, ________, // 3
150 // 2, 2, 2, 2, 2, 2, 2, 2, // 3
151 // 2, 2, 3, 3, 3, 3, 3, 3, // 3
153 /* @ A B C D E F G */
154 /* H I J K L M N O */
155 ________, ________, ________, ________, ________, ________, ________, ________, // 4
156 ________, ________, ________, ________, ________, ________, ________, ________, // 4
158 // 3, 2, 2, 2, 2, 2, 2, 2, // 4
159 // 2, 2, 2, 2, 2, 2, 2, 2, // 4
161 /* P Q R S T U V W */
162 /* X Y Z [ \ ] ^ _ */
163 ________, ________, ________, ________, ________, ________, ________, ________, // 5
164 ________, ________, ________, ________, ________, ________, ________, ________, // 5
166 // 2, 2, 2, 2, 2, 2, 2, 2, // 5
167 // 2, 2, 2, 3, 1, 3, 3, 2, // 5
169 /* ` a b c d e f g */
170 /* h i j k l m n o */
171 ________, ________, ________, ________, ________, ________, ________, ________, // 6
172 ________, ________, ________, ________, ________, ________, ________, ________, // 6
174 // 3, 2, 2, 2, 2, 2, 2, 2, // 6
175 // 2, 2, 2, 2, 2, 2, 2, 2, // 6
177 /* p q r s t u v w */
178 /* x y z { | } ~ 'DEL' */
179 ________, ________, ________, ________, ________, ________, ________, ________, // 7
180 ________, ________, ________, ________, ________, ________, ________, ________, // 7
182 // 2, 2, 2, 2, 2, 2, 2, 2, // 7
183 // 2, 2, 2, 3, 3, 3, 3, 0, // 7