[Bio] / smc / stContext.h Repository:
ViewVC logotype

View of /smc/stContext.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (download) (as text) (annotate) (vendor branch)
Thu Aug 21 17:00:03 2003 UTC (16 years, 3 months ago) by efrank
Branch: MAIN, oma-04Jun1993
CVS Tags: anl000, HEAD
Changes since 1.1: +0 -0 lines
State machine compiler from Bob Marting (R. C. Martin) at Object Mentor Associates.
Has a few small compilation fixes.

We have this code without explicit permission.  We ar evaluating extensions.
Do not distribute..but I think we're consistent with its usage requirements

#ifndef _H_stripperContext
#define _H_stripperContext

// $Id: stContext.h,v 1.1.1.1 2003/08/21 17:00:03 efrank Exp $
#include <iostream.h>

//
// This is the context class of the comment stripper.
// This class knows about the input and output streams,
// How to read and write chars, and which critical chars to
// look for in the input stream.
//

class StripperContext
{
private:
	char itsChar;
	istream *itsIStream;
	ostream *itsOStream;

public:
	StripperContext() { }

    void SetStreams(istream& i, ostream& o)
    {
      itsIStream = &i;
      itsOStream = &o;
    }

    void FSMError(const char* t, const char* s)
    {cerr << "Transition error: " << t << " in state " << s << endl;}

	int ReadChar()
	{
	  int c;
	  c = itsIStream->get();
	  itsChar = c;
	  return c;
	}
	void PutChar() {*itsOStream << itsChar;};
	void PutSlash() {*itsOStream << '/';};
};

#endif


MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3