Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

TokenStream Class Reference

A token stream is a source of tokens. More...

#include <token_stream.h>

Inheritance diagram for TokenStream:

IStreamTokenStream TclTokenStream List of all members.

Public Methods

 TokenStream ( CharSource *i )
 TokenStream ( int argc, char* argv[] )
virtual ~TokenStream ()
virtual bool get_token ( Token& t )
 returns true if succeeded.

virtual bool peek_token ( Token& t )
virtual void push_back ( Token& t )
virtual istream* get_stream ()
 Assume a "{" has been read off, read off tokens until the matching "}". More...

virtual bool is_empty ()
 Return true if no more token can be read.

virtual bool is_at_end_of_command ()
 Return true if next token is either '
', ';' or no more token can be read.



Protected Methods

 TokenStream (void)
 subclass is responsible for initializing either _tokens or _input_stream; An empty suif_vector<Token> will be assigned to the _tokens slot.


Protected Attributes

Tokens_tokens
CharSource_input_stream


Detailed Description

A token stream is a source of tokens.

A token stream can be built from either

A token stream owns the char source.


Constructor & Destructor Documentation

TokenStream::TokenStream ( CharSource * i)

TokenStream::TokenStream ( int argc,
char * argv[])

TokenStream::~TokenStream () [virtual]

TokenStream::TokenStream ( void) [protected]

subclass is responsible for initializing either _tokens or _input_stream; An empty suif_vector<Token> will be assigned to the _tokens slot.


Member Function Documentation

istream * TokenStream::get_stream () [inline, virtual]

Assume a "{" has been read off, read off tokens until the matching "}".

Append all tokens read into a strstream and return it. The match "}" is not included in the strstream.

bool TokenStream::get_token ( Token & t) [inline, virtual]

returns true if succeeded.

bool TokenStream::is_at_end_of_command () [inline, virtual]

Return true if next token is either '
', ';' or no more token can be read.

bool TokenStream::is_empty () [inline, virtual]

Return true if no more token can be read.

bool TokenStream::peek_token ( Token & t) [virtual]

void TokenStream::push_back ( Token & t) [virtual]


Member Data Documentation

CharSource * TokenStream::_input_stream [protected]

Tokens * TokenStream::_tokens [protected]


The documentation for this class was generated from the following files:
Generated at Mon Jul 31 13:44:46 2000 for NCI SUIF by doxygen 1.1.2 written by Dimitri van Heesch, © 1997-2000