OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
TokenStream Class Referenceabstract

Abstract interface for a stream of input tokens. More...

#include <TokenStream.h>

Inheritance diagram for TokenStream:
Inheritance graph
[legend]
Collaboration diagram for TokenStream:
Collaboration graph
[legend]

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
 
RCObjectoperator= (const RCObject &right)
 

Detailed Description

Abstract interface for a stream of input tokens.

Definition at line 33 of file TokenStream.h.

Constructor & Destructor Documentation

◆ TokenStream() [1/3]

TokenStream::TokenStream ( const std::string &  name)

Constructor.

Definition at line 29 of file TokenStream.cpp.

◆ ~TokenStream()

TokenStream::~TokenStream ( )
virtual

Definition at line 34 of file TokenStream.cpp.

◆ TokenStream() [2/3]

TokenStream::TokenStream ( )
private

◆ TokenStream() [3/3]

TokenStream::TokenStream ( const TokenStream )
private

Member Function Documentation

◆ getLine()

int TokenStream::getLine ( ) const

Return line number.

Definition at line 49 of file TokenStream.cpp.

References curr_line.

◆ getName()

const std::string & TokenStream::getName ( ) const

Return stream name.

Definition at line 54 of file TokenStream.cpp.

References stream_name.

◆ operator=()

void TokenStream::operator= ( const TokenStream )
private

◆ putBack()

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().

◆ readToken()

virtual Token TokenStream::readToken ( )
pure virtual

Member Data Documentation

◆ curr_line

int TokenStream::curr_line
protected

◆ put_back

Token TokenStream::put_back
protected

◆ put_back_flag

bool TokenStream::put_back_flag
protected

◆ stream_name

std::string TokenStream::stream_name
protected

The documentation for this class was generated from the following files: