Path: blob/master/runtime/bcutil/attrlookup.h
12809 views
/*******************************************************************************1* Copyright (c) 1991, 2020 IBM Corp. and others2*3* This program and the accompanying materials are made available under4* the terms of the Eclipse Public License 2.0 which accompanies this5* distribution and is available at https://www.eclipse.org/legal/epl-2.0/6* or the Apache License, Version 2.0 which accompanies this distribution and7* is available at https://www.apache.org/licenses/LICENSE-2.0.8*9* This Source Code may also be made available under the following10* Secondary Licenses when the conditions for such availability set11* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU12* General Public License, version 2 with the GNU Classpath13* Exception [1] and GNU General Public License, version 2 with the14* OpenJDK Assembly Exception [2].15*16* [1] https://www.gnu.org/software/classpath/license.html17* [2] http://openjdk.java.net/legal/assembly-exception.html18*19* 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-exception20*******************************************************************************/2122/* ANSI-C code produced by gperf version 3.0.4 */23/* Command-line: gperf -CD -t --output-file=attrlookup.h attrlookup.gperf */24/* Computed positions: -k'2' */2526#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \27&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \28&& (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \29&& ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \30&& ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \31&& ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \32&& ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \33&& ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \34&& ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \35&& ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \36&& ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \37&& ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \38&& ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \39&& ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \40&& ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \41&& ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \42&& ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \43&& ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \44&& ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \45&& ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \46&& ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \47&& ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \48&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))49/* The character set is not based on ISO-646. */50#error "gperf generated tables don't work with this execution character set. Please report a bug to <[email protected]>."51#endif5253#line 39 "attrlookup.gperf"54struct AttribType55{56const char *name;57U_8 attribCode;58U_8 strippedAttribCode;59};6061#define TOTAL_KEYWORDS 2862#define MIN_WORD_LENGTH 463#define MAX_WORD_LENGTH 3664#define MIN_HASH_VALUE 465#define MAX_HASH_VALUE 5066/* maximum key range = 47, duplicates = 0 */6768#ifdef __GNUC__69__inline70#else71#ifdef __cplusplus72inline73#endif74#endif75static unsigned int76attributeHash (register const char *str, register unsigned int len)77{78static const unsigned char asso_values[] =79{8051, 51, 51, 51, 51, 51, 51, 51, 51, 51,8151, 51, 51, 51, 51, 51, 51, 51, 51, 51,8251, 51, 51, 51, 51, 51, 51, 51, 51, 51,8351, 51, 51, 51, 51, 51, 51, 51, 51, 51,8451, 51, 51, 51, 51, 51, 51, 51, 51, 51,8551, 51, 51, 51, 51, 51, 51, 51, 51, 51,8651, 51, 51, 51, 51, 51, 51, 51, 51, 51,8751, 51, 51, 51, 51, 51, 51, 51, 51, 51,8851, 51, 51, 51, 51, 51, 51, 51, 51, 51,8951, 51, 51, 51, 51, 51, 51, 51, 51, 51,9051, 31, 51, 51, 51, 15, 51, 51, 51, 51,910, 0, 51, 51, 51, 51, 15, 0, 51, 51,9225, 0, 51, 51, 51, 51, 51, 51, 51, 51,9351, 51, 51, 51, 51, 51, 51, 51, 51, 51,9451, 51, 51, 51, 51, 51, 51, 51, 51, 51,9551, 51, 51, 51, 51, 51, 51, 51, 51, 51,9651, 51, 51, 51, 51, 51, 51, 51, 51, 51,9751, 51, 51, 51, 51, 51, 51, 51, 51, 51,9851, 51, 51, 51, 51, 51, 51, 51, 51, 51,9951, 51, 51, 51, 51, 51, 51, 51, 51, 51,10051, 51, 51, 51, 51, 51, 51, 51, 51, 51,10151, 51, 51, 51, 51, 51, 51, 51, 51, 51,10251, 51, 51, 51, 51, 51, 51, 51, 51, 51,10351, 51, 51, 51, 51, 51, 51, 51, 51, 51,10451, 51, 51, 51, 51, 51, 51, 51, 51, 51,10551, 51, 51, 51, 51, 51106};107return len + asso_values[(unsigned char)str[1]];108}109110#ifdef __GNUC__111__inline112#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__113__attribute__ ((__gnu_inline__))114#endif115#endif116const struct AttribType *117lookupKnownAttribute (register const char *str, register unsigned int len)118{119static const struct AttribType wordlist[] =120{121#line 47 "attrlookup.gperf"122{"Code", CFR_ATTRIBUTE_Code, CFR_ATTRIBUTE_Code},123#line 49 "attrlookup.gperf"124{"Synthetic", CFR_ATTRIBUTE_Synthetic, CFR_ATTRIBUTE_Synthetic},125#line 53 "attrlookup.gperf"126{"SourceFile", CFR_ATTRIBUTE_SourceFile, CFR_ATTRIBUTE_SourceFile},127#line 54 "attrlookup.gperf"128{"InnerClasses", CFR_ATTRIBUTE_InnerClasses, CFR_ATTRIBUTE_InnerClasses},129#line 55 "attrlookup.gperf"130{"ConstantValue", CFR_ATTRIBUTE_ConstantValue, CFR_ATTRIBUTE_ConstantValue},131#line 57 "attrlookup.gperf"132{"EnclosingMethod", CFR_ATTRIBUTE_EnclosingMethod, CFR_ATTRIBUTE_EnclosingMethod},133#line 59 "attrlookup.gperf"134{"BootstrapMethods", CFR_ATTRIBUTE_BootstrapMethods, CFR_ATTRIBUTE_BootstrapMethods},135#line 60 "attrlookup.gperf"136{"AnnotationDefault", CFR_ATTRIBUTE_AnnotationDefault, CFR_ATTRIBUTE_AnnotationDefault},137#line 61 "attrlookup.gperf"138{"LocalVariableTable", CFR_ATTRIBUTE_LocalVariableTable, CFR_ATTRIBUTE_StrippedLocalVariableTable},139#line 62 "attrlookup.gperf"140{"SourceDebugExtension", CFR_ATTRIBUTE_SourceDebugExtension, CFR_ATTRIBUTE_StrippedSourceDebugExtension},141#line 63 "attrlookup.gperf"142{"LocalVariableTypeTable", CFR_ATTRIBUTE_LocalVariableTypeTable, CFR_ATTRIBUTE_StrippedLocalVariableTypeTable},143#line 48 "attrlookup.gperf"144{"StackMap", CFR_ATTRIBUTE_StackMap, CFR_ATTRIBUTE_StackMap},145#line 50 "attrlookup.gperf"146{"Signature", CFR_ATTRIBUTE_Signature, CFR_ATTRIBUTE_Signature},147#line 64 "attrlookup.gperf"148{"RuntimeVisibleAnnotations", CFR_ATTRIBUTE_RuntimeVisibleAnnotations, CFR_ATTRIBUTE_RuntimeVisibleAnnotations},149#line 65 "attrlookup.gperf"150{"RuntimeInvisibleAnnotations", CFR_ATTRIBUTE_RuntimeInvisibleAnnotations, CFR_ATTRIBUTE_RuntimeInvisibleAnnotations},151#line 56 "attrlookup.gperf"152{"StackMapTable", CFR_ATTRIBUTE_StackMapTable, CFR_ATTRIBUTE_StackMapTable},153#line 66 "attrlookup.gperf"154{"RuntimeVisibleTypeAnnotations", CFR_ATTRIBUTE_RuntimeVisibleTypeAnnotations, CFR_ATTRIBUTE_RuntimeVisibleTypeAnnotations},155#line 58 "attrlookup.gperf"156{"LineNumberTable", CFR_ATTRIBUTE_LineNumberTable, CFR_ATTRIBUTE_StrippedLineNumberTable},157#line 67 "attrlookup.gperf"158{"RuntimeInvisibleTypeAnnotations", CFR_ATTRIBUTE_RuntimeInvisibleTypeAnnotations, CFR_ATTRIBUTE_RuntimeInvisibleTypeAnnotations},159#line 68 "attrlookup.gperf"160{"RuntimeVisibleParameterAnnotations", CFR_ATTRIBUTE_RuntimeVisibleParameterAnnotations, CFR_ATTRIBUTE_RuntimeVisibleParameterAnnotations},161#line 52 "attrlookup.gperf"162{"Exceptions", CFR_ATTRIBUTE_Exceptions, CFR_ATTRIBUTE_Exceptions},163#line 69 "attrlookup.gperf"164{"RuntimeInvisibleParameterAnnotations", CFR_ATTRIBUTE_RuntimeInvisibleParameterAnnotations, CFR_ATTRIBUTE_RuntimeInvisibleParameterAnnotations},165#line 73 "attrlookup.gperf"166{"Record", CFR_ATTRIBUTE_Record, CFR_ATTRIBUTE_Record},167#line 72 "attrlookup.gperf"168{"NestHost", CFR_ATTRIBUTE_NestHost, CFR_ATTRIBUTE_NestHost},169#line 51 "attrlookup.gperf"170{"Deprecated", CFR_ATTRIBUTE_Deprecated, CFR_ATTRIBUTE_Deprecated},171#line 71 "attrlookup.gperf"172{"NestMembers", CFR_ATTRIBUTE_NestMembers, CFR_ATTRIBUTE_NestMembers},173#line 70 "attrlookup.gperf"174{"MethodParameters", CFR_ATTRIBUTE_MethodParameters, CFR_ATTRIBUTE_MethodParameters},175#line 74 "attrlookup.gperf"176{"PermittedSubclasses", CFR_ATTRIBUTE_PermittedSubclasses, CFR_ATTRIBUTE_PermittedSubclasses}177};178179static const signed char lookup[] =180{181-1, -1, -1, -1, 0, -1, -1, -1, -1, 1, 2, -1, 3, 4,182-1, 5, 6, 7, 8, -1, 9, -1, 10, 11, 12, 13, -1, 14,18315, 16, 17, 18, -1, -1, 19, 20, 21, 22, -1, 23, -1, 24,18425, -1, -1, -1, -1, 26, -1, -1, 27185};186187if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)188{189register int key = attributeHash (str, len);190191if (key <= MAX_HASH_VALUE && key >= 0)192{193register int index = lookup[key];194195if (index >= 0)196{197register const char *s = wordlist[index].name;198199if (*str == *s && !strcmp (str + 1, s + 1))200return &wordlist[index];201}202}203}204return 0;205}206207208