示例#1
0
/**
 * Free the resources allocated by a lexer
 */
static void 
freeLexer    (pANTLR3_LEXER lexer)
{
	// This may have ben a delegate or delegator lexer, in which case the
	// state may already have been freed (and set to NULL therefore)
	// so we ignore the state if we don't have it.
	//
	if	(lexer->rec->state != NULL)
	{
		if	(lexer->rec->state->streams != NULL)
		{
			lexer->rec->state->streams->free(lexer->rec->state->streams);
		}
		if	(lexer->rec->state->tokFactory != NULL)
		{
			lexer->rec->state->tokFactory->close(lexer->rec->state->tokFactory);
			lexer->rec->state->tokFactory = NULL;
		}
		if	(lexer->rec->state->tokSource != NULL)
		{
			ANTLR3_FREE(lexer->rec->state->tokSource);
			lexer->rec->state->tokSource = NULL;
		}
	}
	if	(lexer->rec != NULL)
	{
		lexer->rec->free(lexer->rec);
		lexer->rec = NULL;
	}
	ANTLR3_FREE(lexer);
}
示例#2
0
/** \brief Close down an input stream and free any memory allocated by it.
 *
 * \param input Input stream context pointer
 */
static void
antlr3InputClose(pANTLR3_INPUT_STREAM input)
{
    // Close any markers in the input stream
    //
    if	(input->markers != NULL)
    {
		input->markers->free(input->markers);
		input->markers = NULL;
    }

    // Close the string factory
    //
    if	(input->strFactory != NULL)
    {
		input->strFactory->close(input->strFactory);
    }

    // Free the input stream buffer if we allocated it
    //
    if	(input->isAllocated && input->data != NULL)
    {
		ANTLR3_FREE(input->data);
		input->data = NULL;
    }
    
    input->istream->free(input->istream);

    // Finally, free the space for the structure itself
    //
    ANTLR3_FREE(input);

    // Done
    //
}
static  void
factoryClose        (pANTLR3_TOKEN_FACTORY factory)
{
    pANTLR3_COMMON_TOKEN    pool;
    ANTLR3_INT32            poolCount;
    ANTLR3_UINT32           limit;
    ANTLR3_UINT32           token;
    pANTLR3_COMMON_TOKEN    check;

    /* We iterate the token pools one at a time
     */
    for (poolCount = 0; poolCount <= factory->thisPool; poolCount++)
    {
        /* Pointer to current pool
         */
        pool    = factory->pools[poolCount];

        /* Work out how many tokens we need to check in this pool.
         */
        limit   = (poolCount == factory->thisPool ? factory->nextToken : ANTLR3_FACTORY_POOL_SIZE);

        /* Marginal condition, we might be at the start of a brand new pool
         * where the nextToken is 0 and nothing has been allocated.
         */
        if  (limit > 0)
        {
            /* We have some tokens allocated from this pool
             */
            for (token = 0; token < limit; token++)
            {
                /* Next one in the chain
                 */
                check   = pool + token;

                /* If the programmer made this a custom token, then
                 * see if we need to call their free routine.
                 */
/*              if  (check->custom != NULL && check->freeCustom != NULL)
                {
                    check->freeCustom(check->custom);
                    check->custom = NULL;
                }*/
            }
        }

        /* We can now free this pool allocation
         */
        ANTLR3_FREE(factory->pools[poolCount]);
        factory->pools[poolCount] = NULL;
    }

    /* All the pools are deallocated we can free the pointers to the pools
     * now.
     */
    ANTLR3_FREE(factory->pools);

    /* Finally, we can free the space for the factory itself
     */
    ANTLR3_FREE(factory);
}
/// Free up any resources that belong to this common tree node stream.
///
static  void                        antlr3CommonTreeNodeStreamFree  (pANTLR3_COMMON_TREE_NODE_STREAM ctns)
{

        // If this is a rewrting stream, then certain resources
        // belong to the originating node stream and we do not
        // free them here.
        //
        if      (ctns->isRewriter != ANTLR3_TRUE)
        {
                ctns->adaptor                   ->free  (ctns->adaptor);

                if      (ctns->nodeStack != NULL)
                {
                        ctns->nodeStack->free(ctns->nodeStack);
                }

                ANTLR3_FREE(ctns->INVALID_NODE.token);
                ANTLR3_FREE(ctns->EOF_NODE.token);
                ANTLR3_FREE(ctns->DOWN.token);
                ANTLR3_FREE(ctns->UP.token);
        }

        if      (ctns->nodes != NULL)
        {
                ctns->nodes                     ->free  (ctns->nodes);
        }
        ctns->tnstream->istream ->free  (ctns->tnstream->istream);
    ctns->tnstream                      ->free  (ctns->tnstream);


    ANTLR3_FREE(ctns);
}
示例#5
0
static	void
factoryClose	    (pANTLR3_ARBORETUM factory)
{
	ANTLR3_INT32	    poolCount;

	// First close the vector factory that supplied all the child pointer
	// vectors.
	//
	factory->vFactory->close(factory->vFactory);

    if  (factory->nilStack !=  NULL)
    {
        factory->nilStack->free(factory->nilStack);
    }

	// We now JUST free the pools because the C runtime CommonToken based tree
	// cannot contain anything that was not made by this factory.
	//
	for	(poolCount = 0; poolCount <= factory->thisPool; poolCount++)
	{
		// We can now free this pool allocation
		//
		ANTLR3_FREE(factory->pools[poolCount]);
		factory->pools[poolCount] = NULL;
	}

	// All the pools are deallocated we can free the pointers to the pools
	// now.
	//
	ANTLR3_FREE(factory->pools);

	// Finally, we can free the space for the factory itself
	//
	ANTLR3_FREE(factory);
}
示例#6
0
文件: MudLexer.c 项目: copenhas/emud
static void
MudLexerFree  (pMudLexer ctx)
{
    LEXER->free(LEXER);

    ANTLR3_FREE(ctx);
}
static void
belle_sdpLexerFree  (pbelle_sdpLexer ctx)
{
    LEXER->free(LEXER);
    
    ANTLR3_FREE(ctx);
}
示例#8
0
static
void	ANTLR3_CDECL stringFree  (pANTLR3_STRING string)
{
    /* First free the string itself if there was anything in it
     */
    if	(string->chars)
    {
        ANTLR3_FREE(string->chars);
    }

    /* Now free the space for this string
     */
    ANTLR3_FREE(string);

    return;
}
示例#9
0
static void
ExprCppTreeLexerFree  (pExprCppTreeLexer ctx)
{
    LEXER->free(LEXER);
    
    ANTLR3_FREE(ctx);
}
示例#10
0
static void
freeRS	(pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream)
{
    if (stream->freeElements == ANTLR3_TRUE && stream->elements != NULL)
    {
        stream->elements->free(stream->elements);
    }
    ANTLR3_FREE(stream);
}
示例#11
0
static  void
factoryClose        (pANTLR3_TOKEN_FACTORY factory)
{
  ANTLR3_UINT32 i;
  ANTLR3_UINT32 size = factory->thisPool;
  pANTLR3_COMMON_TOKEN tok;

  for(i = 0; i < size && i < factory->nextToken; i++) {
    tok = factory->pools[0] + i;
    if(tok->custom != NULL && tok->freeCustom != NULL) {
      tok->freeCustom(tok->custom);
      tok->custom = NULL;
    }
  }
  ANTLR3_FREE(factory->pools[0]);
  ANTLR3_FREE(factory->pools);
  ANTLR3_FREE(factory);

}
示例#12
0
/** \brief Use the contents of an operating system file as the input
 *         for an input stream.
 *
 * \param fileName Name of operating system file to read.
 * \return
 *	- Pointer to new input stream context upon success
 *	- One of the ANTLR3_ERR_ defines on error.
 */
