Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

KernelIstreamLexer.h

Go to the documentation of this file.
00001 #ifndef KernelIstreamLexerHEADER
00002 #define KernelIstreamLexerHEADER
00003 
00004 #include "DLexerBase.h"
00005 #include "iostream"
00006 #ifdef _USESSTREAM
00007 #include <sstream>
00008 #else
00009 #include "strstream"
00010 #endif
00011 
00012 template <typename InputStream>
00013 class KernelIstreamLexer : public DLGInputStream
00014 {
00015 protected:
00016    InputStream & _myInputStream ;
00017 public:
00018    KernelIstreamLexer (InputStream & stream ) ;
00019    virtual int nextChar () ;
00020 };
00021 
00022 //-------------- implementation ---------------------
00023 
00024 
00025 template<typename InputStream>
00026 KernelIstreamLexer<InputStream>::KernelIstreamLexer(InputStream & stream) :
00027    _myInputStream ( stream )
00028 {
00029 
00030 }
00031 
00032 
00033 template<typename InputStream>
00034 int KernelIstreamLexer<InputStream>::nextChar()
00035 {
00036    char c ;
00037    _myInputStream.get(c) ;
00038    if ( ! _myInputStream.eof() ) 
00039       {
00040          return int(c) ;
00041       }
00042    else
00043       {
00044          return EOF ;
00045       }
00046 }
00047 
00048 #endif

logo OpenMask

Documentation generated on Mon Nov 25 15:24:59 2002

Generated with doxygen 1.2.12 by Dimitri van Heesch ,   1997-2001