1 /** \file
2  * Basic type and constant definitions for ANTLR3 Runtime.
3  */
4 #ifndef	_ANTLR3DEFS_H
5 #define	_ANTLR3DEFS_H
6 
7 // [The "BSD licence"]
8 // Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
9 // http://www.temporal-wave.com
10 // http://www.linkedin.com/in/jimidle
11 //
12 // All rights reserved.
13 //
14 // Redistribution and use in source and binary forms, with or without
15 // modification, are permitted provided that the following conditions
16 // are met:
17 // 1. Redistributions of source code must retain the above copyright
18 //    notice, this list of conditions and the following disclaimer.
19 // 2. Redistributions in binary form must reproduce the above copyright
20 //    notice, this list of conditions and the following disclaimer in the
21 //    documentation and/or other materials provided with the distribution.
22 // 3. The name of the author may not be used to endorse or promote products
23 //    derived from this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
26 // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
27 // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28 // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
29 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
30 // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34 // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 
36 /* Following are for generated code, they are not referenced internally!!!
37  */
38 #if !defined(ANTLR3_HUGE) && !defined(ANTLR3_AVERAGE) && !defined(ANTLR3_SMALL)
39 #define	ANTLR3_AVERAGE
40 #endif
41 
42 #ifdef	ANTLR3_HUGE
43 #ifndef	ANTLR3_SIZE_HINT
44 #define	ANTLR3_SIZE_HINT        2049
45 #endif
46 #ifndef	ANTLR3_LIST_SIZE_HINT
47 #define	ANTLR3_LIST_SIZE_HINT   127
48 #endif
49 #endif
50 
51 #ifdef	ANTLR3_AVERAGE
52 #ifndef	ANTLR3_SIZE_HINT
53 #define	ANTLR3_SIZE_HINT        1025
54 #define	ANTLR3_LIST_SIZE_HINT   63
55 #endif
56 #endif
57 
58 #ifdef	ANTLR3_SMALL
59 #ifndef	ANTLR3_SIZE_HINT
60 #define	ANTLR3_SIZE_HINT        211
61 #define	ANTLR3_LIST_SIZE_HINT   31
62 #endif
63 #endif
64 
65 // Definitions that indicate the encoding scheme character streams and strings etc
66 //
67 /// Indicates Big Endian for encodings where this makes sense
68 ///
69 #define ANTLR3_BE           1
70 
71 /// Indicates Little Endian for encoidngs where this makes sense
72 ///
73 #define ANTLR3_LE           2
74 
75 /// General latin-1 or other 8 bit encoding scheme such as straight ASCII
76 ///
77 #define ANTLR3_ENC_8BIT     4
78 
79 /// UTF-8 encoding scheme
80 ///
81 #define ANTLR3_ENC_UTF8     8
82 
83 /// UTF-16 encoding scheme (which also covers UCS2 as that does not have surrogates)
84 ///
85 #define ANTLR3_ENC_UTF16        16
86 #define ANTLR3_ENC_UTF16BE      16 + ANTLR3_BE
87 #define ANTLR3_ENC_UTF16LE      16 + ANTLR3_LE
88 
89 /// UTF-32 encoding scheme (basically straight 32 bit)
90 ///
91 #define ANTLR3_ENC_UTF32        32
92 #define ANTLR3_ENC_UTF32BE      32 + ANTLR3_BE
93 #define ANTLR3_ENC_UTF32LE      32 + ANTLR3_LE
94 
95 /// Input is 8 bit EBCDIC (which we convert to 8 bit ASCII on the fly
96 ///
97 #define ANTLR3_ENC_EBCDIC       64
98 
99 /* Common definitions come first
100  */
101 #include    <antlr3errors.h>
102 
103 /* Work out what operating system/compiler this is. We just do this once
104  * here and use an internal symbol after this.
105  */
106 #ifdef	_WIN64
107 
108 # ifndef	ANTLR3_WINDOWS
109 #   define	ANTLR3_WINDOWS
110 # endif
111 # define	ANTLR3_WIN64
112 # define	ANTLR3_USE_64BIT
113 
114 #else
115 
116 #ifdef	_WIN32
117 # ifndef	ANTLR3_WINDOWS
118 #  define	ANTLR3_WINDOWS
119 # endif
120 
121 #define	ANTLR3_WIN32
122 #endif
123 
124 #endif
125 
126 #ifdef	ANTLR3_WINDOWS
127 
128 #ifndef WIN32_LEAN_AND_MEAN
129 #define	WIN32_LEAN_AND_MEAN
130 #endif
131 
132 /* Allow VC 8 (vs2005) and above to use 'secure' versions of various functions such as sprintf
133  */
134 #ifndef	_CRT_SECURE_NO_DEPRECATE
135 #define	_CRT_SECURE_NO_DEPRECATE
136 #endif
137 
138 #include    <windows.h>
139 #include    <stdlib.h>
140 #include    <winsock.h>
141 #include    <stdio.h>
142 #include    <sys/types.h>
143 #include    <sys/stat.h>
144 #include    <stdarg.h>
145 
146 #define	ANTLR3_API      __declspec(dllexport)
147 #define	ANTLR3_CDECL    __cdecl
148 #define ANTLR3_FASTCALL __fastcall
149 
150 #ifdef __cplusplus
151 extern "C" {
152 #endif
153 
154 #ifndef __MINGW32__
155 // Standard Windows types
156 //
157 typedef	INT32	ANTLR3_CHAR,	*pANTLR3_CHAR;
158 typedef	UINT32	ANTLR3_UCHAR,	*pANTLR3_UCHAR;
159 
160 typedef	INT8	ANTLR3_INT8,	*pANTLR3_INT8;
161 typedef	INT16	ANTLR3_INT16,	*pANTLR3_INT16;
162 typedef	INT32	ANTLR3_INT32,	*pANTLR3_INT32;
163 typedef	INT64	ANTLR3_INT64,	*pANTLR3_INT64;
164 typedef	UINT8	ANTLR3_UINT8,	*pANTLR3_UINT8;
165 typedef	UINT16	ANTLR3_UINT16,	*pANTLR3_UINT16;
166 typedef	UINT32	ANTLR3_UINT32,	*pANTLR3_UINT32;
167 typedef	UINT64	ANTLR3_UINT64,	*pANTLR3_UINT64;
168 typedef UINT64  ANTLR3_BITWORD, *pANTLR3_BITWORD;
169 typedef	UINT8	ANTLR3_BOOLEAN, *pANTLR3_BOOLEAN;
170 
171 #else
172 // Mingw uses stdint.h and fails to define standard Microsoft typedefs
173 // such as UINT16, hence we must use stdint.h for Mingw.
174 //
175 #include <stdint.h>
176 typedef int32_t     ANTLR3_CHAR,    *pANTLR3_CHAR;
177 typedef uint32_t    ANTLR3_UCHAR,   *pANTLR3_UCHAR;
178 
179 typedef int8_t	    ANTLR3_INT8,    *pANTLR3_INT8;
180 typedef int16_t	    ANTLR3_INT16,   *pANTLR3_INT16;
181 typedef int32_t	    ANTLR3_INT32,   *pANTLR3_INT32;
182 typedef int64_t	    ANTLR3_INT64,   *pANTLR3_INT64;
183 
184 typedef uint8_t	    ANTLR3_UINT8,   *pANTLR3_UINT8;
185 typedef uint16_t    ANTLR3_UINT16,  *pANTLR3_UINT16;
186 typedef uint32_t    ANTLR3_UINT32,  *pANTLR3_UINT32;
187 typedef uint64_t    ANTLR3_UINT64,  *pANTLR3_UINT64;
188 typedef uint64_t    ANTLR3_BITWORD, *pANTLR3_BITWORD;
189 
190 typedef	uint8_t	    ANTLR3_BOOLEAN, *pANTLR3_BOOLEAN;
191 
192 #endif
193 
194 
195 
196 #define	ANTLR3_UINT64_LIT(lit)  lit##ULL
197 
198 #define	ANTLR3_INLINE	        __inline
199 
200 typedef FILE *	    ANTLR3_FDSC;
201 typedef	struct stat ANTLR3_FSTAT_STRUCT;
202 
203 #ifdef	ANTLR3_USE_64BIT
204 #define	ANTLR3_FUNC_PTR(ptr)	(void *)((ANTLR3_UINT64)(ptr))
205 #define ANTLR3_UINT64_CAST(ptr) (ANTLR3_UINT64)(ptr))
206 #define	ANTLR3_UINT32_CAST(ptr)	(ANTLR3_UINT32)((ANTLR3_UINT64)(ptr))
207 typedef ANTLR3_INT64		ANTLR3_MARKER;
208 typedef ANTLR3_UINT64		ANTLR3_INTKEY;
209 #else
210 #define	ANTLR3_FUNC_PTR(ptr)	(void *)((ANTLR3_UINT32)(ptr))
211 #define ANTLR3_UINT64_CAST(ptr) (ANTLR3_UINT64)((ANTLR3_UINT32)(ptr))
212 #define	ANTLR3_UINT32_CAST(ptr)	(ANTLR3_UINT32)(ptr)
213 typedef	ANTLR3_INT32		ANTLR3_MARKER;
214 typedef ANTLR3_UINT32		ANTLR3_INTKEY;
215 #endif
216 
217 #ifdef	ANTLR3_WIN32
218 #endif
219 
220 #ifdef	ANTLR3_WIN64
221 #endif
222 
223 
224 typedef	int			ANTLR3_SALENT;								// Type used for size of accept structure
225 typedef struct sockaddr_in	ANTLR3_SOCKADDRT, * pANTLR3_SOCKADDRT;	// Type used for socket address declaration
226 typedef struct sockaddr		ANTLR3_SOCKADDRC, * pANTLR3_SOCKADDRC;	// Type used for cast on accept()
227 
228 #define	ANTLR3_CLOSESOCKET	closesocket
229 
230 #ifdef __cplusplus
231 }
232 #endif
233 
234 /* Warnings that are over-zealous such as complaining about strdup, we
235  * can turn off.
236  */
237 
238 /* Don't complain about "deprecated" functions such as strdup
239  */
240 #pragma warning( disable : 4996 )
241 
242 #else
243 
244 /* Include configure generated header file
245  */
246 #include	<antlr3config.h>
247 
248 #include <stdio.h>
249 
250 #if HAVE_STDINT_H
251 # include <stdint.h>
252 #endif
253 
254 #if HAVE_SYS_TYPES_H
255 # include <sys/types.h>
256 #endif
257 
258 #if HAVE_SYS_STAT_H
259 # include <sys/stat.h>
260 #endif
261 
262 #if STDC_HEADERS
263 # include   <stdlib.h>
264 # include   <stddef.h>
265 # include   <stdarg.h>
266 #else
267 # if HAVE_STDLIB_H
268 #  include  <stdlib.h>
269 # endif
270 # if HAVE_STDARG_H
271 #  include  <stdarg.h>
272 # endif
273 #endif
274 
275 #if HAVE_STRING_H
276 # if !STDC_HEADERS && HAVE_MEMORY_H
277 #  include <memory.h>
278 # endif
279 # include <string.h>
280 #endif
281 
282 #if HAVE_STRINGS_H
283 # include <strings.h>
284 #endif
285 
286 #if HAVE_INTTYPES_H
287 # include <inttypes.h>
288 #endif
289 
290 #if HAVE_UNISTD_H
291 # include <unistd.h>
292 #endif
293 
294 #ifdef HAVE_NETINET_IN_H
295 #include	<netinet/in.h>
296 #endif
297 
298 #ifdef HAVE_SOCKET_H
299 # include	<socket.h>
300 #else
301 # if HAVE_SYS_SOCKET_H
302 #  include	<sys/socket.h>
303 # endif
304 #endif
305 
306 #ifdef HAVE_NETINET_TCP_H
307 #include	<netinet/tcp.h>
308 #endif
309 
310 #ifdef HAVE_ARPA_NAMESER_H
311 #include <arpa/nameser.h> /* DNS HEADER struct */
312 #endif
313 
314 #ifdef HAVE_NETDB_H
315 #include <netdb.h>
316 #endif
317 
318 
319 #ifdef HAVE_SYS_RESOLVE_H
320 #include	<sys/resolv.h>
321 #endif
322 
323 #ifdef HAVE_RESOLVE_H
324 #include	<resolv.h>
325 #endif
326 
327 
328 #ifdef	HAVE_MALLOC_H
329 # include    <malloc.h>
330 #else
331 # ifdef	HAVE_SYS_MALLOC_H
332 #  include    <sys/malloc.h>
333 # endif
334 #endif
335 
336 #ifdef  HAVE_CTYPE_H
337 # include   <ctype.h>
338 #endif
339 
340 /* Some platforms define a macro, index() in string.h. AIX is
341  * one of these for instance. We must get rid of that definition
342  * as we use ->index all over the place. defining macros like this in system header
343  * files is a really bad idea, but I doubt that IBM will listen to me ;-)
344  */
345 #ifdef	index
346 #undef	index
347 #endif
348 
349 #define _stat   stat
350 
351 // SOCKET not defined on Unix
352 //
353 typedef	int	SOCKET;
354 
355 #define ANTLR3_API
356 #define	ANTLR3_CDECL
357 #define ANTLR3_FASTCALL
358 
359 #ifdef	__hpux
360 
361  // HPUX is always different usually for no good reason. Tru64 should have kicked it
362  // into touch and everyone knows it ;-)
363  //
364  typedef struct sockaddr_in ANTLR3_SOCKADDRT, * pANTLR3_SOCKADDRT;	// Type used for socket address declaration
365  typedef void *		    pANTLR3_SOCKADDRC;				// Type used for cast on accept()
366  typedef int		    ANTLR3_SALENT;
367 
368 #else
369 
370 # if defined(_AIX) || __GNUC__ > 3
371 
372    typedef  socklen_t   ANTLR3_SALENT;
373 
374 # else
375 
376    typedef  size_t	ANTLR3_SALENT;
377 
378 # endif
379 
380    typedef struct sockaddr_in   ANTLR3_SOCKADDRT, * pANTLR3_SOCKADDRT;	// Type used for socket address declaration
381    typedef struct sockaddr	* pANTLR3_SOCKADDRC;                    // Type used for cast on accept()
382 
383 #endif
384 
385 #define INVALID_SOCKET      ((SOCKET)-1)
386 #define	ANTLR3_CLOSESOCKET  close
387 
388 #ifdef __cplusplus
389 extern "C" {
390 #endif
391 
392 /* Inherit type definitions for autoconf
393  */
394 typedef int32_t	    ANTLR3_CHAR,    *pANTLR3_CHAR;
395 typedef uint32_t    ANTLR3_UCHAR,   *pANTLR3_UCHAR;
396 
397 typedef int8_t	    ANTLR3_INT8,    *pANTLR3_INT8;
398 typedef int16_t	    ANTLR3_INT16,   *pANTLR3_INT16;
399 typedef int32_t	    ANTLR3_INT32,   *pANTLR3_INT32;
400 typedef int64_t	    ANTLR3_INT64,   *pANTLR3_INT64;
401 
402 typedef uint8_t	    ANTLR3_UINT8,   *pANTLR3_UINT8;
403 typedef uint16_t    ANTLR3_UINT16,  *pANTLR3_UINT16;
404 typedef uint32_t    ANTLR3_UINT32,  *pANTLR3_UINT32;
405 typedef uint64_t    ANTLR3_UINT64,  *pANTLR3_UINT64;
406 typedef uint64_t    ANTLR3_BITWORD, *pANTLR3_BITWORD;
407 
408 typedef uint32_t    ANTLR3_BOOLEAN, *pANTLR3_BOOLEAN;
409 
410 #define ANTLR3_INLINE   inline
411 #define	ANTLR3_API
412 
413 typedef FILE *	    ANTLR3_FDSC;
414 typedef	struct stat ANTLR3_FSTAT_STRUCT;
415 
416 #ifdef	ANTLR3_USE_64BIT
417 #define	ANTLR3_FUNC_PTR(ptr)    (void *)((ANTLR3_UINT64)(ptr))
418 #define ANTLR3_UINT64_CAST(ptr)	(ANTLR3_UINT64)(ptr))
419 #define	ANTLR3_UINT32_CAST(ptr) (ANTLR3_UINT32)((ANTLR3_UINT64)(ptr))
420 typedef ANTLR3_INT64		ANTLR3_MARKER;
421 typedef ANTLR3_UINT64		ANTLR3_INTKEY;
422 #else
423 #define	ANTLR3_FUNC_PTR(ptr)	(void *)((ANTLR3_UINT32)(ptr))
424 #define ANTLR3_UINT64_CAST(ptr) (ANTLR3_UINT64)((ANTLR3_UINT32)(ptr))
425 #define	ANTLR3_UINT32_CAST(ptr)	(ANTLR3_UINT32)(ptr)
426 typedef	ANTLR3_INT32		ANTLR3_MARKER;
427 typedef ANTLR3_UINT32		ANTLR3_INTKEY;
428 #endif
429 #define	ANTLR3_UINT64_LIT(lit)	lit##ULL
430 
431 #ifdef __cplusplus
432 }
433 #endif
434 
435 #endif
436 
437 #ifdef ANTLR3_USE_64BIT
438 #define ANTLR3_TRIE_DEPTH 63
439 #else
440 #define ANTLR3_TRIE_DEPTH 31
441 #endif
442 /* Pre declare the typedefs for all the interfaces, then
443  * they can be inter-dependant and we will let the linker
444  * sort it out for us.
445  */
446 #include    <antlr3interfaces.h>
447 
448 // Include the unicode.org conversion library header.
449 //
450 #include    <antlr3convertutf.h>
451 
452 /* Prototypes
453  */
454 #ifndef ANTLR3_MALLOC
455 /// Default definition of ANTLR3_MALLOC. You can override this before including
456 /// antlr3.h if you wish to use your own implementation.
457 ///
458 #define	ANTLR3_MALLOC(request)          malloc  ((size_t)(request))
459 #endif
460 
461 #ifndef ANTLR3_CALLOC
462 /// Default definition of ANTLR3_CALLOC. You can override this before including
463 /// antlr3.h if you wish to use your own implementation.
464 ///
465 #define	ANTLR3_CALLOC(numEl, elSize)    calloc  (numEl, (size_t)(elSize))
466 #endif
467 
468 #ifndef ANTLR3_REALLOC
469 /// Default definition of ANTLR3_REALLOC. You can override this before including
470 /// antlr3.h if you wish to use your own implementation.
471 ///
472 #define ANTLR3_REALLOC(current, request)    realloc ((void *)(current), (size_t)(request))
473 #endif
474 #ifndef ANTLR3_FREE
475 /// Default definition of ANTLR3_FREE. You can override this before including
476 /// antlr3.h if you wish to use your own implementation.
477 ///
478 #define	ANTLR3_FREE(ptr)		free    ((void *)(ptr))
479 #endif
480 #ifndef ANTLR3_FREE_FUNC
481 /// Default definition of ANTLR3_FREE_FUNC. You can override this before including
482 /// antlr3.h if you wish to use your own implementation.
483 ///
484 #define	ANTLR3_FREE_FUNC		free
485 #endif
486 #ifndef ANTLR3_STRDUP
487 /// Default definition of ANTLR3_STRDUP. You can override this before including
488 /// antlr3.h if you wish to use your own implementation.
489 ///
490 #define	ANTLR3_STRDUP(instr)		(pANTLR3_UINT8)(strdup  ((const char *)(instr)))
491 #endif
492 #ifndef ANTLR3_MEMCPY
493 /// Default definition of ANTLR3_MEMCPY. You can override this before including
494 /// antlr3.h if you wish to use your own implementation.
495 ///
496 #define	ANTLR3_MEMCPY(target, source, size) memcpy((void *)(target), (const void *)(source), (size_t)(size))
497 #endif
498 #ifndef ANTLR3_MEMMOVE
499 /// Default definition of ANTLR3_MEMMOVE. You can override this before including
500 /// antlr3.h if you wish to use your own implementation.
501 ///
502 #define	ANTLR3_MEMMOVE(target, source, size)    memmove((void *)(target), (const void *)(source), (size_t)(size))
503 #endif
504 #ifndef ANTLR3_MEMSET
505 /// Default definition of ANTLR3_MEMSET. You can override this before including
506 /// antlr3.h if you wish to use your own implementation.
507 ///
508 #define	ANTLR3_MEMSET(target, byte, size)   memset((void *)(target), (int)(byte), (size_t)(size))
509 #endif
510 
511 #ifndef	ANTLR3_PRINTF
512 /// Default definition of printf, set this to something other than printf before including antlr3.h
513 /// if your system does not have a printf. Note that you can define this to be <code>//</code>
514 /// without harming the runtime.
515 ///
516 #define	ANTLR3_PRINTF   printf
517 #endif
518 
519 #ifndef	ANTLR3_FPRINTF
520 /// Default definition of fprintf, set this to something other than fprintf before including antlr3.h
521 /// if your system does not have a fprintf. Note that you can define this to be <code>//</code>
522 /// without harming the runtime.
523 ///
524 #define	ANTLR3_FPRINTF	fprintf
525 #endif
526 
527 #ifdef __cplusplus
528 extern "C" {
529 #endif
530 
531 ANTLR3_API pANTLR3_INT_TRIE antlr3IntTrieNew    (ANTLR3_UINT32 depth);
532 
533 ANTLR3_API pANTLR3_BITSET   antlr3BitsetNew	(ANTLR3_UINT32 numBits);
534 ANTLR3_API pANTLR3_BITSET   antlr3BitsetOf	(ANTLR3_INT32 bit, ...);
535 ANTLR3_API pANTLR3_BITSET   antlr3BitsetList	(pANTLR3_HASH_TABLE list);
536 ANTLR3_API pANTLR3_BITSET   antlr3BitsetCopy	(pANTLR3_BITSET_LIST blist);
537 ANTLR3_API pANTLR3_BITSET   antlr3BitsetLoad    (pANTLR3_BITSET_LIST blist);
538 ANTLR3_API void             antlr3BitsetSetAPI  (pANTLR3_BITSET bitset);
539 
540 
541 ANTLR3_API pANTLR3_BASE_RECOGNIZER  antlr3BaseRecognizerNew                     (ANTLR3_UINT32 type, ANTLR3_UINT32 sizeHint, pANTLR3_RECOGNIZER_SHARED_STATE state);
542 ANTLR3_API void			    antlr3RecognitionExceptionNew               (pANTLR3_BASE_RECOGNIZER recognizer);
543 ANTLR3_API void			    antlr3MTExceptionNew                        (pANTLR3_BASE_RECOGNIZER recognizer);
544 ANTLR3_API void			    antlr3MTNExceptionNew                       (pANTLR3_BASE_RECOGNIZER recognizer);
545 ANTLR3_API pANTLR3_HASH_TABLE	    antlr3HashTableNew                          (ANTLR3_UINT32 sizeHint);
546 ANTLR3_API ANTLR3_UINT32	    antlr3Hash                                  (void * key, ANTLR3_UINT32 keylen);
547 ANTLR3_API pANTLR3_HASH_ENUM	    antlr3EnumNew                               (pANTLR3_HASH_TABLE table);
548 ANTLR3_API pANTLR3_LIST		    antlr3ListNew                               (ANTLR3_UINT32 sizeHint);
549 ANTLR3_API pANTLR3_VECTOR_FACTORY   antlr3VectorFactoryNew                      (ANTLR3_UINT32 sizeHint);
550 ANTLR3_API pANTLR3_VECTOR	    antlr3VectorNew                             (ANTLR3_UINT32 sizeHint);
551 ANTLR3_API pANTLR3_STACK	    antlr3StackNew                              (ANTLR3_UINT32 sizeHint);
552 ANTLR3_API void                     antlr3SetVectorApi                          (pANTLR3_VECTOR vector, ANTLR3_UINT32 sizeHint);
553 ANTLR3_API ANTLR3_UCHAR		    antlr3c8toAntlrc                            (ANTLR3_INT8 inc);
554 ANTLR3_API pANTLR3_TOPO             antlr3TopoNew();
555 
556 ANTLR3_API pANTLR3_EXCEPTION	    antlr3ExceptionNew                          (ANTLR3_UINT32 exception, void * name, void * message, ANTLR3_BOOLEAN freeMessage);
557 
558 
559 ANTLR3_API pANTLR3_INPUT_STREAM     antlr3FileStreamNew                         (pANTLR3_UINT8 fileName, ANTLR3_UINT32 encoding);
560 ANTLR3_API pANTLR3_INPUT_STREAM     antlr3StringStreamNew                       (pANTLR3_UINT8 data, ANTLR3_UINT32 encoding, ANTLR3_UINT32 size, pANTLR3_UINT8 name);
561 
562 ANTLR3_API pANTLR3_INT_STREAM	    antlr3IntStreamNew                          (void);
563 
564 ANTLR3_API pANTLR3_STRING_FACTORY   antlr3StringFactoryNew                      (ANTLR3_UINT32 encoding);
565 
566 ANTLR3_API pANTLR3_COMMON_TOKEN	    antlr3CommonTokenNew                        (ANTLR3_UINT32 ttype);
567 ANTLR3_API pANTLR3_TOKEN_FACTORY    antlr3TokenFactoryNew                       (pANTLR3_INPUT_STREAM input);
568 ANTLR3_API void			    antlr3SetTokenAPI                           (pANTLR3_COMMON_TOKEN token);
569 
570 ANTLR3_API pANTLR3_LEXER	    antlr3LexerNewStream                        (ANTLR3_UINT32 sizeHint, pANTLR3_INPUT_STREAM input, pANTLR3_RECOGNIZER_SHARED_STATE state);
571 ANTLR3_API pANTLR3_LEXER	    antlr3LexerNew                              (ANTLR3_UINT32 sizeHint, pANTLR3_RECOGNIZER_SHARED_STATE state);
572 ANTLR3_API pANTLR3_PARSER	    antlr3ParserNewStreamDbg                    (ANTLR3_UINT32 sizeHint, pANTLR3_TOKEN_STREAM tstream, pANTLR3_DEBUG_EVENT_LISTENER dbg, pANTLR3_RECOGNIZER_SHARED_STATE state);
573 ANTLR3_API pANTLR3_PARSER	    antlr3ParserNewStream                       (ANTLR3_UINT32 sizeHint, pANTLR3_TOKEN_STREAM tstream, pANTLR3_RECOGNIZER_SHARED_STATE state);
574 ANTLR3_API pANTLR3_PARSER           antlr3ParserNew                             (ANTLR3_UINT32 sizeHint, pANTLR3_RECOGNIZER_SHARED_STATE state);
575 
576 ANTLR3_API pANTLR3_COMMON_TOKEN_STREAM  antlr3CommonTokenStreamSourceNew        (ANTLR3_UINT32 hint, pANTLR3_TOKEN_SOURCE source);
577 ANTLR3_API pANTLR3_COMMON_TOKEN_STREAM	antlr3CommonTokenStreamNew              (ANTLR3_UINT32 hint);
578 ANTLR3_API pANTLR3_COMMON_TOKEN_STREAM	antlr3CommonTokenDebugStreamSourceNew   (ANTLR3_UINT32 hint, pANTLR3_TOKEN_SOURCE source, pANTLR3_DEBUG_EVENT_LISTENER debugger);
579 
580 ANTLR3_API pANTLR3_BASE_TREE_ADAPTOR	ANTLR3_TREE_ADAPTORNew                  (pANTLR3_STRING_FACTORY strFactory);
581 ANTLR3_API pANTLR3_BASE_TREE_ADAPTOR	ANTLR3_TREE_ADAPTORDebugNew             (pANTLR3_STRING_FACTORY strFactory, pANTLR3_DEBUG_EVENT_LISTENER	debugger);
582 ANTLR3_API pANTLR3_COMMON_TREE		antlr3CommonTreeNew                     (void);
583 ANTLR3_API pANTLR3_COMMON_TREE		antlr3CommonTreeNewFromTree             (pANTLR3_COMMON_TREE tree);
584 ANTLR3_API pANTLR3_COMMON_TREE		antlr3CommonTreeNewFromToken            (pANTLR3_COMMON_TOKEN tree);
585 ANTLR3_API pANTLR3_ARBORETUM		antlr3ArboretumNew                      (pANTLR3_STRING_FACTORY factory);
586 ANTLR3_API void				antlr3SetCTAPI                          (pANTLR3_COMMON_TREE tree);
587 ANTLR3_API pANTLR3_BASE_TREE		antlr3BaseTreeNew                       (pANTLR3_BASE_TREE tree);
588 
589 ANTLR3_API void				antlr3BaseTreeAdaptorInit               (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_DEBUG_EVENT_LISTENER debugger);
590 
591 ANTLR3_API pANTLR3_TREE_PARSER		antlr3TreeParserNewStream               (ANTLR3_UINT32 sizeHint, pANTLR3_COMMON_TREE_NODE_STREAM ctnstream, pANTLR3_RECOGNIZER_SHARED_STATE state);
592 
593 ANTLR3_API ANTLR3_INT32			antlr3dfaspecialTransition              (void * ctx, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_INT_STREAM is, pANTLR3_CYCLIC_DFA dfa, ANTLR3_INT32 s);
594 ANTLR3_API ANTLR3_INT32			antlr3dfaspecialStateTransition         (void * ctx, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_INT_STREAM is, pANTLR3_CYCLIC_DFA dfa, ANTLR3_INT32 s);
595 ANTLR3_API ANTLR3_INT32			antlr3dfapredict                        (void * ctx, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_INT_STREAM is, pANTLR3_CYCLIC_DFA cdfa);
596 
597 ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM  antlr3CommonTreeNodeStreamNewTree   (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 hint);
598 ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM  antlr3CommonTreeNodeStreamNew       (pANTLR3_STRING_FACTORY strFactory, ANTLR3_UINT32 hint);
599 ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM  antlr3UnbufTreeNodeStreamNewTree    (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 hint);
600 ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM  antlr3UnbufTreeNodeStreamNew        (pANTLR3_STRING_FACTORY strFactory, ANTLR3_UINT32 hint);
601 ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM  antlr3CommonTreeNodeStreamNewStream (pANTLR3_COMMON_TREE_NODE_STREAM inStream);
602 ANTLR3_API pANTLR3_TREE_NODE_STREAM         antlr3TreeNodeStreamNew             ();
603 ANTLR3_API void				    fillBufferExt                       (pANTLR3_COMMON_TOKEN_STREAM tokenStream);
604 
605 ANTLR3_API pANTLR3_REWRITE_RULE_TOKEN_STREAM
606     antlr3RewriteRuleTOKENStreamNewAE	(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description);
607 ANTLR3_API pANTLR3_REWRITE_RULE_TOKEN_STREAM
608     antlr3RewriteRuleTOKENStreamNewAEE	(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, void * oneElement);
609 ANTLR3_API pANTLR3_REWRITE_RULE_TOKEN_STREAM
610     antlr3RewriteRuleTOKENStreamNewAEV	(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, pANTLR3_VECTOR vector);
611 
612 ANTLR3_API pANTLR3_REWRITE_RULE_NODE_STREAM
613     antlr3RewriteRuleNODEStreamNewAE	(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description);
614 ANTLR3_API pANTLR3_REWRITE_RULE_NODE_STREAM
615     antlr3RewriteRuleNODEStreamNewAEE	(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, void * oneElement);
616 ANTLR3_API pANTLR3_REWRITE_RULE_NODE_STREAM
617     antlr3RewriteRuleNODEStreamNewAEV	(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, pANTLR3_VECTOR vector);
618 
619 ANTLR3_API pANTLR3_REWRITE_RULE_SUBTREE_STREAM
620     antlr3RewriteRuleSubtreeStreamNewAE	(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description);
621 ANTLR3_API pANTLR3_REWRITE_RULE_SUBTREE_STREAM
622     antlr3RewriteRuleSubtreeStreamNewAEE(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, void * oneElement);
623 ANTLR3_API pANTLR3_REWRITE_RULE_SUBTREE_STREAM
624     antlr3RewriteRuleSubtreeStreamNewAEV(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, pANTLR3_VECTOR vector);
625 
626 ANTLR3_API pANTLR3_DEBUG_EVENT_LISTENER antlr3DebugListenerNew();
627 
628 #ifdef __cplusplus
629 }
630 #endif
631 
632 #endif	/* _ANTLR3DEFS_H	*/
633