# AFT Output Elements.
# !!DO NOT EDIT!! This file was automatically generated by aft-compile v2.05a on Fri Jan  9 22:44:14 2004
# See http://www.maplefish.com/todd/aft.html for details.
package AFT_OUTPUT;

use vars qw ($filePreamble $filePostamble %elem %pragma_postvar);

$filePreamble = '';	# Holds preamble for output file.
$filePostamble = '';	# Holds postamble for output file.
%elem = ();		# Element commands for producing output file.%pragma_postvar = ();	# Variables for substitution post-filtering.


sub initElements {
	%pragma_postvar = (
	);
	%elem = (
		'StartFilteredVerbatim' =>	 qq'\n\@ID \@F \@Verbatim \@Begin',
		'Image-center' =>	 qq'\n\@CD \@IncludeGraphic \%image\% ',
		'StrikeLine' =>	 qq'# \%line\% ',
		'StartTeletype' =>	 qq'\@F {',
		'StartSmall' =>	 qq'\@S {',
		'StartStrong' =>	 qq'\@B {',
		'StartBulletList' =>	 qq'\n\@BL ',
		'StartQuote' =>	 qq'\n\@QD { ',
		'EndBulletListElement' =>	 qq'\n}',
		'NumberedListElement' =>	 qq'\n\@LI {\n',
		'EndEmphasis' =>	 qq'}',
		'URL' =>	 qq'\@F {<\%target\%>} ',
		'EndNamedList' =>	 qq'\n\@EndList ',
		'EndBulletList' =>	 qq'\n\@EndList ',
		'****' =>	 qq'',
		'NBSPACE' =>	 qq'\" \"',
		'Target' =>	 qq'\%text\% \@PageMark {\%target\%}  ',
		'*' =>	 qq'\n\@Section \@Title {\%section\%} \@Tag {\%section\%} \@Begin ',
		'EndTeletype' =>	 qq'} ',
		'Image-right' =>	 qq'\n\@RightDisplay \@IncludeGraphic \%image\% ',
		'BeginSectLevel2' =>	 qq'\n\@BeginSubSections ',
		'BeginSectLevel3' =>	 qq'\n\@BeginSubSubSections ',
		'EndParagraph' =>	 qq'',
		'Superscript' =>	 qq'\@Sup {\%stuff\%} ',
		'EndSectLevel2' =>	 qq'\n\@EndSubSections ',
		'EndSectLevel3' =>	 qq'\n\@EndSubSubSections ',
		'FullFilterFilteredVerbatim?' =>	 qq'No',
		'**' =>	 qq'\n\@SubSection \@Title {\%section\%} \@Tag {\%section\%} \@Begin ',
		'EndNumberedListElement' =>	 qq'\n}',
		'Image-left' =>	 qq'\n\@LD \@IncludeGraphic \%image\% ',
		'EndStrong' =>	 qq'}',
		'TOC' =>	 qq'# TOC must be made from your lout file. ',
		'EndBlockedVerbatim' =>	 qq'\n\@End \@Verbatim ',
		'Image' =>	 qq'\@IncludeGraphic \%image\%',
		'NamedListElement' =>	 qq'\n\@DTI {\%name\%} {\n',
		'StartNumberedList' =>	 qq'\n\@PNL ',
		'InternalReference' =>	 qq'\%text\% (p. \@PageOf {\%target\%}) ',
		'StartNamedList' =>	 qq'\n\@TL ',
		'StartVerbatim' =>	 qq'\n\@ID \@F \@Verbatim {',
		'NoteRef' =>	 qq'\@Sup {\%ref\%} ',
		'HorizontalLine' =>	 qq'\n\@D \@FullWidthRule ',
		'EndNumberedList' =>	 qq'\n\@EndList ',
		'Subscript' =>	 qq'\@Sub {\%stuff\%} ',
		'prefilter' =>	 qq'\014		\@NP ',
		'CommentLine' =>	 qq'# \%line\% ',
		'StartBlockedVerbatim' =>	 qq'\n\@ID \@F \@Verbatim \@Begin',
		'StartParagraph' =>	 qq'\n\@PP\n ',
		'PreFilterVerbatim?' =>	 qq'No',
		'EndSect1' =>	 qq'\n\@End \@Section ',
		'Center' =>	 qq'\n\@CD {\%center\%} ',
		'EndSect2' =>	 qq'\n\@End \@SubSection ',
		'EndFilteredVerbatim' =>	 qq'\n\@End \@Verbatim ',
		'EndSect3' =>	 qq'\n\@End \@SubSubSection ',
		'EndSect4' =>	 qq'',
		'EndNamedListElement' =>	 qq'\n}',
		'EndVerbatim' =>	 qq'}',
		'StartEmphasis' =>	 qq'\@I {',
		'EndSmall' =>	 qq'}',
		'BulletListElement' =>	 qq'\n\@LI {\n',
		'ParagraphBreak' =>	 qq'',
		'StartTable' =>	 qq'### WARNING: AFT doesn\'t support Lout tables yet! ###',
		'ID' =>	 qq'LOUT',
		'LineBreak' =>	 qq'\n\@LLP ',
		'EndQuote' =>	 qq'} ',
		'***' =>	 qq'\n\@SubSubSection \@Title {\%section\%} \@Tag {\%section\%} \@Begin ',
	);

## Preamble:

$filePreamble = '# Basser Lout Version 3.24 output generated by AFT 
######################################################################
#@SysInclude {tbl}		# Table formatting
#@SysInclude {eq}		# Equations
#@SysInclude {graph}		# Graphs
#@SysInclude {diag}		# Diagrams
#@SysInclude {cprint}		# C, C++
#@SysInclude {eiffel}		# Eiffel
#@SysInclude {blue}		# Blue
#@SysInclude {perl}		# Perl
#@SysInclude {pod}		# POD
#@SysInclude {python}		# Python
@SysInclude {report}		# @SysInclude (system) @Include (local)
@Report 
@Title {%title%}
@Author {%author%}
#@Institution { }
#@DateLine {No}			# Date, Yes (present), No
#@AtEnd { } 			# To include a back cover
#@CoverSheet {No}		# Make a cover sheet
#@ContentsSeparate {No}		# Make a TOC on a separate page
#@InitialFont {Times Base 12p}	# Courier Helvetica Palatino Times ...
#@InitialBreak {hyphen adjust 1.2fx} # hyphen nohyphen; adjust ragged ...
@InitialSpace {tex}		# lout tex troff
#@InitialLanguage {English}	# English  French German Spanish ...
#@PageOrientation {Portrait}	# Portrait Landscape
#@PageHeaders {Simple} 		# None Simple Titles NoTitles
#@ColumnNumber {1}
#@FirstPageNumber {1}
@OptimizePages {Yes}		# Use TeX optimal paragraph breaking
#@AbstractDisplay {No}		# Show the abstract
#@AbstractTitle {Abstract}	# Type whatever abstract title you want
#@Abstract { }			# Type your abstract between braces

//

';

## Postamble:

$filePostamble = '
';
}


