Provides implementations of string (or memory) streams as input for ANLTR3 lexers. More...
#include <antlr3.h>
Functions | |
pANTLR3_INPUT_STREAM | antlr3NewAsciiStringCopyStream (pANTLR3_UINT8 inString, ANTLR3_UINT32 size, pANTLR3_UINT8 name) |
Create an ASCII string stream as input to ANTLR 3, copying the input string. | |
ANTLR3_API pANTLR3_INPUT_STREAM | antlr3NewAsciiStringInPlaceStream (pANTLR3_UINT8 inString, ANTLR3_UINT32 size, pANTLR3_UINT8 name) |
Create an in-place ASCII string stream as input to ANTLR 3. | |
ANTLR3_API pANTLR3_INPUT_STREAM | antlr3NewUCS2StringInPlaceStream (pANTLR3_UINT16 inString, ANTLR3_UINT32 size, pANTLR3_UINT16 name) |
Create an in-place UCS2 string stream as input to ANTLR 3. |
Provides implementations of string (or memory) streams as input for ANLTR3 lexers.
pANTLR3_INPUT_STREAM antlr3NewAsciiStringCopyStream | ( | pANTLR3_UINT8 | inString, |
ANTLR3_UINT32 | size, | ||
pANTLR3_UINT8 | name | ||
) |
Create an ASCII string stream as input to ANTLR 3, copying the input string.
This string stream first makes a copy of the string at the supplied pointer
[in] | inString | Pointer to the string to be copied as the input stream |
[in] | size | Size (in 8 bit ASCII characters) of the input string |
[in] | name | NAme to attach the input stream (can be NULL pointer) |
References ANTLR3_CHARSTREAM, ANTLR3_MALLOC, ANTLR3_MEMMOVE, ANTLR3_TRUE, antlr3AsciiSetupStream(), 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, size(), ANTLR3_INPUT_STREAM_struct::sizeBuf, ANTLR3_INT_STREAM_struct::streamName, and ANTLR3_INPUT_STREAM_struct::strFactory.
ANTLR3_API pANTLR3_INPUT_STREAM antlr3NewAsciiStringInPlaceStream | ( | pANTLR3_UINT8 | inString, |
ANTLR3_UINT32 | size, | ||
pANTLR3_UINT8 | name | ||
) |
Create an in-place ASCII string stream as input to ANTLR 3.
An in-place string steam is the preferred method of supplying strings to ANTLR as input for lexing and compiling. This is because we make no copies of the input string but read from it right where it is.
[in] | inString | Pointer to the string to be used as the input stream |
[in] | size | Size (in 8 bit ASCII characters) of the input string |
[in] | name | NAme to attach the input stream (can be NULL pointer) |
References ANTLR3_CHARSTREAM, ANTLR3_FALSE, ANTLR3_MALLOC, antlr3AsciiSetupStream(), 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, size(), ANTLR3_INPUT_STREAM_struct::sizeBuf, ANTLR3_INT_STREAM_struct::streamName, and ANTLR3_INPUT_STREAM_struct::strFactory.
ANTLR3_API pANTLR3_INPUT_STREAM antlr3NewUCS2StringInPlaceStream | ( | pANTLR3_UINT16 | inString, |
ANTLR3_UINT32 | size, | ||
pANTLR3_UINT16 | name | ||
) |
Create an in-place UCS2 string stream as input to ANTLR 3.
An in-place string steam is the preferred method of supplying strings to ANTLR as input for lexing and compiling. This is because we make no copies of the input string but read from it right where it is.
[in] | inString | Pointer to the string to be used as the input stream |
[in] | size | Size (in 16 bit ASCII characters) of the input string |
[in] | name | Name to attach the input stream (can be NULL pointer) |
References ANTLR3_CHARSTREAM, ANTLR3_FALSE, ANTLR3_MALLOC, antlr3UCS2SetupStream(), 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, size(), ANTLR3_INPUT_STREAM_struct::sizeBuf, ANTLR3_INT_STREAM_struct::streamName, and ANTLR3_INPUT_STREAM_struct::strFactory.