OPAL (Object Oriented Parallel Accelerator Library)
2021.1.99
OPAL
|
Abstract interface for a stream of input tokens. More...
#include <TokenStream.h>
Public Member Functions | |
TokenStream (const std::string &name) | |
Constructor. More... | |
virtual | ~TokenStream () |
void | putBack (const Token &token) |
Put token back to stream. More... | |
virtual Token | readToken ()=0 |
Read single token from stream. More... | |
const std::string & | getName () const |
Return stream name. More... | |
int | getLine () const |
Return line number. More... | |
Public Member Functions inherited from RCObject | |
int | addReference () const |
Increment reference count. More... | |
int | removeReference () const |
Decrement the reference count. More... | |
bool | isShared () const |
Test for sharing. More... | |
Protected Attributes | |
std::string | stream_name |
int | curr_line |
bool | put_back_flag |
Token | put_back |
Private Member Functions | |
TokenStream () | |
TokenStream (const TokenStream &) | |
void | operator= (const TokenStream &) |
Additional Inherited Members | |
Protected Member Functions inherited from RCObject | |
RCObject () | |
Default constructor. More... | |
RCObject (const RCObject &) | |
Copy constructor. More... | |
virtual | ~RCObject ()=0 |
RCObject & | operator= (const RCObject &right) |
Abstract interface for a stream of input tokens.
Definition at line 33 of file TokenStream.h.
TokenStream::TokenStream | ( | const std::string & | name | ) |
Constructor.
Definition at line 29 of file TokenStream.cpp.
|
virtual |
Definition at line 34 of file TokenStream.cpp.
|
private |
|
private |
int TokenStream::getLine | ( | ) | const |
const std::string & TokenStream::getName | ( | ) | const |
|
private |
void TokenStream::putBack | ( | const Token & | token | ) |
Put token back to stream.
Definition at line 38 of file TokenStream.cpp.
References put_back, and put_back_flag.
Referenced by IfStatement::IfStatement().
|
pure virtual |
Read single token from stream.
Implemented in MacroStream, StringStream, and AbsFileStream.
Referenced by CompoundStatement::CompoundStatement(), IfStatement::IfStatement(), SequenceTemplate::parseTemplate(), OpalParser::readStatement(), and WhileStatement::WhileStatement().
|
protected |
Definition at line 62 of file TokenStream.h.
Referenced by FileStream::fillLine(), TerminalStream::fillLine(), getLine(), AbsFileStream::readNumber(), AbsFileStream::readString(), AbsFileStream::readToken(), StringStream::readToken(), and AbsFileStream::readWord().
|
protected |
Definition at line 66 of file TokenStream.h.
Referenced by putBack(), AbsFileStream::readToken(), StringStream::readToken(), and MacroStream::readToken().
|
protected |
Definition at line 65 of file TokenStream.h.
Referenced by putBack(), AbsFileStream::readToken(), StringStream::readToken(), MacroStream::readToken(), and MacroStream::start().
|
protected |
Definition at line 59 of file TokenStream.h.
Referenced by FileStream::fillLine(), getName(), AbsFileStream::readNumber(), AbsFileStream::readString(), AbsFileStream::readToken(), StringStream::readToken(), MacroStream::readToken(), and AbsFileStream::readWord().