% This is a file written using noweb
%
% $Id: fgrammar.nw,v 1.1 1996/03/21 08:13:57 gaertner Exp gaertner $
%

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

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



\title{A Tester for the prettyprinting parser generator}
\author{Felix G\"artner}
\maketitle


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


\tableofcontents


\section{The Tester}

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

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

<<implementation>>=
#include<iostream>
#include<fstream>
#include<stdio.h>

using namespace std;

#include"fgparse.h"

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

	//yydebug=1;

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

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

@


\end{document}


%
% $Log: fgrammar.nw,v $
% Revision 1.1  1996/03/21  08:13:57  gaertner
% Initial revision
%
%


