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 151extern "C" { 152#endif 153 154#ifndef __MINGW32__ 155// Standard Windows types 156// 157typedef INT32 ANTLR3_CHAR, *pANTLR3_CHAR; 158typedef UINT32 ANTLR3_UCHAR, *pANTLR3_UCHAR; 159 160typedef INT8 ANTLR3_INT8, *pANTLR3_INT8; 161typedef INT16 ANTLR3_INT16, *pANTLR3_INT16; 162typedef INT32 ANTLR3_INT32, *pANTLR3_INT32; 163typedef INT64 ANTLR3_INT64, *pANTLR3_INT64; 164typedef UINT8 ANTLR3_UINT8, *pANTLR3_UINT8; 165typedef UINT16 ANTLR3_UINT16, *pANTLR3_UINT16; 166typedef UINT32 ANTLR3_UINT32, *pANTLR3_UINT32; 167typedef UINT64 ANTLR3_UINT64, *pANTLR3_UINT64; 168typedef UINT64 ANTLR3_BITWORD, *pANTLR3_BITWORD; 169typedef 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> 176typedef int32_t ANTLR3_CHAR, *pANTLR3_CHAR; 177typedef uint32_t ANTLR3_UCHAR, *pANTLR3_UCHAR; 178 179typedef int8_t ANTLR3_INT8, *pANTLR3_INT8; 180typedef int16_t ANTLR3_INT16, *pANTLR3_INT16; 181typedef int32_t ANTLR3_INT32, *pANTLR3_INT32; 182typedef int64_t ANTLR3_INT64, *pANTLR3_INT64; 183 184typedef uint8_t ANTLR3_UINT8, *pANTLR3_UINT8; 185typedef uint16_t ANTLR3_UINT16, *pANTLR3_UINT16; 186typedef uint32_t ANTLR3_UINT32, *pANTLR3_UINT32; 187typedef uint64_t ANTLR3_UINT64, *pANTLR3_UINT64; 188typedef uint64_t ANTLR3_BITWORD, *pANTLR3_BITWORD; 189 190typedef 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 200typedef FILE * ANTLR3_FDSC; 201typedef 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)) 207typedef ANTLR3_INT64 ANTLR3_MARKER; 208typedef 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) 213typedef ANTLR3_INT32 ANTLR3_MARKER; 214typedef ANTLR3_UINT32 ANTLR3_INTKEY; 215#endif 216 217#ifdef ANTLR3_WIN32 218#endif 219 220#ifdef ANTLR3_WIN64 221#endif 222 223 224typedef int ANTLR3_SALENT; // Type used for size of accept structure 225typedef struct sockaddr_in ANTLR3_SOCKADDRT, * pANTLR3_SOCKADDRT; // Type used for socket address declaration 226typedef 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// 353typedef 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 389extern "C" { 390#endif 391 392/* Inherit type definitions for autoconf 393 */ 394typedef int32_t ANTLR3_CHAR, *pANTLR3_CHAR; 395typedef uint32_t ANTLR3_UCHAR, *pANTLR3_UCHAR; 396 397typedef int8_t ANTLR3_INT8, *pANTLR3_INT8; 398typedef int16_t ANTLR3_INT16, *pANTLR3_INT16; 399typedef int32_t ANTLR3_INT32, *pANTLR3_INT32; 400typedef int64_t ANTLR3_INT64, *pANTLR3_INT64; 401 402typedef uint8_t ANTLR3_UINT8, *pANTLR3_UINT8; 403typedef uint16_t ANTLR3_UINT16, *pANTLR3_UINT16; 404typedef uint32_t ANTLR3_UINT32, *pANTLR3_UINT32; 405typedef uint64_t ANTLR3_UINT64, *pANTLR3_UINT64; 406typedef uint64_t ANTLR3_BITWORD, *pANTLR3_BITWORD; 407 408typedef uint32_t ANTLR3_BOOLEAN, *pANTLR3_BOOLEAN; 409 410#define ANTLR3_INLINE inline 411#define ANTLR3_API 412 413typedef FILE * ANTLR3_FDSC; 414typedef 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)) 420typedef ANTLR3_INT64 ANTLR3_MARKER; 421typedef 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) 426typedef ANTLR3_INT32 ANTLR3_MARKER; 427typedef 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 528extern "C" { 529#endif 530 531ANTLR3_API pANTLR3_INT_TRIE antlr3IntTrieNew (ANTLR3_UINT32 depth); 532 533ANTLR3_API pANTLR3_BITSET antlr3BitsetNew (ANTLR3_UINT32 numBits); 534ANTLR3_API pANTLR3_BITSET antlr3BitsetOf (ANTLR3_INT32 bit, ...); 535ANTLR3_API pANTLR3_BITSET antlr3BitsetList (pANTLR3_HASH_TABLE list); 536ANTLR3_API pANTLR3_BITSET antlr3BitsetCopy (pANTLR3_BITSET_LIST blist); 537ANTLR3_API pANTLR3_BITSET antlr3BitsetLoad (pANTLR3_BITSET_LIST blist); 538ANTLR3_API void antlr3BitsetSetAPI (pANTLR3_BITSET bitset); 539 540 541ANTLR3_API pANTLR3_BASE_RECOGNIZER antlr3BaseRecognizerNew (ANTLR3_UINT32 type, ANTLR3_UINT32 sizeHint, pANTLR3_RECOGNIZER_SHARED_STATE state); 542ANTLR3_API void antlr3RecognitionExceptionNew (pANTLR3_BASE_RECOGNIZER recognizer); 543ANTLR3_API void antlr3MTExceptionNew (pANTLR3_BASE_RECOGNIZER recognizer); 544ANTLR3_API void antlr3MTNExceptionNew (pANTLR3_BASE_RECOGNIZER recognizer); 545ANTLR3_API pANTLR3_HASH_TABLE antlr3HashTableNew (ANTLR3_UINT32 sizeHint); 546ANTLR3_API ANTLR3_UINT32 antlr3Hash (void * key, ANTLR3_UINT32 keylen); 547ANTLR3_API pANTLR3_HASH_ENUM antlr3EnumNew (pANTLR3_HASH_TABLE table); 548ANTLR3_API pANTLR3_LIST antlr3ListNew (ANTLR3_UINT32 sizeHint); 549ANTLR3_API pANTLR3_VECTOR_FACTORY antlr3VectorFactoryNew (ANTLR3_UINT32 sizeHint); 550ANTLR3_API pANTLR3_VECTOR antlr3VectorNew (ANTLR3_UINT32 sizeHint); 551ANTLR3_API pANTLR3_STACK antlr3StackNew (ANTLR3_UINT32 sizeHint); 552ANTLR3_API void antlr3SetVectorApi (pANTLR3_VECTOR vector, ANTLR3_UINT32 sizeHint); 553ANTLR3_API ANTLR3_UCHAR antlr3c8toAntlrc (ANTLR3_INT8 inc); 554ANTLR3_API pANTLR3_TOPO antlr3TopoNew(); 555 556ANTLR3_API pANTLR3_EXCEPTION antlr3ExceptionNew (ANTLR3_UINT32 exception, void * name, void * message, ANTLR3_BOOLEAN freeMessage); 557 558 559ANTLR3_API pANTLR3_INPUT_STREAM antlr3FileStreamNew (pANTLR3_UINT8 fileName, ANTLR3_UINT32 encoding); 560ANTLR3_API pANTLR3_INPUT_STREAM antlr3StringStreamNew (pANTLR3_UINT8 data, ANTLR3_UINT32 encoding, ANTLR3_UINT32 size, pANTLR3_UINT8 name); 561 562ANTLR3_API pANTLR3_INT_STREAM antlr3IntStreamNew (void); 563 564ANTLR3_API pANTLR3_STRING_FACTORY antlr3StringFactoryNew (ANTLR3_UINT32 encoding); 565 566ANTLR3_API pANTLR3_COMMON_TOKEN antlr3CommonTokenNew (ANTLR3_UINT32 ttype); 567ANTLR3_API pANTLR3_TOKEN_FACTORY antlr3TokenFactoryNew (pANTLR3_INPUT_STREAM input); 568ANTLR3_API void antlr3SetTokenAPI (pANTLR3_COMMON_TOKEN token); 569 570ANTLR3_API pANTLR3_LEXER antlr3LexerNewStream (ANTLR3_UINT32 sizeHint, pANTLR3_INPUT_STREAM input, pANTLR3_RECOGNIZER_SHARED_STATE state); 571ANTLR3_API pANTLR3_LEXER antlr3LexerNew (ANTLR3_UINT32 sizeHint, pANTLR3_RECOGNIZER_SHARED_STATE state); 572ANTLR3_API pANTLR3_PARSER antlr3ParserNewStreamDbg (ANTLR3_UINT32 sizeHint, pANTLR3_TOKEN_STREAM tstream, pANTLR3_DEBUG_EVENT_LISTENER dbg, pANTLR3_RECOGNIZER_SHARED_STATE state); 573ANTLR3_API pANTLR3_PARSER antlr3ParserNewStream (ANTLR3_UINT32 sizeHint, pANTLR3_TOKEN_STREAM tstream, pANTLR3_RECOGNIZER_SHARED_STATE state); 574ANTLR3_API pANTLR3_PARSER antlr3ParserNew (ANTLR3_UINT32 sizeHint, pANTLR3_RECOGNIZER_SHARED_STATE state); 575 576ANTLR3_API pANTLR3_COMMON_TOKEN_STREAM antlr3CommonTokenStreamSourceNew (ANTLR3_UINT32 hint, pANTLR3_TOKEN_SOURCE source); 577ANTLR3_API pANTLR3_COMMON_TOKEN_STREAM antlr3CommonTokenStreamNew (ANTLR3_UINT32 hint); 578ANTLR3_API pANTLR3_COMMON_TOKEN_STREAM antlr3CommonTokenDebugStreamSourceNew (ANTLR3_UINT32 hint, pANTLR3_TOKEN_SOURCE source, pANTLR3_DEBUG_EVENT_LISTENER debugger); 579 580ANTLR3_API pANTLR3_BASE_TREE_ADAPTOR ANTLR3_TREE_ADAPTORNew (pANTLR3_STRING_FACTORY strFactory); 581ANTLR3_API pANTLR3_BASE_TREE_ADAPTOR ANTLR3_TREE_ADAPTORDebugNew (pANTLR3_STRING_FACTORY strFactory, pANTLR3_DEBUG_EVENT_LISTENER debugger); 582ANTLR3_API pANTLR3_COMMON_TREE antlr3CommonTreeNew (void); 583ANTLR3_API pANTLR3_COMMON_TREE antlr3CommonTreeNewFromTree (pANTLR3_COMMON_TREE tree); 584ANTLR3_API pANTLR3_COMMON_TREE antlr3CommonTreeNewFromToken (pANTLR3_COMMON_TOKEN tree); 585ANTLR3_API pANTLR3_ARBORETUM antlr3ArboretumNew (pANTLR3_STRING_FACTORY factory); 586ANTLR3_API void antlr3SetCTAPI (pANTLR3_COMMON_TREE tree); 587ANTLR3_API pANTLR3_BASE_TREE antlr3BaseTreeNew (pANTLR3_BASE_TREE tree); 588 589ANTLR3_API void antlr3BaseTreeAdaptorInit (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_DEBUG_EVENT_LISTENER debugger); 590 591ANTLR3_API pANTLR3_TREE_PARSER antlr3TreeParserNewStream (ANTLR3_UINT32 sizeHint, pANTLR3_COMMON_TREE_NODE_STREAM ctnstream, pANTLR3_RECOGNIZER_SHARED_STATE state); 592 593ANTLR3_API ANTLR3_INT32 antlr3dfaspecialTransition (void * ctx, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_INT_STREAM is, pANTLR3_CYCLIC_DFA dfa, ANTLR3_INT32 s); 594ANTLR3_API ANTLR3_INT32 antlr3dfaspecialStateTransition (void * ctx, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_INT_STREAM is, pANTLR3_CYCLIC_DFA dfa, ANTLR3_INT32 s); 595ANTLR3_API ANTLR3_INT32 antlr3dfapredict (void * ctx, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_INT_STREAM is, pANTLR3_CYCLIC_DFA cdfa); 596 597ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM antlr3CommonTreeNodeStreamNewTree (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 hint); 598ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM antlr3CommonTreeNodeStreamNew (pANTLR3_STRING_FACTORY strFactory, ANTLR3_UINT32 hint); 599ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM antlr3UnbufTreeNodeStreamNewTree (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 hint); 600ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM antlr3UnbufTreeNodeStreamNew (pANTLR3_STRING_FACTORY strFactory, ANTLR3_UINT32 hint); 601ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM antlr3CommonTreeNodeStreamNewStream (pANTLR3_COMMON_TREE_NODE_STREAM inStream); 602ANTLR3_API pANTLR3_TREE_NODE_STREAM antlr3TreeNodeStreamNew (); 603ANTLR3_API void fillBufferExt (pANTLR3_COMMON_TOKEN_STREAM tokenStream); 604 605ANTLR3_API pANTLR3_REWRITE_RULE_TOKEN_STREAM 606 antlr3RewriteRuleTOKENStreamNewAE (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description); 607ANTLR3_API pANTLR3_REWRITE_RULE_TOKEN_STREAM 608 antlr3RewriteRuleTOKENStreamNewAEE (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, void * oneElement); 609ANTLR3_API pANTLR3_REWRITE_RULE_TOKEN_STREAM 610 antlr3RewriteRuleTOKENStreamNewAEV (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, pANTLR3_VECTOR vector); 611 612ANTLR3_API pANTLR3_REWRITE_RULE_NODE_STREAM 613 antlr3RewriteRuleNODEStreamNewAE (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description); 614ANTLR3_API pANTLR3_REWRITE_RULE_NODE_STREAM 615 antlr3RewriteRuleNODEStreamNewAEE (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, void * oneElement); 616ANTLR3_API pANTLR3_REWRITE_RULE_NODE_STREAM 617 antlr3RewriteRuleNODEStreamNewAEV (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, pANTLR3_VECTOR vector); 618 619ANTLR3_API pANTLR3_REWRITE_RULE_SUBTREE_STREAM 620 antlr3RewriteRuleSubtreeStreamNewAE (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description); 621ANTLR3_API pANTLR3_REWRITE_RULE_SUBTREE_STREAM 622 antlr3RewriteRuleSubtreeStreamNewAEE(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, void * oneElement); 623ANTLR3_API pANTLR3_REWRITE_RULE_SUBTREE_STREAM 624 antlr3RewriteRuleSubtreeStreamNewAEV(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, pANTLR3_VECTOR vector); 625 626ANTLR3_API pANTLR3_DEBUG_EVENT_LISTENER antlr3DebugListenerNew(); 627 628#ifdef __cplusplus 629} 630#endif 631 632#endif /* _ANTLR3DEFS_H */ 633