OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
StringStream.h
Go to the documentation of this file.
1 #ifndef CLASSIC_StringStream_HH
2 #define CLASSIC_StringStream_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: StringStream.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: StringStream
13 //
14 // ------------------------------------------------------------------------
15 // Class category: Parser
16 // ------------------------------------------------------------------------
17 //
18 // $Date: 2000/03/27 09:32:37 $
19 // $Author: fci $
20 //
21 // ------------------------------------------------------------------------
22 
23 #include "Parser/TokenStream.h"
24 
25 
26 // Class StringStream
27 // ------------------------------------------------------------------------
29 // The source of tokens is a C++ string.
30 
31 class StringStream: public TokenStream {
32 
33 public:
34 
36  // Initialize stream to read from the named file.
37  StringStream(const std::string &s);
38 
39  virtual ~StringStream();
40 
42  virtual Token readToken();
43 
44 private:
45 
46  // Not implemented.
47  StringStream();
48  StringStream(const StringStream &);
49  void operator=(const StringStream &);
50 
51  // Read double from current statement.
52  Token readNumber();
53 
54  // Read string value from current statement.
55  Token readString();
56 
57  // Read word from current statement.
58  Token readWord();
59 
60  // Current input string;
61  const std::string line;
62  std::string::size_type curr_char;
63 };
64 
65 #endif // CLASSIC_StringStream_HH
Token readNumber()
std::string::size_type curr_char
Definition: StringStream.h:62
Abstract interface for a stream of input tokens.
Definition: TokenStream.h:33
const std::string line
Definition: StringStream.h:61
virtual Token readToken()
Read single token from file.
Representation of a single input token.
Definition: Token.h:33
virtual ~StringStream()
Token readWord()
A stream of input tokens.
Definition: StringStream.h:31
Token readString()
void operator=(const StringStream &)