02f3ff8ff6b0128d0893362f0fe2492b3051aa73
[p5sagit/p5-mst-13.2.git] / keywords.pl
1 #!/usr/bin/perl
2
3 unlink "keywords.h";
4 open(KW, ">keywords.h") || die "Can't create keywords.h: $!\n";
5 select KW;
6
7 print <<EOM;
8 /*
9  *    keywords.h
10  *
11  *    Copyright (c) 1997-2002, Larry Wall
12  *
13  *    You may distribute under the terms of either the GNU General Public
14  *    License or the Artistic License, as specified in the README file.
15  *
16  * !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
17  *  This file is built by keywords.pl from its data.  Any changes made here
18  *  will be lost!
19  */
20 EOM
21
22 # Read & print data.
23
24 $keynum = 0;
25 while (<DATA>) {
26     chop;
27     next unless $_;
28     next if /^#/;
29     ($keyword) = split;
30     print &tab(5, "#define KEY_$keyword"), $keynum++, "\n";
31 }
32
33 ###########################################################################
34 sub tab {
35     local($l, $t) = @_;
36     $t .= "\t" x ($l - (length($t) + 1) / 8);
37     $t;
38 }
39 ###########################################################################
40 __END__
41
42 NULL
43 __FILE__
44 __LINE__
45 __PACKAGE__
46 __DATA__
47 __END__
48 AUTOLOAD
49 BEGIN
50 CORE
51 DESTROY
52 END
53 INIT
54 CHECK
55 abs
56 accept
57 alarm
58 and
59 atan2
60 bind
61 binmode
62 bless
63 caller
64 chdir
65 chmod
66 chomp
67 chop
68 chown
69 chr
70 chroot
71 close
72 closedir
73 cmp
74 connect
75 continue
76 cos
77 crypt
78 dbmclose
79 dbmopen
80 defined
81 delete
82 die
83 do
84 dump
85 each
86 else
87 elsif
88 endgrent
89 endhostent
90 endnetent
91 endprotoent
92 endpwent
93 endservent
94 eof
95 eq
96 eval
97 exec
98 exists
99 exit
100 exp
101 fcntl
102 fileno
103 flock
104 for
105 foreach
106 fork
107 format
108 formline
109 ge
110 getc
111 getgrent
112 getgrgid
113 getgrnam
114 gethostbyaddr
115 gethostbyname
116 gethostent
117 getlogin
118 getnetbyaddr
119 getnetbyname
120 getnetent
121 getpeername
122 getpgrp
123 getppid
124 getpriority
125 getprotobyname
126 getprotobynumber
127 getprotoent
128 getpwent
129 getpwnam
130 getpwuid
131 getservbyname
132 getservbyport
133 getservent
134 getsockname
135 getsockopt
136 glob
137 gmtime
138 goto
139 grep
140 gt
141 hex
142 if
143 index
144 int
145 ioctl
146 join
147 keys
148 kill
149 last
150 lc
151 lcfirst
152 le
153 length
154 link
155 listen
156 local
157 localtime
158 lock
159 log
160 lstat
161 lt
162 m
163 map
164 mkdir
165 msgctl
166 msgget
167 msgrcv
168 msgsnd
169 my
170 ne
171 next
172 no
173 not
174 oct
175 open
176 opendir
177 or
178 ord
179 our
180 pack
181 package
182 pipe
183 pop
184 pos
185 print
186 printf
187 prototype
188 push
189 q
190 qq
191 qr
192 quotemeta
193 qw
194 qx
195 rand
196 read
197 readdir
198 readline
199 readlink
200 readpipe
201 recv
202 redo
203 ref
204 rename
205 require
206 reset
207 return
208 reverse
209 rewinddir
210 rindex
211 rmdir
212 s
213 scalar
214 seek
215 seekdir
216 select
217 semctl
218 semget
219 semop
220 send
221 setgrent
222 sethostent
223 setnetent
224 setpgrp
225 setpriority
226 setprotoent
227 setpwent
228 setservent
229 setsockopt
230 shift
231 shmctl
232 shmget
233 shmread
234 shmwrite
235 shutdown
236 sin
237 sleep
238 socket
239 socketpair
240 sort
241 splice
242 split
243 sprintf
244 sqrt
245 srand
246 stat
247 study
248 sub
249 substr
250 symlink
251 syscall
252 sysopen
253 sysread
254 sysseek
255 system
256 syswrite
257 tell
258 telldir
259 tie
260 tied
261 time
262 times
263 tr
264 truncate
265 uc
266 ucfirst
267 umask
268 undef
269 unless
270 unlink
271 unpack
272 unshift
273 untie
274 until
275 use
276 utime
277 values
278 vec
279 wait
280 waitpid
281 wantarray
282 warn
283 while
284 write
285 x
286 xor
287 y