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