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