antlr3defs.h File Reference


Detailed Description

Basic type and constant definitions for ANTLR3 Runtime.

#include <antlr3errors.h>
#include <antlr3config.h>
#include <stdio.h>
#include <antlr3interfaces.h>
#include <antlr3convertutf.h>

Include dependency graph for antlr3defs.h:

This graph shows which files directly or indirectly include this file:


Defines

#define _stat   stat
#define ANTLR3_API
#define ANTLR3_API
#define ANTLR3_AVERAGE
#define ANTLR3_CALLOC(numEl, elSize)   calloc (numEl, (size_t)(elSize))
 Default definition of ANTLR3_CALLOC.
#define ANTLR3_CDECL
#define ANTLR3_CLOSESOCKET   close
#define ANTLR3_ENCODING_LATIN1   0
#define ANTLR3_ENCODING_UCS2   1
#define ANTLR3_ENCODING_UTF32   3
#define ANTLR3_ENCODING_UTF8   2
#define ANTLR3_FASTCALL
#define ANTLR3_FPRINTF   fprintf
 Default definition of fprintf, set this to something other than fprintf before including antlr3.h if your system does not have a fprintf.
#define ANTLR3_FREE(ptr)   free ((void *)(ptr))
 Default definition of ANTLR3_FREE.
#define ANTLR3_FREE_FUNC   free
 Default definition of ANTLR3_FREE_FUNC .
#define ANTLR3_FUNC_PTR(ptr)   (void *)((ANTLR3_UINT32)(ptr))
#define ANTLR3_INLINE   inline
#define ANTLR3_LIST_SIZE_HINT   63
#define ANTLR3_MALLOC(request)   malloc ((size_t)(request))
 Default definition of ANTLR3_MALLOC.
#define ANTLR3_MEMMOVE(target, source, size)   memcpy((void *)(target), (const void *)(source), (size_t)(size))
 Default definition of ANTLR3_MEMMOVE.
#define ANTLR3_MEMSET(target, byte, size)   memset((void *)(target), (int)(byte), (size_t)(size))
 Default definition of ANTLR3_MEMSET.
#define ANTLR3_PRINTF   printf
 Default definition of printf, set this to something other than printf before including antlr3.h if your system does not have a printf.
#define ANTLR3_REALLOC(current, request)   realloc ((void *)(current), (size_t)(request))
 Default definition of ANTLR3_REALLOC.
#define ANTLR3_SIZE_HINT   1025
#define ANTLR3_STRDUP(instr)   (pANTLR3_UINT8)(strdup ((const char *)(instr)))
 Default definition of ANTLR3_STRDUP.
#define ANTLR3_TRIE_DEPTH   31
#define ANTLR3_UINT32_CAST(ptr)   (ANTLR3_UINT32)(ptr)
#define ANTLR3_UINT64_CAST(ptr)   (ANTLR3_UINT64)((ANTLR3_UINT32)(ptr))
#define ANTLR3_UINT64_LIT(lit)   lit##ULL
#define INVALID_SOCKET   ((SOCKET)-1)

Typedefs

typedef uint64_t ANTLR3_BITWORD
typedef uint32_t ANTLR3_BOOLEAN
typedef int32_t ANTLR3_CHAR
typedef FILE * ANTLR3_FDSC
typedef struct stat ANTLR3_FSTAT_STRUCT
typedef int16_t ANTLR3_INT16
typedef int32_t ANTLR3_INT32
typedef int64_t ANTLR3_INT64
typedef int8_t ANTLR3_INT8
typedef ANTLR3_UINT32 ANTLR3_INTKEY
typedef ANTLR3_INT32 ANTLR3_MARKER
typedef size_t ANTLR3_SALENT
typedef struct sockaddr_in ANTLR3_SOCKADDRT
typedef uint32_t ANTLR3_UCHAR
typedef uint16_t ANTLR3_UINT16
typedef uint32_t ANTLR3_UINT32
typedef uint64_t ANTLR3_UINT64
typedef uint8_t ANTLR3_UINT8
typedef uint64_t * pANTLR3_BITWORD
typedef uint32_t * pANTLR3_BOOLEAN
typedef int32_t * pANTLR3_CHAR
typedef int16_t * pANTLR3_INT16
typedef int32_t * pANTLR3_INT32
typedef int64_t * pANTLR3_INT64
typedef int8_t * pANTLR3_INT8
typedef struct sockaddr * pANTLR3_SOCKADDRC
typedef struct sockaddr_in * pANTLR3_SOCKADDRT
typedef uint32_t * pANTLR3_UCHAR
typedef uint16_t * pANTLR3_UINT16
typedef uint32_t * pANTLR3_UINT32
typedef uint64_t * pANTLR3_UINT64
typedef uint8_t * pANTLR3_UINT8
typedef int SOCKET

