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