ANTLR3_API pANTLR3_INPUT_STREAM
antlr3AsciiFileStreamNew(pANTLR3_UINT8 fileName)
{
    /* Pointer to the input stream we are going to create
     */
    pANTLR3_INPUT_STREAM    input;
    ANTLR3_UINT64	    status;

    /* Allocate memory for the input stream structure
     */
    input   = (pANTLR3_INPUT_STREAM)
		    ANTLR3_MALLOC(sizeof(ANTLR3_INPUT_STREAM));

    if	(input == NULL)
    {
	return	(pANTLR3_INPUT_STREAM) ANTLR3_ERR_NOMEM;
    }

    input->fileName  = ANTLR3_STRDUP(fileName);

    /* Structure was allocated correctly, now we can read the file.
     */
    status  = antlr3readAscii(input);

    if	(status != ANTLR3_SUCCESS)
    {
	ANTLR3_FREE(input->fileName);
	ANTLR3_FREE(input);

	return	ANTLR3_FUNC_PTR(status);
    }

    /* Call the common 8 bit ASCII input stream handler
     * intializer type thingy doobry function.
     */
    antlr3AsciiSetupStream(input, ANTLR3_CHARSTREAM);



    return  input;
}
示例#13
0
// Convert a UTF16 string into a UTF8 representation using the Unicode.org
// supplied C algorithms, which are now contained within the ANTLR3 C runtime
// as permitted by the Unicode license (within the source code antlr3convertutf.c/.h
// UCS2 has the same encoding as UTF16 so we can use UTF16 converter.
//
static	pANTLR3_STRING
toUTF8_UTF16	(pANTLR3_STRING string)
{

    UTF8	      * outputEnd;
    UTF16	      * inputEnd;
    pANTLR3_STRING	utf8String;

    ConversionResult	cResult;

    // Allocate the output buffer, which needs to accommodate potentially
    // 3X (in bytes) the input size (in chars).
    //
    utf8String	= string->factory->newStr8(string->factory, (pANTLR3_UINT8)"");

    if	(utf8String != NULL)
    {
        // Free existing allocation
        //
        ANTLR3_FREE(utf8String->chars);

        // Reallocate according to maximum expected size
        //
        utf8String->size	= string->len *3;
        utf8String->chars	= (pANTLR3_UINT8)ANTLR3_MALLOC(utf8String->size +1);

        if	(utf8String->chars != NULL)
        {
            inputEnd  = (UTF16 *)	(string->chars);
            outputEnd = (UTF8 *)	(utf8String->chars);

            // Call the Unicode converter
            //
            cResult =  ConvertUTF16toUTF8
                       (
                           (const UTF16**)&inputEnd,
                           ((const UTF16 *)(string->chars)) + string->len,
                           &outputEnd,
                           outputEnd + utf8String->size - 1,
                           lenientConversion
                       );

            // We don't really care if things failed or not here, we just converted
            // everything that was vaguely possible and stopped when it wasn't. It is
            // up to the grammar programmer to verify that the input is sensible.
            //
            utf8String->len = ANTLR3_UINT32_CAST(((pANTLR3_UINT8)outputEnd) - utf8String->chars);

            *(outputEnd+1) = '\0';		// Always null terminate
        }
    }
    return utf8String;
}
示例#14
0
/** Fascist Capitalist Pig function created
 *  to oppress the workers comrade.
 */
