OpenMD  2.5
Molecular Dynamics in the Open
antlr::CharBuffer Class Reference

#include <CharBuffer.hpp>

Inheritance diagram for antlr::CharBuffer:

Public Member Functions

 CharBuffer (std ::istream &input)
 Create a character buffer. More...
int getChar ()
 Get the next character from the stream. More...
- Public Member Functions inherited from antlr::InputBuffer
 InputBuffer ()
virtual ~InputBuffer ()
virtual void reset (void)
 Reset the input buffer to empty state. More...
void commit (void)
virtual void consume ()
virtual void fill (unsigned int amount)
virtual int LA (unsigned int i)
virtual unsigned int mark ()
virtual bool isMarked () const
 Are there any marks active in the InputBuffer. More...
virtual void rewind (unsigned int mark)
virtual unsigned int entries () const
std ::string getLAChars () const
std ::string getMarkedChars () const

Private Member Functions

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

Private Attributes

std ::istream & input

Additional Inherited Members

- Protected Member Functions inherited from antlr::InputBuffer
void syncConsume ()
- Protected Attributes inherited from antlr::InputBuffer
unsigned int nMarkers
unsigned int markerOffset
unsigned int numToConsume
CircularQueue< int > queue

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

Definition at line 35 of file CharBuffer.hpp.

Constructor & Destructor Documentation

◆ CharBuffer() [1/2]

antlr::CharBuffer::CharBuffer ( std ::istream &  input_)

Create a character buffer.

Create a character buffer. Enable fail and bad exceptions, if supported by platform.

Definition at line 30 of file CharBuffer.cpp.

◆ CharBuffer() [2/2]

antlr::CharBuffer::CharBuffer ( const CharBuffer other)

Member Function Documentation

◆ getChar()

int antlr::CharBuffer::getChar ( void  )

Get the next character from the stream.

Get the next character from the stream. May throw CharStreamIOException when something bad happens (not EOF) (if supported by platform).

Implements antlr::InputBuffer.

Definition at line 40 of file CharBuffer.cpp.

References input.

◆ operator=()

CharBuffer& antlr::CharBuffer::operator= ( const CharBuffer other)

Member Data Documentation

◆ input

std ::istream& antlr::CharBuffer::input

Definition at line 46 of file CharBuffer.hpp.

Referenced by getChar().

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