antlr3stringstream.c

Langue: en

Version: 383140 (fedora - 01/12/10)

Section: 3 (Bibliothèques de fonctions)

NAME

src/antlr3stringstream.c -

Provides implementations of string (or memory) streams as input for ANLTR3 lexers.

SYNOPSIS


#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.

Detailed Description

Provides implementations of string (or memory) streams as input for ANLTR3 lexers.

Function Documentation

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

Parameters:

inString Pointer to the string to be copied as the input stream
size Size (in 8 bit ASCII characters) of the input string
name NAme to attach the input stream (can be NULL pointer)

Returns:

*
Pointer to new input stream context upon success
*
One of the ANTLR3_ERR_ defines on error.

Remarks:

*
ANTLR does not alter the input string in any way.
*
String is slightly incorrect in that the passed in pointer can be to any memory in C version of ANTLR3 of course.

References ANTLR3_CHARSTREAM, ANTLR3_MALLOC, ANTLR3_MEMMOVE, 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, 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.

Parameters:

inString Pointer to the string to be used as the input stream
size Size (in 8 bit ASCII characters) of the input string
name NAme to attach the input stream (can be NULL pointer)

Returns:

*
Pointer to new input stream context upon success
*
One of the ANTLR3_ERR_ defines on error.

Remarks:

*
ANTLR does not alter the input string in any way.
*
String is slightly incorrect in that the passed in pointer can be to any memory in C version of ANTLR3 of course.

References ANTLR3_CHARSTREAM, 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, 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.

Parameters:

inString Pointer to the string to be used as the input stream
size Size (in 16 bit ASCII characters) of the input string
name Name to attach the input stream (can be NULL pointer)

Returns:

*
Pointer to new input stream context upon success
*
One of the ANTLR3_ERR_ defines on error.

Remarks:

*
ANTLR does not alter the input string in any way.
*
String is slightly incorrect in that the passed in pointer can be to any memory in C version of ANTLR3 of course.

References ANTLR3_CHARSTREAM, 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, ANTLR3_INPUT_STREAM_struct::sizeBuf, ANTLR3_INT_STREAM_struct::streamName, and ANTLR3_INPUT_STREAM_struct::strFactory.

Author

Generated automatically by Doxygen for ANTLR3C from the source code.