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