OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
AbsFileStream.h
Go to the documentation of this file.
1#ifndef CLASSIC_AbsFileStream_HH
2#define CLASSIC_AbsFileStream_HH
3
4// ------------------------------------------------------------------------
5// $RCSfile: AbsFileStream.h,v $
6// ------------------------------------------------------------------------
7// $Revision: 1.1.1.1 $
8// ------------------------------------------------------------------------
9// Copyright: see Copyright.readme
10// ------------------------------------------------------------------------
11//
12// Class: AbsFileStream
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 AbsFileStream
27// ------------------------------------------------------------------------
29// The source of tokens is an abstract file stream.
30
32
33public:
34
36 // Store stream name.
37 explicit AbsFileStream(const std::string &name);
38
39 virtual ~AbsFileStream();
40
42 virtual bool fillLine() = 0;
43
45 // Returns false when end of file is hit.
46 virtual Token readToken();
47
48protected:
49
50 // Read double from current statement.
52
53 // Read string value from current statement.
55
56 // Read word from current statement.
58
59 // Skip C-like comments.
60 bool skipComments();
61
62 // Current input line and position in line.
63 std::string line;
65
66private:
67
68 // Not implemented.
71 void operator=(const AbsFileStream &);
72};
73
74#endif // CLASSIC_AbsFileStream_HH
const std::string name
A stream of input tokens.
Definition: AbsFileStream.h:31
AbsFileStream(const AbsFileStream &)
void operator=(const AbsFileStream &)
std::string line
Definition: AbsFileStream.h:63
virtual bool fillLine()=0
Read next input line.
virtual ~AbsFileStream()
virtual Token readToken()
Read single token from file.
Representation of a single input token.
Definition: Token.h:33
Abstract interface for a stream of input tokens.
Definition: TokenStream.h:33