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