static    void
closeFactory	(pANTLR3_STRING_FACTORY factory)
{
    /* Delete the vector we were tracking the strings with, this will
     * causes all the allocated strings to be deallocated too
     */
    factory->strings->free(factory->strings);

    /* Delete the space for the factory itself
     */
    ANTLR3_FREE((void *)factory);
}
示例#15
0
/**
 * \brief
 * Frees up a chain of ANTLR3 exceptions
 * 
 * \param[in] ex
 * Pointer to the first exception in the chain to free.
 * 
 * \see
 * ANTLR3_EXCEPTION
 */
static void
antlr3ExceptionFree(pANTLR3_EXCEPTION ex)
{
    pANTLR3_EXCEPTION next;

    /* Ensure valid pointer
     */
    while   (ex != NULL)
    {
	/* Pick up anythign following now, before we free the
	 * current memory block.
	 */
	next	= ex->nextException;

	/* Free the message pointer if advised to
	 */
	if  (ex->freeMessage == ANTLR3_TRUE)
	{
	    ANTLR3_FREE(ex->message);
	}

	/* Call the programmer's custom free routine if advised to
	 */
	if  (ex->freeCustom != NULL)
	{
	    ex->freeCustom(ex->custom);
	}

	/* Free the actual structure itself
	 */
	ANTLR3_FREE(ex);

	ex = next;
    }

    return;
}
示例#16
0
/** Free the parser resources
 */
 static void
 TestGrammarParserFree(pTestGrammarParser ctx)
 {
    /* Free any scope memory
     */

	// Free this parser
	//
    ctx->pParser->free(ctx->pParser);


    ANTLR3_FREE(ctx);

    /* Everything is released, so we can return
     */
    return;
 }