Functions

ANTLR3_API
pANTLR3_BASE_TREE_ADAPTOR 
ANTLR3_TREE_ADAPTORDebugNew (pANTLR3_STRING_FACTORY strFactory, pANTLR3_DEBUG_EVENT_LISTENER debugger)
 Debugging version of the tree adaptor (not normally called as generated code calls setDebugEventListener instead which changes a normal token stream to a debugging stream and means that a user's instantiation code does not need to be changed just to debug with AW.
ANTLR3_API
pANTLR3_BASE_TREE_ADAPTOR 
ANTLR3_TREE_ADAPTORNew (pANTLR3_STRING_FACTORY strFactory)
 Create a new tree adaptor.
ANTLR3_API pANTLR3_ARBORETUM antlr3ArboretumNew (pANTLR3_STRING_FACTORY factory)
ANTLR3_API pANTLR3_INPUT_STREAM antlr3AsciiFileStreamNew (pANTLR3_UINT8 fileName)
 Use the contents of an operating system file as the input for an input stream.
ANTLR3_API pANTLR3_BASE_RECOGNIZER antlr3BaseRecognizerNew (ANTLR3_UINT32 type, ANTLR3_UINT32 sizeHint, pANTLR3_RECOGNIZER_SHARED_STATE state)
ANTLR3_API void antlr3BaseTreeAdaptorInit (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_DEBUG_EVENT_LISTENER debugger)
 Given a pointer to a base tree adaptor structure (which is usually embedded in the super class the implements the tree adaptor used in the parse), initialize its function pointers and so on.
ANTLR3_API pANTLR3_BASE_TREE antlr3BaseTreeNew (pANTLR3_BASE_TREE tree)
ANTLR3_API pANTLR3_BITSET antlr3BitsetCopy (pANTLR3_BITSET_LIST blist)
ANTLR3_API pANTLR3_BITSET antlr3BitsetList (pANTLR3_HASH_TABLE list)
ANTLR3_API pANTLR3_BITSET antlr3BitsetLoad (pANTLR3_BITSET_LIST blist)
 Creates a new bitset with at least one 64 bit bset of bits, but as many 64 bit sets as are required.
ANTLR3_API pANTLR3_BITSET antlr3BitsetNew (ANTLR3_UINT32 numBits)
ANTLR3_API pANTLR3_BITSET antlr3BitsetOf (ANTLR3_INT32 bit,...)
 Creates a new bitset with at least one element, but as many elements are required.
ANTLR3_API void antlr3BitsetSetAPI (pANTLR3_BITSET bitset)
ANTLR3_API ANTLR3_UCHAR antlr3c8toAntlrc (ANTLR3_INT8 inc)
 Provides basic utility functions to convert between the various Unicode character conversions.
ANTLR3_API
pANTLR3_COMMON_TOKEN_STREAM 
antlr3CommonTokenDebugStreamSourceNew (ANTLR3_UINT32 hint, pANTLR3_TOKEN_SOURCE source, pANTLR3_DEBUG_EVENT_LISTENER debugger)
ANTLR3_API pANTLR3_COMMON_TOKEN antlr3CommonTokenNew (ANTLR3_UINT32 ttype)
ANTLR3_API
pANTLR3_COMMON_TOKEN_STREAM 
antlr3CommonTokenStreamNew (ANTLR3_UINT32 hint)
ANTLR3_API
pANTLR3_COMMON_TOKEN_STREAM 
antlr3CommonTokenStreamSourceNew (ANTLR3_UINT32 hint, pANTLR3_TOKEN_SOURCE source)
ANTLR3_API pANTLR3_COMMON_TREE antlr3CommonTreeNew (void)
ANTLR3_API pANTLR3_COMMON_TREE antlr3CommonTreeNewFromToken (pANTLR3_COMMON_TOKEN tree)
ANTLR3_API pANTLR3_COMMON_TREE antlr3CommonTreeNewFromTree (pANTLR3_COMMON_TREE tree)
ANTLR3_API
pANTLR3_COMMON_TREE_NODE_STREAM 
antlr3CommonTreeNodeStreamNew (pANTLR3_STRING_FACTORY strFactory, ANTLR3_UINT32 hint)
ANTLR3_API
pANTLR3_COMMON_TREE_NODE_STREAM 
antlr3CommonTreeNodeStreamNewStream (pANTLR3_COMMON_TREE_NODE_STREAM inStream)
ANTLR3_API
pANTLR3_COMMON_TREE_NODE_STREAM 
antlr3CommonTreeNodeStreamNewTree (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 hint)
ANTLR3_API
pANTLR3_DEBUG_EVENT_LISTENER 
antlr3DebugListenerNew ()
 Create and initialize a new debug event listener that can be connected to by ANTLRWorks and any other debugger via a socket.
ANTLR3_API ANTLR3_INT32 antlr3dfapredict (void *ctx, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_INT_STREAM is, pANTLR3_CYCLIC_DFA cdfa)
 From the input stream, predict what alternative will succeed using this DFA (representing the covering regular approximation to the underlying CFL).
ANTLR3_API ANTLR3_INT32 antlr3dfaspecialStateTransition (void *ctx, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_INT_STREAM is, pANTLR3_CYCLIC_DFA dfa, ANTLR3_INT32 s)
 Default special state implementation.
ANTLR3_API ANTLR3_INT32 antlr3dfaspecialTransition (void *ctx, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_INT_STREAM is, pANTLR3_CYCLIC_DFA dfa, ANTLR3_INT32 s)
ANTLR3_API pANTLR3_HASH_ENUM antlr3EnumNew (pANTLR3_HASH_TABLE table)
 Creates an enumeration structure to traverse the hash table.
ANTLR3_API pANTLR3_EXCEPTION antlr3ExceptionNew (ANTLR3_UINT32 exception, void *name, void *message, ANTLR3_BOOLEAN freeMessage)
 Creates a new ANTLR3 exception structure.
ANTLR3_API ANTLR3_UINT32 antlr3Hash (void *key, ANTLR3_UINT32 keylen)
 Given an input key of arbitrary length, return a hash value of it.
ANTLR3_API pANTLR3_HASH_TABLE antlr3HashTableNew (ANTLR3_UINT32 sizeHint)
ANTLR3_API pANTLR3_INT_STREAM antlr3IntStreamNew (void)
ANTLR3_API pANTLR3_INT_TRIE antlr3IntTrieNew (ANTLR3_UINT32 depth)
ANTLR3_API pANTLR3_LEXER antlr3LexerNew (ANTLR3_UINT32 sizeHint, pANTLR3_RECOGNIZER_SHARED_STATE state)
ANTLR3_API pANTLR3_LEXER antlr3LexerNewStream (ANTLR3_UINT32 sizeHint, pANTLR3_INPUT_STREAM input, pANTLR3_RECOGNIZER_SHARED_STATE state)
ANTLR3_API pANTLR3_LIST antlr3ListNew (ANTLR3_UINT32 sizeHint)
ANTLR3_API void antlr3MTExceptionNew (pANTLR3_BASE_RECOGNIZER recognizer)
 Creates a new Mismatched Token Exception and inserts in the recognizer exception stack.
ANTLR3_API void antlr3MTNExceptionNew (pANTLR3_BASE_RECOGNIZER recognizer)
 Creates a new Mismatched Tree Nde Exception and inserts in the recognizer exception stack.
ANTLR3_API pANTLR3_INPUT_STREAM antlr3NewAsciiStringCopyStream (pANTLR3_UINT8 inString, ANTLR3_UINT32 size, pANTLR3_UINT8 name)
 Create an ASCII string stream as input to ANTLR 3, copying the input string.
ANTLR3_API pANTLR3_INPUT_STREAM antlr3NewAsciiStringInPlaceStream (pANTLR3_UINT8 inString, ANTLR3_UINT32 size, pANTLR3_UINT8 name)
 Create an in-place ASCII string stream as input to ANTLR 3.
ANTLR3_API pANTLR3_INPUT_STREAM antlr3NewUCS2StringInPlaceStream (pANTLR3_UINT16 inString, ANTLR3_UINT32 size, pANTLR3_UINT16 name)
 Create an in-place UCS2 string stream as input to ANTLR 3.
ANTLR3_API pANTLR3_PARSER antlr3ParserNew (ANTLR3_UINT32 sizeHint, pANTLR3_RECOGNIZER_SHARED_STATE state)
ANTLR3_API pANTLR3_PARSER antlr3ParserNewStream (ANTLR3_UINT32 sizeHint, pANTLR3_TOKEN_STREAM tstream, pANTLR3_RECOGNIZER_SHARED_STATE state)
ANTLR3_API pANTLR3_PARSER antlr3ParserNewStreamDbg (ANTLR3_UINT32 sizeHint, pANTLR3_TOKEN_STREAM tstream, pANTLR3_DEBUG_EVENT_LISTENER dbg, pANTLR3_RECOGNIZER_SHARED_STATE state)
ANTLR3_API void antlr3RecognitionExceptionNew (pANTLR3_BASE_RECOGNIZER recognizer)
ANTLR3_API
pANTLR3_REWRITE_RULE_NODE_STREAM 
antlr3RewriteRuleNODEStreamNewAE (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description)
ANTLR3_API
pANTLR3_REWRITE_RULE_NODE_STREAM 
antlr3RewriteRuleNODEStreamNewAEE (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, void *oneElement)
ANTLR3_API
pANTLR3_REWRITE_RULE_NODE_STREAM 
antlr3RewriteRuleNODEStreamNewAEV (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, pANTLR3_VECTOR vector)
ANTLR3_API
pANTLR3_REWRITE_RULE_SUBTREE_STREAM 
antlr3RewriteRuleSubtreeStreamNewAE (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description)
ANTLR3_API
pANTLR3_REWRITE_RULE_SUBTREE_STREAM 
antlr3RewriteRuleSubtreeStreamNewAEE (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, void *oneElement)
ANTLR3_API
pANTLR3_REWRITE_RULE_SUBTREE_STREAM 
antlr3RewriteRuleSubtreeStreamNewAEV (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, pANTLR3_VECTOR vector)
ANTLR3_API
pANTLR3_REWRITE_RULE_TOKEN_STREAM 
antlr3RewriteRuleTOKENStreamNewAE (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description)
ANTLR3_API
pANTLR3_REWRITE_RULE_TOKEN_STREAM 
antlr3RewriteRuleTOKENStreamNewAEE (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, void *oneElement)
ANTLR3_API
pANTLR3_REWRITE_RULE_TOKEN_STREAM 
antlr3RewriteRuleTOKENStreamNewAEV (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, pANTLR3_VECTOR vector)
ANTLR3_API void antlr3SetCTAPI (pANTLR3_COMMON_TREE tree)
ANTLR3_API void antlr3SetTokenAPI (pANTLR3_COMMON_TOKEN token)
ANTLR3_API pANTLR3_STACK antlr3StackNew (ANTLR3_UINT32 sizeHint)
ANTLR3_API pANTLR3_STRING_FACTORY antlr3StringFactoryNew (void)
ANTLR3_API pANTLR3_TOKEN_FACTORY antlr3TokenFactoryNew (pANTLR3_INPUT_STREAM input)
ANTLR3_API pANTLR3_TREE_NODE_STREAM antlr3TreeNodeStreamNew ()
ANTLR3_API pANTLR3_TREE_PARSER antlr3TreeParserNewStream (ANTLR3_UINT32 sizeHint, pANTLR3_COMMON_TREE_NODE_STREAM ctnstream, pANTLR3_RECOGNIZER_SHARED_STATE state)
ANTLR3_API pANTLR3_STRING_FACTORY antlr3UCS2StringFactoryNew (void)
 Create a string factory that is UCS2 (16 bit) encoding based.
ANTLR3_API
pANTLR3_COMMON_TREE_NODE_STREAM 
antlr3UnbufTreeNodeStreamNew (pANTLR3_STRING_FACTORY strFactory, ANTLR3_UINT32 hint)
ANTLR3_API
pANTLR3_COMMON_TREE_NODE_STREAM 
antlr3UnbufTreeNodeStreamNewTree (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 hint)
ANTLR3_API pANTLR3_VECTOR_FACTORY antlr3VectorFactoryNew (ANTLR3_UINT32 sizeHint)
 Vector factory creation.
ANTLR3_API pANTLR3_VECTOR antlr3VectorNew (ANTLR3_UINT32 sizeHint)

Define Documentation

#define _stat   stat

Referenced by antlr3Fsize().

#define ANTLR3_API

#define ANTLR3_API

#define ANTLR3_AVERAGE

#define ANTLR3_CALLOC ( numEl,
elSize   )     calloc (numEl, (size_t)(elSize))

