1
0
mirror of https://github.com/aportelli/LatAnalyze.git synced 2024-11-10 08:55:37 +00:00
LatAnalyze/latan/ParserState.hpp

46 lines
968 B
C++
Raw Normal View History

#ifndef LATAN_SAMPLE_HPP_
#define LATAN_SAMPLE_HPP_
#include <latan/Global.hpp>
#include <iostream>
#include <string>
LATAN_BEGIN_CPPDECL
template <typename DataObj>
class ParserState
{
public:
// constructor
explicit ParserState(std::istream *streamPt, std::string *namePt,
DataObj *dataPt);
// destructor
virtual ~ParserState(void);
private:
// scanner allocation/deallocation
virtual void initScanner(void) = 0;
virtual void destroyScanner(void) = 0;
public:
DataObj* data;
void* scanner;
std::istream* stream;
std::string* streamName;
};
template <typename DataObj>
ParserState<DataObj>::ParserState(std::istream *streamPt, std::string *namePt,
DataObj *dataPt)
: data(dataPt)
, scanner(NULL)
, stream(streamPt)
, streamName(namePt)
{}
template <typename DataObj>
ParserState<DataObj>::~ParserState(void)
{}
LATAN_END_CPPDECL
#endif