home *** CD-ROM | disk | FTP | other *** search
Perl Script | 1995-10-07 | 1.1 KB | 63 lines | [TEXT/MPS ] |
- #!/usr/local/bin/perl
-
- open(EMBED, ">embed.h") || die "Can't open embed.h for writing";
-
- print EMBED <<'END';
- /* This file is derived from global.sym and interp.sym */
-
- /* (Doing namespace management portably in C is really gross.) */
-
- #ifdef EMBED
-
- /* globals we need to hide from the world */
- END
-
- open(GLOBAL, "global.sym") || die "Couldn't open global.sym for reading");
-
- while (<GLOBAL>) {
- s/\s*#.*//;
- next if (/^\s*$/);
- s/(\w+)/#define $1 Perl_$1/;
- print EMBED;
- }
-
- print EMBED <<'END';
-
- #endif /* EMBED */
-
- /* Put interpreter specific symbols into a struct? */
-
- #ifdef MULTIPLICITY
-
- END
-
- open(INTERP, "interp.sym") || die "Couldn't open interp.sym for reading");
-
- while (<INTERP>) {
- s/\s*#.*//;
- next if (/^\s*$/);
- s/(\w+)/#define $1 (curinterp->I$1)/;
- print EMBED;
- }
-
- print EMBED <<'END';
-
- #else /* not multiple, so translate interpreter symbols the other way... */
-
- END
-
- open(INTERP, "interp.sym") || die "Couldn't open interp.sym for reading");
-
- while (<INTERP>) {
- s/\s*#.*//;
- next if (/^\s*$/);
- s/(\w+)/#define I$1 $1/;
- print EMBED;
- }
-
- print EMBED <<'END';
-
- #endif /* MULTIPLICITY */
- END
-
-