#include <antlr3errors.h>
#include <antlr3config.h>
#include <stdio.h>
#include <antlr3interfaces.h>
#include <antlr3convertutf.h>
Defines | |
#define | _stat stat |
#define | ANTLR3_API |
#define | ANTLR3_API |
#define | ANTLR3_AVERAGE |
#define | ANTLR3_BE 1 |
Indicates Big Endian for encodings where this makes sense. | |
#define | ANTLR3_CALLOC(numEl, elSize) calloc (numEl, (size_t)(elSize)) |
Default definition of ANTLR3_CALLOC. | |
#define | ANTLR3_CDECL |
#define | ANTLR3_CLOSESOCKET close |
#define | ANTLR3_ENC_8BIT 4 |
General latin-1 or other 8 bit encoding scheme such as straight ASCII. | |
#define | ANTLR3_ENC_EBCDIC 64 |
Input is 8 bit EBCDIC (which we convert to 8 bit ASCII on the fly. | |
#define | ANTLR3_ENC_UTF16 16 |
UTF-16 encoding scheme (which also covers UCS2 as that does not have surrogates). | |
#define | ANTLR3_ENC_UTF16BE 16 + ANTLR3_BE |
#define | ANTLR3_ENC_UTF16LE 16 + ANTLR3_LE |
#define | ANTLR3_ENC_UTF32 32 |
UTF-32 encoding scheme (basically straight 32 bit). | |
#define | ANTLR3_ENC_UTF32BE 32 + ANTLR3_BE |
#define | ANTLR3_ENC_UTF32LE 32 + ANTLR3_LE |
#define | ANTLR3_ENC_UTF8 8 |
UTF-8 encoding scheme. | |
#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_LE 2 |
Indicates Little Endian for encoidngs where this makes sense. | |
#define | ANTLR3_LIST_SIZE_HINT 63 |
#define | ANTLR3_MALLOC(request) malloc ((size_t)(request)) |
Default definition of ANTLR3_MALLOC. | |
#define | ANTLR3_MEMCPY(target, source, size) memcpy((void *)(target), (const void *)(source), (size_t)(size)) |
Default definition of ANTLR3_MEMCPY. | |
#define | ANTLR3_MEMMOVE(target, source, size) memmove((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_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 pANTLR3_INPUT_STREAM | antlr3FileStreamNew (pANTLR3_UINT8 fileName, ANTLR3_UINT32 encoding) |
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_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 void | antlr3SetVectorApi (pANTLR3_VECTOR vector, ANTLR3_UINT32 sizeHint) |
ANTLR3_API pANTLR3_STACK | antlr3StackNew (ANTLR3_UINT32 sizeHint) |
ANTLR3_API pANTLR3_STRING_FACTORY | antlr3StringFactoryNew (ANTLR3_UINT32 encoding) |
ANTLR3_API pANTLR3_INPUT_STREAM | antlr3StringStreamNew (pANTLR3_UINT8 data, ANTLR3_UINT32 encoding, ANTLR3_UINT32 size, pANTLR3_UINT8 name) |
ANTLR3_API pANTLR3_TOKEN_FACTORY | antlr3TokenFactoryNew (pANTLR3_INPUT_STREAM input) |
ANTLR3_API pANTLR3_TOPO | antlr3TopoNew () |
Allocate and initialize a new ANTLR3 topological sorter, which can be used to define edges that identify numerical node indexes that depend on other numerical node indexes, which can then be sorted topologically such that any node is sorted after all its dependent nodes. | |
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_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) |
ANTLR3_API void | fillBufferExt (pANTLR3_COMMON_TOKEN_STREAM tokenStream) |
#define _stat stat |
Referenced by antlr3Fsize().
#define ANTLR3_API |
#define ANTLR3_API |
#define ANTLR3_AVERAGE |
#define ANTLR3_BE 1 |
Indicates Big Endian for encodings where this makes sense.
#define ANTLR3_CALLOC | ( | numEl, | |||
elSize | ) | calloc (numEl, (size_t)(elSize)) |
Default definition of ANTLR3_CALLOC.
You can override this before including antlr3.h if you wish to use your own implementation.
Referenced by addEdge(), antlr3BaseRecognizerNew(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), antlr3CreateFileStream(), antlr3CreateStringStream(), antlr3DebugListenerNew(), antlr3ExceptionNew(), antlr3IntStreamNew(), antlr3IntTrieNew(), antlr3TreeNodeStreamNew(), grow(), intTrieAdd(), newPool(), and newToken().
#define ANTLR3_CDECL |
Referenced by addChild(), antlr3VectorSwap(), newRaw8(), and newRawUTF16().
#define ANTLR3_CLOSESOCKET close |
Referenced by handshake().
#define ANTLR3_ENC_8BIT 4 |
General latin-1 or other 8 bit encoding scheme such as straight ASCII.
Referenced by antlr3StringFactoryNew(), setupInputStream(), stringInit8(), and stringInitUTF16().
#define ANTLR3_ENC_EBCDIC 64 |
Input is 8 bit EBCDIC (which we convert to 8 bit ASCII on the fly.
Referenced by antlr3StringFactoryNew(), and setupInputStream().
#define ANTLR3_ENC_UTF16 16 |
UTF-16 encoding scheme (which also covers UCS2 as that does not have surrogates).
Referenced by antlr3StringFactoryNew(), and setupInputStream().
#define ANTLR3_ENC_UTF16BE 16 + ANTLR3_BE |
Referenced by antlr3StringFactoryNew(), and setupInputStream().
#define ANTLR3_ENC_UTF16LE 16 + ANTLR3_LE |
Referenced by antlr3StringFactoryNew(), and setupInputStream().
#define ANTLR3_ENC_UTF32 32 |
UTF-32 encoding scheme (basically straight 32 bit).
Referenced by antlr3StringFactoryNew(), and setupInputStream().
#define ANTLR3_ENC_UTF32BE 32 + ANTLR3_BE |
Referenced by antlr3StringFactoryNew(), and setupInputStream().
#define ANTLR3_ENC_UTF32LE 32 + ANTLR3_LE |
Referenced by antlr3StringFactoryNew(), and setupInputStream().
#define ANTLR3_ENC_UTF8 8 |
#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.
Note that you can define this to be //
without harming the runtime.
Referenced by addChild(), alreadyParsedRule(), antlr3ExceptionPrint(), antlr3RecognitionExceptionNew(), becomeRoot(), consumeUntil(), consumeUntilSet(), ConvertUTF16toUTF32(), displayRecognitionError(), dupTok(), dupTreeNode(), getChild(), getChildCount(), getText(), match(), matchAny(), memoize(), mismatch(), mTokens(), recover(), recoverFromMismatchedElement(), recoverFromMismatchedSet(), recoverFromMismatchedToken(), replaceChildren(), setText(), setText8(), setType(), and synpred().
#define ANTLR3_FREE | ( | ptr | ) | free ((void *)(ptr)) |
Default definition of ANTLR3_FREE.
You can override this before including antlr3.h if you wish to use your own implementation.
Referenced by antlr3BaseRecognizerNew(), antlr3BitsetCopy(), antlr3BitsetFree(), antlr3BitsetNew(), antlr3CommonTreeNodeStreamFree(), antlr3CTSFree(), antlr3EnumFree(), antlr3ExceptionFree(), antlr3HashDelete(), antlr3HashDeleteI(), antlr3HashFree(), antlr3HashRemove(), antlr3HashTableNew(), antlr3InputClose(), antlr3IntTrieNew(), antlr3ListFree(), antlr3SetVectorApi(), antlr3StackFree(), antlr3StringFactoryNew(), antlr3TokenStreamFree(), antlr3TreeNodeStreamFree(), antlr3VectorFree(), closeFactory(), closeVectorFactory(), ctaFree(), expungeRS(), factoryClose(), freeBR(), freeIntNode(), freeLexer(), freeParser(), freeStream(), freeTopo(), grow(), intTrieFree(), replaceChildren(), sortVector(), stringFree(), and toUTF8_UTF16().
#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 antlr38BitMark().
#define ANTLR3_FUNC_PTR | ( | ptr | ) | (void *)((ANTLR3_UINT32)(ptr)) |
#define ANTLR3_INLINE inline |
#define ANTLR3_LE 2 |
Indicates Little Endian for encoidngs where this makes sense.
#define ANTLR3_LIST_SIZE_HINT 63 |
#define ANTLR3_MALLOC | ( | request | ) | malloc ((size_t)(request)) |
Default definition of ANTLR3_MALLOC.
You can override this before including antlr3.h if you wish to use your own implementation.
Referenced by antlr38BitMark(), ANTLR3_TREE_ADAPTORNew(), antlr3ArboretumNew(), antlr3BaseRecognizerNew(), antlr3BitsetCopy(), antlr3BitsetNew(), antlr3BitsetToIntList(), antlr3CommonTokenStreamNew(), antlr3CommonTreeNew(), antlr3EnumNew(), antlr3HashPut(), antlr3HashPutI(), antlr3HashTableNew(), antlr3LexerNew(), antlr3ListNew(), antlr3ParserNew(), antlr3read8Bit(), antlr3RewriteRuleElementStreamNewAE(), antlr3SetVectorApi(), antlr3StackNew(), antlr3StringFactoryNew(), antlr3TokenFactoryNew(), antlr3TokenStreamNew(), antlr3TopoNew(), antlr3TreeParserNewStream(), antlr3VectorFactoryNew(), antlr3VectorNew(), antlr3VectorResize(), newPool(), newRaw8(), newRawUTF16(), newSize8(), newSizeUTF16(), sortToArray(), sortVector(), to8_UTF16(), and toUTF8_UTF16().
#define ANTLR3_MEMCPY | ( | target, | |||
source, | |||||
size | ) | memcpy((void *)(target), (const void *)(source), (size_t)(size)) |
Default definition of ANTLR3_MEMCPY.
You can override this before including antlr3.h if you wish to use your own implementation.
Referenced by antlr3BitsetClone(), antlr3BitsetCopy(), antlr3VectorResize(), and grow().
#define ANTLR3_MEMMOVE | ( | target, | |||
source, | |||||
size | ) | memmove((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 antlr3VectorDel(), antrl3VectorRemove(), append8(), appendUTF16_UTF16(), insert8(), insertUTF16_8(), insertUTF16_UTF16(), newPtr8(), newPtrUTF16_UTF16(), set8(), and setUTF16_UTF16().
#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.
#define ANTLR3_PRINTF printf |
#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 addc8(), addcUTF16(), addEdge(), antlr3VectorResize(), append8(), appendUTF16_8(), appendUTF16_UTF16(), insert8(), insertUTF16_8(), insertUTF16_UTF16(), newPool(), set8(), setUTF16_8(), and setUTF16_UTF16().
#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) |
Referenced by antlr3UTF16Substr(), antlr3UTF32Substr(), displayRecognitionError(), getUniqueID(), and toUTF8_UTF16().
#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 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 |
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.
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, dupNode(), ANTLR3_BASE_TREE_ADAPTOR_struct::dupNode, errorNode(), ANTLR3_BASE_TREE_ADAPTOR_struct::errorNode, ANTLR3_BASE_TREE_ADAPTOR_struct::free, getChild(), ANTLR3_BASE_TREE_ADAPTOR_struct::getChild, getChildCount(), ANTLR3_BASE_TREE_ADAPTOR_struct::getChildCount, getChildIndex(), ANTLR3_BASE_TREE_ADAPTOR_struct::getChildIndex, getParent(), ANTLR3_BASE_TREE_ADAPTOR_struct::getParent, getText(), ANTLR3_BASE_TREE_ADAPTOR_struct::getText, getTokenStartIndex(), ANTLR3_BASE_TREE_ADAPTOR_struct::getTokenStartIndex, getTokenStopIndex(), ANTLR3_BASE_TREE_ADAPTOR_struct::getTokenStopIndex, getType(), ANTLR3_BASE_TREE_ADAPTOR_struct::getType, replaceChildren(), ANTLR3_BASE_TREE_ADAPTOR_struct::replaceChildren, setChild(), ANTLR3_BASE_TREE_ADAPTOR_struct::setChild, setChildIndex(), ANTLR3_BASE_TREE_ADAPTOR_struct::setChildIndex, setDebugEventListener(), ANTLR3_BASE_TREE_ADAPTOR_struct::setDebugEventListener, setParent(), ANTLR3_BASE_TREE_ADAPTOR_struct::setParent, setTokenBoundaries(), ANTLR3_BASE_TREE_ADAPTOR_struct::setTokenBoundaries, ANTLR3_BASE_TREE_ADAPTOR_struct::strFactory, ANTLR3_COMMON_TOKEN_struct::strFactory, ANTLR3_BASE_TREE_ADAPTOR_struct::super, ANTLR3_BASE_TREE_ADAPTOR_struct::tokenFactory, and ANTLR3_TOKEN_FACTORY_struct::unTruc.
Referenced by ANTLR3_TREE_ADAPTORDebugNew(), and antlr3CommonTreeNodeStreamNew().
ANTLR3_API pANTLR3_ARBORETUM antlr3ArboretumNew | ( | pANTLR3_STRING_FACTORY | factory | ) |
References ANTLR3_MALLOC, antlr3SetCTAPI(), antlr3StackNew(), antlr3VectorFactoryNew(), ANTLR3_COMMON_TREE_struct::baseTree, ANTLR3_ARBORETUM_struct::close, ANTLR3_COMMON_TREE_struct::factory, factoryClose(), ANTLR3_TREE_PARSER_struct::free, newFromToken(), ANTLR3_ARBORETUM_struct::newFromToken, newFromTree(), ANTLR3_ARBORETUM_struct::newFromTree, newPool(), newPoolTree(), ANTLR3_ARBORETUM_struct::newTree, ANTLR3_ARBORETUM_struct::nilStack, ANTLR3_ARBORETUM_struct::pools, ANTLR3_BASE_TREE_struct::strFactory, ANTLR3_ARBORETUM_struct::thisPool, ANTLR3_ARBORETUM_struct::unTruc, and ANTLR3_ARBORETUM_struct::vFactory.
Referenced by ANTLR3_TREE_ADAPTORNew().
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.
References ANTLR3_DEBUG_EVENT_LISTENER_struct::adaptor, addChild(), ANTLR3_BASE_TREE_ADAPTOR_struct::addChild, addChildToken(), ANTLR3_BASE_TREE_ADAPTOR_struct::addChildToken, becomeRoot(), ANTLR3_BASE_TREE_ADAPTOR_struct::becomeRoot, becomeRootToken(), ANTLR3_BASE_TREE_ADAPTOR_struct::becomeRootToken, createTypeText(), ANTLR3_BASE_TREE_ADAPTOR_struct::createTypeText, createTypeToken(), ANTLR3_BASE_TREE_ADAPTOR_struct::createTypeToken, createTypeTokenText(), ANTLR3_BASE_TREE_ADAPTOR_struct::createTypeTokenText, dbgAddChild(), dbgAddChildToken(), dbgBecomeRoot(), dbgBecomeRootToken(), dbgCreateTypeText(), dbgCreateTypeToken(), dbgCreateTypeTokenText(), dbgDupTree(), dbgNil(), dupTree(), ANTLR3_BASE_TREE_ADAPTOR_struct::dupTree, dupTreeTT(), ANTLR3_BASE_TREE_ADAPTOR_struct::dupTreeTT, getChild(), ANTLR3_BASE_TREE_ADAPTOR_struct::getChild, getChildCount(), ANTLR3_BASE_TREE_ADAPTOR_struct::getChildCount, getText(), ANTLR3_BASE_TREE_ADAPTOR_struct::getText, getType(), ANTLR3_BASE_TREE_ADAPTOR_struct::getType, getUniqueID(), ANTLR3_BASE_TREE_ADAPTOR_struct::getUniqueID, isNilNode(), ANTLR3_BASE_TREE_ADAPTOR_struct::isNilNode, makeDot(), ANTLR3_BASE_TREE_ADAPTOR_struct::makeDot, nilNode(), ANTLR3_BASE_TREE_ADAPTOR_struct::nilNode, rulePostProcessing(), ANTLR3_BASE_TREE_ADAPTOR_struct::rulePostProcessing, setText(), ANTLR3_BASE_TREE_ADAPTOR_struct::setText, setText8(), ANTLR3_BASE_TREE_ADAPTOR_struct::setText8, setType(), and ANTLR3_BASE_TREE_ADAPTOR_struct::setType.
Referenced by ANTLR3_TREE_ADAPTORDebugNew(), ANTLR3_TREE_ADAPTORNew(), and setDebugEventListener().
ANTLR3_API pANTLR3_BASE_TREE antlr3BaseTreeNew | ( | pANTLR3_BASE_TREE | tree | ) |
References addChild(), ANTLR3_BASE_TREE_struct::addChild, addChildren(), ANTLR3_BASE_TREE_struct::addChildren, ANTLR3_BASE_TREE_struct::children, deleteChild(), ANTLR3_BASE_TREE_struct::deleteChild, dupTree(), ANTLR3_BASE_TREE_struct::dupTree, freshenPACIndexes(), ANTLR3_BASE_TREE_struct::freshenPACIndexes, freshenPACIndexesAll(), ANTLR3_BASE_TREE_struct::freshenPACIndexesAll, getCharPositionInLine(), ANTLR3_BASE_TREE_struct::getCharPositionInLine, getChild(), ANTLR3_BASE_TREE_struct::getChild, getChildCount(), ANTLR3_BASE_TREE_struct::getChildCount, getFirstChildWithType(), ANTLR3_BASE_TREE_struct::getFirstChildWithType, getLine(), ANTLR3_BASE_TREE_struct::getLine, replaceChildren(), ANTLR3_BASE_TREE_struct::replaceChildren, setChild(), ANTLR3_BASE_TREE_struct::setChild, ANTLR3_BASE_TREE_struct::strFactory, toStringTree(), and ANTLR3_BASE_TREE_struct::toStringTree.
Referenced by antlr3SetCTAPI().
ANTLR3_API pANTLR3_BITSET antlr3BitsetCopy | ( | pANTLR3_BITSET_LIST | blist | ) |
ANTLR3_API pANTLR3_BITSET antlr3BitsetList | ( | pANTLR3_HASH_TABLE | list | ) |
References ANTLR3_BITSET_struct::add, ANTLR3_SUCCESS, antlr3BitsetNew(), antlr3EnumNew(), ANTLR3_HASH_ENUM_struct::free, and ANTLR3_HASH_ENUM_struct::next.
Referenced by getTokensList().
ANTLR3_API pANTLR3_BITSET antlr3BitsetLoad | ( | pANTLR3_BITSET_LIST | inBits | ) |
Creates a new bitset with at least one 64 bit bset of bits, but as many 64 bit sets as are required.
[in] | bset | A variable number of bits to add to the set, ending in -1 (impossible bit). |
References antlr3BitsetNew(), ANTLR3_BITSET_LIST_struct::bits, ANTLR3_BITSET_struct::blist, ANTLR3_BITSET_struct::grow, and ANTLR3_BITSET_LIST_struct::length.
Referenced by combineFollows(), displayRecognitionError(), mismatchIsMissingToken(), and recoverFromMismatchedElement().
ANTLR3_API pANTLR3_BITSET antlr3BitsetNew | ( | ANTLR3_UINT32 | numBits | ) |
References ANTLR3_BITSET_BITS, ANTLR3_BITSET_LOG_BITS, ANTLR3_FREE, ANTLR3_MALLOC, antlr3BitsetSetAPI(), ANTLR3_BITSET_LIST_struct::bits, ANTLR3_BITSET_struct::blist, and ANTLR3_BITSET_LIST_struct::length.
Referenced by addEdge(), antlr3BitsetClone(), antlr3BitsetList(), antlr3BitsetLoad(), antlr3BitsetOf(), combineFollows(), and sortToArray().
ANTLR3_API pANTLR3_BITSET antlr3BitsetOf | ( | ANTLR3_INT32 | bit, | |
... | ||||
) |
Creates a new bitset with at least one element, but as many elements are required.
[in] | bit | A variable number of bits to add to the set, ending in -1 (impossible bit). |
References antlr3BitsetAdd(), and antlr3BitsetNew().
Referenced by getTokensType().
ANTLR3_API void antlr3BitsetSetAPI | ( | pANTLR3_BITSET | bitset | ) |
References ANTLR3_BITSET_struct::add, antlr3BitsetAdd(), antlr3BitsetClone(), antlr3BitsetEquals(), antlr3BitsetFree(), antlr3BitsetIsNil(), antlr3BitsetMember(), antlr3BitsetNumBits(), antlr3BitsetOR(), antlr3BitsetORInPlace(), antlr3BitsetRemove(), antlr3BitsetSize(), antlr3BitsetToIntList(), ANTLR3_BITSET_struct::bor, ANTLR3_BITSET_struct::borInPlace, ANTLR3_BITSET_struct::clone, ANTLR3_BITSET_struct::equals, ANTLR3_BITSET_struct::free, grow(), ANTLR3_BITSET_struct::grow, ANTLR3_BITSET_struct::isMember, ANTLR3_BITSET_struct::isNilNode, ANTLR3_BITSET_struct::numBits, ANTLR3_BITSET_struct::remove, ANTLR3_BITSET_struct::size, and ANTLR3_BITSET_struct::toIntList.
Referenced by antlr3BitsetNew().
ANTLR3_API ANTLR3_UCHAR antlr3c8toAntlrc | ( | ANTLR3_INT8 | inc | ) |
Provides basic utility functions to convert between the various Unicode character conversions.
There are of course various packages that could be used instead of these functions, but then the Antlr 3 C runtime would be dependant on the particular package. Using ICU for this is a good idea if your project is already dependant on it. Convert 8 bit character to ANTLR char form.
[in] | inc | Input character to transform from 8 bit form. |
ANTLR3_API pANTLR3_COMMON_TOKEN_STREAM antlr3CommonTokenDebugStreamSourceNew | ( | ANTLR3_UINT32 | hint, | |
pANTLR3_TOKEN_SOURCE | source, | |||
pANTLR3_DEBUG_EVENT_LISTENER | debugger | |||
) |
References ANTLR3_INT_STREAM_struct::_LA, ANTLR3_TOKEN_STREAM_struct::_LT, ANTLR3_FALSE, antlr3CommonTokenStreamSourceNew(), ANTLR3_INT_STREAM_struct::consume, dbgConsume(), dbgLA(), dbgMark(), dbgRewindLast(), dbgRewindStream(), dbgSeek(), dbgTokLT(), ANTLR3_TOKEN_STREAM_struct::debugger, ANTLR3_TOKEN_STREAM_struct::initialStreamState, ANTLR3_TOKEN_STREAM_struct::istream, ANTLR3_INT_STREAM_struct::mark, ANTLR3_INT_STREAM_struct::rewind, ANTLR3_INT_STREAM_struct::rewindLast, ANTLR3_INT_STREAM_struct::seek, and ANTLR3_COMMON_TOKEN_STREAM_struct::tstream.
ANTLR3_API pANTLR3_COMMON_TOKEN antlr3CommonTokenNew | ( | ANTLR3_UINT32 | ttype | ) |
References newToken(), and ANTLR3_COMMON_TOKEN_struct::setType.
Referenced by antlr3CommonTreeNodeStreamNew().
ANTLR3_API pANTLR3_COMMON_TOKEN_STREAM antlr3CommonTokenStreamNew | ( | ANTLR3_UINT32 | hint | ) |
References _LA(), ANTLR3_INT_STREAM_struct::_LA, ANTLR3_TOKEN_STREAM_struct::_LT, ANTLR3_MALLOC, ANTLR3_TOKENSTREAM, antlr3IntStreamNew(), antlr3TokenStreamNew(), antlr3VectorNew(), consume(), ANTLR3_INT_STREAM_struct::consume, discardOffChannel(), ANTLR3_COMMON_TOKEN_STREAM_struct::discardOffChannelToks, discardTokenType(), ANTLR3_COMMON_TOKEN_STREAM_struct::discardTokenType, ANTLR3_TOKEN_STREAM_struct::get, getSourceName(), ANTLR3_INT_STREAM_struct::getSourceName, getTokenRange(), ANTLR3_COMMON_TOKEN_STREAM_struct::getTokenRange, getTokens(), ANTLR3_COMMON_TOKEN_STREAM_struct::getTokens, getTokensList(), ANTLR3_COMMON_TOKEN_STREAM_struct::getTokensList, getTokenSource(), ANTLR3_TOKEN_STREAM_struct::getTokenSource, getTokensSet(), ANTLR3_COMMON_TOKEN_STREAM_struct::getTokensSet, getTokensType(), ANTLR3_COMMON_TOKEN_STREAM_struct::getTokensType, ANTLR3_INT_STREAM_struct::index, ANTLR3_TOKEN_STREAM_struct::istream, mark(), ANTLR3_INT_STREAM_struct::mark, ANTLR3_COMMON_TOKEN_STREAM_struct::p, release(), ANTLR3_INT_STREAM_struct::release, reset(), ANTLR3_COMMON_TOKEN_STREAM_struct::reset, ANTLR3_INT_STREAM_struct::rewind, rewindLast(), ANTLR3_INT_STREAM_struct::rewindLast, rewindStream(), seek(), ANTLR3_INT_STREAM_struct::seek, setDebugListener(), ANTLR3_TOKEN_STREAM_struct::setDebugListener, setTokenSource(), ANTLR3_TOKEN_STREAM_struct::setTokenSource, setTokenTypeChannel(), ANTLR3_COMMON_TOKEN_STREAM_struct::setTokenTypeChannel, size(), ANTLR3_INT_STREAM_struct::size, ANTLR3_INT_STREAM_struct::super, ANTLR3_TOKEN_STREAM_struct::super, tindex(), ANTLR3_COMMON_TOKEN_STREAM_struct::tokens, tokLT(), toString(), ANTLR3_TOKEN_STREAM_struct::toString, toStringSS(), ANTLR3_TOKEN_STREAM_struct::toStringSS, toStringTT(), ANTLR3_TOKEN_STREAM_struct::toStringTT, ANTLR3_COMMON_TOKEN_STREAM_struct::tstream, and ANTLR3_INT_STREAM_struct::type.
Referenced by antlr3CommonTokenStreamSourceNew().
ANTLR3_API pANTLR3_COMMON_TOKEN_STREAM antlr3CommonTokenStreamSourceNew | ( | ANTLR3_UINT32 | hint, | |
pANTLR3_TOKEN_SOURCE | source | |||
) |
References ANTLR3_FALSE, ANTLR3_TOKEN_DEFAULT_CHANNEL, antlr3CommonTokenStreamNew(), antlr3CTSFree(), ANTLR3_COMMON_TOKEN_STREAM_struct::channel, ANTLR3_COMMON_TOKEN_STREAM_struct::channelOverrides, ANTLR3_COMMON_TOKEN_STREAM_struct::discardOffChannel, ANTLR3_COMMON_TOKEN_STREAM_struct::discardSet, ANTLR3_COMMON_TOKEN_STREAM_struct::free, ANTLR3_TOKEN_STREAM_struct::setTokenSource, and ANTLR3_COMMON_TOKEN_STREAM_struct::tstream.
Referenced by antlr3CommonTokenDebugStreamSourceNew().
ANTLR3_API pANTLR3_COMMON_TREE antlr3CommonTreeNew | ( | void | ) |
References ANTLR3_MALLOC, and antlr3SetCTAPI().
Referenced by antlr3CommonTreeNewFromToken().
ANTLR3_API pANTLR3_COMMON_TREE antlr3CommonTreeNewFromToken | ( | pANTLR3_COMMON_TOKEN | tree | ) |
References antlr3CommonTreeNew(), and ANTLR3_COMMON_TREE_struct::token.
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 | |||
) |
References _LA(), ANTLR3_INT_STREAM_struct::_LA, _LT(), ANTLR3_TREE_NODE_STREAM_struct::_LT, ANTLR3_COMMON_TREE_NODE_STREAM_struct::adaptor, addNavigationNode(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::addNavigationNode, ANTLR3_CALLOC, ANTLR3_COMMONTREENODE, ANTLR3_FALSE, ANTLR3_TEXT_CHARP, ANTLR3_TOKEN_DOWN, ANTLR3_TOKEN_EOF, ANTLR3_TOKEN_INVALID, ANTLR3_TOKEN_UP, ANTLR3_TREE_ADAPTORNew(), antlr3CommonTokenNew(), antlr3CommonTreeNodeStreamFree(), antlr3IntStreamNew(), antlr3SetCTAPI(), antlr3StackNew(), antlr3TreeNodeStreamNew(), antlr3VectorNew(), ANTLR3_COMMON_TOKEN_struct::chars, consume(), ANTLR3_INT_STREAM_struct::consume, ANTLR3_TREE_NODE_STREAM_struct::ctns, DEFAULT_INITIAL_BUFFER_SIZE, ANTLR3_COMMON_TREE_NODE_STREAM_struct::DOWN, ANTLR3_COMMON_TREE_NODE_STREAM_struct::EOF_NODE, ANTLR3_TREE_NODE_STREAM_struct::free, ANTLR3_BASE_TREE_ADAPTOR_struct::free, ANTLR3_COMMON_TREE_NODE_STREAM_struct::free, ANTLR3_TREE_NODE_STREAM_struct::get, getTreeAdaptor(), ANTLR3_TREE_NODE_STREAM_struct::getTreeAdaptor, getTreeSource(), ANTLR3_TREE_NODE_STREAM_struct::getTreeSource, hasUniqueNavigationNodes(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::hasUniqueNavigationNodes, ANTLR3_INT_STREAM_struct::index, INITIAL_CALL_STACK_SIZE, ANTLR3_COMMON_TREE_NODE_STREAM_struct::INVALID_NODE, ANTLR3_TREE_NODE_STREAM_struct::istream, mark(), ANTLR3_INT_STREAM_struct::mark, ANTLR3_COMMON_TREE_NODE_STREAM_struct::markers, newDownNode(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::newDownNode, newUpNode(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::newUpNode, ANTLR3_COMMON_TREE_NODE_STREAM_struct::nodes, ANTLR3_COMMON_TREE_NODE_STREAM_struct::nodeStack, ANTLR3_COMMON_TREE_NODE_STREAM_struct::p, pop(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::pop, push(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::push, release(), ANTLR3_INT_STREAM_struct::release, reset(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::reset, ANTLR3_INT_STREAM_struct::rewind, rewindLast(), ANTLR3_INT_STREAM_struct::rewindLast, rewindMark(), seek(), ANTLR3_INT_STREAM_struct::seek, setUniqueNavigationNodes(), ANTLR3_TREE_NODE_STREAM_struct::setUniqueNavigationNodes, size(), ANTLR3_INT_STREAM_struct::size, ANTLR3_COMMON_TOKEN_struct::strFactory, ANTLR3_COMMON_TREE_NODE_STREAM_struct::stringFactory, ANTLR3_COMMON_TREE_NODE_STREAM_struct::super, ANTLR3_INT_STREAM_struct::super, ANTLR3_COMMON_TOKEN_struct::textState, tindex(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::tnstream, ANTLR3_COMMON_TREE_struct::token, ANTLR3_COMMON_TOKEN_struct::tokText, toString(), ANTLR3_TREE_NODE_STREAM_struct::toString, toStringSS(), ANTLR3_TREE_NODE_STREAM_struct::toStringSS, toStringWork(), ANTLR3_TREE_NODE_STREAM_struct::toStringWork, ANTLR3_INT_STREAM_struct::type, ANTLR3_COMMON_TREE_NODE_STREAM_struct::uniqueNavigationNodes, and ANTLR3_COMMON_TREE_NODE_STREAM_struct::UP.
Referenced by antlr3CommonTreeNodeStreamNewTree().
ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM antlr3CommonTreeNodeStreamNewStream | ( | pANTLR3_COMMON_TREE_NODE_STREAM | inStream | ) |
References _LA(), ANTLR3_INT_STREAM_struct::_LA, _LT(), ANTLR3_TREE_NODE_STREAM_struct::_LT, ANTLR3_COMMON_TREE_NODE_STREAM_struct::adaptor, addNavigationNode(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::addNavigationNode, ANTLR3_CALLOC, ANTLR3_COMMONTREENODE, ANTLR3_FALSE, ANTLR3_TRUE, antlr3CommonTreeNodeStreamFree(), antlr3IntStreamNew(), antlr3SetCTAPI(), antlr3TreeNodeStreamNew(), antlr3VectorNew(), consume(), ANTLR3_INT_STREAM_struct::consume, ANTLR3_TREE_NODE_STREAM_struct::ctns, DEFAULT_INITIAL_BUFFER_SIZE, ANTLR3_COMMON_TREE_NODE_STREAM_struct::DOWN, ANTLR3_COMMON_TREE_NODE_STREAM_struct::EOF_NODE, ANTLR3_TREE_NODE_STREAM_struct::free, ANTLR3_COMMON_TREE_NODE_STREAM_struct::free, ANTLR3_TREE_NODE_STREAM_struct::get, getLookaheadSize(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::getLookaheadSize, getTreeAdaptor(), ANTLR3_TREE_NODE_STREAM_struct::getTreeAdaptor, getTreeSource(), ANTLR3_TREE_NODE_STREAM_struct::getTreeSource, hasUniqueNavigationNodes(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::hasUniqueNavigationNodes, ANTLR3_INT_STREAM_struct::index, ANTLR3_COMMON_TREE_NODE_STREAM_struct::INVALID_NODE, ANTLR3_COMMON_TREE_NODE_STREAM_struct::isRewriter, ANTLR3_TREE_NODE_STREAM_struct::istream, mark(), ANTLR3_INT_STREAM_struct::mark, ANTLR3_COMMON_TREE_NODE_STREAM_struct::markers, newDownNode(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::newDownNode, newUpNode(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::newUpNode, ANTLR3_COMMON_TREE_NODE_STREAM_struct::nodes, ANTLR3_COMMON_TREE_NODE_STREAM_struct::nodeStack, ANTLR3_COMMON_TREE_NODE_STREAM_struct::p, pop(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::pop, push(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::push, release(), ANTLR3_INT_STREAM_struct::release, reset(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::reset, ANTLR3_INT_STREAM_struct::rewind, rewindLast(), ANTLR3_INT_STREAM_struct::rewindLast, rewindMark(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::root, seek(), ANTLR3_INT_STREAM_struct::seek, setUniqueNavigationNodes(), ANTLR3_TREE_NODE_STREAM_struct::setUniqueNavigationNodes, size(), ANTLR3_INT_STREAM_struct::size, ANTLR3_COMMON_TOKEN_struct::strFactory, ANTLR3_COMMON_TREE_NODE_STREAM_struct::stringFactory, ANTLR3_COMMON_TREE_NODE_STREAM_struct::super, ANTLR3_INT_STREAM_struct::super, tindex(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::tnstream, ANTLR3_COMMON_TREE_struct::token, toString(), ANTLR3_TREE_NODE_STREAM_struct::toString, toStringSS(), ANTLR3_TREE_NODE_STREAM_struct::toStringSS, toStringWork(), ANTLR3_TREE_NODE_STREAM_struct::toStringWork, ANTLR3_INT_STREAM_struct::type, ANTLR3_COMMON_TREE_NODE_STREAM_struct::uniqueNavigationNodes, and ANTLR3_COMMON_TREE_NODE_STREAM_struct::UP.
ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM antlr3CommonTreeNodeStreamNewTree | ( | pANTLR3_BASE_TREE | tree, | |
ANTLR3_UINT32 | hint | |||
) |
References antlr3CommonTreeNodeStreamNew(), ANTLR3_COMMON_TREE_NODE_STREAM_struct::root, and ANTLR3_BASE_TREE_struct::strFactory.
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.
References addChild(), ANTLR3_DEBUG_EVENT_LISTENER_struct::addChild, ANTLR3_CALLOC, becomeRoot(), ANTLR3_DEBUG_EVENT_LISTENER_struct::becomeRoot, beginBacktrack(), ANTLR3_DEBUG_EVENT_LISTENER_struct::beginBacktrack, beginResync(), ANTLR3_DEBUG_EVENT_LISTENER_struct::beginResync, commence(), ANTLR3_DEBUG_EVENT_LISTENER_struct::commence, consumeHiddenToken(), ANTLR3_DEBUG_EVENT_LISTENER_struct::consumeHiddenToken, consumeNode(), ANTLR3_DEBUG_EVENT_LISTENER_struct::consumeNode, consumeToken(), ANTLR3_DEBUG_EVENT_LISTENER_struct::consumeToken, createNode(), ANTLR3_DEBUG_EVENT_LISTENER_struct::createNode, createNodeTok(), ANTLR3_DEBUG_EVENT_LISTENER_struct::createNodeTok, DEFAULT_DEBUGGER_PORT, endBacktrack(), ANTLR3_DEBUG_EVENT_LISTENER_struct::endBacktrack, endResync(), ANTLR3_DEBUG_EVENT_LISTENER_struct::endResync, enterAlt(), ANTLR3_DEBUG_EVENT_LISTENER_struct::enterAlt, enterDecision(), ANTLR3_DEBUG_EVENT_LISTENER_struct::enterDecision, enterRule(), ANTLR3_DEBUG_EVENT_LISTENER_struct::enterRule, enterSubRule(), ANTLR3_DEBUG_EVENT_LISTENER_struct::enterSubRule, errorNode(), ANTLR3_DEBUG_EVENT_LISTENER_struct::errorNode, exitDecision(), ANTLR3_DEBUG_EVENT_LISTENER_struct::exitDecision, exitRule(), ANTLR3_DEBUG_EVENT_LISTENER_struct::exitRule, exitSubRule(), ANTLR3_DEBUG_EVENT_LISTENER_struct::exitSubRule, handshake(), ANTLR3_DEBUG_EVENT_LISTENER_struct::handshake, location(), ANTLR3_DEBUG_EVENT_LISTENER_struct::location, LT(), ANTLR3_DEBUG_EVENT_LISTENER_struct::LT, LTT(), ANTLR3_DEBUG_EVENT_LISTENER_struct::LTT, mark(), ANTLR3_DEBUG_EVENT_LISTENER_struct::mark, nilNode(), ANTLR3_DEBUG_EVENT_LISTENER_struct::nilNode, ANTLR3_DEBUG_EVENT_LISTENER_struct::port, ANTLR3_DEBUG_EVENT_LISTENER_struct::PROTOCOL_VERSION, recognitionException(), ANTLR3_DEBUG_EVENT_LISTENER_struct::recognitionException, ANTLR3_DEBUG_EVENT_LISTENER_struct::rewind, rewindLast(), ANTLR3_DEBUG_EVENT_LISTENER_struct::rewindLast, rewindMark(), semanticPredicate(), ANTLR3_DEBUG_EVENT_LISTENER_struct::semanticPredicate, setTokenBoundaries(), ANTLR3_DEBUG_EVENT_LISTENER_struct::setTokenBoundaries, terminate(), and ANTLR3_DEBUG_EVENT_LISTENER_struct::terminate.
Referenced by antlr3DebugListenerNewPort().
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).
Return an alternative number 1..n. Throw an exception upon error.
References ANTLR3_INT_STREAM_struct::_LA, ANTLR3_CYCLIC_DFA_struct::accept, ANTLR3_TOKEN_EOF, ANTLR3_TRUE, ANTLR3_INT_STREAM_struct::consume, ANTLR3_CYCLIC_DFA_struct::eof, ANTLR3_CYCLIC_DFA_struct::eot, ANTLR3_RECOGNIZER_SHARED_STATE_struct::error, ANTLR3_INT_STREAM_struct::mark, mark(), ANTLR3_CYCLIC_DFA_struct::min, noViableAlt(), ANTLR3_INT_STREAM_struct::rewind, ANTLR3_CYCLIC_DFA_struct::special, ANTLR3_CYCLIC_DFA_struct::specialStateTransition, ANTLR3_BASE_RECOGNIZER_struct::state, and ANTLR3_CYCLIC_DFA_struct::transition.
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.
table | Table to enumerate |
References ANTLR3_ERR_NOMEM, ANTLR3_FUNC_PTR, ANTLR3_MALLOC, antlr3EnumFree(), antlr3EnumNext(), antlr3EnumNextEntry(), ANTLR3_HASH_ENUM_struct::bucket, ANTLR3_HASH_TABLE_struct::buckets, ANTLR3_HASH_BUCKET_struct::entries, ANTLR3_HASH_ENUM_struct::entry, ANTLR3_HASH_ENUM_struct::free, ANTLR3_HASH_ENUM_struct::next, and ANTLR3_HASH_ENUM_struct::table.
Referenced by antlr3BitsetList().
ANTLR3_API pANTLR3_EXCEPTION antlr3ExceptionNew | ( | ANTLR3_UINT32 | exception, | |
void * | name, | |||
void * | message, | |||
ANTLR3_BOOLEAN | freeMessage | |||
) |
Creates a new ANTLR3 exception structure.
[in] | exception | One of the ANTLR3_xxx_EXCEPTION indicators such as ANTLR3_RECOGNITION_EXCEPTION |
[in] | message | Pointer to message string |
[in] | freeMessage | Set to ANTLR3_TRUE if the message parameter should be freed by a call to ANTLR3_FREE() when the exception is destroyed. |
References ANTLR3_CALLOC, antlr3ExceptionFree(), antlr3ExceptionPrint(), ANTLR3_EXCEPTION_struct::freeEx, ANTLR3_EXCEPTION_struct::freeMessage, ANTLR3_EXCEPTION_struct::message, ANTLR3_EXCEPTION_struct::name, ANTLR3_EXCEPTION_struct::print, and ANTLR3_EXCEPTION_struct::type.
Referenced by antlr3RecognitionExceptionNew().
ANTLR3_API pANTLR3_INPUT_STREAM antlr3FileStreamNew | ( | pANTLR3_UINT8 | fileName, | |
ANTLR3_UINT32 | encoding | |||
) |
References antlr3CreateFileStream(), ANTLR3_INPUT_STREAM_struct::encoding, ANTLR3_INPUT_STREAM_struct::fileName, ANTLR3_INPUT_STREAM_struct::istream, ANTLR3_STRING_FACTORY_struct::newStr8, setupInputStream(), ANTLR3_INT_STREAM_struct::streamName, and ANTLR3_INPUT_STREAM_struct::strFactory.
ANTLR3_API ANTLR3_UINT32 antlr3Hash | ( | void * | key, | |
ANTLR3_UINT32 | keylen | |||
) |
Given an input key of arbitrary length, return a hash value of it.
This can then be used (with suitable modulo) to index other structures.
Referenced by antlr3HashGet(), antlr3HashPut(), and antlr3HashRemove().
ANTLR3_API pANTLR3_HASH_TABLE antlr3HashTableNew | ( | ANTLR3_UINT32 | sizeHint | ) |
References ANTLR3_HASH_TABLE_struct::allowDups, ANTLR3_FALSE, ANTLR3_FREE, ANTLR3_MALLOC, ANTLR3_TRUE, antlr3HashDelete(), antlr3HashDeleteI(), antlr3HashFree(), antlr3HashGet(), antlr3HashGetI(), antlr3HashPut(), antlr3HashPutI(), antlr3HashRemove(), antlr3HashRemoveI(), antlr3HashSize(), ANTLR3_HASH_TABLE_struct::buckets, ANTLR3_HASH_TABLE_struct::count, ANTLR3_HASH_TABLE_struct::del, ANTLR3_HASH_TABLE_struct::delI, ANTLR3_HASH_TABLE_struct::doStrdup, ANTLR3_HASH_BUCKET_struct::entries, ANTLR3_HASH_TABLE_struct::free, ANTLR3_HASH_TABLE_struct::get, ANTLR3_HASH_TABLE_struct::getI, ANTLR3_HASH_TABLE_struct::modulo, ANTLR3_HASH_TABLE_struct::put, ANTLR3_HASH_TABLE_struct::putI, ANTLR3_HASH_TABLE_struct::remove, ANTLR3_HASH_TABLE_struct::removeI, and ANTLR3_HASH_TABLE_struct::size.
Referenced by antlr3ListNew().
ANTLR3_API pANTLR3_INT_TRIE antlr3IntTrieNew | ( | ANTLR3_UINT32 | depth | ) |
References ANTLR3_INT_TRIE_struct::add, ANTLR3_CALLOC, ANTLR3_ERR_NOMEM, ANTLR3_FREE, ANTLR3_FUNC_PTR, ANTLR3_INT_TRIE_NODE_struct::bitNum, ANTLR3_INT_TRIE_struct::count, ANTLR3_INT_TRIE_struct::del, ANTLR3_INT_TRIE_struct::free, ANTLR3_INT_TRIE_struct::get, intTrieAdd(), intTrieDel(), intTrieFree(), intTrieGet(), ANTLR3_INT_TRIE_NODE_struct::leftN, ANTLR3_INT_TRIE_NODE_struct::rightN, and ANTLR3_INT_TRIE_struct::root.
Referenced by getRuleMemoization(), and reset().
ANTLR3_API pANTLR3_LEXER antlr3LexerNew | ( | ANTLR3_UINT32 | sizeHint, | |
pANTLR3_RECOGNIZER_SHARED_STATE | state | |||
) |
References ANTLR3_MALLOC, ANTLR3_TOKEN_EOF, ANTLR3_TOKEN_INVALID, ANTLR3_TRUE, ANTLR3_TYPE_LEXER, antlr3BaseRecognizerNew(), antlr3SetTokenAPI(), displayRecognitionError(), ANTLR3_BASE_RECOGNIZER_struct::displayRecognitionError, emit(), ANTLR3_LEXER_struct::emit, emitNew(), ANTLR3_LEXER_struct::emitNew, ANTLR3_TOKEN_SOURCE_struct::eofToken, ANTLR3_COMMON_TOKEN_struct::factoryMade, ANTLR3_BASE_RECOGNIZER_struct::free, ANTLR3_LEXER_struct::free, freeLexer(), getCharIndex(), ANTLR3_LEXER_struct::getCharIndex, getCharPositionInLine(), ANTLR3_LEXER_struct::getCharPositionInLine, getCurrentInputSymbol(), ANTLR3_BASE_RECOGNIZER_struct::getCurrentInputSymbol, getLine(), ANTLR3_LEXER_struct::getLine, getMissingSymbol(), ANTLR3_BASE_RECOGNIZER_struct::getMissingSymbol, getText(), ANTLR3_LEXER_struct::getText, matchAny(), ANTLR3_LEXER_struct::matchAny, matchc(), ANTLR3_LEXER_struct::matchc, matchRange(), ANTLR3_LEXER_struct::matchRange, matchs(), ANTLR3_LEXER_struct::matchs, mTokens(), ANTLR3_LEXER_struct::mTokens, nextToken(), ANTLR3_TOKEN_SOURCE_struct::nextToken, popCharStream(), ANTLR3_LEXER_struct::popCharStream, pushCharStream(), ANTLR3_LEXER_struct::pushCharStream, ANTLR3_LEXER_struct::rec, recover(), ANTLR3_LEXER_struct::recover, reportError(), ANTLR3_BASE_RECOGNIZER_struct::reportError, reset(), ANTLR3_BASE_RECOGNIZER_struct::reset, setCharStream(), ANTLR3_LEXER_struct::setCharStream, ANTLR3_COMMON_TOKEN_struct::setType, ANTLR3_TOKEN_SOURCE_struct::skipToken, ANTLR3_BASE_RECOGNIZER_struct::state, ANTLR3_COMMON_TOKEN_struct::strFactory, ANTLR3_TOKEN_SOURCE_struct::strFactory, ANTLR3_TOKEN_SOURCE_struct::super, ANTLR3_BASE_RECOGNIZER_struct::super, ANTLR3_RECOGNIZER_SHARED_STATE_struct::tokFactory, and ANTLR3_RECOGNIZER_SHARED_STATE_struct::tokSource.
Referenced by antlr3LexerNewStream().
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 | ) |
References ANTLR3_LIST_struct::add, ANTLR3_ERR_NOMEM, ANTLR3_FUNC_PTR, ANTLR3_MALLOC, antlr3HashTableNew(), antlr3ListAdd(), antlr3ListDelete(), antlr3ListFree(), antlr3ListGet(), antlr3ListPut(), antlr3ListRemove(), antlr3ListSize(), ANTLR3_LIST_struct::del, ANTLR3_LIST_struct::free, ANTLR3_LIST_struct::get, ANTLR3_LIST_struct::put, ANTLR3_LIST_struct::remove, ANTLR3_LIST_struct::size, and ANTLR3_LIST_struct::table.
Referenced by discardTokenType(), getTokensSet(), and setTokenTypeChannel().
ANTLR3_API void antlr3MTNExceptionNew | ( | pANTLR3_BASE_RECOGNIZER | recognizer | ) |
Creates a new Mismatched Tree Nde Exception and inserts in the recognizer exception stack.
recognizer | Context pointer for this recognizer |
References ANTLR3_MISMATCHED_TREE_NODE_EXCEPTION, ANTLR3_MISMATCHED_TREE_NODE_NAME, antlr3RecognitionExceptionNew(), ANTLR3_RECOGNIZER_SHARED_STATE_struct::exception, ANTLR3_EXCEPTION_struct::name, ANTLR3_BASE_RECOGNIZER_struct::state, and ANTLR3_EXCEPTION_struct::type.
Referenced by antlr3TreeParserNewStream().
ANTLR3_API pANTLR3_PARSER antlr3ParserNew | ( | ANTLR3_UINT32 | sizeHint, | |
pANTLR3_RECOGNIZER_SHARED_STATE | state | |||
) |
References ANTLR3_MALLOC, ANTLR3_TYPE_PARSER, antlr3BaseRecognizerNew(), antlr3MTExceptionNew(), ANTLR3_BASE_RECOGNIZER_struct::exConstruct, ANTLR3_PARSER_struct::free, freeParser(), getTokenStream(), ANTLR3_PARSER_struct::getTokenStream, ANTLR3_PARSER_struct::rec, setDebugListener(), ANTLR3_PARSER_struct::setDebugListener, setTokenStream(), ANTLR3_PARSER_struct::setTokenStream, and ANTLR3_BASE_RECOGNIZER_struct::super.
Referenced by antlr3ParserNewStream().
ANTLR3_API pANTLR3_PARSER antlr3ParserNewStream | ( | ANTLR3_UINT32 | sizeHint, | |
pANTLR3_TOKEN_STREAM | tstream, | |||
pANTLR3_RECOGNIZER_SHARED_STATE | state | |||
) |
References antlr3ParserNew(), and ANTLR3_PARSER_struct::setTokenStream.
Referenced by antlr3ParserNewStreamDbg().
ANTLR3_API pANTLR3_PARSER antlr3ParserNewStreamDbg | ( | ANTLR3_UINT32 | sizeHint, | |
pANTLR3_TOKEN_STREAM | tstream, | |||
pANTLR3_DEBUG_EVENT_LISTENER | dbg, | |||
pANTLR3_RECOGNIZER_SHARED_STATE | state | |||
) |
References antlr3ParserNewStream(), and ANTLR3_PARSER_struct::setDebugListener.
ANTLR3_API pANTLR3_REWRITE_RULE_NODE_STREAM antlr3RewriteRuleNODEStreamNewAE | ( | pANTLR3_BASE_TREE_ADAPTOR | adaptor, | |
pANTLR3_BASE_RECOGNIZER | rec, | |||
pANTLR3_UINT8 | description | |||
) |
References antlr3RewriteRuleElementStreamNewAE(), ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct::dup, dupTreeNode(), ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct::free, freeNodeRS(), ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct::nextNode, nextNodeNode(), ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct::toTree, and toTreeNode().
ANTLR3_API pANTLR3_REWRITE_RULE_NODE_STREAM antlr3RewriteRuleNODEStreamNewAEE | ( | pANTLR3_BASE_TREE_ADAPTOR | adaptor, | |
pANTLR3_BASE_RECOGNIZER | rec, | |||
pANTLR3_UINT8 | description, | |||
void * | oneElement | |||
) |
References antlr3RewriteRuleElementStreamNewAEE(), ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct::dup, dupTreeNode(), ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct::free, freeNodeRS(), ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct::nextNode, nextNodeNode(), ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct::toTree, and toTreeNode().
ANTLR3_API pANTLR3_REWRITE_RULE_NODE_STREAM antlr3RewriteRuleNODEStreamNewAEV | ( | pANTLR3_BASE_TREE_ADAPTOR | adaptor, | |
pANTLR3_BASE_RECOGNIZER | rec, | |||
pANTLR3_UINT8 | description, | |||
pANTLR3_VECTOR | vector | |||
) |
References antlr3RewriteRuleElementStreamNewAEV(), ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct::dup, dupTreeNode(), ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct::free, freeNodeRS(), ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct::nextNode, nextNodeNode(), ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct::toTree, and toTreeNode().
ANTLR3_API pANTLR3_REWRITE_RULE_SUBTREE_STREAM antlr3RewriteRuleSubtreeStreamNewAE | ( | pANTLR3_BASE_TREE_ADAPTOR | adaptor, | |
pANTLR3_BASE_RECOGNIZER | rec, | |||
pANTLR3_UINT8 | description | |||
) |
References antlr3RewriteRuleElementStreamNewAE(), ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct::dup, dupTree(), ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct::free, freeNodeRS(), nextNode(), and ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct::nextNode.
ANTLR3_API pANTLR3_REWRITE_RULE_SUBTREE_STREAM antlr3RewriteRuleSubtreeStreamNewAEE | ( | pANTLR3_BASE_TREE_ADAPTOR | adaptor, | |
pANTLR3_BASE_RECOGNIZER | rec, | |||
pANTLR3_UINT8 | description, | |||
void * | oneElement | |||
) |
References antlr3RewriteRuleElementStreamNewAEE(), ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct::dup, dupTree(), ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct::free, freeNodeRS(), nextNode(), and ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct::nextNode.
ANTLR3_API pANTLR3_REWRITE_RULE_SUBTREE_STREAM antlr3RewriteRuleSubtreeStreamNewAEV | ( | pANTLR3_BASE_TREE_ADAPTOR | adaptor, | |
pANTLR3_BASE_RECOGNIZER | rec, | |||
pANTLR3_UINT8 | description, | |||
pANTLR3_VECTOR | vector | |||
) |
References antlr3RewriteRuleElementStreamNewAEV(), ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct::dup, dupTree(), ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct::free, freeNodeRS(), nextNode(), and ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct::nextNode.
ANTLR3_API pANTLR3_REWRITE_RULE_TOKEN_STREAM antlr3RewriteRuleTOKENStreamNewAE | ( | pANTLR3_BASE_TREE_ADAPTOR | adaptor, | |
pANTLR3_BASE_RECOGNIZER | rec, | |||
pANTLR3_UINT8 | description | |||
) |
References antlr3RewriteRuleElementStreamNewAE(), ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct::dup, dupTok(), ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct::nextNode, and nextNodeToken().
ANTLR3_API pANTLR3_REWRITE_RULE_TOKEN_STREAM antlr3RewriteRuleTOKENStreamNewAEE | ( | pANTLR3_BASE_TREE_ADAPTOR | adaptor, | |
pANTLR3_BASE_RECOGNIZER | rec, | |||
pANTLR3_UINT8 | description, | |||
void * | oneElement | |||
) |
References antlr3RewriteRuleElementStreamNewAEE(), ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct::dup, dupTok(), ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct::nextNode, and nextNodeToken().
ANTLR3_API pANTLR3_REWRITE_RULE_TOKEN_STREAM antlr3RewriteRuleTOKENStreamNewAEV | ( | pANTLR3_BASE_TREE_ADAPTOR | adaptor, | |
pANTLR3_BASE_RECOGNIZER | rec, | |||
pANTLR3_UINT8 | description, | |||
pANTLR3_VECTOR | vector | |||
) |
References antlr3RewriteRuleElementStreamNewAEV(), ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct::dup, dupTok(), ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct::nextNode, and nextNodeToken().
ANTLR3_API void antlr3SetCTAPI | ( | pANTLR3_COMMON_TREE | tree | ) |
References antlr3BaseTreeNew(), ANTLR3_COMMON_TREE_struct::baseTree, ANTLR3_COMMON_TREE_struct::childIndex, ANTLR3_BASE_TREE_struct::children, createChildrenList(), ANTLR3_BASE_TREE_struct::createChildrenList, dupNode(), ANTLR3_BASE_TREE_struct::dupNode, ANTLR3_BASE_TREE_struct::free, getCharPositionInLine(), ANTLR3_BASE_TREE_struct::getCharPositionInLine, getChildIndex(), ANTLR3_BASE_TREE_struct::getChildIndex, getLine(), ANTLR3_BASE_TREE_struct::getLine, getParent(), ANTLR3_BASE_TREE_struct::getParent, getText(), ANTLR3_BASE_TREE_struct::getText, getToken(), ANTLR3_BASE_TREE_struct::getToken, getType(), ANTLR3_BASE_TREE_struct::getType, isNilNode(), ANTLR3_BASE_TREE_struct::isNilNode, ANTLR3_COMMON_TREE_struct::parent, reuse(), ANTLR3_BASE_TREE_struct::reuse, setChildIndex(), ANTLR3_BASE_TREE_struct::setChildIndex, setParent(), ANTLR3_BASE_TREE_struct::setParent, ANTLR3_COMMON_TREE_struct::startIndex, ANTLR3_COMMON_TREE_struct::stopIndex, ANTLR3_BASE_TREE_struct::super, ANTLR3_COMMON_TREE_struct::token, toString(), ANTLR3_BASE_TREE_struct::toString, and ANTLR3_BASE_TREE_struct::u.
Referenced by antlr3ArboretumNew(), antlr3CommonTreeNew(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), and newPoolTree().
ANTLR3_API void antlr3SetTokenAPI | ( | pANTLR3_COMMON_TOKEN | token | ) |
References getChannel(), ANTLR3_COMMON_TOKEN_struct::getChannel, getCharPositionInLine(), ANTLR3_COMMON_TOKEN_struct::getCharPositionInLine, getLine(), ANTLR3_COMMON_TOKEN_struct::getLine, getStartIndex(), ANTLR3_COMMON_TOKEN_struct::getStartIndex, getStopIndex(), ANTLR3_COMMON_TOKEN_struct::getStopIndex, getText(), ANTLR3_COMMON_TOKEN_struct::getText, getTokenIndex(), ANTLR3_COMMON_TOKEN_struct::getTokenIndex, getType(), ANTLR3_COMMON_TOKEN_struct::getType, setChannel(), ANTLR3_COMMON_TOKEN_struct::setChannel, setCharPositionInLine(), ANTLR3_COMMON_TOKEN_struct::setCharPositionInLine, setLine(), ANTLR3_COMMON_TOKEN_struct::setLine, setStartIndex(), ANTLR3_COMMON_TOKEN_struct::setStartIndex, setStopIndex(), ANTLR3_COMMON_TOKEN_struct::setStopIndex, setText(), ANTLR3_COMMON_TOKEN_struct::setText, setText8(), ANTLR3_COMMON_TOKEN_struct::setText8, setTokenIndex(), ANTLR3_COMMON_TOKEN_struct::setTokenIndex, setType(), ANTLR3_COMMON_TOKEN_struct::setType, toString(), and ANTLR3_COMMON_TOKEN_struct::toString.
Referenced by antlr3LexerNew(), antlr3TokenFactoryNew(), newPoolToken(), and newToken().
ANTLR3_API void antlr3SetVectorApi | ( | pANTLR3_VECTOR | vector, | |
ANTLR3_UINT32 | sizeHint | |||
) |
References ANTLR3_VECTOR_struct::add, ANTLR3_FALSE, ANTLR3_FREE, ANTLR3_MALLOC, ANTLR3_VECTOR_INTERNAL_SIZE, antlr3VectorAdd(), antlr3VectorClear(), antlr3VectorDel(), antlr3VectorFree(), antlr3VectorGet(), antlr3VectorSet(), antlr3VectorSize(), antlr3VectorSwap(), antrl3VectorRemove(), ANTLR3_VECTOR_struct::clear, ANTLR3_VECTOR_struct::count, ANTLR3_VECTOR_struct::del, ANTLR3_VECTOR_struct::elements, ANTLR3_VECTOR_struct::elementsSize, ANTLR3_VECTOR_struct::factoryMade, ANTLR3_VECTOR_struct::get, ANTLR3_VECTOR_struct::internal, ANTLR3_VECTOR_struct::remove, ANTLR3_VECTOR_struct::set, ANTLR3_VECTOR_struct::size, and ANTLR3_VECTOR_struct::swap.
Referenced by antlr3VectorFactoryNew(), antlr3VectorNew(), and newVector().
ANTLR3_API pANTLR3_STACK antlr3StackNew | ( | ANTLR3_UINT32 | sizeHint | ) |
References ANTLR3_ERR_NOMEM, ANTLR3_FUNC_PTR, ANTLR3_MALLOC, antlr3StackFree(), antlr3StackGet(), antlr3StackPeek(), antlr3StackPop(), antlr3StackPush(), antlr3StackSize(), antlr3VectorNew(), ANTLR3_STACK_struct::free, ANTLR3_STACK_struct::get, ANTLR3_STACK_struct::peek, ANTLR3_STACK_struct::pop, ANTLR3_STACK_struct::push, ANTLR3_STACK_struct::size, ANTLR3_STACK_struct::top, and ANTLR3_STACK_struct::vector.
Referenced by antlr3ArboretumNew(), antlr3CommonTreeNodeStreamNew(), antlr3VectorFactoryNew(), pushCharStream(), and reset().
ANTLR3_API pANTLR3_STRING_FACTORY antlr3StringFactoryNew | ( | ANTLR3_UINT32 | encoding | ) |
References ANTLR3_ENC_8BIT, ANTLR3_ENC_EBCDIC, ANTLR3_ENC_UTF16, ANTLR3_ENC_UTF16BE, ANTLR3_ENC_UTF16LE, ANTLR3_ENC_UTF32, ANTLR3_ENC_UTF32BE, ANTLR3_ENC_UTF32LE, ANTLR3_ENC_UTF8, ANTLR3_FREE, ANTLR3_MALLOC, antlr3VectorNew(), ANTLR3_STRING_FACTORY_struct::close, closeFactory(), destroy(), ANTLR3_STRING_FACTORY_struct::destroy, ANTLR3_STRING_FACTORY_struct::index, ANTLR3_STRING_FACTORY_struct::newPtr, newPtr8(), ANTLR3_STRING_FACTORY_struct::newPtr8, newPtrUTF16_8(), newPtrUTF16_UTF16(), ANTLR3_STRING_FACTORY_struct::newRaw, newRaw8(), newRawUTF16(), ANTLR3_STRING_FACTORY_struct::newSize, newSize8(), newSizeUTF16(), ANTLR3_STRING_FACTORY_struct::newStr, newStr8(), ANTLR3_STRING_FACTORY_struct::newStr8, newStrUTF16_8(), newStrUTF16_UTF16(), ANTLR3_STRING_FACTORY_struct::printable, printable8(), printableUTF16(), and ANTLR3_STRING_FACTORY_struct::strings.
Referenced by antlr38BitSetupStream(), antlr3EBCDICSetupStream(), antlr3UTF16SetupStream(), antlr3UTF32SetupStream(), and antlr3UTF8SetupStream().
ANTLR3_API pANTLR3_INPUT_STREAM antlr3StringStreamNew | ( | pANTLR3_UINT8 | data, | |
ANTLR3_UINT32 | encoding, | |||
ANTLR3_UINT32 | size, | |||
pANTLR3_UINT8 | name | |||
) |
References antlr3CreateStringStream(), ANTLR3_INPUT_STREAM_struct::encoding, ANTLR3_INPUT_STREAM_struct::fileName, ANTLR3_INPUT_STREAM_struct::istream, ANTLR3_STRING_FACTORY_struct::newStr8, setupInputStream(), ANTLR3_INPUT_STREAM_struct::sizeBuf, ANTLR3_INT_STREAM_struct::streamName, and ANTLR3_INPUT_STREAM_struct::strFactory.
ANTLR3_API pANTLR3_TOKEN_FACTORY antlr3TokenFactoryNew | ( | pANTLR3_INPUT_STREAM | input | ) |
References ANTLR3_MALLOC, ANTLR3_TRUE, antlr3SetTokenAPI(), ANTLR3_TOKEN_FACTORY_struct::close, factoryClose(), ANTLR3_COMMON_TOKEN_struct::factoryMade, factoryReset(), ANTLR3_TOKEN_FACTORY_struct::maxPool, newPool(), newPoolToken(), ANTLR3_TOKEN_FACTORY_struct::newToken, ANTLR3_TOKEN_FACTORY_struct::pools, ANTLR3_TOKEN_FACTORY_struct::reset, setInputStream(), ANTLR3_TOKEN_FACTORY_struct::setInputStream, ANTLR3_TOKEN_FACTORY_struct::thisPool, and ANTLR3_TOKEN_FACTORY_struct::unTruc.
Referenced by ANTLR3_TREE_ADAPTORNew(), getMissingSymbol(), and setCharStream().
ANTLR3_API pANTLR3_TOPO antlr3TopoNew | ( | ) |
Allocate and initialize a new ANTLR3 topological sorter, which can be used to define edges that identify numerical node indexes that depend on other numerical node indexes, which can then be sorted topologically such that any node is sorted after all its dependent nodes.
Use:
/verbatim
pANTLR3_TOPO topo; topo = antlr3NewTopo();
if (topo == NULL) { out of memory }
topo->addEdge(topo, 3, 0); // Node 3 depends on node 0 topo->addEdge(topo, 0, 1); // Node - depends on node 1 topo->sortVector(topo, myVector); // Sort the vector in place (node numbers are the vector entry numbers)
/verbatim
References addEdge(), ANTLR3_TOPO_struct::addEdge, ANTLR3_FALSE, ANTLR3_MALLOC, ANTLR3_TOPO_struct::cycle, ANTLR3_TOPO_struct::cycleMark, ANTLR3_TOPO_struct::edges, ANTLR3_TOPO_struct::free, freeTopo(), ANTLR3_TOPO_struct::hasCycle, ANTLR3_TOPO_struct::limit, ANTLR3_TOPO_struct::sorted, sortToArray(), ANTLR3_TOPO_struct::sortToArray, sortVector(), ANTLR3_TOPO_struct::sortVector, and ANTLR3_TOPO_struct::visited.
ANTLR3_API pANTLR3_TREE_NODE_STREAM antlr3TreeNodeStreamNew | ( | ) |
References ANTLR3_CALLOC, antlr3TreeNodeStreamFree(), ANTLR3_TREE_NODE_STREAM_struct::free, replaceChildren(), and ANTLR3_TREE_NODE_STREAM_struct::replaceChildren.
Referenced by antlr3CommonTreeNodeStreamNew(), and antlr3CommonTreeNodeStreamNewStream().
ANTLR3_API pANTLR3_TREE_PARSER antlr3TreeParserNewStream | ( | ANTLR3_UINT32 | sizeHint, | |
pANTLR3_COMMON_TREE_NODE_STREAM | ctnstream, | |||
pANTLR3_RECOGNIZER_SHARED_STATE | state | |||
) |
Allocate tree parser memory
References ANTLR3_MALLOC, ANTLR3_TYPE_PARSER, ANTLR3_TYPE_TREE_PARSER, antlr3BaseRecognizerNew(), antlr3MTNExceptionNew(), ANTLR3_BASE_RECOGNIZER_struct::exConstruct, ANTLR3_TREE_PARSER_struct::free, freeParser(), getCurrentInputSymbol(), ANTLR3_BASE_RECOGNIZER_struct::getCurrentInputSymbol, getMissingSymbol(), ANTLR3_BASE_RECOGNIZER_struct::getMissingSymbol, getTreeNodeStream(), ANTLR3_TREE_PARSER_struct::getTreeNodeStream, mismatch(), ANTLR3_BASE_RECOGNIZER_struct::mismatch, ANTLR3_TREE_PARSER_struct::rec, setTreeNodeStream(), ANTLR3_TREE_PARSER_struct::setTreeNodeStream, ANTLR3_BASE_RECOGNIZER_struct::super, and ANTLR3_BASE_RECOGNIZER_struct::type.
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.
References ANTLR3_MALLOC, ANTLR3_TRUE, ANTLR3_VECTOR_INTERNAL_SIZE, antlr3SetVectorApi(), antlr3StackNew(), ANTLR3_VECTOR_FACTORY_struct::close, closeVectorFactory(), ANTLR3_VECTOR_struct::factoryMade, ANTLR3_VECTOR_FACTORY_struct::freeStack, newPool(), newVector(), ANTLR3_VECTOR_FACTORY_struct::newVector, ANTLR3_VECTOR_FACTORY_struct::pools, returnVector(), ANTLR3_VECTOR_FACTORY_struct::returnVector, ANTLR3_VECTOR_FACTORY_struct::thisPool, and ANTLR3_VECTOR_FACTORY_struct::unTruc.
Referenced by antlr3ArboretumNew().
ANTLR3_API pANTLR3_VECTOR antlr3VectorNew | ( | ANTLR3_UINT32 | sizeHint | ) |
References ANTLR3_ERR_NOMEM, ANTLR3_FUNC_PTR, ANTLR3_MALLOC, and antlr3SetVectorApi().
Referenced by antlr3BaseRecognizerNew(), antlr3CommonTokenStreamNew(), antlr3CommonTreeNodeStreamNew(), antlr3CommonTreeNodeStreamNewStream(), antlr3InputReset(), antlr3StackNew(), antlr3StringFactoryNew(), replaceChildren(), and reset().
ANTLR3_API void fillBufferExt | ( | pANTLR3_COMMON_TOKEN_STREAM | tokenStream | ) |