ANTLR Support Libraries 2.7.1+
Public Member Functions | Protected Attributes
antlr::CharInputBuffer Class Reference

#include <CharInputBuffer.hpp>

Inheritance diagram for antlr::CharInputBuffer:
Inheritance graph
[legend]
Collaboration diagram for antlr::CharInputBuffer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CharInputBuffer (unsigned char *buf, size_t size, bool owner=false)
 ~CharInputBuffer (void)
virtual void reset (void)
virtual int getChar (void)

Protected Attributes

unsigned char * buffer
 the buffer with data
unsigned char * ptr
 position ptr into the buffer
unsigned char * end
 end sentry for buffer
bool delete_buffer
 flag signifying if we have to delete the buffer

Detailed Description

CharInputBuffer.hpp provides an InputBuffer for plain character arrays (buffers).


Constructor & Destructor Documentation

antlr::CharInputBuffer::CharInputBuffer ( unsigned char *  buf,
size_t  size,
bool  owner = false 
) [inline]

Construct a CharInputBuffer.hpp object with a char* buffer of 'size' if 'owner' is true, then the buffer will be delete[]-ed on destruction.

Note:
it is assumed the buffer was allocated with new[]!
antlr::CharInputBuffer::~CharInputBuffer ( void  ) [inline]

Destructor

Note:
If you're using malloced data, then you probably need to change this destructor. Or better use this class as template for your own.

Member Function Documentation

virtual int antlr::CharInputBuffer::getChar ( void  ) [inline, virtual]

Override this in subclasses to get the next character

Implements antlr::InputBuffer.

virtual void antlr::CharInputBuffer::reset ( void  ) [inline, virtual]

Reset the CharInputBuffer to initial state Called from LexerInputState::reset.

See also:
LexerInputState

Reimplemented from antlr::InputBuffer.


Member Data Documentation

unsigned char* antlr::CharInputBuffer::buffer [protected]

the buffer with data

flag signifying if we have to delete the buffer

unsigned char* antlr::CharInputBuffer::end [protected]

end sentry for buffer

unsigned char* antlr::CharInputBuffer::ptr [protected]

position ptr into the buffer


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines