Home | History | Annotate | Download | only in src

Lines Matching defs:string

2  * Implementation of the ANTLR3 string and string factory classes
42 static pANTLR3_STRING newPtr8 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 string, ANTLR3_UINT32 size);
43 static pANTLR3_STRING newPtrUTF16_8 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 string, ANTLR3_UINT32 size);
44 static pANTLR3_STRING newPtrUTF16_UTF16 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 string, ANTLR3_UINT32 size);
45 static pANTLR3_STRING newStr8 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 string);
46 static pANTLR3_STRING newStrUTF16_8 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 string);
47 static pANTLR3_STRING newStrUTF16_UTF16 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 string);
48 static void destroy (pANTLR3_STRING_FACTORY factory, pANTLR3_STRING string);
49 static pANTLR3_STRING printable8 (pANTLR3_STRING_FACTORY factory, pANTLR3_STRING string);
50 static pANTLR3_STRING printableUTF16 (pANTLR3_STRING_FACTORY factory, pANTLR3_STRING string);
53 /* String API
55 static pANTLR3_UINT8 set8 (pANTLR3_STRING string, const char * chars);
56 static pANTLR3_UINT8 setUTF16_8 (pANTLR3_STRING string, const char * chars);
57 static pANTLR3_UINT8 setUTF16_UTF16 (pANTLR3_STRING string, const char * chars);
58 static pANTLR3_UINT8 append8 (pANTLR3_STRING string, const char * newbit);
59 static pANTLR3_UINT8 appendUTF16_8 (pANTLR3_STRING string, const char * newbit);
60 static pANTLR3_UINT8 appendUTF16_UTF16 (pANTLR3_STRING string, const char * newbit);
61 static pANTLR3_UINT8 insert8 (pANTLR3_STRING string, ANTLR3_UINT32 point, const char * newbit);
62 static pANTLR3_UINT8 insertUTF16_8 (pANTLR3_STRING string, ANTLR3_UINT32 point, const char * newbit);
63 static pANTLR3_UINT8 insertUTF16_UTF16 (pANTLR3_STRING string, ANTLR3_UINT32 point, const char * newbit);
65 static pANTLR3_UINT8 setS (pANTLR3_STRING string, pANTLR3_STRING chars);
66 static pANTLR3_UINT8 appendS (pANTLR3_STRING string, pANTLR3_STRING newbit);
67 static pANTLR3_UINT8 insertS (pANTLR3_STRING string, ANTLR3_UINT32 point, pANTLR3_STRING newbit);
69 static pANTLR3_UINT8 addc8 (pANTLR3_STRING string, ANTLR3_UINT32 c);
70 static pANTLR3_UINT8 addcUTF16 (pANTLR3_STRING string, ANTLR3_UINT32 c);
71 static pANTLR3_UINT8 addi8 (pANTLR3_STRING string, ANTLR3_INT32 i);
72 static pANTLR3_UINT8 addiUTF16 (pANTLR3_STRING string, ANTLR3_INT32 i);
73 static pANTLR3_UINT8 inserti8 (pANTLR3_STRING string, ANTLR3_UINT32 point, ANTLR3_INT32 i);
74 static pANTLR3_UINT8 insertiUTF16 (pANTLR3_STRING string, ANTLR3_UINT32 point, ANTLR3_INT32 i);
76 static ANTLR3_UINT32 compare8 (pANTLR3_STRING string, const char * compStr);
77 static ANTLR3_UINT32 compareUTF16_8 (pANTLR3_STRING string, const char * compStr);
78 static ANTLR3_UINT32 compareUTF16_UTF16(pANTLR3_STRING string, const char * compStr);
79 static ANTLR3_UINT32 compareS (pANTLR3_STRING string, pANTLR3_STRING compStr);
80 static ANTLR3_UCHAR charAt8 (pANTLR3_STRING string, ANTLR3_UINT32 offset);
81 static ANTLR3_UCHAR charAtUTF16 (pANTLR3_STRING string, ANTLR3_UINT32 offset);
82 static pANTLR3_STRING subString8 (pANTLR3_STRING string, ANTLR3_UINT32 startIndex, ANTLR3_UINT32 endIndex);
83 static pANTLR3_STRING subStringUTF16 (pANTLR3_STRING string, ANTLR3_UINT32 startIndex, ANTLR3_UINT32 endIndex);
84 static ANTLR3_INT32 toInt32_8 (pANTLR3_STRING string);
85 static ANTLR3_INT32 toInt32_UTF16 (pANTLR3_STRING string);
86 static pANTLR3_STRING to8_8 (pANTLR3_STRING string);
87 static pANTLR3_STRING to8_UTF16 (pANTLR3_STRING string);
88 static pANTLR3_STRING toUTF8_8 (pANTLR3_STRING string);
89 static pANTLR3_STRING toUTF8_UTF16 (pANTLR3_STRING string);
93 static void stringInit8 (pANTLR3_STRING string);
94 static void stringInitUTF16 (pANTLR3_STRING string);
95 static void ANTLR3_CDECL stringFree (pANTLR3_STRING string);
125 // UTF16 and 8Bit if I am going to support those encodings in the STRING stuff.
126 // The STRING stuff was intended as a quick and dirty hack for people that did not
130 // directly, so I am not implementing the string stuff for the newer encodings.
188 pANTLR3_STRING string;
190 string = (pANTLR3_STRING) ANTLR3_MALLOC(sizeof(ANTLR3_STRING));
192 if (string == NULL)
199 stringInit8(string);
200 string->factory = factory;
202 /* Add the string into the allocated list
204 factory->strings->set(factory->strings, factory->index, (void *) string, (void (ANTLR3_CDECL *)(void *))(stringFree), ANTLR3_TRUE);
205 string->index = factory->index++;
207 return string;
217 pANTLR3_STRING string;
219 string = (pANTLR3_STRING) ANTLR3_MALLOC(sizeof(ANTLR3_STRING));
221 if (string == NULL)
228 stringInitUTF16(string);
229 string->factory = factory;
231 /* Add the string into the allocated list
233 factory->strings->set(factory->strings, factory->index, (void *) string, (void (ANTLR3_CDECL *)(void *))(stringFree), ANTLR3_TRUE);
234 string->index = factory->index++;
236 return string;
239 void ANTLR3_CDECL stringFree (pANTLR3_STRING string)
241 /* First free the string itself if there was anything in it
243 if (string->chars)
245 ANTLR3_FREE(string->chars);
248 /* Now free the space for this string
250 ANTLR3_FREE(string);
256 * \param string
260 stringInit8 (pANTLR3_STRING string)
262 string->len = 0;
263 string->size = 0;
264 string->chars = NULL;
265 string->encoding = ANTLR3_ENC_8BIT ;
269 string->set = set8;
270 string->set8 = set8;
271 string->append = append8;
272 string->append8 = append8;
273 string->insert = insert8;
274 string->insert8 = insert8;
275 string->addi = addi8;
276 string->inserti = inserti8;
277 string->addc = addc8;
278 string->charAt = charAt8;
279 string->compare = compare8;
280 string->compare8 = compare8;
281 string->subString = subString8;
282 string->toInt32 = toInt32_8;
283 string->to8 = to8_8;
284 string->toUTF8 = toUTF8_8;
285 string->compareS = compareS;
286 string->setS = setS;
287 string->appendS = appendS;
288 string->insertS = insertS;
293 * \param string
297 stringInitUTF16 (pANTLR3_STRING string)
299 string->len = 0;
300 string->size = 0;
301 string->chars = NULL;
302 string->encoding = ANTLR3_ENC_8BIT;
306 string->set = setUTF16_UTF16;
307 string->set8 = setUTF16_8;
308 string->append = appendUTF16_UTF16;
309 string->append8 = appendUTF16_8;
310 string->insert = insertUTF16_UTF16;
311 string->insert8 = insertUTF16_8;
312 string->addi = addiUTF16;
313 string->inserti = insertiUTF16;
314 string->addc = addcUTF16;
315 string->charAt = charAtUTF16;
316 string->compare = compareUTF16_UTF16;
317 string->compare8 = compareUTF16_8;
318 string->subString = subStringUTF16;
319 string->toInt32 = toInt32_UTF16;
320 string->to8 = to8_UTF16;
321 string->toUTF8 = toUTF8_UTF16;
323 string->compareS = compareS;
324 string->setS = setS;
325 string->appendS = appendS;
326 string->insertS = insertS;
330 * \param string
335 stringInitUTF8 (pANTLR3_STRING string)
337 string->len = 0;
338 string->size = 0;
339 string->chars = NULL;
345 // Convert an 8 bit string into a UTF8 representation, which is in fact just the string itself
349 toUTF8_8 (pANTLR3_STRING string)
351 return string->factory->newPtr(string->factory, (pANTLR3_UINT8)(string->chars), string->len);
354 // Convert a UTF16 string into a UTF8 representation using the Unicode.org
360 toUTF8_UTF16 (pANTLR3_STRING string)
372 utf8String = string->factory->newStr8(string->factory, (pANTLR3_UINT8)"");
382 utf8String->size = string->len *3;
387 inputEnd = (UTF16 *) (string->chars);
395 ((const UTF16 *)(string->chars)) + string->len,
414 * Creates a new string with enough capacity for size 8 bit characters plus a terminator.
416 * \param[in] factory - Pointer to the string factory that owns strings
418 * \return pointer to the new string.
423 pANTLR3_STRING string;
425 string = factory->newRaw(factory);
427 if (string == NULL)
429 return string;
434 string->chars = (pANTLR3_UINT8) ANTLR3_MALLOC((size_t)(sizeof(ANTLR3_UINT8) * (size+1)));
435 *(string->chars) = '\0';
436 string->size = size + 1;
439 return string;
442 * Creates a new string with enough capacity for size UTF16 characters plus a terminator.
444 * \param[in] factory - Pointer to the string factory that owns strings
446 * \return pointer to the new string.
451 pANTLR3_STRING string;
453 string = factory->newRaw(factory);
455 if (string == NULL)
457 return string;
462 string->chars = (pANTLR3_UINT8) ANTLR3_MALLOC((size_t)(sizeof(ANTLR3_UINT16) * (size+1)));
463 *(string->chars) = '\0';
464 string->size = size+1; /* Size is always in characters, as is len */
466 return string;
469 /** Creates a new 8 bit string initialized with the 8 bit characters at the
471 * \param[in] factory - Pointer to the string factory that owns the strings
473 * \return pointer to the new string
478 pANTLR3_STRING string;
480 string = factory->newSize(factory, size);
482 if (string == NULL)
489 return string;
494 ANTLR3_MEMMOVE(string->chars, (const void *)ptr, size);
495 *(string->chars + size) = '\0'; /* Terminate, these strings are usually used for Token streams and printing etc. */
496 string->len = size;
499 string;
502 /** Creates a new UTF16 string initialized with the 8 bit characters at the
504 * \param[in] factory - Pointer to the string factory that owns the strings
506 * \return pointer to the new string
511 pANTLR3_STRING string;
515 string = factory->newSize(factory, size);
517 if (string == NULL)
524 return string;
532 out = (pANTLR3_UINT16)(string->chars);
542 *(((pANTLR3_UINT16)(string->chars)) + size) = '\0';
544 string->len = size;
547 return string;
550 /** Creates a new UTF16 string initialized with the UTF16 characters at the
552 * \param[in] factory - Pointer to the string factory that owns the strings
554 * \return pointer to the new string
559 pANTLR3_STRING string;
561 string = factory->newSize(factory, size);
563 if (string == NULL)
570 return string;
575 ANTLR3_MEMMOVE(string->chars, (const void *)ptr, (size * sizeof(ANTLR3_UINT16)));
579 *(((pANTLR3_UINT16)(string->chars)) + size) = '\0';
580 string->len = size;
583 return string;
586 /** Create a new 8 bit string from the supplied, null terminated, 8 bit string pointer.
587 * \param[in] factory - Pointer to the string factory that owns strings.
588 * \param[in] ptr - Pointer to the 8 bit encoded string
589 * \return Pointer to the newly initialized string
597 /** Create a new UTF16 string from the supplied, null terminated, 8 bit string pointer.
598 * \param[in] factory - Pointer to the string factory that owns strings.
599 * \param[in] ptr - Pointer to the 8 bit encoded string
600 * \return POinter to the newly initialized string
608 /** Create a new UTF16 string from the supplied, null terminated, UTF16 string pointer.
609 * \param[in] factory - Pointer to the string factory that owns strings.
610 * \param[in] ptr - Pointer to the UTF16 encoded string
611 * \return Pointer to the newly initialized string
619 /** First, determine the length of the input string
632 destroy (pANTLR3_STRING_FACTORY factory, pANTLR3_STRING string)
634 // Record which string we are deleting
636 ANTLR3_UINT32 strIndex = string->index;
638 // Ensure that the string was not factory made, or we would try
641 // Remove the specific indexed string from the vector
645 // One less string in the vector, so decrement the factory index
646 // so that the next string allocated is indexed correctly with
671 // The string has been destroyed and the elements of the factory are reindexed.
679 pANTLR3_STRING string;
688 string = factory->newSize(factory, instr->len *2 + 1);
693 scannedText = string->chars;
718 string->len = (ANTLR3_UINT32)(scannedText - string->chars);
720 return string;
726 pANTLR3_STRING string;
737 string = factory->newSize(factory, instr->len *2 + 1);
742 scannedText = (pANTLR3_UINT16)(string->chars);
773 string->len = outLen;
775 return string;
795 append8 (pANTLR3_STRING string, const char * newbit)
801 if (string->size < (string->len + len + 1))
803 string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)(string->len + len + 1));
804 string->size = string->len + len + 1;
809 ANTLR3_MEMMOVE((void *)(string->chars + string->len), newbit, (ANTLR3_UINT32)(len+1));
810 string->len += len;
812 return string->chars;
816 appendUTF16_8 (pANTLR3_STRING string, const char * newbit)
824 if (string->size < (string->len + len + 1))
826 string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)((sizeof(ANTLR3_UINT16)*(string->len + len + 1))));
827 string->size = string->len + len + 1;
830 apPoint = ((pANTLR3_UINT16)string->chars) + string->len;
831 string->len += len;
839 return string->chars;
843 appendUTF16_UTF16 (pANTLR3_STRING string, const char * newbit)
848 /** First, determine the length of the input string
858 if (string->size < (string->len + len + 1))
860 string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)( sizeof(ANTLR3_UINT16) *(string->len + len + 1) ));
861 string->size = string->len + len + 1;
866 ANTLR3_MEMMOVE((void *)(((pANTLR3_UINT16)string->chars) + string->len), newbit, (ANTLR3_UINT32)(sizeof(ANTLR3_UINT16)*(len+1)));
867 string->len += len;
869 return string->chars;
873 set8 (pANTLR3_STRING string, const char * chars)
878 if (string->size < len + 1)
880 string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)(len + 1));
881 string->size = len + 1;
886 ANTLR3_MEMMOVE((void *)(string->chars), chars, (ANTLR3_UINT32)(len+1));
887 string->len = len;
889 return string->chars;
894 setUTF16_8 (pANTLR3_STRING string, const char * chars)
901 if (string->size < len + 1)
903 string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)(sizeof(ANTLR3_UINT16)*(len + 1)));
904 string->size = len + 1;
906 apPoint = ((pANTLR3_UINT16)string->chars);
907 string->len = len;
909 for (count = 0; count < string->len; count++)
915 return string->chars;
919 setUTF16_UTF16 (pANTLR3_STRING string, const char * chars)
924 /** First, determine the length of the input string
934 if (string->size < len + 1)
936 string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)(sizeof(ANTLR3_UINT16)*(len + 1)));
937 string->size = len + 1;
942 ANTLR3_MEMMOVE((void *)(string->chars), chars, (ANTLR3_UINT32)((len+1) * sizeof(ANTLR3_UINT16)));
943 string->len = len;
945 return string->chars;
950 addc8 (pANTLR3_STRING string, ANTLR3_UINT32 c)
952 if (string->size < string->len + 2)
954 string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)(string->len + 2));
955 string->size = string->len + 2;
957 *(string->chars + string->len) = (ANTLR3_UINT8)c;
958 *(string->chars + string->len + 1) = '\0';
959 string->len++;
961 return string->chars;
965 addcUTF16 (pANTLR3_STRING string, ANTLR3_UINT32 c)
969 if (string->size < string->len + 2)
971 string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)(sizeof(ANTLR3_UINT16) * (string->len + 2)));
972 string->size = string->len + 2;
974 ptr = (pANTLR3_UINT16)(string->chars);
976 *(ptr + string->len) = (ANTLR3_UINT16)c;
977 *(ptr + string->len + 1) = '\0';
978 string->len++;
980 return string->chars;
984 addi8 (pANTLR3_STRING string, ANTLR3_INT32 i)
990 return string->append8(string, (const char *)newbit);
993 addiUTF16 (pANTLR3_STRING string, ANTLR3_INT32 i)
999 return string->append8(string, (const char *)newbit);
1003 inserti8 (pANTLR3_STRING string, ANTLR3_UINT32 point, ANTLR3_INT32 i)
1008 return string->insert8(string, point, (const char *)newbit);
1011 insertiUTF16 (pANTLR3_STRING string, ANTLR3_UINT32 point, ANTLR3_INT32 i)
1016 return string->insert8(string, point, (const char *)newbit);
1020 insert8 (pANTLR3_STRING string, ANTLR3_UINT32 point, const char * newbit)
1024 if (point >= string->len)
1026 return string->append(string, newbit);
1033 return string->chars;
1036 if (string->size < (string->len + len + 1))
1038 string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)(string->len + len + 1));
1039 string->size = string->len + len + 1;
1044 ANTLR3_MEMMOVE((void *)(string->chars + point + len), (void *)(string->chars + point), (ANTLR3_UINT32)(string->len - point + 1));
1048 ANTLR3_MEMMOVE((void *)(string->chars + point), newbit, (ANTLR3_UINT32)(len));
1050 string->len += len;
1052 return string->chars;
1056 insertUTF16_8 (pANTLR3_STRING string, ANTLR3_UINT32 point, const char * newbit)
1062 if (point >= string->len)
1064 return string->append8(string, newbit);
1071 return string->chars;
1074 if (string->size < (string->len + len + 1))
1076 string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)(sizeof(ANTLR3_UINT16)*(string->len + len + 1)));
1077 string->size = string->len + len + 1;
1082 ANTLR3_MEMMOVE((void *)(((pANTLR3_UINT16)string->chars) + point + len), (void *)(((pANTLR3_UINT16)string->chars) + point), (ANTLR3_UINT32)(sizeof(ANTLR3_UINT16)*(string->len - point + 1)));
1084 string->len += len;
1086 inPoint = ((pANTLR3_UINT16)(string->chars))+point;
1092 return string->chars;
1096 insertUTF16_UTF16 (pANTLR3_STRING string, ANTLR3_UINT32 point, const char * newbit)
1101 if (point >= string->len)
1103 return string->append(string, newbit);
1106 /** First, determine the length of the input string
1118 return string->chars;
1121 if (string->size < (string->len + len + 1))
1123 string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)(sizeof(ANTLR3_UINT16)*(string->len + len + 1)));
1124 string->size = string->len + len + 1;
1129 ANTLR3_MEMMOVE((void *)(((pANTLR3_UINT16)string->chars) + point + len), (void *)(((pANTLR3_UINT16)stringstring->len - point + 1)));
1134 ANTLR3_MEMMOVE((void *)(((pANTLR3_UINT16)string->chars) + point), newbit, (ANTLR3_UINT32)(sizeof(ANTLR3_UINT16)*(len)));
1136 string->len += len;
1138 return string->chars;
1141 static pANTLR3_UINT8 setS (pANTLR3_STRING string, pANTLR3_STRING chars)
1143 return string->set(string, (const char *)(chars->chars));
1146 static pANTLR3_UINT8 appendS (pANTLR3_STRING string, pANTLR3_STRING newbit)
1148 /* We may be passed an empty string, in which case we just return the current pointer
1152 return string->chars;
1156 return string->append(string, (const char *)(newbit->chars));
1160 static pANTLR3_UINT8 insertS (pANTLR3_STRING string, ANTLR3_UINT32 point, pANTLR3_STRING newbit)
1162 return string->insert(string, point, (const char *)(newbit->chars));
1165 /* Function that compares the text of a string to the supplied
1166 * 8 bit character string and returns a result a la strcmp()
1169 compare8 (pANTLR3_STRING string, const char * compStr)
1171 return strcmp((const char *)(string->chars), compStr);
1174 /* Function that compares the text of a string with the supplied character string
1175 * (which is assumed to be in the same encoding as the string itself) and returns a result
1179 compareUTF16_8 (pANTLR3_STRING string, const char * compStr)
1184 ourString = (pANTLR3_UINT16)(string->chars);
1203 /* Function that compares the text of a string with the supplied character string
1204 * (which is assumed to be in the same encoding as the string itself) and returns a result
1208 compareUTF16_UTF16 (pANTLR3_STRING string, const char * compStr8)
1214 ourString = (pANTLR3_UINT16)(string->chars);
1233 /* Function that compares the text of a string with the supplied string
1234 * (which is assumed to be in the same encoding as the string itself) and returns a result
1238 compareS (pANTLR3_STRING string, pANTLR3_STRING compStr)
1240 return string->compare(string, (const char *)compStr->chars);
1248 charAt8 (pANTLR3_STRING string, ANTLR3_UINT32 offset)
1250 if (offset > string->len)
1256 return (ANTLR3_UCHAR)(*(string->chars + offset));
1264 charAtUTF16 (pANTLR3_STRING string, ANTLR3_UINT32 offset)
1266 if (offset > string->len)
1272 return (ANTLR3_UCHAR)(*((pANTLR3_UINT16)(string->chars) + offset));
1276 /* Function that returns a substring of the supplied string a la .subString(s,e)
1280 subString8 (pANTLR3_STRING string, ANTLR3_UINT32 startIndex, ANTLR3_UINT32 endIndex)
1284 if (endIndex > string->len)
1286 endIndex = string->len + 1;
1288 newStr = string->factory->newPtr(string->factory, string->chars + startIndex, endIndex - startIndex);
1293 /* Returns a substring of the supplied string a la .subString(s,e)
1297 subStringUTF16 (pANTLR3_STRING string, ANTLR3_UINT32 startIndex, ANTLR3_UINT32 endIndex)
1301 if (endIndex > string->len)
1303 endIndex = string->len + 1;
1305 newStr = string->factory->newPtr(string->factory, (pANTLR3_UINT8)((pANTLR3_UINT16)(string->chars) + startIndex), endIndex - startIndex);
1310 /* Function that can convert the characters in the string to an integer
1313 toInt32_8 (struct ANTLR3_STRING_struct * string)
1315 return atoi((const char *)(string->chars));
1318 /* Function that can convert the characters in the string to an integer
1321 toInt32_UTF16 (struct ANTLR3_STRING_struct * string)
1328 input = (pANTLR3_UINT16)(string->chars);
1351 /* Function that returns a pointer to an 8 bit version of the string,
1352 * which in this case is just the string as this is
1355 static pANTLR3_STRING to8_8 (pANTLR3_STRING string)
1357 return string;
1360 /* Function that returns an 8 bit version of the string,
1365 static pANTLR3_STRING to8_UTF16 (pANTLR3_STRING string)
1370 /* Create a new 8 bit string
1372 newStr = newRaw8(string->factory);
1381 newStr->chars = (pANTLR3_UINT8) ANTLR3_MALLOC((size_t)(string->len + 1));
1382 newStr->size = string->len + 1;
1383 newStr->len = string->len;
1388 for (i=0; i<string->len; i++)
1392 c = *(((pANTLR3_UINT16)(string->chars)) + i);