#define ANTLR3_CDECL

Referenced by addChild(), newRaw16(), newRaw8(), and newVector().

#define ANTLR3_CLOSESOCKET   close

Referenced by handshake().

#define ANTLR3_ENCODING_LATIN1   0

Referenced by stringInit8().

#define ANTLR3_ENCODING_UCS2   1

Referenced by stringInit16().

#define ANTLR3_ENCODING_UTF32   3

#define ANTLR3_ENCODING_UTF8   2

#define ANTLR3_FASTCALL

#define ANTLR3_FPRINTF   fprintf

#define ANTLR3_FREE ( ptr   )     free ((void *)(ptr))

#define ANTLR3_FREE_FUNC   free

Default definition of ANTLR3_FREE_FUNC .

You can override this before including antlr3.h if you wish to use your own implementation.

Referenced by antlr3AsciiMark().

#define ANTLR3_FUNC_PTR ( ptr   )     (void *)((ANTLR3_UINT32)(ptr))

#define ANTLR3_INLINE   inline

#define ANTLR3_LIST_SIZE_HINT   63

#define ANTLR3_MALLOC ( request   )     malloc ((size_t)(request))

#define ANTLR3_MEMMOVE ( target,
source,
size   )     memcpy((void *)(target), (const void *)(source), (size_t)(size))

