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