示例#17
0
/** Free the parser resources
 */
 static void
 filter_expressionParserFree(pfilter_expressionParser ctx)
 {
    /* Free any scope memory
     */

	// Free this parser
	//
    ctx->pParser->free(ctx->pParser);


    ANTLR3_FREE(ctx);

    /* Everything is released, so we can return
     */
    return;
 }
示例#18
0
static void	
freeBR	    (pANTLR3_BASE_RECOGNIZER recognizer)
{
    pANTLR3_EXCEPTION thisE;

    if	(recognizer->ruleMemo != NULL)
    {
	recognizer->ruleMemo->free(recognizer->ruleMemo);
    }

    thisE = recognizer->exception;
    if	(thisE != NULL)
    {
	thisE->freeEx(thisE);
    }

    ANTLR3_FREE(recognizer);
}
/** Free the parser resources
 */
 static void
 corpconfParserFree(pcorpconfParser ctx)
 {
    /* Free any scope memory
     */
    
    ctx->vectors->close(ctx->vectors);
    /* We created the adaptor so we must free it
     */
    ADAPTOR->free(ADAPTOR);
	// Free this parser
	//
    ctx->pParser->free(ctx->pParser);
    ANTLR3_FREE(ctx);

    /* Everything is released, so we can return
     */
    return;
 }
