KDevelop API Documentation

CharBuffer Class Reference

A Stream of characters fed to the lexer from a InputStream that can be rewound via mark()/rewind() methods. More...

#include <CharBuffer.hpp>

Inheritance diagram for CharBuffer:

Inheritance graph
[legend]
Collaboration diagram for CharBuffer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CharBuffer (std::istream &input_)
 Create a character buffer.
int getChar ()
 Get the next character from the stream.

Private Member Functions

 CharBuffer (const CharBuffer &other)
CharBufferoperator= (const CharBuffer &other)

Private Attributes

std::istream & input

Detailed Description

A Stream of characters fed to the lexer from a InputStream that can be rewound via mark()/rewind() methods.

A dynamic array is used to buffer up all the input characters. Normally, "k" characters are stored in the buffer. More characters may be stored during guess mode (testing syntactic predicate), or when LT(i>k) is referenced. Consumption of characters is deferred. In other words, reading the next character is not done by consume(), but deferred until needed by LA or LT.

See also:
antlr.CharQueue

Definition at line 32 of file CharBuffer.hpp.


Constructor & Destructor Documentation

CharBuffer::CharBuffer std::istream &  input_  ) 
 

Create a character buffer.

Enable fail and bad exceptions, if supported by platform.

Definition at line 30 of file CharBuffer.cpp.

CharBuffer::CharBuffer const CharBuffer other  )  [private]
 


Member Function Documentation

int CharBuffer::getChar void   )  [virtual]
 

Get the next character from the stream.

May throw CharStreamIOException when something bad happens (not EOF) (if supported by platform).

Implements InputBuffer.

Definition at line 40 of file CharBuffer.cpp.

References input.

CharBuffer& CharBuffer::operator= const CharBuffer other  )  [private]
 


Member Data Documentation

std ::istream& CharBuffer::input [private]
 

Definition at line 35 of file CharBuffer.hpp.

Referenced by getChar().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Feb 22 09:37:32 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003