#include <antlr3input.h>
Functions | |
static void | antlr38BitConsume (pANTLR3_INT_STREAM is) |
Consume the next character in an 8 bit input stream. | |
static ANTLR3_UINT32 | antlr38BitGetCharPosition (pANTLR3_INPUT_STREAM input) |
Return the current offset in to the current line in the input stream. | |
static ANTLR3_UINT32 | antlr38BitGetLine (pANTLR3_INPUT_STREAM input) |
Return the line number as understood by the 8 bit input stream. | |
static void * | antlr38BitGetLineBuf (pANTLR3_INPUT_STREAM input) |
Return a pointer into the input stream that points at the start of the current input line as triggered by the end of line character installed for the stream (' ' unless told differently). | |
static pANTLR3_STRING | antlr38BitGetSourceName (pANTLR3_INT_STREAM is) |
static ANTLR3_MARKER | antlr38BitIndex (pANTLR3_INT_STREAM is) |
Calculate the current index in the output stream. | |
static ANTLR3_UCHAR | antlr38BitLA (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) |
Return the input element assuming an 8 bit ascii input. | |
static ANTLR3_UCHAR | antlr38BitLA_ucase (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) |
Return the input element assuming an 8 bit input and always return the UPPER CASE character. | |
static void * | antlr38BitLT (pANTLR3_INPUT_STREAM input, ANTLR3_INT32 lt) |
Return the input element assuming an 8 bit ascii input. | |
static ANTLR3_MARKER | antlr38BitMark (pANTLR3_INT_STREAM is) |
Mark the current input point in an 8Bit 8 bit stream such as a file stream, where all the input is available in the buffer. | |
static void | antlr38BitRelease (pANTLR3_INT_STREAM is, ANTLR3_MARKER mark) |
Rewind the lexer input to the state specified by the supplied mark. | |
static void | antlr38BitReuse (pANTLR3_INPUT_STREAM input, pANTLR3_UINT8 inString, ANTLR3_UINT32 size, pANTLR3_UINT8 name) |
Install a new source code in to a working input stream so that the input stream can be reused. | |
static void | antlr38BitRewind (pANTLR3_INT_STREAM is, ANTLR3_MARKER mark) |
Rewind the lexer input to the state specified by the supplied mark. | |
static void | antlr38BitRewindLast (pANTLR3_INT_STREAM is) |
Rewind the lexer input to the state specified by the last produced mark. | |
static void | antlr38BitSeek (pANTLR3_INT_STREAM is, ANTLR3_MARKER seekPoint) |
Rewind the lexer input to the state specified by the supplied mark. | |
static void | antlr38BitSetCharPosition (pANTLR3_INPUT_STREAM input, ANTLR3_UINT32 position) |
Set the current offset in the current line to be a particular setting. | |
static void | antlr38BitSetLine (pANTLR3_INPUT_STREAM input, ANTLR3_UINT32 line) |
Set the current line number as understood by the input stream. | |
static void | antlr38BitSetNewLineChar (pANTLR3_INPUT_STREAM input, ANTLR3_UINT32 newlineChar) |
Set the newline trigger character in the input stream to the supplied parameter. | |
static void | antlr38BitSetUcaseLA (pANTLR3_INPUT_STREAM input, ANTLR3_BOOLEAN flag) |
void | antlr38BitSetupStream (pANTLR3_INPUT_STREAM input) |
Common function to setup function interface for an 8 bit input stream. | |
static ANTLR3_UINT32 | antlr38BitSize (pANTLR3_INPUT_STREAM input) |
Return the size of the current input stream, as an 8Bit file which in this case is the total input. | |
static pANTLR3_STRING | antlr38BitSubstr (pANTLR3_INPUT_STREAM input, ANTLR3_MARKER start, ANTLR3_MARKER stop) |
Return a substring of the 8 bit input stream in newly allocated memory. | |
static ANTLR3_UCHAR | antlr3EBCDICLA (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) |
Return the input element assuming an 8 bit EBCDIC input. | |
void | antlr3EBCDICSetupStream (pANTLR3_INPUT_STREAM input) |
Common function to setup function interface for a EBCDIC input stream. | |
void | antlr3GenericSetupStream (pANTLR3_INPUT_STREAM input) |
static void | antlr3InputClose (pANTLR3_INPUT_STREAM input) |
Close down an input stream and free any memory allocated by it. | |
static void | antlr3InputReset (pANTLR3_INPUT_STREAM input) |
Reset a re-startable input stream to the start. | |
static void | antlr3UTF16Consume (pANTLR3_INT_STREAM is) |
Consume the next character in a UTF16 input stream. | |
static void | antlr3UTF16ConsumeBE (pANTLR3_INT_STREAM is) |
Consume the next character in a UTF16 input stream when the input is Big Endian and the machine is not. | |
static void | antlr3UTF16ConsumeLE (pANTLR3_INT_STREAM is) |
Consume the next character in a UTF16 input stream when the input is Little Endian and the machine is not Note that the UTF16 routines do not do any substantial verification of the input stream as for performance sake, we assume it is validly encoded. | |
static ANTLR3_MARKER | antlr3UTF16Index (pANTLR3_INT_STREAM is) |
Calculate the current index in the output stream. | |
static ANTLR3_UCHAR | antlr3UTF16LA (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) |
Return the input element assuming an 8 bit ascii input. | |
static ANTLR3_UCHAR | antlr3UTF16LABE (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) |
Return the input element assuming a UTF16 input when the input is Little Endian and the machine is not. | |
static ANTLR3_UCHAR | antlr3UTF16LALE (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) |
Return the input element assuming a UTF16 input when the input is Little Endian and the machine is not. | |
static void | antlr3UTF16Seek (pANTLR3_INT_STREAM is, ANTLR3_MARKER seekPoint) |
Rewind the lexer input to the state specified by the supplied mark. | |
void | antlr3UTF16SetupStream (pANTLR3_INPUT_STREAM input, ANTLR3_BOOLEAN machineBigEndian, ANTLR3_BOOLEAN inputBigEndian) |
Common function to setup function interface for a UTF16 or UCS2 input stream. | |
static pANTLR3_STRING | antlr3UTF16Substr (pANTLR3_INPUT_STREAM input, ANTLR3_MARKER start, ANTLR3_MARKER stop) |
Return a substring of the UTF16 input stream in newly allocated memory. | |
static void | antlr3UTF32Consume (pANTLR3_INT_STREAM is) |
Consume the next character in a UTF32 input stream. | |
static ANTLR3_MARKER | antlr3UTF32Index (pANTLR3_INT_STREAM is) |
Calculate the current index in the output stream. | |
static ANTLR3_UCHAR | antlr3UTF32LA (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) |
Return the input element assuming a UTF32 input in natural machine byte order. | |
static ANTLR3_UCHAR | antlr3UTF32LABE (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) |
Return the input element assuming a UTF32 input in big endian byte order. | |
static ANTLR3_UCHAR | antlr3UTF32LALE (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) |
Return the input element assuming a UTF32 input in little endian byte order. | |
static void | antlr3UTF32Seek (pANTLR3_INT_STREAM is, ANTLR3_MARKER seekPoint) |
Rewind the lexer input to the state specified by the supplied mark. | |
void | antlr3UTF32SetupStream (pANTLR3_INPUT_STREAM input, ANTLR3_BOOLEAN machineBigEndian, ANTLR3_BOOLEAN inputBigEndian) |
Common function to setup function interface for a UTF3 input stream. | |
static pANTLR3_STRING | antlr3UTF32Substr (pANTLR3_INPUT_STREAM input, ANTLR3_MARKER start, ANTLR3_MARKER stop) |
Return a substring of the UTF16 input stream in newly allocated memory. | |
static void | antlr3UTF8Consume (pANTLR3_INT_STREAM is) |
Consume the next character in a UTF8 input stream. | |
static ANTLR3_UCHAR | antlr3UTF8LA (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) |
Return the input element assuming a UTF8 input. | |
void | antlr3UTF8SetupStream (pANTLR3_INPUT_STREAM input) |
Common function to setup function interface for a UTF8 input stream. | |
Variables | |
const ANTLR3_UCHAR | e2a [256] |
static const UTF32 | offsetsFromUTF8 [6] |
Magic values subtracted from a buffer value during UTF8 conversion. | |
static const ANTLR3_UINT32 | trailingBytesForUTF8 [256] |
Index into the table below with the first byte of a UTF-8 sequence to get the number of trailing bytes that are supposed to follow it. |
static void antlr38BitConsume | ( | pANTLR3_INT_STREAM | is | ) | [static] |
Consume the next character in an 8 bit input stream.
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 antlr3GenericSetupStream().
static ANTLR3_UINT32 antlr38BitGetCharPosition | ( | pANTLR3_INPUT_STREAM | input | ) | [static] |
Return the current offset in to the current line in the input stream.
input | Input stream context pointer |
References ANTLR3_INPUT_STREAM_struct::charPositionInLine.
Referenced by antlr3GenericSetupStream().
static ANTLR3_UINT32 antlr38BitGetLine | ( | pANTLR3_INPUT_STREAM | input | ) | [static] |
Return the line number as understood by the 8 bit input stream.
input | Input stream context pointer |
References ANTLR3_INPUT_STREAM_struct::line.
Referenced by antlr3GenericSetupStream().
static void * antlr38BitGetLineBuf | ( | pANTLR3_INPUT_STREAM | input | ) | [static] |
Return a pointer into the input stream that points at the start of the current input line as triggered by the end of line character installed for the stream ('
' unless told differently).
[in] | input |
References ANTLR3_INPUT_STREAM_struct::currentLine.
Referenced by antlr3GenericSetupStream().
static pANTLR3_STRING antlr38BitGetSourceName | ( | pANTLR3_INT_STREAM | is | ) | [static] |
References ANTLR3_INT_STREAM_struct::streamName.
Referenced by antlr3GenericSetupStream().
static ANTLR3_MARKER antlr38BitIndex | ( | pANTLR3_INT_STREAM | is | ) | [static] |
Calculate the current index in the output stream.
[in] | input | Input stream context pointer |
References ANTLR3_INPUT_STREAM_struct::nextChar, and ANTLR3_INT_STREAM_struct::super.
Referenced by antlr3GenericSetupStream().
static ANTLR3_UCHAR antlr38BitLA | ( | pANTLR3_INT_STREAM | is, | |
ANTLR3_INT32 | la | |||
) | [static] |
Return the input element assuming an 8 bit ascii input.
[in] | input | Input stream context pointer |
[in] | la | 1 based offset of next input stream element |
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 antlr38BitSetUcaseLA(), and antlr3GenericSetupStream().
static ANTLR3_UCHAR antlr38BitLA_ucase | ( | pANTLR3_INT_STREAM | is, | |
ANTLR3_INT32 | la | |||
) | [static] |
Return the input element assuming an 8 bit input and always return the UPPER CASE character.
Note that this is 8 bit and so we assume that the toupper function will use the correct locale for 8 bits.
[in] | input | Input stream context pointer |
[in] | la | 1 based offset of next input stream element |
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 antlr38BitSetUcaseLA().
static void * antlr38BitLT | ( | pANTLR3_INPUT_STREAM | input, | |
ANTLR3_INT32 | lt | |||
) | [static] |
Return the input element assuming an 8 bit ascii input.
[in] | input | Input stream context pointer |
[in] | lt | 1 based offset of next input stream element |
References ANTLR3_INT_STREAM_struct::_LA, ANTLR3_FUNC_PTR, and ANTLR3_INPUT_STREAM_struct::istream.
Referenced by antlr3GenericSetupStream().
static ANTLR3_MARKER antlr38BitMark | ( | pANTLR3_INT_STREAM | is | ) | [static] |
Mark the current input point in an 8Bit 8 bit stream such as a file stream, where all the input is available in the buffer.
[in] | is | Input stream context pointer |
References ANTLR3_VECTOR_struct::add, ANTLR3_FREE_FUNC, ANTLR3_MALLOC, ANTLR3_INPUT_STREAM_struct::charPositionInLine, ANTLR3_LEX_STATE_struct::charPositionInLine, ANTLR3_VECTOR_struct::count, ANTLR3_INPUT_STREAM_struct::currentLine, ANTLR3_LEX_STATE_struct::currentLine, ANTLR3_VECTOR_struct::get, ANTLR3_INT_STREAM_struct::lastMarker, ANTLR3_INPUT_STREAM_struct::line, ANTLR3_LEX_STATE_struct::line, ANTLR3_INPUT_STREAM_struct::markDepth, ANTLR3_INPUT_STREAM_struct::markers, ANTLR3_INPUT_STREAM_struct::nextChar, ANTLR3_LEX_STATE_struct::nextChar, and ANTLR3_INT_STREAM_struct::super.
Referenced by antlr3GenericSetupStream().
static void antlr38BitRelease | ( | pANTLR3_INT_STREAM | is, | |
ANTLR3_MARKER | mark | |||
) | [static] |
Rewind the lexer input to the state specified by the supplied mark.
[in] | input | Input stream context pointer |
References ANTLR3_INPUT_STREAM_struct::markDepth, and ANTLR3_INT_STREAM_struct::super.
Referenced by antlr3GenericSetupStream().
static void antlr38BitReuse | ( | pANTLR3_INPUT_STREAM | input, | |
pANTLR3_UINT8 | inString, | |||
ANTLR3_UINT32 | size, | |||
pANTLR3_UINT8 | name | |||
) | [static] |
Install a new source code in to a working input stream so that the input stream can be reused.
References ANTLR3_FALSE, ANTLR3_INPUT_STREAM_struct::data, ANTLR3_INPUT_STREAM_struct::fileName, ANTLR3_INPUT_STREAM_struct::isAllocated, ANTLR3_INPUT_STREAM_struct::istream, ANTLR3_STRING_FACTORY_struct::newStr, ANTLR3_INPUT_STREAM_struct::reset, ANTLR3_INPUT_STREAM_struct::sizeBuf, ANTLR3_INT_STREAM_struct::streamName, and ANTLR3_INPUT_STREAM_struct::strFactory.
Referenced by antlr3GenericSetupStream().
static void antlr38BitRewind | ( | pANTLR3_INT_STREAM | is, | |
ANTLR3_MARKER | mark | |||
) | [static] |
Rewind the lexer input to the state specified by the supplied mark.
[in] | input | Input stream context pointer |
References antlr38BitSeek(), ANTLR3_LEX_STATE_struct::charPositionInLine, ANTLR3_INPUT_STREAM_struct::charPositionInLine, ANTLR3_LEX_STATE_struct::currentLine, ANTLR3_INPUT_STREAM_struct::currentLine, ANTLR3_VECTOR_struct::get, ANTLR3_INPUT_STREAM_struct::istream, ANTLR3_LEX_STATE_struct::line, ANTLR3_INPUT_STREAM_struct::line, ANTLR3_INPUT_STREAM_struct::markers, ANTLR3_INPUT_STREAM_struct::nextChar, ANTLR3_LEX_STATE_struct::nextChar, ANTLR3_INT_STREAM_struct::release, and ANTLR3_INT_STREAM_struct::super.
Referenced by antlr3GenericSetupStream().
static void antlr38BitRewindLast | ( | pANTLR3_INT_STREAM | is | ) | [static] |
Rewind the lexer input to the state specified by the last produced mark.
[in] | input | Input stream context pointer |
References ANTLR3_INT_STREAM_struct::lastMarker, and ANTLR3_INT_STREAM_struct::rewind.
Referenced by antlr3GenericSetupStream().
static void antlr38BitSeek | ( | pANTLR3_INT_STREAM | is, | |
ANTLR3_MARKER | seekPoint | |||
) | [static] |
Rewind the lexer input to the state specified by the supplied mark.
[in] | input | Input stream context pointer |
References ANTLR3_FUNC_PTR, ANTLR3_INT_STREAM_struct::consume, ANTLR3_INPUT_STREAM_struct::nextChar, and ANTLR3_INT_STREAM_struct::super.
Referenced by antlr38BitRewind(), and antlr3GenericSetupStream().
static void antlr38BitSetCharPosition | ( | pANTLR3_INPUT_STREAM | input, | |
ANTLR3_UINT32 | position | |||
) | [static] |
Set the current offset in the current line to be a particular setting.
[in] | input | Input stream context pointer |
[in] | position | New setting for current offset. |
References ANTLR3_INPUT_STREAM_struct::charPositionInLine.
Referenced by antlr3GenericSetupStream().
static void antlr38BitSetLine | ( | pANTLR3_INPUT_STREAM | input, | |
ANTLR3_UINT32 | line | |||
) | [static] |
Set the current line number as understood by the input stream.
input | Input stream context pointer | |
line | Line number to tell the input stream we are on |
References ANTLR3_INPUT_STREAM_struct::line.
Referenced by antlr3GenericSetupStream().
static void antlr38BitSetNewLineChar | ( | pANTLR3_INPUT_STREAM | input, | |
ANTLR3_UINT32 | newlineChar | |||
) | [static] |
Set the newline trigger character in the input stream to the supplied parameter.
[in] | input | Input stream context pointer |
[in] | newlineChar | Character to set to be the newline trigger. |
References ANTLR3_INPUT_STREAM_struct::newlineChar.
Referenced by antlr3GenericSetupStream().
static void antlr38BitSetUcaseLA | ( | pANTLR3_INPUT_STREAM | input, | |
ANTLR3_BOOLEAN | flag | |||
) | [static] |
References ANTLR3_INT_STREAM_struct::_LA, antlr38BitLA(), antlr38BitLA_ucase(), and ANTLR3_INPUT_STREAM_struct::istream.
Referenced by antlr3GenericSetupStream().
void antlr38BitSetupStream | ( | pANTLR3_INPUT_STREAM | input | ) |
Common function to setup function interface for an 8 bit input stream.
input | Input stream context pointer |
References antlr3StringFactoryNew(), ANTLR3_INPUT_STREAM_struct::encoding, and ANTLR3_INPUT_STREAM_struct::strFactory.
Referenced by setupInputStream().
static ANTLR3_UINT32 antlr38BitSize | ( | pANTLR3_INPUT_STREAM | input | ) | [static] |
Return the size of the current input stream, as an 8Bit file which in this case is the total input.
Other implementations may provide more sophisticated implementations to deal with non-recoverable streams and so on.
[in] | input | Input stream context pointer |
References ANTLR3_INPUT_STREAM_struct::sizeBuf.
Referenced by antlr3GenericSetupStream().
static pANTLR3_STRING antlr38BitSubstr | ( | pANTLR3_INPUT_STREAM | input, | |
ANTLR3_MARKER | start, | |||
ANTLR3_MARKER | stop | |||
) | [static] |
Return a substring of the 8 bit input stream in newly allocated memory.
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_STRING_FACTORY_struct::newPtr, and ANTLR3_INPUT_STREAM_struct::strFactory.
Referenced by antlr3GenericSetupStream().
static ANTLR3_UCHAR antlr3EBCDICLA | ( | pANTLR3_INT_STREAM | is, | |
ANTLR3_INT32 | la | |||
) | [static] |
Return the input element assuming an 8 bit EBCDIC input.
[in] | input | Input stream context pointer |
[in] | la | 1 based offset of next input stream element |
References ANTLR3_CHARSTREAM_EOF, ANTLR3_INPUT_STREAM_struct::data, e2a, ANTLR3_INPUT_STREAM_struct::nextChar, ANTLR3_INPUT_STREAM_struct::sizeBuf, and ANTLR3_INT_STREAM_struct::super.
Referenced by antlr3EBCDICSetupStream().
void antlr3EBCDICSetupStream | ( | pANTLR3_INPUT_STREAM | input | ) |
Common function to setup function interface for a EBCDIC input stream.
input | Input stream context pointer |
References ANTLR3_INT_STREAM_struct::_LA, antlr3EBCDICLA(), antlr3StringFactoryNew(), ANTLR3_INPUT_STREAM_struct::charByteSize, ANTLR3_INPUT_STREAM_struct::encoding, ANTLR3_INPUT_STREAM_struct::istream, and ANTLR3_INPUT_STREAM_struct::strFactory.
Referenced by setupInputStream().
void antlr3GenericSetupStream | ( | pANTLR3_INPUT_STREAM | input | ) |
References ANTLR3_INT_STREAM_struct::_LA, ANTLR3_INPUT_STREAM_struct::_LT, antlr38BitConsume(), antlr38BitGetCharPosition(), antlr38BitGetLine(), antlr38BitGetLineBuf(), antlr38BitGetSourceName(), antlr38BitIndex(), antlr38BitLA(), antlr38BitLT(), antlr38BitMark(), antlr38BitRelease(), antlr38BitReuse(), antlr38BitRewind(), antlr38BitRewindLast(), antlr38BitSeek(), antlr38BitSetCharPosition(), antlr38BitSetLine(), antlr38BitSetNewLineChar(), antlr38BitSetUcaseLA(), antlr38BitSize(), antlr38BitSubstr(), ANTLR3_CHARSTREAM, antlr3InputClose(), antlr3InputReset(), antlr3IntStreamNew(), ANTLR3_INPUT_STREAM_struct::charByteSize, ANTLR3_INPUT_STREAM_struct::close, ANTLR3_INT_STREAM_struct::consume, ANTLR3_INPUT_STREAM_struct::free, ANTLR3_INPUT_STREAM_struct::getCharPositionInLine, ANTLR3_INPUT_STREAM_struct::getLine, ANTLR3_INPUT_STREAM_struct::getLineBuf, ANTLR3_INT_STREAM_struct::getSourceName, ANTLR3_INT_STREAM_struct::index, ANTLR3_INPUT_STREAM_struct::istream, ANTLR3_INT_STREAM_struct::mark, ANTLR3_INPUT_STREAM_struct::markers, ANTLR3_INT_STREAM_struct::release, ANTLR3_INPUT_STREAM_struct::reset, ANTLR3_INPUT_STREAM_struct::reuse, ANTLR3_INT_STREAM_struct::rewind, ANTLR3_INT_STREAM_struct::rewindLast, ANTLR3_INT_STREAM_struct::seek, ANTLR3_INPUT_STREAM_struct::setCharPositionInLine, ANTLR3_INPUT_STREAM_struct::setLine, ANTLR3_INPUT_STREAM_struct::SetNewLineChar, ANTLR3_INPUT_STREAM_struct::setUcaseLA, ANTLR3_INPUT_STREAM_struct::size, ANTLR3_INPUT_STREAM_struct::substr, ANTLR3_INT_STREAM_struct::super, and ANTLR3_INT_STREAM_struct::type.
Referenced by antlr3CreateFileStream(), and antlr3CreateStringStream().
static void antlr3InputClose | ( | pANTLR3_INPUT_STREAM | input | ) | [static] |
Close down an input stream and free any memory allocated by it.
input | Input stream context pointer |
References ANTLR3_FREE, ANTLR3_STRING_FACTORY_struct::close, ANTLR3_INPUT_STREAM_struct::data, ANTLR3_INT_STREAM_struct::free, ANTLR3_INPUT_STREAM_struct::isAllocated, ANTLR3_INPUT_STREAM_struct::istream, ANTLR3_INPUT_STREAM_struct::markers, and ANTLR3_INPUT_STREAM_struct::strFactory.
Referenced by antlr3GenericSetupStream().
static void antlr3InputReset | ( | pANTLR3_INPUT_STREAM | input | ) | [static] |
Reset a re-startable input stream to the start.
input | Input stream context pointer |
References antlr3VectorNew(), ANTLR3_INPUT_STREAM_struct::charPositionInLine, ANTLR3_VECTOR_struct::clear, ANTLR3_INPUT_STREAM_struct::currentLine, ANTLR3_INPUT_STREAM_struct::data, ANTLR3_INPUT_STREAM_struct::line, ANTLR3_INPUT_STREAM_struct::markDepth, ANTLR3_INPUT_STREAM_struct::markers, and ANTLR3_INPUT_STREAM_struct::nextChar.
Referenced by antlr3GenericSetupStream().
static void antlr3UTF16Consume | ( | pANTLR3_INT_STREAM | is | ) | [static] |
Consume the next character in a UTF16 input stream.
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, ANTLR3_INT_STREAM_struct::super, UNI_SUR_HIGH_END, UNI_SUR_HIGH_START, UNI_SUR_LOW_END, and UNI_SUR_LOW_START.
Referenced by antlr3UTF16SetupStream().
static void antlr3UTF16ConsumeBE | ( | pANTLR3_INT_STREAM | is | ) | [static] |
Consume the next character in a UTF16 input stream when the input is Big Endian and the machine is not.
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, ANTLR3_INT_STREAM_struct::super, UNI_SUR_HIGH_END, UNI_SUR_HIGH_START, UNI_SUR_LOW_END, and UNI_SUR_LOW_START.
Referenced by antlr3UTF16SetupStream().
static void antlr3UTF16ConsumeLE | ( | pANTLR3_INT_STREAM | is | ) | [static] |
Consume the next character in a UTF16 input stream when the input is Little Endian and the machine is not Note that the UTF16 routines do not do any substantial verification of the input stream as for performance sake, we assume it is validly encoded.
So if a low surrogate is found at the curent input position then we just consume it. Surrogate pairs should be seen as Hi, Lo. So if we have a Lo first, then the input stream is fubar but we just ignore that.
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, ANTLR3_INT_STREAM_struct::super, UNI_SUR_HIGH_END, UNI_SUR_HIGH_START, UNI_SUR_LOW_END, and UNI_SUR_LOW_START.
Referenced by antlr3UTF16SetupStream().
static ANTLR3_MARKER antlr3UTF16Index | ( | pANTLR3_INT_STREAM | is | ) | [static] |
Calculate the current index in the output stream.
[in] | input | Input stream context pointer |
References ANTLR3_INPUT_STREAM_struct::nextChar, and ANTLR3_INT_STREAM_struct::super.
Referenced by antlr3UTF16SetupStream().
static ANTLR3_UCHAR antlr3UTF16LA | ( | pANTLR3_INT_STREAM | is, | |
ANTLR3_INT32 | la | |||
) | [static] |
Return the input element assuming an 8 bit ascii input.
[in] | input | Input stream context pointer |
[in] | la | 1 based offset of next input stream element |
References ANTLR3_CHARSTREAM_EOF, ANTLR3_INPUT_STREAM_struct::data, halfBase, halfShift, ANTLR3_INPUT_STREAM_struct::nextChar, ANTLR3_INPUT_STREAM_struct::sizeBuf, ANTLR3_INT_STREAM_struct::super, UNI_SUR_HIGH_END, UNI_SUR_HIGH_START, UNI_SUR_LOW_END, and UNI_SUR_LOW_START.
Referenced by antlr3UTF16SetupStream().
static ANTLR3_UCHAR antlr3UTF16LABE | ( | pANTLR3_INT_STREAM | is, | |
ANTLR3_INT32 | la | |||
) | [static] |
Return the input element assuming a UTF16 input when the input is Little Endian and the machine is not.
[in] | input | Input stream context pointer |
[in] | la | 1 based offset of next input stream element |
References ANTLR3_CHARSTREAM_EOF, ANTLR3_INPUT_STREAM_struct::data, halfBase, halfShift, ANTLR3_INPUT_STREAM_struct::nextChar, ANTLR3_INPUT_STREAM_struct::sizeBuf, ANTLR3_INT_STREAM_struct::super, UNI_SUR_HIGH_END, UNI_SUR_HIGH_START, UNI_SUR_LOW_END, and UNI_SUR_LOW_START.
Referenced by antlr3UTF16SetupStream().
static ANTLR3_UCHAR antlr3UTF16LALE | ( | pANTLR3_INT_STREAM | is, | |
ANTLR3_INT32 | la | |||
) | [static] |
Return the input element assuming a UTF16 input when the input is Little Endian and the machine is not.
[in] | input | Input stream context pointer |
[in] | la | 1 based offset of next input stream element |
References ANTLR3_CHARSTREAM_EOF, ANTLR3_INPUT_STREAM_struct::data, halfBase, halfShift, ANTLR3_INPUT_STREAM_struct::nextChar, ANTLR3_INPUT_STREAM_struct::sizeBuf, ANTLR3_INT_STREAM_struct::super, UNI_SUR_HIGH_END, UNI_SUR_HIGH_START, UNI_SUR_LOW_END, and UNI_SUR_LOW_START.
Referenced by antlr3UTF16SetupStream().
static void antlr3UTF16Seek | ( | pANTLR3_INT_STREAM | is, | |
ANTLR3_MARKER | seekPoint | |||
) | [static] |
Rewind the lexer input to the state specified by the supplied mark.
[in] | input | Input stream context pointer |
References ANTLR3_INT_STREAM_struct::_LA, ANTLR3_CHARSTREAM_EOF, ANTLR3_INT_STREAM_struct::consume, ANTLR3_INPUT_STREAM_struct::nextChar, and ANTLR3_INT_STREAM_struct::super.
Referenced by antlr3UTF16SetupStream().
void antlr3UTF16SetupStream | ( | pANTLR3_INPUT_STREAM | input, | |
ANTLR3_BOOLEAN | machineBigEndian, | |||
ANTLR3_BOOLEAN | inputBigEndian | |||
) |
Common function to setup function interface for a UTF16 or UCS2 input stream.
input | Input stream context pointer |
References ANTLR3_INT_STREAM_struct::_LA, ANTLR3_FALSE, ANTLR3_TRUE, antlr3StringFactoryNew(), antlr3UTF16Consume(), antlr3UTF16ConsumeBE(), antlr3UTF16ConsumeLE(), antlr3UTF16Index(), antlr3UTF16LA(), antlr3UTF16LABE(), antlr3UTF16LALE(), antlr3UTF16Seek(), antlr3UTF16Substr(), ANTLR3_INPUT_STREAM_struct::charByteSize, ANTLR3_INT_STREAM_struct::consume, ANTLR3_INPUT_STREAM_struct::encoding, 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 setupInputStream().
static pANTLR3_STRING antlr3UTF16Substr | ( | pANTLR3_INPUT_STREAM | input, | |
ANTLR3_MARKER | start, | |||
ANTLR3_MARKER | stop | |||
) | [static] |
Return a substring of the UTF16 input stream in newly allocated memory.
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 antlr3UTF16SetupStream().
static void antlr3UTF32Consume | ( | pANTLR3_INT_STREAM | is | ) | [static] |
Consume the next character in a UTF32 input stream.
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 antlr3UTF32SetupStream().
static ANTLR3_MARKER antlr3UTF32Index | ( | pANTLR3_INT_STREAM | is | ) | [static] |
Calculate the current index in the output stream.
[in] | input | Input stream context pointer |
References ANTLR3_INPUT_STREAM_struct::nextChar, and ANTLR3_INT_STREAM_struct::super.
Referenced by antlr3UTF32SetupStream().
static ANTLR3_UCHAR antlr3UTF32LA | ( | pANTLR3_INT_STREAM | is, | |
ANTLR3_INT32 | la | |||
) | [static] |
Return the input element assuming a UTF32 input in natural machine byte order.
[in] | input | Input stream context pointer |
[in] | la | 1 based offset of next input stream element |
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 antlr3UTF32SetupStream().
static ANTLR3_UCHAR antlr3UTF32LABE | ( | pANTLR3_INT_STREAM | is, | |
ANTLR3_INT32 | la | |||
) | [static] |
Return the input element assuming a UTF32 input in big endian byte order.
[in] | input | Input stream context pointer |
[in] | la | 1 based offset of next input stream element |
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 antlr3UTF32SetupStream().
static ANTLR3_UCHAR antlr3UTF32LALE | ( | pANTLR3_INT_STREAM | is, | |
ANTLR3_INT32 | la | |||
) | [static] |
Return the input element assuming a UTF32 input in little endian byte order.
[in] | input | Input stream context pointer |
[in] | la | 1 based offset of next input stream element |
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 antlr3UTF32SetupStream().
static void antlr3UTF32Seek | ( | pANTLR3_INT_STREAM | is, | |
ANTLR3_MARKER | seekPoint | |||
) | [static] |
Rewind the lexer input to the state specified by the supplied mark.
[in] | input | Input stream context pointer |
References ANTLR3_INT_STREAM_struct::_LA, ANTLR3_CHARSTREAM_EOF, ANTLR3_INT_STREAM_struct::consume, ANTLR3_INPUT_STREAM_struct::nextChar, and ANTLR3_INT_STREAM_struct::super.
Referenced by antlr3UTF32SetupStream().
void antlr3UTF32SetupStream | ( | pANTLR3_INPUT_STREAM | input, | |
ANTLR3_BOOLEAN | machineBigEndian, | |||
ANTLR3_BOOLEAN | inputBigEndian | |||
) |
Common function to setup function interface for a UTF3 input stream.
input | Input stream context pointer |
References ANTLR3_INT_STREAM_struct::_LA, ANTLR3_FALSE, ANTLR3_TRUE, antlr3StringFactoryNew(), antlr3UTF32Consume(), antlr3UTF32Index(), antlr3UTF32LA(), antlr3UTF32LABE(), antlr3UTF32LALE(), antlr3UTF32Seek(), antlr3UTF32Substr(), ANTLR3_INPUT_STREAM_struct::charByteSize, ANTLR3_INT_STREAM_struct::consume, ANTLR3_INPUT_STREAM_struct::encoding, 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 setupInputStream().
static pANTLR3_STRING antlr3UTF32Substr | ( | pANTLR3_INPUT_STREAM | input, | |
ANTLR3_MARKER | start, | |||
ANTLR3_MARKER | stop | |||
) | [static] |
Return a substring of the UTF16 input stream in newly allocated memory.
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 antlr3UTF32SetupStream().
static void antlr3UTF8Consume | ( | pANTLR3_INT_STREAM | is | ) | [static] |
Consume the next character in a UTF8 input stream.
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, offsetsFromUTF8, ANTLR3_INPUT_STREAM_struct::sizeBuf, ANTLR3_INT_STREAM_struct::super, and trailingBytesForUTF8.
Referenced by antlr3UTF8SetupStream().
static ANTLR3_UCHAR antlr3UTF8LA | ( | pANTLR3_INT_STREAM | is, | |
ANTLR3_INT32 | la | |||
) | [static] |
Return the input element assuming a UTF8 input.
[in] | input | Input stream context pointer |
[in] | la | 1 based offset of next input stream element |
References ANTLR3_CHARSTREAM_EOF, ANTLR3_INPUT_STREAM_struct::data, ANTLR3_INPUT_STREAM_struct::nextChar, offsetsFromUTF8, ANTLR3_INPUT_STREAM_struct::sizeBuf, ANTLR3_INT_STREAM_struct::super, and trailingBytesForUTF8.
Referenced by antlr3UTF8SetupStream().
void antlr3UTF8SetupStream | ( | pANTLR3_INPUT_STREAM | input | ) |
Common function to setup function interface for a UTF8 input stream.
input | Input stream context pointer |
References ANTLR3_INT_STREAM_struct::_LA, antlr3StringFactoryNew(), antlr3UTF8Consume(), antlr3UTF8LA(), ANTLR3_INPUT_STREAM_struct::charByteSize, ANTLR3_INT_STREAM_struct::consume, ANTLR3_INPUT_STREAM_struct::encoding, ANTLR3_INPUT_STREAM_struct::istream, and ANTLR3_INPUT_STREAM_struct::strFactory.
Referenced by setupInputStream().
const ANTLR3_UCHAR e2a[256] |
Referenced by antlr3EBCDICLA().
const UTF32 offsetsFromUTF8[6] [static] |
Initial value:
{ 0x00000000UL, 0x00003080UL, 0x000E2080UL, 0x03C82080UL, 0xFA082080UL, 0x82082080UL }
This table contains as many values as there might be trailing bytes in a UTF-8 sequence.
const ANTLR3_UINT32 trailingBytesForUTF8[256] [static] |
Initial value:
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 }
Note that *legal* UTF-8 values can't have 4 or 5-bytes. The table is left as-is for anyone who may want to do such conversion, which was allowed in earlier algorithms.