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