Default definition of ANTLR3_MEMMOVE.

You can override this before including antlr3.h if you wish to use your own implementation.

Referenced by antlr3BitsetClone(), antlr3BitsetCopy(), antlr3NewAsciiStringCopyStream(), antlr3VectorDel(), antrl3VectorRemove(), append16_16(), append8(), grow(), insert16_16(), insert16_8(), insert8(), newPoolToken(), newPoolTree(), newPtr16_16(), newPtr8(), set16_16(), and set8().

#define ANTLR3_MEMSET ( target,
byte,
size   )     memset((void *)(target), (int)(byte), (size_t)(size))

Default definition of ANTLR3_MEMSET.

You can override this before including antlr3.h if you wish to use your own implementation.

Referenced by antlr3VectorResize().

#define ANTLR3_PRINTF   printf

Default definition of printf, set this to something other than printf before including antlr3.h if your system does not have a printf.

Note that you can define this to be // without harming the runtime.

Referenced by ack().

#define ANTLR3_REALLOC ( current,
request   )     realloc ((void *)(current), (size_t)(request))

Default definition of ANTLR3_REALLOC.

You can override this before including antlr3.h if you wish to use your own implementation.

Referenced by addc16(), addc8(), antlr3VectorResize(), append16_16(), append16_8(), append8(), insert16_16(), insert16_8(), insert8(), newPool(), set16_16(), set16_8(), and set8().

