Home | History | Annotate | Download | only in include
      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 #elif __LP64__
    115 
    116 # define ANTLR3_USE_64BIT
    117 
    118 #else
    119 
    120 #ifdef	_WIN32
    121 # ifndef	ANTLR3_WINDOWS
    122 #  define	ANTLR3_WINDOWS
    123 # endif
    124 
    125 #define	ANTLR3_WIN32
    126 #endif
    127 
    128 #endif
    129 
    130 #ifdef	ANTLR3_WINDOWS
    131 
    132 #ifndef WIN32_LEAN_AND_MEAN
    133 #define	WIN32_LEAN_AND_MEAN
    134 #endif
    135 
    136 /* Allow VC 8 (vs2005) and above to use 'secure' versions of various functions such as sprintf
    137  */
    138 #ifndef	_CRT_SECURE_NO_DEPRECATE
    139 #define	_CRT_SECURE_NO_DEPRECATE
    140 #endif
    141 
    142 #include    <windows.h>
    143 #include    <stdlib.h>
    144 #include    <winsock.h>
    145 #include    <stdio.h>
    146 #include    <sys/types.h>
    147 #include    <sys/stat.h>
    148 #include    <stdarg.h>
    149 
    150 #define	ANTLR3_API      __declspec(dllexport)
    151 #define	ANTLR3_CDECL    __cdecl
    152 #define ANTLR3_FASTCALL __fastcall
    153 
    154 #ifdef __cplusplus
    155 extern "C" {
    156 #endif
    157 
    158 #ifndef __MINGW32__
    159 // Standard Windows types
    160 //
    161 typedef	INT32	ANTLR3_CHAR,	*pANTLR3_CHAR;
    162 typedef	UINT32	ANTLR3_UCHAR,	*pANTLR3_UCHAR;
    163 
    164 typedef	INT8	ANTLR3_INT8,	*pANTLR3_INT8;
    165 typedef	INT16	ANTLR3_INT16,	*pANTLR3_INT16;
    166 typedef	INT32	ANTLR3_INT32,	*pANTLR3_INT32;
    167 typedef	INT64	ANTLR3_INT64,	*pANTLR3_INT64;
    168 typedef	UINT8	ANTLR3_UINT8,	*pANTLR3_UINT8;
    169 typedef	UINT16	ANTLR3_UINT16,	*pANTLR3_UINT16;
    170 typedef	UINT32	ANTLR3_UINT32,	*pANTLR3_UINT32;
    171 typedef	UINT64	ANTLR3_UINT64,	*pANTLR3_UINT64;
    172 typedef UINT64  ANTLR3_BITWORD, *pANTLR3_BITWORD;
    173 typedef	UINT8	ANTLR3_BOOLEAN, *pANTLR3_BOOLEAN;
    174 
    175 #else
    176 // Mingw uses stdint.h and fails to define standard Microsoft typedefs
    177 // such as UINT16, hence we must use stdint.h for Mingw.
    178 //
    179 #include <stdint.h>
    180 typedef int32_t     ANTLR3_CHAR,    *pANTLR3_CHAR;
    181 typedef uint32_t    ANTLR3_UCHAR,   *pANTLR3_UCHAR;
    182 
    183 typedef int8_t	    ANTLR3_INT8,    *pANTLR3_INT8;
    184 typedef int16_t	    ANTLR3_INT16,   *pANTLR3_INT16;
    185 typedef int32_t	    ANTLR3_INT32,   *pANTLR3_INT32;
    186 typedef int64_t	    ANTLR3_INT64,   *pANTLR3_INT64;
    187 
    188 typedef uint8_t	    ANTLR3_UINT8,   *pANTLR3_UINT8;
    189 typedef uint16_t    ANTLR3_UINT16,  *pANTLR3_UINT16;
    190 typedef uint32_t    ANTLR3_UINT32,  *pANTLR3_UINT32;
    191 typedef uint64_t    ANTLR3_UINT64,  *pANTLR3_UINT64;
    192 typedef uint64_t    ANTLR3_BITWORD, *pANTLR3_BITWORD;
    193 
    194 typedef	uint8_t	    ANTLR3_BOOLEAN, *pANTLR3_BOOLEAN;
    195 
    196 #endif
    197 
    198 
    199 
    200 #define	ANTLR3_UINT64_LIT(lit)  lit##ULL
    201 
    202 #define	ANTLR3_INLINE	        __inline
    203 
    204 typedef FILE *	    ANTLR3_FDSC;
    205 typedef	struct stat ANTLR3_FSTAT_STRUCT;
    206 
    207 #ifdef	ANTLR3_USE_64BIT
    208 #define	ANTLR3_FUNC_PTR(ptr)	(void *)((ANTLR3_UINT64)(ptr))
    209 #define ANTLR3_UINT64_CAST(ptr) (ANTLR3_UINT64)(ptr))
    210 #define	ANTLR3_UINT32_CAST(ptr)	(ANTLR3_UINT32)((ANTLR3_UINT64)(ptr))
    211 typedef ANTLR3_INT64		ANTLR3_MARKER;
    212 typedef ANTLR3_UINT64		ANTLR3_INTKEY;
    213 #else
    214 #define	ANTLR3_FUNC_PTR(ptr)	(void *)((ANTLR3_UINT32)(ptr))
    215 #define ANTLR3_UINT64_CAST(ptr) (ANTLR3_UINT64)((ANTLR3_UINT32)(ptr))
    216 #define	ANTLR3_UINT32_CAST(ptr)	(ANTLR3_UINT32)(ptr)
    217 typedef	ANTLR3_INT32		ANTLR3_MARKER;
    218 typedef ANTLR3_UINT32		ANTLR3_INTKEY;
    219 #endif
    220 
    221 #ifdef	ANTLR3_WIN32
    222 #endif
    223 
    224 #ifdef	ANTLR3_WIN64
    225 #endif
    226 
    227 
    228 typedef	int			ANTLR3_SALENT;								// Type used for size of accept structure
    229 typedef struct sockaddr_in	ANTLR3_SOCKADDRT, * pANTLR3_SOCKADDRT;	// Type used for socket address declaration
    230 typedef struct sockaddr		ANTLR3_SOCKADDRC, * pANTLR3_SOCKADDRC;	// Type used for cast on accept()
    231 
    232 #define	ANTLR3_CLOSESOCKET	closesocket
    233 
    234 #ifdef __cplusplus
    235 }
    236 #endif
    237 
    238 /* Warnings that are over-zealous such as complaining about strdup, we
    239  * can turn off.
    240  */
    241 
    242 /* Don't complain about "deprecated" functions such as strdup
    243  */
    244 #pragma warning( disable : 4996 )
    245 
    246 #else
    247 
    248 /* Include configure generated header file
    249  */
    250 #include	<antlr3config.h>
    251 
    252 #include <stdio.h>
    253 
    254 #if HAVE_STDINT_H
    255 # include <stdint.h>
    256 #endif
    257 
    258 #if HAVE_SYS_TYPES_H
    259 # include <sys/types.h>
    260 #endif
    261 
    262 #if HAVE_SYS_STAT_H
    263 # include <sys/stat.h>
    264 #endif
    265 
    266 #if STDC_HEADERS
    267 # include   <stdlib.h>
    268 # include   <stddef.h>
    269 # include   <stdarg.h>
    270 #else
    271 # if HAVE_STDLIB_H
    272 #  include  <stdlib.h>
    273 # endif
    274 # if HAVE_STDARG_H
    275 #  include  <stdarg.h>
    276 # endif
    277 #endif
    278 
    279 #if HAVE_STRING_H
    280 # if !STDC_HEADERS && HAVE_MEMORY_H
    281 #  include <memory.h>
    282 # endif
    283 # include <string.h>
    284 #endif
    285 
    286 #if HAVE_STRINGS_H
    287 # include <strings.h>
    288 #endif
    289 
    290 #if HAVE_INTTYPES_H
    291 # include <inttypes.h>
    292 #endif
    293 
    294 #if HAVE_UNISTD_H
    295 # include <unistd.h>
    296 #endif
    297 
    298 #ifdef HAVE_NETINET_IN_H
    299 #include	<netinet/in.h>
    300 #endif
    301 
    302 #ifdef HAVE_SOCKET_H
    303 # include	<socket.h>
    304 #else
    305 # if HAVE_SYS_SOCKET_H
    306 #  include	<sys/socket.h>
    307 # endif
    308 #endif
    309 
    310 #ifdef HAVE_NETINET_TCP_H
    311 #include	<netinet/tcp.h>
    312 #endif
    313 
    314 #ifdef HAVE_ARPA_NAMESER_H
    315 #include <arpa/nameser.h> /* DNS HEADER struct */
    316 #endif
    317 
    318 #ifdef HAVE_NETDB_H
    319 #include <netdb.h>
    320 #endif
    321 
    322 
    323 #ifdef HAVE_SYS_RESOLVE_H
    324 #include	<sys/resolv.h>
    325 #endif
    326 
    327 #ifdef HAVE_RESOLVE_H
    328 #include	<resolv.h>
    329 #endif
    330 
    331 
    332 #ifdef	HAVE_MALLOC_H
    333 # include    <malloc.h>
    334 #else
    335 # ifdef	HAVE_SYS_MALLOC_H
    336 #  include    <sys/malloc.h>
    337 # endif
    338 #endif
    339 
    340 #ifdef  HAVE_CTYPE_H
    341 # include   <ctype.h>
    342 #endif
    343 
    344 /* Some platforms define a macro, index() in string.h. AIX is
    345  * one of these for instance. We must get rid of that definition
    346  * as we use ->index all over the place. defining macros like this in system header
    347  * files is a really bad idea, but I doubt that IBM will listen to me ;-)
    348  */
    349 #ifdef	index
    350 #undef	index
    351 #endif
    352 
    353 #define _stat   stat
    354 
    355 // SOCKET not defined on Unix
    356 //
    357 typedef	int	SOCKET;
    358 
    359 #define ANTLR3_API
    360 #define	ANTLR3_CDECL
    361 #define ANTLR3_FASTCALL
    362 
    363 #ifdef	__hpux
    364 
    365  // HPUX is always different usually for no good reason. Tru64 should have kicked it
    366  // into touch and everyone knows it ;-)
    367  //
    368  typedef struct sockaddr_in ANTLR3_SOCKADDRT, * pANTLR3_SOCKADDRT;	// Type used for socket address declaration
    369  typedef void *		    pANTLR3_SOCKADDRC;				// Type used for cast on accept()
    370  typedef int		    ANTLR3_SALENT;
    371 
    372 #else
    373 
    374 # if defined(_AIX) || __GNUC__ > 3
    375 
    376    typedef  socklen_t   ANTLR3_SALENT;
    377 
    378 # else
    379 
    380    typedef  size_t	ANTLR3_SALENT;
    381 
    382 # endif
    383 
    384    typedef struct sockaddr_in   ANTLR3_SOCKADDRT, * pANTLR3_SOCKADDRT;	// Type used for socket address declaration
    385    typedef struct sockaddr	* pANTLR3_SOCKADDRC;                    // Type used for cast on accept()
    386 
    387 #endif
    388 
    389 #define INVALID_SOCKET      ((SOCKET)-1)
    390 #define	ANTLR3_CLOSESOCKET  close
    391 
    392 #ifdef __cplusplus
    393 extern "C" {
    394 #endif
    395 
    396 /* Inherit type definitions for autoconf
    397  */
    398 typedef int32_t	    ANTLR3_CHAR,    *pANTLR3_CHAR;
    399 typedef uint32_t    ANTLR3_UCHAR,   *pANTLR3_UCHAR;
    400 
    401 typedef int8_t	    ANTLR3_INT8,    *pANTLR3_INT8;
    402 typedef int16_t	    ANTLR3_INT16,   *pANTLR3_INT16;
    403 typedef int32_t	    ANTLR3_INT32,   *pANTLR3_INT32;
    404 typedef int64_t	    ANTLR3_INT64,   *pANTLR3_INT64;
    405 
    406 typedef uint8_t	    ANTLR3_UINT8,   *pANTLR3_UINT8;
    407 typedef uint16_t    ANTLR3_UINT16,  *pANTLR3_UINT16;
    408 typedef uint32_t    ANTLR3_UINT32,  *pANTLR3_UINT32;
    409 typedef uint64_t    ANTLR3_UINT64,  *pANTLR3_UINT64;
    410 typedef uint64_t    ANTLR3_BITWORD, *pANTLR3_BITWORD;
    411 
    412 typedef uint32_t    ANTLR3_BOOLEAN, *pANTLR3_BOOLEAN;
    413 
    414 #define ANTLR3_INLINE   inline
    415 #define	ANTLR3_API
    416 
    417 typedef FILE *	    ANTLR3_FDSC;
    418 typedef	struct stat ANTLR3_FSTAT_STRUCT;
    419 
    420 #ifdef	ANTLR3_USE_64BIT
    421 #define	ANTLR3_FUNC_PTR(ptr)    (void *)((ANTLR3_UINT64)(ptr))
    422 #define ANTLR3_UINT64_CAST(ptr)	(ANTLR3_UINT64)(ptr))
    423 #define	ANTLR3_UINT32_CAST(ptr) (ANTLR3_UINT32)((ANTLR3_UINT64)(ptr))
    424 typedef ANTLR3_INT64		ANTLR3_MARKER;
    425 typedef ANTLR3_UINT64		ANTLR3_INTKEY;
    426 #else
    427 #define	ANTLR3_FUNC_PTR(ptr)	(void *)((ANTLR3_UINT32)(ptr))
    428 #define ANTLR3_UINT64_CAST(ptr) (ANTLR3_UINT64)((ANTLR3_UINT32)(ptr))
    429 #define	ANTLR3_UINT32_CAST(ptr)	(ANTLR3_UINT32)(ptr)
    430 typedef	ANTLR3_INT32		ANTLR3_MARKER;
    431 typedef ANTLR3_UINT32		ANTLR3_INTKEY;
    432 #endif
    433 #define	ANTLR3_UINT64_LIT(lit)	lit##ULL
    434 
    435 #ifdef __cplusplus
    436 }
    437 #endif
    438 
    439 #endif
    440 
    441 #ifdef ANTLR3_USE_64BIT
    442 #define ANTLR3_TRIE_DEPTH 63
    443 #else
    444 #define ANTLR3_TRIE_DEPTH 31
    445 #endif
    446 /* Pre declare the typedefs for all the interfaces, then
    447  * they can be inter-dependant and we will let the linker
    448  * sort it out for us.
    449  */
    450 #include    <antlr3interfaces.h>
    451 
    452 // Include the unicode.org conversion library header.
    453 //
    454 #include    <antlr3convertutf.h>
    455 
    456 /* Prototypes
    457  */
    458 #ifndef ANTLR3_MALLOC
    459 /// Default definition of ANTLR3_MALLOC. You can override this before including
    460 /// antlr3.h if you wish to use your own implementation.
    461 ///
    462 #define	ANTLR3_MALLOC(request)          malloc  ((size_t)(request))
    463 #endif
    464 
    465 #ifndef ANTLR3_CALLOC
    466 /// Default definition of ANTLR3_CALLOC. You can override this before including
    467 /// antlr3.h if you wish to use your own implementation.
    468 ///
    469 #define	ANTLR3_CALLOC(numEl, elSize)    calloc  (numEl, (size_t)(elSize))
    470 #endif
    471 
    472 #ifndef ANTLR3_REALLOC
    473 /// Default definition of ANTLR3_REALLOC. You can override this before including
    474 /// antlr3.h if you wish to use your own implementation.
    475 ///
    476 #define ANTLR3_REALLOC(current, request)    realloc ((void *)(current), (size_t)(request))
    477 #endif
    478 #ifndef ANTLR3_FREE
    479 /// Default definition of ANTLR3_FREE. You can override this before including
    480 /// antlr3.h if you wish to use your own implementation.
    481 ///
    482 #define	ANTLR3_FREE(ptr)		free    ((void *)(ptr))
    483 #endif
    484 #ifndef ANTLR3_FREE_FUNC
    485 /// Default definition of ANTLR3_FREE_FUNC. You can override this before including
    486 /// antlr3.h if you wish to use your own implementation.
    487 ///
    488 #define	ANTLR3_FREE_FUNC		free
    489 #endif
    490 #ifndef ANTLR3_STRDUP
    491 /// Default definition of ANTLR3_STRDUP. You can override this before including
    492 /// antlr3.h if you wish to use your own implementation.
    493 ///
    494 #define	ANTLR3_STRDUP(instr)		(pANTLR3_UINT8)(strdup  ((const char *)(instr)))
    495 #endif
    496 #ifndef ANTLR3_MEMCPY
    497 /// Default definition of ANTLR3_MEMCPY. You can override this before including
    498 /// antlr3.h if you wish to use your own implementation.
    499 ///
    500 #define	ANTLR3_MEMCPY(target, source, size) memcpy((void *)(target), (const void *)(source), (size_t)(size))
    501 #endif
    502 #ifndef ANTLR3_MEMMOVE
    503 /// Default definition of ANTLR3_MEMMOVE. You can override this before including
    504 /// antlr3.h if you wish to use your own implementation.
    505 ///
    506 #define	ANTLR3_MEMMOVE(target, source, size)    memmove((void *)(target), (const void *)(source), (size_t)(size))
    507 #endif
    508 #ifndef ANTLR3_MEMSET
    509 /// Default definition of ANTLR3_MEMSET. You can override this before including
    510 /// antlr3.h if you wish to use your own implementation.
    511 ///
    512 #define	ANTLR3_MEMSET(target, byte, size)   memset((void *)(target), (int)(byte), (size_t)(size))
    513 #endif
    514 
    515 #ifndef	ANTLR3_PRINTF
    516 /// Default definition of printf, set this to something other than printf before including antlr3.h
    517 /// if your system does not have a printf. Note that you can define this to be <code>//</code>
    518 /// without harming the runtime.
    519 ///
    520 #define	ANTLR3_PRINTF   printf
    521 #endif
    522 
    523 #ifndef	ANTLR3_FPRINTF
    524 /// Default definition of fprintf, set this to something other than fprintf before including antlr3.h
    525 /// if your system does not have a fprintf. Note that you can define this to be <code>//</code>
    526 /// without harming the runtime.
    527 ///
    528 #define	ANTLR3_FPRINTF	fprintf
    529 #endif
    530 
    531 #ifdef __cplusplus
    532 extern "C" {
    533 #endif
    534 
    535 ANTLR3_API pANTLR3_INT_TRIE antlr3IntTrieNew    (ANTLR3_UINT32 depth);
    536 
    537 ANTLR3_API pANTLR3_BITSET   antlr3BitsetNew	(ANTLR3_UINT32 numBits);
    538 ANTLR3_API pANTLR3_BITSET   antlr3BitsetOf	(ANTLR3_INT32 bit, ...);
    539 ANTLR3_API pANTLR3_BITSET   antlr3BitsetList	(pANTLR3_HASH_TABLE list);
    540 ANTLR3_API pANTLR3_BITSET   antlr3BitsetCopy	(pANTLR3_BITSET_LIST blist);
    541 ANTLR3_API pANTLR3_BITSET   antlr3BitsetLoad    (pANTLR3_BITSET_LIST blist);
    542 ANTLR3_API void             antlr3BitsetSetAPI  (pANTLR3_BITSET bitset);
    543 
    544 
    545 ANTLR3_API pANTLR3_BASE_RECOGNIZER  antlr3BaseRecognizerNew                     (ANTLR3_UINT32 type, ANTLR3_UINT32 sizeHint, pANTLR3_RECOGNIZER_SHARED_STATE state);
    546 ANTLR3_API void			    antlr3RecognitionExceptionNew               (pANTLR3_BASE_RECOGNIZER recognizer);
    547 ANTLR3_API void			    antlr3MTExceptionNew                        (pANTLR3_BASE_RECOGNIZER recognizer);
    548 ANTLR3_API void			    antlr3MTNExceptionNew                       (pANTLR3_BASE_RECOGNIZER recognizer);
    549 ANTLR3_API pANTLR3_HASH_TABLE	    antlr3HashTableNew                          (ANTLR3_UINT32 sizeHint);
    550 ANTLR3_API ANTLR3_UINT32	    antlr3Hash                                  (void * key, ANTLR3_UINT32 keylen);
    551 ANTLR3_API pANTLR3_HASH_ENUM	    antlr3EnumNew                               (pANTLR3_HASH_TABLE table);
    552 ANTLR3_API pANTLR3_LIST		    antlr3ListNew                               (ANTLR3_UINT32 sizeHint);
    553 ANTLR3_API pANTLR3_VECTOR_FACTORY   antlr3VectorFactoryNew                      (ANTLR3_UINT32 sizeHint);
    554 ANTLR3_API pANTLR3_VECTOR	    antlr3VectorNew                             (ANTLR3_UINT32 sizeHint);
    555 ANTLR3_API pANTLR3_STACK	    antlr3StackNew                              (ANTLR3_UINT32 sizeHint);
    556 ANTLR3_API void                     antlr3SetVectorApi                          (pANTLR3_VECTOR vector, ANTLR3_UINT32 sizeHint);
    557 ANTLR3_API ANTLR3_UCHAR		    antlr3c8toAntlrc                            (ANTLR3_INT8 inc);
    558 ANTLR3_API pANTLR3_TOPO             antlr3TopoNew();
    559 
    560 ANTLR3_API pANTLR3_EXCEPTION	    antlr3ExceptionNew                          (ANTLR3_UINT32 exception, void * name, void * message, ANTLR3_BOOLEAN freeMessage);
    561 
    562 
    563 ANTLR3_API pANTLR3_INPUT_STREAM     antlr3FileStreamNew                         (pANTLR3_UINT8 fileName, ANTLR3_UINT32 encoding);
    564 ANTLR3_API pANTLR3_INPUT_STREAM     antlr3StringStreamNew                       (pANTLR3_UINT8 data, ANTLR3_UINT32 encoding, ANTLR3_UINT32 size, pANTLR3_UINT8 name);
    565 
    566 ANTLR3_API pANTLR3_INT_STREAM	    antlr3IntStreamNew                          (void);
    567 
    568 ANTLR3_API pANTLR3_STRING_FACTORY   antlr3StringFactoryNew                      (ANTLR3_UINT32 encoding);
    569 
    570 ANTLR3_API pANTLR3_COMMON_TOKEN	    antlr3CommonTokenNew                        (ANTLR3_UINT32 ttype);
    571 ANTLR3_API pANTLR3_TOKEN_FACTORY    antlr3TokenFactoryNew                       (pANTLR3_INPUT_STREAM input);
    572 ANTLR3_API void			    antlr3SetTokenAPI                           (pANTLR3_COMMON_TOKEN token);
    573 
    574 ANTLR3_API pANTLR3_LEXER	    antlr3LexerNewStream                        (ANTLR3_UINT32 sizeHint, pANTLR3_INPUT_STREAM input, pANTLR3_RECOGNIZER_SHARED_STATE state);
    575 ANTLR3_API pANTLR3_LEXER	    antlr3LexerNew                              (ANTLR3_UINT32 sizeHint, pANTLR3_RECOGNIZER_SHARED_STATE state);
    576 ANTLR3_API pANTLR3_PARSER	    antlr3ParserNewStreamDbg                    (ANTLR3_UINT32 sizeHint, pANTLR3_TOKEN_STREAM tstream, pANTLR3_DEBUG_EVENT_LISTENER dbg, pANTLR3_RECOGNIZER_SHARED_STATE state);
    577 ANTLR3_API pANTLR3_PARSER	    antlr3ParserNewStream                       (ANTLR3_UINT32 sizeHint, pANTLR3_TOKEN_STREAM tstream, pANTLR3_RECOGNIZER_SHARED_STATE state);
    578 ANTLR3_API pANTLR3_PARSER           antlr3ParserNew                             (ANTLR3_UINT32 sizeHint, pANTLR3_RECOGNIZER_SHARED_STATE state);
    579 
    580 ANTLR3_API pANTLR3_COMMON_TOKEN_STREAM  antlr3CommonTokenStreamSourceNew        (ANTLR3_UINT32 hint, pANTLR3_TOKEN_SOURCE source);
    581 ANTLR3_API pANTLR3_COMMON_TOKEN_STREAM	antlr3CommonTokenStreamNew              (ANTLR3_UINT32 hint);
    582 ANTLR3_API pANTLR3_COMMON_TOKEN_STREAM	antlr3CommonTokenDebugStreamSourceNew   (ANTLR3_UINT32 hint, pANTLR3_TOKEN_SOURCE source, pANTLR3_DEBUG_EVENT_LISTENER debugger);
    583 
    584 ANTLR3_API pANTLR3_BASE_TREE_ADAPTOR	ANTLR3_TREE_ADAPTORNew                  (pANTLR3_STRING_FACTORY strFactory);
    585 ANTLR3_API pANTLR3_BASE_TREE_ADAPTOR	ANTLR3_TREE_ADAPTORDebugNew             (pANTLR3_STRING_FACTORY strFactory, pANTLR3_DEBUG_EVENT_LISTENER	debugger);
    586 ANTLR3_API pANTLR3_COMMON_TREE		antlr3CommonTreeNew                     (void);
    587 ANTLR3_API pANTLR3_COMMON_TREE		antlr3CommonTreeNewFromTree             (pANTLR3_COMMON_TREE tree);
    588 ANTLR3_API pANTLR3_COMMON_TREE		antlr3CommonTreeNewFromToken            (pANTLR3_COMMON_TOKEN tree);
    589 ANTLR3_API pANTLR3_ARBORETUM		antlr3ArboretumNew                      (pANTLR3_STRING_FACTORY factory);
    590 ANTLR3_API void				antlr3SetCTAPI                          (pANTLR3_COMMON_TREE tree);
    591 ANTLR3_API pANTLR3_BASE_TREE		antlr3BaseTreeNew                       (pANTLR3_BASE_TREE tree);
    592 
    593 ANTLR3_API void				antlr3BaseTreeAdaptorInit               (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_DEBUG_EVENT_LISTENER debugger);
    594 
    595 ANTLR3_API pANTLR3_TREE_PARSER		antlr3TreeParserNewStream               (ANTLR3_UINT32 sizeHint, pANTLR3_COMMON_TREE_NODE_STREAM ctnstream, pANTLR3_RECOGNIZER_SHARED_STATE state);
    596 
    597 ANTLR3_API ANTLR3_INT32			antlr3dfaspecialTransition              (void * ctx, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_INT_STREAM is, pANTLR3_CYCLIC_DFA dfa, ANTLR3_INT32 s);
    598 ANTLR3_API ANTLR3_INT32			antlr3dfaspecialStateTransition         (void * ctx, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_INT_STREAM is, pANTLR3_CYCLIC_DFA dfa, ANTLR3_INT32 s);
    599 ANTLR3_API ANTLR3_INT32			antlr3dfapredict                        (void * ctx, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_INT_STREAM is, pANTLR3_CYCLIC_DFA cdfa);
    600 
    601 ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM  antlr3CommonTreeNodeStreamNewTree   (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 hint);
    602 ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM  antlr3CommonTreeNodeStreamNew       (pANTLR3_STRING_FACTORY strFactory, ANTLR3_UINT32 hint);
    603 ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM  antlr3UnbufTreeNodeStreamNewTree    (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 hint);
    604 ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM  antlr3UnbufTreeNodeStreamNew        (pANTLR3_STRING_FACTORY strFactory, ANTLR3_UINT32 hint);
    605 ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM  antlr3CommonTreeNodeStreamNewStream (pANTLR3_COMMON_TREE_NODE_STREAM inStream);
    606 ANTLR3_API pANTLR3_TREE_NODE_STREAM         antlr3TreeNodeStreamNew             ();
    607 ANTLR3_API void				    fillBufferExt                       (pANTLR3_COMMON_TOKEN_STREAM tokenStream);
    608 
    609 ANTLR3_API pANTLR3_REWRITE_RULE_TOKEN_STREAM
    610     antlr3RewriteRuleTOKENStreamNewAE	(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description);
    611 ANTLR3_API pANTLR3_REWRITE_RULE_TOKEN_STREAM
    612     antlr3RewriteRuleTOKENStreamNewAEE	(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, void * oneElement);
    613 ANTLR3_API pANTLR3_REWRITE_RULE_TOKEN_STREAM
    614     antlr3RewriteRuleTOKENStreamNewAEV	(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, pANTLR3_VECTOR vector);
    615 
    616 ANTLR3_API pANTLR3_REWRITE_RULE_NODE_STREAM
    617     antlr3RewriteRuleNODEStreamNewAE	(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description);
    618 ANTLR3_API pANTLR3_REWRITE_RULE_NODE_STREAM
    619     antlr3RewriteRuleNODEStreamNewAEE	(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, void * oneElement);
    620 ANTLR3_API pANTLR3_REWRITE_RULE_NODE_STREAM
    621     antlr3RewriteRuleNODEStreamNewAEV	(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, pANTLR3_VECTOR vector);
    622 
    623 ANTLR3_API pANTLR3_REWRITE_RULE_SUBTREE_STREAM
    624     antlr3RewriteRuleSubtreeStreamNewAE	(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description);
    625 ANTLR3_API pANTLR3_REWRITE_RULE_SUBTREE_STREAM
    626     antlr3RewriteRuleSubtreeStreamNewAEE(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, void * oneElement);
    627 ANTLR3_API pANTLR3_REWRITE_RULE_SUBTREE_STREAM
    628     antlr3RewriteRuleSubtreeStreamNewAEV(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, pANTLR3_VECTOR vector);
    629 
    630 ANTLR3_API pANTLR3_DEBUG_EVENT_LISTENER antlr3DebugListenerNew();
    631 
    632 #ifdef __cplusplus
    633 }
    634 #endif
    635 
    636 #endif	/* _ANTLR3DEFS_H	*/
    637