libutap  0.93
Uppaal Timed Automata Parser
tags.cc
Go to the documentation of this file.
1 /* C++ code produced by gperf version 3.1 */
2 /* Command-line: gperf -C -E -t -L C++ -c -K str -Z Tags tags.gperf */
3 /* Computed positions: -k'1,3' */
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 #line 1 "tags.gperf"
33 struct Tag { const char *str; tag_t tag; };
34 /* maximum key range = 48, duplicates = 0 */
35 
36 class Tags
37 {
38 private:
39  static inline unsigned int hash (const char *str, size_t len);
40 public:
41  static const struct Tag *in_word_set (const char *str, size_t len);
42 };
43 
44 inline unsigned int
45 Tags::hash (const char *str, size_t len)
46 {
47  static const unsigned char asso_values[] =
48  {
49  52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
50  52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
51  52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52  52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
53  52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
54  52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
55  52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
56  52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
57  52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
58  52, 52, 52, 52, 52, 52, 52, 10, 15, 5,
59  35, 10, 10, 5, 52, 0, 52, 52, 10, 5,
60  20, 5, 20, 5, 20, 0, 15, 5, 52, 52,
61  52, 0, 52, 52, 52, 52, 52, 52, 52, 52,
62  52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
63  52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
64  52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
65  52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
66  52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
67  52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
68  52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
69  52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
70  52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
71  52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
72  52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
73  52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
74  52, 52, 52, 52, 52, 52
75  };
76  return len + asso_values[static_cast<unsigned char>(str[2])] + asso_values[static_cast<unsigned char>(str[0])];
77 }
78 
79 const struct Tag *
80 Tags::in_word_set (const char *str, size_t len)
81 {
82  enum
83  {
84  TOTAL_KEYWORDS = 36,
85  MIN_WORD_LENGTH = 3,
86  MAX_WORD_LENGTH = 13,
87  MIN_HASH_VALUE = 4,
88  MAX_HASH_VALUE = 51
89  };
90 
91  static const struct Tag wordlist[] =
92  {
93  {""}, {""}, {""}, {""},
94 #line 12 "tags.gperf"
95  {"init", TAG_INIT},
96  {""},
97 #line 8 "tags.gperf"
98  {"system", TAG_SYSTEM},
99  {""},
100 #line 28 "tags.gperf"
101  {"instance", TAG_INSTANCE},
102 #line 34 "tags.gperf"
103  {"sbml", TAG_SBML},
104  {""},
105 #line 17 "tags.gperf"
106  {"source", TAG_SOURCE},
107 #line 30 "tags.gperf"
108  {"message", TAG_MESSAGE},
109 #line 7 "tags.gperf"
110  {"instantiation", TAG_INSTANTIATION},
111 #line 25 "tags.gperf"
112  {"yloccoord", TAG_YLOCCOORD},
113  {""},
114 #line 14 "tags.gperf"
115  {"urgent", TAG_URGENT},
116 #line 38 "tags.gperf"
117  {"comment", TAG_COMMENT},
118 #line 22 "tags.gperf"
119  {"lsc", TAG_LSC},
120 #line 15 "tags.gperf"
121  {"committed", TAG_COMMITTED},
122 #line 36 "tags.gperf"
123  {"query", TAG_QUERY},
124 #line 33 "tags.gperf"
125  {"anchor", TAG_ANCHOR},
126 #line 35 "tags.gperf"
127  {"queries", TAG_QUERIES},
128 #line 11 "tags.gperf"
129  {"location", TAG_LOCATION},
130 #line 20 "tags.gperf"
131  {"nail", TAG_NAIL},
132  {""},
133 #line 26 "tags.gperf"
134  {"lsclocation", TAG_LSCLOCATION},
135 #line 4 "tags.gperf"
136  {"imports", TAG_IMPORTS},
137 #line 6 "tags.gperf"
138  {"template", TAG_TEMPLATE},
139 #line 9 "tags.gperf"
140  {"name", TAG_NAME},
141 #line 19 "tags.gperf"
142  {"label", TAG_LABEL},
143 #line 29 "tags.gperf"
144  {"temperature", TAG_TEMPERATURE},
145 #line 21 "tags.gperf"
146  {"project", TAG_PROJECT},
147 #line 3 "tags.gperf"
148  {"nta", TAG_NTA},
149 #line 31 "tags.gperf"
150  {"condition", TAG_CONDITION},
151 #line 13 "tags.gperf"
152  {"transition", TAG_TRANSITION},
153 #line 16 "tags.gperf"
154  {"branchpoint", TAG_BRANCHPOINT},
155 #line 37 "tags.gperf"
156  {"formula", TAG_FORMULA},
157 #line 27 "tags.gperf"
158  {"prechart", TAG_PRECHART},
159 #line 23 "tags.gperf"
160  {"type", TAG_TYPE},
161  {""},
162 #line 18 "tags.gperf"
163  {"target", TAG_TARGET},
164  {""}, {""},
165 #line 24 "tags.gperf"
166  {"mode", TAG_MODE},
167  {""},
168 #line 32 "tags.gperf"
169  {"update", TAG_UPDATE},
170  {""}, {""},
171 #line 10 "tags.gperf"
172  {"parameter", TAG_PARAMETER},
173  {""},
174 #line 5 "tags.gperf"
175  {"declaration", TAG_DECLARATION}
176  };
177 
178  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
179  {
180  unsigned int key = hash (str, len);
181 
182  if (key <= MAX_HASH_VALUE)
183  {
184  const char *s = wordlist[key].str;
185 
186  if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
187  return &wordlist[key];
188  }
189  }
190  return 0;
191 }
192 #line 39 "tags.gperf"
193 
tag_t
Enumeration type for tags.
Definition: xmlreader.cpp:57