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

moot::TokenReader Class Reference

Abstract class for token input.

#include <mootTokenIO.h>

Inheritance diagram for moot::TokenReader:

Inheritance graph
[legend]
Collaboration diagram for moot::TokenReader:

Collaboration graph
[legend]
List of all members.

Public Methods

Constructors etc.
Input Selection
Token-Level Access
Diagnostics

Public Attributes

Static Public Attributes


Constructor & Destructor Documentation

moot::TokenReader::TokenReader int    fmt = tiofUnknown,
const std::string &    name = "TokenReader"
[inline]
 

Default constructor \fmt: bitmask of TokenIO::TokenIOFormat flags \mode: default input mode \name: name of current input source

virtual moot::TokenReader::~TokenReader void    [inline, virtual]
 

Default destructor : override in descendant classes


Member Function Documentation

virtual size_t moot::TokenReader::byte_number size_t    n [inline, virtual]
 

Get current byte number. Descendants may override this method.

Reimplemented in moot::TokenReaderExpat.

virtual size_t moot::TokenReader::byte_number void    [inline, virtual]
 

Get current byte number. Descendants may override this method.

Reimplemented in moot::TokenReaderExpat.

virtual void moot::TokenReader::carp const char *    fmt,
...   
[virtual]
 

Complain, giving verbose information

virtual void moot::TokenReader::close void    [inline, virtual]
 

Finish input from currently selected source & perform any required cleanup operations. This method should always be called before selecting a new input source. The current input stream is only closed if it was created locally.

Descendants may override this method.

Reimplemented in moot::TokenReaderExpat.

virtual size_t moot::TokenReader::column_number size_t    n [inline, virtual]
 

Set current column number. Descendants may override this method.

Reimplemented in moot::TokenReaderExpat, and moot::TokenReaderNative.

virtual size_t moot::TokenReader::column_number void    [inline, virtual]
 

Get current column number. Descendants may override this method.

Reimplemented in moot::TokenReaderExpat, and moot::TokenReaderNative.

virtual void moot::TokenReader::from_buffer const void *    buf,
size_t    len
[inline, virtual]
 

Select input from a C memory-buffer. Caller is responsible for allocation and de-allocation. Descendants using C memory-buffer input may override this method. Default implementation calls from_mstream().

Reimplemented in moot::TokenReaderExpat.

virtual void moot::TokenReader::from_cxxstream std::istream &    is [inline, virtual]
 

Select input from a C++ stream. Caller is responsible for allocation and de-allocation. Descendants using C++ stream input may override this method. Default implementation calls from_mstream().

Reimplemented in moot::TokenReaderExpat.

virtual void moot::TokenReader::from_fd int    fd [inline, virtual]
 

Select input from a file descriptor. Caller is responsible for opening and closing the stream. Descendants using file descriptor input may override this method. No default implementation.

Reimplemented in moot::TokenReaderExpat.

virtual void moot::TokenReader::from_file FILE *    file [inline, virtual]
 

Select input from a C stream. Caller is responsible for opening and closing the stream. Descendants using C stream input may override this method. Default implementation calls from_mstream().

Reimplemented in moot::TokenReaderExpat.

virtual void moot::TokenReader::from_filename const char *    filename [inline, virtual]
 

Select input from a named file. Descendants using named file input may override this method. The filename "-" may be used to specify stdin. Default implementation calls from_mstream().

Reimplemented in moot::TokenReaderExpat.

virtual void moot::TokenReader::from_mstream mootio::mistream   mis [inline, virtual]
 

Select input from a mootio::mistream object, reference version. Default implementation just calls from_mstream(&mis).

Reimplemented in moot::TokenReaderExpat.

virtual void moot::TokenReader::from_mstream mootio::mistream   mistreamp [inline, virtual]
 

Select input from a mootio::mistream pointer. This is the basic case. Descendendant classes may want to override this method.

Reimplemented in moot::TokenReaderExpat, and moot::TokenReaderNative.

virtual void moot::TokenReader::from_string const char *    s [inline, virtual]
 

Select input from a NUL-terminated C string. Caller is responsible for allocation and de-allocation. Descendants using C string input may override this method. Default implementation calls from_cbuffer(s,len).

virtual mootTokenType moot::TokenReader::get_sentence void    [virtual]
 

Read in next sentence. On completion, current sentence (if any) is in *tr_sentence. Descendants may override this method for sentence-wise input.

Reimplemented in moot::TokenReaderExpat, and moot::TokenReaderNative.

virtual mootTokenType moot::TokenReader::get_token void    [inline, virtual]
 

Get the next token from the buffer. On completion, current token (if any) is in *tr_token. Descendants must override this method.

Reimplemented in moot::TokenReaderExpat, and moot::TokenReaderNative.

virtual size_t moot::TokenReader::line_number size_t    n [inline, virtual]
 

Set current line number. Descendants may override this method.

Reimplemented in moot::TokenReaderExpat, and moot::TokenReaderNative.

virtual size_t moot::TokenReader::line_number void    [inline, virtual]
 

Get current line number. Descendants may override this method.

Reimplemented in moot::TokenReaderExpat, and moot::TokenReaderNative.

virtual void moot::TokenReader::reader_name const std::string &    myname [inline, virtual]
 

Set reader subtype name to use for diagnostics. Descendants may override this method.

Reimplemented in moot::TokenReaderExpat.

mootSentence* moot::TokenReader::sentence void    [inline]
 

Get a pointer to the current input sentence. Returns NULL if no sentence is available.

Warning:
The contents of the sentence returned may be overwritten on the next call to any other TokenReader method.

mootToken* moot::TokenReader::token void    [inline]
 

Get pointer to the current input token. Returns NULL if no token is available.

Warning:
The contents of the token returned may be overwritten on the next call to any other TokenReader method.

void moot::TokenReader::tr_clear void    [inline]
 

Clear TokenReader-relevant construction buffers, if they exist.


Member Data Documentation

const size_t moot::TokenReader::TR_DEFAULT_BUFSIZE = 256 [static]
 

Default size of input buffer.

int moot::TokenReader::tr_format
 

Format flags: bitmask of TokenIO::TokenIOFormat flags

mootio::mistream* moot::TokenReader::tr_istream
 

Currently selected input stream (may be NULL)

bool moot::TokenReader::tr_istream_created
 

Whether we created tr_istream locally

std::string moot::TokenReader::tr_name
 

Name of TokenReader subtype.

mootSentence* moot::TokenReader::tr_sentence
 

Pointer to a real internal 'current sentence' buffer, used as return value for sentence() method.

Descendant implementations are responsible for allocation, population, maniuplation, and destruction of the data it points to.

mootToken* moot::TokenReader::tr_token
 

Pointer to a real internal 'current token' buffer, used as return value for token() method.

Descendant implementations are responsible for allocation, population, manipulation, and destruction of the data it points to.


The documentation for this class was generated from the following file:
Generated on Wed Jul 28 15:48:06 2004 for libmoot by doxygen1.2.15