OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
TokenStream.h
Go to the documentation of this file.
1#ifndef OPALX_TokenStream_HH
2#define OPALX_TokenStream_HH
3
4// ------------------------------------------------------------------------
5// $RCSfile: TokenStream.h,v $
6// ------------------------------------------------------------------------
7// $Revision: 1.1.1.1 $
8// ------------------------------------------------------------------------
9// Copyright: see Copyright.readme
10// ------------------------------------------------------------------------
11//
12// Class: TokenStream
13//
14// ------------------------------------------------------------------------
15// Class category: Parser
16// ------------------------------------------------------------------------
17//
18// $Date: 2000/03/27 09:32:37 $
19// $Author: fci $
20//
21// ------------------------------------------------------------------------
22
23#include <string>
24#include "OpalParser/Token.h"
25
26// Class TokenStream
27// ------------------------------------------------------------------------
29
31public:
33 // Store the stream name.
34 TokenStream(const std::string& name);
35
36 virtual ~TokenStream();
37
39 // This allows to reparse the token.
40 void putBack(const Token& token);
41
43 virtual Token readToken() = 0;
44
46 const std::string& getName() const;
47
49 int getLine() const;
50
51protected:
52 // Current stream name.
53 std::string stream_name;
54
55 // Current input line number.
57
58 // Last token put back, if any.
61
62private:
63 // Not implemented.
66 void operator=(const TokenStream&);
67};
68
69#endif // OPALX_TokenStream_HH
Abstract interface for a stream of input tokens.
Definition TokenStream.h:30
bool put_back_flag
Definition TokenStream.h:59
virtual ~TokenStream()
TokenStream(const TokenStream &)
std::string stream_name
Definition TokenStream.h:53
Token put_back
Definition TokenStream.h:60
int getLine() const
Return line number.
const std::string & getName() const
Return stream name.
void putBack(const Token &token)
Put token back to stream.
virtual Token readToken()=0
Read single token from stream.
void operator=(const TokenStream &)
Representation of a single input token.
Definition Token.h:32