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