#define ANTLR3_SIZE_HINT   1025

#define ANTLR3_STRDUP ( instr   )     (pANTLR3_UINT8)(strdup ((const char *)(instr)))

Default definition of ANTLR3_STRDUP.

You can override this before including antlr3.h if you wish to use your own implementation.

Referenced by antlr3HashPut().

#define ANTLR3_TRIE_DEPTH   31

#define ANTLR3_UINT32_CAST ( ptr   )     (ANTLR3_UINT32)(ptr)

#define ANTLR3_UINT64_CAST ( ptr   )     (ANTLR3_UINT64)((ANTLR3_UINT32)(ptr))

#define ANTLR3_UINT64_LIT ( lit   )     lit##ULL

#define INVALID_SOCKET   ((SOCKET)-1)

Referenced by handshake().


Typedef Documentation

typedef uint64_t ANTLR3_BITWORD

typedef uint32_t ANTLR3_BOOLEAN

typedef int32_t ANTLR3_CHAR

typedef FILE* ANTLR3_FDSC

typedef struct stat ANTLR3_FSTAT_STRUCT

typedef int16_t ANTLR3_INT16

typedef int32_t ANTLR3_INT32

typedef int64_t ANTLR3_INT64

typedef int8_t ANTLR3_INT8

typedef size_t ANTLR3_SALENT

