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

moot::TokenReaderExpat Class Reference

Experimental XML reader class using expat.

#include <mootTokenExpatIO.h>

Inheritance diagram for moot::TokenReaderExpat:

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

Collaboration graph
[legend]
List of all members.

Public Types

Public Methods

Constructors and Such
TokenReader Overrides : Input Selection
TokenReader Overrides : Input
XML Utilities
expat handlers
Error reporting

Public Attributes

Search Parameters
Internal Data

Static Public Attributes


Member Typedef Documentation

typedef slist<int> moot::TokenReaderExpat::NodeInfoStack
 

Node information stack: each element is a bitmask of xmlNodeFlags


Member Enumeration Documentation

enum moot::TokenReaderExpat::xmlNodeFlags
 

Enum for parser node-information stack elements: use these constants to create bitmasks.

Enumeration values:
TRX_Default  nothing special about this node
TRX_IsOuter  extra-document data
TRX_IsRoot  document root node
TRX_IsBodyE  body node
TRX_IsBodyD  (indirect) daughter of a body node
TRX_IsTokenE  token node
TRX_IsTokenD  (indirect) daughter of a token node
TRX_IsTokTextE  token-text node
TRX_IsTokTextD  (indirect) daughter of a token-text node
TRX_IsAnalysisE  token-analysis node
TRX_IsAnalysisD  (indirect) daughter of an analysis node
TRX_IsBestTagE  'best tag' node
TRX_IsBestTagD  (indirect) daughter of a 'best tag' node
TRX_All  all possible flags (useful for masking)


Constructor & Destructor Documentation

moot::TokenReaderExpat::TokenReaderExpat int    fmt = tiofXML,
size_t    buflen = 8192,
const std::string &    encoding = "",
const std::string &    name = "TokenReaderExpat"
[inline]
 

Default constructor: \bufsize: length of parse buffer for expat \encoding: override document encoding (broken?)

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

Default destructor


Member Function Documentation

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

Set current byte number.

Reimplemented from moot::TokenReader.

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

Get current byte number.

Reimplemented from moot::TokenReader.

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

complain

Reimplemented from moot::mootExpatParser.

virtual void moot::TokenReaderExpat::CharacterDataHandler const XML_Char *    s,
int    len
[virtual]
 

Handle character data

Reimplemented from moot::mootExpatParser.

virtual void moot::TokenReaderExpat::close void    [virtual]
 

Close currently selected input source.

Reimplemented from moot::mootExpatParser.

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

Set current column number.

Reimplemented from moot::TokenReader.

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

Get current column number.

Reimplemented from moot::TokenReader.

virtual void moot::TokenReaderExpat::CommentHandler const XML_Char *    s [virtual]
 

Handle comments

Reimplemented from moot::mootExpatParser.

virtual void moot::TokenReaderExpat::DefaultHandler const XML_Char *    s,
int    len
[virtual]
 

Handle any other document-internal data (no entity expansion!)

Reimplemented from moot::mootExpatParser.

virtual void moot::TokenReaderExpat::EndElementHandler const char *    el [virtual]
 

Handle end elements

Reimplemented from moot::mootExpatParser.

bool moot::TokenReaderExpat::ensure_cb_fullsents void   
 

Ensure that there is some data in the callback sentence buffer, possibly parsing another chunk of the document. If more data is read, tr_token is reset to NULL.

Returns false iff no more data is available in cb_fullsents.

virtual void moot::TokenReaderExpat::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 from moot::mootExpatParser.

virtual void moot::TokenReaderExpat::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 from moot::mootExpatParser.

virtual void moot::TokenReaderExpat::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 from moot::mootExpatParser.

virtual void moot::TokenReaderExpat::from_file FILE *    infile [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 from moot::mootExpatParser.

virtual void moot::TokenReaderExpat::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 from moot::mootExpatParser.

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

Select input from a mootio::mistream reference. This is the basic case. Descendant classes may override this method.

Reimplemented from moot::mootExpatParser.

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

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

Reimplemented from moot::mootExpatParser.

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

Read in next sentence. On completion, current sentence (if any) is in *tr_sentence.

Reimplemented from moot::TokenReader.

virtual mootTokenType moot::TokenReaderExpat::get_token void    [virtual]
 

Get the next token from the buffer. On completion, current token (if any) is in *tr_token.

Reimplemented from moot::TokenReader.

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

Set current line number -- not implemented.

Reimplemented from moot::TokenReader.

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

Get current line number.

Reimplemented from moot::TokenReader.

int moot::TokenReaderExpat::next_node_info int    emptyStackValue = TRX_IsOuter,
int    inheritanceMask = defaultNodeInheritanceMask
[inline]
 

Predict node information for the next node by inheritance-masking

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

Declare subtype name to use for diagnostics.

Reimplemented from moot::TokenReader.

virtual void moot::TokenReaderExpat::reset void    [virtual]
 

Reset parser state

Reimplemented from moot::mootExpatParser.

void moot::TokenReaderExpat::save_context mootTokenType    toktype = TokTypeXMLRaw,
int    info = 0
[inline]
 

Save current parser context as a mootToken to the callback sentence buffer.

void moot::TokenReaderExpat::save_context_data const char *    text,
size_t    len,
mootTokenType    toktype = TokTypeXMLRaw,
int    info = 0
 

Save a mootToken to the callback sentence buffer

void moot::TokenReaderExpat::save_context_data const mootio::micbuffer   buf,
mootTokenType    toktype = TokTypeXMLRaw,
int    info = 0
[inline]
 

Save a mootToken to the callback sentence buffer

virtual void moot::TokenReaderExpat::StartElementHandler const char *    el,
const char **    attr
[virtual]
 

Handle start elements

Reimplemented from moot::mootExpatParser.

int moot::TokenReaderExpat::top_node_info int    emptyStackValue = TRX_IsOuter [inline]
 

Get node information for the parent node (top of the stack)

virtual void moot::TokenReaderExpat::XmlDeclHandler const XML_Char *    version,
const XML_Char *    encoding,
int    standalone
[virtual]
 

Handle XML declarations

Reimplemented from moot::mootExpatParser.


Member Data Documentation

std::string moot::TokenReaderExpat::analysis_elt
 

std::string moot::TokenReaderExpat::besttag_elt
 

std::string moot::TokenReaderExpat::body_elt
 

mootSentence moot::TokenReaderExpat::cb_fullsents
 

mootSentence moot::TokenReaderExpat::cb_nxtsent
 

mootToken* moot::TokenReaderExpat::cb_nxttok
 

const int moot::TokenReaderExpat::defaultNodeInheritanceMask = TRX_IsBodyD|TRX_IsTokenD|TRX_IsTokTextD|TRX_IsAnalysisD|TRX_IsBestTagD [static]
 

Default node-inheritance flags

int moot::TokenReaderExpat::done
 

std::string moot::TokenReaderExpat::eos_elt
 

std::string moot::TokenReaderExpat::postag_attr
 

bool moot::TokenReaderExpat::save_raw_xml
 

NodeInfoStack moot::TokenReaderExpat::stack
 

std::string moot::TokenReaderExpat::text_elt
 

std::string moot::TokenReaderExpat::token_elt
 

mootSentence moot::TokenReaderExpat::trx_sentbuf
 


The documentation for this class was generated from the following file:
Generated on Mon Sep 11 16:10:37 2006 for libmoot by doxygen1.2.18