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