root/libparser/java_res.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. java_hash
  2. java_lookup
  3. java_reserved_word

   1 /* ANSI-C code produced by gperf version 3.0.4 */
   2 /* Command-line: gperf --language=ANSI-C --struct-type --slot-name=name --hash-fn-name=java_hash --lookup-fn-name=java_lookup  */
   3 /* Computed positions: -k'1-2' */
   4 
   5 #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
   6       && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
   7       && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
   8       && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
   9       && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
  10       && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
  11       && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
  12       && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
  13       && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
  14       && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
  15       && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
  16       && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
  17       && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
  18       && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
  19       && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
  20       && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
  21       && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
  22       && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
  23       && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
  24       && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
  25       && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
  26       && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
  27       && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
  28 /* The character set is not based on ISO-646.  */
  29 #error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
  30 #endif
  31 
  32 
  33 #include "strmake.h"
  34 #define START_VARIABLE  1001
  35 #define START_WORD      2001
  36 #define START_SHARP     3001
  37 #define START_YACC      4001
  38 #define IS_RESERVED_WORD(a)     ((a) >= START_WORD)
  39 #define IS_RESERVED_VARIABLE(a) ((a) >= START_VARIABLE && (a) < START_WORD)
  40 #define IS_RESERVED_SHARP(a)    ((a) >= START_SHARP && (a) < START_YACC)
  41 #define IS_RESERVED_YACC(a)     ((a) >= START_YACC)
  42 
  43 #define JAVA_ABSTRACT   2001
  44 #define JAVA_BOOLEAN    2002
  45 #define JAVA_BREAK      2003
  46 #define JAVA_BYTE       2004
  47 #define JAVA_CASE       2005
  48 #define JAVA_CATCH      2006
  49 #define JAVA_CHAR       2007
  50 #define JAVA_CLASS      2008
  51 #define JAVA_CONST      2009
  52 #define JAVA_CONTINUE   2010
  53 #define JAVA_DEFAULT    2011
  54 #define JAVA_DO 2012
  55 #define JAVA_DOUBLE     2013
  56 #define JAVA_ELSE       2014
  57 #define JAVA_ENUM       2015
  58 #define JAVA_EXTENDS    2016
  59 #define JAVA_FALSE      2017
  60 #define JAVA_FINAL      2018
  61 #define JAVA_FINALLY    2019
  62 #define JAVA_FLOAT      2020
  63 #define JAVA_FOR        2021
  64 #define JAVA_GOTO       2022
  65 #define JAVA_IF 2023
  66 #define JAVA_IMPLEMENTS 2024
  67 #define JAVA_IMPORT     2025
  68 #define JAVA_INSTANCEOF 2026
  69 #define JAVA_INT        2027
  70 #define JAVA_INTERFACE  2028
  71 #define JAVA_LONG       2029
  72 #define JAVA_NATIVE     2030
  73 #define JAVA_NEW        2031
  74 #define JAVA_NULL       2032
  75 #define JAVA_PACKAGE    2033
  76 #define JAVA_PRIVATE    2034
  77 #define JAVA_PROTECTED  2035
  78 #define JAVA_PUBLIC     2036
  79 #define JAVA_RETURN     2037
  80 #define JAVA_SHORT      2038
  81 #define JAVA_STATIC     2039
  82 #define JAVA_STRICTFP   2040
  83 #define JAVA_SUPER      2041
  84 #define JAVA_SWITCH     2042
  85 #define JAVA_SYNCHRONIZED       2043
  86 #define JAVA_THIS       2044
  87 #define JAVA_THROW      2045
  88 #define JAVA_THROWS     2046
  89 #define JAVA_UNION      2047
  90 #define JAVA_TRANSIENT  2048
  91 #define JAVA_TRUE       2049
  92 #define JAVA_TRY        2050
  93 #define JAVA_VOID       2051
  94 #define JAVA_VOLATILE   2052
  95 #define JAVA_WHILE      2053
  96 #define JAVA_WIDEFP     2054
  97 struct keyword { char *name; int token; };
  98 
  99 #define TOTAL_KEYWORDS 54
 100 #define MIN_WORD_LENGTH 2
 101 #define MAX_WORD_LENGTH 12
 102 #define MIN_HASH_VALUE 4
 103 #define MAX_HASH_VALUE 82
 104 /* maximum key range = 79, duplicates = 0 */
 105 
 106 #ifdef __GNUC__
 107 __inline
 108 #else
 109 #ifdef __cplusplus
 110 inline
 111 #endif
 112 #endif
 113 static unsigned int
 114 java_hash (register const char *str, register unsigned int len)
 115 {
 116   static unsigned char asso_values[] =
 117     {
 118       83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
 119       83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
 120       83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
 121       83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
 122       83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
 123       83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
 124       83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
 125       83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
 126       83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
 127       83, 83, 83, 83, 83, 83, 83, 25, 15, 30,
 128       50, 25, 20, 35,  0, 10, 83, 83, 40, 50,
 129       10,  5, 10, 83,  5,  5,  0,  5, 55, 40,
 130       15, 35, 83, 83, 83, 83, 83, 83, 83, 83,
 131       83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
 132       83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
 133       83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
 134       83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
 135       83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
 136       83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
 137       83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
 138       83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
 139       83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
 140       83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
 141       83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
 142       83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
 143       83, 83, 83, 83, 83, 83
 144     };
 145   return len + asso_values[(unsigned char)str[1]] + asso_values[(unsigned char)str[0]];
 146 }
 147 
 148 #ifdef __GNUC__
 149 __inline
 150 #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
 151 __attribute__ ((__gnu_inline__))
 152 #endif
 153 #endif
 154 struct keyword *
 155 java_lookup (register const char *str, register unsigned int len)
 156 {
 157   static struct keyword wordlist[] =
 158     {
 159       {""}, {""}, {""}, {""},
 160       {"this", JAVA_THIS},
 161       {"throw", JAVA_THROW},
 162       {"throws", JAVA_THROWS},
 163       {""},
 164       {"try", JAVA_TRY},
 165       {"true", JAVA_TRUE},
 166       {"short", JAVA_SHORT},
 167       {"static", JAVA_STATIC},
 168       {""},
 169       {"strictfp", JAVA_STRICTFP},
 170       {"transient", JAVA_TRANSIENT},
 171       {"super", JAVA_SUPER},
 172       {""}, {""}, {""},
 173       {"null", JAVA_NULL},
 174       {"union", JAVA_UNION},
 175       {"public", JAVA_PUBLIC},
 176       {"private", JAVA_PRIVATE},
 177       {"int", JAVA_INT},
 178       {"protected", JAVA_PROTECTED},
 179       {"break", JAVA_BREAK},
 180       {""},
 181       {"boolean", JAVA_BOOLEAN},
 182       {"for", JAVA_FOR},
 183       {"interface", JAVA_INTERFACE},
 184       {"instanceof", JAVA_INSTANCEOF},
 185       {""},
 186       {"if", JAVA_IF},
 187       {""},
 188       {"char", JAVA_CHAR},
 189       {"final", JAVA_FINAL},
 190       {"return", JAVA_RETURN},
 191       {"finally", JAVA_FINALLY},
 192       {"new", JAVA_NEW},
 193       {"enum", JAVA_ENUM},
 194       {"const", JAVA_CONST},
 195       {"native", JAVA_NATIVE},
 196       {"package", JAVA_PACKAGE},
 197       {"continue", JAVA_CONTINUE},
 198       {"goto", JAVA_GOTO},
 199       {"while", JAVA_WHILE},
 200       {""},
 201       {"extends", JAVA_EXTENDS},
 202       {"abstract", JAVA_ABSTRACT},
 203       {"long", JAVA_LONG},
 204       {"false", JAVA_FALSE},
 205       {"switch", JAVA_SWITCH},
 206       {"synchronized", JAVA_SYNCHRONIZED},
 207       {""},
 208       {"byte", JAVA_BYTE},
 209       {""},
 210       {"widefp", JAVA_WIDEFP},
 211       {"do", JAVA_DO},
 212       {""},
 213       {"case", JAVA_CASE},
 214       {"catch", JAVA_CATCH},
 215       {"double", JAVA_DOUBLE},
 216       {""}, {""},
 217       {"void", JAVA_VOID},
 218       {"float", JAVA_FLOAT},
 219       {"import", JAVA_IMPORT},
 220       {""},
 221       {"volatile", JAVA_VOLATILE},
 222       {"else", JAVA_ELSE},
 223       {"implements", JAVA_IMPLEMENTS},
 224       {""}, {""}, {""}, {""},
 225       {"class", JAVA_CLASS},
 226       {""}, {""}, {""}, {""}, {""}, {""},
 227       {"default", JAVA_DEFAULT}
 228     };
 229 
 230   if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
 231     {
 232       register int key = java_hash (str, len);
 233 
 234       if (key <= MAX_HASH_VALUE && key >= 0)
 235         {
 236           register const char *s = wordlist[key].name;
 237 
 238           if (*str == *s && !strcmp (str + 1, s + 1))
 239             return &wordlist[key];
 240         }
 241     }
 242   return 0;
 243 }
 244 
 245 int
 246 java_reserved_word(const char *str, int len)
 247 {
 248         struct keyword *keyword;
 249 
 250         keyword = java_lookup(str, len);
 251         return (keyword && IS_RESERVED_WORD(keyword->token)) ? keyword->token : 0;
 252 }

/* [previous][next][first][last][top][bottom][index][help] */