diff options
Diffstat (limited to 'CIAO/CCF/CCF/CompilerElements/TokenStream.hpp')
-rw-r--r-- | CIAO/CCF/CCF/CompilerElements/TokenStream.hpp | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/CIAO/CCF/CCF/CompilerElements/TokenStream.hpp b/CIAO/CCF/CCF/CompilerElements/TokenStream.hpp deleted file mode 100644 index f1d3ab4fb8c..00000000000 --- a/CIAO/CCF/CCF/CompilerElements/TokenStream.hpp +++ /dev/null @@ -1,82 +0,0 @@ -// file : CCF/CompilerElements/TokenStream.hpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#ifndef CCF_COMPILER_ELEMENTS_TOKEN_STREAM_HPP -#define CCF_COMPILER_ELEMENTS_TOKEN_STREAM_HPP - -#include <string> -#include <istream> - -namespace CCF -{ - namespace CompilerElements - { - template <typename Token> - class TokenStream - { - public: - // (JP 06-04-06) Not required by C++ spec, but it - // eliminates buggy GCC warnings. - virtual ~TokenStream () {} - - virtual Token - next () = 0; - }; - - template <> - class TokenStream<char> - { - public: - typedef - std::char_traits<char> - traits; - - typedef - traits::int_type - int_type; - - typedef - traits::char_type - char_type; - - public: - virtual int_type - next () = 0; - - static char_type - to_char_type (int_type i) - { - return traits::to_char_type (i); - } - - static int_type - eos () - { - return traits::eof (); - } - }; - - class InputStreamAdapter : public TokenStream<char> - { - public: - InputStreamAdapter (std::istream& is) - : is_ (is) - { - } - - public: - - virtual int_type - next () - { - return is_.get (); - } - - private: - std::istream& is_; - }; - } -} - -#endif // CCF_COMPILER_ELEMENTS_TOKEN_STREAM_HPP |