antlr3UCS2Substr (3) - Linux Manuals

NAME

src/antlr3ucs2inputstream.c -

Base functions to initialize and manipulate a UCS2 input stream.

SYNOPSIS


#include <antlr3input.h>

Functions


static void antlr3UCS2Consume (pANTLR3_INT_STREAM is)
Consume the next character in an 8 bit ASCII input stream.
static ANTLR3_MARKER antlr3UCS2Index (pANTLR3_INT_STREAM is)
Calculate the current index in the output stream.
static ANTLR3_UCHAR antlr3UCS2LA (pANTLR3_INT_STREAM is, ANTLR3_INT32 la)
Return the input element assuming an 8 bit ascii input.
static void antlr3UCS2Seek (pANTLR3_INT_STREAM is, ANTLR3_MARKER seekPoint)
Rewind the lexer input to the state specified by the supplied mark.
void antlr3UCS2SetupStream (pANTLR3_INPUT_STREAM input, ANTLR3_UINT32 type)
Common function to setup function interface for a 16 bit 'UCS2' input stream.
static pANTLR3_STRING antlr3UCS2Substr (pANTLR3_INPUT_STREAM input, ANTLR3_MARKER start, ANTLR3_MARKER stop)
Return a substring of the ucs2 (16 bit) input stream in newly allocated memory.

Detailed Description

Base functions to initialize and manipulate a UCS2 input stream.

Function Documentation

static void antlr3UCS2Consume (pANTLR3_INT_STREAM is) [static]

Consume the next character in an 8 bit ASCII input stream. Parameters:

input Input stream context pointer

References ANTLR3_INPUT_STREAM_struct::charPositionInLine, ANTLR3_INPUT_STREAM_struct::currentLine, ANTLR3_INPUT_STREAM_struct::data, ANTLR3_INPUT_STREAM_struct::line, ANTLR3_INPUT_STREAM_struct::newlineChar, ANTLR3_INPUT_STREAM_struct::nextChar, ANTLR3_INPUT_STREAM_struct::sizeBuf, and ANTLR3_INT_STREAM_struct::super.

Referenced by antlr3UCS2SetupStream().

static ANTLR3_MARKER antlr3UCS2Index (pANTLR3_INT_STREAM is) [static]

Calculate the current index in the output stream. Parameters:

input Input stream context pointer

References ANTLR3_INPUT_STREAM_struct::nextChar, and ANTLR3_INT_STREAM_struct::super.

Referenced by antlr3UCS2SetupStream().

static ANTLR3_UCHAR antlr3UCS2LA (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) [static]

Return the input element assuming an 8 bit ascii input. Parameters:

input Input stream context pointer
la 1 based offset of next input stream element

Returns:

Next input character in internal ANTLR3 encoding (UTF32)

References ANTLR3_CHARSTREAM_EOF, ANTLR3_INPUT_STREAM_struct::data, ANTLR3_INPUT_STREAM_struct::nextChar, ANTLR3_INPUT_STREAM_struct::sizeBuf, and ANTLR3_INT_STREAM_struct::super.

Referenced by antlr3UCS2SetupStream().

static void antlr3UCS2Seek (pANTLR3_INT_STREAM is, ANTLR3_MARKER seekPoint) [static]

Rewind the lexer input to the state specified by the supplied mark. Parameters:

input Input stream context pointer

Remarks:

Assumes ASCII (or at least, 8 Bit) input stream.

References ANTLR3_INT_STREAM_struct::consume, ANTLR3_INPUT_STREAM_struct::nextChar, and ANTLR3_INT_STREAM_struct::super.

Referenced by antlr3UCS2SetupStream().

void antlr3UCS2SetupStream (pANTLR3_INPUT_STREAM input, ANTLR3_UINT32 type)

Common function to setup function interface for a 16 bit 'UCS2' input stream. Parameters:

input Input stream context pointer

Remarks:

*
Strictly speaking, there is no such thing as a UCS2 input stream as the term tends to confuse the notions of character encoding, unicode and so on. However because there will possibly be a need for a UTF-16 stream, I needed to identify 16 bit streams that do not support surrogate encodings and UCS2 is how it is mostly referred to. For instance Java, Oracle and others use a 16 bit encoding of characters and so this type of stream is very common. Take it to mean, therefore, a straight 16 bit uncomplicated encoding of Unicode code points.

References ANTLR3_INT_STREAM_struct::_LA, antlr3GenericSetupStream(), antlr3UCS2Consume(), antlr3UCS2Index(), antlr3UCS2LA(), antlr3UCS2Seek(), antlr3UCS2StringFactoryNew(), antlr3UCS2Substr(), ANTLR3_INPUT_STREAM_struct::charByteSize, ANTLR3_INT_STREAM_struct::consume, ANTLR3_INT_STREAM_struct::index, ANTLR3_INPUT_STREAM_struct::istream, ANTLR3_INT_STREAM_struct::seek, ANTLR3_INPUT_STREAM_struct::strFactory, and ANTLR3_INPUT_STREAM_struct::substr.

Referenced by antlr3NewUCS2StringInPlaceStream().

static pANTLR3_STRING antlr3UCS2Substr (pANTLR3_INPUT_STREAM input, ANTLR3_MARKER start, ANTLR3_MARKER stop) [static]

Return a substring of the ucs2 (16 bit) input stream in newly allocated memory. Parameters:

input Input stream context pointer
start Offset in input stream where the string starts
stop Offset in the input stream where the string ends.

References ANTLR3_UINT32_CAST, ANTLR3_STRING_FACTORY_struct::newPtr, and ANTLR3_INPUT_STREAM_struct::strFactory.

Referenced by antlr3UCS2SetupStream().

Author

Generated automatically by Doxygen for ANTLR3C from the source code.