ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/preprocess
Revision: 1.2
Committed: Thu Aug 31 09:19:34 2006 UTC (17 years, 8 months ago) by root
Branch: MAIN
Changes since 1.1: +1 -1 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 #!/opt/bin/perl
2
3 # todo: gather dynamically
4 my @kw = qw(
5 ac
6 activate_on_push
7 activate_on_release
8 alive
9 anim_speed
10 animation
11 applied
12 arch
13 armour
14 attach
15 attack_movement
16 attacktype
17 auto_apply
18 been_applied
19 berserk
20 blocksview
21 body_range
22 body_arm
23 body_torso
24 body_head
25 body_neck
26 body_skill
27 body_finger
28 body_shoulder
29 body_foot
30 body_hand
31 body_wrist
32 body_waist
33 can_apply
34 can_cast_spell
35 can_roll
36 can_see_in_dark
37 can_use_armour
38 can_use_bow
39 can_use_horn
40 can_use_range
41 can_use_ring
42 can_use_rod
43 can_use_scroll
44 can_use_shield
45 can_use_skill
46 can_use_wand
47 can_use_weapon
48 carrying
49 casting_time
50 cha
51 changing
52 client_type
53 con
54 confused
55 connected
56 container
57 cursed
58 custom_name
59 dam
60 dam_modifier
61 damned
62 dex
63 direction
64 duration
65 duration_modifier
66 editable
67 editor_folder
68 elevation
69 end
70 endlore
71 endmsg
72 exp
73 expmul
74 face
75 food
76 friendly
77 gen_sp_armour
78 generator
79 glow_radius
80 grace
81 has_ready_bow
82 has_ready_horn
83 has_ready_rod
84 has_ready_scroll
85 has_ready_skill
86 has_ready_wand
87 has_ready_weapon
88 hitback
89 hp
90 identified
91 immune
92 int
93 inv_locked
94 invisible
95 is_animated
96 is_blind
97 is_buildable
98 is_cauldron
99 is_floor
100 is_hilly
101 is_lightable
102 is_thrown
103 is_turnable
104 is_used_up
105 is_water
106 is_wooded
107 item_power
108 known_cursed
109 known_magical
110 last_eat
111 last_grace
112 last_heal
113 last_sp
114 level
115 lifesave
116 lore
117 luck
118 magic
119 make_invisible
120 material
121 materialname
122 maxgrace
123 maxhp
124 maxsp
125 monster
126 more
127 move_allow
128 move_block
129 move_off
130 move_on
131 move_slow
132 move_slow_penalty
133 move_state
134 move_type
135 msg
136 name
137 name_pl
138 neutral
139 no_attack
140 no_damage
141 no_drop
142 no_fix_player
143 no_magic
144 no_pick
145 no_skill_ident
146 no_steal
147 no_strength
148 nrof
149 object
150 oid
151 one_hit
152 only_attack
153 other_arch
154 overlay_floor
155 path_attuned
156 path_denied
157 path_repelled
158 perm_exp
159 pick_up
160 pow
161 protected
162 race
163 random_move
164 random_movement
165 randomitems
166 range
167 range_modifier
168 reflect_missile
169 reflect_spell
170 reflecting
171 resist_acid
172 resist_blind
173 resist_cancellation
174 resist_chaos
175 resist_cold
176 resist_confusion
177 resist_counterspell
178 resist_death
179 resist_deplete
180 resist_disease
181 resist_drain
182 resist_electricity
183 resist_fear
184 resist_fire
185 resist_ghosthit
186 resist_godpower
187 resist_holyword
188 resist_internal
189 resist_life_stealing
190 resist_magic
191 resist_paralyze
192 resist_physical
193 resist_poison
194 resist_slow
195 resist_turn_undead
196 resist_weaponmagic
197 run_away
198 scared
199 see_anywhere
200 see_invisible
201 skill
202 slaying
203 sleep
204 slow_move
205 smoothlevel
206 sp
207 speed
208 speed_left
209 splitting
210 stand_still
211 startequip
212 state
213 stealth
214 str
215 subtype
216 tear_down
217 title
218 tooltype
219 treasure
220 type
221 unaggressive
222 undead
223 unique
224 unpaid
225 use_content_on_gen
226 value
227 vulnerable
228 was_wiz
229 wc
230 weapontype
231 weight
232 will_apply
233 wis
234 wiz
235 x
236 xrays
237 y
238 );
239
240 open GPERF, "|-", "gperf -m50 >kw_hash.h"
241 or die "gperf: $!";
242
243 print GPERF <<EOF;
244 %language=C++
245 %enum
246 %define class-name kw_lex
247 %define lookup-function-name match
248 %struct-type
249 %compare-strncmp
250 %delimiters=,
251 struct keyword_idx { const char *name; enum keyword index; };
252 %%
253 EOF
254
255 for (@kw) {
256 printf GPERF "%s,%s\n", $_, "KW_" . uc;
257 }
258
259 print GPERF <<EOF;
260 %%
261 const char *const keyword_str [] = {
262 "<EOF>",
263 "<ERROR>",
264 EOF
265
266 for (@kw) {
267 printf GPERF " \"%s\",\n", $_;
268 }
269
270 print GPERF "};\n\n";
271
272 open KW, ">", "keyword.h";
273
274 print KW <<EOF;
275 #ifndef KW_H__
276 #define KW_H__
277
278 enum keyword {
279 KW_eof, KW_error,
280 EOF
281
282 for (@kw) {
283 printf KW " %s,\n", "KW_" . uc;
284 }
285
286 print KW <<EOF;
287 NUM_KEYWORD,
288 };
289
290 extern const char *const keyword_str [];
291
292 #endif
293
294 EOF
295