Back to Top page.

EGOAScanner.h

Go to the documentation of this file.
00001 /****************************************************************************
00002   
00003   $Id: EGOAScanner.h,v 1.2 2002/11/08 03:47:38 motegi Exp $
00004   Copyright (C) 2002 Higuchi Lab. All rights reserved.
00005 
00006 *****************************************************************************/
00007 #ifndef INCLUDE__SCANNER_H__FILE
00008 #define INCLUDE__SCANNER_H__FILE
00009 
00010 #include "EGOAParser.h"
00011 #include <string>
00012 #include <iosfwd>
00013 
00014 class EGOAScanner {
00015 public:
00016   EGOAScanner() : in(0) { }
00017   EGOAScanner(std::istream* inputstream) : in(inputstream), lineNo(1) { }
00018   virtual ~EGOAScanner() { }
00019 
00020   virtual void initialize(std::istream* inputstream) {
00021     in = inputstream;
00022     lineNo = 1;
00023   }
00024 
00025   virtual EGOAParser::Token scan();
00026 
00027   virtual const std::string& getLexBuf() const {
00028     return lexBuf;
00029   }
00030   virtual unsigned getLineNo() const {
00031     return lineNo;
00032   }
00033 protected:
00034   EGOAScanner(const EGOAScanner&);
00035   EGOAScanner& operator=(const EGOAScanner&);
00036 
00037   std::istream* in;             
00038   std::string lexBuf;      
00039   unsigned lineNo;         
00040 };
00041 
00042 #endif  // INCLUDE__SCANNER_H__FILE
00043 
00044