antlr3-addi (3) - Linux Manuals
NAME
ANTLR3_STRING_struct -
Base string class tracks the allocations and provides simple string tracking functions.
SYNOPSIS
#include <antlr3string.h>
Data Fields
pANTLR3_UINT8(* addc )(struct ANTLR3_STRING_struct *string, ANTLR3_UINT32 c)
Pointer to function that adds a single character to the end of the string, in the encoding of the string - 8 bit, 16 bit, utf-8 etc.
pANTLR3_UINT8(* addi )(struct ANTLR3_STRING_struct *string, ANTLR3_INT32 i)
Pointer to function that adds the stringified representation of an integer to the string.
pANTLR3_UINT8(* append )(struct ANTLR3_STRING_struct *string, const char *newbit)
Pointer to function adds a raw char * type pointer in the default encoding for this string.
pANTLR3_UINT8(* append8 )(struct ANTLR3_STRING_struct *string, const char *newbit)
Pointer to function adds a raw char * type pointer in the default encoding for this string.
pANTLR3_UINT8(* appendS )(struct ANTLR3_STRING_struct *string, struct ANTLR3_STRING_struct *newbit)
Pointer to function appends a copy of the characters contained in another string.
ANTLR3_UCHAR(* charAt )(struct ANTLR3_STRING_struct *string, ANTLR3_UINT32 offset)
Pointer to a function that returns the character indexed at the supplied offset as a 32 bit character.
pANTLR3_UINT8 chars
Pointer to the current string value (starts at NULL unless the string allocator is told to create it with a pre known size.
ANTLR3_UINT32(* compare )(struct ANTLR3_STRING_struct *string, const char *compStr)
Pointer to a function that compares the text of a string with the supplied character string (which is assumed to be in the same encoding as the string itself) and returns a result a la strcmp().
ANTLR3_UINT32(* compare8 )(struct ANTLR3_STRING_struct *string, const char *compStr)
Pointer to function that compares the text of a string to the supplied 8 bit character string and returns a result a la strcmp().
ANTLR3_UINT32(* compareS )(struct ANTLR3_STRING_struct *string, struct ANTLR3_STRING_struct *compStr)
Pointer to a function that compares the text of a string with the supplied string (which is assumed to be in the same encoding as the string itself) and returns a result a la strcmp().
ANTLR3_UINT8 encoding
Occasionally it is useful to know what the encoding of the string actually is, hence it is stored here as one the ANTLR3_ENCODING_ values.
pANTLR3_STRING_FACTORY factory
The factory that created this string.
ANTLR3_UINT32 index
Index of string (allocation number) in case someone wants to explicitly release it.
pANTLR3_UINT8(* insert )(struct ANTLR3_STRING_struct *string, ANTLR3_UINT32 point, const char *newbit)
Pointer to function that inserts the supplied string at the specified offset in the current string in the default encoding for this string.
pANTLR3_UINT8(* insert8 )(struct ANTLR3_STRING_struct *string, ANTLR3_UINT32 point, const char *newbit)
Pointer to function that inserts the supplied string at the specified offset in the current string in the default encoding for this string.
pANTLR3_UINT8(* inserti )(struct ANTLR3_STRING_struct *string, ANTLR3_UINT32 point, ANTLR3_INT32 i)
Pointer to function that inserts the supplied integer in string form at the specified offset in the current string.
pANTLR3_UINT8(* insertS )(struct ANTLR3_STRING_struct *string, ANTLR3_UINT32 point, struct ANTLR3_STRING_struct *newbit)
Pointer to function that inserts a copy of the characters in the supplied string at the specified offset in the current string.
ANTLR3_UINT32 len
Current length of the string up to and not including, the trailing '' Note that the actual allocation (->size) is always at least one byte more than this to accommodate trailing ''.
pANTLR3_UINT8(* set )(struct ANTLR3_STRING_struct *string, const char *chars)
Pointer to function that sets the string value to a specific string in the default encoding for this string.
pANTLR3_UINT8(* set8 )(struct ANTLR3_STRING_struct *string, const char *chars)
Pointer to function that sets the string value to a specific 8 bit string in the default encoding for this string.
pANTLR3_UINT8(* setS )(struct ANTLR3_STRING_struct *string, struct ANTLR3_STRING_struct *chars)
Pointer to function that sets the string value to a copy of the supplied string (strings must be in the same encoding.
ANTLR3_UINT32 size
Current size of the string in bytes including the trailing ''.
struct ANTLR3_STRING_struct *(* subString )(struct ANTLR3_STRING_struct *string, ANTLR3_UINT32 startIndex, ANTLR3_UINT32 endIndex)
Pointer to a function that returns a substring of the supplied string a la .subString(s,e) in the Java language.
struct ANTLR3_STRING_struct *(* to8 )(struct ANTLR3_STRING_struct *string)
Pointer to a function that yields an 8 bit string regardless of the encoding of the supplied string.
ANTLR3_INT32(* toInt32 )(struct ANTLR3_STRING_struct *string)
Pointer to a function that returns the integer representation of any numeric characters at the beginning of the string.
struct ANTLR3_STRING_struct *(* toUTF8 )(struct ANTLR3_STRING_struct *string)
Pointer to a function that yields a UT8 encoded string of the current string, regardless of the current encoding of the string.
Detailed Description
Base string class tracks the allocations and provides simple string tracking functions.
Mostly you can work directly on the string for things that don't reallocate it, like strchr() etc. Perhaps someone will want to provide implementations for UTF8 and so on.
Field Documentation
pANTLR3_UINT8(* ANTLR3_STRING_struct::addc)(struct ANTLR3_STRING_struct *string, ANTLR3_UINT32 c)
Pointer to function that adds a single character to the end of the string, in the encoding of the string - 8 bit, 16 bit, utf-8 etc. Input is a single UTF32 (32 bits wide integer) character.
Referenced by consumeHiddenToken(), consumeToken(), defineDotEdges(), defineDotNodes(), makeDot(), serializeNode(), serializeText(), serializeToken(), and toString().
pANTLR3_UINT8(* ANTLR3_STRING_struct::addi)(struct ANTLR3_STRING_struct *string, ANTLR3_INT32 i)
Pointer to function that adds the stringified representation of an integer to the string.
Referenced by serializeNode(), serializeToken(), and toString().
pANTLR3_UINT8(* ANTLR3_STRING_struct::append)(struct ANTLR3_STRING_struct *string, const char *newbit)
Pointer to function adds a raw char * type pointer in the default encoding for this string. For instance, if this is ASCII 8 bit, then this function is the same as append8 but if the encoding is 16 bit, then the pointer is assumed to point to 16 bit characters not 8 bit.
Referenced by serializeText().
pANTLR3_UINT8(* ANTLR3_STRING_struct::append8)(struct ANTLR3_STRING_struct *string, const char *newbit)
Pointer to function adds a raw char * type pointer in the default encoding for this string. For instance, if this is a 16 bit string, then this function assumes the pointer points to 8 bit characters that must be converted on the fly.
Referenced by defineDotEdges(), defineDotNodes(), getMissingSymbol(), makeDot(), toString(), and toStringTree().
pANTLR3_UINT8(* ANTLR3_STRING_struct::appendS)(struct ANTLR3_STRING_struct *string, struct ANTLR3_STRING_struct *newbit)
Pointer to function appends a copy of the characters contained in another string. Strings must be in the same encoding.
ANTLR3_UCHAR(* ANTLR3_STRING_struct::charAt)(struct ANTLR3_STRING_struct *string, ANTLR3_UINT32 offset)
Pointer to a function that returns the character indexed at the supplied offset as a 32 bit character.
Referenced by defineDotEdges(), defineDotNodes(), makeDot(), and serializeText().
pANTLR3_UINT8 ANTLR3_STRING_struct::chars
Pointer to the current string value (starts at NULL unless the string allocator is told to create it with a pre known size.
Referenced by addc16(), append16_16(), append16_8(), append8(), appendS(), charAt16(), compare16_16(), compare16_8(), compare8(), compareS(), consumeHiddenToken(), consumeToken(), createTokenFromToken(), displayRecognitionError(), handshake(), insert16_16(), insert16_8(), insert8(), insertS(), newPtr16_16(), newPtr16_8(), newPtr8(), newSize16(), newSize8(), printable16(), printable8(), replaceChildren(), set16_16(), set16_8(), set8(), setS(), stringFree(), subString16(), subString8(), to8_16(), toInt32_16(), toInt32_8(), toUTF8_16(), and toUTF8_8().
ANTLR3_UINT32(* ANTLR3_STRING_struct::compare)(struct ANTLR3_STRING_struct *string, const char *compStr)
Pointer to a function that compares the text of a string with the supplied character string (which is assumed to be in the same encoding as the string itself) and returns a result a la strcmp().
ANTLR3_UINT32(* ANTLR3_STRING_struct::compare8)(struct ANTLR3_STRING_struct *string, const char *compStr)
Pointer to function that compares the text of a string to the supplied 8 bit character string and returns a result a la strcmp().
ANTLR3_UINT32(* ANTLR3_STRING_struct::compareS)(struct ANTLR3_STRING_struct *string, struct ANTLR3_STRING_struct *compStr)
Pointer to a function that compares the text of a string with the supplied string (which is assumed to be in the same encoding as the string itself) and returns a result a la strcmp().
Referenced by stringInit16(), and stringInit8().
ANTLR3_UINT8 ANTLR3_STRING_struct::encoding
Occasionally it is useful to know what the encoding of the string actually is, hence it is stored here as one the ANTLR3_ENCODING_ values.
pANTLR3_STRING_FACTORY ANTLR3_STRING_struct::factory
The factory that created this string.
Referenced by serializeNode(), serializeToken(), subString16(), subString8(), to8_16(), toString(), toUTF8_16(), and toUTF8_8().
ANTLR3_UINT32 ANTLR3_STRING_struct::index
Index of string (allocation number) in case someone wants to explicitly release it.
pANTLR3_UINT8(* ANTLR3_STRING_struct::insert)(struct ANTLR3_STRING_struct *string, ANTLR3_UINT32 point, const char *newbit)
Pointer to function that inserts the supplied string at the specified offset in the current string in the default encoding for this string. For instance, if this is an 8 bit string, then this is the same as insert8, but if this is a 16 bit string, then the poitner must point to 16 bit characters.
pANTLR3_UINT8(* ANTLR3_STRING_struct::insert8)(struct ANTLR3_STRING_struct *string, ANTLR3_UINT32 point, const char *newbit)
Pointer to function that inserts the supplied string at the specified offset in the current string in the default encoding for this string. For instance, if this is a 16 bit string then the pointer is assumed to point at 8 bit characteres that must be converted on the fly.
Referenced by consumeHiddenToken(), and consumeToken().
pANTLR3_UINT8(* ANTLR3_STRING_struct::inserti)(struct ANTLR3_STRING_struct *string, ANTLR3_UINT32 point, ANTLR3_INT32 i)
Pointer to function that inserts the supplied integer in string form at the specified offset in the current string.
pANTLR3_UINT8(* ANTLR3_STRING_struct::insertS)(struct ANTLR3_STRING_struct *string, ANTLR3_UINT32 point, struct ANTLR3_STRING_struct *newbit)
Pointer to function that inserts a copy of the characters in the supplied string at the specified offset in the current string. strings must be in the same encoding.
ANTLR3_UINT32 ANTLR3_STRING_struct::len
Current length of the string up to and not including, the trailing '' Note that the actual allocation (->size) is always at least one byte more than this to accommodate trailing ''.
Referenced by addc16(), addc8(), append16_16(), append16_8(), append8(), appendS(), charAt16(), charAt8(), createTokenFromToken(), defineDotEdges(), defineDotNodes(), insert16_16(), insert16_8(), insert8(), makeDot(), printable16(), printable8(), serializeText(), subString16(), subString8(), to8_16(), toUTF8_16(), and toUTF8_8().
pANTLR3_UINT8(* ANTLR3_STRING_struct::set)(struct ANTLR3_STRING_struct *string, const char *chars)
Pointer to function that sets the string value to a specific string in the default encoding for this string. For instance, if this is ASCII 8 bit, then this function is the same as set8 but if the encoding is 16 bit, then the pointer is assumed to point to 16 bit characters not 8 bit.
Referenced by serializeNode(), and serializeToken().
pANTLR3_UINT8(* ANTLR3_STRING_struct::set8)(struct ANTLR3_STRING_struct *string, const char *chars)
Pointer to function that sets the string value to a specific 8 bit string in the default encoding for this string. For instance, if this is a 16 bit string, then this function is the same as set8 but if the encoding is 16 bit, then the pointer is assumed to point to 8 bit characters that must be converted to 16 bit characters on the fly.
pANTLR3_UINT8(* ANTLR3_STRING_struct::setS)(struct ANTLR3_STRING_struct *string, struct ANTLR3_STRING_struct *chars)
Pointer to function that sets the string value to a copy of the supplied string (strings must be in the same encoding.
ANTLR3_UINT32 ANTLR3_STRING_struct::size
Current size of the string in bytes including the trailing ''.
Referenced by addc16(), addc8(), append16_16(), append16_8(), append8(), appendS(), insert16_16(), insert16_8(), insert8(), set16_16(), set16_8(), set8(), to8_16(), and toUTF8_16().
struct ANTLR3_STRING_struct*(* ANTLR3_STRING_struct::subString)(struct ANTLR3_STRING_struct *string, ANTLR3_UINT32 startIndex, ANTLR3_UINT32 endIndex) [read]
Pointer to a function that returns a substring of the supplied string a la .subString(s,e) in the Java language.
struct ANTLR3_STRING_struct*(* ANTLR3_STRING_struct::to8)(struct ANTLR3_STRING_struct *string) [read]
Pointer to a function that yields an 8 bit string regardless of the encoding of the supplied string. This is useful when you want to use the text of a token in some way that requires an 8 bit value, such as the key for a hashtable. The function is required to produce a usable string even if the text given as input has characters that do not fit in 8 bit space, it will replace them with some arbitrary character such as '?'
Referenced by displayRecognitionError().
ANTLR3_INT32(* ANTLR3_STRING_struct::toInt32)(struct ANTLR3_STRING_struct *string)
Pointer to a function that returns the integer representation of any numeric characters at the beginning of the string.
Referenced by stringInit16(), and stringInit8().
struct ANTLR3_STRING_struct*(* ANTLR3_STRING_struct::toUTF8)(struct ANTLR3_STRING_struct *string) [read]
Pointer to a function that yields a UT8 encoded string of the current string, regardless of the current encoding of the string. Because there is currently no UTF8 handling in the string class, it creates therefore, a string that is useful only for read only applications as it will not contain methods that deal with UTF8 at the moment.
Referenced by serializeNode(), serializeToken(), stringInit16(), and stringInit8().
Author
Generated automatically by Doxygen for ANTLR3C from the source code.