% This is a file written using noweb
%
% $Id: ftokens.nw,v 2.0 1996/12/16 17:31:57 gaertner Exp $
%

\documentclass{article}
\usepackage{a4,version,noweb}
\begin{document}

\includeversion{bigspecs}
%\includeversion{impls}
%\excludeversion{bigspecs}% without elaborate specification
\excludeversion{impls}% without implementation



\title{A Tester for the Prettyprinting Scanner Generator}
\author{Felix G\"artner}
\maketitle


\begin{abstract}
    This document describes a short program to test the new
    [[Pscan_builder]] class used to generate prettyprinting scanners
    from formatted token files.
\end{abstract}


\tableofcontents


\section{The Tester}

It's a simple program that uses a [[Pscan_builder]] object to process
standard input into standard output.

Invoke this program like this:
 %
\begin{quote}
  {\tt ftokens} < {\it formatted-token-file}
\end{quote}
 %
and look whether the output makes sense.

<<implementation>>=

#include<iostream>
#include<fstream>
#include<stdio.h>
#include<stdlib.h>

using namespace std;

#include"ftparse.h"

//extern int yydebug;


int
main(int argc, char** argv)
{
	int i;

	//yydebug=1;

	Pscan_builder generator;

	i = generator.build(&cin, &cout);

	if (i!=0) {
		cerr << argv[0] << ": " << generator.error_text()
			<< " in line "
			<< generator.error_line() << endl;
	}
	return(0);
}

@


\end{document}


%
% $Log: ftokens.nw,v $
% Revision 2.0  1996/12/16 17:31:57  gaertner
% *** empty log message ***
%
% Revision 1.1  1996/03/19  15:56:40  gaertner
% Initial revision
%
% Revision 1.1  1996/03/19  15:56:40  gaertner
% Initial revision
%
%


