source: trunk/essentials/dev-lang/perl/keywords.pl

Last change on this file was 3181, checked in by bird, 19 years ago

perl 5.8.8

File size: 2.8 KB
Line 
1#!/usr/bin/perl
2
3require 'regen_lib.pl';
4safer_unlink ("keywords.h");
5open(KW, ">keywords.h") || die "Can't create keywords.h: $!\n";
6binmode KW;
7select KW;
8
9print <<EOM;
10/* -*- buffer-read-only: t -*-
11 *
12 * keywords.h
13 *
14 * Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2005,
15 * 2006, by Larry Wall and others
16 *
17 * You may distribute under the terms of either the GNU General Public
18 * License or the Artistic License, as specified in the README file.
19 *
20 * !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
21 * This file is built by keywords.pl from its data. Any changes made here
22 * will be lost!
23 */
24EOM
25
26# Read & print data.
27
28$keynum = 0;
29while (<DATA>) {
30 chop;
31 next unless $_;
32 next if /^#/;
33 ($keyword) = split;
34 print &tab(5, "#define KEY_$keyword"), $keynum++, "\n";
35}
36
37print KW "\n/* ex: set ro: */\n";
38
39close KW or die "Error closing keywords.h: $!";
40
41###########################################################################
42sub tab {
43 local($l, $t) = @_;
44 $t .= "\t" x ($l - (length($t) + 1) / 8);
45 $t;
46}
47###########################################################################
48__END__
49
50NULL
51__FILE__