Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/bcutil/attrlookup.h
5985 views
1
/*******************************************************************************
2
* Copyright (c) 1991, 2020 IBM Corp. and others
3
*
4
* This program and the accompanying materials are made available under
5
* the terms of the Eclipse Public License 2.0 which accompanies this
6
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
7
* or the Apache License, Version 2.0 which accompanies this distribution and
8
* is available at https://www.apache.org/licenses/LICENSE-2.0.
9
*
10
* This Source Code may also be made available under the following
11
* Secondary Licenses when the conditions for such availability set
12
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
13
* General Public License, version 2 with the GNU Classpath
14
* Exception [1] and GNU General Public License, version 2 with the
15
* OpenJDK Assembly Exception [2].
16
*
17
* [1] https://www.gnu.org/software/classpath/license.html
18
* [2] http://openjdk.java.net/legal/assembly-exception.html
19
*
20
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
21
*******************************************************************************/
22
23
/* ANSI-C code produced by gperf version 3.0.4 */
24
/* Command-line: gperf -CD -t --output-file=attrlookup.h attrlookup.gperf */
25
/* Computed positions: -k'2' */
26
27
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
28
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
29
&& (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
30
&& ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
31
&& ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
32
&& ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
33
&& ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
34
&& ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
35
&& ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
36
&& ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
37
&& ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
38
&& ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
39
&& ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
40
&& ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
41
&& ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
42
&& ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
43
&& ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
44
&& ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
45
&& ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
46
&& ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
47
&& ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
48
&& ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
49
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
50
/* The character set is not based on ISO-646. */
51
#error "gperf generated tables don't work with this execution character set. Please report a bug to <[email protected]>."
52
#endif
53
54
#line 39 "attrlookup.gperf"
55
struct AttribType
56
{
57
const char *name;
58
U_8 attribCode;
59
U_8 strippedAttribCode;
60
};
61
62
#define TOTAL_KEYWORDS 28
63
#define MIN_WORD_LENGTH 4
64
#define MAX_WORD_LENGTH 36
65
#define MIN_HASH_VALUE 4
66
#define MAX_HASH_VALUE 50
67
/* maximum key range = 47, duplicates = 0 */
68
69
#ifdef __GNUC__
70
__inline
71
#else
72
#ifdef __cplusplus
73
inline
74
#endif
75
#endif
76
static unsigned int
77
attributeHash (register const char *str, register unsigned int len)
78
{
79
static const unsigned char asso_values[] =
80
{
81
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
82
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
83
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
84
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
85
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
86
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
87
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
88
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
89
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
90
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
91
51, 31, 51, 51, 51, 15, 51, 51, 51, 51,
92
0, 0, 51, 51, 51, 51, 15, 0, 51, 51,
93
25, 0, 51, 51, 51, 51, 51, 51, 51, 51,
94
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
95
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
96
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
97
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
98
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
99
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
100
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
101
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
102
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
103
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
104
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
105
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
106
51, 51, 51, 51, 51, 51
107
};
108
return len + asso_values[(unsigned char)str[1]];
109
}
110
111
#ifdef __GNUC__
112
__inline
113
#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
114
__attribute__ ((__gnu_inline__))
115
#endif
116
#endif
117
const struct AttribType *
118
lookupKnownAttribute (register const char *str, register unsigned int len)
119
{
120
static const struct AttribType wordlist[] =
121
{
122
#line 47 "attrlookup.gperf"
123
{"Code", CFR_ATTRIBUTE_Code, CFR_ATTRIBUTE_Code},
124
#line 49 "attrlookup.gperf"
125
{"Synthetic", CFR_ATTRIBUTE_Synthetic, CFR_ATTRIBUTE_Synthetic},
126
#line 53 "attrlookup.gperf"
127
{"SourceFile", CFR_ATTRIBUTE_SourceFile, CFR_ATTRIBUTE_SourceFile},
128
#line 54 "attrlookup.gperf"
129
{"InnerClasses", CFR_ATTRIBUTE_InnerClasses, CFR_ATTRIBUTE_InnerClasses},
130
#line 55 "attrlookup.gperf"
131
{"ConstantValue", CFR_ATTRIBUTE_ConstantValue, CFR_ATTRIBUTE_ConstantValue},
132
#line 57 "attrlookup.gperf"
133
{"EnclosingMethod", CFR_ATTRIBUTE_EnclosingMethod, CFR_ATTRIBUTE_EnclosingMethod},
134
#line 59 "attrlookup.gperf"
135
{"BootstrapMethods", CFR_ATTRIBUTE_BootstrapMethods, CFR_ATTRIBUTE_BootstrapMethods},
136
#line 60 "attrlookup.gperf"
137
{"AnnotationDefault", CFR_ATTRIBUTE_AnnotationDefault, CFR_ATTRIBUTE_AnnotationDefault},
138
#line 61 "attrlookup.gperf"
139
{"LocalVariableTable", CFR_ATTRIBUTE_LocalVariableTable, CFR_ATTRIBUTE_StrippedLocalVariableTable},
140
#line 62 "attrlookup.gperf"
141
{"SourceDebugExtension", CFR_ATTRIBUTE_SourceDebugExtension, CFR_ATTRIBUTE_StrippedSourceDebugExtension},
142
#line 63 "attrlookup.gperf"
143
{"LocalVariableTypeTable", CFR_ATTRIBUTE_LocalVariableTypeTable, CFR_ATTRIBUTE_StrippedLocalVariableTypeTable},
144
#line 48 "attrlookup.gperf"
145
{"StackMap", CFR_ATTRIBUTE_StackMap, CFR_ATTRIBUTE_StackMap},
146
#line 50 "attrlookup.gperf"
147
{"Signature", CFR_ATTRIBUTE_Signature, CFR_ATTRIBUTE_Signature},
148
#line 64 "attrlookup.gperf"
149
{"RuntimeVisibleAnnotations", CFR_ATTRIBUTE_RuntimeVisibleAnnotations, CFR_ATTRIBUTE_RuntimeVisibleAnnotations},
150
#line 65 "attrlookup.gperf"
151
{"RuntimeInvisibleAnnotations", CFR_ATTRIBUTE_RuntimeInvisibleAnnotations, CFR_ATTRIBUTE_RuntimeInvisibleAnnotations},
152
#line 56 "attrlookup.gperf"
153
{"StackMapTable", CFR_ATTRIBUTE_StackMapTable, CFR_ATTRIBUTE_StackMapTable},
154
#line 66 "attrlookup.gperf"
155
{"RuntimeVisibleTypeAnnotations", CFR_ATTRIBUTE_RuntimeVisibleTypeAnnotations, CFR_ATTRIBUTE_RuntimeVisibleTypeAnnotations},
156
#line 58 "attrlookup.gperf"
157
{"LineNumberTable", CFR_ATTRIBUTE_LineNumberTable, CFR_ATTRIBUTE_StrippedLineNumberTable},
158
#line 67 "attrlookup.gperf"
159
{"RuntimeInvisibleTypeAnnotations", CFR_ATTRIBUTE_RuntimeInvisibleTypeAnnotations, CFR_ATTRIBUTE_RuntimeInvisibleTypeAnnotations},
160
#line 68 "attrlookup.gperf"
161
{"RuntimeVisibleParameterAnnotations", CFR_ATTRIBUTE_RuntimeVisibleParameterAnnotations, CFR_ATTRIBUTE_RuntimeVisibleParameterAnnotations},
162
#line 52 "attrlookup.gperf"
163
{"Exceptions", CFR_ATTRIBUTE_Exceptions, CFR_ATTRIBUTE_Exceptions},
164
#line 69 "attrlookup.gperf"
165
{"RuntimeInvisibleParameterAnnotations", CFR_ATTRIBUTE_RuntimeInvisibleParameterAnnotations, CFR_ATTRIBUTE_RuntimeInvisibleParameterAnnotations},
166
#line 73 "attrlookup.gperf"
167
{"Record", CFR_ATTRIBUTE_Record, CFR_ATTRIBUTE_Record},
168
#line 72 "attrlookup.gperf"
169
{"NestHost", CFR_ATTRIBUTE_NestHost, CFR_ATTRIBUTE_NestHost},
170
#line 51 "attrlookup.gperf"
171
{"Deprecated", CFR_ATTRIBUTE_Deprecated, CFR_ATTRIBUTE_Deprecated},
172
#line 71 "attrlookup.gperf"
173
{"NestMembers", CFR_ATTRIBUTE_NestMembers, CFR_ATTRIBUTE_NestMembers},
174
#line 70 "attrlookup.gperf"
175
{"MethodParameters", CFR_ATTRIBUTE_MethodParameters, CFR_ATTRIBUTE_MethodParameters},
176
#line 74 "attrlookup.gperf"
177
{"PermittedSubclasses", CFR_ATTRIBUTE_PermittedSubclasses, CFR_ATTRIBUTE_PermittedSubclasses}
178
};
179
180
static const signed char lookup[] =
181
{
182
-1, -1, -1, -1, 0, -1, -1, -1, -1, 1, 2, -1, 3, 4,
183
-1, 5, 6, 7, 8, -1, 9, -1, 10, 11, 12, 13, -1, 14,
184
15, 16, 17, 18, -1, -1, 19, 20, 21, 22, -1, 23, -1, 24,
185
25, -1, -1, -1, -1, 26, -1, -1, 27
186
};
187
188
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
189
{
190
register int key = attributeHash (str, len);
191
192
if (key <= MAX_HASH_VALUE && key >= 0)
193
{
194
register int index = lookup[key];
195
196
if (index >= 0)
197
{
198
register const char *s = wordlist[index].name;
199
200
if (*str == *s && !strcmp (str + 1, s + 1))
201
return &wordlist[index];
202
}
203
}
204
}
205
return 0;
206
}
207
208