## Prefilter subroutine:

sub prefilter {
   my ($line) = @_;
   $line=~s/\\/-BSlAsH-/g;
   $line=~s/\"/\"\\\"\"/g;
   $line=~s/-BSlAsH-/\"\\\\"/g;
   $line=~s/\{\-([^\}]+)\@([^\}]+)\-\}/%LeFtB%NeG$1-AtChAr-$2%NeG%RiGhTB/g;
   $line=~s/\{\+([^\}]+)\+\}/%LeFtB%PlUs$1%PlUs%RiGhTB/g;
   $line=~s/\}\+([^\}]+)\+\{/%RiGhTB%PlUs$1%PlUs%LeFtB/g;
   $line=~s/\{\-([^\}]+)\-\}/%LeFtB%NeG$1%NeG%RiGhTB/g;
   $line=~s/\}\-([^\}]+)\-\{/%RiGhTB%NeG$1%NeG%LeFtB/g;
   $line=~s/[\{\}\@]/\"$&\"/g;
   $line=~s/%LeFtB/{/g;
   $line=~s/%RiGhTB/}/g;
   $line=~s/%PlUs/+/g;
   $line=~s/%NeG/-/g;
   $line=~s/-AtChAr-/@/g;
   $line=~s/\`\`([^\']+)\'\'\'\'/``$1-4QuOtEs-/g;
   $line=~s/\`\`([^\']+)\'\'/``$1-2QuOtEs-/g;
   $line=~s/-4QuOtEs-/''''/g;
   $line=~s/-2QuOtEs-/''''/g;
   $line=~s/[\#\&\^\/]/\"$&\"/g;
   $line=~s/\~\~/-DTiLdE-/g;
   return $line;
}

## Postfilter subroutine:

sub postfilter {
   my ($line) = @_;
   $line=~s/\~/\"~\"/g;
   $line=~s/-DTiLdE-/~/g;
   $line=~s/\|/\"|\"/g;
   return $line;
}

1;
