Coverage Report

Created: 2025-07-07 10:01

/work/workdir/CustomTarget/editeng/generated/tokens.cxx
Line
Count
Source (jump to first uncovered line)
1
/* C++ code produced by gperf version 3.1 */
2
/* Command-line: /usr/bin/gperf --compare-strncmp --readonly-tables /work/workdir/CustomTarget/editeng/generated/tokens.gperf  */
3
/* Computed positions: -k'1' */
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-gperf@gnu.org>."
30
#endif
31
32
struct xmltoken
33
{
34
  const char *name; XMLTokenEnum nToken;
35
};
36
37
#define TOTAL_KEYWORDS 7
38
0
#define MIN_WORD_LENGTH 4
39
0
#define MAX_WORD_LENGTH 16
40
#define MIN_HASH_VALUE 4
41
0
#define MAX_HASH_VALUE 21
42
/* maximum key range = 18, duplicates = 0 */
43
44
class Perfect_Hash
45
{
46
private:
47
  static inline unsigned int hash (const char *str, size_t len);
48
public:
49
  static const struct xmltoken *in_word_set (const char *str, size_t len);
50
};
51
52
inline unsigned int
53
Perfect_Hash::hash (const char *str, size_t len)
54
0
{
55
0
  static const unsigned char asso_values[] =
56
0
    {
57
0
      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
58
0
      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
59
0
      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
60
0
      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
61
0
      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
62
0
      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
63
0
      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
64
0
      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
65
0
      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
66
0
      22, 22, 22, 22, 22, 22, 22,  5,  0, 22,
67
0
      22, 22, 22, 22, 22, 22, 22, 22,  0, 22,
68
0
       0, 22,  0, 22, 22, 22, 22,  0, 22, 22,
69
0
      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
70
0
      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
71
0
      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
72
0
      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
73
0
      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
74
0
      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
75
0
      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
76
0
      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
77
0
      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
78
0
      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
79
0
      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
80
0
      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
81
0
      22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
82
0
      22, 22, 22, 22, 22, 22
83
0
    };
84
0
  return len + asso_values[static_cast<unsigned char>(str[0])];
85
0
}
86
87
static const struct xmltoken wordlist[] =
88
  {
89
    {(char*)0, XML_TOKEN_INVALID}, {(char*)0, XML_TOKEN_INVALID}, {(char*)0, XML_TOKEN_INVALID}, {(char*)0, XML_TOKEN_INVALID},
90
    {"name",XML_NAME},
91
    {"block",XML_BLOCK},
92
    {(char*)0, XML_TOKEN_INVALID}, {(char*)0, XML_TOKEN_INVALID}, {(char*)0, XML_TOKEN_INVALID},
93
    {"list-name",XML_LIST_NAME},
94
    {"block-list",XML_BLOCK_LIST},
95
    {(char*)0, XML_TOKEN_INVALID},
96
    {"package-name",XML_PACKAGE_NAME},
97
    {(char*)0, XML_TOKEN_INVALID}, {(char*)0, XML_TOKEN_INVALID}, {(char*)0, XML_TOKEN_INVALID},
98
    {"unformatted-text",XML_UNFORMATTED_TEXT},
99
    {(char*)0, XML_TOKEN_INVALID}, {(char*)0, XML_TOKEN_INVALID}, {(char*)0, XML_TOKEN_INVALID}, {(char*)0, XML_TOKEN_INVALID},
100
    {"abbreviated-name",XML_ABBREVIATED_NAME}
101
  };
102
103
const struct xmltoken *
104
Perfect_Hash::in_word_set (const char *str, size_t len)
105
0
{
106
0
  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
107
0
    {
108
0
      unsigned int key = hash (str, len);
109
110
0
      if (key <= MAX_HASH_VALUE)
111
0
        {
112
0
          const char *s = wordlist[key].name;
113
114
0
          if (s && *str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
115
0
            return &wordlist[key];
116
0
        }
117
0
    }
118
0
  return 0;
119
0
}
120