| 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 | binmode KW;
|
|---|
| 7 | select KW;
|
|---|
| 8 |
|
|---|
| 9 | print <<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 | */
|
|---|
| 24 | EOM
|
|---|
| 25 |
|
|---|
| 26 | # Read & print data.
|
|---|
| 27 |
|
|---|
| 28 | $keynum = 0;
|
|---|
| 29 | while (<DATA>) {
|
|---|
| 30 | chop;
|
|---|
| 31 | next unless $_;
|
|---|
| 32 | next if /^#/;
|
|---|
| 33 | ($keyword) = split;
|
|---|
| 34 | print &tab(5, "#define KEY_$keyword"), $keynum++, "\n";
|
|---|
| 35 | }
|
|---|
| 36 |
|
|---|
| 37 | print KW "\n/* ex: set ro: */\n";
|
|---|
| 38 |
|
|---|
| 39 | close KW or die "Error closing keywords.h: $!";
|
|---|
| 40 |
|
|---|
| 41 | ###########################################################################
|
|---|
| 42 | sub tab {
|
|---|
| 43 | local($l, $t) = @_;
|
|---|
| 44 | $t .= "\t" x ($l - (length($t) + 1) / 8);
|
|---|
| 45 | $t;
|
|---|
| 46 | }
|
|---|
| 47 | ###########################################################################
|
|---|
| 48 | __END__
|
|---|
| 49 |
|
|---|
| 50 | NULL
|
|---|
| 51 | __FILE__
|
|---|
|
|---|