typedef struct sockaddr_in ANTLR3_SOCKADDRT

typedef uint32_t ANTLR3_UCHAR

typedef uint16_t ANTLR3_UINT16

typedef uint32_t ANTLR3_UINT32

typedef uint64_t ANTLR3_UINT64

typedef uint8_t ANTLR3_UINT8

typedef uint64_t * pANTLR3_BITWORD

typedef uint32_t * pANTLR3_BOOLEAN

typedef int32_t * pANTLR3_CHAR

typedef int16_t * pANTLR3_INT16

typedef int32_t * pANTLR3_INT32

typedef int64_t * pANTLR3_INT64

typedef int8_t * pANTLR3_INT8

typedef struct sockaddr* pANTLR3_SOCKADDRC

typedef struct sockaddr_in * pANTLR3_SOCKADDRT

typedef uint32_t * pANTLR3_UCHAR

typedef uint16_t * pANTLR3_UINT16

typedef uint32_t * pANTLR3_UINT32

typedef uint64_t * pANTLR3_UINT64

typedef uint8_t * pANTLR3_UINT8

typedef int SOCKET


Function Documentation

ANTLR3_API pANTLR3_BASE_TREE_ADAPTOR ANTLR3_TREE_ADAPTORDebugNew ( pANTLR3_STRING_FACTORY  strFactory,
pANTLR3_DEBUG_EVENT_LISTENER  debugger 
)

Debugging version of the tree adaptor (not normally called as generated code calls setDebugEventListener instead which changes a normal token stream to a debugging stream and means that a user's instantiation code does not need to be changed just to debug with AW.

References ANTLR3_TREE_ADAPTORNew(), antlr3BaseTreeAdaptorInit(), ANTLR3_BASE_TREE_ADAPTOR_struct::create, dbgCreate(), dbgSetTokenBoundaries(), and ANTLR3_BASE_TREE_ADAPTOR_struct::setTokenBoundaries.

Here is the call graph for this function:

ANTLR3_API pANTLR3_BASE_TREE_ADAPTOR ANTLR3_TREE_ADAPTORNew ( pANTLR3_STRING_FACTORY  strFactory  ) 

Create a new tree adaptor.

Note that despite the fact that this is creating a new COMMON_TREE adaptor, we return the address of the BASE_TREE interface, as should any other adaptor that wishes to be used as the tree element of a tree parse/build. It needs to be given the address of a valid string factory as we do not know what the originating input stream encoding type was. This way we can rely on just using the original input stream's string factory or one of the correct type which the user supplies us.

References ANTLR3_MALLOC, antlr3ArboretumNew(), antlr3BaseTreeAdaptorInit(), antlr3TokenFactoryNew(), ANTLR3_COMMON_TREE_ADAPTOR_struct::arboretum, ANTLR3_COMMON_TREE_ADAPTOR_struct::baseAdaptor, create(), ANTLR3_BASE_TREE_ADAPTOR_struct::create, createToken(), ANTLR3_BASE_TREE_ADAPTOR_struct::createToken, createTokenFromToken(), ANTLR3_BASE_TREE_ADAPTOR_struct::createTokenFromToken, ctaFree(), deleteChild(), ANTLR3_BASE_TREE_ADAPTOR_struct::deleteChild, dupN