示例#20
0
static void
ctaFree(pANTLR3_BASE_TREE_ADAPTOR adaptor)
{
    pANTLR3_COMMON_TREE_ADAPTOR cta;

    cta	= (pANTLR3_COMMON_TREE_ADAPTOR)(adaptor->super);

    /* Free the tree factory we created
     */
    cta->arboretum->close(((pANTLR3_COMMON_TREE_ADAPTOR)(adaptor->super))->arboretum);

    /* Free the token factory we created
     */
    adaptor->tokenFactory->close(adaptor->tokenFactory);

    /* Free the super pointer, as it is this that was allocated
     * and is the common tree structure.
     */
    ANTLR3_FREE(adaptor->super);
}
示例#21
0
ANTLR3_API pANTLR3_STRING_FACTORY 
antlr3StringFactoryNew()
{
	pANTLR3_STRING_FACTORY  factory;

	/* Allocate memory
	*/
	factory	= (pANTLR3_STRING_FACTORY) ANTLR3_MALLOC(sizeof(ANTLR3_STRING_FACTORY));

	if	(factory == NULL)
	{
		return	NULL;
	}

	/* Now we make a new list to track the strings.
	*/
	factory->strings	= antlr3VectorNew(0);
	factory->index	= 0;

	if	(factory->strings == NULL)
	{
		ANTLR3_FREE(factory);
		return	NULL;
	}

	/* Install the API (8 bit assumed)
	*/
	factory->newRaw		=  newRaw8;
	factory->newSize	=  newSize8;

	factory->newPtr		=  newPtr8;
	factory->newPtr8	=  newPtr8;
	factory->newStr		=  newStr8;
	factory->newStr8	=  newStr8;
	factory->destroy	=  destroy;
	factory->printable	=  printable8;
	factory->destroy	=  destroy;
	factory->close		=  closeFactory;

	return  factory;
}
static void		    
antlr3CTSFree	    (pANTLR3_COMMON_TOKEN_STREAM stream)
{
	// We only free up our subordinate interfaces if they belong
	// to us, otherwise we let whoever owns them deal with them.
	//
	if	(stream->tstream->super == stream)
	{
		if	(stream->tstream->istream->super == stream->tstream)
		{
			stream->tstream->istream->free(stream->tstream->istream);
			stream->tstream->istream = NULL;
		}
		stream->tstream->free(stream->tstream);
	}

	// Now we free our own resources
	//
	if	(stream->tokens != NULL)
	{
		stream->tokens->free(stream->tokens);
		stream->tokens	= NULL;
	}
	if	(stream->discardSet != NULL)
	{
		stream->discardSet->free(stream->discardSet);
		stream->discardSet  = NULL;
	}
	if	(stream->channelOverrides != NULL)
	{
		stream->channelOverrides->free(stream->channelOverrides);
		stream->channelOverrides = NULL;
	}

	// Free our memory now
	//
	ANTLR3_FREE(stream);
}
示例#23
0
static void
freeParser	(pANTLR3_TREE_PARSER parser)
{
	if	(parser->rec != NULL)
	{
		// This may have ben a delegate or delegator parser, in which case the
		// state may already have been freed (and set to NULL therefore)
		// so we ignore the state if we don't have it.
		//
		if	(parser->rec->state != NULL)
		{
			if	(parser->rec->state->following != NULL)
			{
				stackFree(parser->rec->state->following);
				parser->rec->state->following = NULL;
			}
		}
	    parser->rec->free(parser->rec);
	    parser->rec	= NULL;
    }

    ANTLR3_FREE(parser);
}
示例#24
0
/* For use in tree output where we are accumulating rule labels via label += ruleRef
 * we need a function that knows how to free a return scope when the list is destroyed.
 * We cannot just use ANTLR3_FREE because in debug tracking mode, this is a macro.
 */
