keywords.c_shipped 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. /* ANSI-C code produced by gperf version 3.0.1 */
  2. /* Command-line: gperf -L ANSI-C -a -C -E -g -H is_reserved_hash -k '1,3,$' -N is_reserved_word -p -t scripts/genksyms/keywords.gperf */
  3. #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
  4. && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
  5. && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
  6. && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
  7. && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
  8. && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
  9. && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
  10. && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
  11. && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
  12. && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
  13. && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
  14. && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
  15. && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
  16. && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
  17. && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
  18. && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
  19. && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
  20. && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
  21. && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
  22. && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
  23. && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
  24. && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
  25. && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
  26. /* The character set is not based on ISO-646. */
  27. #error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
  28. #endif
  29. #line 1 "scripts/genksyms/keywords.gperf"
  30. #line 3 "scripts/genksyms/keywords.gperf"
  31. struct resword { const char *name; int token; };
  32. /* maximum key range = 68, duplicates = 0 */
  33. #ifdef __GNUC__
  34. __inline
  35. #else
  36. #ifdef __cplusplus
  37. inline
  38. #endif
  39. #endif
  40. static unsigned int
  41. is_reserved_hash (register const char *str, register unsigned int len)
  42. {
  43. static const unsigned char asso_values[] =
  44. {
  45. 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
  46. 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
  47. 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
  48. 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
  49. 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
  50. 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
  51. 71, 71, 71, 71, 71, 71, 71, 71, 71, 0,
  52. 71, 71, 71, 71, 71, 71, 35, 71, 71, 71,
  53. 5, 71, 71, 71, 71, 71, 71, 71, 71, 71,
  54. 71, 71, 71, 71, 71, 0, 71, 0, 71, 5,
  55. 5, 0, 10, 20, 71, 25, 71, 71, 20, 0,
  56. 20, 30, 25, 71, 10, 5, 0, 20, 15, 71,
  57. 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
  58. 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
  59. 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
  60. 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
  61. 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
  62. 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
  63. 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
  64. 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
  65. 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
  66. 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
  67. 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
  68. 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
  69. 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
  70. 71, 71, 71, 71, 71, 71
  71. };
  72. return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]] + asso_values[(unsigned char)str[len - 1]];
  73. }
  74. #ifdef __GNUC__
  75. __inline
  76. #endif
  77. const struct resword *
  78. is_reserved_word (register const char *str, register unsigned int len)
  79. {
  80. enum
  81. {
  82. TOTAL_KEYWORDS = 42,
  83. MIN_WORD_LENGTH = 3,
  84. MAX_WORD_LENGTH = 24,
  85. MIN_HASH_VALUE = 3,
  86. MAX_HASH_VALUE = 70
  87. };
  88. static const struct resword wordlist[] =
  89. {
  90. {""}, {""}, {""},
  91. #line 25 "scripts/genksyms/keywords.gperf"
  92. {"asm", ASM_KEYW},
  93. {""},
  94. #line 8 "scripts/genksyms/keywords.gperf"
  95. {"__asm", ASM_KEYW},
  96. {""},
  97. #line 9 "scripts/genksyms/keywords.gperf"
  98. {"__asm__", ASM_KEYW},
  99. {""},
  100. #line 22 "scripts/genksyms/keywords.gperf"
  101. {"_restrict", RESTRICT_KEYW},
  102. #line 51 "scripts/genksyms/keywords.gperf"
  103. {"__typeof__", TYPEOF_KEYW},
  104. #line 10 "scripts/genksyms/keywords.gperf"
  105. {"__attribute", ATTRIBUTE_KEYW},
  106. #line 12 "scripts/genksyms/keywords.gperf"
  107. {"__const", CONST_KEYW},
  108. #line 11 "scripts/genksyms/keywords.gperf"
  109. {"__attribute__", ATTRIBUTE_KEYW},
  110. #line 13 "scripts/genksyms/keywords.gperf"
  111. {"__const__", CONST_KEYW},
  112. #line 17 "scripts/genksyms/keywords.gperf"
  113. {"__signed__", SIGNED_KEYW},
  114. #line 43 "scripts/genksyms/keywords.gperf"
  115. {"static", STATIC_KEYW},
  116. {""},
  117. #line 16 "scripts/genksyms/keywords.gperf"
  118. {"__signed", SIGNED_KEYW},
  119. #line 31 "scripts/genksyms/keywords.gperf"
  120. {"char", CHAR_KEYW},
  121. {""},
  122. #line 44 "scripts/genksyms/keywords.gperf"
  123. {"struct", STRUCT_KEYW},
  124. #line 23 "scripts/genksyms/keywords.gperf"
  125. {"__restrict__", RESTRICT_KEYW},
  126. #line 24 "scripts/genksyms/keywords.gperf"
  127. {"restrict", RESTRICT_KEYW},
  128. #line 34 "scripts/genksyms/keywords.gperf"
  129. {"enum", ENUM_KEYW},
  130. #line 18 "scripts/genksyms/keywords.gperf"
  131. {"__volatile", VOLATILE_KEYW},
  132. #line 35 "scripts/genksyms/keywords.gperf"
  133. {"extern", EXTERN_KEYW},
  134. #line 19 "scripts/genksyms/keywords.gperf"
  135. {"__volatile__", VOLATILE_KEYW},
  136. #line 38 "scripts/genksyms/keywords.gperf"
  137. {"int", INT_KEYW},
  138. #line 7 "scripts/genksyms/keywords.gperf"
  139. {"EXPORT_SYMBOL_GPL_FUTURE", EXPORT_SYMBOL_KEYW},
  140. #line 32 "scripts/genksyms/keywords.gperf"
  141. {"const", CONST_KEYW},
  142. #line 33 "scripts/genksyms/keywords.gperf"
  143. {"double", DOUBLE_KEYW},
  144. {""},
  145. #line 14 "scripts/genksyms/keywords.gperf"
  146. {"__inline", INLINE_KEYW},
  147. #line 30 "scripts/genksyms/keywords.gperf"
  148. {"auto", AUTO_KEYW},
  149. #line 15 "scripts/genksyms/keywords.gperf"
  150. {"__inline__", INLINE_KEYW},
  151. #line 42 "scripts/genksyms/keywords.gperf"
  152. {"signed", SIGNED_KEYW},
  153. {""},
  154. #line 47 "scripts/genksyms/keywords.gperf"
  155. {"unsigned", UNSIGNED_KEYW},
  156. {""},
  157. #line 41 "scripts/genksyms/keywords.gperf"
  158. {"short", SHORT_KEYW},
  159. #line 50 "scripts/genksyms/keywords.gperf"
  160. {"typeof", TYPEOF_KEYW},
  161. #line 45 "scripts/genksyms/keywords.gperf"
  162. {"typedef", TYPEDEF_KEYW},
  163. #line 49 "scripts/genksyms/keywords.gperf"
  164. {"volatile", VOLATILE_KEYW},
  165. {""},
  166. #line 36 "scripts/genksyms/keywords.gperf"
  167. {"float", FLOAT_KEYW},
  168. {""}, {""},
  169. #line 40 "scripts/genksyms/keywords.gperf"
  170. {"register", REGISTER_KEYW},
  171. #line 48 "scripts/genksyms/keywords.gperf"
  172. {"void", VOID_KEYW},
  173. {""},
  174. #line 37 "scripts/genksyms/keywords.gperf"
  175. {"inline", INLINE_KEYW},
  176. {""},
  177. #line 5 "scripts/genksyms/keywords.gperf"
  178. {"EXPORT_SYMBOL", EXPORT_SYMBOL_KEYW},
  179. {""},
  180. #line 21 "scripts/genksyms/keywords.gperf"
  181. {"_Bool", BOOL_KEYW},
  182. {""},
  183. #line 6 "scripts/genksyms/keywords.gperf"
  184. {"EXPORT_SYMBOL_GPL", EXPORT_SYMBOL_KEYW},
  185. {""}, {""}, {""}, {""}, {""}, {""},
  186. #line 39 "scripts/genksyms/keywords.gperf"
  187. {"long", LONG_KEYW},
  188. {""}, {""}, {""}, {""}, {""},
  189. #line 46 "scripts/genksyms/keywords.gperf"
  190. {"union", UNION_KEYW}
  191. };
  192. if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
  193. {
  194. register int key = is_reserved_hash (str, len);
  195. if (key <= MAX_HASH_VALUE && key >= 0)
  196. {
  197. register const char *s = wordlist[key].name;
  198. if (*str == *s && !strcmp (str + 1, s + 1))
  199. return &wordlist[key];
  200. }
  201. }
  202. return 0;
  203. }