#!/usr/local/bin/perl5
'di';
'ig00';
#
# $Header$
#
# $Log$

# untads -- Extract user-readable text from TADS source files
# for spell-checking or proofreading

# by Matthew Amster-Burton, [email protected]
# Last revision: 0.2, 11/4/96
# placed in the public domain

# usage:
# untads file.t > output.txt
# OR untads file.t | spell

$/ = 0777;

while( <> ) {                  # Actually slurping whole file
  s#/\*.*\*/##gs;             # Kill C comments
  s#//.*\n#\n#g;              # Kill C++ comments
  s/<<.*?>>//g;               # Kill variable includes
  s/%\w+%//g;                 # Kill format strings
  s/\\'/##apostrophe##/g;
  s/\\./ /g;                  # Kill escape sequences (and apostrophes...)
  s/\n[\t ]+/\n/g;            # Kill line indents
  while( /'([^']*)'|"([^"]*)"/go ) { # q// or qq//
     $tmp = $1 . $2;
     $tmp =~ s/##apostrophe##/'/;
     print "$tmp\n";
  }
}



###############################################################

   # These next few lines are legal in both Perl and nroff.

00;                       # finish .ig

'di           \" finish diversion--previous line must be blank
nr nl 0-1    \" fake up transition to first page again
nr % 0         \" start at page 1
'; __END__ ##### From here on it's a standard manual page #####

TH UNTADS 1 "November 29, 1995"
AT 3
SH NAME
untads \- whatever
SH SYNOPSIS
B untads [options] [files]
SH DESCRIPTION
I untads
extracts user-visible text from a TADS code (.t) file.
SH ENVIRONMENT
No environment variables are used.
SH FILES
None.
SH AUTHOR
Matthew Amster
SH "SEE ALSO"

SH DIAGNOSTICS

SH BUGS
Takes a bunch o' memory.