static	void ANTLR3_CDECL freeScope(void * scope)
{
    ANTLR3_FREE(scope);
}
static void
antlr3TreeNodeStreamFree(pANTLR3_TREE_NODE_STREAM stream)
{
    ANTLR3_FREE(stream);
}
示例#26
0
pBOUNDED_TOKEN_BUFFER BoundedTokenBufferSourceNew(ANTLR3_UINT32 k,
                                                  pANTLR3_TOKEN_SOURCE source) {
  pBOUNDED_TOKEN_BUFFER buffer;
  pANTLR3_COMMON_TOKEN_STREAM stream;

  assert(k > 0);

  /* Memory for the interface structure */
  buffer =
      (pBOUNDED_TOKEN_BUFFER)ANTLR3_MALLOC(sizeof(BOUNDED_TOKEN_BUFFER_struct));

  if (buffer == NULL) {
    return NULL;
  }

  buffer->tokenBuffer = (pANTLR3_COMMON_TOKEN*)ANTLR3_MALLOC(
      2 * k * sizeof(pANTLR3_COMMON_TOKEN));
  if (buffer->tokenBuffer == NULL) {
    ANTLR3_FREE(buffer);
    return NULL;
  }

  buffer->currentIndex = 0;
  buffer->maxIndex = 0;
  buffer->k = k;
  buffer->bufferSize = 2 * k;
  buffer->empty = ANTLR3_TRUE;
  buffer->done = ANTLR3_FALSE;

  stream = antlr3CommonTokenStreamSourceNew(k, source);
  if (stream == NULL) {
    ANTLR3_FREE(buffer->tokenBuffer);
    ANTLR3_FREE(buffer);
    return NULL;
  }

  stream->super = buffer;
  buffer->commonTstream = stream;

  /* Defaults */
  stream->p = -1;

  /* Install the token stream API */
  stream->tstream->_LT = tokLT;
  stream->tstream->get = get;
  stream->tstream->getTokenSource = getTokenSource;
  stream->tstream->setTokenSource = setTokenSource;
  stream->tstream->toString = toString;
  stream->tstream->toStringSS = toStringSS;
  stream->tstream->toStringTT = toStringTT;
  stream->tstream->setDebugListener = setDebugListener;

  /* Install INT_STREAM interface */
  stream->tstream->istream->_LA = _LA;
  stream->tstream->istream->mark = mark;
  stream->tstream->istream->release = release;
  stream->tstream->istream->size = size;
  stream->tstream->istream->index = tindex;
  stream->tstream->istream->rewind = rewindStream;
  stream->tstream->istream->rewindLast = rewindLast;
  stream->tstream->istream->seek = seek;
  stream->tstream->istream->consume = consume;
  stream->tstream->istream->getSourceName = getSourceName;

  return buffer;
}
示例#27
0
ANTLR3_API pANTLR3_STRING_FACTORY
antlr3StringFactoryNew(ANTLR3_UINT32 encoding)
{
    pANTLR3_STRING_FACTORY  factory;

    /* Allocate memory
    */
    factory	= (pANTLR3_STRING_FACTORY) ANTLR3_MALLOC(sizeof(ANTLR3_STRING_FACTORY));

    if	(factory == NULL)
    {
        return	NULL;
    }

    /* Now we make a new list to track the strings.
    */
    factory->strings	= antlr3VectorNew(0);
    factory->index	= 0;

    if	(factory->strings == NULL)
    {
        ANTLR3_FREE(factory);
        return	NULL;
    }

    // Install the API
    //
    switch(encoding)
    {

    case    ANTLR3_ENC_UTF16:

        factory->newRaw	    =  newRawUTF16;
        factory->newSize	=  newSizeUTF16;
        factory->newPtr	    =  newPtrUTF16_UTF16;
        factory->newPtr8	=  newPtrUTF16_8;
        factory->newStr	    =  newStrUTF16_UTF16;
        factory->newStr8	=  newStrUTF16_8;
        factory->printable	=  printableUTF16;
        factory->destroy	=  destroy;
        factory->close	    =  closeFactory;
        break;

    // TODO: These encodings need equivalent functions to
    // UTF16 and 8Bit if I am going to support those encodings in the STRING stuff.
    // The STRING stuff was intended as a quick and dirty hack for people that did not
    // want to worry about memory and performance very much, but nobody ever reads the
    // notes or comments or uses the email list search. I want to discourage using these
    // interfaces as it is much more efficient to use the pointers within the tokens
    // directly, so I am not implementing the string stuff for the newer encodings.
    //
    case    ANTLR3_ENC_UTF8:
        break;

    case    ANTLR3_ENC_UTF32:
        break;

    case    ANTLR3_ENC_UTF16BE:
        break;

    case    ANTLR3_ENC_UTF16LE:
        break;

    case    ANTLR3_ENC_UTF32BE:
        break;

    case    ANTLR3_ENC_UTF32LE:
        break;

    case    ANTLR3_ENC_EBCDIC:
    case    ANTLR3_ENC_8BIT:
    default:

        factory->newRaw	    =  newRaw8;
        factory->newSize	=  newSize8;
        factory->newPtr	    =  newPtr8;
        factory->newPtr8	=  newPtr8;
        factory->newStr	    =  newStr8;
        factory->newStr8	=  newStr8;
        factory->printable	=  printable8;
        factory->destroy	=  destroy;
        factory->close	    =  closeFactory;
        break;
    }
    return  factory;
}
示例#28
0
void
BoundedTokenBufferFree(pBOUNDED_TOKEN_BUFFER buffer) {
  buffer->commonTstream->free(buffer->commonTstream);
  ANTLR3_FREE(buffer->tokenBuffer);
  ANTLR3_FREE(buffer);
}
/** \brief Create a new lexer called belle_sdpLexer
 *
 * \param[in]    instream Pointer to an initialized input stream
 * \param[state] state Previously created shared recognizer stat
 * \return 
 *     - Success pbelle_sdpLexer initialized for the lex start
 *     - Fail NULL
 */
ANTLR3_API pbelle_sdpLexer belle_sdpLexerNewSSD         
(pANTLR3_INPUT_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
{
    pbelle_sdpLexer ctx; // Context structure we will build and return

    ctx = (pbelle_sdpLexer) ANTLR3_CALLOC(1, sizeof(belle_sdpLexer));

    if  (ctx == NULL)
    {
        // Failed to allocate memory for lexer context
        return  NULL;
    }

    /* -------------------------------------------------------------------
     * Memory for basic structure is allocated, now to fill in
     * in base ANTLR3 structures. We initialize the function pointers
     * for the standard ANTLR3 lexer function set, but upon return
     * from here, the programmer may set the pointers to provide custom
     * implementations of each function. 
     *
     * We don't use the macros defined in belle_sdpLexer.h here so you can get a sense
     * of what goes where.
     */
    
    /* Create a base lexer, using the supplied input stream
     */
    ctx->pLexer	= antlr3LexerNewStream(ANTLR3_SIZE_HINT, instream, state);
    
    /* Check that we allocated the memory correctly
     */
    if	(ctx->pLexer == NULL)
    {
		ANTLR3_FREE(ctx);
		return  NULL;
    }
    /* Install the implementation of our belle_sdpLexer interface
     */
    ctx->mT__20	= mT__20;
    ctx->mT__21	= mT__21;
    ctx->mT__22	= mT__22;
    ctx->mT__23	= mT__23;
    ctx->mT__24	= mT__24;
    ctx->mT__25	= mT__25;
    ctx->mT__26	= mT__26;
    ctx->mT__27	= mT__27;
    ctx->mDIGIT	= mDIGIT;
    ctx->mZERO	= mZERO;
    ctx->mPOS_DIGIT	= mPOS_DIGIT;
    ctx->mCOMMON_CHAR	= mCOMMON_CHAR;
    ctx->mHEX_CHAR	= mHEX_CHAR;
    ctx->mSPACE	= mSPACE;
    ctx->mLQUOTE	= mLQUOTE;
    ctx->mRQUOTE	= mRQUOTE;
    ctx->mCR	= mCR;
    ctx->mLF	= mLF;
    ctx->mDOT	= mDOT;
    ctx->mEQUAL	= mEQUAL;
    ctx->mCOLON	= mCOLON;
    ctx->mSLASH	= mSLASH;
    ctx->mDASH	= mDASH;
    ctx->mANY_EXCEPT_CR_LF	= mANY_EXCEPT_CR_LF;
    ctx->mTokens	= mTokens;
    
    /** When the nextToken() call is made to this lexer's pANTLR3_TOKEN_SOURCE
     *  it will call mTokens() in this generated code, and will pass it the ctx
     * pointer of this lexer, not the context of the base lexer, so store that now.
     */
    ctx->pLexer->ctx	    = ctx;
    
    /**Install the token matching function
     */
    ctx->pLexer->mTokens = (void (*) (void *))(mTokens);
    
    ctx->getGrammarFileName	= getGrammarFileName;
    ctx->free		= belle_sdpLexerFree;

    
    


    /* Return the newly built lexer to the caller
     */
    return  ctx;
}
static void
antlr3TokenStreamFree(pANTLR3_TOKEN_STREAM stream)
{   
    ANTLR3_FREE(stream);
}