/** \file
 *  This C source file was generated by $ANTLR version 3.4
 *
 *     -  From the grammar source file : ANTLRv3.g
 *     -                            On : 2016-01-26 14:40:45
 *     -                for the parser : ANTLRv3ParserParser
 *
 * Editing it, at least manually, is not wise.
 *
 * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
 *
 *
*/
// [The "BSD license"]
// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
// http://www.temporal-wave.com
// http://www.linkedin.com/in/jimidle
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
//    notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
//    notice, this list of conditions and the following disclaimer in the
//    documentation and/or other materials provided with the distribution.
// 3. The name of the author may not be used to endorse or promote products
//    derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


/* =============================================================================
 * This is what the grammar programmer asked us to put at the top of every file.
 */

#ifndef _WIN32
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wparentheses"
#ifdef __APPLE__
// Comparison of unsigned expression >= 0 is always true.
#pragma GCC diagnostic ignored "-Wtautological-compare"
#else
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6 )
#pragma GCC diagnostic ignored "-Wtype-limits"
#endif
#endif
#else
#pragma warning(disable:4296) // Condition is always true.
#endif

/* End of Header action.
 * =============================================================================
 */

/* -----------------------------------------
 * Include the ANTLR3 generated header file.
 */
#include    "ANTLRv3Parser.h"
/* ----------------------------------------- */

/** ANTLR v3 grammar written in ANTLR v3 with AST construction */




/* MACROS that hide the C interface implementations from the
 * generated code, which makes it a little more understandable to the human eye.
 * I am very much against using C pre-processor macros for function calls and bits
 * of code as you cannot see what is happening when single stepping in debuggers
 * and so on. The exception (in my book at least) is for generated code, where you are
 * not maintaining it, but may wish to read and understand it. If you single step it, you know that input()
 * hides some indirect calls, but is always referring to the input stream. This is
 * probably more readable than ctx->input->istream->input(snarfle0->blarg) and allows me to rejig
 * the runtime interfaces without changing the generated code too often, without
 * confusing the reader of the generated output, who may not wish to know the gory
 * details of the interface inheritance.
 */

#define		CTX	ctx

/* Aids in accessing scopes for grammar programmers
 */
#undef	SCOPE_TYPE
#undef	SCOPE_STACK
#undef	SCOPE_TOP
#define	SCOPE_TYPE(scope)   pANTLRv3Parser_##scope##_SCOPE
#define SCOPE_STACK(scope)  pANTLRv3Parser_##scope##Stack
#define	SCOPE_TOP(scope)    ctx->pANTLRv3Parser_##scope##Top
#define	SCOPE_SIZE(scope)		ctx->pANTLRv3Parser_##scope##Stack_limit
#define SCOPE_INSTANCE(scope, i)	(ctx->SCOPE_STACK(scope)->get(ctx->SCOPE_STACK(scope),i))

/* Macros for accessing things in the parser
 */

#undef	    PARSER
#undef	    RECOGNIZER
#undef	    HAVEPARSEDRULE
#undef		MEMOIZE
#undef	    INPUT
#undef	    STRSTREAM
#undef	    HASEXCEPTION
#undef	    EXCEPTION
#undef	    MATCHT
#undef	    MATCHANYT
#undef	    FOLLOWSTACK
#undef	    FOLLOWPUSH
#undef	    FOLLOWPOP
#undef	    PRECOVER
#undef	    PREPORTERROR
#undef	    LA
#undef	    LT
#undef	    CONSTRUCTEX
#undef	    CONSUME
#undef	    MARK
#undef	    REWIND
#undef	    REWINDLAST
#undef	    PERRORRECOVERY
#undef	    HASFAILED
#undef	    FAILEDFLAG
#undef	    RECOVERFROMMISMATCHEDSET
#undef	    RECOVERFROMMISMATCHEDELEMENT
#undef		INDEX
#undef      ADAPTOR
#undef		SEEK
#undef	    RULEMEMO
#undef		DBG

#define	    PARSER				ctx->pParser
#define	    RECOGNIZER				PARSER->rec
#define	    PSRSTATE				RECOGNIZER->state
#define	    HAVEPARSEDRULE(r)			RECOGNIZER->alreadyParsedRule(RECOGNIZER, r)
#define	    MEMOIZE(ri,si)			RECOGNIZER->memoize(RECOGNIZER, ri, si)
#define	    INPUT				PARSER->tstream
#define	    STRSTREAM				INPUT
#define	    ISTREAM				INPUT->istream
#define	    INDEX()				ISTREAM->index(INPUT->istream)
#define	    HASEXCEPTION()			(PSRSTATE->error == ANTLR3_TRUE)
#define	    EXCEPTION				PSRSTATE->exception
#define	    MATCHT(t, fs)			RECOGNIZER->match(RECOGNIZER, t, fs)
#define	    MATCHANYT()				RECOGNIZER->matchAny(RECOGNIZER)
#define	    FOLLOWSTACK				PSRSTATE->following
#ifdef  SKIP_FOLLOW_SETS
#define	    FOLLOWPUSH(x)
#define	    FOLLOWPOP()
#else
#define	    FOLLOWPUSH(x)			FOLLOWSTACK->push(FOLLOWSTACK, ((void *)(&(x))), NULL)
#define	    FOLLOWPOP()				FOLLOWSTACK->pop(FOLLOWSTACK)
#endif
#define	    PRECOVER()				RECOGNIZER->recover(RECOGNIZER)
#define	    PREPORTERROR()			RECOGNIZER->reportError(RECOGNIZER)
#define	    LA(n)				INPUT->istream->_LA(ISTREAM, n)
#define	    LT(n)				INPUT->_LT(INPUT, n)
#define	    CONSTRUCTEX()			RECOGNIZER->exConstruct(RECOGNIZER)
#define	    CONSUME()				ISTREAM->consume(ISTREAM)
#define	    MARK()				ISTREAM->mark(ISTREAM)
#define	    REWIND(m)				ISTREAM->rewind(ISTREAM, m)
#define	    REWINDLAST()			ISTREAM->rewindLast(ISTREAM)
#define	    SEEK(n)				ISTREAM->seek(ISTREAM, n)
#define	    PERRORRECOVERY			PSRSTATE->errorRecovery
#define	    FAILEDFLAG				PSRSTATE->failed
#define	    HASFAILED()				(FAILEDFLAG == ANTLR3_TRUE)
#define	    BACKTRACKING			PSRSTATE->backtracking
#define	    RECOVERFROMMISMATCHEDSET(s)		RECOGNIZER->recoverFromMismatchedSet(RECOGNIZER, s)
#define	    RECOVERFROMMISMATCHEDELEMENT(e)	RECOGNIZER->recoverFromMismatchedElement(RECOGNIZER, s)
#define     ADAPTOR                         ctx->adaptor
#define		RULEMEMO						PSRSTATE->ruleMemo
#define		DBG								RECOGNIZER->debugger


#define		TOKTEXT(tok, txt)				tok, (pANTLR3_UINT8)txt

/* The 4 tokens defined below may well clash with your own #defines or token types. If so
 * then for the present you must use different names for your defines as these are hard coded
 * in the code generator. It would be better not to use such names internally, and maybe
 * we can change this in a forthcoming release. I deliberately do not #undef these
 * here as this will at least give you a redefined error somewhere if they clash.
 */
#define	    UP	    ANTLR3_TOKEN_UP
#define	    DOWN    ANTLR3_TOKEN_DOWN
#define	    EOR	    ANTLR3_TOKEN_EOR
#define	    INVALID ANTLR3_TOKEN_INVALID


/* =============================================================================
 * Functions to create and destroy scopes. First come the rule scopes, followed
 * by the global declared scopes.
 */

/* ruleAttributeScopeFuncDecl(scope)
 */
/* -----------------------------------------------------------------------------
 * Function declarations for creating a ANTLRv3Parser_rule scope set
 */
static pANTLRv3Parser_rule_SCOPE   pANTLRv3Parser_rulePush(pANTLRv3Parser ctx);
static void ANTLR3_CDECL ruleFree(pANTLRv3Parser_rule_SCOPE scope);
/* ----------------------------------------------------------------------------- */


/* ruleAttributeScopeFuncs(scope)
 */
/* attributeFuncs(scope)
 */

static void ANTLR3_CDECL ruleFree(pANTLRv3Parser_rule_SCOPE scope)
{
    ANTLR3_FREE(scope);
}

/** \brief Allocate initial memory for a ANTLRv3Parser rule scope variable stack entry and
 *         add it to the top of the stack.
 *
 * \remark
 * By default the structure is freed with ANTLR_FREE(), but you can use the
 * the \@init action to install a pointer to a custom free() routine by
 * adding the code:
 * \code
 *   ctx->pANTLRv3Parser_ruleTop->free = myroutine;
 * \endcode
 *
 * With lots of comments of course! The routine should be declared in
 * \@members { } as:
 * \code
 *   void ANTLR3_CDECL myfunc( pANTLRv3Parser_rule_SCOPE ptr).
 * \endcode
 *
 * It should perform any custom freeing stuff that you need (call ANTLR_FREE3, not free()
 * NB: It should not free the pointer it is given, which is the scope stack entry itself
 * and will be freed by the function that calls your custom free routine.
 *
 */
static pANTLRv3Parser_rule_SCOPE
pANTLRv3Parser_rulePush(pANTLRv3Parser ctx)
{
    /* Pointer used to create a new set of attributes
     */
    pANTLRv3Parser_rule_SCOPE      newAttributes;

    /* Allocate the memory for a new structure if we need one.
     */
    if (ctx->pANTLRv3Parser_ruleStack->size(ctx->pANTLRv3Parser_ruleStack) > ctx->pANTLRv3Parser_ruleStack_limit)
    {
        // The current limit value was less than the number of scopes available on the stack so
        // we can just reuse one. Our limit tracks the stack count, so the index of the entry we want
        // is one less than that, or conveniently, the current value of limit.
        //
        newAttributes = (pANTLRv3Parser_rule_SCOPE)ctx->pANTLRv3Parser_ruleStack->get(ctx->pANTLRv3Parser_ruleStack, ctx->pANTLRv3Parser_ruleStack_limit);
    }
    else
    {
        // Need a new allocation
        //
        newAttributes = (pANTLRv3Parser_rule_SCOPE) ANTLR3_MALLOC(sizeof(ANTLRv3Parser_rule_SCOPE));
        if  (newAttributes != NULL)
        {
            /* Standard ANTLR3 library implementation
             */
            ctx->pANTLRv3Parser_ruleStack->push(ctx->pANTLRv3Parser_ruleStack, newAttributes, (void (*)(void *))ruleFree);
        }
    }

    // Blank out any previous free pointer, the user might or might install a new one.
    //
    newAttributes->free = NULL;

    // Indicate the position in the available stack that the current level is at
    //
    ctx->pANTLRv3Parser_ruleStack_limit++;

	/* Return value is the pointer to the new entry, which may be used locally
	 * without de-referencing via the context.
     */
    return  newAttributes;
}







/* ============================================================================= */

/* =============================================================================
 * Start of recognizer
 */


/** \brief Table of all token names in symbolic order, mainly used for
 *         error reporting.
 */
pANTLR3_UINT8   ANTLRv3ParserTokenNames[93+4]
     = {
        (pANTLR3_UINT8) "<invalid>",       /* String to print to indicate an invalid token */
        (pANTLR3_UINT8) "<EOR>",
        (pANTLR3_UINT8) "<DOWN>",
        (pANTLR3_UINT8) "<UP>",
        (pANTLR3_UINT8) "ACTION",
        (pANTLR3_UINT8) "ACTION_CHAR_LITERAL",
        (pANTLR3_UINT8) "ACTION_ESC",
        (pANTLR3_UINT8) "ACTION_STRING_LITERAL",
        (pANTLR3_UINT8) "ALT_V3TOK",
        (pANTLR3_UINT8) "ARGLIST_V3TOK",
        (pANTLR3_UINT8) "ARG_ACTION",
        (pANTLR3_UINT8) "ARG_V3TOK",
        (pANTLR3_UINT8) "AT_V3TOK",
        (pANTLR3_UINT8) "BACKTRACK_SEMPRED_V3TOK",
        (pANTLR3_UINT8) "BANG_V3TOK",
        (pANTLR3_UINT8) "BLOCK_V3TOK",
        (pANTLR3_UINT8) "CATCH_SYM",
        (pANTLR3_UINT8) "CHAR_LITERAL",
        (pANTLR3_UINT8) "CHAR_RANGE_V3TOK",
        (pANTLR3_UINT8) "CLOSURE_V3TOK",
        (pANTLR3_UINT8) "COMBINED_GRAMMAR_V3TOK",
        (pANTLR3_UINT8) "DOC_COMMENT_V3TOK",
        (pANTLR3_UINT8) "DOT_SYM",
        (pANTLR3_UINT8) "DOUBLE_ANGLE_STRING_LITERAL",
        (pANTLR3_UINT8) "DOUBLE_QUOTE_STRING_LITERAL",
        (pANTLR3_UINT8) "EOA_V3TOK",
        (pANTLR3_UINT8) "EOB_V3TOK",
        (pANTLR3_UINT8) "EOR_V3TOK",
        (pANTLR3_UINT8) "EPSILON_V3TOK",
        (pANTLR3_UINT8) "ESC",
        (pANTLR3_UINT8) "FINALLY_SYM",
        (pANTLR3_UINT8) "FRAGMENT_V3TOK",
        (pANTLR3_UINT8) "GATED_SEMPRED_V3TOK",
        (pANTLR3_UINT8) "ID_V3TOK",
        (pANTLR3_UINT8) "INT",
        (pANTLR3_UINT8) "LABEL_ASSIGN_V3TOK",
        (pANTLR3_UINT8) "LABEL_V3TOK",
        (pANTLR3_UINT8) "LEXER_GRAMMAR_V3TOK",
        (pANTLR3_UINT8) "LEXER_V3TOK",
        (pANTLR3_UINT8) "LIST_LABEL_ASSIGN_V3TOK",
        (pANTLR3_UINT8) "LITERAL_CHAR",
        (pANTLR3_UINT8) "ML_COMMENT",
        (pANTLR3_UINT8) "NESTED_ACTION",
        (pANTLR3_UINT8) "NESTED_ARG_ACTION",
        (pANTLR3_UINT8) "OPTIONAL_V3TOK",
        (pANTLR3_UINT8) "OPTIONS",
        (pANTLR3_UINT8) "OPTIONS_SYM",
        (pANTLR3_UINT8) "PARSER_GRAMMAR_V3TOK",
        (pANTLR3_UINT8) "PARSER_V3TOK",
        (pANTLR3_UINT8) "POSITIVE_CLOSURE_V3TOK",
        (pANTLR3_UINT8) "RANGE_V3TOK",
        (pANTLR3_UINT8) "RET_V3TOK",
        (pANTLR3_UINT8) "REWRITE_V3TOK",
        (pANTLR3_UINT8) "ROOT_V3TOK",
        (pANTLR3_UINT8) "RULE_REF",
        (pANTLR3_UINT8) "RULE_V3TOK",
        (pANTLR3_UINT8) "SCOPE_V3TOK",
        (pANTLR3_UINT8) "SEMPRED_V3TOK",
        (pANTLR3_UINT8) "SL_COMMENT",
        (pANTLR3_UINT8) "SRC",
        (pANTLR3_UINT8) "SRC_SYM",
        (pANTLR3_UINT8) "STRING_LITERAL",
        (pANTLR3_UINT8) "SYNPRED_V3TOK",
        (pANTLR3_UINT8) "SYN_SEMPRED_V3TOK",
        (pANTLR3_UINT8) "TEMPLATE_V3TOK",
        (pANTLR3_UINT8) "TOKENS",
        (pANTLR3_UINT8) "TOKENS_SYM",
        (pANTLR3_UINT8) "TOKEN_REF",
        (pANTLR3_UINT8) "TREE_BEGIN_V3TOK",
        (pANTLR3_UINT8) "TREE_GRAMMAR_V3TOK",
        (pANTLR3_UINT8) "WS",
        (pANTLR3_UINT8) "WS_LOOP",
        (pANTLR3_UINT8) "XDIGIT",
        (pANTLR3_UINT8) "'$'",
        (pANTLR3_UINT8) "'('",
        (pANTLR3_UINT8) "')'",
        (pANTLR3_UINT8) "'*'",
        (pANTLR3_UINT8) "'+'",
        (pANTLR3_UINT8) "','",
        (pANTLR3_UINT8) "':'",
        (pANTLR3_UINT8) "'::'",
        (pANTLR3_UINT8) "';'",
        (pANTLR3_UINT8) "'<'",
        (pANTLR3_UINT8) "'=>'",
        (pANTLR3_UINT8) "'>'",
        (pANTLR3_UINT8) "'?'",
        (pANTLR3_UINT8) "'grammar'",
        (pANTLR3_UINT8) "'lexer'",
        (pANTLR3_UINT8) "'parser'",
        (pANTLR3_UINT8) "'private'",
        (pANTLR3_UINT8) "'protected'",
        (pANTLR3_UINT8) "'public'",
        (pANTLR3_UINT8) "'throws'",
        (pANTLR3_UINT8) "'tree'",
        (pANTLR3_UINT8) "'|'",
        (pANTLR3_UINT8) "'}'",
        (pANTLR3_UINT8) "'~'"
       };


/* ruleAttributeScopeFuncMacro(scope)
 */
/** Function for popping the top value from a pANTLRv3Parser_ruleStack
 */
void
pANTLRv3Parser_rulePop(pANTLRv3Parser ctx)
{
    // First see if the user defined a function they want to be called when a
    // scope is popped/freed.
    //
	// If the user supplied the scope entries with a free function,then call it first
	//
    if	(SCOPE_TOP(rule)->free != NULL)
	{
        SCOPE_TOP(rule)->free(SCOPE_TOP(rule));
	}

    // Now we decrement the scope's upper limit bound. We do not actually pop the scope as
    // we want to reuse scope entries if we do continuous push and pops. Most scopes don't
    // next too far so we don't want to keep freeing and allocating them
    //
    ctx->pANTLRv3Parser_ruleStack_limit--;
    SCOPE_TOP(rule) = (pANTLRv3Parser_rule_SCOPE)(ctx->pANTLRv3Parser_ruleStack->get(ctx->pANTLRv3Parser_ruleStack, ctx->pANTLRv3Parser_ruleStack_limit - 1));
}



// Forward declare the locally static matching functions we have generated.
//
static 
 ANTLRv3Parser_grammarDef_return
	grammarDef    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_tokensSpec_return
	tokensSpec    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_tokenSpec_return
	tokenSpec    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_attrScope_return
	attrScope    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_action_return
	action    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_actionScopeName_return
	actionScopeName    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_optionsSpec_return
	optionsSpec    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_option_return
	option    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_optionValue_return
	optionValue    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_rule_return
	rule    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_ruleAction_return
	ruleAction    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_throwsSpec_return
	throwsSpec    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_ruleScopeSpec_return
	ruleScopeSpec    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_block_return
	block    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_altpair_return
	altpair    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_altList_return
	altList    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_alternative_return
	alternative    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_exceptionGroup_return
	exceptionGroup    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_exceptionHandler_return
	exceptionHandler    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_finallyClause_return
	finallyClause    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_element_return
	element    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_atom_return
	atom    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_notSet_return
	notSet    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_notTerminal_return
	notTerminal    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_elementOptions_return
	elementOptions    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_elementOption_return
	elementOption    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_treeSpec_return
	treeSpec    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_range_return
	range    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_terminal_return
	terminal    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_ebnf_return
	ebnf    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_ebnfSuffix_return
	ebnfSuffix    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_rewrite_return
	rewrite    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_rewrite_alternative_return
	rewrite_alternative    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_rewrite_tree_block_return
	rewrite_tree_block    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_rewrite_tree_alternative_return
	rewrite_tree_alternative    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_rewrite_tree_element_return
	rewrite_tree_element    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_rewrite_tree_atom_return
	rewrite_tree_atom    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_rewrite_tree_ebnf_return
	rewrite_tree_ebnf    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_rewrite_tree_return
	rewrite_tree    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_rewrite_template_return
	rewrite_template    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_rewrite_template_ref_return
	rewrite_template_ref    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_rewrite_indirect_template_head_return
	rewrite_indirect_template_head    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_rewrite_template_args_return
	rewrite_template_args    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_rewrite_template_arg_return
	rewrite_template_arg    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_qid_return
	qid    (pANTLRv3Parser ctx);
static 
 ANTLRv3Parser_id_return
	id    (pANTLRv3Parser ctx);
static 
 ANTLR3_BOOLEAN
	synpred100_ANTLRv3    (pANTLRv3Parser ctx);
static 
 ANTLR3_BOOLEAN
	synpred101_ANTLRv3    (pANTLRv3Parser ctx);
static void	ANTLRv3ParserFree(pANTLRv3Parser ctx);
static void     ANTLRv3ParserReset (pANTLRv3Parser ctx);

/* 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);
}

/** \brief Name of the grammar file that generated this code
 */
static const char fileName[] = "ANTLRv3.g";

/** \brief Return the name of the grammar file that generated this code.
 */
static const char * getGrammarFileName()
{
	return fileName;
}
/** \brief Create a new ANTLRv3Parser parser and return a context for it.
 *
 * \param[in] instream Pointer to an input stream interface.
 *
 * \return Pointer to new parser context upon success.
 */
ANTLR3_API pANTLRv3Parser
ANTLRv3ParserNew   (pANTLR3_COMMON_TOKEN_STREAM instream)
{
	// See if we can create a new parser with the standard constructor
	//
	return ANTLRv3ParserNewSSD(instream, NULL);
}

/** \brief Create a new ANTLRv3Parser parser and return a context for it.
 *
 * \param[in] instream Pointer to an input stream interface.
 *
 * \return Pointer to new parser context upon success.
 */
ANTLR3_API pANTLRv3Parser
ANTLRv3ParserNewSSD   (pANTLR3_COMMON_TOKEN_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
{
    pANTLRv3Parser ctx;	    /* Context structure we will build and return   */

    ctx	= (pANTLRv3Parser) ANTLR3_CALLOC(1, sizeof(ANTLRv3Parser));

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

    /* -------------------------------------------------------------------
     * Memory for basic structure is allocated, now to fill in
     * the base ANTLR3 structures. We initialize the function pointers
     * for the standard ANTLR3 parser 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 ANTLRv3Parser.h here, in order that you can get a sense
     * of what goes where.
     */

    /* Create a base parser/recognizer, using the supplied token stream
     */
    ctx->pParser	    = antlr3ParserNewStream(ANTLR3_SIZE_HINT, instream->tstream, state);
    /* Install the implementation of our ANTLRv3Parser interface
     */
    ctx->grammarDef	= grammarDef;
    ctx->tokensSpec	= tokensSpec;
    ctx->tokenSpec	= tokenSpec;
    ctx->attrScope	= attrScope;
    ctx->action	= action;
    ctx->actionScopeName	= actionScopeName;
    ctx->optionsSpec	= optionsSpec;
    ctx->option	= option;
    ctx->optionValue	= optionValue;
    ctx->rule	= rule;
    ctx->ruleAction	= ruleAction;
    ctx->throwsSpec	= throwsSpec;
    ctx->ruleScopeSpec	= ruleScopeSpec;
    ctx->block	= block;
    ctx->altpair	= altpair;
    ctx->altList	= altList;
    ctx->alternative	= alternative;
    ctx->exceptionGroup	= exceptionGroup;
    ctx->exceptionHandler	= exceptionHandler;
    ctx->finallyClause	= finallyClause;
    ctx->element	= element;
    ctx->atom	= atom;
    ctx->notSet	= notSet;
    ctx->notTerminal	= notTerminal;
    ctx->elementOptions	= elementOptions;
    ctx->elementOption	= elementOption;
    ctx->treeSpec	= treeSpec;
    ctx->range	= range;
    ctx->terminal	= terminal;
    ctx->ebnf	= ebnf;
    ctx->ebnfSuffix	= ebnfSuffix;
    ctx->rewrite	= rewrite;
    ctx->rewrite_alternative	= rewrite_alternative;
    ctx->rewrite_tree_block	= rewrite_tree_block;
    ctx->rewrite_tree_alternative	= rewrite_tree_alternative;
    ctx->rewrite_tree_element	= rewrite_tree_element;
    ctx->rewrite_tree_atom	= rewrite_tree_atom;
    ctx->rewrite_tree_ebnf	= rewrite_tree_ebnf;
    ctx->rewrite_tree	= rewrite_tree;
    ctx->rewrite_template	= rewrite_template;
    ctx->rewrite_template_ref	= rewrite_template_ref;
    ctx->rewrite_indirect_template_head	= rewrite_indirect_template_head;
    ctx->rewrite_template_args	= rewrite_template_args;
    ctx->rewrite_template_arg	= rewrite_template_arg;
    ctx->qid	= qid;
    ctx->id	= id;
    ctx->synpred100_ANTLRv3	= synpred100_ANTLRv3;
    ctx->synpred101_ANTLRv3	= synpred101_ANTLRv3;
    ctx->free			= ANTLRv3ParserFree;
    ctx->reset			= ANTLRv3ParserReset;
    ctx->getGrammarFileName	= getGrammarFileName;

    /* Install the scope pushing methods.
     */
    /* ruleAttributeScope(scope)
     */
    ctx->pANTLRv3Parser_rulePush     = pANTLRv3Parser_rulePush;
    ctx->pANTLRv3Parser_ruleStack    = antlr3StackNew(0);
    ctx->pANTLRv3Parser_ruleStack_limit    = 0;
    ctx->pANTLRv3Parser_ruleTop      = NULL;



ADAPTOR	= ANTLR3_TREE_ADAPTORNew(instream->tstream->tokenSource->strFactory);

ctx->vectors	= antlr3VectorFactoryNew(0);
    /* Install the token table
     */
    PSRSTATE->tokenNames   = ANTLRv3ParserTokenNames;


    /* Return the newly built parser to the caller
     */
    return  ctx;
}

static void
ANTLRv3ParserReset (pANTLRv3Parser ctx)
{
    RECOGNIZER->reset(RECOGNIZER);
}

/** Free the parser resources
 */
 static void
 ANTLRv3ParserFree(pANTLRv3Parser ctx)
 {
    /* Free any scope memory
     */
    /* ruleAttributeScope(scope)
     */
    ctx->pANTLRv3Parser_ruleStack->free(ctx->pANTLRv3Parser_ruleStack);



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;
 }

/** Return token names used by this 
parser

 *
 * The returned pointer is used as an index into the token names table (using the token
 * number as the index).
 *
 * \return Pointer to first char * in the table.
 */
static pANTLR3_UINT8    *getTokenNames()
{
        return ANTLRv3ParserTokenNames;
}


    	int gtype;


/* Declare the bitsets
 */
/** Bitset defining follow set for error recovery in rule state: FOLLOW_DOC_COMMENT_V3TOK_in_grammarDef392  */
static	ANTLR3_BITWORD FOLLOW_DOC_COMMENT_V3TOK_in_grammarDef392_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000021C00000) };
static  ANTLR3_BITSET_LIST FOLLOW_DOC_COMMENT_V3TOK_in_grammarDef392	= { FOLLOW_DOC_COMMENT_V3TOK_in_grammarDef392_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_87_in_grammarDef406  */
static	ANTLR3_BITWORD FOLLOW_87_in_grammarDef406_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000400000) };
static  ANTLR3_BITSET_LIST FOLLOW_87_in_grammarDef406	= { FOLLOW_87_in_grammarDef406_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_88_in_grammarDef422  */
static	ANTLR3_BITWORD FOLLOW_88_in_grammarDef422_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000400000) };
static  ANTLR3_BITSET_LIST FOLLOW_88_in_grammarDef422	= { FOLLOW_88_in_grammarDef422_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_93_in_grammarDef436  */
static	ANTLR3_BITWORD FOLLOW_93_in_grammarDef436_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000400000) };
static  ANTLR3_BITSET_LIST FOLLOW_93_in_grammarDef436	= { FOLLOW_93_in_grammarDef436_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_86_in_grammarDef468  */
static	ANTLR3_BITWORD FOLLOW_86_in_grammarDef468_bits[]	= { ANTLR3_UINT64_LIT(0x0040000000000000), ANTLR3_UINT64_LIT(0x0000000000000008) };
static  ANTLR3_BITSET_LIST FOLLOW_86_in_grammarDef468	= { FOLLOW_86_in_grammarDef468_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_id_in_grammarDef470  */
static	ANTLR3_BITWORD FOLLOW_id_in_grammarDef470_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000020000) };
static  ANTLR3_BITSET_LIST FOLLOW_id_in_grammarDef470	= { FOLLOW_id_in_grammarDef470_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_81_in_grammarDef472  */
static	ANTLR3_BITWORD FOLLOW_81_in_grammarDef472_bits[]	= { ANTLR3_UINT64_LIT(0x0140200080201000), ANTLR3_UINT64_LIT(0x000000000E00000A) };
static  ANTLR3_BITSET_LIST FOLLOW_81_in_grammarDef472	= { FOLLOW_81_in_grammarDef472_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_optionsSpec_in_grammarDef474  */
static	ANTLR3_BITWORD FOLLOW_optionsSpec_in_grammarDef474_bits[]	= { ANTLR3_UINT64_LIT(0x0140000080201000), ANTLR3_UINT64_LIT(0x000000000E00000A) };
static  ANTLR3_BITSET_LIST FOLLOW_optionsSpec_in_grammarDef474	= { FOLLOW_optionsSpec_in_grammarDef474_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_tokensSpec_in_grammarDef477  */
static	ANTLR3_BITWORD FOLLOW_tokensSpec_in_grammarDef477_bits[]	= { ANTLR3_UINT64_LIT(0x0140000080201000), ANTLR3_UINT64_LIT(0x000000000E000008) };
static  ANTLR3_BITSET_LIST FOLLOW_tokensSpec_in_grammarDef477	= { FOLLOW_tokensSpec_in_grammarDef477_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_attrScope_in_grammarDef480  */
static	ANTLR3_BITWORD FOLLOW_attrScope_in_grammarDef480_bits[]	= { ANTLR3_UINT64_LIT(0x0140000080201000), ANTLR3_UINT64_LIT(0x000000000E000008) };
static  ANTLR3_BITSET_LIST FOLLOW_attrScope_in_grammarDef480	= { FOLLOW_attrScope_in_grammarDef480_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_action_in_grammarDef483  */
static	ANTLR3_BITWORD FOLLOW_action_in_grammarDef483_bits[]	= { ANTLR3_UINT64_LIT(0x0040000080201000), ANTLR3_UINT64_LIT(0x000000000E000008) };
static  ANTLR3_BITSET_LIST FOLLOW_action_in_grammarDef483	= { FOLLOW_action_in_grammarDef483_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_rule_in_grammarDef486  */
static	ANTLR3_BITWORD FOLLOW_rule_in_grammarDef486_bits[]	= { ANTLR3_UINT64_LIT(0x0040000080200000), ANTLR3_UINT64_LIT(0x000000000E000008) };
static  ANTLR3_BITSET_LIST FOLLOW_rule_in_grammarDef486	= { FOLLOW_rule_in_grammarDef486_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_EOF_in_grammarDef489  */
static	ANTLR3_BITWORD FOLLOW_EOF_in_grammarDef489_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_EOF_in_grammarDef489	= { FOLLOW_EOF_in_grammarDef489_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_TOKENS_in_tokensSpec550  */
static	ANTLR3_BITWORD FOLLOW_TOKENS_in_tokensSpec550_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000008) };
static  ANTLR3_BITSET_LIST FOLLOW_TOKENS_in_tokensSpec550	= { FOLLOW_TOKENS_in_tokensSpec550_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_tokenSpec_in_tokensSpec552  */
static	ANTLR3_BITWORD FOLLOW_tokenSpec_in_tokensSpec552_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000080000008) };
static  ANTLR3_BITSET_LIST FOLLOW_tokenSpec_in_tokensSpec552	= { FOLLOW_tokenSpec_in_tokensSpec552_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_95_in_tokensSpec555  */
static	ANTLR3_BITWORD FOLLOW_95_in_tokensSpec555_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_95_in_tokensSpec555	= { FOLLOW_95_in_tokensSpec555_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_TOKEN_REF_in_tokenSpec575  */
static	ANTLR3_BITWORD FOLLOW_TOKEN_REF_in_tokenSpec575_bits[]	= { ANTLR3_UINT64_LIT(0x0000000800000000), ANTLR3_UINT64_LIT(0x0000000000020000) };
static  ANTLR3_BITSET_LIST FOLLOW_TOKEN_REF_in_tokenSpec575	= { FOLLOW_TOKEN_REF_in_tokenSpec575_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LABEL_ASSIGN_V3TOK_in_tokenSpec581  */
static	ANTLR3_BITWORD FOLLOW_LABEL_ASSIGN_V3TOK_in_tokenSpec581_bits[]	= { ANTLR3_UINT64_LIT(0x2000000000020000) };
static  ANTLR3_BITSET_LIST FOLLOW_LABEL_ASSIGN_V3TOK_in_tokenSpec581	= { FOLLOW_LABEL_ASSIGN_V3TOK_in_tokenSpec581_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_STRING_LITERAL_in_tokenSpec586  */
static	ANTLR3_BITWORD FOLLOW_STRING_LITERAL_in_tokenSpec586_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000020000) };
static  ANTLR3_BITSET_LIST FOLLOW_STRING_LITERAL_in_tokenSpec586	= { FOLLOW_STRING_LITERAL_in_tokenSpec586_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_CHAR_LITERAL_in_tokenSpec590  */
static	ANTLR3_BITWORD FOLLOW_CHAR_LITERAL_in_tokenSpec590_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000020000) };
static  ANTLR3_BITSET_LIST FOLLOW_CHAR_LITERAL_in_tokenSpec590	= { FOLLOW_CHAR_LITERAL_in_tokenSpec590_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_81_in_tokenSpec629  */
static	ANTLR3_BITWORD FOLLOW_81_in_tokenSpec629_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_81_in_tokenSpec629	= { FOLLOW_81_in_tokenSpec629_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_SCOPE_V3TOK_in_attrScope640  */
static	ANTLR3_BITWORD FOLLOW_SCOPE_V3TOK_in_attrScope640_bits[]	= { ANTLR3_UINT64_LIT(0x0040000000000000), ANTLR3_UINT64_LIT(0x0000000000000008) };
static  ANTLR3_BITSET_LIST FOLLOW_SCOPE_V3TOK_in_attrScope640	= { FOLLOW_SCOPE_V3TOK_in_attrScope640_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_id_in_attrScope642  */
static	ANTLR3_BITWORD FOLLOW_id_in_attrScope642_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000010) };
static  ANTLR3_BITSET_LIST FOLLOW_id_in_attrScope642	= { FOLLOW_id_in_attrScope642_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ACTION_in_attrScope644  */
static	ANTLR3_BITWORD FOLLOW_ACTION_in_attrScope644_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_ACTION_in_attrScope644	= { FOLLOW_ACTION_in_attrScope644_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_AT_V3TOK_in_action667  */
static	ANTLR3_BITWORD FOLLOW_AT_V3TOK_in_action667_bits[]	= { ANTLR3_UINT64_LIT(0x0040000000000000), ANTLR3_UINT64_LIT(0x0000000001800008) };
static  ANTLR3_BITSET_LIST FOLLOW_AT_V3TOK_in_action667	= { FOLLOW_AT_V3TOK_in_action667_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_actionScopeName_in_action670  */
static	ANTLR3_BITWORD FOLLOW_actionScopeName_in_action670_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000010000) };
static  ANTLR3_BITSET_LIST FOLLOW_actionScopeName_in_action670	= { FOLLOW_actionScopeName_in_action670_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_80_in_action672  */
static	ANTLR3_BITWORD FOLLOW_80_in_action672_bits[]	= { ANTLR3_UINT64_LIT(0x0040000000000000), ANTLR3_UINT64_LIT(0x0000000000000008) };
static  ANTLR3_BITSET_LIST FOLLOW_80_in_action672	= { FOLLOW_80_in_action672_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_id_in_action676  */
static	ANTLR3_BITWORD FOLLOW_id_in_action676_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000010) };
static  ANTLR3_BITSET_LIST FOLLOW_id_in_action676	= { FOLLOW_id_in_action676_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ACTION_in_action678  */
static	ANTLR3_BITWORD FOLLOW_ACTION_in_action678_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_ACTION_in_action678	= { FOLLOW_ACTION_in_action678_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_id_in_actionScopeName703  */
static	ANTLR3_BITWORD FOLLOW_id_in_actionScopeName703_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_id_in_actionScopeName703	= { FOLLOW_id_in_actionScopeName703_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_87_in_actionScopeName712  */
static	ANTLR3_BITWORD FOLLOW_87_in_actionScopeName712_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_87_in_actionScopeName712	= { FOLLOW_87_in_actionScopeName712_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_88_in_actionScopeName727  */
static	ANTLR3_BITWORD FOLLOW_88_in_actionScopeName727_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_88_in_actionScopeName727	= { FOLLOW_88_in_actionScopeName727_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_OPTIONS_in_optionsSpec742  */
static	ANTLR3_BITWORD FOLLOW_OPTIONS_in_optionsSpec742_bits[]	= { ANTLR3_UINT64_LIT(0x0040000000000000), ANTLR3_UINT64_LIT(0x0000000000000008) };
static  ANTLR3_BITSET_LIST FOLLOW_OPTIONS_in_optionsSpec742	= { FOLLOW_OPTIONS_in_optionsSpec742_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_option_in_optionsSpec745  */
static	ANTLR3_BITWORD FOLLOW_option_in_optionsSpec745_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000020000) };
static  ANTLR3_BITSET_LIST FOLLOW_option_in_optionsSpec745	= { FOLLOW_option_in_optionsSpec745_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_81_in_optionsSpec747  */
static	ANTLR3_BITWORD FOLLOW_81_in_optionsSpec747_bits[]	= { ANTLR3_UINT64_LIT(0x0040000000000000), ANTLR3_UINT64_LIT(0x0000000080000008) };
static  ANTLR3_BITSET_LIST FOLLOW_81_in_optionsSpec747	= { FOLLOW_81_in_optionsSpec747_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_95_in_optionsSpec751  */
static	ANTLR3_BITWORD FOLLOW_95_in_optionsSpec751_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_95_in_optionsSpec751	= { FOLLOW_95_in_optionsSpec751_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_id_in_option776  */
static	ANTLR3_BITWORD FOLLOW_id_in_option776_bits[]	= { ANTLR3_UINT64_LIT(0x0000000800000000) };
static  ANTLR3_BITSET_LIST FOLLOW_id_in_option776	= { FOLLOW_id_in_option776_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LABEL_ASSIGN_V3TOK_in_option778  */
static	ANTLR3_BITWORD FOLLOW_LABEL_ASSIGN_V3TOK_in_option778_bits[]	= { ANTLR3_UINT64_LIT(0x2040000400020000), ANTLR3_UINT64_LIT(0x0000000000001008) };
static  ANTLR3_BITSET_LIST FOLLOW_LABEL_ASSIGN_V3TOK_in_option778	= { FOLLOW_LABEL_ASSIGN_V3TOK_in_option778_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_optionValue_in_option780  */
static	ANTLR3_BITWORD FOLLOW_optionValue_in_option780_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_optionValue_in_option780	= { FOLLOW_optionValue_in_option780_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_qid_in_optionValue809  */
static	ANTLR3_BITWORD FOLLOW_qid_in_optionValue809_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_qid_in_optionValue809	= { FOLLOW_qid_in_optionValue809_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_STRING_LITERAL_in_optionValue819  */
static	ANTLR3_BITWORD FOLLOW_STRING_LITERAL_in_optionValue819_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_STRING_LITERAL_in_optionValue819	= { FOLLOW_STRING_LITERAL_in_optionValue819_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_CHAR_LITERAL_in_optionValue829  */
static	ANTLR3_BITWORD FOLLOW_CHAR_LITERAL_in_optionValue829_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_CHAR_LITERAL_in_optionValue829	= { FOLLOW_CHAR_LITERAL_in_optionValue829_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_INT_in_optionValue839  */
static	ANTLR3_BITWORD FOLLOW_INT_in_optionValue839_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_INT_in_optionValue839	= { FOLLOW_INT_in_optionValue839_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_76_in_optionValue849  */
static	ANTLR3_BITWORD FOLLOW_76_in_optionValue849_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_76_in_optionValue849	= { FOLLOW_76_in_optionValue849_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_DOC_COMMENT_V3TOK_in_rule874  */
static	ANTLR3_BITWORD FOLLOW_DOC_COMMENT_V3TOK_in_rule874_bits[]	= { ANTLR3_UINT64_LIT(0x0040000080000000), ANTLR3_UINT64_LIT(0x000000000E000008) };
static  ANTLR3_BITSET_LIST FOLLOW_DOC_COMMENT_V3TOK_in_rule874	= { FOLLOW_DOC_COMMENT_V3TOK_in_rule874_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_90_in_rule884  */
static	ANTLR3_BITWORD FOLLOW_90_in_rule884_bits[]	= { ANTLR3_UINT64_LIT(0x0040000000000000), ANTLR3_UINT64_LIT(0x0000000000000008) };
static  ANTLR3_BITSET_LIST FOLLOW_90_in_rule884	= { FOLLOW_90_in_rule884_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_91_in_rule886  */
static	ANTLR3_BITWORD FOLLOW_91_in_rule886_bits[]	= { ANTLR3_UINT64_LIT(0x0040000000000000), ANTLR3_UINT64_LIT(0x0000000000000008) };
static  ANTLR3_BITSET_LIST FOLLOW_91_in_rule886	= { FOLLOW_91_in_rule886_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_89_in_rule888  */
static	ANTLR3_BITWORD FOLLOW_89_in_rule888_bits[]	= { ANTLR3_UINT64_LIT(0x0040000000000000), ANTLR3_UINT64_LIT(0x0000000000000008) };
static  ANTLR3_BITSET_LIST FOLLOW_89_in_rule888	= { FOLLOW_89_in_rule888_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_FRAGMENT_V3TOK_in_rule890  */
static	ANTLR3_BITWORD FOLLOW_FRAGMENT_V3TOK_in_rule890_bits[]	= { ANTLR3_UINT64_LIT(0x0040000000000000), ANTLR3_UINT64_LIT(0x0000000000000008) };
static  ANTLR3_BITSET_LIST FOLLOW_FRAGMENT_V3TOK_in_rule890	= { FOLLOW_FRAGMENT_V3TOK_in_rule890_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_id_in_rule898  */
static	ANTLR3_BITWORD FOLLOW_id_in_rule898_bits[]	= { ANTLR3_UINT64_LIT(0x0108200000005400), ANTLR3_UINT64_LIT(0x0000000010008000) };
static  ANTLR3_BITSET_LIST FOLLOW_id_in_rule898	= { FOLLOW_id_in_rule898_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_BANG_V3TOK_in_rule904  */
static	ANTLR3_BITWORD FOLLOW_BANG_V3TOK_in_rule904_bits[]	= { ANTLR3_UINT64_LIT(0x0108200000001400), ANTLR3_UINT64_LIT(0x0000000010008000) };
static  ANTLR3_BITSET_LIST FOLLOW_BANG_V3TOK_in_rule904	= { FOLLOW_BANG_V3TOK_in_rule904_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ARG_ACTION_in_rule913  */
static	ANTLR3_BITWORD FOLLOW_ARG_ACTION_in_rule913_bits[]	= { ANTLR3_UINT64_LIT(0x0108200000001000), ANTLR3_UINT64_LIT(0x0000000010008000) };
static  ANTLR3_BITSET_LIST FOLLOW_ARG_ACTION_in_rule913	= { FOLLOW_ARG_ACTION_in_rule913_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RET_V3TOK_in_rule922  */
static	ANTLR3_BITWORD FOLLOW_RET_V3TOK_in_rule922_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000400) };
static  ANTLR3_BITSET_LIST FOLLOW_RET_V3TOK_in_rule922	= { FOLLOW_RET_V3TOK_in_rule922_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ARG_ACTION_in_rule926  */
static	ANTLR3_BITWORD FOLLOW_ARG_ACTION_in_rule926_bits[]	= { ANTLR3_UINT64_LIT(0x0100200000001000), ANTLR3_UINT64_LIT(0x0000000010008000) };
static  ANTLR3_BITSET_LIST FOLLOW_ARG_ACTION_in_rule926	= { FOLLOW_ARG_ACTION_in_rule926_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_throwsSpec_in_rule934  */
static	ANTLR3_BITWORD FOLLOW_throwsSpec_in_rule934_bits[]	= { ANTLR3_UINT64_LIT(0x0100200000001000), ANTLR3_UINT64_LIT(0x0000000000008000) };
static  ANTLR3_BITSET_LIST FOLLOW_throwsSpec_in_rule934	= { FOLLOW_throwsSpec_in_rule934_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_optionsSpec_in_rule937  */
static	ANTLR3_BITWORD FOLLOW_optionsSpec_in_rule937_bits[]	= { ANTLR3_UINT64_LIT(0x0100000000001000), ANTLR3_UINT64_LIT(0x0000000000008000) };
static  ANTLR3_BITSET_LIST FOLLOW_optionsSpec_in_rule937	= { FOLLOW_optionsSpec_in_rule937_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ruleScopeSpec_in_rule940  */
static	ANTLR3_BITWORD FOLLOW_ruleScopeSpec_in_rule940_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000001000), ANTLR3_UINT64_LIT(0x0000000000008000) };
static  ANTLR3_BITSET_LIST FOLLOW_ruleScopeSpec_in_rule940	= { FOLLOW_ruleScopeSpec_in_rule940_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ruleAction_in_rule943  */
static	ANTLR3_BITWORD FOLLOW_ruleAction_in_rule943_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000001000), ANTLR3_UINT64_LIT(0x0000000000008000) };
static  ANTLR3_BITSET_LIST FOLLOW_ruleAction_in_rule943	= { FOLLOW_ruleAction_in_rule943_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_79_in_rule948  */
static	ANTLR3_BITWORD FOLLOW_79_in_rule948_bits[]	= { ANTLR3_UINT64_LIT(0x2250000000420010), ANTLR3_UINT64_LIT(0x0000000100000418) };
static  ANTLR3_BITSET_LIST FOLLOW_79_in_rule948	= { FOLLOW_79_in_rule948_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_altList_in_rule950  */
static	ANTLR3_BITWORD FOLLOW_altList_in_rule950_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000020000) };
static  ANTLR3_BITSET_LIST FOLLOW_altList_in_rule950	= { FOLLOW_altList_in_rule950_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_81_in_rule952  */
static	ANTLR3_BITWORD FOLLOW_81_in_rule952_bits[]	= { ANTLR3_UINT64_LIT(0x0000000040010002) };
static  ANTLR3_BITSET_LIST FOLLOW_81_in_rule952	= { FOLLOW_81_in_rule952_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_exceptionGroup_in_rule956  */
static	ANTLR3_BITWORD FOLLOW_exceptionGroup_in_rule956_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_exceptionGroup_in_rule956	= { FOLLOW_exceptionGroup_in_rule956_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_AT_V3TOK_in_ruleAction1060  */
static	ANTLR3_BITWORD FOLLOW_AT_V3TOK_in_ruleAction1060_bits[]	= { ANTLR3_UINT64_LIT(0x0040000000000000), ANTLR3_UINT64_LIT(0x0000000000000008) };
static  ANTLR3_BITSET_LIST FOLLOW_AT_V3TOK_in_ruleAction1060	= { FOLLOW_AT_V3TOK_in_ruleAction1060_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_id_in_ruleAction1062  */
static	ANTLR3_BITWORD FOLLOW_id_in_ruleAction1062_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000010) };
static  ANTLR3_BITSET_LIST FOLLOW_id_in_ruleAction1062	= { FOLLOW_id_in_ruleAction1062_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ACTION_in_ruleAction1064  */
static	ANTLR3_BITWORD FOLLOW_ACTION_in_ruleAction1064_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_ACTION_in_ruleAction1064	= { FOLLOW_ACTION_in_ruleAction1064_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_92_in_throwsSpec1085  */
static	ANTLR3_BITWORD FOLLOW_92_in_throwsSpec1085_bits[]	= { ANTLR3_UINT64_LIT(0x0040000000000000), ANTLR3_UINT64_LIT(0x0000000000000008) };
static  ANTLR3_BITSET_LIST FOLLOW_92_in_throwsSpec1085	= { FOLLOW_92_in_throwsSpec1085_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_id_in_throwsSpec1087  */
static	ANTLR3_BITWORD FOLLOW_id_in_throwsSpec1087_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000004000) };
static  ANTLR3_BITSET_LIST FOLLOW_id_in_throwsSpec1087	= { FOLLOW_id_in_throwsSpec1087_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_78_in_throwsSpec1091  */
static	ANTLR3_BITWORD FOLLOW_78_in_throwsSpec1091_bits[]	= { ANTLR3_UINT64_LIT(0x0040000000000000), ANTLR3_UINT64_LIT(0x0000000000000008) };
static  ANTLR3_BITSET_LIST FOLLOW_78_in_throwsSpec1091	= { FOLLOW_78_in_throwsSpec1091_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_id_in_throwsSpec1093  */
static	ANTLR3_BITWORD FOLLOW_id_in_throwsSpec1093_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000004000) };
static  ANTLR3_BITSET_LIST FOLLOW_id_in_throwsSpec1093	= { FOLLOW_id_in_throwsSpec1093_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_SCOPE_V3TOK_in_ruleScopeSpec1116  */
static	ANTLR3_BITWORD FOLLOW_SCOPE_V3TOK_in_ruleScopeSpec1116_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000010) };
static  ANTLR3_BITSET_LIST FOLLOW_SCOPE_V3TOK_in_ruleScopeSpec1116	= { FOLLOW_SCOPE_V3TOK_in_ruleScopeSpec1116_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ACTION_in_ruleScopeSpec1118  */
static	ANTLR3_BITWORD FOLLOW_ACTION_in_ruleScopeSpec1118_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_ACTION_in_ruleScopeSpec1118	= { FOLLOW_ACTION_in_ruleScopeSpec1118_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_SCOPE_V3TOK_in_ruleScopeSpec1131  */
static	ANTLR3_BITWORD FOLLOW_SCOPE_V3TOK_in_ruleScopeSpec1131_bits[]	= { ANTLR3_UINT64_LIT(0x0040000000000000), ANTLR3_UINT64_LIT(0x0000000000000008) };
static  ANTLR3_BITSET_LIST FOLLOW_SCOPE_V3TOK_in_ruleScopeSpec1131	= { FOLLOW_SCOPE_V3TOK_in_ruleScopeSpec1131_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_id_in_ruleScopeSpec1133  */
static	ANTLR3_BITWORD FOLLOW_id_in_ruleScopeSpec1133_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000024000) };
static  ANTLR3_BITSET_LIST FOLLOW_id_in_ruleScopeSpec1133	= { FOLLOW_id_in_ruleScopeSpec1133_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_78_in_ruleScopeSpec1136  */
static	ANTLR3_BITWORD FOLLOW_78_in_ruleScopeSpec1136_bits[]	= { ANTLR3_UINT64_LIT(0x0040000000000000), ANTLR3_UINT64_LIT(0x0000000000000008) };
static  ANTLR3_BITSET_LIST FOLLOW_78_in_ruleScopeSpec1136	= { FOLLOW_78_in_ruleScopeSpec1136_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_id_in_ruleScopeSpec1138  */
static	ANTLR3_BITWORD FOLLOW_id_in_ruleScopeSpec1138_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000024000) };
static  ANTLR3_BITSET_LIST FOLLOW_id_in_ruleScopeSpec1138	= { FOLLOW_id_in_ruleScopeSpec1138_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_81_in_ruleScopeSpec1142  */
static	ANTLR3_BITWORD FOLLOW_81_in_ruleScopeSpec1142_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_81_in_ruleScopeSpec1142	= { FOLLOW_81_in_ruleScopeSpec1142_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_SCOPE_V3TOK_in_ruleScopeSpec1156  */
static	ANTLR3_BITWORD FOLLOW_SCOPE_V3TOK_in_ruleScopeSpec1156_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000010) };
static  ANTLR3_BITSET_LIST FOLLOW_SCOPE_V3TOK_in_ruleScopeSpec1156	= { FOLLOW_SCOPE_V3TOK_in_ruleScopeSpec1156_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ACTION_in_ruleScopeSpec1158  */
static	ANTLR3_BITWORD FOLLOW_ACTION_in_ruleScopeSpec1158_bits[]	= { ANTLR3_UINT64_LIT(0x0100000000000000) };
static  ANTLR3_BITSET_LIST FOLLOW_ACTION_in_ruleScopeSpec1158	= { FOLLOW_ACTION_in_ruleScopeSpec1158_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_SCOPE_V3TOK_in_ruleScopeSpec1162  */
static	ANTLR3_BITWORD FOLLOW_SCOPE_V3TOK_in_ruleScopeSpec1162_bits[]	= { ANTLR3_UINT64_LIT(0x0040000000000000), ANTLR3_UINT64_LIT(0x0000000000000008) };
static  ANTLR3_BITSET_LIST FOLLOW_SCOPE_V3TOK_in_ruleScopeSpec1162	= { FOLLOW_SCOPE_V3TOK_in_ruleScopeSpec1162_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_id_in_ruleScopeSpec1164  */
static	ANTLR3_BITWORD FOLLOW_id_in_ruleScopeSpec1164_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000024000) };
static  ANTLR3_BITSET_LIST FOLLOW_id_in_ruleScopeSpec1164	= { FOLLOW_id_in_ruleScopeSpec1164_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_78_in_ruleScopeSpec1167  */
static	ANTLR3_BITWORD FOLLOW_78_in_ruleScopeSpec1167_bits[]	= { ANTLR3_UINT64_LIT(0x0040000000000000), ANTLR3_UINT64_LIT(0x0000000000000008) };
static  ANTLR3_BITSET_LIST FOLLOW_78_in_ruleScopeSpec1167	= { FOLLOW_78_in_ruleScopeSpec1167_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_id_in_ruleScopeSpec1169  */
static	ANTLR3_BITWORD FOLLOW_id_in_ruleScopeSpec1169_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000024000) };
static  ANTLR3_BITSET_LIST FOLLOW_id_in_ruleScopeSpec1169	= { FOLLOW_id_in_ruleScopeSpec1169_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_81_in_ruleScopeSpec1173  */
static	ANTLR3_BITWORD FOLLOW_81_in_ruleScopeSpec1173_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_81_in_ruleScopeSpec1173	= { FOLLOW_81_in_ruleScopeSpec1173_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_74_in_block1201  */
static	ANTLR3_BITWORD FOLLOW_74_in_block1201_bits[]	= { ANTLR3_UINT64_LIT(0x2250200000420010), ANTLR3_UINT64_LIT(0x0000000100008418) };
static  ANTLR3_BITSET_LIST FOLLOW_74_in_block1201	= { FOLLOW_74_in_block1201_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_optionsSpec_in_block1209  */
static	ANTLR3_BITWORD FOLLOW_optionsSpec_in_block1209_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000008000) };
static  ANTLR3_BITSET_LIST FOLLOW_optionsSpec_in_block1209	= { FOLLOW_optionsSpec_in_block1209_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_79_in_block1213  */
static	ANTLR3_BITWORD FOLLOW_79_in_block1213_bits[]	= { ANTLR3_UINT64_LIT(0x2250000000420010), ANTLR3_UINT64_LIT(0x0000000100000418) };
static  ANTLR3_BITSET_LIST FOLLOW_79_in_block1213	= { FOLLOW_79_in_block1213_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_altpair_in_block1218  */
static	ANTLR3_BITWORD FOLLOW_altpair_in_block1218_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000040000800) };
static  ANTLR3_BITSET_LIST FOLLOW_altpair_in_block1218	= { FOLLOW_altpair_in_block1218_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_94_in_block1222  */
static	ANTLR3_BITWORD FOLLOW_94_in_block1222_bits[]	= { ANTLR3_UINT64_LIT(0x2250000000420010), ANTLR3_UINT64_LIT(0x0000000100000418) };
static  ANTLR3_BITSET_LIST FOLLOW_94_in_block1222	= { FOLLOW_94_in_block1222_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_altpair_in_block1224  */
static	ANTLR3_BITWORD FOLLOW_altpair_in_block1224_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000040000800) };
static  ANTLR3_BITSET_LIST FOLLOW_altpair_in_block1224	= { FOLLOW_altpair_in_block1224_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_75_in_block1233  */
static	ANTLR3_BITWORD FOLLOW_75_in_block1233_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_75_in_block1233	= { FOLLOW_75_in_block1233_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_alternative_in_altpair1262  */
static	ANTLR3_BITWORD FOLLOW_alternative_in_altpair1262_bits[]	= { ANTLR3_UINT64_LIT(0x0010000000000000) };
static  ANTLR3_BITSET_LIST FOLLOW_alternative_in_altpair1262	= { FOLLOW_alternative_in_altpair1262_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_rewrite_in_altpair1264  */
static	ANTLR3_BITWORD FOLLOW_rewrite_in_altpair1264_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_rewrite_in_altpair1264	= { FOLLOW_rewrite_in_altpair1264_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_altpair_in_altList1278  */
static	ANTLR3_BITWORD FOLLOW_altpair_in_altList1278_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000040000000) };
static  ANTLR3_BITSET_LIST FOLLOW_altpair_in_altList1278	= { FOLLOW_altpair_in_altList1278_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_94_in_altList1282  */
static	ANTLR3_BITWORD FOLLOW_94_in_altList1282_bits[]	= { ANTLR3_UINT64_LIT(0x2250000000420010), ANTLR3_UINT64_LIT(0x0000000100000418) };
static  ANTLR3_BITSET_LIST FOLLOW_94_in_altList1282	= { FOLLOW_94_in_altList1282_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_altpair_in_altList1284  */
static	ANTLR3_BITWORD FOLLOW_altpair_in_altList1284_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000040000000) };
static  ANTLR3_BITSET_LIST FOLLOW_altpair_in_altList1284	= { FOLLOW_altpair_in_altList1284_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_element_in_alternative1322  */
static	ANTLR3_BITWORD FOLLOW_element_in_alternative1322_bits[]	= { ANTLR3_UINT64_LIT(0x2240000000420012), ANTLR3_UINT64_LIT(0x0000000100000418) };
static  ANTLR3_BITSET_LIST FOLLOW_element_in_alternative1322	= { FOLLOW_element_in_alternative1322_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_exceptionHandler_in_exceptionGroup1373  */
static	ANTLR3_BITWORD FOLLOW_exceptionHandler_in_exceptionGroup1373_bits[]	= { ANTLR3_UINT64_LIT(0x0000000040010002) };
static  ANTLR3_BITSET_LIST FOLLOW_exceptionHandler_in_exceptionGroup1373	= { FOLLOW_exceptionHandler_in_exceptionGroup1373_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_finallyClause_in_exceptionGroup1380  */
static	ANTLR3_BITWORD FOLLOW_finallyClause_in_exceptionGroup1380_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_finallyClause_in_exceptionGroup1380	= { FOLLOW_finallyClause_in_exceptionGroup1380_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_finallyClause_in_exceptionGroup1388  */
static	ANTLR3_BITWORD FOLLOW_finallyClause_in_exceptionGroup1388_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_finallyClause_in_exceptionGroup1388	= { FOLLOW_finallyClause_in_exceptionGroup1388_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_CATCH_SYM_in_exceptionHandler1408  */
static	ANTLR3_BITWORD FOLLOW_CATCH_SYM_in_exceptionHandler1408_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000400) };
static  ANTLR3_BITSET_LIST FOLLOW_CATCH_SYM_in_exceptionHandler1408	= { FOLLOW_CATCH_SYM_in_exceptionHandler1408_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ARG_ACTION_in_exceptionHandler1410  */
static	ANTLR3_BITWORD FOLLOW_ARG_ACTION_in_exceptionHandler1410_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000010) };
static  ANTLR3_BITSET_LIST FOLLOW_ARG_ACTION_in_exceptionHandler1410	= { FOLLOW_ARG_ACTION_in_exceptionHandler1410_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ACTION_in_exceptionHandler1412  */
static	ANTLR3_BITWORD FOLLOW_ACTION_in_exceptionHandler1412_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_ACTION_in_exceptionHandler1412	= { FOLLOW_ACTION_in_exceptionHandler1412_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_FINALLY_SYM_in_finallyClause1442  */
static	ANTLR3_BITWORD FOLLOW_FINALLY_SYM_in_finallyClause1442_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000010) };
static  ANTLR3_BITSET_LIST FOLLOW_FINALLY_SYM_in_finallyClause1442	= { FOLLOW_FINALLY_SYM_in_finallyClause1442_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ACTION_in_finallyClause1444  */
static	ANTLR3_BITWORD FOLLOW_ACTION_in_finallyClause1444_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_ACTION_in_finallyClause1444	= { FOLLOW_ACTION_in_finallyClause1444_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_id_in_element1466  */
static	ANTLR3_BITWORD FOLLOW_id_in_element1466_bits[]	= { ANTLR3_UINT64_LIT(0x0000008800000000) };
static  ANTLR3_BITSET_LIST FOLLOW_id_in_element1466	= { FOLLOW_id_in_element1466_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LABEL_ASSIGN_V3TOK_in_element1471  */
static	ANTLR3_BITWORD FOLLOW_LABEL_ASSIGN_V3TOK_in_element1471_bits[]	= { ANTLR3_UINT64_LIT(0x2040000000420000), ANTLR3_UINT64_LIT(0x0000000100000008) };
static  ANTLR3_BITSET_LIST FOLLOW_LABEL_ASSIGN_V3TOK_in_element1471	= { FOLLOW_LABEL_ASSIGN_V3TOK_in_element1471_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LIST_LABEL_ASSIGN_V3TOK_in_element1475  */
static	ANTLR3_BITWORD FOLLOW_LIST_LABEL_ASSIGN_V3TOK_in_element1475_bits[]	= { ANTLR3_UINT64_LIT(0x2040000000420000), ANTLR3_UINT64_LIT(0x0000000100000008) };
static  ANTLR3_BITSET_LIST FOLLOW_LIST_LABEL_ASSIGN_V3TOK_in_element1475	= { FOLLOW_LIST_LABEL_ASSIGN_V3TOK_in_element1475_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_atom_in_element1478  */
static	ANTLR3_BITWORD FOLLOW_atom_in_element1478_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000203000) };
static  ANTLR3_BITSET_LIST FOLLOW_atom_in_element1478	= { FOLLOW_atom_in_element1478_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ebnfSuffix_in_element1484  */
static	ANTLR3_BITWORD FOLLOW_ebnfSuffix_in_element1484_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_ebnfSuffix_in_element1484	= { FOLLOW_ebnfSuffix_in_element1484_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_id_in_element1543  */
static	ANTLR3_BITWORD FOLLOW_id_in_element1543_bits[]	= { ANTLR3_UINT64_LIT(0x0000008800000000) };
static  ANTLR3_BITSET_LIST FOLLOW_id_in_element1543	= { FOLLOW_id_in_element1543_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LABEL_ASSIGN_V3TOK_in_element1548  */
static	ANTLR3_BITWORD FOLLOW_LABEL_ASSIGN_V3TOK_in_element1548_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000400) };
static  ANTLR3_BITSET_LIST FOLLOW_LABEL_ASSIGN_V3TOK_in_element1548	= { FOLLOW_LABEL_ASSIGN_V3TOK_in_element1548_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LIST_LABEL_ASSIGN_V3TOK_in_element1552  */
static	ANTLR3_BITWORD FOLLOW_LIST_LABEL_ASSIGN_V3TOK_in_element1552_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000400) };
static  ANTLR3_BITSET_LIST FOLLOW_LIST_LABEL_ASSIGN_V3TOK_in_element1552	= { FOLLOW_LIST_LABEL_ASSIGN_V3TOK_in_element1552_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_in_element1555  */
static	ANTLR3_BITWORD FOLLOW_block_in_element1555_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000203000) };
static  ANTLR3_BITSET_LIST FOLLOW_block_in_element1555	= { FOLLOW_block_in_element1555_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ebnfSuffix_in_element1562  */
static	ANTLR3_BITWORD FOLLOW_ebnfSuffix_in_element1562_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_ebnfSuffix_in_element1562	= { FOLLOW_ebnfSuffix_in_element1562_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_atom_in_element1621  */
static	ANTLR3_BITWORD FOLLOW_atom_in_element1621_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000203000) };
static  ANTLR3_BITSET_LIST FOLLOW_atom_in_element1621	= { FOLLOW_atom_in_element1621_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ebnfSuffix_in_element1627  */
static	ANTLR3_BITWORD FOLLOW_ebnfSuffix_in_element1627_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_ebnfSuffix_in_element1627	= { FOLLOW_ebnfSuffix_in_element1627_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ebnf_in_element1673  */
static	ANTLR3_BITWORD FOLLOW_ebnf_in_element1673_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_ebnf_in_element1673	= { FOLLOW_ebnf_in_element1673_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ACTION_in_element1680  */
static	ANTLR3_BITWORD FOLLOW_ACTION_in_element1680_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_ACTION_in_element1680	= { FOLLOW_ACTION_in_element1680_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMPRED_V3TOK_in_element1691  */
static	ANTLR3_BITWORD FOLLOW_SEMPRED_V3TOK_in_element1691_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000080000) };
static  ANTLR3_BITSET_LIST FOLLOW_SEMPRED_V3TOK_in_element1691	= { FOLLOW_SEMPRED_V3TOK_in_element1691_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_83_in_element1701  */
static	ANTLR3_BITWORD FOLLOW_83_in_element1701_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_83_in_element1701	= { FOLLOW_83_in_element1701_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_treeSpec_in_element1727  */
static	ANTLR3_BITWORD FOLLOW_treeSpec_in_element1727_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000203000) };
static  ANTLR3_BITSET_LIST FOLLOW_treeSpec_in_element1727	= { FOLLOW_treeSpec_in_element1727_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ebnfSuffix_in_element1733  */
static	ANTLR3_BITWORD FOLLOW_ebnfSuffix_in_element1733_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_ebnfSuffix_in_element1733	= { FOLLOW_ebnfSuffix_in_element1733_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_terminal_in_atom1784  */
static	ANTLR3_BITWORD FOLLOW_terminal_in_atom1784_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_terminal_in_atom1784	= { FOLLOW_terminal_in_atom1784_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_range_in_atom1789  */
static	ANTLR3_BITWORD FOLLOW_range_in_atom1789_bits[]	= { ANTLR3_UINT64_LIT(0x0020000000004002) };
static  ANTLR3_BITSET_LIST FOLLOW_range_in_atom1789	= { FOLLOW_range_in_atom1789_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ROOT_V3TOK_in_atom1799  */
static	ANTLR3_BITWORD FOLLOW_ROOT_V3TOK_in_atom1799_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_ROOT_V3TOK_in_atom1799	= { FOLLOW_ROOT_V3TOK_in_atom1799_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_BANG_V3TOK_in_atom1803  */
static	ANTLR3_BITWORD FOLLOW_BANG_V3TOK_in_atom1803_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_BANG_V3TOK_in_atom1803	= { FOLLOW_BANG_V3TOK_in_atom1803_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_notSet_in_atom1837  */
static	ANTLR3_BITWORD FOLLOW_notSet_in_atom1837_bits[]	= { ANTLR3_UINT64_LIT(0x0020000000004002) };
static  ANTLR3_BITSET_LIST FOLLOW_notSet_in_atom1837	= { FOLLOW_notSet_in_atom1837_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ROOT_V3TOK_in_atom1846  */
static	ANTLR3_BITWORD FOLLOW_ROOT_V3TOK_in_atom1846_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_ROOT_V3TOK_in_atom1846	= { FOLLOW_ROOT_V3TOK_in_atom1846_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_BANG_V3TOK_in_atom1850  */
static	ANTLR3_BITWORD FOLLOW_BANG_V3TOK_in_atom1850_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_BANG_V3TOK_in_atom1850	= { FOLLOW_BANG_V3TOK_in_atom1850_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RULE_REF_in_atom1884  */
static	ANTLR3_BITWORD FOLLOW_RULE_REF_in_atom1884_bits[]	= { ANTLR3_UINT64_LIT(0x0020000000004402) };
static  ANTLR3_BITSET_LIST FOLLOW_RULE_REF_in_atom1884	= { FOLLOW_RULE_REF_in_atom1884_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ARG_ACTION_in_atom1886  */
static	ANTLR3_BITWORD FOLLOW_ARG_ACTION_in_atom1886_bits[]	= { ANTLR3_UINT64_LIT(0x0020000000004002) };
static  ANTLR3_BITSET_LIST FOLLOW_ARG_ACTION_in_atom1886	= { FOLLOW_ARG_ACTION_in_atom1886_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ROOT_V3TOK_in_atom1896  */
static	ANTLR3_BITWORD FOLLOW_ROOT_V3TOK_in_atom1896_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_ROOT_V3TOK_in_atom1896	= { FOLLOW_ROOT_V3TOK_in_atom1896_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_BANG_V3TOK_in_atom1900  */
static	ANTLR3_BITWORD FOLLOW_BANG_V3TOK_in_atom1900_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_BANG_V3TOK_in_atom1900	= { FOLLOW_BANG_V3TOK_in_atom1900_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_96_in_notSet1944  */
static	ANTLR3_BITWORD FOLLOW_96_in_notSet1944_bits[]	= { ANTLR3_UINT64_LIT(0x2000000000020000), ANTLR3_UINT64_LIT(0x0000000000000408) };
static  ANTLR3_BITSET_LIST FOLLOW_96_in_notSet1944	= { FOLLOW_96_in_notSet1944_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_notTerminal_in_notSet1950  */
static	ANTLR3_BITWORD FOLLOW_notTerminal_in_notSet1950_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000040000) };
static  ANTLR3_BITSET_LIST FOLLOW_notTerminal_in_notSet1950	= { FOLLOW_notTerminal_in_notSet1950_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_elementOptions_in_notSet1952  */
static	ANTLR3_BITWORD FOLLOW_elementOptions_in_notSet1952_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_elementOptions_in_notSet1952	= { FOLLOW_elementOptions_in_notSet1952_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_in_notSet1970  */
static	ANTLR3_BITWORD FOLLOW_block_in_notSet1970_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000040000) };
static  ANTLR3_BITSET_LIST FOLLOW_block_in_notSet1970	= { FOLLOW_block_in_notSet1970_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_elementOptions_in_notSet1972  */
static	ANTLR3_BITWORD FOLLOW_elementOptions_in_notSet1972_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_elementOptions_in_notSet1972	= { FOLLOW_elementOptions_in_notSet1972_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_82_in_elementOptions2024  */
static	ANTLR3_BITWORD FOLLOW_82_in_elementOptions2024_bits[]	= { ANTLR3_UINT64_LIT(0x0040000000000000), ANTLR3_UINT64_LIT(0x0000000000000008) };
static  ANTLR3_BITSET_LIST FOLLOW_82_in_elementOptions2024	= { FOLLOW_82_in_elementOptions2024_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_qid_in_elementOptions2026  */
static	ANTLR3_BITWORD FOLLOW_qid_in_elementOptions2026_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000100000) };
static  ANTLR3_BITSET_LIST FOLLOW_qid_in_elementOptions2026	= { FOLLOW_qid_in_elementOptions2026_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_84_in_elementOptions2028  */
static	ANTLR3_BITWORD FOLLOW_84_in_elementOptions2028_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_84_in_elementOptions2028	= { FOLLOW_84_in_elementOptions2028_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_82_in_elementOptions2046  */
static	ANTLR3_BITWORD FOLLOW_82_in_elementOptions2046_bits[]	= { ANTLR3_UINT64_LIT(0x0040000000000000), ANTLR3_UINT64_LIT(0x0000000000000008) };
static  ANTLR3_BITSET_LIST FOLLOW_82_in_elementOptions2046	= { FOLLOW_82_in_elementOptions2046_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_option_in_elementOptions2048  */
static	ANTLR3_BITWORD FOLLOW_option_in_elementOptions2048_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000120000) };
static  ANTLR3_BITSET_LIST FOLLOW_option_in_elementOptions2048	= { FOLLOW_option_in_elementOptions2048_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_81_in_elementOptions2051  */
static	ANTLR3_BITWORD FOLLOW_81_in_elementOptions2051_bits[]	= { ANTLR3_UINT64_LIT(0x0040000000000000), ANTLR3_UINT64_LIT(0x0000000000000008) };
static  ANTLR3_BITSET_LIST FOLLOW_81_in_elementOptions2051	= { FOLLOW_81_in_elementOptions2051_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_option_in_elementOptions2053  */
static	ANTLR3_BITWORD FOLLOW_option_in_elementOptions2053_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000120000) };
static  ANTLR3_BITSET_LIST FOLLOW_option_in_elementOptions2053	= { FOLLOW_option_in_elementOptions2053_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_84_in_elementOptions2057  */
static	ANTLR3_BITWORD FOLLOW_84_in_elementOptions2057_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_84_in_elementOptions2057	= { FOLLOW_84_in_elementOptions2057_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_id_in_elementOption2077  */
static	ANTLR3_BITWORD FOLLOW_id_in_elementOption2077_bits[]	= { ANTLR3_UINT64_LIT(0x0000000800000000) };
static  ANTLR3_BITSET_LIST FOLLOW_id_in_elementOption2077	= { FOLLOW_id_in_elementOption2077_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LABEL_ASSIGN_V3TOK_in_elementOption2079  */
static	ANTLR3_BITWORD FOLLOW_LABEL_ASSIGN_V3TOK_in_elementOption2079_bits[]	= { ANTLR3_UINT64_LIT(0x2040000400020000), ANTLR3_UINT64_LIT(0x0000000000001008) };
static  ANTLR3_BITSET_LIST FOLLOW_LABEL_ASSIGN_V3TOK_in_elementOption2079	= { FOLLOW_LABEL_ASSIGN_V3TOK_in_elementOption2079_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_optionValue_in_elementOption2081  */
static	ANTLR3_BITWORD FOLLOW_optionValue_in_elementOption2081_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_optionValue_in_elementOption2081	= { FOLLOW_optionValue_in_elementOption2081_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_TREE_BEGIN_V3TOK_in_treeSpec2103  */
static	ANTLR3_BITWORD FOLLOW_TREE_BEGIN_V3TOK_in_treeSpec2103_bits[]	= { ANTLR3_UINT64_LIT(0x2240000000420010), ANTLR3_UINT64_LIT(0x0000000100000418) };
static  ANTLR3_BITSET_LIST FOLLOW_TREE_BEGIN_V3TOK_in_treeSpec2103	= { FOLLOW_TREE_BEGIN_V3TOK_in_treeSpec2103_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_element_in_treeSpec2105  */
static	ANTLR3_BITWORD FOLLOW_element_in_treeSpec2105_bits[]	= { ANTLR3_UINT64_LIT(0x2240000000420010), ANTLR3_UINT64_LIT(0x0000000100000418) };
static  ANTLR3_BITSET_LIST FOLLOW_element_in_treeSpec2105	= { FOLLOW_element_in_treeSpec2105_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_element_in_treeSpec2109  */
static	ANTLR3_BITWORD FOLLOW_element_in_treeSpec2109_bits[]	= { ANTLR3_UINT64_LIT(0x2240000000420010), ANTLR3_UINT64_LIT(0x0000000100000C18) };
static  ANTLR3_BITSET_LIST FOLLOW_element_in_treeSpec2109	= { FOLLOW_element_in_treeSpec2109_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_75_in_treeSpec2114  */
static	ANTLR3_BITWORD FOLLOW_75_in_treeSpec2114_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_75_in_treeSpec2114	= { FOLLOW_75_in_treeSpec2114_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_CHAR_LITERAL_in_range2137  */
static	ANTLR3_BITWORD FOLLOW_CHAR_LITERAL_in_range2137_bits[]	= { ANTLR3_UINT64_LIT(0x0004000000000000) };
static  ANTLR3_BITSET_LIST FOLLOW_CHAR_LITERAL_in_range2137	= { FOLLOW_CHAR_LITERAL_in_range2137_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RANGE_V3TOK_in_range2139  */
static	ANTLR3_BITWORD FOLLOW_RANGE_V3TOK_in_range2139_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000020000) };
static  ANTLR3_BITSET_LIST FOLLOW_RANGE_V3TOK_in_range2139	= { FOLLOW_RANGE_V3TOK_in_range2139_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_CHAR_LITERAL_in_range2143  */
static	ANTLR3_BITWORD FOLLOW_CHAR_LITERAL_in_range2143_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000040000) };
static  ANTLR3_BITSET_LIST FOLLOW_CHAR_LITERAL_in_range2143	= { FOLLOW_CHAR_LITERAL_in_range2143_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_elementOptions_in_range2145  */
static	ANTLR3_BITWORD FOLLOW_elementOptions_in_range2145_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_elementOptions_in_range2145	= { FOLLOW_elementOptions_in_range2145_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_CHAR_LITERAL_in_terminal2178  */
static	ANTLR3_BITWORD FOLLOW_CHAR_LITERAL_in_terminal2178_bits[]	= { ANTLR3_UINT64_LIT(0x0020000000004002), ANTLR3_UINT64_LIT(0x0000000000040000) };
static  ANTLR3_BITSET_LIST FOLLOW_CHAR_LITERAL_in_terminal2178	= { FOLLOW_CHAR_LITERAL_in_terminal2178_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_elementOptions_in_terminal2180  */
static	ANTLR3_BITWORD FOLLOW_elementOptions_in_terminal2180_bits[]	= { ANTLR3_UINT64_LIT(0x0020000000004002) };
static  ANTLR3_BITSET_LIST FOLLOW_elementOptions_in_terminal2180	= { FOLLOW_elementOptions_in_terminal2180_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_TOKEN_REF_in_terminal2209  */
static	ANTLR3_BITWORD FOLLOW_TOKEN_REF_in_terminal2209_bits[]	= { ANTLR3_UINT64_LIT(0x0020000000004402), ANTLR3_UINT64_LIT(0x0000000000040000) };
static  ANTLR3_BITSET_LIST FOLLOW_TOKEN_REF_in_terminal2209	= { FOLLOW_TOKEN_REF_in_terminal2209_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ARG_ACTION_in_terminal2211  */
static	ANTLR3_BITWORD FOLLOW_ARG_ACTION_in_terminal2211_bits[]	= { ANTLR3_UINT64_LIT(0x0020000000004002), ANTLR3_UINT64_LIT(0x0000000000040000) };
static  ANTLR3_BITSET_LIST FOLLOW_ARG_ACTION_in_terminal2211	= { FOLLOW_ARG_ACTION_in_terminal2211_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_elementOptions_in_terminal2214  */
static	ANTLR3_BITWORD FOLLOW_elementOptions_in_terminal2214_bits[]	= { ANTLR3_UINT64_LIT(0x0020000000004002) };
static  ANTLR3_BITSET_LIST FOLLOW_elementOptions_in_terminal2214	= { FOLLOW_elementOptions_in_terminal2214_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_STRING_LITERAL_in_terminal2233  */
static	ANTLR3_BITWORD FOLLOW_STRING_LITERAL_in_terminal2233_bits[]	= { ANTLR3_UINT64_LIT(0x0020000000004002), ANTLR3_UINT64_LIT(0x0000000000040000) };
static  ANTLR3_BITSET_LIST FOLLOW_STRING_LITERAL_in_terminal2233	= { FOLLOW_STRING_LITERAL_in_terminal2233_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_elementOptions_in_terminal2235  */
static	ANTLR3_BITWORD FOLLOW_elementOptions_in_terminal2235_bits[]	= { ANTLR3_UINT64_LIT(0x0020000000004002) };
static  ANTLR3_BITSET_LIST FOLLOW_elementOptions_in_terminal2235	= { FOLLOW_elementOptions_in_terminal2235_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_DOT_SYM_in_terminal2254  */
static	ANTLR3_BITWORD FOLLOW_DOT_SYM_in_terminal2254_bits[]	= { ANTLR3_UINT64_LIT(0x0020000000004002), ANTLR3_UINT64_LIT(0x0000000000040000) };
static  ANTLR3_BITSET_LIST FOLLOW_DOT_SYM_in_terminal2254	= { FOLLOW_DOT_SYM_in_terminal2254_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_elementOptions_in_terminal2256  */
static	ANTLR3_BITWORD FOLLOW_elementOptions_in_terminal2256_bits[]	= { ANTLR3_UINT64_LIT(0x0020000000004002) };
static  ANTLR3_BITSET_LIST FOLLOW_elementOptions_in_terminal2256	= { FOLLOW_elementOptions_in_terminal2256_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ROOT_V3TOK_in_terminal2283  */
static	ANTLR3_BITWORD FOLLOW_ROOT_V3TOK_in_terminal2283_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_ROOT_V3TOK_in_terminal2283	= { FOLLOW_ROOT_V3TOK_in_terminal2283_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_BANG_V3TOK_in_terminal2298  */
static	ANTLR3_BITWORD FOLLOW_BANG_V3TOK_in_terminal2298_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_BANG_V3TOK_in_terminal2298	= { FOLLOW_BANG_V3TOK_in_terminal2298_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_block_in_ebnf2332  */
static	ANTLR3_BITWORD FOLLOW_block_in_ebnf2332_bits[]	= { ANTLR3_UINT64_LIT(0x0020000000004002), ANTLR3_UINT64_LIT(0x0000000000283000) };
static  ANTLR3_BITSET_LIST FOLLOW_block_in_ebnf2332	= { FOLLOW_block_in_ebnf2332_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_85_in_ebnf2341  */
static	ANTLR3_BITWORD FOLLOW_85_in_ebnf2341_bits[]	= { ANTLR3_UINT64_LIT(0x0020000000004002) };
static  ANTLR3_BITSET_LIST FOLLOW_85_in_ebnf2341	= { FOLLOW_85_in_ebnf2341_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_76_in_ebnf2358  */
static	ANTLR3_BITWORD FOLLOW_76_in_ebnf2358_bits[]	= { ANTLR3_UINT64_LIT(0x0020000000004002) };
static  ANTLR3_BITSET_LIST FOLLOW_76_in_ebnf2358	= { FOLLOW_76_in_ebnf2358_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_77_in_ebnf2375  */
static	ANTLR3_BITWORD FOLLOW_77_in_ebnf2375_bits[]	= { ANTLR3_UINT64_LIT(0x0020000000004002) };
static  ANTLR3_BITSET_LIST FOLLOW_77_in_ebnf2375	= { FOLLOW_77_in_ebnf2375_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_83_in_ebnf2392  */
static	ANTLR3_BITWORD FOLLOW_83_in_ebnf2392_bits[]	= { ANTLR3_UINT64_LIT(0x0020000000004002) };
static  ANTLR3_BITSET_LIST FOLLOW_83_in_ebnf2392	= { FOLLOW_83_in_ebnf2392_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ROOT_V3TOK_in_ebnf2459  */
static	ANTLR3_BITWORD FOLLOW_ROOT_V3TOK_in_ebnf2459_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_ROOT_V3TOK_in_ebnf2459	= { FOLLOW_ROOT_V3TOK_in_ebnf2459_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_BANG_V3TOK_in_ebnf2474  */
static	ANTLR3_BITWORD FOLLOW_BANG_V3TOK_in_ebnf2474_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_BANG_V3TOK_in_ebnf2474	= { FOLLOW_BANG_V3TOK_in_ebnf2474_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_85_in_ebnfSuffix2502  */
static	ANTLR3_BITWORD FOLLOW_85_in_ebnfSuffix2502_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_85_in_ebnfSuffix2502	= { FOLLOW_85_in_ebnfSuffix2502_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_76_in_ebnfSuffix2514  */
static	ANTLR3_BITWORD FOLLOW_76_in_ebnfSuffix2514_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_76_in_ebnfSuffix2514	= { FOLLOW_76_in_ebnfSuffix2514_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_77_in_ebnfSuffix2527  */
static	ANTLR3_BITWORD FOLLOW_77_in_ebnfSuffix2527_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_77_in_ebnfSuffix2527	= { FOLLOW_77_in_ebnfSuffix2527_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_REWRITE_V3TOK_in_rewrite2551  */
static	ANTLR3_BITWORD FOLLOW_REWRITE_V3TOK_in_rewrite2551_bits[]	= { ANTLR3_UINT64_LIT(0x0200000000000000) };
static  ANTLR3_BITSET_LIST FOLLOW_REWRITE_V3TOK_in_rewrite2551	= { FOLLOW_REWRITE_V3TOK_in_rewrite2551_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_SEMPRED_V3TOK_in_rewrite2555  */
static	ANTLR3_BITWORD FOLLOW_SEMPRED_V3TOK_in_rewrite2555_bits[]	= { ANTLR3_UINT64_LIT(0x2050000000020010), ANTLR3_UINT64_LIT(0x0000000000000618) };
static  ANTLR3_BITSET_LIST FOLLOW_SEMPRED_V3TOK_in_rewrite2555	= { FOLLOW_SEMPRED_V3TOK_in_rewrite2555_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_rewrite_alternative_in_rewrite2559  */
static	ANTLR3_BITWORD FOLLOW_rewrite_alternative_in_rewrite2559_bits[]	= { ANTLR3_UINT64_LIT(0x0010000000000000) };
static  ANTLR3_BITSET_LIST FOLLOW_rewrite_alternative_in_rewrite2559	= { FOLLOW_rewrite_alternative_in_rewrite2559_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_REWRITE_V3TOK_in_rewrite2567  */
static	ANTLR3_BITWORD FOLLOW_REWRITE_V3TOK_in_rewrite2567_bits[]	= { ANTLR3_UINT64_LIT(0x2040000000020010), ANTLR3_UINT64_LIT(0x0000000000000618) };
static  ANTLR3_BITSET_LIST FOLLOW_REWRITE_V3TOK_in_rewrite2567	= { FOLLOW_REWRITE_V3TOK_in_rewrite2567_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_rewrite_alternative_in_rewrite2571  */
static	ANTLR3_BITWORD FOLLOW_rewrite_alternative_in_rewrite2571_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_rewrite_alternative_in_rewrite2571	= { FOLLOW_rewrite_alternative_in_rewrite2571_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_rewrite_template_in_rewrite_alternative2622  */
static	ANTLR3_BITWORD FOLLOW_rewrite_template_in_rewrite_alternative2622_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_rewrite_template_in_rewrite_alternative2622	= { FOLLOW_rewrite_template_in_rewrite_alternative2622_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_rewrite_tree_alternative_in_rewrite_alternative2627  */
static	ANTLR3_BITWORD FOLLOW_rewrite_tree_alternative_in_rewrite_alternative2627_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_rewrite_tree_alternative_in_rewrite_alternative2627	= { FOLLOW_rewrite_tree_alternative_in_rewrite_alternative2627_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_74_in_rewrite_tree_block2669  */
static	ANTLR3_BITWORD FOLLOW_74_in_rewrite_tree_block2669_bits[]	= { ANTLR3_UINT64_LIT(0x2040000000020010), ANTLR3_UINT64_LIT(0x0000000000000618) };
static  ANTLR3_BITSET_LIST FOLLOW_74_in_rewrite_tree_block2669	= { FOLLOW_74_in_rewrite_tree_block2669_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_rewrite_tree_alternative_in_rewrite_tree_block2671  */
static	ANTLR3_BITWORD FOLLOW_rewrite_tree_alternative_in_rewrite_tree_block2671_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000800) };
static  ANTLR3_BITSET_LIST FOLLOW_rewrite_tree_alternative_in_rewrite_tree_block2671	= { FOLLOW_rewrite_tree_alternative_in_rewrite_tree_block2671_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_75_in_rewrite_tree_block2673  */
static	ANTLR3_BITWORD FOLLOW_75_in_rewrite_tree_block2673_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_75_in_rewrite_tree_block2673	= { FOLLOW_75_in_rewrite_tree_block2673_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_rewrite_tree_element_in_rewrite_tree_alternative2707  */
static	ANTLR3_BITWORD FOLLOW_rewrite_tree_element_in_rewrite_tree_alternative2707_bits[]	= { ANTLR3_UINT64_LIT(0x2040000000020012), ANTLR3_UINT64_LIT(0x0000000000000618) };
static  ANTLR3_BITSET_LIST FOLLOW_rewrite_tree_element_in_rewrite_tree_alternative2707	= { FOLLOW_rewrite_tree_element_in_rewrite_tree_alternative2707_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_rewrite_tree_atom_in_rewrite_tree_element2735  */
static	ANTLR3_BITWORD FOLLOW_rewrite_tree_atom_in_rewrite_tree_element2735_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_rewrite_tree_atom_in_rewrite_tree_element2735	= { FOLLOW_rewrite_tree_atom_in_rewrite_tree_element2735_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_rewrite_tree_atom_in_rewrite_tree_element2740  */
static	ANTLR3_BITWORD FOLLOW_rewrite_tree_atom_in_rewrite_tree_element2740_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000203000) };
static  ANTLR3_BITSET_LIST FOLLOW_rewrite_tree_atom_in_rewrite_tree_element2740	= { FOLLOW_rewrite_tree_atom_in_rewrite_tree_element2740_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ebnfSuffix_in_rewrite_tree_element2742  */
static	ANTLR3_BITWORD FOLLOW_ebnfSuffix_in_rewrite_tree_element2742_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_ebnfSuffix_in_rewrite_tree_element2742	= { FOLLOW_ebnfSuffix_in_rewrite_tree_element2742_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_rewrite_tree_in_rewrite_tree_element2776  */
static	ANTLR3_BITWORD FOLLOW_rewrite_tree_in_rewrite_tree_element2776_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000203000) };
static  ANTLR3_BITSET_LIST FOLLOW_rewrite_tree_in_rewrite_tree_element2776	= { FOLLOW_rewrite_tree_in_rewrite_tree_element2776_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ebnfSuffix_in_rewrite_tree_element2782  */
static	ANTLR3_BITWORD FOLLOW_ebnfSuffix_in_rewrite_tree_element2782_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_ebnfSuffix_in_rewrite_tree_element2782	= { FOLLOW_ebnfSuffix_in_rewrite_tree_element2782_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_rewrite_tree_ebnf_in_rewrite_tree_element2828  */
static	ANTLR3_BITWORD FOLLOW_rewrite_tree_ebnf_in_rewrite_tree_element2828_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_rewrite_tree_ebnf_in_rewrite_tree_element2828	= { FOLLOW_rewrite_tree_ebnf_in_rewrite_tree_element2828_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_CHAR_LITERAL_in_rewrite_tree_atom2844  */
static	ANTLR3_BITWORD FOLLOW_CHAR_LITERAL_in_rewrite_tree_atom2844_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_CHAR_LITERAL_in_rewrite_tree_atom2844	= { FOLLOW_CHAR_LITERAL_in_rewrite_tree_atom2844_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_TOKEN_REF_in_rewrite_tree_atom2851  */
static	ANTLR3_BITWORD FOLLOW_TOKEN_REF_in_rewrite_tree_atom2851_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000402) };
static  ANTLR3_BITSET_LIST FOLLOW_TOKEN_REF_in_rewrite_tree_atom2851	= { FOLLOW_TOKEN_REF_in_rewrite_tree_atom2851_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ARG_ACTION_in_rewrite_tree_atom2853  */
static	ANTLR3_BITWORD FOLLOW_ARG_ACTION_in_rewrite_tree_atom2853_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_ARG_ACTION_in_rewrite_tree_atom2853	= { FOLLOW_ARG_ACTION_in_rewrite_tree_atom2853_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RULE_REF_in_rewrite_tree_atom2874  */
static	ANTLR3_BITWORD FOLLOW_RULE_REF_in_rewrite_tree_atom2874_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_RULE_REF_in_rewrite_tree_atom2874	= { FOLLOW_RULE_REF_in_rewrite_tree_atom2874_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_STRING_LITERAL_in_rewrite_tree_atom2881  */
static	ANTLR3_BITWORD FOLLOW_STRING_LITERAL_in_rewrite_tree_atom2881_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_STRING_LITERAL_in_rewrite_tree_atom2881	= { FOLLOW_STRING_LITERAL_in_rewrite_tree_atom2881_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_73_in_rewrite_tree_atom2890  */
static	ANTLR3_BITWORD FOLLOW_73_in_rewrite_tree_atom2890_bits[]	= { ANTLR3_UINT64_LIT(0x0040000000000000), ANTLR3_UINT64_LIT(0x0000000000000008) };
static  ANTLR3_BITSET_LIST FOLLOW_73_in_rewrite_tree_atom2890	= { FOLLOW_73_in_rewrite_tree_atom2890_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_id_in_rewrite_tree_atom2892  */
static	ANTLR3_BITWORD FOLLOW_id_in_rewrite_tree_atom2892_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_id_in_rewrite_tree_atom2892	= { FOLLOW_id_in_rewrite_tree_atom2892_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ACTION_in_rewrite_tree_atom2903  */
static	ANTLR3_BITWORD FOLLOW_ACTION_in_rewrite_tree_atom2903_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_ACTION_in_rewrite_tree_atom2903	= { FOLLOW_ACTION_in_rewrite_tree_atom2903_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_rewrite_tree_block_in_rewrite_tree_ebnf2924  */
static	ANTLR3_BITWORD FOLLOW_rewrite_tree_block_in_rewrite_tree_ebnf2924_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000203000) };
static  ANTLR3_BITSET_LIST FOLLOW_rewrite_tree_block_in_rewrite_tree_ebnf2924	= { FOLLOW_rewrite_tree_block_in_rewrite_tree_ebnf2924_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ebnfSuffix_in_rewrite_tree_ebnf2926  */
static	ANTLR3_BITWORD FOLLOW_ebnfSuffix_in_rewrite_tree_ebnf2926_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_ebnfSuffix_in_rewrite_tree_ebnf2926	= { FOLLOW_ebnfSuffix_in_rewrite_tree_ebnf2926_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_TREE_BEGIN_V3TOK_in_rewrite_tree2946  */
static	ANTLR3_BITWORD FOLLOW_TREE_BEGIN_V3TOK_in_rewrite_tree2946_bits[]	= { ANTLR3_UINT64_LIT(0x2040000000020010), ANTLR3_UINT64_LIT(0x0000000000000208) };
static  ANTLR3_BITSET_LIST FOLLOW_TREE_BEGIN_V3TOK_in_rewrite_tree2946	= { FOLLOW_TREE_BEGIN_V3TOK_in_rewrite_tree2946_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_rewrite_tree_atom_in_rewrite_tree2948  */
static	ANTLR3_BITWORD FOLLOW_rewrite_tree_atom_in_rewrite_tree2948_bits[]	= { ANTLR3_UINT64_LIT(0x2040000000020010), ANTLR3_UINT64_LIT(0x0000000000000E18) };
static  ANTLR3_BITSET_LIST FOLLOW_rewrite_tree_atom_in_rewrite_tree2948	= { FOLLOW_rewrite_tree_atom_in_rewrite_tree2948_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_rewrite_tree_element_in_rewrite_tree2950  */
static	ANTLR3_BITWORD FOLLOW_rewrite_tree_element_in_rewrite_tree2950_bits[]	= { ANTLR3_UINT64_LIT(0x2040000000020010), ANTLR3_UINT64_LIT(0x0000000000000E18) };
static  ANTLR3_BITSET_LIST FOLLOW_rewrite_tree_element_in_rewrite_tree2950	= { FOLLOW_rewrite_tree_element_in_rewrite_tree2950_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_75_in_rewrite_tree2953  */
static	ANTLR3_BITWORD FOLLOW_75_in_rewrite_tree2953_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_75_in_rewrite_tree2953	= { FOLLOW_75_in_rewrite_tree2953_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_id_in_rewrite_template2985  */
static	ANTLR3_BITWORD FOLLOW_id_in_rewrite_template2985_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000400) };
static  ANTLR3_BITSET_LIST FOLLOW_id_in_rewrite_template2985	= { FOLLOW_id_in_rewrite_template2985_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_74_in_rewrite_template2989  */
static	ANTLR3_BITWORD FOLLOW_74_in_rewrite_template2989_bits[]	= { ANTLR3_UINT64_LIT(0x0040000000000000), ANTLR3_UINT64_LIT(0x0000000000000808) };
static  ANTLR3_BITSET_LIST FOLLOW_74_in_rewrite_template2989	= { FOLLOW_74_in_rewrite_template2989_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_rewrite_template_args_in_rewrite_template2991  */
static	ANTLR3_BITWORD FOLLOW_rewrite_template_args_in_rewrite_template2991_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000800) };
static  ANTLR3_BITSET_LIST FOLLOW_rewrite_template_args_in_rewrite_template2991	= { FOLLOW_rewrite_template_args_in_rewrite_template2991_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_75_in_rewrite_template2993  */
static	ANTLR3_BITWORD FOLLOW_75_in_rewrite_template2993_bits[]	= { ANTLR3_UINT64_LIT(0x0000000001800000) };
static  ANTLR3_BITSET_LIST FOLLOW_75_in_rewrite_template2993	= { FOLLOW_75_in_rewrite_template2993_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_DOUBLE_QUOTE_STRING_LITERAL_in_rewrite_template3001  */
static	ANTLR3_BITWORD FOLLOW_DOUBLE_QUOTE_STRING_LITERAL_in_rewrite_template3001_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_DOUBLE_QUOTE_STRING_LITERAL_in_rewrite_template3001	= { FOLLOW_DOUBLE_QUOTE_STRING_LITERAL_in_rewrite_template3001_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_DOUBLE_ANGLE_STRING_LITERAL_in_rewrite_template3007  */
static	ANTLR3_BITWORD FOLLOW_DOUBLE_ANGLE_STRING_LITERAL_in_rewrite_template3007_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_DOUBLE_ANGLE_STRING_LITERAL_in_rewrite_template3007	= { FOLLOW_DOUBLE_ANGLE_STRING_LITERAL_in_rewrite_template3007_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_rewrite_template_ref_in_rewrite_template3034  */
static	ANTLR3_BITWORD FOLLOW_rewrite_template_ref_in_rewrite_template3034_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_rewrite_template_ref_in_rewrite_template3034	= { FOLLOW_rewrite_template_ref_in_rewrite_template3034_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_rewrite_indirect_template_head_in_rewrite_template3043  */
static	ANTLR3_BITWORD FOLLOW_rewrite_indirect_template_head_in_rewrite_template3043_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_rewrite_indirect_template_head_in_rewrite_template3043	= { FOLLOW_rewrite_indirect_template_head_in_rewrite_template3043_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ACTION_in_rewrite_template3052  */
static	ANTLR3_BITWORD FOLLOW_ACTION_in_rewrite_template3052_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_ACTION_in_rewrite_template3052	= { FOLLOW_ACTION_in_rewrite_template3052_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_id_in_rewrite_template_ref3065  */
static	ANTLR3_BITWORD FOLLOW_id_in_rewrite_template_ref3065_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000400) };
static  ANTLR3_BITSET_LIST FOLLOW_id_in_rewrite_template_ref3065	= { FOLLOW_id_in_rewrite_template_ref3065_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_74_in_rewrite_template_ref3069  */
static	ANTLR3_BITWORD FOLLOW_74_in_rewrite_template_ref3069_bits[]	= { ANTLR3_UINT64_LIT(0x0040000000000000), ANTLR3_UINT64_LIT(0x0000000000000808) };
static  ANTLR3_BITSET_LIST FOLLOW_74_in_rewrite_template_ref3069	= { FOLLOW_74_in_rewrite_template_ref3069_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_rewrite_template_args_in_rewrite_template_ref3071  */
static	ANTLR3_BITWORD FOLLOW_rewrite_template_args_in_rewrite_template_ref3071_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000800) };
static  ANTLR3_BITSET_LIST FOLLOW_rewrite_template_args_in_rewrite_template_ref3071	= { FOLLOW_rewrite_template_args_in_rewrite_template_ref3071_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_75_in_rewrite_template_ref3073  */
static	ANTLR3_BITWORD FOLLOW_75_in_rewrite_template_ref3073_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_75_in_rewrite_template_ref3073	= { FOLLOW_75_in_rewrite_template_ref3073_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_74_in_rewrite_indirect_template_head3101  */
static	ANTLR3_BITWORD FOLLOW_74_in_rewrite_indirect_template_head3101_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000010) };
static  ANTLR3_BITSET_LIST FOLLOW_74_in_rewrite_indirect_template_head3101	= { FOLLOW_74_in_rewrite_indirect_template_head3101_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ACTION_in_rewrite_indirect_template_head3103  */
static	ANTLR3_BITWORD FOLLOW_ACTION_in_rewrite_indirect_template_head3103_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000800) };
static  ANTLR3_BITSET_LIST FOLLOW_ACTION_in_rewrite_indirect_template_head3103	= { FOLLOW_ACTION_in_rewrite_indirect_template_head3103_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_75_in_rewrite_indirect_template_head3105  */
static	ANTLR3_BITWORD FOLLOW_75_in_rewrite_indirect_template_head3105_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000400) };
static  ANTLR3_BITSET_LIST FOLLOW_75_in_rewrite_indirect_template_head3105	= { FOLLOW_75_in_rewrite_indirect_template_head3105_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_74_in_rewrite_indirect_template_head3107  */
static	ANTLR3_BITWORD FOLLOW_74_in_rewrite_indirect_template_head3107_bits[]	= { ANTLR3_UINT64_LIT(0x0040000000000000), ANTLR3_UINT64_LIT(0x0000000000000808) };
static  ANTLR3_BITSET_LIST FOLLOW_74_in_rewrite_indirect_template_head3107	= { FOLLOW_74_in_rewrite_indirect_template_head3107_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_rewrite_template_args_in_rewrite_indirect_template_head3109  */
static	ANTLR3_BITWORD FOLLOW_rewrite_template_args_in_rewrite_indirect_template_head3109_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000000), ANTLR3_UINT64_LIT(0x0000000000000800) };
static  ANTLR3_BITSET_LIST FOLLOW_rewrite_template_args_in_rewrite_indirect_template_head3109	= { FOLLOW_rewrite_template_args_in_rewrite_indirect_template_head3109_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_75_in_rewrite_indirect_template_head3111  */
static	ANTLR3_BITWORD FOLLOW_75_in_rewrite_indirect_template_head3111_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_75_in_rewrite_indirect_template_head3111	= { FOLLOW_75_in_rewrite_indirect_template_head3111_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_rewrite_template_arg_in_rewrite_template_args3135  */
static	ANTLR3_BITWORD FOLLOW_rewrite_template_arg_in_rewrite_template_args3135_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000004000) };
static  ANTLR3_BITSET_LIST FOLLOW_rewrite_template_arg_in_rewrite_template_args3135	= { FOLLOW_rewrite_template_arg_in_rewrite_template_args3135_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_78_in_rewrite_template_args3138  */
static	ANTLR3_BITWORD FOLLOW_78_in_rewrite_template_args3138_bits[]	= { ANTLR3_UINT64_LIT(0x0040000000000000), ANTLR3_UINT64_LIT(0x0000000000000008) };
static  ANTLR3_BITSET_LIST FOLLOW_78_in_rewrite_template_args3138	= { FOLLOW_78_in_rewrite_template_args3138_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_rewrite_template_arg_in_rewrite_template_args3140  */
static	ANTLR3_BITWORD FOLLOW_rewrite_template_arg_in_rewrite_template_args3140_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002), ANTLR3_UINT64_LIT(0x0000000000004000) };
static  ANTLR3_BITSET_LIST FOLLOW_rewrite_template_arg_in_rewrite_template_args3140	= { FOLLOW_rewrite_template_arg_in_rewrite_template_args3140_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_id_in_rewrite_template_arg3173  */
static	ANTLR3_BITWORD FOLLOW_id_in_rewrite_template_arg3173_bits[]	= { ANTLR3_UINT64_LIT(0x0000000800000000) };
static  ANTLR3_BITSET_LIST FOLLOW_id_in_rewrite_template_arg3173	= { FOLLOW_id_in_rewrite_template_arg3173_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LABEL_ASSIGN_V3TOK_in_rewrite_template_arg3175  */
static	ANTLR3_BITWORD FOLLOW_LABEL_ASSIGN_V3TOK_in_rewrite_template_arg3175_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000010) };
static  ANTLR3_BITSET_LIST FOLLOW_LABEL_ASSIGN_V3TOK_in_rewrite_template_arg3175	= { FOLLOW_LABEL_ASSIGN_V3TOK_in_rewrite_template_arg3175_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ACTION_in_rewrite_template_arg3177  */
static	ANTLR3_BITWORD FOLLOW_ACTION_in_rewrite_template_arg3177_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_ACTION_in_rewrite_template_arg3177	= { FOLLOW_ACTION_in_rewrite_template_arg3177_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_id_in_qid3198  */
static	ANTLR3_BITWORD FOLLOW_id_in_qid3198_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000400002) };
static  ANTLR3_BITSET_LIST FOLLOW_id_in_qid3198	= { FOLLOW_id_in_qid3198_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_DOT_SYM_in_qid3201  */
static	ANTLR3_BITWORD FOLLOW_DOT_SYM_in_qid3201_bits[]	= { ANTLR3_UINT64_LIT(0x0040000000000000), ANTLR3_UINT64_LIT(0x0000000000000008) };
static  ANTLR3_BITSET_LIST FOLLOW_DOT_SYM_in_qid3201	= { FOLLOW_DOT_SYM_in_qid3201_bits, 2	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_id_in_qid3203  */
static	ANTLR3_BITWORD FOLLOW_id_in_qid3203_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000400002) };
static  ANTLR3_BITSET_LIST FOLLOW_id_in_qid3203	= { FOLLOW_id_in_qid3203_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_rewrite_template_in_synpred100_ANTLRv32622  */
static	ANTLR3_BITWORD FOLLOW_rewrite_template_in_synpred100_ANTLRv32622_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_rewrite_template_in_synpred100_ANTLRv32622	= { FOLLOW_rewrite_template_in_synpred100_ANTLRv32622_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_rewrite_tree_alternative_in_synpred101_ANTLRv32627  */
static	ANTLR3_BITWORD FOLLOW_rewrite_tree_alternative_in_synpred101_ANTLRv32627_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_rewrite_tree_alternative_in_synpred101_ANTLRv32627	= { FOLLOW_rewrite_tree_alternative_in_synpred101_ANTLRv32627_bits, 1	};



/* =========================================================================
 * DFA tables for the parser
 */
/** Static dfa state tables for Cyclic dfa:
 *    463:1: rewrite_template : ( id lp= '(' rewrite_template_args ')' (str= DOUBLE_QUOTE_STRING_LITERAL |str= DOUBLE_ANGLE_STRING_LITERAL ) -> ^( TEMPLATE_V3TOK[$lp,\"TEMPLATE\"] id rewrite_template_args $str) | rewrite_template_ref | rewrite_indirect_template_head | ACTION );
 */
static const ANTLR3_INT32 dfa82_eot[15] =
    {
	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
    };
static const ANTLR3_INT32 dfa82_eof[15] =
    {
	-1, -1, -1, -1, -1, -1, 9, -1, -1, -1, -1, -1, -1, -1, -1
    };
static const ANTLR3_INT32 dfa82_min[15] =
    {
	4, 74, -1, -1, 54, 35, 23, 4, -1, -1, 75, 54, 35, 4, 75
    };
static const ANTLR3_INT32 dfa82_max[15] =
    {
	74, 74, -1, -1, 75, 35, 94, 4, -1, -1, 78, 67, 35, 4, 78
    };
static const ANTLR3_INT32 dfa82_accept[15] =
    {
	-1, -1, 3, 4, -1, -1, -1, -1, 1, 2, -1, -1, -1, -1, -1
    };
static const ANTLR3_INT32 dfa82_special[15] =
    {
	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
    };

/** Used when there is no transition table entry for a particular state */
#define dfa82_T_empty	    NULL

static const ANTLR3_INT32 dfa82_T0[] =
    {
	14
    };

static const ANTLR3_INT32 dfa82_T1[] =
    {
	10
    };

static const ANTLR3_INT32 dfa82_T2[] =
    {
	8, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 9, -1, -1, -1, -1, -1, -1, -1, 
	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 9, -1, -1, 
	-1, -1, -1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 9
    };

static const ANTLR3_INT32 dfa82_T3[] =
    {
	5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, -1, -1, -1, -1, -1, 
	-1, -1, 6
    };

static const ANTLR3_INT32 dfa82_T4[] =
    {
	13
    };

static const ANTLR3_INT32 dfa82_T5[] =
    {
	3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, 
	-1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, 2
    };

static const ANTLR3_INT32 dfa82_T6[] =
    {
	7
    };

static const ANTLR3_INT32 dfa82_T7[] =
    {
	4
    };

static const ANTLR3_INT32 dfa82_T8[] =
    {
	6, -1, -1, 11
    };

static const ANTLR3_INT32 dfa82_T9[] =
    {
	12, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 12
    };


/* Transition tables are a table of sub tables, with some tables
 * reused for efficiency.
 */
static const ANTLR3_INT32 * const dfa82_transitions[] =
{
    dfa82_T5, dfa82_T7, NULL, NULL, dfa82_T3, dfa82_T6, dfa82_T2, dfa82_T1, 
    NULL, NULL, dfa82_T8, dfa82_T9, dfa82_T4, dfa82_T0, dfa82_T8
};


/* Declare tracking structure for Cyclic DFA 82
 */
static
ANTLR3_CYCLIC_DFA cdfa82
    =	{
	    82,		    /* Decision number of this dfa	    */
	    /* Which decision this represents:   */
	    (const pANTLR3_UCHAR)"463:1: rewrite_template : ( id lp= '(' rewrite_template_args ')' (str= DOUBLE_QUOTE_STRING_LITERAL |str= DOUBLE_ANGLE_STRING_LITERAL ) -> ^( TEMPLATE_V3TOK[$lp,\"TEMPLATE\"] id rewrite_template_args $str) | rewrite_template_ref | rewrite_indirect_template_head | ACTION );",
	    (CDFA_SPECIAL_FUNC) antlr3dfaspecialStateTransition,	/* Default special state transition function	*/

	    antlr3dfaspecialTransition,		/* DFA specialTransition is currently just a default function in the runtime */
	    antlr3dfapredict,			/* DFA simulator function is in the runtime */
	    dfa82_eot,	    /* EOT table			    */
	    dfa82_eof,	    /* EOF table			    */
	    dfa82_min,	    /* Minimum tokens for each state    */
	    dfa82_max,	    /* Maximum tokens for each state    */
	    dfa82_accept,	/* Accept table			    */
	    dfa82_special,	/* Special transition states	    */
	    dfa82_transitions	/* Table of transition tables	    */

	};
/* End of Cyclic DFA 82
 * ---------------------
 */ 
/* =========================================================================
 * End of DFA tables for the parser
 */

/* ==============================================
 * Parsing rules
 */
/**
 * $ANTLR start grammarDef
 * ANTLRv3.g:122:1: grammarDef : ( DOC_COMMENT_V3TOK )? ( 'lexer' | 'parser' | 'tree' |) g= 'grammar' id ';' ( optionsSpec )? ( tokensSpec )? ( attrScope )* ( action )* ( rule )+ EOF -> ^( $g id ( DOC_COMMENT_V3TOK )? ( optionsSpec )? ( tokensSpec )? ( attrScope )* ( action )* ( rule )+ ) ;
 */
static ANTLRv3Parser_grammarDef_return
grammarDef(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_grammarDef_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    g;
    pANTLR3_COMMON_TOKEN    DOC_COMMENT_V3TOK1;
    pANTLR3_COMMON_TOKEN    string_literal2;
    pANTLR3_COMMON_TOKEN    string_literal3;
    pANTLR3_COMMON_TOKEN    string_literal4;
    pANTLR3_COMMON_TOKEN    char_literal6;
    pANTLR3_COMMON_TOKEN    EOF12;
    ANTLRv3Parser_id_return id5;
    #undef	RETURN_TYPE_id5
    #define	RETURN_TYPE_id5 ANTLRv3Parser_id_return

    ANTLRv3Parser_optionsSpec_return optionsSpec7;
    #undef	RETURN_TYPE_optionsSpec7
    #define	RETURN_TYPE_optionsSpec7 ANTLRv3Parser_optionsSpec_return

    ANTLRv3Parser_tokensSpec_return tokensSpec8;
    #undef	RETURN_TYPE_tokensSpec8
    #define	RETURN_TYPE_tokensSpec8 ANTLRv3Parser_tokensSpec_return

    ANTLRv3Parser_attrScope_return attrScope9;
    #undef	RETURN_TYPE_attrScope9
    #define	RETURN_TYPE_attrScope9 ANTLRv3Parser_attrScope_return

    ANTLRv3Parser_action_return action10;
    #undef	RETURN_TYPE_action10
    #define	RETURN_TYPE_action10 ANTLRv3Parser_action_return

    ANTLRv3Parser_rule_return rule11;
    #undef	RETURN_TYPE_rule11
    #define	RETURN_TYPE_rule11 ANTLRv3Parser_rule_return

    pANTLR3_BASE_TREE g_tree;
    pANTLR3_BASE_TREE DOC_COMMENT_V3TOK1_tree;
    pANTLR3_BASE_TREE string_literal2_tree;
    pANTLR3_BASE_TREE string_literal3_tree;
    pANTLR3_BASE_TREE string_literal4_tree;
    pANTLR3_BASE_TREE char_literal6_tree;
    pANTLR3_BASE_TREE EOF12_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_93;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_EOF;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_DOC_COMMENT_V3TOK;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_81;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_86;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_87;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_88;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_id;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_tokensSpec;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_attrScope;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_rule;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_action;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_optionsSpec;
    /* Initialize rule variables
     */

    root_0 = NULL;

    g       = NULL;
    DOC_COMMENT_V3TOK1       = NULL;
    string_literal2       = NULL;
    string_literal3       = NULL;
    string_literal4       = NULL;
    char_literal6       = NULL;
    EOF12       = NULL;
    id5.tree = NULL;

    optionsSpec7.tree = NULL;

    tokensSpec8.tree = NULL;

    attrScope9.tree = NULL;

    action10.tree = NULL;

    rule11.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    g_tree   = NULL;
    DOC_COMMENT_V3TOK1_tree   = NULL;
    string_literal2_tree   = NULL;
    string_literal3_tree   = NULL;
    string_literal4_tree   = NULL;
    char_literal6_tree   = NULL;
    EOF12_tree   = NULL;

    stream_93   = NULL;
    #define CREATE_stream_93  if (stream_93 == NULL) {stream_93 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 93"); } 
    stream_EOF   = NULL;
    #define CREATE_stream_EOF  if (stream_EOF == NULL) {stream_EOF = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token EOF"); } 
    stream_DOC_COMMENT_V3TOK   = NULL;
    #define CREATE_stream_DOC_COMMENT_V3TOK  if (stream_DOC_COMMENT_V3TOK == NULL) {stream_DOC_COMMENT_V3TOK = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token DOC_COMMENT_V3TOK"); } 
    stream_81   = NULL;
    #define CREATE_stream_81  if (stream_81 == NULL) {stream_81 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 81"); } 
    stream_86   = NULL;
    #define CREATE_stream_86  if (stream_86 == NULL) {stream_86 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 86"); } 
    stream_87   = NULL;
    #define CREATE_stream_87  if (stream_87 == NULL) {stream_87 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 87"); } 
    stream_88   = NULL;
    #define CREATE_stream_88  if (stream_88 == NULL) {stream_88 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 88"); } 
    stream_id   = NULL;
    #define CREATE_stream_id  if (stream_id == NULL) {stream_id = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule id"); }
    stream_tokensSpec   = NULL;
    #define CREATE_stream_tokensSpec  if (stream_tokensSpec == NULL) {stream_tokensSpec = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule tokensSpec"); }
    stream_attrScope   = NULL;
    #define CREATE_stream_attrScope  if (stream_attrScope == NULL) {stream_attrScope = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule attrScope"); }
    stream_rule   = NULL;
    #define CREATE_stream_rule  if (stream_rule == NULL) {stream_rule = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule rule"); }
    stream_action   = NULL;
    #define CREATE_stream_action  if (stream_action == NULL) {stream_action = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule action"); }
    stream_optionsSpec   = NULL;
    #define CREATE_stream_optionsSpec  if (stream_optionsSpec == NULL) {stream_optionsSpec = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule optionsSpec"); }

    retval.tree  = NULL;

    {
        // ANTLRv3.g:122:11: ( ( DOC_COMMENT_V3TOK )? ( 'lexer' | 'parser' | 'tree' |) g= 'grammar' id ';' ( optionsSpec )? ( tokensSpec )? ( attrScope )* ( action )* ( rule )+ EOF -> ^( $g id ( DOC_COMMENT_V3TOK )? ( optionsSpec )? ( tokensSpec )? ( attrScope )* ( action )* ( rule )+ ) )
        // ANTLRv3.g:123:2: ( DOC_COMMENT_V3TOK )? ( 'lexer' | 'parser' | 'tree' |) g= 'grammar' id ';' ( optionsSpec )? ( tokensSpec )? ( attrScope )* ( action )* ( rule )+ EOF
        {
            // ANTLRv3.g:123:2: ( DOC_COMMENT_V3TOK )?
            {
                int alt1=2;
                switch ( LA(1) )
                {
                    case DOC_COMMENT_V3TOK:
                    	{
                    		alt1=1;
                    	}
                        break;
                }

                switch (alt1)
                {
            	case 1:
            	    // ANTLRv3.g:123:2: DOC_COMMENT_V3TOK
            	    {
            	        DOC_COMMENT_V3TOK1 = (pANTLR3_COMMON_TOKEN) MATCHT(DOC_COMMENT_V3TOK, &FOLLOW_DOC_COMMENT_V3TOK_in_grammarDef392);
            	        if  (HASEXCEPTION())
            	        {
            	            goto rulegrammarDefEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }
            	         
            	        if ( BACKTRACKING==0 ) { CREATE_stream_DOC_COMMENT_V3TOK; stream_DOC_COMMENT_V3TOK->add(stream_DOC_COMMENT_V3TOK, DOC_COMMENT_V3TOK1, NULL); }


            	    }
            	    break;

                }
            }

            // ANTLRv3.g:124:5: ( 'lexer' | 'parser' | 'tree' |)
            {
                int alt2=4;
                switch ( LA(1) )
                {
                case 87:
                	{
                		alt2=1;
                	}
                    break;
                case 88:
                	{
                		alt2=2;
                	}
                    break;
                case 93:
                	{
                		alt2=3;
                	}
                    break;
                case 86:
                	{
                		alt2=4;
                	}
                    break;

                default:
                    if (BACKTRACKING>0)
                    {
                        FAILEDFLAG = ANTLR3_TRUE;
                        return retval;
                    }

                    CONSTRUCTEX();
                    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
                    EXCEPTION->message      = (void *)"";
                    EXCEPTION->decisionNum  = 2;
                    EXCEPTION->state        = 0;


                    goto rulegrammarDefEx;

                }

                switch (alt2)
                {
            	case 1:
            	    // ANTLRv3.g:125:6: 'lexer'
            	    {
            	        string_literal2 = (pANTLR3_COMMON_TOKEN) MATCHT(87, &FOLLOW_87_in_grammarDef406);
            	        if  (HASEXCEPTION())
            	        {
            	            goto rulegrammarDefEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }
            	         
            	        if ( BACKTRACKING==0 ) { CREATE_stream_87; stream_87->add(stream_87, string_literal2, NULL); }


            	        if ( BACKTRACKING==0 )
            	        {
            	            gtype=LEXER_GRAMMAR_V3TOK;
            	        }


            	    }
            	    break;
            	case 2:
            	    // ANTLRv3.g:126:8: 'parser'
            	    {
            	        string_literal3 = (pANTLR3_COMMON_TOKEN) MATCHT(88, &FOLLOW_88_in_grammarDef422);
            	        if  (HASEXCEPTION())
            	        {
            	            goto rulegrammarDefEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }
            	         
            	        if ( BACKTRACKING==0 ) { CREATE_stream_88; stream_88->add(stream_88, string_literal3, NULL); }


            	        if ( BACKTRACKING==0 )
            	        {
            	            gtype=PARSER_GRAMMAR_V3TOK;
            	        }


            	    }
            	    break;
            	case 3:
            	    // ANTLRv3.g:127:8: 'tree'
            	    {
            	        string_literal4 = (pANTLR3_COMMON_TOKEN) MATCHT(93, &FOLLOW_93_in_grammarDef436);
            	        if  (HASEXCEPTION())
            	        {
            	            goto rulegrammarDefEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }
            	         
            	        if ( BACKTRACKING==0 ) { CREATE_stream_93; stream_93->add(stream_93, string_literal4, NULL); }


            	        if ( BACKTRACKING==0 )
            	        {
            	            gtype=TREE_GRAMMAR_V3TOK;
            	        }


            	    }
            	    break;
            	case 4:
            	    // ANTLRv3.g:128:8: 
            	    {
            	        if ( BACKTRACKING==0 )
            	        {
            	            gtype=COMBINED_GRAMMAR_V3TOK;
            	        }


            	    }
            	    break;

                }
            }

            g = (pANTLR3_COMMON_TOKEN) MATCHT(86, &FOLLOW_86_in_grammarDef468);
            if  (HASEXCEPTION())
            {
                goto rulegrammarDefEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_86; stream_86->add(stream_86, g, NULL); }


            FOLLOWPUSH(FOLLOW_id_in_grammarDef470);
            id5=id(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto rulegrammarDefEx;
            }
            if (HASFAILED())
            {
                return retval;
            }

            if ( BACKTRACKING==0 ) { CREATE_stream_id; stream_id->add(stream_id, id5.tree, NULL); }

            char_literal6 = (pANTLR3_COMMON_TOKEN) MATCHT(81, &FOLLOW_81_in_grammarDef472);
            if  (HASEXCEPTION())
            {
                goto rulegrammarDefEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_81; stream_81->add(stream_81, char_literal6, NULL); }


            // ANTLRv3.g:130:23: ( optionsSpec )?
            {
                int alt3=2;
                switch ( LA(1) )
                {
                    case OPTIONS:
                    	{
                    		alt3=1;
                    	}
                        break;
                }

                switch (alt3)
                {
            	case 1:
            	    // ANTLRv3.g:130:23: optionsSpec
            	    {
            	        FOLLOWPUSH(FOLLOW_optionsSpec_in_grammarDef474);
            	        optionsSpec7=optionsSpec(ctx);

            	        FOLLOWPOP();
            	        if  (HASEXCEPTION())
            	        {
            	            goto rulegrammarDefEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }

            	        if ( BACKTRACKING==0 ) { CREATE_stream_optionsSpec; stream_optionsSpec->add(stream_optionsSpec, optionsSpec7.tree, NULL); }

            	    }
            	    break;

                }
            }

            // ANTLRv3.g:130:36: ( tokensSpec )?
            {
                int alt4=2;
                switch ( LA(1) )
                {
                    case TOKENS:
                    	{
                    		alt4=1;
                    	}
                        break;
                }

                switch (alt4)
                {
            	case 1:
            	    // ANTLRv3.g:130:36: tokensSpec
            	    {
            	        FOLLOWPUSH(FOLLOW_tokensSpec_in_grammarDef477);
            	        tokensSpec8=tokensSpec(ctx);

            	        FOLLOWPOP();
            	        if  (HASEXCEPTION())
            	        {
            	            goto rulegrammarDefEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }

            	        if ( BACKTRACKING==0 ) { CREATE_stream_tokensSpec; stream_tokensSpec->add(stream_tokensSpec, tokensSpec8.tree, NULL); }

            	    }
            	    break;

                }
            }

            // ANTLRv3.g:130:48: ( attrScope )*

            for (;;)
            {
                int alt5=2;
                switch ( LA(1) )
                {
                case SCOPE_V3TOK:
                	{
                		alt5=1;
                	}
                    break;

                }

                switch (alt5)
                {
            	case 1:
            	    // ANTLRv3.g:130:48: attrScope
            	    {
            	        FOLLOWPUSH(FOLLOW_attrScope_in_grammarDef480);
            	        attrScope9=attrScope(ctx);

            	        FOLLOWPOP();
            	        if  (HASEXCEPTION())
            	        {
            	            goto rulegrammarDefEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }

            	        if ( BACKTRACKING==0 ) { CREATE_stream_attrScope; stream_attrScope->add(stream_attrScope, attrScope9.tree, NULL); }

            	    }
            	    break;

            	default:
            	    goto loop5;	/* break out of the loop */
            	    break;
                }
            }
            loop5: ; /* Jump out to here if this rule does not match */


            // ANTLRv3.g:130:59: ( action )*

            for (;;)
            {
                int alt6=2;
                switch ( LA(1) )
                {
                case AT_V3TOK:
                	{
                		alt6=1;
                	}
                    break;

                }

                switch (alt6)
                {
            	case 1:
            	    // ANTLRv3.g:130:59: action
            	    {
            	        FOLLOWPUSH(FOLLOW_action_in_grammarDef483);
            	        action10=action(ctx);

            	        FOLLOWPOP();
            	        if  (HASEXCEPTION())
            	        {
            	            goto rulegrammarDefEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }

            	        if ( BACKTRACKING==0 ) { CREATE_stream_action; stream_action->add(stream_action, action10.tree, NULL); }

            	    }
            	    break;

            	default:
            	    goto loop6;	/* break out of the loop */
            	    break;
                }
            }
            loop6: ; /* Jump out to here if this rule does not match */


            // ANTLRv3.g:130:67: ( rule )+
            {
                int cnt7=0;

                for (;;)
                {
                    int alt7=2;
            	switch ( LA(1) )
            	{
            	case DOC_COMMENT_V3TOK:
            	case FRAGMENT_V3TOK:
            	case RULE_REF:
            	case TOKEN_REF:
            	case 89:
            	case 90:
            	case 91:
            		{
            			alt7=1;
            		}
            	    break;

            	}

            	switch (alt7)
            	{
            	    case 1:
            	        // ANTLRv3.g:130:67: rule
            	        {
            	            FOLLOWPUSH(FOLLOW_rule_in_grammarDef486);
            	            rule11=rule(ctx);

            	            FOLLOWPOP();
            	            if  (HASEXCEPTION())
            	            {
            	                goto rulegrammarDefEx;
            	            }
            	            if (HASFAILED())
            	            {
            	                return retval;
            	            }

            	            if ( BACKTRACKING==0 ) { CREATE_stream_rule; stream_rule->add(stream_rule, rule11.tree, NULL); }

            	        }
            	        break;

            	    default:

            		if ( cnt7 >= 1 )
            		{
            		    goto loop7;
            		}
            		if (BACKTRACKING>0)
            		{
            		    FAILEDFLAG = ANTLR3_TRUE;
            		    return retval;
            		}

            		/* mismatchedSetEx()
            		 */
            		CONSTRUCTEX();
            		EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
            		EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;


            		goto rulegrammarDefEx;
            	}
            	cnt7++;
                }
                loop7: ;	/* Jump to here if this rule does not match */
            }

            EOF12 = (pANTLR3_COMMON_TOKEN) MATCHT(EOF, &FOLLOW_EOF_in_grammarDef489);
            if  (HASEXCEPTION())
            {
                goto rulegrammarDefEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_EOF; stream_EOF->add(stream_EOF, EOF12, NULL); }


            if ( BACKTRACKING==0 )
            {
                 g->setType(g, gtype); 
            }


            /* AST REWRITE
             * elements          : id, action, rule, tokensSpec, g, DOC_COMMENT_V3TOK, attrScope, optionsSpec
             * token labels      : g
             * rule labels       : retval
             * token list labels : 
             * rule list labels  : 
             */
            if ( BACKTRACKING==0 ) 

            {
            	pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_g;
            	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	stream_g=antlr3RewriteRuleTOKENStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token g", g);
            	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	retval.tree    = root_0;
            	// 132:6: -> ^( $g id ( DOC_COMMENT_V3TOK )? ( optionsSpec )? ( tokensSpec )? ( attrScope )* ( action )* ( rule )+ )
            	{
            	    // ANTLRv3.g:132:9: ^( $g id ( DOC_COMMENT_V3TOK )? ( optionsSpec )? ( tokensSpec )? ( attrScope )* ( action )* ( rule )+ )
            	    {
            	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRootToken(ADAPTOR, stream_g == NULL ? NULL : stream_g->nextToken(stream_g), root_1));

            	        ADAPTOR->addChild(ADAPTOR, root_1, stream_id == NULL ? NULL : stream_id->nextTree(stream_id));

            	        // ANTLRv3.g:133:15: ( DOC_COMMENT_V3TOK )?
            	        {
            	        	if ( (stream_DOC_COMMENT_V3TOK != NULL && stream_DOC_COMMENT_V3TOK->hasNext(stream_DOC_COMMENT_V3TOK))  )
            	        	{
            	        		ADAPTOR->addChild(ADAPTOR, root_1, 
            	        		stream_DOC_COMMENT_V3TOK == NULL ? NULL : stream_DOC_COMMENT_V3TOK->nextNode(stream_DOC_COMMENT_V3TOK)
            	        		);

            	        	}
            	        	if ( stream_DOC_COMMENT_V3TOK != NULL) stream_DOC_COMMENT_V3TOK->reset(stream_DOC_COMMENT_V3TOK);

            	        }

            	        // ANTLRv3.g:133:34: ( optionsSpec )?
            	        {
            	        	if ( (stream_optionsSpec != NULL && stream_optionsSpec->hasNext(stream_optionsSpec))  )
            	        	{
            	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_optionsSpec == NULL ? NULL : stream_optionsSpec->nextTree(stream_optionsSpec));

            	        	}
            	        	if ( stream_optionsSpec != NULL) stream_optionsSpec->reset(stream_optionsSpec);

            	        }

            	        // ANTLRv3.g:133:47: ( tokensSpec )?
            	        {
            	        	if ( (stream_tokensSpec != NULL && stream_tokensSpec->hasNext(stream_tokensSpec))  )
            	        	{
            	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_tokensSpec == NULL ? NULL : stream_tokensSpec->nextTree(stream_tokensSpec));

            	        	}
            	        	if ( stream_tokensSpec != NULL) stream_tokensSpec->reset(stream_tokensSpec);

            	        }

            	        // ANTLRv3.g:133:59: ( attrScope )*
            	        {
            	        	while ( (stream_attrScope != NULL && stream_attrScope->hasNext(stream_attrScope))  )
            	        	{
            	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_attrScope == NULL ? NULL : stream_attrScope->nextTree(stream_attrScope));

            	        	}
            	        	if (stream_attrScope != NULL) stream_attrScope->reset(stream_attrScope);

            	        }

            	        // ANTLRv3.g:133:70: ( action )*
            	        {
            	        	while ( (stream_action != NULL && stream_action->hasNext(stream_action))  )
            	        	{
            	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_action == NULL ? NULL : stream_action->nextTree(stream_action));

            	        	}
            	        	if (stream_action != NULL) stream_action->reset(stream_action);

            	        }

            	        if ((stream_rule == NULL || !stream_rule->hasNext(stream_rule))  )
            	        {
            	            CONSTRUCTEX();
            	            EXCEPTION->type         = ANTLR3_REWRITE_EARLY_EXCEPTION;
            	            EXCEPTION->name         = (void *)ANTLR3_REWRITE_EARLY_EXCEPTION_NAME;
            	        }
            	        else
            	        {
            	        	while ( (stream_rule->hasNext(stream_rule))  ) {
            	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_rule == NULL ? NULL : stream_rule->nextTree(stream_rule));

            	        	}
            	        	stream_rule->reset(stream_rule);

            	        }
            	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	    }

            	}


            	retval.tree = root_0; // set result root
            	if (stream_g != NULL) stream_g->free(stream_g); 
            	if (stream_retval != NULL) stream_retval->free(stream_retval);


            }
        }

    }

    // This is where rules clean up and exit
    //
    goto rulegrammarDefEx; /* Prevent compiler warnings */
    rulegrammarDefEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_93 != NULL) stream_93->free(stream_93);
        if (stream_EOF != NULL) stream_EOF->free(stream_EOF);
        if (stream_DOC_COMMENT_V3TOK != NULL) stream_DOC_COMMENT_V3TOK->free(stream_DOC_COMMENT_V3TOK);
        if (stream_81 != NULL) stream_81->free(stream_81);
        if (stream_86 != NULL) stream_86->free(stream_86);
        if (stream_87 != NULL) stream_87->free(stream_87);
        if (stream_88 != NULL) stream_88->free(stream_88);
        if (stream_id != NULL) stream_id->free(stream_id);
        if (stream_tokensSpec != NULL) stream_tokensSpec->free(stream_tokensSpec);
        if (stream_attrScope != NULL) stream_attrScope->free(stream_attrScope);
        if (stream_rule != NULL) stream_rule->free(stream_rule);
        if (stream_action != NULL) stream_action->free(stream_action);
        if (stream_optionsSpec != NULL) stream_optionsSpec->free(stream_optionsSpec);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end grammarDef */

/**
 * $ANTLR start tokensSpec
 * ANTLRv3.g:137:1: tokensSpec : TOKENS ( tokenSpec )+ '}' -> ^( TOKENS ( tokenSpec )+ ) ;
 */
static ANTLRv3Parser_tokensSpec_return
tokensSpec(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_tokensSpec_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    TOKENS13;
    pANTLR3_COMMON_TOKEN    char_literal15;
    ANTLRv3Parser_tokenSpec_return tokenSpec14;
    #undef	RETURN_TYPE_tokenSpec14
    #define	RETURN_TYPE_tokenSpec14 ANTLRv3Parser_tokenSpec_return

    pANTLR3_BASE_TREE TOKENS13_tree;
    pANTLR3_BASE_TREE char_literal15_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_TOKENS;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_95;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_tokenSpec;
    /* Initialize rule variables
     */

    root_0 = NULL;

    TOKENS13       = NULL;
    char_literal15       = NULL;
    tokenSpec14.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    TOKENS13_tree   = NULL;
    char_literal15_tree   = NULL;

    stream_TOKENS   = NULL;
    #define CREATE_stream_TOKENS  if (stream_TOKENS == NULL) {stream_TOKENS = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token TOKENS"); } 
    stream_95   = NULL;
    #define CREATE_stream_95  if (stream_95 == NULL) {stream_95 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 95"); } 
    stream_tokenSpec   = NULL;
    #define CREATE_stream_tokenSpec  if (stream_tokenSpec == NULL) {stream_tokenSpec = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule tokenSpec"); }

    retval.tree  = NULL;

    {
        // ANTLRv3.g:138:2: ( TOKENS ( tokenSpec )+ '}' -> ^( TOKENS ( tokenSpec )+ ) )
        // ANTLRv3.g:138:4: TOKENS ( tokenSpec )+ '}'
        {
            TOKENS13 = (pANTLR3_COMMON_TOKEN) MATCHT(TOKENS, &FOLLOW_TOKENS_in_tokensSpec550);
            if  (HASEXCEPTION())
            {
                goto ruletokensSpecEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_TOKENS; stream_TOKENS->add(stream_TOKENS, TOKENS13, NULL); }


            // ANTLRv3.g:138:11: ( tokenSpec )+
            {
                int cnt8=0;

                for (;;)
                {
                    int alt8=2;
            	switch ( LA(1) )
            	{
            	case TOKEN_REF:
            		{
            			alt8=1;
            		}
            	    break;

            	}

            	switch (alt8)
            	{
            	    case 1:
            	        // ANTLRv3.g:138:11: tokenSpec
            	        {
            	            FOLLOWPUSH(FOLLOW_tokenSpec_in_tokensSpec552);
            	            tokenSpec14=tokenSpec(ctx);

            	            FOLLOWPOP();
            	            if  (HASEXCEPTION())
            	            {
            	                goto ruletokensSpecEx;
            	            }
            	            if (HASFAILED())
            	            {
            	                return retval;
            	            }

            	            if ( BACKTRACKING==0 ) { CREATE_stream_tokenSpec; stream_tokenSpec->add(stream_tokenSpec, tokenSpec14.tree, NULL); }

            	        }
            	        break;

            	    default:

            		if ( cnt8 >= 1 )
            		{
            		    goto loop8;
            		}
            		if (BACKTRACKING>0)
            		{
            		    FAILEDFLAG = ANTLR3_TRUE;
            		    return retval;
            		}

            		/* mismatchedSetEx()
            		 */
            		CONSTRUCTEX();
            		EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
            		EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;


            		goto ruletokensSpecEx;
            	}
            	cnt8++;
                }
                loop8: ;	/* Jump to here if this rule does not match */
            }

            char_literal15 = (pANTLR3_COMMON_TOKEN) MATCHT(95, &FOLLOW_95_in_tokensSpec555);
            if  (HASEXCEPTION())
            {
                goto ruletokensSpecEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_95; stream_95->add(stream_95, char_literal15, NULL); }


            /* AST REWRITE
             * elements          : TOKENS, tokenSpec
             * token labels      : 
             * rule labels       : retval
             * token list labels : 
             * rule list labels  : 
             */
            if ( BACKTRACKING==0 ) 

            {
            	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	retval.tree    = root_0;
            	// 138:26: -> ^( TOKENS ( tokenSpec )+ )
            	{
            	    // ANTLRv3.g:138:29: ^( TOKENS ( tokenSpec )+ )
            	    {
            	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
            	        stream_TOKENS == NULL ? NULL : stream_TOKENS->nextNode(stream_TOKENS)
            	        , root_1));

            	        if ((stream_tokenSpec == NULL || !stream_tokenSpec->hasNext(stream_tokenSpec))  )
            	        {
            	            CONSTRUCTEX();
            	            EXCEPTION->type         = ANTLR3_REWRITE_EARLY_EXCEPTION;
            	            EXCEPTION->name         = (void *)ANTLR3_REWRITE_EARLY_EXCEPTION_NAME;
            	        }
            	        else
            	        {
            	        	while ( (stream_tokenSpec->hasNext(stream_tokenSpec))  ) {
            	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_tokenSpec == NULL ? NULL : stream_tokenSpec->nextTree(stream_tokenSpec));

            	        	}
            	        	stream_tokenSpec->reset(stream_tokenSpec);

            	        }
            	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	    }

            	}


            	retval.tree = root_0; // set result root
            	if (stream_retval != NULL) stream_retval->free(stream_retval);


            }
        }

    }

    // This is where rules clean up and exit
    //
    goto ruletokensSpecEx; /* Prevent compiler warnings */
    ruletokensSpecEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_TOKENS != NULL) stream_TOKENS->free(stream_TOKENS);
        if (stream_95 != NULL) stream_95->free(stream_95);
        if (stream_tokenSpec != NULL) stream_tokenSpec->free(stream_tokenSpec);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end tokensSpec */

/**
 * $ANTLR start tokenSpec
 * ANTLRv3.g:141:1: tokenSpec : TOKEN_REF ( '=' (lit= STRING_LITERAL |lit= CHAR_LITERAL ) -> ^( '=' TOKEN_REF $lit) | -> TOKEN_REF ) ';' ;
 */
static ANTLRv3Parser_tokenSpec_return
tokenSpec(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_tokenSpec_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    lit;
    pANTLR3_COMMON_TOKEN    TOKEN_REF16;
    pANTLR3_COMMON_TOKEN    char_literal17;
    pANTLR3_COMMON_TOKEN    char_literal18;

    pANTLR3_BASE_TREE lit_tree;
    pANTLR3_BASE_TREE TOKEN_REF16_tree;
    pANTLR3_BASE_TREE char_literal17_tree;
    pANTLR3_BASE_TREE char_literal18_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_STRING_LITERAL;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_CHAR_LITERAL;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_81;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_TOKEN_REF;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_LABEL_ASSIGN_V3TOK;

    /* Initialize rule variables
     */

    root_0 = NULL;

    lit       = NULL;
    TOKEN_REF16       = NULL;
    char_literal17       = NULL;
    char_literal18       = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    lit_tree   = NULL;
    TOKEN_REF16_tree   = NULL;
    char_literal17_tree   = NULL;
    char_literal18_tree   = NULL;

    stream_STRING_LITERAL   = NULL;
    #define CREATE_stream_STRING_LITERAL  if (stream_STRING_LITERAL == NULL) {stream_STRING_LITERAL = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token STRING_LITERAL"); } 
    stream_CHAR_LITERAL   = NULL;
    #define CREATE_stream_CHAR_LITERAL  if (stream_CHAR_LITERAL == NULL) {stream_CHAR_LITERAL = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token CHAR_LITERAL"); } 
    stream_81   = NULL;
    #define CREATE_stream_81  if (stream_81 == NULL) {stream_81 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 81"); } 
    stream_TOKEN_REF   = NULL;
    #define CREATE_stream_TOKEN_REF  if (stream_TOKEN_REF == NULL) {stream_TOKEN_REF = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token TOKEN_REF"); } 
    stream_LABEL_ASSIGN_V3TOK   = NULL;
    #define CREATE_stream_LABEL_ASSIGN_V3TOK  if (stream_LABEL_ASSIGN_V3TOK == NULL) {stream_LABEL_ASSIGN_V3TOK = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token LABEL_ASSIGN_V3TOK"); } 

    retval.tree  = NULL;

    {
        // ANTLRv3.g:142:2: ( TOKEN_REF ( '=' (lit= STRING_LITERAL |lit= CHAR_LITERAL ) -> ^( '=' TOKEN_REF $lit) | -> TOKEN_REF ) ';' )
        // ANTLRv3.g:142:4: TOKEN_REF ( '=' (lit= STRING_LITERAL |lit= CHAR_LITERAL ) -> ^( '=' TOKEN_REF $lit) | -> TOKEN_REF ) ';'
        {
            TOKEN_REF16 = (pANTLR3_COMMON_TOKEN) MATCHT(TOKEN_REF, &FOLLOW_TOKEN_REF_in_tokenSpec575);
            if  (HASEXCEPTION())
            {
                goto ruletokenSpecEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_TOKEN_REF; stream_TOKEN_REF->add(stream_TOKEN_REF, TOKEN_REF16, NULL); }


            // ANTLRv3.g:143:3: ( '=' (lit= STRING_LITERAL |lit= CHAR_LITERAL ) -> ^( '=' TOKEN_REF $lit) | -> TOKEN_REF )
            {
                int alt10=2;
                switch ( LA(1) )
                {
                case LABEL_ASSIGN_V3TOK:
                	{
                		alt10=1;
                	}
                    break;
                case 81:
                	{
                		alt10=2;
                	}
                    break;

                default:
                    if (BACKTRACKING>0)
                    {
                        FAILEDFLAG = ANTLR3_TRUE;
                        return retval;
                    }

                    CONSTRUCTEX();
                    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
                    EXCEPTION->message      = (void *)"";
                    EXCEPTION->decisionNum  = 10;
                    EXCEPTION->state        = 0;


                    goto ruletokenSpecEx;

                }

                switch (alt10)
                {
            	case 1:
            	    // ANTLRv3.g:143:5: '=' (lit= STRING_LITERAL |lit= CHAR_LITERAL )
            	    {
            	        char_literal17 = (pANTLR3_COMMON_TOKEN) MATCHT(LABEL_ASSIGN_V3TOK, &FOLLOW_LABEL_ASSIGN_V3TOK_in_tokenSpec581);
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruletokenSpecEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }
            	         
            	        if ( BACKTRACKING==0 ) { CREATE_stream_LABEL_ASSIGN_V3TOK; stream_LABEL_ASSIGN_V3TOK->add(stream_LABEL_ASSIGN_V3TOK, char_literal17, NULL); }


            	        // ANTLRv3.g:143:9: (lit= STRING_LITERAL |lit= CHAR_LITERAL )
            	        {
            	            int alt9=2;
            	            switch ( LA(1) )
            	            {
            	            case STRING_LITERAL:
            	            	{
            	            		alt9=1;
            	            	}
            	                break;
            	            case CHAR_LITERAL:
            	            	{
            	            		alt9=2;
            	            	}
            	                break;

            	            default:
            	                if (BACKTRACKING>0)
            	                {
            	                    FAILEDFLAG = ANTLR3_TRUE;
            	                    return retval;
            	                }

            	                CONSTRUCTEX();
            	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            	                EXCEPTION->message      = (void *)"";
            	                EXCEPTION->decisionNum  = 9;
            	                EXCEPTION->state        = 0;


            	                goto ruletokenSpecEx;

            	            }

            	            switch (alt9)
            	            {
            	        	case 1:
            	        	    // ANTLRv3.g:143:10: lit= STRING_LITERAL
            	        	    {
            	        	        lit = (pANTLR3_COMMON_TOKEN) MATCHT(STRING_LITERAL, &FOLLOW_STRING_LITERAL_in_tokenSpec586);
            	        	        if  (HASEXCEPTION())
            	        	        {
            	        	            goto ruletokenSpecEx;
            	        	        }
            	        	        if (HASFAILED())
            	        	        {
            	        	            return retval;
            	        	        }
            	        	         
            	        	        if ( BACKTRACKING==0 ) { CREATE_stream_STRING_LITERAL; stream_STRING_LITERAL->add(stream_STRING_LITERAL, lit, NULL); }


            	        	    }
            	        	    break;
            	        	case 2:
            	        	    // ANTLRv3.g:143:29: lit= CHAR_LITERAL
            	        	    {
            	        	        lit = (pANTLR3_COMMON_TOKEN) MATCHT(CHAR_LITERAL, &FOLLOW_CHAR_LITERAL_in_tokenSpec590);
            	        	        if  (HASEXCEPTION())
            	        	        {
            	        	            goto ruletokenSpecEx;
            	        	        }
            	        	        if (HASFAILED())
            	        	        {
            	        	            return retval;
            	        	        }
            	        	         
            	        	        if ( BACKTRACKING==0 ) { CREATE_stream_CHAR_LITERAL; stream_CHAR_LITERAL->add(stream_CHAR_LITERAL, lit, NULL); }


            	        	    }
            	        	    break;

            	            }
            	        }

            	        /* AST REWRITE
            	         * elements          : LABEL_ASSIGN_V3TOK, TOKEN_REF, lit
            	         * token labels      : lit
            	         * rule labels       : retval
            	         * token list labels : 
            	         * rule list labels  : 
            	         */
            	        if ( BACKTRACKING==0 ) 

            	        {
            	        	pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_lit;
            	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	        	stream_lit=antlr3RewriteRuleTOKENStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token lit", lit);
            	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	retval.tree    = root_0;
            	        	// 143:47: -> ^( '=' TOKEN_REF $lit)
            	        	{
            	        	    // ANTLRv3.g:143:50: ^( '=' TOKEN_REF $lit)
            	        	    {
            	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
            	        	        stream_LABEL_ASSIGN_V3TOK == NULL ? NULL : stream_LABEL_ASSIGN_V3TOK->nextNode(stream_LABEL_ASSIGN_V3TOK)
            	        	        , root_1));

            	        	        ADAPTOR->addChild(ADAPTOR, root_1, 
            	        	        stream_TOKEN_REF == NULL ? NULL : stream_TOKEN_REF->nextNode(stream_TOKEN_REF)
            	        	        );

            	        	        ADAPTOR->addChild(ADAPTOR, root_1, stream_lit == NULL ? NULL : stream_lit->nextNode(stream_lit));

            	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	        	    }

            	        	}


            	        	retval.tree = root_0; // set result root
            	        	if (stream_lit != NULL) stream_lit->free(stream_lit); 
            	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


            	        }
            	    }
            	    break;
            	case 2:
            	    // ANTLRv3.g:144:16: 
            	    {
            	        /* AST REWRITE
            	         * elements          : TOKEN_REF
            	         * token labels      : 
            	         * rule labels       : retval
            	         * token list labels : 
            	         * rule list labels  : 
            	         */
            	        if ( BACKTRACKING==0 ) 

            	        {
            	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	retval.tree    = root_0;
            	        	// 144:16: -> TOKEN_REF
            	        	{
            	        	    ADAPTOR->addChild(ADAPTOR, root_0, 
            	        	    stream_TOKEN_REF == NULL ? NULL : stream_TOKEN_REF->nextNode(stream_TOKEN_REF)
            	        	    );

            	        	}


            	        	retval.tree = root_0; // set result root
            	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


            	        }
            	    }
            	    break;

                }
            }

            char_literal18 = (pANTLR3_COMMON_TOKEN) MATCHT(81, &FOLLOW_81_in_tokenSpec629);
            if  (HASEXCEPTION())
            {
                goto ruletokenSpecEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_81; stream_81->add(stream_81, char_literal18, NULL); }


        }

    }

    // This is where rules clean up and exit
    //
    goto ruletokenSpecEx; /* Prevent compiler warnings */
    ruletokenSpecEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_STRING_LITERAL != NULL) stream_STRING_LITERAL->free(stream_STRING_LITERAL);
        if (stream_CHAR_LITERAL != NULL) stream_CHAR_LITERAL->free(stream_CHAR_LITERAL);
        if (stream_81 != NULL) stream_81->free(stream_81);
        if (stream_TOKEN_REF != NULL) stream_TOKEN_REF->free(stream_TOKEN_REF);
        if (stream_LABEL_ASSIGN_V3TOK != NULL) stream_LABEL_ASSIGN_V3TOK->free(stream_LABEL_ASSIGN_V3TOK);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end tokenSpec */

/**
 * $ANTLR start attrScope
 * ANTLRv3.g:149:1: attrScope : 'scope' id ACTION -> ^( 'scope' id ACTION ) ;
 */
static ANTLRv3Parser_attrScope_return
attrScope(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_attrScope_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    string_literal19;
    pANTLR3_COMMON_TOKEN    ACTION21;
    ANTLRv3Parser_id_return id20;
    #undef	RETURN_TYPE_id20
    #define	RETURN_TYPE_id20 ANTLRv3Parser_id_return

    pANTLR3_BASE_TREE string_literal19_tree;
    pANTLR3_BASE_TREE ACTION21_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_ACTION;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_SCOPE_V3TOK;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_id;
    /* Initialize rule variables
     */

    root_0 = NULL;

    string_literal19       = NULL;
    ACTION21       = NULL;
    id20.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    string_literal19_tree   = NULL;
    ACTION21_tree   = NULL;

    stream_ACTION   = NULL;
    #define CREATE_stream_ACTION  if (stream_ACTION == NULL) {stream_ACTION = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token ACTION"); } 
    stream_SCOPE_V3TOK   = NULL;
    #define CREATE_stream_SCOPE_V3TOK  if (stream_SCOPE_V3TOK == NULL) {stream_SCOPE_V3TOK = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token SCOPE_V3TOK"); } 
    stream_id   = NULL;
    #define CREATE_stream_id  if (stream_id == NULL) {stream_id = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule id"); }

    retval.tree  = NULL;

    {
        // ANTLRv3.g:150:2: ( 'scope' id ACTION -> ^( 'scope' id ACTION ) )
        // ANTLRv3.g:150:4: 'scope' id ACTION
        {
            string_literal19 = (pANTLR3_COMMON_TOKEN) MATCHT(SCOPE_V3TOK, &FOLLOW_SCOPE_V3TOK_in_attrScope640);
            if  (HASEXCEPTION())
            {
                goto ruleattrScopeEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_SCOPE_V3TOK; stream_SCOPE_V3TOK->add(stream_SCOPE_V3TOK, string_literal19, NULL); }


            FOLLOWPUSH(FOLLOW_id_in_attrScope642);
            id20=id(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto ruleattrScopeEx;
            }
            if (HASFAILED())
            {
                return retval;
            }

            if ( BACKTRACKING==0 ) { CREATE_stream_id; stream_id->add(stream_id, id20.tree, NULL); }

            ACTION21 = (pANTLR3_COMMON_TOKEN) MATCHT(ACTION, &FOLLOW_ACTION_in_attrScope644);
            if  (HASEXCEPTION())
            {
                goto ruleattrScopeEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_ACTION; stream_ACTION->add(stream_ACTION, ACTION21, NULL); }


            /* AST REWRITE
             * elements          : ACTION, id, SCOPE_V3TOK
             * token labels      : 
             * rule labels       : retval
             * token list labels : 
             * rule list labels  : 
             */
            if ( BACKTRACKING==0 ) 

            {
            	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	retval.tree    = root_0;
            	// 150:22: -> ^( 'scope' id ACTION )
            	{
            	    // ANTLRv3.g:150:25: ^( 'scope' id ACTION )
            	    {
            	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
            	        stream_SCOPE_V3TOK == NULL ? NULL : stream_SCOPE_V3TOK->nextNode(stream_SCOPE_V3TOK)
            	        , root_1));

            	        ADAPTOR->addChild(ADAPTOR, root_1, stream_id == NULL ? NULL : stream_id->nextTree(stream_id));

            	        ADAPTOR->addChild(ADAPTOR, root_1, 
            	        stream_ACTION == NULL ? NULL : stream_ACTION->nextNode(stream_ACTION)
            	        );

            	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	    }

            	}


            	retval.tree = root_0; // set result root
            	if (stream_retval != NULL) stream_retval->free(stream_retval);


            }
        }

    }

    // This is where rules clean up and exit
    //
    goto ruleattrScopeEx; /* Prevent compiler warnings */
    ruleattrScopeEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_ACTION != NULL) stream_ACTION->free(stream_ACTION);
        if (stream_SCOPE_V3TOK != NULL) stream_SCOPE_V3TOK->free(stream_SCOPE_V3TOK);
        if (stream_id != NULL) stream_id->free(stream_id);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end attrScope */

/**
 * $ANTLR start action
 * ANTLRv3.g:154:1: action : '@' ( actionScopeName '::' )? id ACTION -> ^( '@' ( actionScopeName )? id ACTION ) ;
 */
static ANTLRv3Parser_action_return
action(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_action_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    char_literal22;
    pANTLR3_COMMON_TOKEN    string_literal24;
    pANTLR3_COMMON_TOKEN    ACTION26;
    ANTLRv3Parser_actionScopeName_return actionScopeName23;
    #undef	RETURN_TYPE_actionScopeName23
    #define	RETURN_TYPE_actionScopeName23 ANTLRv3Parser_actionScopeName_return

    ANTLRv3Parser_id_return id25;
    #undef	RETURN_TYPE_id25
    #define	RETURN_TYPE_id25 ANTLRv3Parser_id_return

    pANTLR3_BASE_TREE char_literal22_tree;
    pANTLR3_BASE_TREE string_literal24_tree;
    pANTLR3_BASE_TREE ACTION26_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_AT_V3TOK;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_80;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_ACTION;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_id;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_actionScopeName;
    /* Initialize rule variables
     */

    root_0 = NULL;

    char_literal22       = NULL;
    string_literal24       = NULL;
    ACTION26       = NULL;
    actionScopeName23.tree = NULL;

    id25.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    char_literal22_tree   = NULL;
    string_literal24_tree   = NULL;
    ACTION26_tree   = NULL;

    stream_AT_V3TOK   = NULL;
    #define CREATE_stream_AT_V3TOK  if (stream_AT_V3TOK == NULL) {stream_AT_V3TOK = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token AT_V3TOK"); } 
    stream_80   = NULL;
    #define CREATE_stream_80  if (stream_80 == NULL) {stream_80 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 80"); } 
    stream_ACTION   = NULL;
    #define CREATE_stream_ACTION  if (stream_ACTION == NULL) {stream_ACTION = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token ACTION"); } 
    stream_id   = NULL;
    #define CREATE_stream_id  if (stream_id == NULL) {stream_id = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule id"); }
    stream_actionScopeName   = NULL;
    #define CREATE_stream_actionScopeName  if (stream_actionScopeName == NULL) {stream_actionScopeName = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule actionScopeName"); }

    retval.tree  = NULL;

    {
        // ANTLRv3.g:155:2: ( '@' ( actionScopeName '::' )? id ACTION -> ^( '@' ( actionScopeName )? id ACTION ) )
        // ANTLRv3.g:155:4: '@' ( actionScopeName '::' )? id ACTION
        {
            char_literal22 = (pANTLR3_COMMON_TOKEN) MATCHT(AT_V3TOK, &FOLLOW_AT_V3TOK_in_action667);
            if  (HASEXCEPTION())
            {
                goto ruleactionEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_AT_V3TOK; stream_AT_V3TOK->add(stream_AT_V3TOK, char_literal22, NULL); }


            // ANTLRv3.g:155:8: ( actionScopeName '::' )?
            {
                int alt11=2;
                switch ( LA(1) )
                {
                    case RULE_REF:
                    case TOKEN_REF:
                    	{
                    		switch ( LA(2) )
                    		{
                    		    case 80:
                    		    	{
                    		    		alt11=1;
                    		    	}
                    		        break;
                    		}

                    	}
                        break;
                    case 87:
                    case 88:
                    	{
                    		alt11=1;
                    	}
                        break;
                }

                switch (alt11)
                {
            	case 1:
            	    // ANTLRv3.g:155:9: actionScopeName '::'
            	    {
            	        FOLLOWPUSH(FOLLOW_actionScopeName_in_action670);
            	        actionScopeName23=actionScopeName(ctx);

            	        FOLLOWPOP();
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleactionEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }

            	        if ( BACKTRACKING==0 ) { CREATE_stream_actionScopeName; stream_actionScopeName->add(stream_actionScopeName, actionScopeName23.tree, NULL); }

            	        string_literal24 = (pANTLR3_COMMON_TOKEN) MATCHT(80, &FOLLOW_80_in_action672);
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleactionEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }
            	         
            	        if ( BACKTRACKING==0 ) { CREATE_stream_80; stream_80->add(stream_80, string_literal24, NULL); }


            	    }
            	    break;

                }
            }

            FOLLOWPUSH(FOLLOW_id_in_action676);
            id25=id(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto ruleactionEx;
            }
            if (HASFAILED())
            {
                return retval;
            }

            if ( BACKTRACKING==0 ) { CREATE_stream_id; stream_id->add(stream_id, id25.tree, NULL); }

            ACTION26 = (pANTLR3_COMMON_TOKEN) MATCHT(ACTION, &FOLLOW_ACTION_in_action678);
            if  (HASEXCEPTION())
            {
                goto ruleactionEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_ACTION; stream_ACTION->add(stream_ACTION, ACTION26, NULL); }


            /* AST REWRITE
             * elements          : AT_V3TOK, id, actionScopeName, ACTION
             * token labels      : 
             * rule labels       : retval
             * token list labels : 
             * rule list labels  : 
             */
            if ( BACKTRACKING==0 ) 

            {
            	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	retval.tree    = root_0;
            	// 155:42: -> ^( '@' ( actionScopeName )? id ACTION )
            	{
            	    // ANTLRv3.g:155:45: ^( '@' ( actionScopeName )? id ACTION )
            	    {
            	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
            	        stream_AT_V3TOK == NULL ? NULL : stream_AT_V3TOK->nextNode(stream_AT_V3TOK)
            	        , root_1));

            	        // ANTLRv3.g:155:51: ( actionScopeName )?
            	        {
            	        	if ( (stream_actionScopeName != NULL && stream_actionScopeName->hasNext(stream_actionScopeName))  )
            	        	{
            	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_actionScopeName == NULL ? NULL : stream_actionScopeName->nextTree(stream_actionScopeName));

            	        	}
            	        	if ( stream_actionScopeName != NULL) stream_actionScopeName->reset(stream_actionScopeName);

            	        }

            	        ADAPTOR->addChild(ADAPTOR, root_1, stream_id == NULL ? NULL : stream_id->nextTree(stream_id));

            	        ADAPTOR->addChild(ADAPTOR, root_1, 
            	        stream_ACTION == NULL ? NULL : stream_ACTION->nextNode(stream_ACTION)
            	        );

            	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	    }

            	}


            	retval.tree = root_0; // set result root
            	if (stream_retval != NULL) stream_retval->free(stream_retval);


            }
        }

    }

    // This is where rules clean up and exit
    //
    goto ruleactionEx; /* Prevent compiler warnings */
    ruleactionEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_AT_V3TOK != NULL) stream_AT_V3TOK->free(stream_AT_V3TOK);
        if (stream_80 != NULL) stream_80->free(stream_80);
        if (stream_ACTION != NULL) stream_ACTION->free(stream_ACTION);
        if (stream_id != NULL) stream_id->free(stream_id);
        if (stream_actionScopeName != NULL) stream_actionScopeName->free(stream_actionScopeName);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end action */

/**
 * $ANTLR start actionScopeName
 * ANTLRv3.g:161:1: actionScopeName : ( id |l= 'lexer' |p= 'parser' );
 */
static ANTLRv3Parser_actionScopeName_return
actionScopeName(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_actionScopeName_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    l;
    pANTLR3_COMMON_TOKEN    p;
    ANTLRv3Parser_id_return id27;
    #undef	RETURN_TYPE_id27
    #define	RETURN_TYPE_id27 ANTLRv3Parser_id_return

    pANTLR3_BASE_TREE l_tree;
    pANTLR3_BASE_TREE p_tree;

    /* Initialize rule variables
     */

    root_0 = NULL;

    l       = NULL;
    p       = NULL;
    id27.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    l_tree   = NULL;
    p_tree   = NULL;


    retval.tree  = NULL;

    {
        {
            //  ANTLRv3.g:161:16: ( id |l= 'lexer' |p= 'parser' )

            ANTLR3_UINT32 alt12;

            alt12=3;

            switch ( LA(1) )
            {
            case RULE_REF:
            case TOKEN_REF:
            	{
            		alt12=1;
            	}
                break;
            case 87:
            	{
            		alt12=2;
            	}
                break;
            case 88:
            	{
            		alt12=3;
            	}
                break;

            default:
                if (BACKTRACKING>0)
                {
                    FAILEDFLAG = ANTLR3_TRUE;
                    return retval;
                }

                CONSTRUCTEX();
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
                EXCEPTION->message      = (void *)"";
                EXCEPTION->decisionNum  = 12;
                EXCEPTION->state        = 0;


                goto ruleactionScopeNameEx;

            }

            switch (alt12)
            {
        	case 1:
        	    // ANTLRv3.g:162:2: id
        	    {
        	        root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


        	        FOLLOWPUSH(FOLLOW_id_in_actionScopeName703);
        	        id27=id(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleactionScopeNameEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, id27.tree);

        	    }
        	    break;
        	case 2:
        	    // ANTLRv3.g:163:4: l= 'lexer'
        	    {
        	        root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


        	        l = (pANTLR3_COMMON_TOKEN) MATCHT(87, &FOLLOW_87_in_actionScopeName712);
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleactionScopeNameEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) {
        	        l_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, l));
        	        ADAPTOR->addChild(ADAPTOR, root_0, l_tree);
        	        }

        	    }
        	    break;
        	case 3:
        	    // ANTLRv3.g:164:9: p= 'parser'
        	    {
        	        root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


        	        p = (pANTLR3_COMMON_TOKEN) MATCHT(88, &FOLLOW_88_in_actionScopeName727);
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleactionScopeNameEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) {
        	        p_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, p));
        	        ADAPTOR->addChild(ADAPTOR, root_0, p_tree);
        	        }

        	    }
        	    break;

            }
        }
    }

    // This is where rules clean up and exit
    //
    goto ruleactionScopeNameEx; /* Prevent compiler warnings */
    ruleactionScopeNameEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    {

        	// There are limitations in the C target generator which prevent us
        	// from using the target neutral constructs to change the token type.
        	retval.start->setType(retval.start, ID_V3TOK);

    }

    return retval;
}
/* $ANTLR end actionScopeName */

/**
 * $ANTLR start optionsSpec
 * ANTLRv3.g:173:1: optionsSpec : OPTIONS ( option ';' )+ '}' -> ^( OPTIONS ( option )+ ) ;
 */
static ANTLRv3Parser_optionsSpec_return
optionsSpec(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_optionsSpec_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    OPTIONS28;
    pANTLR3_COMMON_TOKEN    char_literal30;
    pANTLR3_COMMON_TOKEN    char_literal31;
    ANTLRv3Parser_option_return option29;
    #undef	RETURN_TYPE_option29
    #define	RETURN_TYPE_option29 ANTLRv3Parser_option_return

    pANTLR3_BASE_TREE OPTIONS28_tree;
    pANTLR3_BASE_TREE char_literal30_tree;
    pANTLR3_BASE_TREE char_literal31_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_95;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_81;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_OPTIONS;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_option;
    /* Initialize rule variables
     */

    root_0 = NULL;

    OPTIONS28       = NULL;
    char_literal30       = NULL;
    char_literal31       = NULL;
    option29.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    OPTIONS28_tree   = NULL;
    char_literal30_tree   = NULL;
    char_literal31_tree   = NULL;

    stream_95   = NULL;
    #define CREATE_stream_95  if (stream_95 == NULL) {stream_95 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 95"); } 
    stream_81   = NULL;
    #define CREATE_stream_81  if (stream_81 == NULL) {stream_81 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 81"); } 
    stream_OPTIONS   = NULL;
    #define CREATE_stream_OPTIONS  if (stream_OPTIONS == NULL) {stream_OPTIONS = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token OPTIONS"); } 
    stream_option   = NULL;
    #define CREATE_stream_option  if (stream_option == NULL) {stream_option = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule option"); }

    retval.tree  = NULL;

    {
        // ANTLRv3.g:174:2: ( OPTIONS ( option ';' )+ '}' -> ^( OPTIONS ( option )+ ) )
        // ANTLRv3.g:174:4: OPTIONS ( option ';' )+ '}'
        {
            OPTIONS28 = (pANTLR3_COMMON_TOKEN) MATCHT(OPTIONS, &FOLLOW_OPTIONS_in_optionsSpec742);
            if  (HASEXCEPTION())
            {
                goto ruleoptionsSpecEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_OPTIONS; stream_OPTIONS->add(stream_OPTIONS, OPTIONS28, NULL); }


            // ANTLRv3.g:174:12: ( option ';' )+
            {
                int cnt13=0;

                for (;;)
                {
                    int alt13=2;
            	switch ( LA(1) )
            	{
            	case RULE_REF:
            	case TOKEN_REF:
            		{
            			alt13=1;
            		}
            	    break;

            	}

            	switch (alt13)
            	{
            	    case 1:
            	        // ANTLRv3.g:174:13: option ';'
            	        {
            	            FOLLOWPUSH(FOLLOW_option_in_optionsSpec745);
            	            option29=option(ctx);

            	            FOLLOWPOP();
            	            if  (HASEXCEPTION())
            	            {
            	                goto ruleoptionsSpecEx;
            	            }
            	            if (HASFAILED())
            	            {
            	                return retval;
            	            }

            	            if ( BACKTRACKING==0 ) { CREATE_stream_option; stream_option->add(stream_option, option29.tree, NULL); }

            	            char_literal30 = (pANTLR3_COMMON_TOKEN) MATCHT(81, &FOLLOW_81_in_optionsSpec747);
            	            if  (HASEXCEPTION())
            	            {
            	                goto ruleoptionsSpecEx;
            	            }
            	            if (HASFAILED())
            	            {
            	                return retval;
            	            }
            	             
            	            if ( BACKTRACKING==0 ) { CREATE_stream_81; stream_81->add(stream_81, char_literal30, NULL); }


            	        }
            	        break;

            	    default:

            		if ( cnt13 >= 1 )
            		{
            		    goto loop13;
            		}
            		if (BACKTRACKING>0)
            		{
            		    FAILEDFLAG = ANTLR3_TRUE;
            		    return retval;
            		}

            		/* mismatchedSetEx()
            		 */
            		CONSTRUCTEX();
            		EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
            		EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;


            		goto ruleoptionsSpecEx;
            	}
            	cnt13++;
                }
                loop13: ;	/* Jump to here if this rule does not match */
            }

            char_literal31 = (pANTLR3_COMMON_TOKEN) MATCHT(95, &FOLLOW_95_in_optionsSpec751);
            if  (HASEXCEPTION())
            {
                goto ruleoptionsSpecEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_95; stream_95->add(stream_95, char_literal31, NULL); }


            /* AST REWRITE
             * elements          : OPTIONS, option
             * token labels      : 
             * rule labels       : retval
             * token list labels : 
             * rule list labels  : 
             */
            if ( BACKTRACKING==0 ) 

            {
            	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	retval.tree    = root_0;
            	// 174:30: -> ^( OPTIONS ( option )+ )
            	{
            	    // ANTLRv3.g:174:33: ^( OPTIONS ( option )+ )
            	    {
            	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
            	        stream_OPTIONS == NULL ? NULL : stream_OPTIONS->nextNode(stream_OPTIONS)
            	        , root_1));

            	        if ((stream_option == NULL || !stream_option->hasNext(stream_option))  )
            	        {
            	            CONSTRUCTEX();
            	            EXCEPTION->type         = ANTLR3_REWRITE_EARLY_EXCEPTION;
            	            EXCEPTION->name         = (void *)ANTLR3_REWRITE_EARLY_EXCEPTION_NAME;
            	        }
            	        else
            	        {
            	        	while ( (stream_option->hasNext(stream_option))  ) {
            	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_option == NULL ? NULL : stream_option->nextTree(stream_option));

            	        	}
            	        	stream_option->reset(stream_option);

            	        }
            	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	    }

            	}


            	retval.tree = root_0; // set result root
            	if (stream_retval != NULL) stream_retval->free(stream_retval);


            }
        }

    }

    // This is where rules clean up and exit
    //
    goto ruleoptionsSpecEx; /* Prevent compiler warnings */
    ruleoptionsSpecEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_95 != NULL) stream_95->free(stream_95);
        if (stream_81 != NULL) stream_81->free(stream_81);
        if (stream_OPTIONS != NULL) stream_OPTIONS->free(stream_OPTIONS);
        if (stream_option != NULL) stream_option->free(stream_option);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end optionsSpec */

/**
 * $ANTLR start option
 * ANTLRv3.g:177:1: option : id '=' optionValue -> ^( '=' id optionValue ) ;
 */
static ANTLRv3Parser_option_return
option(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_option_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    char_literal33;
    ANTLRv3Parser_id_return id32;
    #undef	RETURN_TYPE_id32
    #define	RETURN_TYPE_id32 ANTLRv3Parser_id_return

    ANTLRv3Parser_optionValue_return optionValue34;
    #undef	RETURN_TYPE_optionValue34
    #define	RETURN_TYPE_optionValue34 ANTLRv3Parser_optionValue_return

    pANTLR3_BASE_TREE char_literal33_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_LABEL_ASSIGN_V3TOK;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_id;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_optionValue;
    /* Initialize rule variables
     */

    root_0 = NULL;

    char_literal33       = NULL;
    id32.tree = NULL;

    optionValue34.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    char_literal33_tree   = NULL;

    stream_LABEL_ASSIGN_V3TOK   = NULL;
    #define CREATE_stream_LABEL_ASSIGN_V3TOK  if (stream_LABEL_ASSIGN_V3TOK == NULL) {stream_LABEL_ASSIGN_V3TOK = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token LABEL_ASSIGN_V3TOK"); } 
    stream_id   = NULL;
    #define CREATE_stream_id  if (stream_id == NULL) {stream_id = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule id"); }
    stream_optionValue   = NULL;
    #define CREATE_stream_optionValue  if (stream_optionValue == NULL) {stream_optionValue = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule optionValue"); }

    retval.tree  = NULL;

    {
        // ANTLRv3.g:178:5: ( id '=' optionValue -> ^( '=' id optionValue ) )
        // ANTLRv3.g:178:9: id '=' optionValue
        {
            FOLLOWPUSH(FOLLOW_id_in_option776);
            id32=id(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto ruleoptionEx;
            }
            if (HASFAILED())
            {
                return retval;
            }

            if ( BACKTRACKING==0 ) { CREATE_stream_id; stream_id->add(stream_id, id32.tree, NULL); }

            char_literal33 = (pANTLR3_COMMON_TOKEN) MATCHT(LABEL_ASSIGN_V3TOK, &FOLLOW_LABEL_ASSIGN_V3TOK_in_option778);
            if  (HASEXCEPTION())
            {
                goto ruleoptionEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_LABEL_ASSIGN_V3TOK; stream_LABEL_ASSIGN_V3TOK->add(stream_LABEL_ASSIGN_V3TOK, char_literal33, NULL); }


            FOLLOWPUSH(FOLLOW_optionValue_in_option780);
            optionValue34=optionValue(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto ruleoptionEx;
            }
            if (HASFAILED())
            {
                return retval;
            }

            if ( BACKTRACKING==0 ) { CREATE_stream_optionValue; stream_optionValue->add(stream_optionValue, optionValue34.tree, NULL); }

            /* AST REWRITE
             * elements          : LABEL_ASSIGN_V3TOK, optionValue, id
             * token labels      : 
             * rule labels       : retval
             * token list labels : 
             * rule list labels  : 
             */
            if ( BACKTRACKING==0 ) 

            {
            	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	retval.tree    = root_0;
            	// 178:28: -> ^( '=' id optionValue )
            	{
            	    // ANTLRv3.g:178:31: ^( '=' id optionValue )
            	    {
            	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
            	        stream_LABEL_ASSIGN_V3TOK == NULL ? NULL : stream_LABEL_ASSIGN_V3TOK->nextNode(stream_LABEL_ASSIGN_V3TOK)
            	        , root_1));

            	        ADAPTOR->addChild(ADAPTOR, root_1, stream_id == NULL ? NULL : stream_id->nextTree(stream_id));

            	        ADAPTOR->addChild(ADAPTOR, root_1, stream_optionValue == NULL ? NULL : stream_optionValue->nextTree(stream_optionValue));

            	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	    }

            	}


            	retval.tree = root_0; // set result root
            	if (stream_retval != NULL) stream_retval->free(stream_retval);


            }
        }

    }

    // This is where rules clean up and exit
    //
    goto ruleoptionEx; /* Prevent compiler warnings */
    ruleoptionEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_LABEL_ASSIGN_V3TOK != NULL) stream_LABEL_ASSIGN_V3TOK->free(stream_LABEL_ASSIGN_V3TOK);
        if (stream_id != NULL) stream_id->free(stream_id);
        if (stream_optionValue != NULL) stream_optionValue->free(stream_optionValue);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end option */

/**
 * $ANTLR start optionValue
 * ANTLRv3.g:181:1: optionValue : ( qid | STRING_LITERAL | CHAR_LITERAL | INT |s= '*' -> STRING_LITERAL[$s] );
 */
static ANTLRv3Parser_optionValue_return
optionValue(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_optionValue_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    s;
    pANTLR3_COMMON_TOKEN    STRING_LITERAL36;
    pANTLR3_COMMON_TOKEN    CHAR_LITERAL37;
    pANTLR3_COMMON_TOKEN    INT38;
    ANTLRv3Parser_qid_return qid35;
    #undef	RETURN_TYPE_qid35
    #define	RETURN_TYPE_qid35 ANTLRv3Parser_qid_return

    pANTLR3_BASE_TREE s_tree;
    pANTLR3_BASE_TREE STRING_LITERAL36_tree;
    pANTLR3_BASE_TREE CHAR_LITERAL37_tree;
    pANTLR3_BASE_TREE INT38_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_76;

    /* Initialize rule variables
     */

    root_0 = NULL;

    s       = NULL;
    STRING_LITERAL36       = NULL;
    CHAR_LITERAL37       = NULL;
    INT38       = NULL;
    qid35.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    s_tree   = NULL;
    STRING_LITERAL36_tree   = NULL;
    CHAR_LITERAL37_tree   = NULL;
    INT38_tree   = NULL;

    stream_76   = NULL;
    #define CREATE_stream_76  if (stream_76 == NULL) {stream_76 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 76"); } 

    retval.tree  = NULL;

    {
        {
            //  ANTLRv3.g:182:5: ( qid | STRING_LITERAL | CHAR_LITERAL | INT |s= '*' -> STRING_LITERAL[$s] )

            ANTLR3_UINT32 alt14;

            alt14=5;

            switch ( LA(1) )
            {
            case RULE_REF:
            case TOKEN_REF:
            	{
            		alt14=1;
            	}
                break;
            case STRING_LITERAL:
            	{
            		alt14=2;
            	}
                break;
            case CHAR_LITERAL:
            	{
            		alt14=3;
            	}
                break;
            case INT:
            	{
            		alt14=4;
            	}
                break;
            case 76:
            	{
            		alt14=5;
            	}
                break;

            default:
                if (BACKTRACKING>0)
                {
                    FAILEDFLAG = ANTLR3_TRUE;
                    return retval;
                }

                CONSTRUCTEX();
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
                EXCEPTION->message      = (void *)"";
                EXCEPTION->decisionNum  = 14;
                EXCEPTION->state        = 0;


                goto ruleoptionValueEx;

            }

            switch (alt14)
            {
        	case 1:
        	    // ANTLRv3.g:182:9: qid
        	    {
        	        root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


        	        FOLLOWPUSH(FOLLOW_qid_in_optionValue809);
        	        qid35=qid(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleoptionValueEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, qid35.tree);

        	    }
        	    break;
        	case 2:
        	    // ANTLRv3.g:183:9: STRING_LITERAL
        	    {
        	        root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


        	        STRING_LITERAL36 = (pANTLR3_COMMON_TOKEN) MATCHT(STRING_LITERAL, &FOLLOW_STRING_LITERAL_in_optionValue819);
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleoptionValueEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) {
        	        STRING_LITERAL36_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, STRING_LITERAL36));
        	        ADAPTOR->addChild(ADAPTOR, root_0, STRING_LITERAL36_tree);
        	        }

        	    }
        	    break;
        	case 3:
        	    // ANTLRv3.g:184:9: CHAR_LITERAL
        	    {
        	        root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


        	        CHAR_LITERAL37 = (pANTLR3_COMMON_TOKEN) MATCHT(CHAR_LITERAL, &FOLLOW_CHAR_LITERAL_in_optionValue829);
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleoptionValueEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) {
        	        CHAR_LITERAL37_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, CHAR_LITERAL37));
        	        ADAPTOR->addChild(ADAPTOR, root_0, CHAR_LITERAL37_tree);
        	        }

        	    }
        	    break;
        	case 4:
        	    // ANTLRv3.g:185:9: INT
        	    {
        	        root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


        	        INT38 = (pANTLR3_COMMON_TOKEN) MATCHT(INT, &FOLLOW_INT_in_optionValue839);
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleoptionValueEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) {
        	        INT38_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, INT38));
        	        ADAPTOR->addChild(ADAPTOR, root_0, INT38_tree);
        	        }

        	    }
        	    break;
        	case 5:
        	    // ANTLRv3.g:186:7: s= '*'
        	    {
        	        s = (pANTLR3_COMMON_TOKEN) MATCHT(76, &FOLLOW_76_in_optionValue849);
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleoptionValueEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }
        	         
        	        if ( BACKTRACKING==0 ) { CREATE_stream_76; stream_76->add(stream_76, s, NULL); }


        	        /* AST REWRITE
        	         * elements          : 
        	         * token labels      : 
        	         * rule labels       : retval
        	         * token list labels : 
        	         * rule list labels  : 
        	         */
        	        if ( BACKTRACKING==0 ) 

        	        {
        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	retval.tree    = root_0;
        	        	// 186:13: -> STRING_LITERAL[$s]
        	        	{
        	        	    ADAPTOR->addChild(ADAPTOR, root_0, 

        	        	    #if 1 == 2
        	        	    	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, STRING_LITERAL, TOKTEXT(s))
        	        	    #else
        	        	    	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, STRING_LITERAL, (pANTLR3_UINT8)s)
        	        	    #endif

        	        	    );

        	        	}


        	        	retval.tree = root_0; // set result root
        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        }
        	    }
        	    break;

            }
        }
    }

    // This is where rules clean up and exit
    //
    goto ruleoptionValueEx; /* Prevent compiler warnings */
    ruleoptionValueEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_76 != NULL) stream_76->free(stream_76);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end optionValue */

/**
 * $ANTLR start rule
 * ANTLRv3.g:189:1: rule : ( DOC_COMMENT_V3TOK )? (modifier= ( 'protected' | 'public' | 'private' | 'fragment' ) )? id ( BANG_V3TOK )? (arg= ARG_ACTION )? ( 'returns' rt= ARG_ACTION )? ( throwsSpec )? ( optionsSpec )? ( ruleScopeSpec )? ( ruleAction )* ':' altList ';' ( exceptionGroup )? -> ^( RULE_V3TOK id ( ^( ARG_V3TOK[$arg] $arg) )? ( ^( 'returns' $rt) )? ( throwsSpec )? ( optionsSpec )? ( ruleScopeSpec )? ( ruleAction )* altList ( exceptionGroup )? EOR_V3TOK[\"EORu\"] ) ;
 */
static ANTLRv3Parser_rule_return
rule(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_rule_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    modifier;
    pANTLR3_COMMON_TOKEN    arg;
    pANTLR3_COMMON_TOKEN    rt;
    pANTLR3_COMMON_TOKEN    DOC_COMMENT_V3TOK39;
    pANTLR3_COMMON_TOKEN    string_literal40;
    pANTLR3_COMMON_TOKEN    string_literal41;
    pANTLR3_COMMON_TOKEN    string_literal42;
    pANTLR3_COMMON_TOKEN    string_literal43;
    pANTLR3_COMMON_TOKEN    BANG_V3TOK45;
    pANTLR3_COMMON_TOKEN    string_literal46;
    pANTLR3_COMMON_TOKEN    char_literal51;
    pANTLR3_COMMON_TOKEN    char_literal53;
    ANTLRv3Parser_id_return id44;
    #undef	RETURN_TYPE_id44
    #define	RETURN_TYPE_id44 ANTLRv3Parser_id_return

    ANTLRv3Parser_throwsSpec_return throwsSpec47;
    #undef	RETURN_TYPE_throwsSpec47
    #define	RETURN_TYPE_throwsSpec47 ANTLRv3Parser_throwsSpec_return

    ANTLRv3Parser_optionsSpec_return optionsSpec48;
    #undef	RETURN_TYPE_optionsSpec48
    #define	RETURN_TYPE_optionsSpec48 ANTLRv3Parser_optionsSpec_return

    ANTLRv3Parser_ruleScopeSpec_return ruleScopeSpec49;
    #undef	RETURN_TYPE_ruleScopeSpec49
    #define	RETURN_TYPE_ruleScopeSpec49 ANTLRv3Parser_ruleScopeSpec_return

    ANTLRv3Parser_ruleAction_return ruleAction50;
    #undef	RETURN_TYPE_ruleAction50
    #define	RETURN_TYPE_ruleAction50 ANTLRv3Parser_ruleAction_return

    ANTLRv3Parser_altList_return altList52;
    #undef	RETURN_TYPE_altList52
    #define	RETURN_TYPE_altList52 ANTLRv3Parser_altList_return

    ANTLRv3Parser_exceptionGroup_return exceptionGroup54;
    #undef	RETURN_TYPE_exceptionGroup54
    #define	RETURN_TYPE_exceptionGroup54 ANTLRv3Parser_exceptionGroup_return

    pANTLR3_BASE_TREE modifier_tree;
    pANTLR3_BASE_TREE arg_tree;
    pANTLR3_BASE_TREE rt_tree;
    pANTLR3_BASE_TREE DOC_COMMENT_V3TOK39_tree;
    pANTLR3_BASE_TREE string_literal40_tree;
    pANTLR3_BASE_TREE string_literal41_tree;
    pANTLR3_BASE_TREE string_literal42_tree;
    pANTLR3_BASE_TREE string_literal43_tree;
    pANTLR3_BASE_TREE BANG_V3TOK45_tree;
    pANTLR3_BASE_TREE string_literal46_tree;
    pANTLR3_BASE_TREE char_literal51_tree;
    pANTLR3_BASE_TREE char_literal53_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_79;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_BANG_V3TOK;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_91;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_FRAGMENT_V3TOK;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_90;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_RET_V3TOK;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_DOC_COMMENT_V3TOK;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_81;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_ARG_ACTION;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_89;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_id;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_exceptionGroup;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_throwsSpec;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_ruleScopeSpec;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_optionsSpec;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_altList;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_ruleAction;
    /* Initialize rule variables
     */
    ctx->pANTLRv3Parser_ruleTop = pANTLRv3Parser_rulePush(ctx);
    root_0 = NULL;

    modifier       = NULL;
    arg       = NULL;
    rt       = NULL;
    DOC_COMMENT_V3TOK39       = NULL;
    string_literal40       = NULL;
    string_literal41       = NULL;
    string_literal42       = NULL;
    string_literal43       = NULL;
    BANG_V3TOK45       = NULL;
    string_literal46       = NULL;
    char_literal51       = NULL;
    char_literal53       = NULL;
    id44.tree = NULL;

    throwsSpec47.tree = NULL;

    optionsSpec48.tree = NULL;

    ruleScopeSpec49.tree = NULL;

    ruleAction50.tree = NULL;

    altList52.tree = NULL;

    exceptionGroup54.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    modifier_tree   = NULL;
    arg_tree   = NULL;
    rt_tree   = NULL;
    DOC_COMMENT_V3TOK39_tree   = NULL;
    string_literal40_tree   = NULL;
    string_literal41_tree   = NULL;
    string_literal42_tree   = NULL;
    string_literal43_tree   = NULL;
    BANG_V3TOK45_tree   = NULL;
    string_literal46_tree   = NULL;
    char_literal51_tree   = NULL;
    char_literal53_tree   = NULL;

    stream_79   = NULL;
    #define CREATE_stream_79  if (stream_79 == NULL) {stream_79 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 79"); } 
    stream_BANG_V3TOK   = NULL;
    #define CREATE_stream_BANG_V3TOK  if (stream_BANG_V3TOK == NULL) {stream_BANG_V3TOK = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token BANG_V3TOK"); } 
    stream_91   = NULL;
    #define CREATE_stream_91  if (stream_91 == NULL) {stream_91 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 91"); } 
    stream_FRAGMENT_V3TOK   = NULL;
    #define CREATE_stream_FRAGMENT_V3TOK  if (stream_FRAGMENT_V3TOK == NULL) {stream_FRAGMENT_V3TOK = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token FRAGMENT_V3TOK"); } 
    stream_90   = NULL;
    #define CREATE_stream_90  if (stream_90 == NULL) {stream_90 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 90"); } 
    stream_RET_V3TOK   = NULL;
    #define CREATE_stream_RET_V3TOK  if (stream_RET_V3TOK == NULL) {stream_RET_V3TOK = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token RET_V3TOK"); } 
    stream_DOC_COMMENT_V3TOK   = NULL;
    #define CREATE_stream_DOC_COMMENT_V3TOK  if (stream_DOC_COMMENT_V3TOK == NULL) {stream_DOC_COMMENT_V3TOK = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token DOC_COMMENT_V3TOK"); } 
    stream_81   = NULL;
    #define CREATE_stream_81  if (stream_81 == NULL) {stream_81 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 81"); } 
    stream_ARG_ACTION   = NULL;
    #define CREATE_stream_ARG_ACTION  if (stream_ARG_ACTION == NULL) {stream_ARG_ACTION = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token ARG_ACTION"); } 
    stream_89   = NULL;
    #define CREATE_stream_89  if (stream_89 == NULL) {stream_89 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 89"); } 
    stream_id   = NULL;
    #define CREATE_stream_id  if (stream_id == NULL) {stream_id = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule id"); }
    stream_exceptionGroup   = NULL;
    #define CREATE_stream_exceptionGroup  if (stream_exceptionGroup == NULL) {stream_exceptionGroup = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule exceptionGroup"); }
    stream_throwsSpec   = NULL;
    #define CREATE_stream_throwsSpec  if (stream_throwsSpec == NULL) {stream_throwsSpec = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule throwsSpec"); }
    stream_ruleScopeSpec   = NULL;
    #define CREATE_stream_ruleScopeSpec  if (stream_ruleScopeSpec == NULL) {stream_ruleScopeSpec = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule ruleScopeSpec"); }
    stream_optionsSpec   = NULL;
    #define CREATE_stream_optionsSpec  if (stream_optionsSpec == NULL) {stream_optionsSpec = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule optionsSpec"); }
    stream_altList   = NULL;
    #define CREATE_stream_altList  if (stream_altList == NULL) {stream_altList = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule altList"); }
    stream_ruleAction   = NULL;
    #define CREATE_stream_ruleAction  if (stream_ruleAction == NULL) {stream_ruleAction = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule ruleAction"); }

    retval.tree  = NULL;

    {
        // ANTLRv3.g:193:2: ( ( DOC_COMMENT_V3TOK )? (modifier= ( 'protected' | 'public' | 'private' | 'fragment' ) )? id ( BANG_V3TOK )? (arg= ARG_ACTION )? ( 'returns' rt= ARG_ACTION )? ( throwsSpec )? ( optionsSpec )? ( ruleScopeSpec )? ( ruleAction )* ':' altList ';' ( exceptionGroup )? -> ^( RULE_V3TOK id ( ^( ARG_V3TOK[$arg] $arg) )? ( ^( 'returns' $rt) )? ( throwsSpec )? ( optionsSpec )? ( ruleScopeSpec )? ( ruleAction )* altList ( exceptionGroup )? EOR_V3TOK[\"EORu\"] ) )
        // ANTLRv3.g:193:4: ( DOC_COMMENT_V3TOK )? (modifier= ( 'protected' | 'public' | 'private' | 'fragment' ) )? id ( BANG_V3TOK )? (arg= ARG_ACTION )? ( 'returns' rt= ARG_ACTION )? ( throwsSpec )? ( optionsSpec )? ( ruleScopeSpec )? ( ruleAction )* ':' altList ';' ( exceptionGroup )?
        {
            // ANTLRv3.g:193:4: ( DOC_COMMENT_V3TOK )?
            {
                int alt15=2;
                switch ( LA(1) )
                {
                    case DOC_COMMENT_V3TOK:
                    	{
                    		alt15=1;
                    	}
                        break;
                }

                switch (alt15)
                {
            	case 1:
            	    // ANTLRv3.g:193:4: DOC_COMMENT_V3TOK
            	    {
            	        DOC_COMMENT_V3TOK39 = (pANTLR3_COMMON_TOKEN) MATCHT(DOC_COMMENT_V3TOK, &FOLLOW_DOC_COMMENT_V3TOK_in_rule874);
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleruleEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            pANTLRv3Parser_rulePop(ctx);

            	            return retval;
            	        }
            	         
            	        if ( BACKTRACKING==0 ) { CREATE_stream_DOC_COMMENT_V3TOK; stream_DOC_COMMENT_V3TOK->add(stream_DOC_COMMENT_V3TOK, DOC_COMMENT_V3TOK39, NULL); }


            	    }
            	    break;

                }
            }

            // ANTLRv3.g:194:3: (modifier= ( 'protected' | 'public' | 'private' | 'fragment' ) )?
            {
                int alt17=2;
                switch ( LA(1) )
                {
                    case FRAGMENT_V3TOK:
                    case 89:
                    case 90:
                    case 91:
                    	{
                    		alt17=1;
                    	}
                        break;
                }

                switch (alt17)
                {
            	case 1:
            	    // ANTLRv3.g:194:5: modifier= ( 'protected' | 'public' | 'private' | 'fragment' )
            	    {
            	        // ANTLRv3.g:194:14: ( 'protected' | 'public' | 'private' | 'fragment' )
            	        {
            	            int alt16=4;
            	            switch ( LA(1) )
            	            {
            	            case 90:
            	            	{
            	            		alt16=1;
            	            	}
            	                break;
            	            case 91:
            	            	{
            	            		alt16=2;
            	            	}
            	                break;
            	            case 89:
            	            	{
            	            		alt16=3;
            	            	}
            	                break;
            	            case FRAGMENT_V3TOK:
            	            	{
            	            		alt16=4;
            	            	}
            	                break;

            	            default:
            	                if (BACKTRACKING>0)
            	                {
            	                    FAILEDFLAG = ANTLR3_TRUE;
            	                    pANTLRv3Parser_rulePop(ctx);

            	                    return retval;
            	                }

            	                CONSTRUCTEX();
            	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            	                EXCEPTION->message      = (void *)"";
            	                EXCEPTION->decisionNum  = 16;
            	                EXCEPTION->state        = 0;


            	                goto ruleruleEx;

            	            }

            	            switch (alt16)
            	            {
            	        	case 1:
            	        	    // ANTLRv3.g:194:15: 'protected'
            	        	    {
            	        	        string_literal40 = (pANTLR3_COMMON_TOKEN) MATCHT(90, &FOLLOW_90_in_rule884);
            	        	        if  (HASEXCEPTION())
            	        	        {
            	        	            goto ruleruleEx;
            	        	        }
            	        	        if (HASFAILED())
            	        	        {
            	        	            pANTLRv3Parser_rulePop(ctx);

            	        	            return retval;
            	        	        }
            	        	         
            	        	        if ( BACKTRACKING==0 ) { CREATE_stream_90; stream_90->add(stream_90, string_literal40, NULL); }


            	        	    }
            	        	    break;
            	        	case 2:
            	        	    // ANTLRv3.g:194:27: 'public'
            	        	    {
            	        	        string_literal41 = (pANTLR3_COMMON_TOKEN) MATCHT(91, &FOLLOW_91_in_rule886);
            	        	        if  (HASEXCEPTION())
            	        	        {
            	        	            goto ruleruleEx;
            	        	        }
            	        	        if (HASFAILED())
            	        	        {
            	        	            pANTLRv3Parser_rulePop(ctx);

            	        	            return retval;
            	        	        }
            	        	         
            	        	        if ( BACKTRACKING==0 ) { CREATE_stream_91; stream_91->add(stream_91, string_literal41, NULL); }


            	        	    }
            	        	    break;
            	        	case 3:
            	        	    // ANTLRv3.g:194:36: 'private'
            	        	    {
            	        	        string_literal42 = (pANTLR3_COMMON_TOKEN) MATCHT(89, &FOLLOW_89_in_rule888);
            	        	        if  (HASEXCEPTION())
            	        	        {
            	        	            goto ruleruleEx;
            	        	        }
            	        	        if (HASFAILED())
            	        	        {
            	        	            pANTLRv3Parser_rulePop(ctx);

            	        	            return retval;
            	        	        }
            	        	         
            	        	        if ( BACKTRACKING==0 ) { CREATE_stream_89; stream_89->add(stream_89, string_literal42, NULL); }


            	        	    }
            	        	    break;
            	        	case 4:
            	        	    // ANTLRv3.g:194:46: 'fragment'
            	        	    {
            	        	        string_literal43 = (pANTLR3_COMMON_TOKEN) MATCHT(FRAGMENT_V3TOK, &FOLLOW_FRAGMENT_V3TOK_in_rule890);
            	        	        if  (HASEXCEPTION())
            	        	        {
            	        	            goto ruleruleEx;
            	        	        }
            	        	        if (HASFAILED())
            	        	        {
            	        	            pANTLRv3Parser_rulePop(ctx);

            	        	            return retval;
            	        	        }
            	        	         
            	        	        if ( BACKTRACKING==0 ) { CREATE_stream_FRAGMENT_V3TOK; stream_FRAGMENT_V3TOK->add(stream_FRAGMENT_V3TOK, string_literal43, NULL); }


            	        	    }
            	        	    break;

            	            }
            	        }

            	    }
            	    break;

                }
            }

            FOLLOWPUSH(FOLLOW_id_in_rule898);
            id44=id(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto ruleruleEx;
            }
            if (HASFAILED())
            {
                pANTLRv3Parser_rulePop(ctx);

                return retval;
            }

            if ( BACKTRACKING==0 ) { CREATE_stream_id; stream_id->add(stream_id, id44.tree, NULL); }

            if ( BACKTRACKING==0 )
            {
                (SCOPE_TOP(rule))->name= 
                (STRSTREAM->toStringTT(STRSTREAM, id44.start, id44.stop))
                ;
            }


            // ANTLRv3.g:196:3: ( BANG_V3TOK )?
            {
                int alt18=2;
                switch ( LA(1) )
                {
                    case BANG_V3TOK:
                    	{
                    		alt18=1;
                    	}
                        break;
                }

                switch (alt18)
                {
            	case 1:
            	    // ANTLRv3.g:196:3: BANG_V3TOK
            	    {
            	        BANG_V3TOK45 = (pANTLR3_COMMON_TOKEN) MATCHT(BANG_V3TOK, &FOLLOW_BANG_V3TOK_in_rule904);
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleruleEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            pANTLRv3Parser_rulePop(ctx);

            	            return retval;
            	        }
            	         
            	        if ( BACKTRACKING==0 ) { CREATE_stream_BANG_V3TOK; stream_BANG_V3TOK->add(stream_BANG_V3TOK, BANG_V3TOK45, NULL); }


            	    }
            	    break;

                }
            }

            // ANTLRv3.g:197:3: (arg= ARG_ACTION )?
            {
                int alt19=2;
                switch ( LA(1) )
                {
                    case ARG_ACTION:
                    	{
                    		alt19=1;
                    	}
                        break;
                }

                switch (alt19)
                {
            	case 1:
            	    // ANTLRv3.g:197:5: arg= ARG_ACTION
            	    {
            	        arg = (pANTLR3_COMMON_TOKEN) MATCHT(ARG_ACTION, &FOLLOW_ARG_ACTION_in_rule913);
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleruleEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            pANTLRv3Parser_rulePop(ctx);

            	            return retval;
            	        }
            	         
            	        if ( BACKTRACKING==0 ) { CREATE_stream_ARG_ACTION; stream_ARG_ACTION->add(stream_ARG_ACTION, arg, NULL); }


            	    }
            	    break;

                }
            }

            // ANTLRv3.g:198:3: ( 'returns' rt= ARG_ACTION )?
            {
                int alt20=2;
                switch ( LA(1) )
                {
                    case RET_V3TOK:
                    	{
                    		alt20=1;
                    	}
                        break;
                }

                switch (alt20)
                {
            	case 1:
            	    // ANTLRv3.g:198:5: 'returns' rt= ARG_ACTION
            	    {
            	        string_literal46 = (pANTLR3_COMMON_TOKEN) MATCHT(RET_V3TOK, &FOLLOW_RET_V3TOK_in_rule922);
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleruleEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            pANTLRv3Parser_rulePop(ctx);

            	            return retval;
            	        }
            	         
            	        if ( BACKTRACKING==0 ) { CREATE_stream_RET_V3TOK; stream_RET_V3TOK->add(stream_RET_V3TOK, string_literal46, NULL); }


            	        rt = (pANTLR3_COMMON_TOKEN) MATCHT(ARG_ACTION, &FOLLOW_ARG_ACTION_in_rule926);
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleruleEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            pANTLRv3Parser_rulePop(ctx);

            	            return retval;
            	        }
            	         
            	        if ( BACKTRACKING==0 ) { CREATE_stream_ARG_ACTION; stream_ARG_ACTION->add(stream_ARG_ACTION, rt, NULL); }


            	    }
            	    break;

                }
            }

            // ANTLRv3.g:199:3: ( throwsSpec )?
            {
                int alt21=2;
                switch ( LA(1) )
                {
                    case 92:
                    	{
                    		alt21=1;
                    	}
                        break;
                }

                switch (alt21)
                {
            	case 1:
            	    // ANTLRv3.g:199:3: throwsSpec
            	    {
            	        FOLLOWPUSH(FOLLOW_throwsSpec_in_rule934);
            	        throwsSpec47=throwsSpec(ctx);

            	        FOLLOWPOP();
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleruleEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            pANTLRv3Parser_rulePop(ctx);

            	            return retval;
            	        }

            	        if ( BACKTRACKING==0 ) { CREATE_stream_throwsSpec; stream_throwsSpec->add(stream_throwsSpec, throwsSpec47.tree, NULL); }

            	    }
            	    break;

                }
            }

            // ANTLRv3.g:199:15: ( optionsSpec )?
            {
                int alt22=2;
                switch ( LA(1) )
                {
                    case OPTIONS:
                    	{
                    		alt22=1;
                    	}
                        break;
                }

                switch (alt22)
                {
            	case 1:
            	    // ANTLRv3.g:199:15: optionsSpec
            	    {
            	        FOLLOWPUSH(FOLLOW_optionsSpec_in_rule937);
            	        optionsSpec48=optionsSpec(ctx);

            	        FOLLOWPOP();
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleruleEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            pANTLRv3Parser_rulePop(ctx);

            	            return retval;
            	        }

            	        if ( BACKTRACKING==0 ) { CREATE_stream_optionsSpec; stream_optionsSpec->add(stream_optionsSpec, optionsSpec48.tree, NULL); }

            	    }
            	    break;

                }
            }

            // ANTLRv3.g:199:28: ( ruleScopeSpec )?
            {
                int alt23=2;
                switch ( LA(1) )
                {
                    case SCOPE_V3TOK:
                    	{
                    		alt23=1;
                    	}
                        break;
                }

                switch (alt23)
                {
            	case 1:
            	    // ANTLRv3.g:199:28: ruleScopeSpec
            	    {
            	        FOLLOWPUSH(FOLLOW_ruleScopeSpec_in_rule940);
            	        ruleScopeSpec49=ruleScopeSpec(ctx);

            	        FOLLOWPOP();
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleruleEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            pANTLRv3Parser_rulePop(ctx);

            	            return retval;
            	        }

            	        if ( BACKTRACKING==0 ) { CREATE_stream_ruleScopeSpec; stream_ruleScopeSpec->add(stream_ruleScopeSpec, ruleScopeSpec49.tree, NULL); }

            	    }
            	    break;

                }
            }

            // ANTLRv3.g:199:43: ( ruleAction )*

            for (;;)
            {
                int alt24=2;
                switch ( LA(1) )
                {
                case AT_V3TOK:
                	{
                		alt24=1;
                	}
                    break;

                }

                switch (alt24)
                {
            	case 1:
            	    // ANTLRv3.g:199:43: ruleAction
            	    {
            	        FOLLOWPUSH(FOLLOW_ruleAction_in_rule943);
            	        ruleAction50=ruleAction(ctx);

            	        FOLLOWPOP();
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleruleEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            pANTLRv3Parser_rulePop(ctx);

            	            return retval;
            	        }

            	        if ( BACKTRACKING==0 ) { CREATE_stream_ruleAction; stream_ruleAction->add(stream_ruleAction, ruleAction50.tree, NULL); }

            	    }
            	    break;

            	default:
            	    goto loop24;	/* break out of the loop */
            	    break;
                }
            }
            loop24: ; /* Jump out to here if this rule does not match */


            char_literal51 = (pANTLR3_COMMON_TOKEN) MATCHT(79, &FOLLOW_79_in_rule948);
            if  (HASEXCEPTION())
            {
                goto ruleruleEx;
            }
            if (HASFAILED())
            {
                pANTLRv3Parser_rulePop(ctx);

                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_79; stream_79->add(stream_79, char_literal51, NULL); }


            FOLLOWPUSH(FOLLOW_altList_in_rule950);
            altList52=altList(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto ruleruleEx;
            }
            if (HASFAILED())
            {
                pANTLRv3Parser_rulePop(ctx);

                return retval;
            }

            if ( BACKTRACKING==0 ) { CREATE_stream_altList; stream_altList->add(stream_altList, altList52.tree, NULL); }

            char_literal53 = (pANTLR3_COMMON_TOKEN) MATCHT(81, &FOLLOW_81_in_rule952);
            if  (HASEXCEPTION())
            {
                goto ruleruleEx;
            }
            if (HASFAILED())
            {
                pANTLRv3Parser_rulePop(ctx);

                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_81; stream_81->add(stream_81, char_literal53, NULL); }


            // ANTLRv3.g:201:3: ( exceptionGroup )?
            {
                int alt25=2;
                switch ( LA(1) )
                {
                    case CATCH_SYM:
                    case FINALLY_SYM:
                    	{
                    		alt25=1;
                    	}
                        break;
                }

                switch (alt25)
                {
            	case 1:
            	    // ANTLRv3.g:201:3: exceptionGroup
            	    {
            	        FOLLOWPUSH(FOLLOW_exceptionGroup_in_rule956);
            	        exceptionGroup54=exceptionGroup(ctx);

            	        FOLLOWPOP();
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleruleEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            pANTLRv3Parser_rulePop(ctx);

            	            return retval;
            	        }

            	        if ( BACKTRACKING==0 ) { CREATE_stream_exceptionGroup; stream_exceptionGroup->add(stream_exceptionGroup, exceptionGroup54.tree, NULL); }

            	    }
            	    break;

                }
            }

            /* AST REWRITE
             * elements          : id, ruleScopeSpec, arg, altList, exceptionGroup, optionsSpec, throwsSpec, ruleAction, rt, RET_V3TOK
             * token labels      : arg, rt
             * rule labels       : retval
             * token list labels : 
             * rule list labels  : 
             */
            if ( BACKTRACKING==0 ) 

            {
            	pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_arg;
            	pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_rt;
            	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	stream_arg=antlr3RewriteRuleTOKENStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token arg", arg);
            	stream_rt=antlr3RewriteRuleTOKENStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token rt", rt);
            	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	retval.tree    = root_0;
            	// 202:6: -> ^( RULE_V3TOK id ( ^( ARG_V3TOK[$arg] $arg) )? ( ^( 'returns' $rt) )? ( throwsSpec )? ( optionsSpec )? ( ruleScopeSpec )? ( ruleAction )* altList ( exceptionGroup )? EOR_V3TOK[\"EORu\"] )
            	{
            	    // ANTLRv3.g:202:9: ^( RULE_V3TOK id ( ^( ARG_V3TOK[$arg] $arg) )? ( ^( 'returns' $rt) )? ( throwsSpec )? ( optionsSpec )? ( ruleScopeSpec )? ( ruleAction )* altList ( exceptionGroup )? EOR_V3TOK[\"EORu\"] )
            	    {
            	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
            	        (pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, RULE_V3TOK, (pANTLR3_UINT8)"RULE_V3TOK")
            	        , root_1));

            	        ADAPTOR->addChild(ADAPTOR, root_1, stream_id == NULL ? NULL : stream_id->nextTree(stream_id));

            	        // ANTLRv3.g:202:26: ( ^( ARG_V3TOK[$arg] $arg) )?
            	        {
            	        	if ( (stream_arg != NULL && stream_arg->hasNext(stream_arg))  )
            	        	{
            	        		// ANTLRv3.g:202:26: ^( ARG_V3TOK[$arg] $arg)
            	        		{
            	        		    pANTLR3_BASE_TREE root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        		    root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 

            	        		    #if 1 == 2
            	        		    	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, ARG_V3TOK, TOKTEXT(arg))
            	        		    #else
            	        		    	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, ARG_V3TOK, (pANTLR3_UINT8)arg)
            	        		    #endif

            	        		    , root_2));

            	        		    ADAPTOR->addChild(ADAPTOR, root_2, stream_arg == NULL ? NULL : stream_arg->nextNode(stream_arg));

            	        		    ADAPTOR->addChild(ADAPTOR, root_1, root_2);
            	        		}

            	        	}
            	        	if ( stream_arg != NULL) stream_arg->reset(stream_arg);

            	        }

            	        // ANTLRv3.g:202:51: ( ^( 'returns' $rt) )?
            	        {
            	        	if ( (stream_rt != NULL && stream_rt->hasNext(stream_rt)) || (stream_RET_V3TOK != NULL && stream_RET_V3TOK->hasNext(stream_RET_V3TOK))  )
            	        	{
            	        		// ANTLRv3.g:202:51: ^( 'returns' $rt)
            	        		{
            	        		    pANTLR3_BASE_TREE root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        		    root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
            	        		    stream_RET_V3TOK == NULL ? NULL : stream_RET_V3TOK->nextNode(stream_RET_V3TOK)
            	        		    , root_2));

            	        		    ADAPTOR->addChild(ADAPTOR, root_2, stream_rt == NULL ? NULL : stream_rt->nextNode(stream_rt));

            	        		    ADAPTOR->addChild(ADAPTOR, root_1, root_2);
            	        		}

            	        	}
            	        	if ( stream_rt != NULL) stream_rt->reset(stream_rt);
            	        	if ( stream_RET_V3TOK != NULL) stream_RET_V3TOK->reset(stream_RET_V3TOK);

            	        }

            	        // ANTLRv3.g:203:9: ( throwsSpec )?
            	        {
            	        	if ( (stream_throwsSpec != NULL && stream_throwsSpec->hasNext(stream_throwsSpec))  )
            	        	{
            	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_throwsSpec == NULL ? NULL : stream_throwsSpec->nextTree(stream_throwsSpec));

            	        	}
            	        	if ( stream_throwsSpec != NULL) stream_throwsSpec->reset(stream_throwsSpec);

            	        }

            	        // ANTLRv3.g:203:21: ( optionsSpec )?
            	        {
            	        	if ( (stream_optionsSpec != NULL && stream_optionsSpec->hasNext(stream_optionsSpec))  )
            	        	{
            	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_optionsSpec == NULL ? NULL : stream_optionsSpec->nextTree(stream_optionsSpec));

            	        	}
            	        	if ( stream_optionsSpec != NULL) stream_optionsSpec->reset(stream_optionsSpec);

            	        }

            	        // ANTLRv3.g:203:34: ( ruleScopeSpec )?
            	        {
            	        	if ( (stream_ruleScopeSpec != NULL && stream_ruleScopeSpec->hasNext(stream_ruleScopeSpec))  )
            	        	{
            	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_ruleScopeSpec == NULL ? NULL : stream_ruleScopeSpec->nextTree(stream_ruleScopeSpec));

            	        	}
            	        	if ( stream_ruleScopeSpec != NULL) stream_ruleScopeSpec->reset(stream_ruleScopeSpec);

            	        }

            	        // ANTLRv3.g:203:49: ( ruleAction )*
            	        {
            	        	while ( (stream_ruleAction != NULL && stream_ruleAction->hasNext(stream_ruleAction))  )
            	        	{
            	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_ruleAction == NULL ? NULL : stream_ruleAction->nextTree(stream_ruleAction));

            	        	}
            	        	if (stream_ruleAction != NULL) stream_ruleAction->reset(stream_ruleAction);

            	        }

            	        ADAPTOR->addChild(ADAPTOR, root_1, stream_altList == NULL ? NULL : stream_altList->nextTree(stream_altList));

            	        // ANTLRv3.g:205:9: ( exceptionGroup )?
            	        {
            	        	if ( (stream_exceptionGroup != NULL && stream_exceptionGroup->hasNext(stream_exceptionGroup))  )
            	        	{
            	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_exceptionGroup == NULL ? NULL : stream_exceptionGroup->nextTree(stream_exceptionGroup));

            	        	}
            	        	if ( stream_exceptionGroup != NULL) stream_exceptionGroup->reset(stream_exceptionGroup);

            	        }

            	        ADAPTOR->addChild(ADAPTOR, root_1, 

            	        #if 1 == 2
            	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, EOR_V3TOK, TOKTEXT("EORu"))
            	        #else
            	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, EOR_V3TOK, (pANTLR3_UINT8)"EORu")
            	        #endif

            	        );

            	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	    }

            	}


            	retval.tree = root_0; // set result root
            	if (stream_arg != NULL) stream_arg->free(stream_arg); 
            	if (stream_rt != NULL) stream_rt->free(stream_rt); 
            	if (stream_retval != NULL) stream_retval->free(stream_retval);


            }
        }

    }

    // This is where rules clean up and exit
    //
    goto ruleruleEx; /* Prevent compiler warnings */
    ruleruleEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_79 != NULL) stream_79->free(stream_79);
        if (stream_BANG_V3TOK != NULL) stream_BANG_V3TOK->free(stream_BANG_V3TOK);
        if (stream_91 != NULL) stream_91->free(stream_91);
        if (stream_FRAGMENT_V3TOK != NULL) stream_FRAGMENT_V3TOK->free(stream_FRAGMENT_V3TOK);
        if (stream_90 != NULL) stream_90->free(stream_90);
        if (stream_RET_V3TOK != NULL) stream_RET_V3TOK->free(stream_RET_V3TOK);
        if (stream_DOC_COMMENT_V3TOK != NULL) stream_DOC_COMMENT_V3TOK->free(stream_DOC_COMMENT_V3TOK);
        if (stream_81 != NULL) stream_81->free(stream_81);
        if (stream_ARG_ACTION != NULL) stream_ARG_ACTION->free(stream_ARG_ACTION);
        if (stream_89 != NULL) stream_89->free(stream_89);
        if (stream_id != NULL) stream_id->free(stream_id);
        if (stream_exceptionGroup != NULL) stream_exceptionGroup->free(stream_exceptionGroup);
        if (stream_throwsSpec != NULL) stream_throwsSpec->free(stream_throwsSpec);
        if (stream_ruleScopeSpec != NULL) stream_ruleScopeSpec->free(stream_ruleScopeSpec);
        if (stream_optionsSpec != NULL) stream_optionsSpec->free(stream_optionsSpec);
        if (stream_altList != NULL) stream_altList->free(stream_altList);
        if (stream_ruleAction != NULL) stream_ruleAction->free(stream_ruleAction);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    pANTLRv3Parser_rulePop(ctx);

    return retval;
}
/* $ANTLR end rule */

/**
 * $ANTLR start ruleAction
 * ANTLRv3.g:211:1: ruleAction : '@' id ACTION -> ^( '@' id ACTION ) ;
 */
static ANTLRv3Parser_ruleAction_return
ruleAction(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_ruleAction_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    char_literal55;
    pANTLR3_COMMON_TOKEN    ACTION57;
    ANTLRv3Parser_id_return id56;
    #undef	RETURN_TYPE_id56
    #define	RETURN_TYPE_id56 ANTLRv3Parser_id_return

    pANTLR3_BASE_TREE char_literal55_tree;
    pANTLR3_BASE_TREE ACTION57_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_AT_V3TOK;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_ACTION;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_id;
    /* Initialize rule variables
     */

    root_0 = NULL;

    char_literal55       = NULL;
    ACTION57       = NULL;
    id56.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    char_literal55_tree   = NULL;
    ACTION57_tree   = NULL;

    stream_AT_V3TOK   = NULL;
    #define CREATE_stream_AT_V3TOK  if (stream_AT_V3TOK == NULL) {stream_AT_V3TOK = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token AT_V3TOK"); } 
    stream_ACTION   = NULL;
    #define CREATE_stream_ACTION  if (stream_ACTION == NULL) {stream_ACTION = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token ACTION"); } 
    stream_id   = NULL;
    #define CREATE_stream_id  if (stream_id == NULL) {stream_id = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule id"); }

    retval.tree  = NULL;

    {
        // ANTLRv3.g:212:2: ( '@' id ACTION -> ^( '@' id ACTION ) )
        // ANTLRv3.g:212:4: '@' id ACTION
        {
            char_literal55 = (pANTLR3_COMMON_TOKEN) MATCHT(AT_V3TOK, &FOLLOW_AT_V3TOK_in_ruleAction1060);
            if  (HASEXCEPTION())
            {
                goto ruleruleActionEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_AT_V3TOK; stream_AT_V3TOK->add(stream_AT_V3TOK, char_literal55, NULL); }


            FOLLOWPUSH(FOLLOW_id_in_ruleAction1062);
            id56=id(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto ruleruleActionEx;
            }
            if (HASFAILED())
            {
                return retval;
            }

            if ( BACKTRACKING==0 ) { CREATE_stream_id; stream_id->add(stream_id, id56.tree, NULL); }

            ACTION57 = (pANTLR3_COMMON_TOKEN) MATCHT(ACTION, &FOLLOW_ACTION_in_ruleAction1064);
            if  (HASEXCEPTION())
            {
                goto ruleruleActionEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_ACTION; stream_ACTION->add(stream_ACTION, ACTION57, NULL); }


            /* AST REWRITE
             * elements          : id, ACTION, AT_V3TOK
             * token labels      : 
             * rule labels       : retval
             * token list labels : 
             * rule list labels  : 
             */
            if ( BACKTRACKING==0 ) 

            {
            	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	retval.tree    = root_0;
            	// 212:18: -> ^( '@' id ACTION )
            	{
            	    // ANTLRv3.g:212:21: ^( '@' id ACTION )
            	    {
            	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
            	        stream_AT_V3TOK == NULL ? NULL : stream_AT_V3TOK->nextNode(stream_AT_V3TOK)
            	        , root_1));

            	        ADAPTOR->addChild(ADAPTOR, root_1, stream_id == NULL ? NULL : stream_id->nextTree(stream_id));

            	        ADAPTOR->addChild(ADAPTOR, root_1, 
            	        stream_ACTION == NULL ? NULL : stream_ACTION->nextNode(stream_ACTION)
            	        );

            	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	    }

            	}


            	retval.tree = root_0; // set result root
            	if (stream_retval != NULL) stream_retval->free(stream_retval);


            }
        }

    }

    // This is where rules clean up and exit
    //
    goto ruleruleActionEx; /* Prevent compiler warnings */
    ruleruleActionEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_AT_V3TOK != NULL) stream_AT_V3TOK->free(stream_AT_V3TOK);
        if (stream_ACTION != NULL) stream_ACTION->free(stream_ACTION);
        if (stream_id != NULL) stream_id->free(stream_id);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end ruleAction */

/**
 * $ANTLR start throwsSpec
 * ANTLRv3.g:215:1: throwsSpec : 'throws' id ( ',' id )* -> ^( 'throws' ( id )+ ) ;
 */
static ANTLRv3Parser_throwsSpec_return
throwsSpec(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_throwsSpec_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    string_literal58;
    pANTLR3_COMMON_TOKEN    char_literal60;
    ANTLRv3Parser_id_return id59;
    #undef	RETURN_TYPE_id59
    #define	RETURN_TYPE_id59 ANTLRv3Parser_id_return

    ANTLRv3Parser_id_return id61;
    #undef	RETURN_TYPE_id61
    #define	RETURN_TYPE_id61 ANTLRv3Parser_id_return

    pANTLR3_BASE_TREE string_literal58_tree;
    pANTLR3_BASE_TREE char_literal60_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_78;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_92;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_id;
    /* Initialize rule variables
     */

    root_0 = NULL;

    string_literal58       = NULL;
    char_literal60       = NULL;
    id59.tree = NULL;

    id61.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    string_literal58_tree   = NULL;
    char_literal60_tree   = NULL;

    stream_78   = NULL;
    #define CREATE_stream_78  if (stream_78 == NULL) {stream_78 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 78"); } 
    stream_92   = NULL;
    #define CREATE_stream_92  if (stream_92 == NULL) {stream_92 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 92"); } 
    stream_id   = NULL;
    #define CREATE_stream_id  if (stream_id == NULL) {stream_id = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule id"); }

    retval.tree  = NULL;

    {
        // ANTLRv3.g:216:2: ( 'throws' id ( ',' id )* -> ^( 'throws' ( id )+ ) )
        // ANTLRv3.g:216:4: 'throws' id ( ',' id )*
        {
            string_literal58 = (pANTLR3_COMMON_TOKEN) MATCHT(92, &FOLLOW_92_in_throwsSpec1085);
            if  (HASEXCEPTION())
            {
                goto rulethrowsSpecEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_92; stream_92->add(stream_92, string_literal58, NULL); }


            FOLLOWPUSH(FOLLOW_id_in_throwsSpec1087);
            id59=id(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto rulethrowsSpecEx;
            }
            if (HASFAILED())
            {
                return retval;
            }

            if ( BACKTRACKING==0 ) { CREATE_stream_id; stream_id->add(stream_id, id59.tree, NULL); }

            // ANTLRv3.g:216:16: ( ',' id )*

            for (;;)
            {
                int alt26=2;
                switch ( LA(1) )
                {
                case 78:
                	{
                		alt26=1;
                	}
                    break;

                }

                switch (alt26)
                {
            	case 1:
            	    // ANTLRv3.g:216:18: ',' id
            	    {
            	        char_literal60 = (pANTLR3_COMMON_TOKEN) MATCHT(78, &FOLLOW_78_in_throwsSpec1091);
            	        if  (HASEXCEPTION())
            	        {
            	            goto rulethrowsSpecEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }
            	         
            	        if ( BACKTRACKING==0 ) { CREATE_stream_78; stream_78->add(stream_78, char_literal60, NULL); }


            	        FOLLOWPUSH(FOLLOW_id_in_throwsSpec1093);
            	        id61=id(ctx);

            	        FOLLOWPOP();
            	        if  (HASEXCEPTION())
            	        {
            	            goto rulethrowsSpecEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }

            	        if ( BACKTRACKING==0 ) { CREATE_stream_id; stream_id->add(stream_id, id61.tree, NULL); }

            	    }
            	    break;

            	default:
            	    goto loop26;	/* break out of the loop */
            	    break;
                }
            }
            loop26: ; /* Jump out to here if this rule does not match */


            /* AST REWRITE
             * elements          : id, 92
             * token labels      : 
             * rule labels       : retval
             * token list labels : 
             * rule list labels  : 
             */
            if ( BACKTRACKING==0 ) 

            {
            	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	retval.tree    = root_0;
            	// 216:28: -> ^( 'throws' ( id )+ )
            	{
            	    // ANTLRv3.g:216:31: ^( 'throws' ( id )+ )
            	    {
            	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
            	        stream_92 == NULL ? NULL : stream_92->nextNode(stream_92)
            	        , root_1));

            	        if ((stream_id == NULL || !stream_id->hasNext(stream_id))  )
            	        {
            	            CONSTRUCTEX();
            	            EXCEPTION->type         = ANTLR3_REWRITE_EARLY_EXCEPTION;
            	            EXCEPTION->name         = (void *)ANTLR3_REWRITE_EARLY_EXCEPTION_NAME;
            	        }
            	        else
            	        {
            	        	while ( (stream_id->hasNext(stream_id))  ) {
            	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_id == NULL ? NULL : stream_id->nextTree(stream_id));

            	        	}
            	        	stream_id->reset(stream_id);

            	        }
            	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	    }

            	}


            	retval.tree = root_0; // set result root
            	if (stream_retval != NULL) stream_retval->free(stream_retval);


            }
        }

    }

    // This is where rules clean up and exit
    //
    goto rulethrowsSpecEx; /* Prevent compiler warnings */
    rulethrowsSpecEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_78 != NULL) stream_78->free(stream_78);
        if (stream_92 != NULL) stream_92->free(stream_92);
        if (stream_id != NULL) stream_id->free(stream_id);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end throwsSpec */

/**
 * $ANTLR start ruleScopeSpec
 * ANTLRv3.g:219:1: ruleScopeSpec : ( 'scope' ACTION -> ^( 'scope' ACTION ) | 'scope' id ( ',' id )* ';' -> ^( 'scope' ( id )+ ) | 'scope' ACTION 'scope' id ( ',' id )* ';' -> ^( 'scope' ACTION ( id )+ ) );
 */
static ANTLRv3Parser_ruleScopeSpec_return
ruleScopeSpec(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_ruleScopeSpec_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    string_literal62;
    pANTLR3_COMMON_TOKEN    ACTION63;
    pANTLR3_COMMON_TOKEN    string_literal64;
    pANTLR3_COMMON_TOKEN    char_literal66;
    pANTLR3_COMMON_TOKEN    char_literal68;
    pANTLR3_COMMON_TOKEN    string_literal69;
    pANTLR3_COMMON_TOKEN    ACTION70;
    pANTLR3_COMMON_TOKEN    string_literal71;
    pANTLR3_COMMON_TOKEN    char_literal73;
    pANTLR3_COMMON_TOKEN    char_literal75;
    ANTLRv3Parser_id_return id65;
    #undef	RETURN_TYPE_id65
    #define	RETURN_TYPE_id65 ANTLRv3Parser_id_return

    ANTLRv3Parser_id_return id67;
    #undef	RETURN_TYPE_id67
    #define	RETURN_TYPE_id67 ANTLRv3Parser_id_return

    ANTLRv3Parser_id_return id72;
    #undef	RETURN_TYPE_id72
    #define	RETURN_TYPE_id72 ANTLRv3Parser_id_return

    ANTLRv3Parser_id_return id74;
    #undef	RETURN_TYPE_id74
    #define	RETURN_TYPE_id74 ANTLRv3Parser_id_return

    pANTLR3_BASE_TREE string_literal62_tree;
    pANTLR3_BASE_TREE ACTION63_tree;
    pANTLR3_BASE_TREE string_literal64_tree;
    pANTLR3_BASE_TREE char_literal66_tree;
    pANTLR3_BASE_TREE char_literal68_tree;
    pANTLR3_BASE_TREE string_literal69_tree;
    pANTLR3_BASE_TREE ACTION70_tree;
    pANTLR3_BASE_TREE string_literal71_tree;
    pANTLR3_BASE_TREE char_literal73_tree;
    pANTLR3_BASE_TREE char_literal75_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_78;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_81;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_ACTION;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_SCOPE_V3TOK;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_id;
    /* Initialize rule variables
     */

    root_0 = NULL;

    string_literal62       = NULL;
    ACTION63       = NULL;
    string_literal64       = NULL;
    char_literal66       = NULL;
    char_literal68       = NULL;
    string_literal69       = NULL;
    ACTION70       = NULL;
    string_literal71       = NULL;
    char_literal73       = NULL;
    char_literal75       = NULL;
    id65.tree = NULL;

    id67.tree = NULL;

    id72.tree = NULL;

    id74.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    string_literal62_tree   = NULL;
    ACTION63_tree   = NULL;
    string_literal64_tree   = NULL;
    char_literal66_tree   = NULL;
    char_literal68_tree   = NULL;
    string_literal69_tree   = NULL;
    ACTION70_tree   = NULL;
    string_literal71_tree   = NULL;
    char_literal73_tree   = NULL;
    char_literal75_tree   = NULL;

    stream_78   = NULL;
    #define CREATE_stream_78  if (stream_78 == NULL) {stream_78 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 78"); } 
    stream_81   = NULL;
    #define CREATE_stream_81  if (stream_81 == NULL) {stream_81 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 81"); } 
    stream_ACTION   = NULL;
    #define CREATE_stream_ACTION  if (stream_ACTION == NULL) {stream_ACTION = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token ACTION"); } 
    stream_SCOPE_V3TOK   = NULL;
    #define CREATE_stream_SCOPE_V3TOK  if (stream_SCOPE_V3TOK == NULL) {stream_SCOPE_V3TOK = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token SCOPE_V3TOK"); } 
    stream_id   = NULL;
    #define CREATE_stream_id  if (stream_id == NULL) {stream_id = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule id"); }

    retval.tree  = NULL;

    {
        {
            //  ANTLRv3.g:220:2: ( 'scope' ACTION -> ^( 'scope' ACTION ) | 'scope' id ( ',' id )* ';' -> ^( 'scope' ( id )+ ) | 'scope' ACTION 'scope' id ( ',' id )* ';' -> ^( 'scope' ACTION ( id )+ ) )

            ANTLR3_UINT32 alt29;

            alt29=3;

            switch ( LA(1) )
            {
            case SCOPE_V3TOK:
            	{
            		switch ( LA(2) )
            		{
            		case ACTION:
            			{
            				switch ( LA(3) )
            				{
            				case SCOPE_V3TOK:
            					{
            						alt29=3;
            					}
            				    break;
            				case EOF:
            				case AT_V3TOK:
            				case 79:
            					{
            						alt29=1;
            					}
            				    break;

            				default:
            				    if (BACKTRACKING>0)
            				    {
            				        FAILEDFLAG = ANTLR3_TRUE;
            				        return retval;
            				    }

            				    CONSTRUCTEX();
            				    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            				    EXCEPTION->message      = (void *)"";
            				    EXCEPTION->decisionNum  = 29;
            				    EXCEPTION->state        = 2;


            				    goto ruleruleScopeSpecEx;

            				}

            			}
            		    break;
            		case RULE_REF:
            		case TOKEN_REF:
            			{
            				alt29=2;
            			}
            		    break;

            		default:
            		    if (BACKTRACKING>0)
            		    {
            		        FAILEDFLAG = ANTLR3_TRUE;
            		        return retval;
            		    }

            		    CONSTRUCTEX();
            		    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            		    EXCEPTION->message      = (void *)"";
            		    EXCEPTION->decisionNum  = 29;
            		    EXCEPTION->state        = 1;


            		    goto ruleruleScopeSpecEx;

            		}

            	}
                break;

            default:
                if (BACKTRACKING>0)
                {
                    FAILEDFLAG = ANTLR3_TRUE;
                    return retval;
                }

                CONSTRUCTEX();
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
                EXCEPTION->message      = (void *)"";
                EXCEPTION->decisionNum  = 29;
                EXCEPTION->state        = 0;


                goto ruleruleScopeSpecEx;

            }

            switch (alt29)
            {
        	case 1:
        	    // ANTLRv3.g:220:4: 'scope' ACTION
        	    {
        	        string_literal62 = (pANTLR3_COMMON_TOKEN) MATCHT(SCOPE_V3TOK, &FOLLOW_SCOPE_V3TOK_in_ruleScopeSpec1116);
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleruleScopeSpecEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }
        	         
        	        if ( BACKTRACKING==0 ) { CREATE_stream_SCOPE_V3TOK; stream_SCOPE_V3TOK->add(stream_SCOPE_V3TOK, string_literal62, NULL); }


        	        ACTION63 = (pANTLR3_COMMON_TOKEN) MATCHT(ACTION, &FOLLOW_ACTION_in_ruleScopeSpec1118);
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleruleScopeSpecEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }
        	         
        	        if ( BACKTRACKING==0 ) { CREATE_stream_ACTION; stream_ACTION->add(stream_ACTION, ACTION63, NULL); }


        	        /* AST REWRITE
        	         * elements          : ACTION, SCOPE_V3TOK
        	         * token labels      : 
        	         * rule labels       : retval
        	         * token list labels : 
        	         * rule list labels  : 
        	         */
        	        if ( BACKTRACKING==0 ) 

        	        {
        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	retval.tree    = root_0;
        	        	// 220:19: -> ^( 'scope' ACTION )
        	        	{
        	        	    // ANTLRv3.g:220:22: ^( 'scope' ACTION )
        	        	    {
        	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
        	        	        stream_SCOPE_V3TOK == NULL ? NULL : stream_SCOPE_V3TOK->nextNode(stream_SCOPE_V3TOK)
        	        	        , root_1));

        	        	        ADAPTOR->addChild(ADAPTOR, root_1, 
        	        	        stream_ACTION == NULL ? NULL : stream_ACTION->nextNode(stream_ACTION)
        	        	        );

        	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
        	        	    }

        	        	}


        	        	retval.tree = root_0; // set result root
        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        }
        	    }
        	    break;
        	case 2:
        	    // ANTLRv3.g:221:4: 'scope' id ( ',' id )* ';'
        	    {
        	        string_literal64 = (pANTLR3_COMMON_TOKEN) MATCHT(SCOPE_V3TOK, &FOLLOW_SCOPE_V3TOK_in_ruleScopeSpec1131);
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleruleScopeSpecEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }
        	         
        	        if ( BACKTRACKING==0 ) { CREATE_stream_SCOPE_V3TOK; stream_SCOPE_V3TOK->add(stream_SCOPE_V3TOK, string_literal64, NULL); }


        	        FOLLOWPUSH(FOLLOW_id_in_ruleScopeSpec1133);
        	        id65=id(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleruleScopeSpecEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) { CREATE_stream_id; stream_id->add(stream_id, id65.tree, NULL); }

        	        // ANTLRv3.g:221:15: ( ',' id )*

        	        for (;;)
        	        {
        	            int alt27=2;
        	            switch ( LA(1) )
        	            {
        	            case 78:
        	            	{
        	            		alt27=1;
        	            	}
        	                break;

        	            }

        	            switch (alt27)
        	            {
        	        	case 1:
        	        	    // ANTLRv3.g:221:16: ',' id
        	        	    {
        	        	        char_literal66 = (pANTLR3_COMMON_TOKEN) MATCHT(78, &FOLLOW_78_in_ruleScopeSpec1136);
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto ruleruleScopeSpecEx;
        	        	        }
        	        	        if (HASFAILED())
        	        	        {
        	        	            return retval;
        	        	        }
        	        	         
        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_78; stream_78->add(stream_78, char_literal66, NULL); }


        	        	        FOLLOWPUSH(FOLLOW_id_in_ruleScopeSpec1138);
        	        	        id67=id(ctx);

        	        	        FOLLOWPOP();
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto ruleruleScopeSpecEx;
        	        	        }
        	        	        if (HASFAILED())
        	        	        {
        	        	            return retval;
        	        	        }

        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_id; stream_id->add(stream_id, id67.tree, NULL); }

        	        	    }
        	        	    break;

        	        	default:
        	        	    goto loop27;	/* break out of the loop */
        	        	    break;
        	            }
        	        }
        	        loop27: ; /* Jump out to here if this rule does not match */


        	        char_literal68 = (pANTLR3_COMMON_TOKEN) MATCHT(81, &FOLLOW_81_in_ruleScopeSpec1142);
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleruleScopeSpecEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }
        	         
        	        if ( BACKTRACKING==0 ) { CREATE_stream_81; stream_81->add(stream_81, char_literal68, NULL); }


        	        /* AST REWRITE
        	         * elements          : SCOPE_V3TOK, id
        	         * token labels      : 
        	         * rule labels       : retval
        	         * token list labels : 
        	         * rule list labels  : 
        	         */
        	        if ( BACKTRACKING==0 ) 

        	        {
        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	retval.tree    = root_0;
        	        	// 221:29: -> ^( 'scope' ( id )+ )
        	        	{
        	        	    // ANTLRv3.g:221:32: ^( 'scope' ( id )+ )
        	        	    {
        	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
        	        	        stream_SCOPE_V3TOK == NULL ? NULL : stream_SCOPE_V3TOK->nextNode(stream_SCOPE_V3TOK)
        	        	        , root_1));

        	        	        if ((stream_id == NULL || !stream_id->hasNext(stream_id))  )
        	        	        {
        	        	            CONSTRUCTEX();
        	        	            EXCEPTION->type         = ANTLR3_REWRITE_EARLY_EXCEPTION;
        	        	            EXCEPTION->name         = (void *)ANTLR3_REWRITE_EARLY_EXCEPTION_NAME;
        	        	        }
        	        	        else
        	        	        {
        	        	        	while ( (stream_id->hasNext(stream_id))  ) {
        	        	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_id == NULL ? NULL : stream_id->nextTree(stream_id));

        	        	        	}
        	        	        	stream_id->reset(stream_id);

        	        	        }
        	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
        	        	    }

        	        	}


        	        	retval.tree = root_0; // set result root
        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        }
        	    }
        	    break;
        	case 3:
        	    // ANTLRv3.g:222:4: 'scope' ACTION 'scope' id ( ',' id )* ';'
        	    {
        	        string_literal69 = (pANTLR3_COMMON_TOKEN) MATCHT(SCOPE_V3TOK, &FOLLOW_SCOPE_V3TOK_in_ruleScopeSpec1156);
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleruleScopeSpecEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }
        	         
        	        if ( BACKTRACKING==0 ) { CREATE_stream_SCOPE_V3TOK; stream_SCOPE_V3TOK->add(stream_SCOPE_V3TOK, string_literal69, NULL); }


        	        ACTION70 = (pANTLR3_COMMON_TOKEN) MATCHT(ACTION, &FOLLOW_ACTION_in_ruleScopeSpec1158);
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleruleScopeSpecEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }
        	         
        	        if ( BACKTRACKING==0 ) { CREATE_stream_ACTION; stream_ACTION->add(stream_ACTION, ACTION70, NULL); }


        	        string_literal71 = (pANTLR3_COMMON_TOKEN) MATCHT(SCOPE_V3TOK, &FOLLOW_SCOPE_V3TOK_in_ruleScopeSpec1162);
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleruleScopeSpecEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }
        	         
        	        if ( BACKTRACKING==0 ) { CREATE_stream_SCOPE_V3TOK; stream_SCOPE_V3TOK->add(stream_SCOPE_V3TOK, string_literal71, NULL); }


        	        FOLLOWPUSH(FOLLOW_id_in_ruleScopeSpec1164);
        	        id72=id(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleruleScopeSpecEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) { CREATE_stream_id; stream_id->add(stream_id, id72.tree, NULL); }

        	        // ANTLRv3.g:223:14: ( ',' id )*

        	        for (;;)
        	        {
        	            int alt28=2;
        	            switch ( LA(1) )
        	            {
        	            case 78:
        	            	{
        	            		alt28=1;
        	            	}
        	                break;

        	            }

        	            switch (alt28)
        	            {
        	        	case 1:
        	        	    // ANTLRv3.g:223:15: ',' id
        	        	    {
        	        	        char_literal73 = (pANTLR3_COMMON_TOKEN) MATCHT(78, &FOLLOW_78_in_ruleScopeSpec1167);
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto ruleruleScopeSpecEx;
        	        	        }
        	        	        if (HASFAILED())
        	        	        {
        	        	            return retval;
        	        	        }
        	        	         
        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_78; stream_78->add(stream_78, char_literal73, NULL); }


        	        	        FOLLOWPUSH(FOLLOW_id_in_ruleScopeSpec1169);
        	        	        id74=id(ctx);

        	        	        FOLLOWPOP();
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto ruleruleScopeSpecEx;
        	        	        }
        	        	        if (HASFAILED())
        	        	        {
        	        	            return retval;
        	        	        }

        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_id; stream_id->add(stream_id, id74.tree, NULL); }

        	        	    }
        	        	    break;

        	        	default:
        	        	    goto loop28;	/* break out of the loop */
        	        	    break;
        	            }
        	        }
        	        loop28: ; /* Jump out to here if this rule does not match */


        	        char_literal75 = (pANTLR3_COMMON_TOKEN) MATCHT(81, &FOLLOW_81_in_ruleScopeSpec1173);
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleruleScopeSpecEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }
        	         
        	        if ( BACKTRACKING==0 ) { CREATE_stream_81; stream_81->add(stream_81, char_literal75, NULL); }


        	        /* AST REWRITE
        	         * elements          : SCOPE_V3TOK, id, ACTION
        	         * token labels      : 
        	         * rule labels       : retval
        	         * token list labels : 
        	         * rule list labels  : 
        	         */
        	        if ( BACKTRACKING==0 ) 

        	        {
        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	retval.tree    = root_0;
        	        	// 224:3: -> ^( 'scope' ACTION ( id )+ )
        	        	{
        	        	    // ANTLRv3.g:224:6: ^( 'scope' ACTION ( id )+ )
        	        	    {
        	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
        	        	        stream_SCOPE_V3TOK == NULL ? NULL : stream_SCOPE_V3TOK->nextNode(stream_SCOPE_V3TOK)
        	        	        , root_1));

        	        	        ADAPTOR->addChild(ADAPTOR, root_1, 
        	        	        stream_ACTION == NULL ? NULL : stream_ACTION->nextNode(stream_ACTION)
        	        	        );

        	        	        if ((stream_id == NULL || !stream_id->hasNext(stream_id))  )
        	        	        {
        	        	            CONSTRUCTEX();
        	        	            EXCEPTION->type         = ANTLR3_REWRITE_EARLY_EXCEPTION;
        	        	            EXCEPTION->name         = (void *)ANTLR3_REWRITE_EARLY_EXCEPTION_NAME;
        	        	        }
        	        	        else
        	        	        {
        	        	        	while ( (stream_id->hasNext(stream_id))  ) {
        	        	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_id == NULL ? NULL : stream_id->nextTree(stream_id));

        	        	        	}
        	        	        	stream_id->reset(stream_id);

        	        	        }
        	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
        	        	    }

        	        	}


        	        	retval.tree = root_0; // set result root
        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        }
        	    }
        	    break;

            }
        }
    }

    // This is where rules clean up and exit
    //
    goto ruleruleScopeSpecEx; /* Prevent compiler warnings */
    ruleruleScopeSpecEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_78 != NULL) stream_78->free(stream_78);
        if (stream_81 != NULL) stream_81->free(stream_81);
        if (stream_ACTION != NULL) stream_ACTION->free(stream_ACTION);
        if (stream_SCOPE_V3TOK != NULL) stream_SCOPE_V3TOK->free(stream_SCOPE_V3TOK);
        if (stream_id != NULL) stream_id->free(stream_id);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end ruleScopeSpec */

/**
 * $ANTLR start block
 * ANTLRv3.g:227:1: block : lp= '(' ( (opts= optionsSpec )? ':' )? altpair ( '|' altpair )* rp= ')' -> ^( BLOCK_V3TOK[$lp,\"BLOCK\"] ( optionsSpec )? ( altpair )+ EOB_V3TOK[$rp,\"EOB\"] ) ;
 */
static ANTLRv3Parser_block_return
block(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_block_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    lp;
    pANTLR3_COMMON_TOKEN    rp;
    pANTLR3_COMMON_TOKEN    char_literal76;
    pANTLR3_COMMON_TOKEN    char_literal78;
    ANTLRv3Parser_optionsSpec_return opts;
    #undef	RETURN_TYPE_opts
    #define	RETURN_TYPE_opts ANTLRv3Parser_optionsSpec_return

    ANTLRv3Parser_altpair_return altpair77;
    #undef	RETURN_TYPE_altpair77
    #define	RETURN_TYPE_altpair77 ANTLRv3Parser_altpair_return

    ANTLRv3Parser_altpair_return altpair79;
    #undef	RETURN_TYPE_altpair79
    #define	RETURN_TYPE_altpair79 ANTLRv3Parser_altpair_return

    pANTLR3_BASE_TREE lp_tree;
    pANTLR3_BASE_TREE rp_tree;
    pANTLR3_BASE_TREE char_literal76_tree;
    pANTLR3_BASE_TREE char_literal78_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_79;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_94;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_74;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_75;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_altpair;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_optionsSpec;
    /* Initialize rule variables
     */

    root_0 = NULL;

    lp       = NULL;
    rp       = NULL;
    char_literal76       = NULL;
    char_literal78       = NULL;
    opts.tree = NULL;

    altpair77.tree = NULL;

    altpair79.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    lp_tree   = NULL;
    rp_tree   = NULL;
    char_literal76_tree   = NULL;
    char_literal78_tree   = NULL;

    stream_79   = NULL;
    #define CREATE_stream_79  if (stream_79 == NULL) {stream_79 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 79"); } 
    stream_94   = NULL;
    #define CREATE_stream_94  if (stream_94 == NULL) {stream_94 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 94"); } 
    stream_74   = NULL;
    #define CREATE_stream_74  if (stream_74 == NULL) {stream_74 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 74"); } 
    stream_75   = NULL;
    #define CREATE_stream_75  if (stream_75 == NULL) {stream_75 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 75"); } 
    stream_altpair   = NULL;
    #define CREATE_stream_altpair  if (stream_altpair == NULL) {stream_altpair = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule altpair"); }
    stream_optionsSpec   = NULL;
    #define CREATE_stream_optionsSpec  if (stream_optionsSpec == NULL) {stream_optionsSpec = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule optionsSpec"); }

    retval.tree  = NULL;

    {
        // ANTLRv3.g:227:6: (lp= '(' ( (opts= optionsSpec )? ':' )? altpair ( '|' altpair )* rp= ')' -> ^( BLOCK_V3TOK[$lp,\"BLOCK\"] ( optionsSpec )? ( altpair )+ EOB_V3TOK[$rp,\"EOB\"] ) )
        // ANTLRv3.g:228:2: lp= '(' ( (opts= optionsSpec )? ':' )? altpair ( '|' altpair )* rp= ')'
        {
            lp = (pANTLR3_COMMON_TOKEN) MATCHT(74, &FOLLOW_74_in_block1201);
            if  (HASEXCEPTION())
            {
                goto ruleblockEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_74; stream_74->add(stream_74, lp, NULL); }


            // ANTLRv3.g:228:11: ( (opts= optionsSpec )? ':' )?
            {
                int alt31=2;
                switch ( LA(1) )
                {
                    case OPTIONS:
                    case 79:
                    	{
                    		alt31=1;
                    	}
                        break;
                }

                switch (alt31)
                {
            	case 1:
            	    // ANTLRv3.g:228:12: (opts= optionsSpec )? ':'
            	    {
            	        // ANTLRv3.g:228:12: (opts= optionsSpec )?
            	        {
            	            int alt30=2;
            	            switch ( LA(1) )
            	            {
            	                case OPTIONS:
            	                	{
            	                		alt30=1;
            	                	}
            	                    break;
            	            }

            	            switch (alt30)
            	            {
            	        	case 1:
            	        	    // ANTLRv3.g:228:13: opts= optionsSpec
            	        	    {
            	        	        FOLLOWPUSH(FOLLOW_optionsSpec_in_block1209);
            	        	        opts=optionsSpec(ctx);

            	        	        FOLLOWPOP();
            	        	        if  (HASEXCEPTION())
            	        	        {
            	        	            goto ruleblockEx;
            	        	        }
            	        	        if (HASFAILED())
            	        	        {
            	        	            return retval;
            	        	        }

            	        	        if ( BACKTRACKING==0 ) { CREATE_stream_optionsSpec; stream_optionsSpec->add(stream_optionsSpec, opts.tree, NULL); }

            	        	    }
            	        	    break;

            	            }
            	        }

            	        char_literal76 = (pANTLR3_COMMON_TOKEN) MATCHT(79, &FOLLOW_79_in_block1213);
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleblockEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }
            	         
            	        if ( BACKTRACKING==0 ) { CREATE_stream_79; stream_79->add(stream_79, char_literal76, NULL); }


            	    }
            	    break;

                }
            }

            FOLLOWPUSH(FOLLOW_altpair_in_block1218);
            altpair77=altpair(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto ruleblockEx;
            }
            if (HASFAILED())
            {
                return retval;
            }

            if ( BACKTRACKING==0 ) { CREATE_stream_altpair; stream_altpair->add(stream_altpair, altpair77.tree, NULL); }

            // ANTLRv3.g:228:49: ( '|' altpair )*

            for (;;)
            {
                int alt32=2;
                switch ( LA(1) )
                {
                case 94:
                	{
                		alt32=1;
                	}
                    break;

                }

                switch (alt32)
                {
            	case 1:
            	    // ANTLRv3.g:228:51: '|' altpair
            	    {
            	        char_literal78 = (pANTLR3_COMMON_TOKEN) MATCHT(94, &FOLLOW_94_in_block1222);
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleblockEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }
            	         
            	        if ( BACKTRACKING==0 ) { CREATE_stream_94; stream_94->add(stream_94, char_literal78, NULL); }


            	        FOLLOWPUSH(FOLLOW_altpair_in_block1224);
            	        altpair79=altpair(ctx);

            	        FOLLOWPOP();
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleblockEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }

            	        if ( BACKTRACKING==0 ) { CREATE_stream_altpair; stream_altpair->add(stream_altpair, altpair79.tree, NULL); }

            	    }
            	    break;

            	default:
            	    goto loop32;	/* break out of the loop */
            	    break;
                }
            }
            loop32: ; /* Jump out to here if this rule does not match */


            rp = (pANTLR3_COMMON_TOKEN) MATCHT(75, &FOLLOW_75_in_block1233);
            if  (HASEXCEPTION())
            {
                goto ruleblockEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_75; stream_75->add(stream_75, rp, NULL); }


            /* AST REWRITE
             * elements          : altpair, optionsSpec
             * token labels      : 
             * rule labels       : retval
             * token list labels : 
             * rule list labels  : 
             */
            if ( BACKTRACKING==0 ) 

            {
            	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	retval.tree    = root_0;
            	// 229:3: -> ^( BLOCK_V3TOK[$lp,\"BLOCK\"] ( optionsSpec )? ( altpair )+ EOB_V3TOK[$rp,\"EOB\"] )
            	{
            	    // ANTLRv3.g:229:6: ^( BLOCK_V3TOK[$lp,\"BLOCK\"] ( optionsSpec )? ( altpair )+ EOB_V3TOK[$rp,\"EOB\"] )
            	    {
            	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 

            	        #if 2 == 2
            	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, BLOCK_V3TOK, TOKTEXT(lp, "BLOCK"))
            	        #else
            	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, BLOCK_V3TOK, (pANTLR3_UINT8)lp, "BLOCK")
            	        #endif

            	        , root_1));

            	        // ANTLRv3.g:229:34: ( optionsSpec )?
            	        {
            	        	if ( (stream_optionsSpec != NULL && stream_optionsSpec->hasNext(stream_optionsSpec))  )
            	        	{
            	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_optionsSpec == NULL ? NULL : stream_optionsSpec->nextTree(stream_optionsSpec));

            	        	}
            	        	if ( stream_optionsSpec != NULL) stream_optionsSpec->reset(stream_optionsSpec);

            	        }

            	        if ((stream_altpair == NULL || !stream_altpair->hasNext(stream_altpair))  )
            	        {
            	            CONSTRUCTEX();
            	            EXCEPTION->type         = ANTLR3_REWRITE_EARLY_EXCEPTION;
            	            EXCEPTION->name         = (void *)ANTLR3_REWRITE_EARLY_EXCEPTION_NAME;
            	        }
            	        else
            	        {
            	        	while ( (stream_altpair->hasNext(stream_altpair))  ) {
            	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_altpair == NULL ? NULL : stream_altpair->nextTree(stream_altpair));

            	        	}
            	        	stream_altpair->reset(stream_altpair);

            	        }
            	        ADAPTOR->addChild(ADAPTOR, root_1, 

            	        #if 2 == 2
            	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, EOB_V3TOK, TOKTEXT(rp, "EOB"))
            	        #else
            	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, EOB_V3TOK, (pANTLR3_UINT8)rp, "EOB")
            	        #endif

            	        );

            	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	    }

            	}


            	retval.tree = root_0; // set result root
            	if (stream_retval != NULL) stream_retval->free(stream_retval);


            }
        }

    }

    // This is where rules clean up and exit
    //
    goto ruleblockEx; /* Prevent compiler warnings */
    ruleblockEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_79 != NULL) stream_79->free(stream_79);
        if (stream_94 != NULL) stream_94->free(stream_94);
        if (stream_74 != NULL) stream_74->free(stream_74);
        if (stream_75 != NULL) stream_75->free(stream_75);
        if (stream_altpair != NULL) stream_altpair->free(stream_altpair);
        if (stream_optionsSpec != NULL) stream_optionsSpec->free(stream_optionsSpec);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end block */

/**
 * $ANTLR start altpair
 * ANTLRv3.g:232:1: altpair : alternative rewrite ;
 */
static ANTLRv3Parser_altpair_return
altpair(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_altpair_return retval;


    pANTLR3_BASE_TREE root_0;

    ANTLRv3Parser_alternative_return alternative80;
    #undef	RETURN_TYPE_alternative80
    #define	RETURN_TYPE_alternative80 ANTLRv3Parser_alternative_return

    ANTLRv3Parser_rewrite_return rewrite81;
    #undef	RETURN_TYPE_rewrite81
    #define	RETURN_TYPE_rewrite81 ANTLRv3Parser_rewrite_return


    /* Initialize rule variables
     */

    root_0 = NULL;

    alternative80.tree = NULL;

    rewrite81.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;




    retval.tree  = NULL;

    {
        // ANTLRv3.g:232:9: ( alternative rewrite )
        // ANTLRv3.g:232:11: alternative rewrite
        {
            root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


            FOLLOWPUSH(FOLLOW_alternative_in_altpair1262);
            alternative80=alternative(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto rulealtpairEx;
            }
            if (HASFAILED())
            {
                return retval;
            }

            if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, alternative80.tree);

            FOLLOWPUSH(FOLLOW_rewrite_in_altpair1264);
            rewrite81=rewrite(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto rulealtpairEx;
            }
            if (HASFAILED())
            {
                return retval;
            }

            if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, rewrite81.tree);

        }

    }

    // This is where rules clean up and exit
    //
    goto rulealtpairEx; /* Prevent compiler warnings */
    rulealtpairEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end altpair */

/**
 * $ANTLR start altList
 * ANTLRv3.g:234:1: altList : altpair ( '|' altpair )* -> ^( BLOCK_V3TOK[prevToken, \"BLOCK\"] ( altpair )+ EOB_V3TOK[\"EOB\"] ) ;
 */
static ANTLRv3Parser_altList_return
altList(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_altList_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    char_literal83;
    ANTLRv3Parser_altpair_return altpair82;
    #undef	RETURN_TYPE_altpair82
    #define	RETURN_TYPE_altpair82 ANTLRv3Parser_altpair_return

    ANTLRv3Parser_altpair_return altpair84;
    #undef	RETURN_TYPE_altpair84
    #define	RETURN_TYPE_altpair84 ANTLRv3Parser_altpair_return

    pANTLR3_BASE_TREE char_literal83_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_94;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_altpair;
    /* Initialize rule variables
     */

    root_0 = NULL;


    	pANTLR3_COMMON_TOKEN prevToken = LT(-1); // either : or (

    char_literal83       = NULL;
    altpair82.tree = NULL;

    altpair84.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    char_literal83_tree   = NULL;

    stream_94   = NULL;
    #define CREATE_stream_94  if (stream_94 == NULL) {stream_94 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 94"); } 
    stream_altpair   = NULL;
    #define CREATE_stream_altpair  if (stream_altpair == NULL) {stream_altpair = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule altpair"); }

    retval.tree  = NULL;

    {
        // ANTLRv3.g:237:2: ( altpair ( '|' altpair )* -> ^( BLOCK_V3TOK[prevToken, \"BLOCK\"] ( altpair )+ EOB_V3TOK[\"EOB\"] ) )
        // ANTLRv3.g:238:2: altpair ( '|' altpair )*
        {
            FOLLOWPUSH(FOLLOW_altpair_in_altList1278);
            altpair82=altpair(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto rulealtListEx;
            }
            if (HASFAILED())
            {
                return retval;
            }

            if ( BACKTRACKING==0 ) { CREATE_stream_altpair; stream_altpair->add(stream_altpair, altpair82.tree, NULL); }

            // ANTLRv3.g:238:10: ( '|' altpair )*

            for (;;)
            {
                int alt33=2;
                switch ( LA(1) )
                {
                case 94:
                	{
                		alt33=1;
                	}
                    break;

                }

                switch (alt33)
                {
            	case 1:
            	    // ANTLRv3.g:238:12: '|' altpair
            	    {
            	        char_literal83 = (pANTLR3_COMMON_TOKEN) MATCHT(94, &FOLLOW_94_in_altList1282);
            	        if  (HASEXCEPTION())
            	        {
            	            goto rulealtListEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }
            	         
            	        if ( BACKTRACKING==0 ) { CREATE_stream_94; stream_94->add(stream_94, char_literal83, NULL); }


            	        FOLLOWPUSH(FOLLOW_altpair_in_altList1284);
            	        altpair84=altpair(ctx);

            	        FOLLOWPOP();
            	        if  (HASEXCEPTION())
            	        {
            	            goto rulealtListEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }

            	        if ( BACKTRACKING==0 ) { CREATE_stream_altpair; stream_altpair->add(stream_altpair, altpair84.tree, NULL); }

            	    }
            	    break;

            	default:
            	    goto loop33;	/* break out of the loop */
            	    break;
                }
            }
            loop33: ; /* Jump out to here if this rule does not match */


            /* AST REWRITE
             * elements          : altpair
             * token labels      : 
             * rule labels       : retval
             * token list labels : 
             * rule list labels  : 
             */
            if ( BACKTRACKING==0 ) 

            {
            	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	retval.tree    = root_0;
            	// 238:27: -> ^( BLOCK_V3TOK[prevToken, \"BLOCK\"] ( altpair )+ EOB_V3TOK[\"EOB\"] )
            	{
            	    // ANTLRv3.g:238:30: ^( BLOCK_V3TOK[prevToken, \"BLOCK\"] ( altpair )+ EOB_V3TOK[\"EOB\"] )
            	    {
            	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 

            	        #if 2 == 2
            	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, BLOCK_V3TOK, TOKTEXT(prevToken, "BLOCK"))
            	        #else
            	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, BLOCK_V3TOK, (pANTLR3_UINT8)prevToken, "BLOCK")
            	        #endif

            	        , root_1));

            	        if ((stream_altpair == NULL || !stream_altpair->hasNext(stream_altpair))  )
            	        {
            	            CONSTRUCTEX();
            	            EXCEPTION->type         = ANTLR3_REWRITE_EARLY_EXCEPTION;
            	            EXCEPTION->name         = (void *)ANTLR3_REWRITE_EARLY_EXCEPTION_NAME;
            	        }
            	        else
            	        {
            	        	while ( (stream_altpair->hasNext(stream_altpair))  ) {
            	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_altpair == NULL ? NULL : stream_altpair->nextTree(stream_altpair));

            	        	}
            	        	stream_altpair->reset(stream_altpair);

            	        }
            	        ADAPTOR->addChild(ADAPTOR, root_1, 

            	        #if 1 == 2
            	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, EOB_V3TOK, TOKTEXT("EOB"))
            	        #else
            	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, EOB_V3TOK, (pANTLR3_UINT8)"EOB")
            	        #endif

            	        );

            	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	    }

            	}


            	retval.tree = root_0; // set result root
            	if (stream_retval != NULL) stream_retval->free(stream_retval);


            }
        }

    }

    // This is where rules clean up and exit
    //
    goto rulealtListEx; /* Prevent compiler warnings */
    rulealtListEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_94 != NULL) stream_94->free(stream_94);
        if (stream_altpair != NULL) stream_altpair->free(stream_altpair);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end altList */

/**
 * $ANTLR start alternative
 * ANTLRv3.g:241:1: alternative : ( ( element )+ -> ^( ALT_V3TOK[firstToken,\"ALT\"] ( element )+ EOA_V3TOK[\"EOA\"] ) | -> ^( ALT_V3TOK[prevToken,\"ALT\"] EPSILON_V3TOK[prevToken,\"EPSILON\"] EOA_V3TOK[\"EOA\"] ) );
 */
static ANTLRv3Parser_alternative_return
alternative(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_alternative_return retval;


    pANTLR3_BASE_TREE root_0;

    ANTLRv3Parser_element_return element85;
    #undef	RETURN_TYPE_element85
    #define	RETURN_TYPE_element85 ANTLRv3Parser_element_return

    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_element;
    /* Initialize rule variables
     */

    root_0 = NULL;


    	pANTLR3_COMMON_TOKEN firstToken = LT(1);
    	pANTLR3_COMMON_TOKEN prevToken = LT(-1); // either : or | I think

    element85.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;



    stream_element   = NULL;
    #define CREATE_stream_element  if (stream_element == NULL) {stream_element = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule element"); }

    retval.tree  = NULL;

    {
        {
            //  ANTLRv3.g:246:5: ( ( element )+ -> ^( ALT_V3TOK[firstToken,\"ALT\"] ( element )+ EOA_V3TOK[\"EOA\"] ) | -> ^( ALT_V3TOK[prevToken,\"ALT\"] EPSILON_V3TOK[prevToken,\"EPSILON\"] EOA_V3TOK[\"EOA\"] ) )

            ANTLR3_UINT32 alt35;

            alt35=2;

            switch ( LA(1) )
            {
            case ACTION:
            case CHAR_LITERAL:
            case DOT_SYM:
            case RULE_REF:
            case SEMPRED_V3TOK:
            case STRING_LITERAL:
            case TOKEN_REF:
            case TREE_BEGIN_V3TOK:
            case 74:
            case 96:
            	{
            		alt35=1;
            	}
                break;
            case EOF:
            case REWRITE_V3TOK:
            case 75:
            case 81:
            case 94:
            	{
            		alt35=2;
            	}
                break;

            default:
                if (BACKTRACKING>0)
                {
                    FAILEDFLAG = ANTLR3_TRUE;
                    return retval;
                }

                CONSTRUCTEX();
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
                EXCEPTION->message      = (void *)"";
                EXCEPTION->decisionNum  = 35;
                EXCEPTION->state        = 0;


                goto rulealternativeEx;

            }

            switch (alt35)
            {
        	case 1:
        	    // ANTLRv3.g:246:9: ( element )+
        	    {
        	        // ANTLRv3.g:246:9: ( element )+
        	        {
        	            int cnt34=0;

        	            for (;;)
        	            {
        	                int alt34=2;
        	        	switch ( LA(1) )
        	        	{
        	        	case ACTION:
        	        	case CHAR_LITERAL:
        	        	case DOT_SYM:
        	        	case RULE_REF:
        	        	case SEMPRED_V3TOK:
        	        	case STRING_LITERAL:
        	        	case TOKEN_REF:
        	        	case TREE_BEGIN_V3TOK:
        	        	case 74:
        	        	case 96:
        	        		{
        	        			alt34=1;
        	        		}
        	        	    break;

        	        	}

        	        	switch (alt34)
        	        	{
        	        	    case 1:
        	        	        // ANTLRv3.g:246:9: element
        	        	        {
        	        	            FOLLOWPUSH(FOLLOW_element_in_alternative1322);
        	        	            element85=element(ctx);

        	        	            FOLLOWPOP();
        	        	            if  (HASEXCEPTION())
        	        	            {
        	        	                goto rulealternativeEx;
        	        	            }
        	        	            if (HASFAILED())
        	        	            {
        	        	                return retval;
        	        	            }

        	        	            if ( BACKTRACKING==0 ) { CREATE_stream_element; stream_element->add(stream_element, element85.tree, NULL); }

        	        	        }
        	        	        break;

        	        	    default:

        	        		if ( cnt34 >= 1 )
        	        		{
        	        		    goto loop34;
        	        		}
        	        		if (BACKTRACKING>0)
        	        		{
        	        		    FAILEDFLAG = ANTLR3_TRUE;
        	        		    return retval;
        	        		}

        	        		/* mismatchedSetEx()
        	        		 */
        	        		CONSTRUCTEX();
        	        		EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
        	        		EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;


        	        		goto rulealternativeEx;
        	        	}
        	        	cnt34++;
        	            }
        	            loop34: ;	/* Jump to here if this rule does not match */
        	        }

        	        /* AST REWRITE
        	         * elements          : element
        	         * token labels      : 
        	         * rule labels       : retval
        	         * token list labels : 
        	         * rule list labels  : 
        	         */
        	        if ( BACKTRACKING==0 ) 

        	        {
        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	retval.tree    = root_0;
        	        	// 246:18: -> ^( ALT_V3TOK[firstToken,\"ALT\"] ( element )+ EOA_V3TOK[\"EOA\"] )
        	        	{
        	        	    // ANTLRv3.g:246:21: ^( ALT_V3TOK[firstToken,\"ALT\"] ( element )+ EOA_V3TOK[\"EOA\"] )
        	        	    {
        	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 

        	        	        #if 2 == 2
        	        	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, ALT_V3TOK, TOKTEXT(firstToken, "ALT"))
        	        	        #else
        	        	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, ALT_V3TOK, (pANTLR3_UINT8)firstToken, "ALT")
        	        	        #endif

        	        	        , root_1));

        	        	        if ((stream_element == NULL || !stream_element->hasNext(stream_element))  )
        	        	        {
        	        	            CONSTRUCTEX();
        	        	            EXCEPTION->type         = ANTLR3_REWRITE_EARLY_EXCEPTION;
        	        	            EXCEPTION->name         = (void *)ANTLR3_REWRITE_EARLY_EXCEPTION_NAME;
        	        	        }
        	        	        else
        	        	        {
        	        	        	while ( (stream_element->hasNext(stream_element))  ) {
        	        	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_element == NULL ? NULL : stream_element->nextTree(stream_element));

        	        	        	}
        	        	        	stream_element->reset(stream_element);

        	        	        }
        	        	        ADAPTOR->addChild(ADAPTOR, root_1, 

        	        	        #if 1 == 2
        	        	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, EOA_V3TOK, TOKTEXT("EOA"))
        	        	        #else
        	        	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, EOA_V3TOK, (pANTLR3_UINT8)"EOA")
        	        	        #endif

        	        	        );

        	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
        	        	    }

        	        	}


        	        	retval.tree = root_0; // set result root
        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        }
        	    }
        	    break;
        	case 2:
        	    // ANTLRv3.g:247:9: 
        	    {
        	        /* AST REWRITE
        	         * elements          : 
        	         * token labels      : 
        	         * rule labels       : retval
        	         * token list labels : 
        	         * rule list labels  : 
        	         */
        	        if ( BACKTRACKING==0 ) 

        	        {
        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	retval.tree    = root_0;
        	        	// 247:9: -> ^( ALT_V3TOK[prevToken,\"ALT\"] EPSILON_V3TOK[prevToken,\"EPSILON\"] EOA_V3TOK[\"EOA\"] )
        	        	{
        	        	    // ANTLRv3.g:247:12: ^( ALT_V3TOK[prevToken,\"ALT\"] EPSILON_V3TOK[prevToken,\"EPSILON\"] EOA_V3TOK[\"EOA\"] )
        	        	    {
        	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 

        	        	        #if 2 == 2
        	        	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, ALT_V3TOK, TOKTEXT(prevToken, "ALT"))
        	        	        #else
        	        	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, ALT_V3TOK, (pANTLR3_UINT8)prevToken, "ALT")
        	        	        #endif

        	        	        , root_1));

        	        	        ADAPTOR->addChild(ADAPTOR, root_1, 

        	        	        #if 2 == 2
        	        	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, EPSILON_V3TOK, TOKTEXT(prevToken, "EPSILON"))
        	        	        #else
        	        	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, EPSILON_V3TOK, (pANTLR3_UINT8)prevToken, "EPSILON")
        	        	        #endif

        	        	        );

        	        	        ADAPTOR->addChild(ADAPTOR, root_1, 

        	        	        #if 1 == 2
        	        	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, EOA_V3TOK, TOKTEXT("EOA"))
        	        	        #else
        	        	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, EOA_V3TOK, (pANTLR3_UINT8)"EOA")
        	        	        #endif

        	        	        );

        	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
        	        	    }

        	        	}


        	        	retval.tree = root_0; // set result root
        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        }
        	    }
        	    break;

            }
        }
    }

    // This is where rules clean up and exit
    //
    goto rulealternativeEx; /* Prevent compiler warnings */
    rulealternativeEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_element != NULL) stream_element->free(stream_element);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end alternative */

/**
 * $ANTLR start exceptionGroup
 * ANTLRv3.g:250:1: exceptionGroup : ( ( exceptionHandler )+ ( finallyClause )? | finallyClause );
 */
static ANTLRv3Parser_exceptionGroup_return
exceptionGroup(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_exceptionGroup_return retval;


    pANTLR3_BASE_TREE root_0;

    ANTLRv3Parser_exceptionHandler_return exceptionHandler86;
    #undef	RETURN_TYPE_exceptionHandler86
    #define	RETURN_TYPE_exceptionHandler86 ANTLRv3Parser_exceptionHandler_return

    ANTLRv3Parser_finallyClause_return finallyClause87;
    #undef	RETURN_TYPE_finallyClause87
    #define	RETURN_TYPE_finallyClause87 ANTLRv3Parser_finallyClause_return

    ANTLRv3Parser_finallyClause_return finallyClause88;
    #undef	RETURN_TYPE_finallyClause88
    #define	RETURN_TYPE_finallyClause88 ANTLRv3Parser_finallyClause_return


    /* Initialize rule variables
     */

    root_0 = NULL;

    exceptionHandler86.tree = NULL;

    finallyClause87.tree = NULL;

    finallyClause88.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;




    retval.tree  = NULL;

    {
        {
            //  ANTLRv3.g:251:2: ( ( exceptionHandler )+ ( finallyClause )? | finallyClause )

            ANTLR3_UINT32 alt38;

            alt38=2;

            switch ( LA(1) )
            {
            case CATCH_SYM:
            	{
            		alt38=1;
            	}
                break;
            case FINALLY_SYM:
            	{
            		alt38=2;
            	}
                break;

            default:
                if (BACKTRACKING>0)
                {
                    FAILEDFLAG = ANTLR3_TRUE;
                    return retval;
                }

                CONSTRUCTEX();
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
                EXCEPTION->message      = (void *)"";
                EXCEPTION->decisionNum  = 38;
                EXCEPTION->state        = 0;


                goto ruleexceptionGroupEx;

            }

            switch (alt38)
            {
        	case 1:
        	    // ANTLRv3.g:251:4: ( exceptionHandler )+ ( finallyClause )?
        	    {
        	        root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


        	        // ANTLRv3.g:251:4: ( exceptionHandler )+
        	        {
        	            int cnt36=0;

        	            for (;;)
        	            {
        	                int alt36=2;
        	        	switch ( LA(1) )
        	        	{
        	        	case CATCH_SYM:
        	        		{
        	        			alt36=1;
        	        		}
        	        	    break;

        	        	}

        	        	switch (alt36)
        	        	{
        	        	    case 1:
        	        	        // ANTLRv3.g:251:6: exceptionHandler
        	        	        {
        	        	            FOLLOWPUSH(FOLLOW_exceptionHandler_in_exceptionGroup1373);
        	        	            exceptionHandler86=exceptionHandler(ctx);

        	        	            FOLLOWPOP();
        	        	            if  (HASEXCEPTION())
        	        	            {
        	        	                goto ruleexceptionGroupEx;
        	        	            }
        	        	            if (HASFAILED())
        	        	            {
        	        	                return retval;
        	        	            }

        	        	            if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, exceptionHandler86.tree);

        	        	        }
        	        	        break;

        	        	    default:

        	        		if ( cnt36 >= 1 )
        	        		{
        	        		    goto loop36;
        	        		}
        	        		if (BACKTRACKING>0)
        	        		{
        	        		    FAILEDFLAG = ANTLR3_TRUE;
        	        		    return retval;
        	        		}

        	        		/* mismatchedSetEx()
        	        		 */
        	        		CONSTRUCTEX();
        	        		EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
        	        		EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;


        	        		goto ruleexceptionGroupEx;
        	        	}
        	        	cnt36++;
        	            }
        	            loop36: ;	/* Jump to here if this rule does not match */
        	        }

        	        // ANTLRv3.g:251:26: ( finallyClause )?
        	        {
        	            int alt37=2;
        	            switch ( LA(1) )
        	            {
        	                case FINALLY_SYM:
        	                	{
        	                		alt37=1;
        	                	}
        	                    break;
        	            }

        	            switch (alt37)
        	            {
        	        	case 1:
        	        	    // ANTLRv3.g:251:28: finallyClause
        	        	    {
        	        	        FOLLOWPUSH(FOLLOW_finallyClause_in_exceptionGroup1380);
        	        	        finallyClause87=finallyClause(ctx);

        	        	        FOLLOWPOP();
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto ruleexceptionGroupEx;
        	        	        }
        	        	        if (HASFAILED())
        	        	        {
        	        	            return retval;
        	        	        }

        	        	        if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, finallyClause87.tree);

        	        	    }
        	        	    break;

        	            }
        	        }

        	    }
        	    break;
        	case 2:
        	    // ANTLRv3.g:252:4: finallyClause
        	    {
        	        root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


        	        FOLLOWPUSH(FOLLOW_finallyClause_in_exceptionGroup1388);
        	        finallyClause88=finallyClause(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleexceptionGroupEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, finallyClause88.tree);

        	    }
        	    break;

            }
        }
    }

    // This is where rules clean up and exit
    //
    goto ruleexceptionGroupEx; /* Prevent compiler warnings */
    ruleexceptionGroupEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end exceptionGroup */

/**
 * $ANTLR start exceptionHandler
 * ANTLRv3.g:255:1: exceptionHandler : CATCH_SYM ARG_ACTION ACTION -> ^( CATCH_SYM ARG_ACTION ACTION ) ;
 */
static ANTLRv3Parser_exceptionHandler_return
exceptionHandler(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_exceptionHandler_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    CATCH_SYM89;
    pANTLR3_COMMON_TOKEN    ARG_ACTION90;
    pANTLR3_COMMON_TOKEN    ACTION91;

    pANTLR3_BASE_TREE CATCH_SYM89_tree;
    pANTLR3_BASE_TREE ARG_ACTION90_tree;
    pANTLR3_BASE_TREE ACTION91_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_CATCH_SYM;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_ACTION;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_ARG_ACTION;

    /* Initialize rule variables
     */

    root_0 = NULL;

    CATCH_SYM89       = NULL;
    ARG_ACTION90       = NULL;
    ACTION91       = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    CATCH_SYM89_tree   = NULL;
    ARG_ACTION90_tree   = NULL;
    ACTION91_tree   = NULL;

    stream_CATCH_SYM   = NULL;
    #define CREATE_stream_CATCH_SYM  if (stream_CATCH_SYM == NULL) {stream_CATCH_SYM = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token CATCH_SYM"); } 
    stream_ACTION   = NULL;
    #define CREATE_stream_ACTION  if (stream_ACTION == NULL) {stream_ACTION = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token ACTION"); } 
    stream_ARG_ACTION   = NULL;
    #define CREATE_stream_ARG_ACTION  if (stream_ARG_ACTION == NULL) {stream_ARG_ACTION = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token ARG_ACTION"); } 

    retval.tree  = NULL;

    {
        // ANTLRv3.g:256:5: ( CATCH_SYM ARG_ACTION ACTION -> ^( CATCH_SYM ARG_ACTION ACTION ) )
        // ANTLRv3.g:256:10: CATCH_SYM ARG_ACTION ACTION
        {
            CATCH_SYM89 = (pANTLR3_COMMON_TOKEN) MATCHT(CATCH_SYM, &FOLLOW_CATCH_SYM_in_exceptionHandler1408);
            if  (HASEXCEPTION())
            {
                goto ruleexceptionHandlerEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_CATCH_SYM; stream_CATCH_SYM->add(stream_CATCH_SYM, CATCH_SYM89, NULL); }


            ARG_ACTION90 = (pANTLR3_COMMON_TOKEN) MATCHT(ARG_ACTION, &FOLLOW_ARG_ACTION_in_exceptionHandler1410);
            if  (HASEXCEPTION())
            {
                goto ruleexceptionHandlerEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_ARG_ACTION; stream_ARG_ACTION->add(stream_ARG_ACTION, ARG_ACTION90, NULL); }


            ACTION91 = (pANTLR3_COMMON_TOKEN) MATCHT(ACTION, &FOLLOW_ACTION_in_exceptionHandler1412);
            if  (HASEXCEPTION())
            {
                goto ruleexceptionHandlerEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_ACTION; stream_ACTION->add(stream_ACTION, ACTION91, NULL); }


            /* AST REWRITE
             * elements          : ARG_ACTION, ACTION, CATCH_SYM
             * token labels      : 
             * rule labels       : retval
             * token list labels : 
             * rule list labels  : 
             */
            if ( BACKTRACKING==0 ) 

            {
            	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	retval.tree    = root_0;
            	// 256:38: -> ^( CATCH_SYM ARG_ACTION ACTION )
            	{
            	    // ANTLRv3.g:256:41: ^( CATCH_SYM ARG_ACTION ACTION )
            	    {
            	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
            	        stream_CATCH_SYM == NULL ? NULL : stream_CATCH_SYM->nextNode(stream_CATCH_SYM)
            	        , root_1));

            	        ADAPTOR->addChild(ADAPTOR, root_1, 
            	        stream_ARG_ACTION == NULL ? NULL : stream_ARG_ACTION->nextNode(stream_ARG_ACTION)
            	        );

            	        ADAPTOR->addChild(ADAPTOR, root_1, 
            	        stream_ACTION == NULL ? NULL : stream_ACTION->nextNode(stream_ACTION)
            	        );

            	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	    }

            	}


            	retval.tree = root_0; // set result root
            	if (stream_retval != NULL) stream_retval->free(stream_retval);


            }
        }

    }

    // This is where rules clean up and exit
    //
    goto ruleexceptionHandlerEx; /* Prevent compiler warnings */
    ruleexceptionHandlerEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_CATCH_SYM != NULL) stream_CATCH_SYM->free(stream_CATCH_SYM);
        if (stream_ACTION != NULL) stream_ACTION->free(stream_ACTION);
        if (stream_ARG_ACTION != NULL) stream_ARG_ACTION->free(stream_ARG_ACTION);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end exceptionHandler */

/**
 * $ANTLR start finallyClause
 * ANTLRv3.g:259:1: finallyClause : FINALLY_SYM ACTION -> ^( FINALLY_SYM ACTION ) ;
 */
static ANTLRv3Parser_finallyClause_return
finallyClause(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_finallyClause_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    FINALLY_SYM92;
    pANTLR3_COMMON_TOKEN    ACTION93;

    pANTLR3_BASE_TREE FINALLY_SYM92_tree;
    pANTLR3_BASE_TREE ACTION93_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_FINALLY_SYM;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_ACTION;

    /* Initialize rule variables
     */

    root_0 = NULL;

    FINALLY_SYM92       = NULL;
    ACTION93       = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    FINALLY_SYM92_tree   = NULL;
    ACTION93_tree   = NULL;

    stream_FINALLY_SYM   = NULL;
    #define CREATE_stream_FINALLY_SYM  if (stream_FINALLY_SYM == NULL) {stream_FINALLY_SYM = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token FINALLY_SYM"); } 
    stream_ACTION   = NULL;
    #define CREATE_stream_ACTION  if (stream_ACTION == NULL) {stream_ACTION = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token ACTION"); } 

    retval.tree  = NULL;

    {
        // ANTLRv3.g:260:5: ( FINALLY_SYM ACTION -> ^( FINALLY_SYM ACTION ) )
        // ANTLRv3.g:260:10: FINALLY_SYM ACTION
        {
            FINALLY_SYM92 = (pANTLR3_COMMON_TOKEN) MATCHT(FINALLY_SYM, &FOLLOW_FINALLY_SYM_in_finallyClause1442);
            if  (HASEXCEPTION())
            {
                goto rulefinallyClauseEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_FINALLY_SYM; stream_FINALLY_SYM->add(stream_FINALLY_SYM, FINALLY_SYM92, NULL); }


            ACTION93 = (pANTLR3_COMMON_TOKEN) MATCHT(ACTION, &FOLLOW_ACTION_in_finallyClause1444);
            if  (HASEXCEPTION())
            {
                goto rulefinallyClauseEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_ACTION; stream_ACTION->add(stream_ACTION, ACTION93, NULL); }


            /* AST REWRITE
             * elements          : FINALLY_SYM, ACTION
             * token labels      : 
             * rule labels       : retval
             * token list labels : 
             * rule list labels  : 
             */
            if ( BACKTRACKING==0 ) 

            {
            	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	retval.tree    = root_0;
            	// 260:29: -> ^( FINALLY_SYM ACTION )
            	{
            	    // ANTLRv3.g:260:32: ^( FINALLY_SYM ACTION )
            	    {
            	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
            	        stream_FINALLY_SYM == NULL ? NULL : stream_FINALLY_SYM->nextNode(stream_FINALLY_SYM)
            	        , root_1));

            	        ADAPTOR->addChild(ADAPTOR, root_1, 
            	        stream_ACTION == NULL ? NULL : stream_ACTION->nextNode(stream_ACTION)
            	        );

            	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	    }

            	}


            	retval.tree = root_0; // set result root
            	if (stream_retval != NULL) stream_retval->free(stream_retval);


            }
        }

    }

    // This is where rules clean up and exit
    //
    goto rulefinallyClauseEx; /* Prevent compiler warnings */
    rulefinallyClauseEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_FINALLY_SYM != NULL) stream_FINALLY_SYM->free(stream_FINALLY_SYM);
        if (stream_ACTION != NULL) stream_ACTION->free(stream_ACTION);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end finallyClause */

/**
 * $ANTLR start element
 * ANTLRv3.g:263:1: element : ( id (labelOp= '=' |labelOp= '+=' ) atom ( ebnfSuffix -> ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] ^( $labelOp id atom ) EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) ) | -> ^( $labelOp id atom ) ) | id (labelOp= '=' |labelOp= '+=' ) block ( ebnfSuffix -> ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] ^( $labelOp id block ) EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) ) | -> ^( $labelOp id block ) ) | atom ( ebnfSuffix -> ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] atom EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) ) | -> atom ) | ebnf | ACTION |p= SEMPRED_V3TOK ( '=>' ->| -> SEMPRED_V3TOK ) | treeSpec ( ebnfSuffix -> ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] treeSpec EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) ) | -> treeSpec ) );
 */
static ANTLRv3Parser_element_return
element(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_element_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    labelOp;
    pANTLR3_COMMON_TOKEN    p;
    pANTLR3_COMMON_TOKEN    ACTION103;
    pANTLR3_COMMON_TOKEN    string_literal104;
    ANTLRv3Parser_id_return id94;
    #undef	RETURN_TYPE_id94
    #define	RETURN_TYPE_id94 ANTLRv3Parser_id_return

    ANTLRv3Parser_atom_return atom95;
    #undef	RETURN_TYPE_atom95
    #define	RETURN_TYPE_atom95 ANTLRv3Parser_atom_return

    ANTLRv3Parser_ebnfSuffix_return ebnfSuffix96;
    #undef	RETURN_TYPE_ebnfSuffix96
    #define	RETURN_TYPE_ebnfSuffix96 ANTLRv3Parser_ebnfSuffix_return

    ANTLRv3Parser_id_return id97;
    #undef	RETURN_TYPE_id97
    #define	RETURN_TYPE_id97 ANTLRv3Parser_id_return

    ANTLRv3Parser_block_return block98;
    #undef	RETURN_TYPE_block98
    #define	RETURN_TYPE_block98 ANTLRv3Parser_block_return

    ANTLRv3Parser_ebnfSuffix_return ebnfSuffix99;
    #undef	RETURN_TYPE_ebnfSuffix99
    #define	RETURN_TYPE_ebnfSuffix99 ANTLRv3Parser_ebnfSuffix_return

    ANTLRv3Parser_atom_return atom100;
    #undef	RETURN_TYPE_atom100
    #define	RETURN_TYPE_atom100 ANTLRv3Parser_atom_return

    ANTLRv3Parser_ebnfSuffix_return ebnfSuffix101;
    #undef	RETURN_TYPE_ebnfSuffix101
    #define	RETURN_TYPE_ebnfSuffix101 ANTLRv3Parser_ebnfSuffix_return

    ANTLRv3Parser_ebnf_return ebnf102;
    #undef	RETURN_TYPE_ebnf102
    #define	RETURN_TYPE_ebnf102 ANTLRv3Parser_ebnf_return

    ANTLRv3Parser_treeSpec_return treeSpec105;
    #undef	RETURN_TYPE_treeSpec105
    #define	RETURN_TYPE_treeSpec105 ANTLRv3Parser_treeSpec_return

    ANTLRv3Parser_ebnfSuffix_return ebnfSuffix106;
    #undef	RETURN_TYPE_ebnfSuffix106
    #define	RETURN_TYPE_ebnfSuffix106 ANTLRv3Parser_ebnfSuffix_return

    pANTLR3_BASE_TREE labelOp_tree;
    pANTLR3_BASE_TREE p_tree;
    pANTLR3_BASE_TREE ACTION103_tree;
    pANTLR3_BASE_TREE string_literal104_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_SEMPRED_V3TOK;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_LIST_LABEL_ASSIGN_V3TOK;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_83;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_LABEL_ASSIGN_V3TOK;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_id;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_atom;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_ebnfSuffix;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_block;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_treeSpec;
    /* Initialize rule variables
     */

    root_0 = NULL;

    labelOp       = NULL;
    p       = NULL;
    ACTION103       = NULL;
    string_literal104       = NULL;
    id94.tree = NULL;

    atom95.tree = NULL;

    ebnfSuffix96.tree = NULL;

    id97.tree = NULL;

    block98.tree = NULL;

    ebnfSuffix99.tree = NULL;

    atom100.tree = NULL;

    ebnfSuffix101.tree = NULL;

    ebnf102.tree = NULL;

    treeSpec105.tree = NULL;

    ebnfSuffix106.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    labelOp_tree   = NULL;
    p_tree   = NULL;
    ACTION103_tree   = NULL;
    string_literal104_tree   = NULL;

    stream_SEMPRED_V3TOK   = NULL;
    #define CREATE_stream_SEMPRED_V3TOK  if (stream_SEMPRED_V3TOK == NULL) {stream_SEMPRED_V3TOK = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token SEMPRED_V3TOK"); } 
    stream_LIST_LABEL_ASSIGN_V3TOK   = NULL;
    #define CREATE_stream_LIST_LABEL_ASSIGN_V3TOK  if (stream_LIST_LABEL_ASSIGN_V3TOK == NULL) {stream_LIST_LABEL_ASSIGN_V3TOK = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token LIST_LABEL_ASSIGN_V3TOK"); } 
    stream_83   = NULL;
    #define CREATE_stream_83  if (stream_83 == NULL) {stream_83 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 83"); } 
    stream_LABEL_ASSIGN_V3TOK   = NULL;
    #define CREATE_stream_LABEL_ASSIGN_V3TOK  if (stream_LABEL_ASSIGN_V3TOK == NULL) {stream_LABEL_ASSIGN_V3TOK = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token LABEL_ASSIGN_V3TOK"); } 
    stream_id   = NULL;
    #define CREATE_stream_id  if (stream_id == NULL) {stream_id = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule id"); }
    stream_atom   = NULL;
    #define CREATE_stream_atom  if (stream_atom == NULL) {stream_atom = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule atom"); }
    stream_ebnfSuffix   = NULL;
    #define CREATE_stream_ebnfSuffix  if (stream_ebnfSuffix == NULL) {stream_ebnfSuffix = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule ebnfSuffix"); }
    stream_block   = NULL;
    #define CREATE_stream_block  if (stream_block == NULL) {stream_block = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule block"); }
    stream_treeSpec   = NULL;
    #define CREATE_stream_treeSpec  if (stream_treeSpec == NULL) {stream_treeSpec = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule treeSpec"); }

    retval.tree  = NULL;

    {
        {
            //  ANTLRv3.g:264:2: ( id (labelOp= '=' |labelOp= '+=' ) atom ( ebnfSuffix -> ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] ^( $labelOp id atom ) EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) ) | -> ^( $labelOp id atom ) ) | id (labelOp= '=' |labelOp= '+=' ) block ( ebnfSuffix -> ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] ^( $labelOp id block ) EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) ) | -> ^( $labelOp id block ) ) | atom ( ebnfSuffix -> ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] atom EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) ) | -> atom ) | ebnf | ACTION |p= SEMPRED_V3TOK ( '=>' ->| -> SEMPRED_V3TOK ) | treeSpec ( ebnfSuffix -> ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] treeSpec EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) ) | -> treeSpec ) )

            ANTLR3_UINT32 alt46;

            alt46=7;

            switch ( LA(1) )
            {
            case TOKEN_REF:
            	{
            		switch ( LA(2) )
            		{
            		case LABEL_ASSIGN_V3TOK:
            			{
            				switch ( LA(3) )
            				{
            				case CHAR_LITERAL:
            				case DOT_SYM:
            				case RULE_REF:
            				case STRING_LITERAL:
            				case TOKEN_REF:
            				case 96:
            					{
            						alt46=1;
            					}
            				    break;
            				case 74:
            					{
            						alt46=2;
            					}
            				    break;

            				default:
            				    if (BACKTRACKING>0)
            				    {
            				        FAILEDFLAG = ANTLR3_TRUE;
            				        return retval;
            				    }

            				    CONSTRUCTEX();
            				    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            				    EXCEPTION->message      = (void *)"";
            				    EXCEPTION->decisionNum  = 46;
            				    EXCEPTION->state        = 8;


            				    goto ruleelementEx;

            				}

            			}
            		    break;
            		case LIST_LABEL_ASSIGN_V3TOK:
            			{
            				switch ( LA(3) )
            				{
            				case CHAR_LITERAL:
            				case DOT_SYM:
            				case RULE_REF:
            				case STRING_LITERAL:
            				case TOKEN_REF:
            				case 96:
            					{
            						alt46=1;
            					}
            				    break;
            				case 74:
            					{
            						alt46=2;
            					}
            				    break;

            				default:
            				    if (BACKTRACKING>0)
            				    {
            				        FAILEDFLAG = ANTLR3_TRUE;
            				        return retval;
            				    }

            				    CONSTRUCTEX();
            				    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            				    EXCEPTION->message      = (void *)"";
            				    EXCEPTION->decisionNum  = 46;
            				    EXCEPTION->state        = 9;


            				    goto ruleelementEx;

            				}

            			}
            		    break;
            		case EOF:
            		case ACTION:
            		case ARG_ACTION:
            		case BANG_V3TOK:
            		case CHAR_LITERAL:
            		case DOT_SYM:
            		case REWRITE_V3TOK:
            		case ROOT_V3TOK:
            		case RULE_REF:
            		case SEMPRED_V3TOK:
            		case STRING_LITERAL:
            		case TOKEN_REF:
            		case TREE_BEGIN_V3TOK:
            		case 74:
            		case 75:
            		case 76:
            		case 77:
            		case 81:
            		case 82:
            		case 85:
            		case 94:
            		case 96:
            			{
            				alt46=3;
            			}
            		    break;

            		default:
            		    if (BACKTRACKING>0)
            		    {
            		        FAILEDFLAG = ANTLR3_TRUE;
            		        return retval;
            		    }

            		    CONSTRUCTEX();
            		    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            		    EXCEPTION->message      = (void *)"";
            		    EXCEPTION->decisionNum  = 46;
            		    EXCEPTION->state        = 1;


            		    goto ruleelementEx;

            		}

            	}
                break;
            case CHAR_LITERAL:
            case DOT_SYM:
            case STRING_LITERAL:
            case 96:
            	{
            		alt46=3;
            	}
                break;
            case RULE_REF:
            	{
            		switch ( LA(2) )
            		{
            		case LABEL_ASSIGN_V3TOK:
            			{
            				switch ( LA(3) )
            				{
            				case CHAR_LITERAL:
            				case DOT_SYM:
            				case RULE_REF:
            				case STRING_LITERAL:
            				case TOKEN_REF:
            				case 96:
            					{
            						alt46=1;
            					}
            				    break;
            				case 74:
            					{
            						alt46=2;
            					}
            				    break;

            				default:
            				    if (BACKTRACKING>0)
            				    {
            				        FAILEDFLAG = ANTLR3_TRUE;
            				        return retval;
            				    }

            				    CONSTRUCTEX();
            				    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            				    EXCEPTION->message      = (void *)"";
            				    EXCEPTION->decisionNum  = 46;
            				    EXCEPTION->state        = 8;


            				    goto ruleelementEx;

            				}

            			}
            		    break;
            		case LIST_LABEL_ASSIGN_V3TOK:
            			{
            				switch ( LA(3) )
            				{
            				case CHAR_LITERAL:
            				case DOT_SYM:
            				case RULE_REF:
            				case STRING_LITERAL:
            				case TOKEN_REF:
            				case 96:
            					{
            						alt46=1;
            					}
            				    break;
            				case 74:
            					{
            						alt46=2;
            					}
            				    break;

            				default:
            				    if (BACKTRACKING>0)
            				    {
            				        FAILEDFLAG = ANTLR3_TRUE;
            				        return retval;
            				    }

            				    CONSTRUCTEX();
            				    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            				    EXCEPTION->message      = (void *)"";
            				    EXCEPTION->decisionNum  = 46;
            				    EXCEPTION->state        = 9;


            				    goto ruleelementEx;

            				}

            			}
            		    break;
            		case EOF:
            		case ACTION:
            		case ARG_ACTION:
            		case BANG_V3TOK:
            		case CHAR_LITERAL:
            		case DOT_SYM:
            		case REWRITE_V3TOK:
            		case ROOT_V3TOK:
            		case RULE_REF:
            		case SEMPRED_V3TOK:
            		case STRING_LITERAL:
            		case TOKEN_REF:
            		case TREE_BEGIN_V3TOK:
            		case 74:
            		case 75:
            		case 76:
            		case 77:
            		case 81:
            		case 85:
            		case 94:
            		case 96:
            			{
            				alt46=3;
            			}
            		    break;

            		default:
            		    if (BACKTRACKING>0)
            		    {
            		        FAILEDFLAG = ANTLR3_TRUE;
            		        return retval;
            		    }

            		    CONSTRUCTEX();
            		    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            		    EXCEPTION->message      = (void *)"";
            		    EXCEPTION->decisionNum  = 46;
            		    EXCEPTION->state        = 3;


            		    goto ruleelementEx;

            		}

            	}
                break;
            case 74:
            	{
            		alt46=4;
            	}
                break;
            case ACTION:
            	{
            		alt46=5;
            	}
                break;
            case SEMPRED_V3TOK:
            	{
            		alt46=6;
            	}
                break;
            case TREE_BEGIN_V3TOK:
            	{
            		alt46=7;
            	}
                break;

            default:
                if (BACKTRACKING>0)
                {
                    FAILEDFLAG = ANTLR3_TRUE;
                    return retval;
                }

                CONSTRUCTEX();
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
                EXCEPTION->message      = (void *)"";
                EXCEPTION->decisionNum  = 46;
                EXCEPTION->state        = 0;


                goto ruleelementEx;

            }

            switch (alt46)
            {
        	case 1:
        	    // ANTLRv3.g:264:4: id (labelOp= '=' |labelOp= '+=' ) atom ( ebnfSuffix -> ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] ^( $labelOp id atom ) EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) ) | -> ^( $labelOp id atom ) )
        	    {
        	        FOLLOWPUSH(FOLLOW_id_in_element1466);
        	        id94=id(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleelementEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) { CREATE_stream_id; stream_id->add(stream_id, id94.tree, NULL); }

        	        // ANTLRv3.g:264:7: (labelOp= '=' |labelOp= '+=' )
        	        {
        	            int alt39=2;
        	            switch ( LA(1) )
        	            {
        	            case LABEL_ASSIGN_V3TOK:
        	            	{
        	            		alt39=1;
        	            	}
        	                break;
        	            case LIST_LABEL_ASSIGN_V3TOK:
        	            	{
        	            		alt39=2;
        	            	}
        	                break;

        	            default:
        	                if (BACKTRACKING>0)
        	                {
        	                    FAILEDFLAG = ANTLR3_TRUE;
        	                    return retval;
        	                }

        	                CONSTRUCTEX();
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
        	                EXCEPTION->message      = (void *)"";
        	                EXCEPTION->decisionNum  = 39;
        	                EXCEPTION->state        = 0;


        	                goto ruleelementEx;

        	            }

        	            switch (alt39)
        	            {
        	        	case 1:
        	        	    // ANTLRv3.g:264:8: labelOp= '='
        	        	    {
        	        	        labelOp = (pANTLR3_COMMON_TOKEN) MATCHT(LABEL_ASSIGN_V3TOK, &FOLLOW_LABEL_ASSIGN_V3TOK_in_element1471);
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto ruleelementEx;
        	        	        }
        	        	        if (HASFAILED())
        	        	        {
        	        	            return retval;
        	        	        }
        	        	         
        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_LABEL_ASSIGN_V3TOK; stream_LABEL_ASSIGN_V3TOK->add(stream_LABEL_ASSIGN_V3TOK, labelOp, NULL); }


        	        	    }
        	        	    break;
        	        	case 2:
        	        	    // ANTLRv3.g:264:20: labelOp= '+='
        	        	    {
        	        	        labelOp = (pANTLR3_COMMON_TOKEN) MATCHT(LIST_LABEL_ASSIGN_V3TOK, &FOLLOW_LIST_LABEL_ASSIGN_V3TOK_in_element1475);
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto ruleelementEx;
        	        	        }
        	        	        if (HASFAILED())
        	        	        {
        	        	            return retval;
        	        	        }
        	        	         
        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_LIST_LABEL_ASSIGN_V3TOK; stream_LIST_LABEL_ASSIGN_V3TOK->add(stream_LIST_LABEL_ASSIGN_V3TOK, labelOp, NULL); }


        	        	    }
        	        	    break;

        	            }
        	        }

        	        FOLLOWPUSH(FOLLOW_atom_in_element1478);
        	        atom95=atom(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleelementEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) { CREATE_stream_atom; stream_atom->add(stream_atom, atom95.tree, NULL); }

        	        // ANTLRv3.g:265:3: ( ebnfSuffix -> ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] ^( $labelOp id atom ) EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) ) | -> ^( $labelOp id atom ) )
        	        {
        	            int alt40=2;
        	            switch ( LA(1) )
        	            {
        	            case 76:
        	            case 77:
        	            case 85:
        	            	{
        	            		alt40=1;
        	            	}
        	                break;
        	            case EOF:
        	            case ACTION:
        	            case CHAR_LITERAL:
        	            case DOT_SYM:
        	            case REWRITE_V3TOK:
        	            case RULE_REF:
        	            case SEMPRED_V3TOK:
        	            case STRING_LITERAL:
        	            case TOKEN_REF:
        	            case TREE_BEGIN_V3TOK:
        	            case 74:
        	            case 75:
        	            case 81:
        	            case 94:
        	            case 96:
        	            	{
        	            		alt40=2;
        	            	}
        	                break;

        	            default:
        	                if (BACKTRACKING>0)
        	                {
        	                    FAILEDFLAG = ANTLR3_TRUE;
        	                    return retval;
        	                }

        	                CONSTRUCTEX();
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
        	                EXCEPTION->message      = (void *)"";
        	                EXCEPTION->decisionNum  = 40;
        	                EXCEPTION->state        = 0;


        	                goto ruleelementEx;

        	            }

        	            switch (alt40)
        	            {
        	        	case 1:
        	        	    // ANTLRv3.g:265:5: ebnfSuffix
        	        	    {
        	        	        FOLLOWPUSH(FOLLOW_ebnfSuffix_in_element1484);
        	        	        ebnfSuffix96=ebnfSuffix(ctx);

        	        	        FOLLOWPOP();
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto ruleelementEx;
        	        	        }
        	        	        if (HASFAILED())
        	        	        {
        	        	            return retval;
        	        	        }

        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_ebnfSuffix; stream_ebnfSuffix->add(stream_ebnfSuffix, ebnfSuffix96.tree, NULL); }

        	        	        /* AST REWRITE
        	        	         * elements          : labelOp, id, ebnfSuffix, atom
        	        	         * token labels      : labelOp
        	        	         * rule labels       : retval
        	        	         * token list labels : 
        	        	         * rule list labels  : 
        	        	         */
        	        	        if ( BACKTRACKING==0 ) 

        	        	        {
        	        	        	pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_labelOp;
        	        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	        	stream_labelOp=antlr3RewriteRuleTOKENStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token labelOp", labelOp);
        	        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	retval.tree    = root_0;
        	        	        	// 265:16: -> ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] ^( $labelOp id atom ) EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) )
        	        	        	{
        	        	        	    // ANTLRv3.g:265:19: ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] ^( $labelOp id atom ) EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) )
        	        	        	    {
        	        	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_ebnfSuffix == NULL ? NULL : stream_ebnfSuffix->nextNode(stream_ebnfSuffix), root_1));

        	        	        	        // ANTLRv3.g:265:33: ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] ^( $labelOp id atom ) EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] )
        	        	        	        {
        	        	        	            pANTLR3_BASE_TREE root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	            root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 

        	        	        	            #if 1 == 2
        	        	        	            	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, BLOCK_V3TOK, TOKTEXT("BLOCK"))
        	        	        	            #else
        	        	        	            	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, BLOCK_V3TOK, (pANTLR3_UINT8)"BLOCK")
        	        	        	            #endif

        	        	        	            , root_2));

        	        	        	            // ANTLRv3.g:265:56: ^( ALT_V3TOK[\"ALT\"] ^( $labelOp id atom ) EOA_V3TOK[\"EOA\"] )
        	        	        	            {
        	        	        	                pANTLR3_BASE_TREE root_3 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	                root_3 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 

        	        	        	                #if 1 == 2
        	        	        	                	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, ALT_V3TOK, TOKTEXT("ALT"))
        	        	        	                #else
        	        	        	                	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, ALT_V3TOK, (pANTLR3_UINT8)"ALT")
        	        	        	                #endif

        	        	        	                , root_3));

        	        	        	                // ANTLRv3.g:265:75: ^( $labelOp id atom )
        	        	        	                {
        	        	        	                    pANTLR3_BASE_TREE root_4 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	                    root_4 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRootToken(ADAPTOR, stream_labelOp == NULL ? NULL : stream_labelOp->nextToken(stream_labelOp), root_4));

        	        	        	                    ADAPTOR->addChild(ADAPTOR, root_4, stream_id == NULL ? NULL : stream_id->nextTree(stream_id));

        	        	        	                    ADAPTOR->addChild(ADAPTOR, root_4, stream_atom == NULL ? NULL : stream_atom->nextTree(stream_atom));

        	        	        	                    ADAPTOR->addChild(ADAPTOR, root_3, root_4);
        	        	        	                }

        	        	        	                ADAPTOR->addChild(ADAPTOR, root_3, 

        	        	        	                #if 1 == 2
        	        	        	                	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, EOA_V3TOK, TOKTEXT("EOA"))
        	        	        	                #else
        	        	        	                	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, EOA_V3TOK, (pANTLR3_UINT8)"EOA")
        	        	        	                #endif

        	        	        	                );

        	        	        	                ADAPTOR->addChild(ADAPTOR, root_2, root_3);
        	        	        	            }

        	        	        	            ADAPTOR->addChild(ADAPTOR, root_2, 

        	        	        	            #if 1 == 2
        	        	        	            	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, EOB_V3TOK, TOKTEXT("EOB"))
        	        	        	            #else
        	        	        	            	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, EOB_V3TOK, (pANTLR3_UINT8)"EOB")
        	        	        	            #endif

        	        	        	            );

        	        	        	            ADAPTOR->addChild(ADAPTOR, root_1, root_2);
        	        	        	        }

        	        	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
        	        	        	    }

        	        	        	}


        	        	        	retval.tree = root_0; // set result root
        	        	        	if (stream_labelOp != NULL) stream_labelOp->free(stream_labelOp); 
        	        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        	        }
        	        	    }
        	        	    break;
        	        	case 2:
        	        	    // ANTLRv3.g:266:8: 
        	        	    {
        	        	        /* AST REWRITE
        	        	         * elements          : id, atom, labelOp
        	        	         * token labels      : labelOp
        	        	         * rule labels       : retval
        	        	         * token list labels : 
        	        	         * rule list labels  : 
        	        	         */
        	        	        if ( BACKTRACKING==0 ) 

        	        	        {
        	        	        	pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_labelOp;
        	        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	        	stream_labelOp=antlr3RewriteRuleTOKENStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token labelOp", labelOp);
        	        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	retval.tree    = root_0;
        	        	        	// 266:8: -> ^( $labelOp id atom )
        	        	        	{
        	        	        	    // ANTLRv3.g:266:11: ^( $labelOp id atom )
        	        	        	    {
        	        	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRootToken(ADAPTOR, stream_labelOp == NULL ? NULL : stream_labelOp->nextToken(stream_labelOp), root_1));

        	        	        	        ADAPTOR->addChild(ADAPTOR, root_1, stream_id == NULL ? NULL : stream_id->nextTree(stream_id));

        	        	        	        ADAPTOR->addChild(ADAPTOR, root_1, stream_atom == NULL ? NULL : stream_atom->nextTree(stream_atom));

        	        	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
        	        	        	    }

        	        	        	}


        	        	        	retval.tree = root_0; // set result root
        	        	        	if (stream_labelOp != NULL) stream_labelOp->free(stream_labelOp); 
        	        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        	        }
        	        	    }
        	        	    break;

        	            }
        	        }

        	    }
        	    break;
        	case 2:
        	    // ANTLRv3.g:268:4: id (labelOp= '=' |labelOp= '+=' ) block ( ebnfSuffix -> ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] ^( $labelOp id block ) EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) ) | -> ^( $labelOp id block ) )
        	    {
        	        FOLLOWPUSH(FOLLOW_id_in_element1543);
        	        id97=id(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleelementEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) { CREATE_stream_id; stream_id->add(stream_id, id97.tree, NULL); }

        	        // ANTLRv3.g:268:7: (labelOp= '=' |labelOp= '+=' )
        	        {
        	            int alt41=2;
        	            switch ( LA(1) )
        	            {
        	            case LABEL_ASSIGN_V3TOK:
        	            	{
        	            		alt41=1;
        	            	}
        	                break;
        	            case LIST_LABEL_ASSIGN_V3TOK:
        	            	{
        	            		alt41=2;
        	            	}
        	                break;

        	            default:
        	                if (BACKTRACKING>0)
        	                {
        	                    FAILEDFLAG = ANTLR3_TRUE;
        	                    return retval;
        	                }

        	                CONSTRUCTEX();
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
        	                EXCEPTION->message      = (void *)"";
        	                EXCEPTION->decisionNum  = 41;
        	                EXCEPTION->state        = 0;


        	                goto ruleelementEx;

        	            }

        	            switch (alt41)
        	            {
        	        	case 1:
        	        	    // ANTLRv3.g:268:8: labelOp= '='
        	        	    {
        	        	        labelOp = (pANTLR3_COMMON_TOKEN) MATCHT(LABEL_ASSIGN_V3TOK, &FOLLOW_LABEL_ASSIGN_V3TOK_in_element1548);
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto ruleelementEx;
        	        	        }
        	        	        if (HASFAILED())
        	        	        {
        	        	            return retval;
        	        	        }
        	        	         
        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_LABEL_ASSIGN_V3TOK; stream_LABEL_ASSIGN_V3TOK->add(stream_LABEL_ASSIGN_V3TOK, labelOp, NULL); }


        	        	    }
        	        	    break;
        	        	case 2:
        	        	    // ANTLRv3.g:268:20: labelOp= '+='
        	        	    {
        	        	        labelOp = (pANTLR3_COMMON_TOKEN) MATCHT(LIST_LABEL_ASSIGN_V3TOK, &FOLLOW_LIST_LABEL_ASSIGN_V3TOK_in_element1552);
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto ruleelementEx;
        	        	        }
        	        	        if (HASFAILED())
        	        	        {
        	        	            return retval;
        	        	        }
        	        	         
        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_LIST_LABEL_ASSIGN_V3TOK; stream_LIST_LABEL_ASSIGN_V3TOK->add(stream_LIST_LABEL_ASSIGN_V3TOK, labelOp, NULL); }


        	        	    }
        	        	    break;

        	            }
        	        }

        	        FOLLOWPUSH(FOLLOW_block_in_element1555);
        	        block98=block(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleelementEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) { CREATE_stream_block; stream_block->add(stream_block, block98.tree, NULL); }

        	        // ANTLRv3.g:269:4: ( ebnfSuffix -> ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] ^( $labelOp id block ) EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) ) | -> ^( $labelOp id block ) )
        	        {
        	            int alt42=2;
        	            switch ( LA(1) )
        	            {
        	            case 76:
        	            case 77:
        	            case 85:
        	            	{
        	            		alt42=1;
        	            	}
        	                break;
        	            case EOF:
        	            case ACTION:
        	            case CHAR_LITERAL:
        	            case DOT_SYM:
        	            case REWRITE_V3TOK:
        	            case RULE_REF:
        	            case SEMPRED_V3TOK:
        	            case STRING_LITERAL:
        	            case TOKEN_REF:
        	            case TREE_BEGIN_V3TOK:
        	            case 74:
        	            case 75:
        	            case 81:
        	            case 94:
        	            case 96:
        	            	{
        	            		alt42=2;
        	            	}
        	                break;

        	            default:
        	                if (BACKTRACKING>0)
        	                {
        	                    FAILEDFLAG = ANTLR3_TRUE;
        	                    return retval;
        	                }

        	                CONSTRUCTEX();
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
        	                EXCEPTION->message      = (void *)"";
        	                EXCEPTION->decisionNum  = 42;
        	                EXCEPTION->state        = 0;


        	                goto ruleelementEx;

        	            }

        	            switch (alt42)
        	            {
        	        	case 1:
        	        	    // ANTLRv3.g:269:6: ebnfSuffix
        	        	    {
        	        	        FOLLOWPUSH(FOLLOW_ebnfSuffix_in_element1562);
        	        	        ebnfSuffix99=ebnfSuffix(ctx);

        	        	        FOLLOWPOP();
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto ruleelementEx;
        	        	        }
        	        	        if (HASFAILED())
        	        	        {
        	        	            return retval;
        	        	        }

        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_ebnfSuffix; stream_ebnfSuffix->add(stream_ebnfSuffix, ebnfSuffix99.tree, NULL); }

        	        	        /* AST REWRITE
        	        	         * elements          : block, id, ebnfSuffix, labelOp
        	        	         * token labels      : labelOp
        	        	         * rule labels       : retval
        	        	         * token list labels : 
        	        	         * rule list labels  : 
        	        	         */
        	        	        if ( BACKTRACKING==0 ) 

        	        	        {
        	        	        	pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_labelOp;
        	        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	        	stream_labelOp=antlr3RewriteRuleTOKENStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token labelOp", labelOp);
        	        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	retval.tree    = root_0;
        	        	        	// 269:17: -> ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] ^( $labelOp id block ) EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) )
        	        	        	{
        	        	        	    // ANTLRv3.g:269:20: ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] ^( $labelOp id block ) EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) )
        	        	        	    {
        	        	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_ebnfSuffix == NULL ? NULL : stream_ebnfSuffix->nextNode(stream_ebnfSuffix), root_1));

        	        	        	        // ANTLRv3.g:269:34: ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] ^( $labelOp id block ) EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] )
        	        	        	        {
        	        	        	            pANTLR3_BASE_TREE root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	            root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 

        	        	        	            #if 1 == 2
        	        	        	            	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, BLOCK_V3TOK, TOKTEXT("BLOCK"))
        	        	        	            #else
        	        	        	            	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, BLOCK_V3TOK, (pANTLR3_UINT8)"BLOCK")
        	        	        	            #endif

        	        	        	            , root_2));

        	        	        	            // ANTLRv3.g:269:57: ^( ALT_V3TOK[\"ALT\"] ^( $labelOp id block ) EOA_V3TOK[\"EOA\"] )
        	        	        	            {
        	        	        	                pANTLR3_BASE_TREE root_3 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	                root_3 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 

        	        	        	                #if 1 == 2
        	        	        	                	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, ALT_V3TOK, TOKTEXT("ALT"))
        	        	        	                #else
        	        	        	                	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, ALT_V3TOK, (pANTLR3_UINT8)"ALT")
        	        	        	                #endif

        	        	        	                , root_3));

        	        	        	                // ANTLRv3.g:269:76: ^( $labelOp id block )
        	        	        	                {
        	        	        	                    pANTLR3_BASE_TREE root_4 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	                    root_4 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRootToken(ADAPTOR, stream_labelOp == NULL ? NULL : stream_labelOp->nextToken(stream_labelOp), root_4));

        	        	        	                    ADAPTOR->addChild(ADAPTOR, root_4, stream_id == NULL ? NULL : stream_id->nextTree(stream_id));

        	        	        	                    ADAPTOR->addChild(ADAPTOR, root_4, stream_block == NULL ? NULL : stream_block->nextTree(stream_block));

        	        	        	                    ADAPTOR->addChild(ADAPTOR, root_3, root_4);
        	        	        	                }

        	        	        	                ADAPTOR->addChild(ADAPTOR, root_3, 

        	        	        	                #if 1 == 2
        	        	        	                	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, EOA_V3TOK, TOKTEXT("EOA"))
        	        	        	                #else
        	        	        	                	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, EOA_V3TOK, (pANTLR3_UINT8)"EOA")
        	        	        	                #endif

        	        	        	                );

        	        	        	                ADAPTOR->addChild(ADAPTOR, root_2, root_3);
        	        	        	            }

        	        	        	            ADAPTOR->addChild(ADAPTOR, root_2, 

        	        	        	            #if 1 == 2
        	        	        	            	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, EOB_V3TOK, TOKTEXT("EOB"))
        	        	        	            #else
        	        	        	            	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, EOB_V3TOK, (pANTLR3_UINT8)"EOB")
        	        	        	            #endif

        	        	        	            );

        	        	        	            ADAPTOR->addChild(ADAPTOR, root_1, root_2);
        	        	        	        }

        	        	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
        	        	        	    }

        	        	        	}


        	        	        	retval.tree = root_0; // set result root
        	        	        	if (stream_labelOp != NULL) stream_labelOp->free(stream_labelOp); 
        	        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        	        }
        	        	    }
        	        	    break;
        	        	case 2:
        	        	    // ANTLRv3.g:270:8: 
        	        	    {
        	        	        /* AST REWRITE
        	        	         * elements          : labelOp, block, id
        	        	         * token labels      : labelOp
        	        	         * rule labels       : retval
        	        	         * token list labels : 
        	        	         * rule list labels  : 
        	        	         */
        	        	        if ( BACKTRACKING==0 ) 

        	        	        {
        	        	        	pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_labelOp;
        	        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	        	stream_labelOp=antlr3RewriteRuleTOKENStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token labelOp", labelOp);
        	        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	retval.tree    = root_0;
        	        	        	// 270:8: -> ^( $labelOp id block )
        	        	        	{
        	        	        	    // ANTLRv3.g:270:11: ^( $labelOp id block )
        	        	        	    {
        	        	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRootToken(ADAPTOR, stream_labelOp == NULL ? NULL : stream_labelOp->nextToken(stream_labelOp), root_1));

        	        	        	        ADAPTOR->addChild(ADAPTOR, root_1, stream_id == NULL ? NULL : stream_id->nextTree(stream_id));

        	        	        	        ADAPTOR->addChild(ADAPTOR, root_1, stream_block == NULL ? NULL : stream_block->nextTree(stream_block));

        	        	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
        	        	        	    }

        	        	        	}


        	        	        	retval.tree = root_0; // set result root
        	        	        	if (stream_labelOp != NULL) stream_labelOp->free(stream_labelOp); 
        	        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        	        }
        	        	    }
        	        	    break;

        	            }
        	        }

        	    }
        	    break;
        	case 3:
        	    // ANTLRv3.g:272:4: atom ( ebnfSuffix -> ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] atom EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) ) | -> atom )
        	    {
        	        FOLLOWPUSH(FOLLOW_atom_in_element1621);
        	        atom100=atom(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleelementEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) { CREATE_stream_atom; stream_atom->add(stream_atom, atom100.tree, NULL); }

        	        // ANTLRv3.g:273:3: ( ebnfSuffix -> ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] atom EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) ) | -> atom )
        	        {
        	            int alt43=2;
        	            switch ( LA(1) )
        	            {
        	            case 76:
        	            case 77:
        	            case 85:
        	            	{
        	            		alt43=1;
        	            	}
        	                break;
        	            case EOF:
        	            case ACTION:
        	            case CHAR_LITERAL:
        	            case DOT_SYM:
        	            case REWRITE_V3TOK:
        	            case RULE_REF:
        	            case SEMPRED_V3TOK:
        	            case STRING_LITERAL:
        	            case TOKEN_REF:
        	            case TREE_BEGIN_V3TOK:
        	            case 74:
        	            case 75:
        	            case 81:
        	            case 94:
        	            case 96:
        	            	{
        	            		alt43=2;
        	            	}
        	                break;

        	            default:
        	                if (BACKTRACKING>0)
        	                {
        	                    FAILEDFLAG = ANTLR3_TRUE;
        	                    return retval;
        	                }

        	                CONSTRUCTEX();
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
        	                EXCEPTION->message      = (void *)"";
        	                EXCEPTION->decisionNum  = 43;
        	                EXCEPTION->state        = 0;


        	                goto ruleelementEx;

        	            }

        	            switch (alt43)
        	            {
        	        	case 1:
        	        	    // ANTLRv3.g:273:5: ebnfSuffix
        	        	    {
        	        	        FOLLOWPUSH(FOLLOW_ebnfSuffix_in_element1627);
        	        	        ebnfSuffix101=ebnfSuffix(ctx);

        	        	        FOLLOWPOP();
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto ruleelementEx;
        	        	        }
        	        	        if (HASFAILED())
        	        	        {
        	        	            return retval;
        	        	        }

        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_ebnfSuffix; stream_ebnfSuffix->add(stream_ebnfSuffix, ebnfSuffix101.tree, NULL); }

        	        	        /* AST REWRITE
        	        	         * elements          : atom, ebnfSuffix
        	        	         * token labels      : 
        	        	         * rule labels       : retval
        	        	         * token list labels : 
        	        	         * rule list labels  : 
        	        	         */
        	        	        if ( BACKTRACKING==0 ) 

        	        	        {
        	        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	retval.tree    = root_0;
        	        	        	// 273:16: -> ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] atom EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) )
        	        	        	{
        	        	        	    // ANTLRv3.g:273:19: ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] atom EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) )
        	        	        	    {
        	        	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_ebnfSuffix == NULL ? NULL : stream_ebnfSuffix->nextNode(stream_ebnfSuffix), root_1));

        	        	        	        // ANTLRv3.g:273:33: ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] atom EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] )
        	        	        	        {
        	        	        	            pANTLR3_BASE_TREE root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	            root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 

        	        	        	            #if 1 == 2
        	        	        	            	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, BLOCK_V3TOK, TOKTEXT("BLOCK"))
        	        	        	            #else
        	        	        	            	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, BLOCK_V3TOK, (pANTLR3_UINT8)"BLOCK")
        	        	        	            #endif

        	        	        	            , root_2));

        	        	        	            // ANTLRv3.g:273:56: ^( ALT_V3TOK[\"ALT\"] atom EOA_V3TOK[\"EOA\"] )
        	        	        	            {
        	        	        	                pANTLR3_BASE_TREE root_3 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	                root_3 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 

        	        	        	                #if 1 == 2
        	        	        	                	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, ALT_V3TOK, TOKTEXT("ALT"))
        	        	        	                #else
        	        	        	                	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, ALT_V3TOK, (pANTLR3_UINT8)"ALT")
        	        	        	                #endif

        	        	        	                , root_3));

        	        	        	                ADAPTOR->addChild(ADAPTOR, root_3, stream_atom == NULL ? NULL : stream_atom->nextTree(stream_atom));

        	        	        	                ADAPTOR->addChild(ADAPTOR, root_3, 

        	        	        	                #if 1 == 2
        	        	        	                	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, EOA_V3TOK, TOKTEXT("EOA"))
        	        	        	                #else
        	        	        	                	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, EOA_V3TOK, (pANTLR3_UINT8)"EOA")
        	        	        	                #endif

        	        	        	                );

        	        	        	                ADAPTOR->addChild(ADAPTOR, root_2, root_3);
        	        	        	            }

        	        	        	            ADAPTOR->addChild(ADAPTOR, root_2, 

        	        	        	            #if 1 == 2
        	        	        	            	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, EOB_V3TOK, TOKTEXT("EOB"))
        	        	        	            #else
        	        	        	            	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, EOB_V3TOK, (pANTLR3_UINT8)"EOB")
        	        	        	            #endif

        	        	        	            );

        	        	        	            ADAPTOR->addChild(ADAPTOR, root_1, root_2);
        	        	        	        }

        	        	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
        	        	        	    }

        	        	        	}


        	        	        	retval.tree = root_0; // set result root
        	        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        	        }
        	        	    }
        	        	    break;
        	        	case 2:
        	        	    // ANTLRv3.g:274:8: 
        	        	    {
        	        	        /* AST REWRITE
        	        	         * elements          : atom
        	        	         * token labels      : 
        	        	         * rule labels       : retval
        	        	         * token list labels : 
        	        	         * rule list labels  : 
        	        	         */
        	        	        if ( BACKTRACKING==0 ) 

        	        	        {
        	        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	retval.tree    = root_0;
        	        	        	// 274:8: -> atom
        	        	        	{
        	        	        	    ADAPTOR->addChild(ADAPTOR, root_0, stream_atom == NULL ? NULL : stream_atom->nextTree(stream_atom));

        	        	        	}


        	        	        	retval.tree = root_0; // set result root
        	        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        	        }
        	        	    }
        	        	    break;

        	            }
        	        }

        	    }
        	    break;
        	case 4:
        	    // ANTLRv3.g:276:4: ebnf
        	    {
        	        root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


        	        FOLLOWPUSH(FOLLOW_ebnf_in_element1673);
        	        ebnf102=ebnf(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleelementEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, ebnf102.tree);

        	    }
        	    break;
        	case 5:
        	    // ANTLRv3.g:277:6: ACTION
        	    {
        	        root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


        	        ACTION103 = (pANTLR3_COMMON_TOKEN) MATCHT(ACTION, &FOLLOW_ACTION_in_element1680);
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleelementEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) {
        	        ACTION103_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, ACTION103));
        	        ADAPTOR->addChild(ADAPTOR, root_0, ACTION103_tree);
        	        }

        	    }
        	    break;
        	case 6:
        	    // ANTLRv3.g:278:6: p= SEMPRED_V3TOK ( '=>' ->| -> SEMPRED_V3TOK )
        	    {
        	        p = (pANTLR3_COMMON_TOKEN) MATCHT(SEMPRED_V3TOK, &FOLLOW_SEMPRED_V3TOK_in_element1691);
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleelementEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }
        	         
        	        if ( BACKTRACKING==0 ) { CREATE_stream_SEMPRED_V3TOK; stream_SEMPRED_V3TOK->add(stream_SEMPRED_V3TOK, p, NULL); }


        	        // ANTLRv3.g:279:3: ( '=>' ->| -> SEMPRED_V3TOK )
        	        {
        	            int alt44=2;
        	            switch ( LA(1) )
        	            {
        	            case 83:
        	            	{
        	            		alt44=1;
        	            	}
        	                break;
        	            case EOF:
        	            case ACTION:
        	            case CHAR_LITERAL:
        	            case DOT_SYM:
        	            case REWRITE_V3TOK:
        	            case RULE_REF:
        	            case SEMPRED_V3TOK:
        	            case STRING_LITERAL:
        	            case TOKEN_REF:
        	            case TREE_BEGIN_V3TOK:
        	            case 74:
        	            case 75:
        	            case 81:
        	            case 94:
        	            case 96:
        	            	{
        	            		alt44=2;
        	            	}
        	                break;

        	            default:
        	                if (BACKTRACKING>0)
        	                {
        	                    FAILEDFLAG = ANTLR3_TRUE;
        	                    return retval;
        	                }

        	                CONSTRUCTEX();
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
        	                EXCEPTION->message      = (void *)"";
        	                EXCEPTION->decisionNum  = 44;
        	                EXCEPTION->state        = 0;


        	                goto ruleelementEx;

        	            }

        	            switch (alt44)
        	            {
        	        	case 1:
        	        	    // ANTLRv3.g:280:5: '=>'
        	        	    {
        	        	        string_literal104 = (pANTLR3_COMMON_TOKEN) MATCHT(83, &FOLLOW_83_in_element1701);
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto ruleelementEx;
        	        	        }
        	        	        if (HASFAILED())
        	        	        {
        	        	            return retval;
        	        	        }
        	        	         
        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_83; stream_83->add(stream_83, string_literal104, NULL); }


        	        	        /* AST REWRITE
        	        	         * elements          : 
        	        	         * token labels      : 
        	        	         * rule labels       : retval
        	        	         * token list labels : 
        	        	         * rule list labels  : 
        	        	         */
        	        	        if ( BACKTRACKING==0 ) 

        	        	        {
        	        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	retval.tree    = root_0;
        	        	        	// 280:10: ->
        	        	        	{
        	        	        	    ADAPTOR->addChild(ADAPTOR, root_0,  ADAPTOR->createTypeToken(ADAPTOR, GATED_SEMPRED_V3TOK, p) );

        	        	        	}


        	        	        	retval.tree = root_0; // set result root
        	        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        	        }
        	        	    }
        	        	    break;
        	        	case 2:
        	        	    // ANTLRv3.g:281:7: 
        	        	    {
        	        	        /* AST REWRITE
        	        	         * elements          : SEMPRED_V3TOK
        	        	         * token labels      : 
        	        	         * rule labels       : retval
        	        	         * token list labels : 
        	        	         * rule list labels  : 
        	        	         */
        	        	        if ( BACKTRACKING==0 ) 

        	        	        {
        	        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	retval.tree    = root_0;
        	        	        	// 281:7: -> SEMPRED_V3TOK
        	        	        	{
        	        	        	    ADAPTOR->addChild(ADAPTOR, root_0, 
        	        	        	    stream_SEMPRED_V3TOK == NULL ? NULL : stream_SEMPRED_V3TOK->nextNode(stream_SEMPRED_V3TOK)
        	        	        	    );

        	        	        	}


        	        	        	retval.tree = root_0; // set result root
        	        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        	        }
        	        	    }
        	        	    break;

        	            }
        	        }

        	    }
        	    break;
        	case 7:
        	    // ANTLRv3.g:283:6: treeSpec ( ebnfSuffix -> ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] treeSpec EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) ) | -> treeSpec )
        	    {
        	        FOLLOWPUSH(FOLLOW_treeSpec_in_element1727);
        	        treeSpec105=treeSpec(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleelementEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) { CREATE_stream_treeSpec; stream_treeSpec->add(stream_treeSpec, treeSpec105.tree, NULL); }

        	        // ANTLRv3.g:284:3: ( ebnfSuffix -> ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] treeSpec EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) ) | -> treeSpec )
        	        {
        	            int alt45=2;
        	            switch ( LA(1) )
        	            {
        	            case 76:
        	            case 77:
        	            case 85:
        	            	{
        	            		alt45=1;
        	            	}
        	                break;
        	            case EOF:
        	            case ACTION:
        	            case CHAR_LITERAL:
        	            case DOT_SYM:
        	            case REWRITE_V3TOK:
        	            case RULE_REF:
        	            case SEMPRED_V3TOK:
        	            case STRING_LITERAL:
        	            case TOKEN_REF:
        	            case TREE_BEGIN_V3TOK:
        	            case 74:
        	            case 75:
        	            case 81:
        	            case 94:
        	            case 96:
        	            	{
        	            		alt45=2;
        	            	}
        	                break;

        	            default:
        	                if (BACKTRACKING>0)
        	                {
        	                    FAILEDFLAG = ANTLR3_TRUE;
        	                    return retval;
        	                }

        	                CONSTRUCTEX();
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
        	                EXCEPTION->message      = (void *)"";
        	                EXCEPTION->decisionNum  = 45;
        	                EXCEPTION->state        = 0;


        	                goto ruleelementEx;

        	            }

        	            switch (alt45)
        	            {
        	        	case 1:
        	        	    // ANTLRv3.g:284:5: ebnfSuffix
        	        	    {
        	        	        FOLLOWPUSH(FOLLOW_ebnfSuffix_in_element1733);
        	        	        ebnfSuffix106=ebnfSuffix(ctx);

        	        	        FOLLOWPOP();
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto ruleelementEx;
        	        	        }
        	        	        if (HASFAILED())
        	        	        {
        	        	            return retval;
        	        	        }

        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_ebnfSuffix; stream_ebnfSuffix->add(stream_ebnfSuffix, ebnfSuffix106.tree, NULL); }

        	        	        /* AST REWRITE
        	        	         * elements          : ebnfSuffix, treeSpec
        	        	         * token labels      : 
        	        	         * rule labels       : retval
        	        	         * token list labels : 
        	        	         * rule list labels  : 
        	        	         */
        	        	        if ( BACKTRACKING==0 ) 

        	        	        {
        	        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	retval.tree    = root_0;
        	        	        	// 284:16: -> ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] treeSpec EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) )
        	        	        	{
        	        	        	    // ANTLRv3.g:284:19: ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] treeSpec EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) )
        	        	        	    {
        	        	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_ebnfSuffix == NULL ? NULL : stream_ebnfSuffix->nextNode(stream_ebnfSuffix), root_1));

        	        	        	        // ANTLRv3.g:284:33: ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] treeSpec EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] )
        	        	        	        {
        	        	        	            pANTLR3_BASE_TREE root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	            root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 

        	        	        	            #if 1 == 2
        	        	        	            	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, BLOCK_V3TOK, TOKTEXT("BLOCK"))
        	        	        	            #else
        	        	        	            	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, BLOCK_V3TOK, (pANTLR3_UINT8)"BLOCK")
        	        	        	            #endif

        	        	        	            , root_2));

        	        	        	            // ANTLRv3.g:284:56: ^( ALT_V3TOK[\"ALT\"] treeSpec EOA_V3TOK[\"EOA\"] )
        	        	        	            {
        	        	        	                pANTLR3_BASE_TREE root_3 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	                root_3 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 

        	        	        	                #if 1 == 2
        	        	        	                	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, ALT_V3TOK, TOKTEXT("ALT"))
        	        	        	                #else
        	        	        	                	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, ALT_V3TOK, (pANTLR3_UINT8)"ALT")
        	        	        	                #endif

        	        	        	                , root_3));

        	        	        	                ADAPTOR->addChild(ADAPTOR, root_3, stream_treeSpec == NULL ? NULL : stream_treeSpec->nextTree(stream_treeSpec));

        	        	        	                ADAPTOR->addChild(ADAPTOR, root_3, 

        	        	        	                #if 1 == 2
        	        	        	                	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, EOA_V3TOK, TOKTEXT("EOA"))
        	        	        	                #else
        	        	        	                	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, EOA_V3TOK, (pANTLR3_UINT8)"EOA")
        	        	        	                #endif

        	        	        	                );

        	        	        	                ADAPTOR->addChild(ADAPTOR, root_2, root_3);
        	        	        	            }

        	        	        	            ADAPTOR->addChild(ADAPTOR, root_2, 

        	        	        	            #if 1 == 2
        	        	        	            	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, EOB_V3TOK, TOKTEXT("EOB"))
        	        	        	            #else
        	        	        	            	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, EOB_V3TOK, (pANTLR3_UINT8)"EOB")
        	        	        	            #endif

        	        	        	            );

        	        	        	            ADAPTOR->addChild(ADAPTOR, root_1, root_2);
        	        	        	        }

        	        	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
        	        	        	    }

        	        	        	}


        	        	        	retval.tree = root_0; // set result root
        	        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        	        }
        	        	    }
        	        	    break;
        	        	case 2:
        	        	    // ANTLRv3.g:285:8: 
        	        	    {
        	        	        /* AST REWRITE
        	        	         * elements          : treeSpec
        	        	         * token labels      : 
        	        	         * rule labels       : retval
        	        	         * token list labels : 
        	        	         * rule list labels  : 
        	        	         */
        	        	        if ( BACKTRACKING==0 ) 

        	        	        {
        	        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	retval.tree    = root_0;
        	        	        	// 285:8: -> treeSpec
        	        	        	{
        	        	        	    ADAPTOR->addChild(ADAPTOR, root_0, stream_treeSpec == NULL ? NULL : stream_treeSpec->nextTree(stream_treeSpec));

        	        	        	}


        	        	        	retval.tree = root_0; // set result root
        	        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        	        }
        	        	    }
        	        	    break;

        	            }
        	        }

        	    }
        	    break;

            }
        }
    }

    // This is where rules clean up and exit
    //
    goto ruleelementEx; /* Prevent compiler warnings */
    ruleelementEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_SEMPRED_V3TOK != NULL) stream_SEMPRED_V3TOK->free(stream_SEMPRED_V3TOK);
        if (stream_LIST_LABEL_ASSIGN_V3TOK != NULL) stream_LIST_LABEL_ASSIGN_V3TOK->free(stream_LIST_LABEL_ASSIGN_V3TOK);
        if (stream_83 != NULL) stream_83->free(stream_83);
        if (stream_LABEL_ASSIGN_V3TOK != NULL) stream_LABEL_ASSIGN_V3TOK->free(stream_LABEL_ASSIGN_V3TOK);
        if (stream_id != NULL) stream_id->free(stream_id);
        if (stream_atom != NULL) stream_atom->free(stream_atom);
        if (stream_ebnfSuffix != NULL) stream_ebnfSuffix->free(stream_ebnfSuffix);
        if (stream_block != NULL) stream_block->free(stream_block);
        if (stream_treeSpec != NULL) stream_treeSpec->free(stream_treeSpec);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end element */

/**
 * $ANTLR start atom
 * ANTLRv3.g:289:1: atom : ( terminal | range ( (op= ROOT_V3TOK |op= BANG_V3TOK ) -> ^( $op range ) | -> range ) | notSet ( (op= ROOT_V3TOK |op= BANG_V3TOK ) -> ^( $op notSet ) | -> notSet ) | RULE_REF ( ARG_ACTION )? ( (op= ROOT_V3TOK |op= BANG_V3TOK ) -> ^( $op RULE_REF ( ARG_ACTION )? ) | -> ^( RULE_REF ( ARG_ACTION )? ) ) );
 */
static ANTLRv3Parser_atom_return
atom(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_atom_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    op;
    pANTLR3_COMMON_TOKEN    RULE_REF110;
    pANTLR3_COMMON_TOKEN    ARG_ACTION111;
    ANTLRv3Parser_terminal_return terminal107;
    #undef	RETURN_TYPE_terminal107
    #define	RETURN_TYPE_terminal107 ANTLRv3Parser_terminal_return

    ANTLRv3Parser_range_return range108;
    #undef	RETURN_TYPE_range108
    #define	RETURN_TYPE_range108 ANTLRv3Parser_range_return

    ANTLRv3Parser_notSet_return notSet109;
    #undef	RETURN_TYPE_notSet109
    #define	RETURN_TYPE_notSet109 ANTLRv3Parser_notSet_return

    pANTLR3_BASE_TREE op_tree;
    pANTLR3_BASE_TREE RULE_REF110_tree;
    pANTLR3_BASE_TREE ARG_ACTION111_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_ROOT_V3TOK;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_BANG_V3TOK;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_RULE_REF;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_ARG_ACTION;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_range;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_notSet;
    /* Initialize rule variables
     */

    root_0 = NULL;

    op       = NULL;
    RULE_REF110       = NULL;
    ARG_ACTION111       = NULL;
    terminal107.tree = NULL;

    range108.tree = NULL;

    notSet109.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    op_tree   = NULL;
    RULE_REF110_tree   = NULL;
    ARG_ACTION111_tree   = NULL;

    stream_ROOT_V3TOK   = NULL;
    #define CREATE_stream_ROOT_V3TOK  if (stream_ROOT_V3TOK == NULL) {stream_ROOT_V3TOK = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token ROOT_V3TOK"); } 
    stream_BANG_V3TOK   = NULL;
    #define CREATE_stream_BANG_V3TOK  if (stream_BANG_V3TOK == NULL) {stream_BANG_V3TOK = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token BANG_V3TOK"); } 
    stream_RULE_REF   = NULL;
    #define CREATE_stream_RULE_REF  if (stream_RULE_REF == NULL) {stream_RULE_REF = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token RULE_REF"); } 
    stream_ARG_ACTION   = NULL;
    #define CREATE_stream_ARG_ACTION  if (stream_ARG_ACTION == NULL) {stream_ARG_ACTION = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token ARG_ACTION"); } 
    stream_range   = NULL;
    #define CREATE_stream_range  if (stream_range == NULL) {stream_range = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule range"); }
    stream_notSet   = NULL;
    #define CREATE_stream_notSet  if (stream_notSet == NULL) {stream_notSet = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule notSet"); }

    retval.tree  = NULL;

    {
        {
            //  ANTLRv3.g:289:5: ( terminal | range ( (op= ROOT_V3TOK |op= BANG_V3TOK ) -> ^( $op range ) | -> range ) | notSet ( (op= ROOT_V3TOK |op= BANG_V3TOK ) -> ^( $op notSet ) | -> notSet ) | RULE_REF ( ARG_ACTION )? ( (op= ROOT_V3TOK |op= BANG_V3TOK ) -> ^( $op RULE_REF ( ARG_ACTION )? ) | -> ^( RULE_REF ( ARG_ACTION )? ) ) )

            ANTLR3_UINT32 alt54;

            alt54=4;

            switch ( LA(1) )
            {
            case CHAR_LITERAL:
            	{
            		switch ( LA(2) )
            		{
            		case RANGE_V3TOK:
            			{
            				alt54=2;
            			}
            		    break;
            		case EOF:
            		case ACTION:
            		case BANG_V3TOK:
            		case CHAR_LITERAL:
            		case DOT_SYM:
            		case REWRITE_V3TOK:
            		case ROOT_V3TOK:
            		case RULE_REF:
            		case SEMPRED_V3TOK:
            		case STRING_LITERAL:
            		case TOKEN_REF:
            		case TREE_BEGIN_V3TOK:
            		case 74:
            		case 75:
            		case 76:
            		case 77:
            		case 81:
            		case 82:
            		case 85:
            		case 94:
            		case 96:
            			{
            				alt54=1;
            			}
            		    break;

            		default:
            		    if (BACKTRACKING>0)
            		    {
            		        FAILEDFLAG = ANTLR3_TRUE;
            		        return retval;
            		    }

            		    CONSTRUCTEX();
            		    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            		    EXCEPTION->message      = (void *)"";
            		    EXCEPTION->decisionNum  = 54;
            		    EXCEPTION->state        = 1;


            		    goto ruleatomEx;

            		}

            	}
                break;
            case DOT_SYM:
            case STRING_LITERAL:
            case TOKEN_REF:
            	{
            		alt54=1;
            	}
                break;
            case 96:
            	{
            		alt54=3;
            	}
                break;
            case RULE_REF:
            	{
            		alt54=4;
            	}
                break;

            default:
                if (BACKTRACKING>0)
                {
                    FAILEDFLAG = ANTLR3_TRUE;
                    return retval;
                }

                CONSTRUCTEX();
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
                EXCEPTION->message      = (void *)"";
                EXCEPTION->decisionNum  = 54;
                EXCEPTION->state        = 0;


                goto ruleatomEx;

            }

            switch (alt54)
            {
        	case 1:
        	    // ANTLRv3.g:290:2: terminal
        	    {
        	        root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


        	        FOLLOWPUSH(FOLLOW_terminal_in_atom1784);
        	        terminal107=terminal(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleatomEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, terminal107.tree);

        	    }
        	    break;
        	case 2:
        	    // ANTLRv3.g:291:4: range ( (op= ROOT_V3TOK |op= BANG_V3TOK ) -> ^( $op range ) | -> range )
        	    {
        	        FOLLOWPUSH(FOLLOW_range_in_atom1789);
        	        range108=range(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleatomEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) { CREATE_stream_range; stream_range->add(stream_range, range108.tree, NULL); }

        	        // ANTLRv3.g:292:3: ( (op= ROOT_V3TOK |op= BANG_V3TOK ) -> ^( $op range ) | -> range )
        	        {
        	            int alt48=2;
        	            switch ( LA(1) )
        	            {
        	            case BANG_V3TOK:
        	            case ROOT_V3TOK:
        	            	{
        	            		alt48=1;
        	            	}
        	                break;
        	            case EOF:
        	            case ACTION:
        	            case CHAR_LITERAL:
        	            case DOT_SYM:
        	            case REWRITE_V3TOK:
        	            case RULE_REF:
        	            case SEMPRED_V3TOK:
        	            case STRING_LITERAL:
        	            case TOKEN_REF:
        	            case TREE_BEGIN_V3TOK:
        	            case 74:
        	            case 75:
        	            case 76:
        	            case 77:
        	            case 81:
        	            case 85:
        	            case 94:
        	            case 96:
        	            	{
        	            		alt48=2;
        	            	}
        	                break;

        	            default:
        	                if (BACKTRACKING>0)
        	                {
        	                    FAILEDFLAG = ANTLR3_TRUE;
        	                    return retval;
        	                }

        	                CONSTRUCTEX();
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
        	                EXCEPTION->message      = (void *)"";
        	                EXCEPTION->decisionNum  = 48;
        	                EXCEPTION->state        = 0;


        	                goto ruleatomEx;

        	            }

        	            switch (alt48)
        	            {
        	        	case 1:
        	        	    // ANTLRv3.g:292:5: (op= ROOT_V3TOK |op= BANG_V3TOK )
        	        	    {
        	        	        // ANTLRv3.g:292:5: (op= ROOT_V3TOK |op= BANG_V3TOK )
        	        	        {
        	        	            int alt47=2;
        	        	            switch ( LA(1) )
        	        	            {
        	        	            case ROOT_V3TOK:
        	        	            	{
        	        	            		alt47=1;
        	        	            	}
        	        	                break;
        	        	            case BANG_V3TOK:
        	        	            	{
        	        	            		alt47=2;
        	        	            	}
        	        	                break;

        	        	            default:
        	        	                if (BACKTRACKING>0)
        	        	                {
        	        	                    FAILEDFLAG = ANTLR3_TRUE;
        	        	                    return retval;
        	        	                }

        	        	                CONSTRUCTEX();
        	        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
        	        	                EXCEPTION->message      = (void *)"";
        	        	                EXCEPTION->decisionNum  = 47;
        	        	                EXCEPTION->state        = 0;


        	        	                goto ruleatomEx;

        	        	            }

        	        	            switch (alt47)
        	        	            {
        	        	        	case 1:
        	        	        	    // ANTLRv3.g:292:6: op= ROOT_V3TOK
        	        	        	    {
        	        	        	        op = (pANTLR3_COMMON_TOKEN) MATCHT(ROOT_V3TOK, &FOLLOW_ROOT_V3TOK_in_atom1799);
        	        	        	        if  (HASEXCEPTION())
        	        	        	        {
        	        	        	            goto ruleatomEx;
        	        	        	        }
        	        	        	        if (HASFAILED())
        	        	        	        {
        	        	        	            return retval;
        	        	        	        }
        	        	        	         
        	        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_ROOT_V3TOK; stream_ROOT_V3TOK->add(stream_ROOT_V3TOK, op, NULL); }


        	        	        	    }
        	        	        	    break;
        	        	        	case 2:
        	        	        	    // ANTLRv3.g:292:20: op= BANG_V3TOK
        	        	        	    {
        	        	        	        op = (pANTLR3_COMMON_TOKEN) MATCHT(BANG_V3TOK, &FOLLOW_BANG_V3TOK_in_atom1803);
        	        	        	        if  (HASEXCEPTION())
        	        	        	        {
        	        	        	            goto ruleatomEx;
        	        	        	        }
        	        	        	        if (HASFAILED())
        	        	        	        {
        	        	        	            return retval;
        	        	        	        }
        	        	        	         
        	        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_BANG_V3TOK; stream_BANG_V3TOK->add(stream_BANG_V3TOK, op, NULL); }


        	        	        	    }
        	        	        	    break;

        	        	            }
        	        	        }

        	        	        /* AST REWRITE
        	        	         * elements          : op, range
        	        	         * token labels      : op
        	        	         * rule labels       : retval
        	        	         * token list labels : 
        	        	         * rule list labels  : 
        	        	         */
        	        	        if ( BACKTRACKING==0 ) 

        	        	        {
        	        	        	pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_op;
        	        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	        	stream_op=antlr3RewriteRuleTOKENStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token op", op);
        	        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	retval.tree    = root_0;
        	        	        	// 292:35: -> ^( $op range )
        	        	        	{
        	        	        	    // ANTLRv3.g:292:38: ^( $op range )
        	        	        	    {
        	        	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRootToken(ADAPTOR, stream_op == NULL ? NULL : stream_op->nextToken(stream_op), root_1));

        	        	        	        ADAPTOR->addChild(ADAPTOR, root_1, stream_range == NULL ? NULL : stream_range->nextTree(stream_range));

        	        	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
        	        	        	    }

        	        	        	}


        	        	        	retval.tree = root_0; // set result root
        	        	        	if (stream_op != NULL) stream_op->free(stream_op); 
        	        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        	        }
        	        	    }
        	        	    break;
        	        	case 2:
        	        	    // ANTLRv3.g:293:9: 
        	        	    {
        	        	        /* AST REWRITE
        	        	         * elements          : range
        	        	         * token labels      : 
        	        	         * rule labels       : retval
        	        	         * token list labels : 
        	        	         * rule list labels  : 
        	        	         */
        	        	        if ( BACKTRACKING==0 ) 

        	        	        {
        	        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	retval.tree    = root_0;
        	        	        	// 293:9: -> range
        	        	        	{
        	        	        	    ADAPTOR->addChild(ADAPTOR, root_0, stream_range == NULL ? NULL : stream_range->nextTree(stream_range));

        	        	        	}


        	        	        	retval.tree = root_0; // set result root
        	        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        	        }
        	        	    }
        	        	    break;

        	            }
        	        }

        	    }
        	    break;
        	case 3:
        	    // ANTLRv3.g:295:7: notSet ( (op= ROOT_V3TOK |op= BANG_V3TOK ) -> ^( $op notSet ) | -> notSet )
        	    {
        	        FOLLOWPUSH(FOLLOW_notSet_in_atom1837);
        	        notSet109=notSet(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleatomEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) { CREATE_stream_notSet; stream_notSet->add(stream_notSet, notSet109.tree, NULL); }

        	        // ANTLRv3.g:296:3: ( (op= ROOT_V3TOK |op= BANG_V3TOK ) -> ^( $op notSet ) | -> notSet )
        	        {
        	            int alt50=2;
        	            switch ( LA(1) )
        	            {
        	            case BANG_V3TOK:
        	            case ROOT_V3TOK:
        	            	{
        	            		alt50=1;
        	            	}
        	                break;
        	            case EOF:
        	            case ACTION:
        	            case CHAR_LITERAL:
        	            case DOT_SYM:
        	            case REWRITE_V3TOK:
        	            case RULE_REF:
        	            case SEMPRED_V3TOK:
        	            case STRING_LITERAL:
        	            case TOKEN_REF:
        	            case TREE_BEGIN_V3TOK:
        	            case 74:
        	            case 75:
        	            case 76:
        	            case 77:
        	            case 81:
        	            case 85:
        	            case 94:
        	            case 96:
        	            	{
        	            		alt50=2;
        	            	}
        	                break;

        	            default:
        	                if (BACKTRACKING>0)
        	                {
        	                    FAILEDFLAG = ANTLR3_TRUE;
        	                    return retval;
        	                }

        	                CONSTRUCTEX();
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
        	                EXCEPTION->message      = (void *)"";
        	                EXCEPTION->decisionNum  = 50;
        	                EXCEPTION->state        = 0;


        	                goto ruleatomEx;

        	            }

        	            switch (alt50)
        	            {
        	        	case 1:
        	        	    // ANTLRv3.g:296:5: (op= ROOT_V3TOK |op= BANG_V3TOK )
        	        	    {
        	        	        // ANTLRv3.g:296:5: (op= ROOT_V3TOK |op= BANG_V3TOK )
        	        	        {
        	        	            int alt49=2;
        	        	            switch ( LA(1) )
        	        	            {
        	        	            case ROOT_V3TOK:
        	        	            	{
        	        	            		alt49=1;
        	        	            	}
        	        	                break;
        	        	            case BANG_V3TOK:
        	        	            	{
        	        	            		alt49=2;
        	        	            	}
        	        	                break;

        	        	            default:
        	        	                if (BACKTRACKING>0)
        	        	                {
        	        	                    FAILEDFLAG = ANTLR3_TRUE;
        	        	                    return retval;
        	        	                }

        	        	                CONSTRUCTEX();
        	        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
        	        	                EXCEPTION->message      = (void *)"";
        	        	                EXCEPTION->decisionNum  = 49;
        	        	                EXCEPTION->state        = 0;


        	        	                goto ruleatomEx;

        	        	            }

        	        	            switch (alt49)
        	        	            {
        	        	        	case 1:
        	        	        	    // ANTLRv3.g:296:6: op= ROOT_V3TOK
        	        	        	    {
        	        	        	        op = (pANTLR3_COMMON_TOKEN) MATCHT(ROOT_V3TOK, &FOLLOW_ROOT_V3TOK_in_atom1846);
        	        	        	        if  (HASEXCEPTION())
        	        	        	        {
        	        	        	            goto ruleatomEx;
        	        	        	        }
        	        	        	        if (HASFAILED())
        	        	        	        {
        	        	        	            return retval;
        	        	        	        }
        	        	        	         
        	        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_ROOT_V3TOK; stream_ROOT_V3TOK->add(stream_ROOT_V3TOK, op, NULL); }


        	        	        	    }
        	        	        	    break;
        	        	        	case 2:
        	        	        	    // ANTLRv3.g:296:20: op= BANG_V3TOK
        	        	        	    {
        	        	        	        op = (pANTLR3_COMMON_TOKEN) MATCHT(BANG_V3TOK, &FOLLOW_BANG_V3TOK_in_atom1850);
        	        	        	        if  (HASEXCEPTION())
        	        	        	        {
        	        	        	            goto ruleatomEx;
        	        	        	        }
        	        	        	        if (HASFAILED())
        	        	        	        {
        	        	        	            return retval;
        	        	        	        }
        	        	        	         
        	        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_BANG_V3TOK; stream_BANG_V3TOK->add(stream_BANG_V3TOK, op, NULL); }


        	        	        	    }
        	        	        	    break;

        	        	            }
        	        	        }

        	        	        /* AST REWRITE
        	        	         * elements          : notSet, op
        	        	         * token labels      : op
        	        	         * rule labels       : retval
        	        	         * token list labels : 
        	        	         * rule list labels  : 
        	        	         */
        	        	        if ( BACKTRACKING==0 ) 

        	        	        {
        	        	        	pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_op;
        	        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	        	stream_op=antlr3RewriteRuleTOKENStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token op", op);
        	        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	retval.tree    = root_0;
        	        	        	// 296:35: -> ^( $op notSet )
        	        	        	{
        	        	        	    // ANTLRv3.g:296:38: ^( $op notSet )
        	        	        	    {
        	        	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRootToken(ADAPTOR, stream_op == NULL ? NULL : stream_op->nextToken(stream_op), root_1));

        	        	        	        ADAPTOR->addChild(ADAPTOR, root_1, stream_notSet == NULL ? NULL : stream_notSet->nextTree(stream_notSet));

        	        	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
        	        	        	    }

        	        	        	}


        	        	        	retval.tree = root_0; // set result root
        	        	        	if (stream_op != NULL) stream_op->free(stream_op); 
        	        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        	        }
        	        	    }
        	        	    break;
        	        	case 2:
        	        	    // ANTLRv3.g:297:9: 
        	        	    {
        	        	        /* AST REWRITE
        	        	         * elements          : notSet
        	        	         * token labels      : 
        	        	         * rule labels       : retval
        	        	         * token list labels : 
        	        	         * rule list labels  : 
        	        	         */
        	        	        if ( BACKTRACKING==0 ) 

        	        	        {
        	        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	retval.tree    = root_0;
        	        	        	// 297:9: -> notSet
        	        	        	{
        	        	        	    ADAPTOR->addChild(ADAPTOR, root_0, stream_notSet == NULL ? NULL : stream_notSet->nextTree(stream_notSet));

        	        	        	}


        	        	        	retval.tree = root_0; // set result root
        	        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        	        }
        	        	    }
        	        	    break;

        	            }
        	        }

        	    }
        	    break;
        	case 4:
        	    // ANTLRv3.g:299:7: RULE_REF ( ARG_ACTION )? ( (op= ROOT_V3TOK |op= BANG_V3TOK ) -> ^( $op RULE_REF ( ARG_ACTION )? ) | -> ^( RULE_REF ( ARG_ACTION )? ) )
        	    {
        	        RULE_REF110 = (pANTLR3_COMMON_TOKEN) MATCHT(RULE_REF, &FOLLOW_RULE_REF_in_atom1884);
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleatomEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }
        	         
        	        if ( BACKTRACKING==0 ) { CREATE_stream_RULE_REF; stream_RULE_REF->add(stream_RULE_REF, RULE_REF110, NULL); }


        	        // ANTLRv3.g:299:16: ( ARG_ACTION )?
        	        {
        	            int alt51=2;
        	            switch ( LA(1) )
        	            {
        	                case ARG_ACTION:
        	                	{
        	                		alt51=1;
        	                	}
        	                    break;
        	            }

        	            switch (alt51)
        	            {
        	        	case 1:
        	        	    // ANTLRv3.g:299:16: ARG_ACTION
        	        	    {
        	        	        ARG_ACTION111 = (pANTLR3_COMMON_TOKEN) MATCHT(ARG_ACTION, &FOLLOW_ARG_ACTION_in_atom1886);
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto ruleatomEx;
        	        	        }
        	        	        if (HASFAILED())
        	        	        {
        	        	            return retval;
        	        	        }
        	        	         
        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_ARG_ACTION; stream_ARG_ACTION->add(stream_ARG_ACTION, ARG_ACTION111, NULL); }


        	        	    }
        	        	    break;

        	            }
        	        }

        	        // ANTLRv3.g:300:3: ( (op= ROOT_V3TOK |op= BANG_V3TOK ) -> ^( $op RULE_REF ( ARG_ACTION )? ) | -> ^( RULE_REF ( ARG_ACTION )? ) )
        	        {
        	            int alt53=2;
        	            switch ( LA(1) )
        	            {
        	            case BANG_V3TOK:
        	            case ROOT_V3TOK:
        	            	{
        	            		alt53=1;
        	            	}
        	                break;
        	            case EOF:
        	            case ACTION:
        	            case CHAR_LITERAL:
        	            case DOT_SYM:
        	            case REWRITE_V3TOK:
        	            case RULE_REF:
        	            case SEMPRED_V3TOK:
        	            case STRING_LITERAL:
        	            case TOKEN_REF:
        	            case TREE_BEGIN_V3TOK:
        	            case 74:
        	            case 75:
        	            case 76:
        	            case 77:
        	            case 81:
        	            case 85:
        	            case 94:
        	            case 96:
        	            	{
        	            		alt53=2;
        	            	}
        	                break;

        	            default:
        	                if (BACKTRACKING>0)
        	                {
        	                    FAILEDFLAG = ANTLR3_TRUE;
        	                    return retval;
        	                }

        	                CONSTRUCTEX();
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
        	                EXCEPTION->message      = (void *)"";
        	                EXCEPTION->decisionNum  = 53;
        	                EXCEPTION->state        = 0;


        	                goto ruleatomEx;

        	            }

        	            switch (alt53)
        	            {
        	        	case 1:
        	        	    // ANTLRv3.g:300:5: (op= ROOT_V3TOK |op= BANG_V3TOK )
        	        	    {
        	        	        // ANTLRv3.g:300:5: (op= ROOT_V3TOK |op= BANG_V3TOK )
        	        	        {
        	        	            int alt52=2;
        	        	            switch ( LA(1) )
        	        	            {
        	        	            case ROOT_V3TOK:
        	        	            	{
        	        	            		alt52=1;
        	        	            	}
        	        	                break;
        	        	            case BANG_V3TOK:
        	        	            	{
        	        	            		alt52=2;
        	        	            	}
        	        	                break;

        	        	            default:
        	        	                if (BACKTRACKING>0)
        	        	                {
        	        	                    FAILEDFLAG = ANTLR3_TRUE;
        	        	                    return retval;
        	        	                }

        	        	                CONSTRUCTEX();
        	        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
        	        	                EXCEPTION->message      = (void *)"";
        	        	                EXCEPTION->decisionNum  = 52;
        	        	                EXCEPTION->state        = 0;


        	        	                goto ruleatomEx;

        	        	            }

        	        	            switch (alt52)
        	        	            {
        	        	        	case 1:
        	        	        	    // ANTLRv3.g:300:6: op= ROOT_V3TOK
        	        	        	    {
        	        	        	        op = (pANTLR3_COMMON_TOKEN) MATCHT(ROOT_V3TOK, &FOLLOW_ROOT_V3TOK_in_atom1896);
        	        	        	        if  (HASEXCEPTION())
        	        	        	        {
        	        	        	            goto ruleatomEx;
        	        	        	        }
        	        	        	        if (HASFAILED())
        	        	        	        {
        	        	        	            return retval;
        	        	        	        }
        	        	        	         
        	        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_ROOT_V3TOK; stream_ROOT_V3TOK->add(stream_ROOT_V3TOK, op, NULL); }


        	        	        	    }
        	        	        	    break;
        	        	        	case 2:
        	        	        	    // ANTLRv3.g:300:20: op= BANG_V3TOK
        	        	        	    {
        	        	        	        op = (pANTLR3_COMMON_TOKEN) MATCHT(BANG_V3TOK, &FOLLOW_BANG_V3TOK_in_atom1900);
        	        	        	        if  (HASEXCEPTION())
        	        	        	        {
        	        	        	            goto ruleatomEx;
        	        	        	        }
        	        	        	        if (HASFAILED())
        	        	        	        {
        	        	        	            return retval;
        	        	        	        }
        	        	        	         
        	        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_BANG_V3TOK; stream_BANG_V3TOK->add(stream_BANG_V3TOK, op, NULL); }


        	        	        	    }
        	        	        	    break;

        	        	            }
        	        	        }

        	        	        /* AST REWRITE
        	        	         * elements          : RULE_REF, op, ARG_ACTION
        	        	         * token labels      : op
        	        	         * rule labels       : retval
        	        	         * token list labels : 
        	        	         * rule list labels  : 
        	        	         */
        	        	        if ( BACKTRACKING==0 ) 

        	        	        {
        	        	        	pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_op;
        	        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	        	stream_op=antlr3RewriteRuleTOKENStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token op", op);
        	        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	retval.tree    = root_0;
        	        	        	// 300:35: -> ^( $op RULE_REF ( ARG_ACTION )? )
        	        	        	{
        	        	        	    // ANTLRv3.g:300:38: ^( $op RULE_REF ( ARG_ACTION )? )
        	        	        	    {
        	        	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRootToken(ADAPTOR, stream_op == NULL ? NULL : stream_op->nextToken(stream_op), root_1));

        	        	        	        ADAPTOR->addChild(ADAPTOR, root_1, 
        	        	        	        stream_RULE_REF == NULL ? NULL : stream_RULE_REF->nextNode(stream_RULE_REF)
        	        	        	        );

        	        	        	        // ANTLRv3.g:300:53: ( ARG_ACTION )?
        	        	        	        {
        	        	        	        	if ( (stream_ARG_ACTION != NULL && stream_ARG_ACTION->hasNext(stream_ARG_ACTION))  )
        	        	        	        	{
        	        	        	        		ADAPTOR->addChild(ADAPTOR, root_1, 
        	        	        	        		stream_ARG_ACTION == NULL ? NULL : stream_ARG_ACTION->nextNode(stream_ARG_ACTION)
        	        	        	        		);

        	        	        	        	}
        	        	        	        	if ( stream_ARG_ACTION != NULL) stream_ARG_ACTION->reset(stream_ARG_ACTION);

        	        	        	        }

        	        	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
        	        	        	    }

        	        	        	}


        	        	        	retval.tree = root_0; // set result root
        	        	        	if (stream_op != NULL) stream_op->free(stream_op); 
        	        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        	        }
        	        	    }
        	        	    break;
        	        	case 2:
        	        	    // ANTLRv3.g:301:9: 
        	        	    {
        	        	        /* AST REWRITE
        	        	         * elements          : ARG_ACTION, RULE_REF
        	        	         * token labels      : 
        	        	         * rule labels       : retval
        	        	         * token list labels : 
        	        	         * rule list labels  : 
        	        	         */
        	        	        if ( BACKTRACKING==0 ) 

        	        	        {
        	        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	retval.tree    = root_0;
        	        	        	// 301:9: -> ^( RULE_REF ( ARG_ACTION )? )
        	        	        	{
        	        	        	    // ANTLRv3.g:301:12: ^( RULE_REF ( ARG_ACTION )? )
        	        	        	    {
        	        	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
        	        	        	        stream_RULE_REF == NULL ? NULL : stream_RULE_REF->nextNode(stream_RULE_REF)
        	        	        	        , root_1));

        	        	        	        // ANTLRv3.g:301:23: ( ARG_ACTION )?
        	        	        	        {
        	        	        	        	if ( (stream_ARG_ACTION != NULL && stream_ARG_ACTION->hasNext(stream_ARG_ACTION))  )
        	        	        	        	{
        	        	        	        		ADAPTOR->addChild(ADAPTOR, root_1, 
        	        	        	        		stream_ARG_ACTION == NULL ? NULL : stream_ARG_ACTION->nextNode(stream_ARG_ACTION)
        	        	        	        		);

        	        	        	        	}
        	        	        	        	if ( stream_ARG_ACTION != NULL) stream_ARG_ACTION->reset(stream_ARG_ACTION);

        	        	        	        }

        	        	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
        	        	        	    }

        	        	        	}


        	        	        	retval.tree = root_0; // set result root
        	        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        	        }
        	        	    }
        	        	    break;

        	            }
        	        }

        	    }
        	    break;

            }
        }
    }

    // This is where rules clean up and exit
    //
    goto ruleatomEx; /* Prevent compiler warnings */
    ruleatomEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_ROOT_V3TOK != NULL) stream_ROOT_V3TOK->free(stream_ROOT_V3TOK);
        if (stream_BANG_V3TOK != NULL) stream_BANG_V3TOK->free(stream_BANG_V3TOK);
        if (stream_RULE_REF != NULL) stream_RULE_REF->free(stream_RULE_REF);
        if (stream_ARG_ACTION != NULL) stream_ARG_ACTION->free(stream_ARG_ACTION);
        if (stream_range != NULL) stream_range->free(stream_range);
        if (stream_notSet != NULL) stream_notSet->free(stream_notSet);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end atom */

/**
 * $ANTLR start notSet
 * ANTLRv3.g:305:1: notSet : '~' ( notTerminal ( elementOptions )? -> ^( '~' notTerminal ( elementOptions )? ) | block ( elementOptions )? -> ^( '~' block ( elementOptions )? ) ) ;
 */
static ANTLRv3Parser_notSet_return
notSet(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_notSet_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    char_literal112;
    ANTLRv3Parser_notTerminal_return notTerminal113;
    #undef	RETURN_TYPE_notTerminal113
    #define	RETURN_TYPE_notTerminal113 ANTLRv3Parser_notTerminal_return

    ANTLRv3Parser_elementOptions_return elementOptions114;
    #undef	RETURN_TYPE_elementOptions114
    #define	RETURN_TYPE_elementOptions114 ANTLRv3Parser_elementOptions_return

    ANTLRv3Parser_block_return block115;
    #undef	RETURN_TYPE_block115
    #define	RETURN_TYPE_block115 ANTLRv3Parser_block_return

    ANTLRv3Parser_elementOptions_return elementOptions116;
    #undef	RETURN_TYPE_elementOptions116
    #define	RETURN_TYPE_elementOptions116 ANTLRv3Parser_elementOptions_return

    pANTLR3_BASE_TREE char_literal112_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_96;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_notTerminal;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_elementOptions;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_block;
    /* Initialize rule variables
     */

    root_0 = NULL;

    char_literal112       = NULL;
    notTerminal113.tree = NULL;

    elementOptions114.tree = NULL;

    block115.tree = NULL;

    elementOptions116.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    char_literal112_tree   = NULL;

    stream_96   = NULL;
    #define CREATE_stream_96  if (stream_96 == NULL) {stream_96 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 96"); } 
    stream_notTerminal   = NULL;
    #define CREATE_stream_notTerminal  if (stream_notTerminal == NULL) {stream_notTerminal = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule notTerminal"); }
    stream_elementOptions   = NULL;
    #define CREATE_stream_elementOptions  if (stream_elementOptions == NULL) {stream_elementOptions = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule elementOptions"); }
    stream_block   = NULL;
    #define CREATE_stream_block  if (stream_block == NULL) {stream_block = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule block"); }

    retval.tree  = NULL;

    {
        // ANTLRv3.g:306:2: ( '~' ( notTerminal ( elementOptions )? -> ^( '~' notTerminal ( elementOptions )? ) | block ( elementOptions )? -> ^( '~' block ( elementOptions )? ) ) )
        // ANTLRv3.g:306:4: '~' ( notTerminal ( elementOptions )? -> ^( '~' notTerminal ( elementOptions )? ) | block ( elementOptions )? -> ^( '~' block ( elementOptions )? ) )
        {
            char_literal112 = (pANTLR3_COMMON_TOKEN) MATCHT(96, &FOLLOW_96_in_notSet1944);
            if  (HASEXCEPTION())
            {
                goto rulenotSetEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_96; stream_96->add(stream_96, char_literal112, NULL); }


            // ANTLRv3.g:307:3: ( notTerminal ( elementOptions )? -> ^( '~' notTerminal ( elementOptions )? ) | block ( elementOptions )? -> ^( '~' block ( elementOptions )? ) )
            {
                int alt57=2;
                switch ( LA(1) )
                {
                case CHAR_LITERAL:
                case STRING_LITERAL:
                case TOKEN_REF:
                	{
                		alt57=1;
                	}
                    break;
                case 74:
                	{
                		alt57=2;
                	}
                    break;

                default:
                    if (BACKTRACKING>0)
                    {
                        FAILEDFLAG = ANTLR3_TRUE;
                        return retval;
                    }

                    CONSTRUCTEX();
                    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
                    EXCEPTION->message      = (void *)"";
                    EXCEPTION->decisionNum  = 57;
                    EXCEPTION->state        = 0;


                    goto rulenotSetEx;

                }

                switch (alt57)
                {
            	case 1:
            	    // ANTLRv3.g:307:5: notTerminal ( elementOptions )?
            	    {
            	        FOLLOWPUSH(FOLLOW_notTerminal_in_notSet1950);
            	        notTerminal113=notTerminal(ctx);

            	        FOLLOWPOP();
            	        if  (HASEXCEPTION())
            	        {
            	            goto rulenotSetEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }

            	        if ( BACKTRACKING==0 ) { CREATE_stream_notTerminal; stream_notTerminal->add(stream_notTerminal, notTerminal113.tree, NULL); }

            	        // ANTLRv3.g:307:17: ( elementOptions )?
            	        {
            	            int alt55=2;
            	            switch ( LA(1) )
            	            {
            	                case 82:
            	                	{
            	                		alt55=1;
            	                	}
            	                    break;
            	            }

            	            switch (alt55)
            	            {
            	        	case 1:
            	        	    // ANTLRv3.g:307:17: elementOptions
            	        	    {
            	        	        FOLLOWPUSH(FOLLOW_elementOptions_in_notSet1952);
            	        	        elementOptions114=elementOptions(ctx);

            	        	        FOLLOWPOP();
            	        	        if  (HASEXCEPTION())
            	        	        {
            	        	            goto rulenotSetEx;
            	        	        }
            	        	        if (HASFAILED())
            	        	        {
            	        	            return retval;
            	        	        }

            	        	        if ( BACKTRACKING==0 ) { CREATE_stream_elementOptions; stream_elementOptions->add(stream_elementOptions, elementOptions114.tree, NULL); }

            	        	    }
            	        	    break;

            	            }
            	        }

            	        /* AST REWRITE
            	         * elements          : 96, elementOptions, notTerminal
            	         * token labels      : 
            	         * rule labels       : retval
            	         * token list labels : 
            	         * rule list labels  : 
            	         */
            	        if ( BACKTRACKING==0 ) 

            	        {
            	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	retval.tree    = root_0;
            	        	// 307:33: -> ^( '~' notTerminal ( elementOptions )? )
            	        	{
            	        	    // ANTLRv3.g:307:36: ^( '~' notTerminal ( elementOptions )? )
            	        	    {
            	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
            	        	        stream_96 == NULL ? NULL : stream_96->nextNode(stream_96)
            	        	        , root_1));

            	        	        ADAPTOR->addChild(ADAPTOR, root_1, stream_notTerminal == NULL ? NULL : stream_notTerminal->nextTree(stream_notTerminal));

            	        	        // ANTLRv3.g:307:54: ( elementOptions )?
            	        	        {
            	        	        	if ( (stream_elementOptions != NULL && stream_elementOptions->hasNext(stream_elementOptions))  )
            	        	        	{
            	        	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_elementOptions == NULL ? NULL : stream_elementOptions->nextTree(stream_elementOptions));

            	        	        	}
            	        	        	if ( stream_elementOptions != NULL) stream_elementOptions->reset(stream_elementOptions);

            	        	        }

            	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	        	    }

            	        	}


            	        	retval.tree = root_0; // set result root
            	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


            	        }
            	    }
            	    break;
            	case 2:
            	    // ANTLRv3.g:308:5: block ( elementOptions )?
            	    {
            	        FOLLOWPUSH(FOLLOW_block_in_notSet1970);
            	        block115=block(ctx);

            	        FOLLOWPOP();
            	        if  (HASEXCEPTION())
            	        {
            	            goto rulenotSetEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }

            	        if ( BACKTRACKING==0 ) { CREATE_stream_block; stream_block->add(stream_block, block115.tree, NULL); }

            	        // ANTLRv3.g:308:11: ( elementOptions )?
            	        {
            	            int alt56=2;
            	            switch ( LA(1) )
            	            {
            	                case 82:
            	                	{
            	                		alt56=1;
            	                	}
            	                    break;
            	            }

            	            switch (alt56)
            	            {
            	        	case 1:
            	        	    // ANTLRv3.g:308:11: elementOptions
            	        	    {
            	        	        FOLLOWPUSH(FOLLOW_elementOptions_in_notSet1972);
            	        	        elementOptions116=elementOptions(ctx);

            	        	        FOLLOWPOP();
            	        	        if  (HASEXCEPTION())
            	        	        {
            	        	            goto rulenotSetEx;
            	        	        }
            	        	        if (HASFAILED())
            	        	        {
            	        	            return retval;
            	        	        }

            	        	        if ( BACKTRACKING==0 ) { CREATE_stream_elementOptions; stream_elementOptions->add(stream_elementOptions, elementOptions116.tree, NULL); }

            	        	    }
            	        	    break;

            	            }
            	        }

            	        /* AST REWRITE
            	         * elements          : block, 96, elementOptions
            	         * token labels      : 
            	         * rule labels       : retval
            	         * token list labels : 
            	         * rule list labels  : 
            	         */
            	        if ( BACKTRACKING==0 ) 

            	        {
            	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	retval.tree    = root_0;
            	        	// 308:28: -> ^( '~' block ( elementOptions )? )
            	        	{
            	        	    // ANTLRv3.g:308:31: ^( '~' block ( elementOptions )? )
            	        	    {
            	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
            	        	        stream_96 == NULL ? NULL : stream_96->nextNode(stream_96)
            	        	        , root_1));

            	        	        ADAPTOR->addChild(ADAPTOR, root_1, stream_block == NULL ? NULL : stream_block->nextTree(stream_block));

            	        	        // ANTLRv3.g:308:43: ( elementOptions )?
            	        	        {
            	        	        	if ( (stream_elementOptions != NULL && stream_elementOptions->hasNext(stream_elementOptions))  )
            	        	        	{
            	        	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_elementOptions == NULL ? NULL : stream_elementOptions->nextTree(stream_elementOptions));

            	        	        	}
            	        	        	if ( stream_elementOptions != NULL) stream_elementOptions->reset(stream_elementOptions);

            	        	        }

            	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	        	    }

            	        	}


            	        	retval.tree = root_0; // set result root
            	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


            	        }
            	    }
            	    break;

                }
            }

        }

    }

    // This is where rules clean up and exit
    //
    goto rulenotSetEx; /* Prevent compiler warnings */
    rulenotSetEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_96 != NULL) stream_96->free(stream_96);
        if (stream_notTerminal != NULL) stream_notTerminal->free(stream_notTerminal);
        if (stream_elementOptions != NULL) stream_elementOptions->free(stream_elementOptions);
        if (stream_block != NULL) stream_block->free(stream_block);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end notSet */

/**
 * $ANTLR start notTerminal
 * ANTLRv3.g:312:1: notTerminal : ( CHAR_LITERAL | TOKEN_REF | STRING_LITERAL );
 */
static ANTLRv3Parser_notTerminal_return
notTerminal(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_notTerminal_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    set117;

    pANTLR3_BASE_TREE set117_tree;

    /* Initialize rule variables
     */

    root_0 = NULL;

    set117       = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    set117_tree   = NULL;


    retval.tree  = NULL;

    {
        // ANTLRv3.g:313:2: ( CHAR_LITERAL | TOKEN_REF | STRING_LITERAL )
        // ANTLRv3.g:
        {
            root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


            set117=(pANTLR3_COMMON_TOKEN)LT(1);

            if ( LA(1) == CHAR_LITERAL || LA(1) == STRING_LITERAL || LA(1) == TOKEN_REF )
            {
                CONSUME();
                if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, 
                (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, set117))
                );
                PERRORRECOVERY=ANTLR3_FALSE;
                FAILEDFLAG=ANTLR3_FALSE;

            }
            else
            {
                if (BACKTRACKING>0)
                {
                    FAILEDFLAG = ANTLR3_TRUE;
                    return retval;
                }

                CONSTRUCTEX();
                EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
                EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
                EXCEPTION->expectingSet = NULL;

                goto rulenotTerminalEx;
            }


        }

    }

    // This is where rules clean up and exit
    //
    goto rulenotTerminalEx; /* Prevent compiler warnings */
    rulenotTerminalEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end notTerminal */

/**
 * $ANTLR start elementOptions
 * ANTLRv3.g:318:1: elementOptions : ( '<' qid '>' -> ^( OPTIONS qid ) | '<' option ( ';' option )* '>' -> ^( OPTIONS ( option )+ ) );
 */
static ANTLRv3Parser_elementOptions_return
elementOptions(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_elementOptions_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    char_literal118;
    pANTLR3_COMMON_TOKEN    char_literal120;
    pANTLR3_COMMON_TOKEN    char_literal121;
    pANTLR3_COMMON_TOKEN    char_literal123;
    pANTLR3_COMMON_TOKEN    char_literal125;
    ANTLRv3Parser_qid_return qid119;
    #undef	RETURN_TYPE_qid119
    #define	RETURN_TYPE_qid119 ANTLRv3Parser_qid_return

    ANTLRv3Parser_option_return option122;
    #undef	RETURN_TYPE_option122
    #define	RETURN_TYPE_option122 ANTLRv3Parser_option_return

    ANTLRv3Parser_option_return option124;
    #undef	RETURN_TYPE_option124
    #define	RETURN_TYPE_option124 ANTLRv3Parser_option_return

    pANTLR3_BASE_TREE char_literal118_tree;
    pANTLR3_BASE_TREE char_literal120_tree;
    pANTLR3_BASE_TREE char_literal121_tree;
    pANTLR3_BASE_TREE char_literal123_tree;
    pANTLR3_BASE_TREE char_literal125_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_82;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_81;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_84;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_qid;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_option;
    /* Initialize rule variables
     */

    root_0 = NULL;

    char_literal118       = NULL;
    char_literal120       = NULL;
    char_literal121       = NULL;
    char_literal123       = NULL;
    char_literal125       = NULL;
    qid119.tree = NULL;

    option122.tree = NULL;

    option124.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    char_literal118_tree   = NULL;
    char_literal120_tree   = NULL;
    char_literal121_tree   = NULL;
    char_literal123_tree   = NULL;
    char_literal125_tree   = NULL;

    stream_82   = NULL;
    #define CREATE_stream_82  if (stream_82 == NULL) {stream_82 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 82"); } 
    stream_81   = NULL;
    #define CREATE_stream_81  if (stream_81 == NULL) {stream_81 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 81"); } 
    stream_84   = NULL;
    #define CREATE_stream_84  if (stream_84 == NULL) {stream_84 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 84"); } 
    stream_qid   = NULL;
    #define CREATE_stream_qid  if (stream_qid == NULL) {stream_qid = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule qid"); }
    stream_option   = NULL;
    #define CREATE_stream_option  if (stream_option == NULL) {stream_option = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule option"); }

    retval.tree  = NULL;

    {
        {
            //  ANTLRv3.g:319:2: ( '<' qid '>' -> ^( OPTIONS qid ) | '<' option ( ';' option )* '>' -> ^( OPTIONS ( option )+ ) )

            ANTLR3_UINT32 alt59;

            alt59=2;

            switch ( LA(1) )
            {
            case 82:
            	{
            		switch ( LA(2) )
            		{
            		case RULE_REF:
            		case TOKEN_REF:
            			{
            				switch ( LA(3) )
            				{
            				case DOT_SYM:
            				case 84:
            					{
            						alt59=1;
            					}
            				    break;
            				case LABEL_ASSIGN_V3TOK:
            					{
            						alt59=2;
            					}
            				    break;

            				default:
            				    if (BACKTRACKING>0)
            				    {
            				        FAILEDFLAG = ANTLR3_TRUE;
            				        return retval;
            				    }

            				    CONSTRUCTEX();
            				    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            				    EXCEPTION->message      = (void *)"";
            				    EXCEPTION->decisionNum  = 59;
            				    EXCEPTION->state        = 2;


            				    goto ruleelementOptionsEx;

            				}

            			}
            		    break;

            		default:
            		    if (BACKTRACKING>0)
            		    {
            		        FAILEDFLAG = ANTLR3_TRUE;
            		        return retval;
            		    }

            		    CONSTRUCTEX();
            		    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            		    EXCEPTION->message      = (void *)"";
            		    EXCEPTION->decisionNum  = 59;
            		    EXCEPTION->state        = 1;


            		    goto ruleelementOptionsEx;

            		}

            	}
                break;

            default:
                if (BACKTRACKING>0)
                {
                    FAILEDFLAG = ANTLR3_TRUE;
                    return retval;
                }

                CONSTRUCTEX();
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
                EXCEPTION->message      = (void *)"";
                EXCEPTION->decisionNum  = 59;
                EXCEPTION->state        = 0;


                goto ruleelementOptionsEx;

            }

            switch (alt59)
            {
        	case 1:
        	    // ANTLRv3.g:319:4: '<' qid '>'
        	    {
        	        char_literal118 = (pANTLR3_COMMON_TOKEN) MATCHT(82, &FOLLOW_82_in_elementOptions2024);
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleelementOptionsEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }
        	         
        	        if ( BACKTRACKING==0 ) { CREATE_stream_82; stream_82->add(stream_82, char_literal118, NULL); }


        	        FOLLOWPUSH(FOLLOW_qid_in_elementOptions2026);
        	        qid119=qid(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleelementOptionsEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) { CREATE_stream_qid; stream_qid->add(stream_qid, qid119.tree, NULL); }

        	        char_literal120 = (pANTLR3_COMMON_TOKEN) MATCHT(84, &FOLLOW_84_in_elementOptions2028);
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleelementOptionsEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }
        	         
        	        if ( BACKTRACKING==0 ) { CREATE_stream_84; stream_84->add(stream_84, char_literal120, NULL); }


        	        /* AST REWRITE
        	         * elements          : qid
        	         * token labels      : 
        	         * rule labels       : retval
        	         * token list labels : 
        	         * rule list labels  : 
        	         */
        	        if ( BACKTRACKING==0 ) 

        	        {
        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	retval.tree    = root_0;
        	        	// 319:21: -> ^( OPTIONS qid )
        	        	{
        	        	    // ANTLRv3.g:319:24: ^( OPTIONS qid )
        	        	    {
        	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
        	        	        (pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, OPTIONS, (pANTLR3_UINT8)"OPTIONS")
        	        	        , root_1));

        	        	        ADAPTOR->addChild(ADAPTOR, root_1, stream_qid == NULL ? NULL : stream_qid->nextTree(stream_qid));

        	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
        	        	    }

        	        	}


        	        	retval.tree = root_0; // set result root
        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        }
        	    }
        	    break;
        	case 2:
        	    // ANTLRv3.g:320:4: '<' option ( ';' option )* '>'
        	    {
        	        char_literal121 = (pANTLR3_COMMON_TOKEN) MATCHT(82, &FOLLOW_82_in_elementOptions2046);
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleelementOptionsEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }
        	         
        	        if ( BACKTRACKING==0 ) { CREATE_stream_82; stream_82->add(stream_82, char_literal121, NULL); }


        	        FOLLOWPUSH(FOLLOW_option_in_elementOptions2048);
        	        option122=option(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleelementOptionsEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) { CREATE_stream_option; stream_option->add(stream_option, option122.tree, NULL); }

        	        // ANTLRv3.g:320:15: ( ';' option )*

        	        for (;;)
        	        {
        	            int alt58=2;
        	            switch ( LA(1) )
        	            {
        	            case 81:
        	            	{
        	            		alt58=1;
        	            	}
        	                break;

        	            }

        	            switch (alt58)
        	            {
        	        	case 1:
        	        	    // ANTLRv3.g:320:16: ';' option
        	        	    {
        	        	        char_literal123 = (pANTLR3_COMMON_TOKEN) MATCHT(81, &FOLLOW_81_in_elementOptions2051);
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto ruleelementOptionsEx;
        	        	        }
        	        	        if (HASFAILED())
        	        	        {
        	        	            return retval;
        	        	        }
        	        	         
        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_81; stream_81->add(stream_81, char_literal123, NULL); }


        	        	        FOLLOWPUSH(FOLLOW_option_in_elementOptions2053);
        	        	        option124=option(ctx);

        	        	        FOLLOWPOP();
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto ruleelementOptionsEx;
        	        	        }
        	        	        if (HASFAILED())
        	        	        {
        	        	            return retval;
        	        	        }

        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_option; stream_option->add(stream_option, option124.tree, NULL); }

        	        	    }
        	        	    break;

        	        	default:
        	        	    goto loop58;	/* break out of the loop */
        	        	    break;
        	            }
        	        }
        	        loop58: ; /* Jump out to here if this rule does not match */


        	        char_literal125 = (pANTLR3_COMMON_TOKEN) MATCHT(84, &FOLLOW_84_in_elementOptions2057);
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleelementOptionsEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }
        	         
        	        if ( BACKTRACKING==0 ) { CREATE_stream_84; stream_84->add(stream_84, char_literal125, NULL); }


        	        /* AST REWRITE
        	         * elements          : option
        	         * token labels      : 
        	         * rule labels       : retval
        	         * token list labels : 
        	         * rule list labels  : 
        	         */
        	        if ( BACKTRACKING==0 ) 

        	        {
        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	retval.tree    = root_0;
        	        	// 320:33: -> ^( OPTIONS ( option )+ )
        	        	{
        	        	    // ANTLRv3.g:320:36: ^( OPTIONS ( option )+ )
        	        	    {
        	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
        	        	        (pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, OPTIONS, (pANTLR3_UINT8)"OPTIONS")
        	        	        , root_1));

        	        	        if ((stream_option == NULL || !stream_option->hasNext(stream_option))  )
        	        	        {
        	        	            CONSTRUCTEX();
        	        	            EXCEPTION->type         = ANTLR3_REWRITE_EARLY_EXCEPTION;
        	        	            EXCEPTION->name         = (void *)ANTLR3_REWRITE_EARLY_EXCEPTION_NAME;
        	        	        }
        	        	        else
        	        	        {
        	        	        	while ( (stream_option->hasNext(stream_option))  ) {
        	        	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_option == NULL ? NULL : stream_option->nextTree(stream_option));

        	        	        	}
        	        	        	stream_option->reset(stream_option);

        	        	        }
        	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
        	        	    }

        	        	}


        	        	retval.tree = root_0; // set result root
        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        }
        	    }
        	    break;

            }
        }
    }

    // This is where rules clean up and exit
    //
    goto ruleelementOptionsEx; /* Prevent compiler warnings */
    ruleelementOptionsEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_82 != NULL) stream_82->free(stream_82);
        if (stream_81 != NULL) stream_81->free(stream_81);
        if (stream_84 != NULL) stream_84->free(stream_84);
        if (stream_qid != NULL) stream_qid->free(stream_qid);
        if (stream_option != NULL) stream_option->free(stream_option);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end elementOptions */

/**
 * $ANTLR start elementOption
 * ANTLRv3.g:323:1: elementOption : id '=' optionValue -> ^( '=' id optionValue ) ;
 */
static ANTLRv3Parser_elementOption_return
elementOption(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_elementOption_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    char_literal127;
    ANTLRv3Parser_id_return id126;
    #undef	RETURN_TYPE_id126
    #define	RETURN_TYPE_id126 ANTLRv3Parser_id_return

    ANTLRv3Parser_optionValue_return optionValue128;
    #undef	RETURN_TYPE_optionValue128
    #define	RETURN_TYPE_optionValue128 ANTLRv3Parser_optionValue_return

    pANTLR3_BASE_TREE char_literal127_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_LABEL_ASSIGN_V3TOK;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_id;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_optionValue;
    /* Initialize rule variables
     */

    root_0 = NULL;

    char_literal127       = NULL;
    id126.tree = NULL;

    optionValue128.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    char_literal127_tree   = NULL;

    stream_LABEL_ASSIGN_V3TOK   = NULL;
    #define CREATE_stream_LABEL_ASSIGN_V3TOK  if (stream_LABEL_ASSIGN_V3TOK == NULL) {stream_LABEL_ASSIGN_V3TOK = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token LABEL_ASSIGN_V3TOK"); } 
    stream_id   = NULL;
    #define CREATE_stream_id  if (stream_id == NULL) {stream_id = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule id"); }
    stream_optionValue   = NULL;
    #define CREATE_stream_optionValue  if (stream_optionValue == NULL) {stream_optionValue = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule optionValue"); }

    retval.tree  = NULL;

    {
        // ANTLRv3.g:324:2: ( id '=' optionValue -> ^( '=' id optionValue ) )
        // ANTLRv3.g:324:4: id '=' optionValue
        {
            FOLLOWPUSH(FOLLOW_id_in_elementOption2077);
            id126=id(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto ruleelementOptionEx;
            }
            if (HASFAILED())
            {
                return retval;
            }

            if ( BACKTRACKING==0 ) { CREATE_stream_id; stream_id->add(stream_id, id126.tree, NULL); }

            char_literal127 = (pANTLR3_COMMON_TOKEN) MATCHT(LABEL_ASSIGN_V3TOK, &FOLLOW_LABEL_ASSIGN_V3TOK_in_elementOption2079);
            if  (HASEXCEPTION())
            {
                goto ruleelementOptionEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_LABEL_ASSIGN_V3TOK; stream_LABEL_ASSIGN_V3TOK->add(stream_LABEL_ASSIGN_V3TOK, char_literal127, NULL); }


            FOLLOWPUSH(FOLLOW_optionValue_in_elementOption2081);
            optionValue128=optionValue(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto ruleelementOptionEx;
            }
            if (HASFAILED())
            {
                return retval;
            }

            if ( BACKTRACKING==0 ) { CREATE_stream_optionValue; stream_optionValue->add(stream_optionValue, optionValue128.tree, NULL); }

            /* AST REWRITE
             * elements          : id, optionValue, LABEL_ASSIGN_V3TOK
             * token labels      : 
             * rule labels       : retval
             * token list labels : 
             * rule list labels  : 
             */
            if ( BACKTRACKING==0 ) 

            {
            	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	retval.tree    = root_0;
            	// 324:23: -> ^( '=' id optionValue )
            	{
            	    // ANTLRv3.g:324:26: ^( '=' id optionValue )
            	    {
            	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
            	        stream_LABEL_ASSIGN_V3TOK == NULL ? NULL : stream_LABEL_ASSIGN_V3TOK->nextNode(stream_LABEL_ASSIGN_V3TOK)
            	        , root_1));

            	        ADAPTOR->addChild(ADAPTOR, root_1, stream_id == NULL ? NULL : stream_id->nextTree(stream_id));

            	        ADAPTOR->addChild(ADAPTOR, root_1, stream_optionValue == NULL ? NULL : stream_optionValue->nextTree(stream_optionValue));

            	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	    }

            	}


            	retval.tree = root_0; // set result root
            	if (stream_retval != NULL) stream_retval->free(stream_retval);


            }
        }

    }

    // This is where rules clean up and exit
    //
    goto ruleelementOptionEx; /* Prevent compiler warnings */
    ruleelementOptionEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_LABEL_ASSIGN_V3TOK != NULL) stream_LABEL_ASSIGN_V3TOK->free(stream_LABEL_ASSIGN_V3TOK);
        if (stream_id != NULL) stream_id->free(stream_id);
        if (stream_optionValue != NULL) stream_optionValue->free(stream_optionValue);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end elementOption */

/**
 * $ANTLR start treeSpec
 * ANTLRv3.g:327:1: treeSpec : '^(' element ( element )+ ')' -> ^( TREE_BEGIN_V3TOK ( element )+ ) ;
 */
static ANTLRv3Parser_treeSpec_return
treeSpec(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_treeSpec_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    string_literal129;
    pANTLR3_COMMON_TOKEN    char_literal132;
    ANTLRv3Parser_element_return element130;
    #undef	RETURN_TYPE_element130
    #define	RETURN_TYPE_element130 ANTLRv3Parser_element_return

    ANTLRv3Parser_element_return element131;
    #undef	RETURN_TYPE_element131
    #define	RETURN_TYPE_element131 ANTLRv3Parser_element_return

    pANTLR3_BASE_TREE string_literal129_tree;
    pANTLR3_BASE_TREE char_literal132_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_TREE_BEGIN_V3TOK;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_75;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_element;
    /* Initialize rule variables
     */

    root_0 = NULL;

    string_literal129       = NULL;
    char_literal132       = NULL;
    element130.tree = NULL;

    element131.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    string_literal129_tree   = NULL;
    char_literal132_tree   = NULL;

    stream_TREE_BEGIN_V3TOK   = NULL;
    #define CREATE_stream_TREE_BEGIN_V3TOK  if (stream_TREE_BEGIN_V3TOK == NULL) {stream_TREE_BEGIN_V3TOK = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token TREE_BEGIN_V3TOK"); } 
    stream_75   = NULL;
    #define CREATE_stream_75  if (stream_75 == NULL) {stream_75 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 75"); } 
    stream_element   = NULL;
    #define CREATE_stream_element  if (stream_element == NULL) {stream_element = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule element"); }

    retval.tree  = NULL;

    {
        // ANTLRv3.g:328:2: ( '^(' element ( element )+ ')' -> ^( TREE_BEGIN_V3TOK ( element )+ ) )
        // ANTLRv3.g:328:4: '^(' element ( element )+ ')'
        {
            string_literal129 = (pANTLR3_COMMON_TOKEN) MATCHT(TREE_BEGIN_V3TOK, &FOLLOW_TREE_BEGIN_V3TOK_in_treeSpec2103);
            if  (HASEXCEPTION())
            {
                goto ruletreeSpecEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_TREE_BEGIN_V3TOK; stream_TREE_BEGIN_V3TOK->add(stream_TREE_BEGIN_V3TOK, string_literal129, NULL); }


            FOLLOWPUSH(FOLLOW_element_in_treeSpec2105);
            element130=element(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto ruletreeSpecEx;
            }
            if (HASFAILED())
            {
                return retval;
            }

            if ( BACKTRACKING==0 ) { CREATE_stream_element; stream_element->add(stream_element, element130.tree, NULL); }

            // ANTLRv3.g:328:17: ( element )+
            {
                int cnt60=0;

                for (;;)
                {
                    int alt60=2;
            	switch ( LA(1) )
            	{
            	case ACTION:
            	case CHAR_LITERAL:
            	case DOT_SYM:
            	case RULE_REF:
            	case SEMPRED_V3TOK:
            	case STRING_LITERAL:
            	case TOKEN_REF:
            	case TREE_BEGIN_V3TOK:
            	case 74:
            	case 96:
            		{
            			alt60=1;
            		}
            	    break;

            	}

            	switch (alt60)
            	{
            	    case 1:
            	        // ANTLRv3.g:328:19: element
            	        {
            	            FOLLOWPUSH(FOLLOW_element_in_treeSpec2109);
            	            element131=element(ctx);

            	            FOLLOWPOP();
            	            if  (HASEXCEPTION())
            	            {
            	                goto ruletreeSpecEx;
            	            }
            	            if (HASFAILED())
            	            {
            	                return retval;
            	            }

            	            if ( BACKTRACKING==0 ) { CREATE_stream_element; stream_element->add(stream_element, element131.tree, NULL); }

            	        }
            	        break;

            	    default:

            		if ( cnt60 >= 1 )
            		{
            		    goto loop60;
            		}
            		if (BACKTRACKING>0)
            		{
            		    FAILEDFLAG = ANTLR3_TRUE;
            		    return retval;
            		}

            		/* mismatchedSetEx()
            		 */
            		CONSTRUCTEX();
            		EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
            		EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;


            		goto ruletreeSpecEx;
            	}
            	cnt60++;
                }
                loop60: ;	/* Jump to here if this rule does not match */
            }

            char_literal132 = (pANTLR3_COMMON_TOKEN) MATCHT(75, &FOLLOW_75_in_treeSpec2114);
            if  (HASEXCEPTION())
            {
                goto ruletreeSpecEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_75; stream_75->add(stream_75, char_literal132, NULL); }


            /* AST REWRITE
             * elements          : element
             * token labels      : 
             * rule labels       : retval
             * token list labels : 
             * rule list labels  : 
             */
            if ( BACKTRACKING==0 ) 

            {
            	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	retval.tree    = root_0;
            	// 328:34: -> ^( TREE_BEGIN_V3TOK ( element )+ )
            	{
            	    // ANTLRv3.g:328:37: ^( TREE_BEGIN_V3TOK ( element )+ )
            	    {
            	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
            	        (pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, TREE_BEGIN_V3TOK, (pANTLR3_UINT8)"TREE_BEGIN_V3TOK")
            	        , root_1));

            	        if ((stream_element == NULL || !stream_element->hasNext(stream_element))  )
            	        {
            	            CONSTRUCTEX();
            	            EXCEPTION->type         = ANTLR3_REWRITE_EARLY_EXCEPTION;
            	            EXCEPTION->name         = (void *)ANTLR3_REWRITE_EARLY_EXCEPTION_NAME;
            	        }
            	        else
            	        {
            	        	while ( (stream_element->hasNext(stream_element))  ) {
            	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_element == NULL ? NULL : stream_element->nextTree(stream_element));

            	        	}
            	        	stream_element->reset(stream_element);

            	        }
            	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	    }

            	}


            	retval.tree = root_0; // set result root
            	if (stream_retval != NULL) stream_retval->free(stream_retval);


            }
        }

    }

    // This is where rules clean up and exit
    //
    goto ruletreeSpecEx; /* Prevent compiler warnings */
    ruletreeSpecEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_TREE_BEGIN_V3TOK != NULL) stream_TREE_BEGIN_V3TOK->free(stream_TREE_BEGIN_V3TOK);
        if (stream_75 != NULL) stream_75->free(stream_75);
        if (stream_element != NULL) stream_element->free(stream_element);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end treeSpec */

/**
 * $ANTLR start range
 * ANTLRv3.g:331:1: range : c1= CHAR_LITERAL RANGE_V3TOK c2= CHAR_LITERAL ( elementOptions )? -> ^( CHAR_RANGE_V3TOK[$c1,\"..\"] $c1 $c2 ( elementOptions )? ) ;
 */
static ANTLRv3Parser_range_return
range(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_range_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    c1;
    pANTLR3_COMMON_TOKEN    c2;
    pANTLR3_COMMON_TOKEN    RANGE_V3TOK133;
    ANTLRv3Parser_elementOptions_return elementOptions134;
    #undef	RETURN_TYPE_elementOptions134
    #define	RETURN_TYPE_elementOptions134 ANTLRv3Parser_elementOptions_return

    pANTLR3_BASE_TREE c1_tree;
    pANTLR3_BASE_TREE c2_tree;
    pANTLR3_BASE_TREE RANGE_V3TOK133_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_CHAR_LITERAL;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_RANGE_V3TOK;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_elementOptions;
    /* Initialize rule variables
     */

    root_0 = NULL;

    c1       = NULL;
    c2       = NULL;
    RANGE_V3TOK133       = NULL;
    elementOptions134.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    c1_tree   = NULL;
    c2_tree   = NULL;
    RANGE_V3TOK133_tree   = NULL;

    stream_CHAR_LITERAL   = NULL;
    #define CREATE_stream_CHAR_LITERAL  if (stream_CHAR_LITERAL == NULL) {stream_CHAR_LITERAL = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token CHAR_LITERAL"); } 
    stream_RANGE_V3TOK   = NULL;
    #define CREATE_stream_RANGE_V3TOK  if (stream_RANGE_V3TOK == NULL) {stream_RANGE_V3TOK = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token RANGE_V3TOK"); } 
    stream_elementOptions   = NULL;
    #define CREATE_stream_elementOptions  if (stream_elementOptions == NULL) {stream_elementOptions = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule elementOptions"); }

    retval.tree  = NULL;

    {
        // ANTLRv3.g:332:2: (c1= CHAR_LITERAL RANGE_V3TOK c2= CHAR_LITERAL ( elementOptions )? -> ^( CHAR_RANGE_V3TOK[$c1,\"..\"] $c1 $c2 ( elementOptions )? ) )
        // ANTLRv3.g:332:4: c1= CHAR_LITERAL RANGE_V3TOK c2= CHAR_LITERAL ( elementOptions )?
        {
            c1 = (pANTLR3_COMMON_TOKEN) MATCHT(CHAR_LITERAL, &FOLLOW_CHAR_LITERAL_in_range2137);
            if  (HASEXCEPTION())
            {
                goto rulerangeEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_CHAR_LITERAL; stream_CHAR_LITERAL->add(stream_CHAR_LITERAL, c1, NULL); }


            RANGE_V3TOK133 = (pANTLR3_COMMON_TOKEN) MATCHT(RANGE_V3TOK, &FOLLOW_RANGE_V3TOK_in_range2139);
            if  (HASEXCEPTION())
            {
                goto rulerangeEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_RANGE_V3TOK; stream_RANGE_V3TOK->add(stream_RANGE_V3TOK, RANGE_V3TOK133, NULL); }


            c2 = (pANTLR3_COMMON_TOKEN) MATCHT(CHAR_LITERAL, &FOLLOW_CHAR_LITERAL_in_range2143);
            if  (HASEXCEPTION())
            {
                goto rulerangeEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_CHAR_LITERAL; stream_CHAR_LITERAL->add(stream_CHAR_LITERAL, c2, NULL); }


            // ANTLRv3.g:332:48: ( elementOptions )?
            {
                int alt61=2;
                switch ( LA(1) )
                {
                    case 82:
                    	{
                    		alt61=1;
                    	}
                        break;
                }

                switch (alt61)
                {
            	case 1:
            	    // ANTLRv3.g:332:48: elementOptions
            	    {
            	        FOLLOWPUSH(FOLLOW_elementOptions_in_range2145);
            	        elementOptions134=elementOptions(ctx);

            	        FOLLOWPOP();
            	        if  (HASEXCEPTION())
            	        {
            	            goto rulerangeEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }

            	        if ( BACKTRACKING==0 ) { CREATE_stream_elementOptions; stream_elementOptions->add(stream_elementOptions, elementOptions134.tree, NULL); }

            	    }
            	    break;

                }
            }

            /* AST REWRITE
             * elements          : elementOptions, c2, c1
             * token labels      : c1, c2
             * rule labels       : retval
             * token list labels : 
             * rule list labels  : 
             */
            if ( BACKTRACKING==0 ) 

            {
            	pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_c1;
            	pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_c2;
            	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	stream_c1=antlr3RewriteRuleTOKENStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token c1", c1);
            	stream_c2=antlr3RewriteRuleTOKENStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token c2", c2);
            	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	retval.tree    = root_0;
            	// 333:3: -> ^( CHAR_RANGE_V3TOK[$c1,\"..\"] $c1 $c2 ( elementOptions )? )
            	{
            	    // ANTLRv3.g:333:6: ^( CHAR_RANGE_V3TOK[$c1,\"..\"] $c1 $c2 ( elementOptions )? )
            	    {
            	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 

            	        #if 2 == 2
            	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, CHAR_RANGE_V3TOK, TOKTEXT(c1, ".."))
            	        #else
            	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, CHAR_RANGE_V3TOK, (pANTLR3_UINT8)c1, "..")
            	        #endif

            	        , root_1));

            	        ADAPTOR->addChild(ADAPTOR, root_1, stream_c1 == NULL ? NULL : stream_c1->nextNode(stream_c1));

            	        ADAPTOR->addChild(ADAPTOR, root_1, stream_c2 == NULL ? NULL : stream_c2->nextNode(stream_c2));

            	        // ANTLRv3.g:333:43: ( elementOptions )?
            	        {
            	        	if ( (stream_elementOptions != NULL && stream_elementOptions->hasNext(stream_elementOptions))  )
            	        	{
            	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_elementOptions == NULL ? NULL : stream_elementOptions->nextTree(stream_elementOptions));

            	        	}
            	        	if ( stream_elementOptions != NULL) stream_elementOptions->reset(stream_elementOptions);

            	        }

            	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	    }

            	}


            	retval.tree = root_0; // set result root
            	if (stream_c1 != NULL) stream_c1->free(stream_c1); 
            	if (stream_c2 != NULL) stream_c2->free(stream_c2); 
            	if (stream_retval != NULL) stream_retval->free(stream_retval);


            }
        }

    }

    // This is where rules clean up and exit
    //
    goto rulerangeEx; /* Prevent compiler warnings */
    rulerangeEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_CHAR_LITERAL != NULL) stream_CHAR_LITERAL->free(stream_CHAR_LITERAL);
        if (stream_RANGE_V3TOK != NULL) stream_RANGE_V3TOK->free(stream_RANGE_V3TOK);
        if (stream_elementOptions != NULL) stream_elementOptions->free(stream_elementOptions);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end range */

/**
 * $ANTLR start terminal
 * ANTLRv3.g:336:1: terminal : ( CHAR_LITERAL ( elementOptions )? -> ^( CHAR_LITERAL ( elementOptions )? ) | TOKEN_REF ( ARG_ACTION )? ( elementOptions )? -> ^( TOKEN_REF ( ARG_ACTION )? ( elementOptions )? ) | STRING_LITERAL ( elementOptions )? -> ^( STRING_LITERAL ( elementOptions )? ) | DOT_SYM ( elementOptions )? -> ^( DOT_SYM ( elementOptions )? ) ) ( ROOT_V3TOK -> ^( ROOT_V3TOK $terminal) | BANG_V3TOK -> ^( BANG_V3TOK $terminal) )? ;
 */
static ANTLRv3Parser_terminal_return
terminal(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_terminal_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    CHAR_LITERAL135;
    pANTLR3_COMMON_TOKEN    TOKEN_REF137;
    pANTLR3_COMMON_TOKEN    ARG_ACTION138;
    pANTLR3_COMMON_TOKEN    STRING_LITERAL140;
    pANTLR3_COMMON_TOKEN    DOT_SYM142;
    pANTLR3_COMMON_TOKEN    ROOT_V3TOK144;
    pANTLR3_COMMON_TOKEN    BANG_V3TOK145;
    ANTLRv3Parser_elementOptions_return elementOptions136;
    #undef	RETURN_TYPE_elementOptions136
    #define	RETURN_TYPE_elementOptions136 ANTLRv3Parser_elementOptions_return

    ANTLRv3Parser_elementOptions_return elementOptions139;
    #undef	RETURN_TYPE_elementOptions139
    #define	RETURN_TYPE_elementOptions139 ANTLRv3Parser_elementOptions_return

    ANTLRv3Parser_elementOptions_return elementOptions141;
    #undef	RETURN_TYPE_elementOptions141
    #define	RETURN_TYPE_elementOptions141 ANTLRv3Parser_elementOptions_return

    ANTLRv3Parser_elementOptions_return elementOptions143;
    #undef	RETURN_TYPE_elementOptions143
    #define	RETURN_TYPE_elementOptions143 ANTLRv3Parser_elementOptions_return

    pANTLR3_BASE_TREE CHAR_LITERAL135_tree;
    pANTLR3_BASE_TREE TOKEN_REF137_tree;
    pANTLR3_BASE_TREE ARG_ACTION138_tree;
    pANTLR3_BASE_TREE STRING_LITERAL140_tree;
    pANTLR3_BASE_TREE DOT_SYM142_tree;
    pANTLR3_BASE_TREE ROOT_V3TOK144_tree;
    pANTLR3_BASE_TREE BANG_V3TOK145_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_ROOT_V3TOK;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_DOT_SYM;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_STRING_LITERAL;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_BANG_V3TOK;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_CHAR_LITERAL;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_TOKEN_REF;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_ARG_ACTION;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_elementOptions;
    /* Initialize rule variables
     */

    root_0 = NULL;

    CHAR_LITERAL135       = NULL;
    TOKEN_REF137       = NULL;
    ARG_ACTION138       = NULL;
    STRING_LITERAL140       = NULL;
    DOT_SYM142       = NULL;
    ROOT_V3TOK144       = NULL;
    BANG_V3TOK145       = NULL;
    elementOptions136.tree = NULL;

    elementOptions139.tree = NULL;

    elementOptions141.tree = NULL;

    elementOptions143.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    CHAR_LITERAL135_tree   = NULL;
    TOKEN_REF137_tree   = NULL;
    ARG_ACTION138_tree   = NULL;
    STRING_LITERAL140_tree   = NULL;
    DOT_SYM142_tree   = NULL;
    ROOT_V3TOK144_tree   = NULL;
    BANG_V3TOK145_tree   = NULL;

    stream_ROOT_V3TOK   = NULL;
    #define CREATE_stream_ROOT_V3TOK  if (stream_ROOT_V3TOK == NULL) {stream_ROOT_V3TOK = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token ROOT_V3TOK"); } 
    stream_DOT_SYM   = NULL;
    #define CREATE_stream_DOT_SYM  if (stream_DOT_SYM == NULL) {stream_DOT_SYM = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token DOT_SYM"); } 
    stream_STRING_LITERAL   = NULL;
    #define CREATE_stream_STRING_LITERAL  if (stream_STRING_LITERAL == NULL) {stream_STRING_LITERAL = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token STRING_LITERAL"); } 
    stream_BANG_V3TOK   = NULL;
    #define CREATE_stream_BANG_V3TOK  if (stream_BANG_V3TOK == NULL) {stream_BANG_V3TOK = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token BANG_V3TOK"); } 
    stream_CHAR_LITERAL   = NULL;
    #define CREATE_stream_CHAR_LITERAL  if (stream_CHAR_LITERAL == NULL) {stream_CHAR_LITERAL = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token CHAR_LITERAL"); } 
    stream_TOKEN_REF   = NULL;
    #define CREATE_stream_TOKEN_REF  if (stream_TOKEN_REF == NULL) {stream_TOKEN_REF = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token TOKEN_REF"); } 
    stream_ARG_ACTION   = NULL;
    #define CREATE_stream_ARG_ACTION  if (stream_ARG_ACTION == NULL) {stream_ARG_ACTION = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token ARG_ACTION"); } 
    stream_elementOptions   = NULL;
    #define CREATE_stream_elementOptions  if (stream_elementOptions == NULL) {stream_elementOptions = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule elementOptions"); }

    retval.tree  = NULL;

    {
        // ANTLRv3.g:336:9: ( ( CHAR_LITERAL ( elementOptions )? -> ^( CHAR_LITERAL ( elementOptions )? ) | TOKEN_REF ( ARG_ACTION )? ( elementOptions )? -> ^( TOKEN_REF ( ARG_ACTION )? ( elementOptions )? ) | STRING_LITERAL ( elementOptions )? -> ^( STRING_LITERAL ( elementOptions )? ) | DOT_SYM ( elementOptions )? -> ^( DOT_SYM ( elementOptions )? ) ) ( ROOT_V3TOK -> ^( ROOT_V3TOK $terminal) | BANG_V3TOK -> ^( BANG_V3TOK $terminal) )? )
        // ANTLRv3.g:337:2: ( CHAR_LITERAL ( elementOptions )? -> ^( CHAR_LITERAL ( elementOptions )? ) | TOKEN_REF ( ARG_ACTION )? ( elementOptions )? -> ^( TOKEN_REF ( ARG_ACTION )? ( elementOptions )? ) | STRING_LITERAL ( elementOptions )? -> ^( STRING_LITERAL ( elementOptions )? ) | DOT_SYM ( elementOptions )? -> ^( DOT_SYM ( elementOptions )? ) ) ( ROOT_V3TOK -> ^( ROOT_V3TOK $terminal) | BANG_V3TOK -> ^( BANG_V3TOK $terminal) )?
        {
            // ANTLRv3.g:337:2: ( CHAR_LITERAL ( elementOptions )? -> ^( CHAR_LITERAL ( elementOptions )? ) | TOKEN_REF ( ARG_ACTION )? ( elementOptions )? -> ^( TOKEN_REF ( ARG_ACTION )? ( elementOptions )? ) | STRING_LITERAL ( elementOptions )? -> ^( STRING_LITERAL ( elementOptions )? ) | DOT_SYM ( elementOptions )? -> ^( DOT_SYM ( elementOptions )? ) )
            {
                int alt67=4;
                switch ( LA(1) )
                {
                case CHAR_LITERAL:
                	{
                		alt67=1;
                	}
                    break;
                case TOKEN_REF:
                	{
                		alt67=2;
                	}
                    break;
                case STRING_LITERAL:
                	{
                		alt67=3;
                	}
                    break;
                case DOT_SYM:
                	{
                		alt67=4;
                	}
                    break;

                default:
                    if (BACKTRACKING>0)
                    {
                        FAILEDFLAG = ANTLR3_TRUE;
                        return retval;
                    }

                    CONSTRUCTEX();
                    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
                    EXCEPTION->message      = (void *)"";
                    EXCEPTION->decisionNum  = 67;
                    EXCEPTION->state        = 0;


                    goto ruleterminalEx;

                }

                switch (alt67)
                {
            	case 1:
            	    // ANTLRv3.g:338:3: CHAR_LITERAL ( elementOptions )?
            	    {
            	        CHAR_LITERAL135 = (pANTLR3_COMMON_TOKEN) MATCHT(CHAR_LITERAL, &FOLLOW_CHAR_LITERAL_in_terminal2178);
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleterminalEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }
            	         
            	        if ( BACKTRACKING==0 ) { CREATE_stream_CHAR_LITERAL; stream_CHAR_LITERAL->add(stream_CHAR_LITERAL, CHAR_LITERAL135, NULL); }


            	        // ANTLRv3.g:338:16: ( elementOptions )?
            	        {
            	            int alt62=2;
            	            switch ( LA(1) )
            	            {
            	                case 82:
            	                	{
            	                		alt62=1;
            	                	}
            	                    break;
            	            }

            	            switch (alt62)
            	            {
            	        	case 1:
            	        	    // ANTLRv3.g:338:16: elementOptions
            	        	    {
            	        	        FOLLOWPUSH(FOLLOW_elementOptions_in_terminal2180);
            	        	        elementOptions136=elementOptions(ctx);

            	        	        FOLLOWPOP();
            	        	        if  (HASEXCEPTION())
            	        	        {
            	        	            goto ruleterminalEx;
            	        	        }
            	        	        if (HASFAILED())
            	        	        {
            	        	            return retval;
            	        	        }

            	        	        if ( BACKTRACKING==0 ) { CREATE_stream_elementOptions; stream_elementOptions->add(stream_elementOptions, elementOptions136.tree, NULL); }

            	        	    }
            	        	    break;

            	            }
            	        }

            	        /* AST REWRITE
            	         * elements          : elementOptions, CHAR_LITERAL
            	         * token labels      : 
            	         * rule labels       : retval
            	         * token list labels : 
            	         * rule list labels  : 
            	         */
            	        if ( BACKTRACKING==0 ) 

            	        {
            	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	retval.tree    = root_0;
            	        	// 338:38: -> ^( CHAR_LITERAL ( elementOptions )? )
            	        	{
            	        	    // ANTLRv3.g:338:41: ^( CHAR_LITERAL ( elementOptions )? )
            	        	    {
            	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
            	        	        stream_CHAR_LITERAL == NULL ? NULL : stream_CHAR_LITERAL->nextNode(stream_CHAR_LITERAL)
            	        	        , root_1));

            	        	        // ANTLRv3.g:338:56: ( elementOptions )?
            	        	        {
            	        	        	if ( (stream_elementOptions != NULL && stream_elementOptions->hasNext(stream_elementOptions))  )
            	        	        	{
            	        	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_elementOptions == NULL ? NULL : stream_elementOptions->nextTree(stream_elementOptions));

            	        	        	}
            	        	        	if ( stream_elementOptions != NULL) stream_elementOptions->reset(stream_elementOptions);

            	        	        }

            	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	        	    }

            	        	}


            	        	retval.tree = root_0; // set result root
            	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


            	        }
            	    }
            	    break;
            	case 2:
            	    // ANTLRv3.g:340:5: TOKEN_REF ( ARG_ACTION )? ( elementOptions )?
            	    {
            	        TOKEN_REF137 = (pANTLR3_COMMON_TOKEN) MATCHT(TOKEN_REF, &FOLLOW_TOKEN_REF_in_terminal2209);
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleterminalEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }
            	         
            	        if ( BACKTRACKING==0 ) { CREATE_stream_TOKEN_REF; stream_TOKEN_REF->add(stream_TOKEN_REF, TOKEN_REF137, NULL); }


            	        // ANTLRv3.g:340:15: ( ARG_ACTION )?
            	        {
            	            int alt63=2;
            	            switch ( LA(1) )
            	            {
            	                case ARG_ACTION:
            	                	{
            	                		alt63=1;
            	                	}
            	                    break;
            	            }

            	            switch (alt63)
            	            {
            	        	case 1:
            	        	    // ANTLRv3.g:340:15: ARG_ACTION
            	        	    {
            	        	        ARG_ACTION138 = (pANTLR3_COMMON_TOKEN) MATCHT(ARG_ACTION, &FOLLOW_ARG_ACTION_in_terminal2211);
            	        	        if  (HASEXCEPTION())
            	        	        {
            	        	            goto ruleterminalEx;
            	        	        }
            	        	        if (HASFAILED())
            	        	        {
            	        	            return retval;
            	        	        }
            	        	         
            	        	        if ( BACKTRACKING==0 ) { CREATE_stream_ARG_ACTION; stream_ARG_ACTION->add(stream_ARG_ACTION, ARG_ACTION138, NULL); }


            	        	    }
            	        	    break;

            	            }
            	        }

            	        // ANTLRv3.g:340:27: ( elementOptions )?
            	        {
            	            int alt64=2;
            	            switch ( LA(1) )
            	            {
            	                case 82:
            	                	{
            	                		alt64=1;
            	                	}
            	                    break;
            	            }

            	            switch (alt64)
            	            {
            	        	case 1:
            	        	    // ANTLRv3.g:340:27: elementOptions
            	        	    {
            	        	        FOLLOWPUSH(FOLLOW_elementOptions_in_terminal2214);
            	        	        elementOptions139=elementOptions(ctx);

            	        	        FOLLOWPOP();
            	        	        if  (HASEXCEPTION())
            	        	        {
            	        	            goto ruleterminalEx;
            	        	        }
            	        	        if (HASFAILED())
            	        	        {
            	        	            return retval;
            	        	        }

            	        	        if ( BACKTRACKING==0 ) { CREATE_stream_elementOptions; stream_elementOptions->add(stream_elementOptions, elementOptions139.tree, NULL); }

            	        	    }
            	        	    break;

            	            }
            	        }

            	        /* AST REWRITE
            	         * elements          : TOKEN_REF, elementOptions, ARG_ACTION
            	         * token labels      : 
            	         * rule labels       : retval
            	         * token list labels : 
            	         * rule list labels  : 
            	         */
            	        if ( BACKTRACKING==0 ) 

            	        {
            	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	retval.tree    = root_0;
            	        	// 340:43: -> ^( TOKEN_REF ( ARG_ACTION )? ( elementOptions )? )
            	        	{
            	        	    // ANTLRv3.g:340:46: ^( TOKEN_REF ( ARG_ACTION )? ( elementOptions )? )
            	        	    {
            	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
            	        	        stream_TOKEN_REF == NULL ? NULL : stream_TOKEN_REF->nextNode(stream_TOKEN_REF)
            	        	        , root_1));

            	        	        // ANTLRv3.g:340:58: ( ARG_ACTION )?
            	        	        {
            	        	        	if ( (stream_ARG_ACTION != NULL && stream_ARG_ACTION->hasNext(stream_ARG_ACTION))  )
            	        	        	{
            	        	        		ADAPTOR->addChild(ADAPTOR, root_1, 
            	        	        		stream_ARG_ACTION == NULL ? NULL : stream_ARG_ACTION->nextNode(stream_ARG_ACTION)
            	        	        		);

            	        	        	}
            	        	        	if ( stream_ARG_ACTION != NULL) stream_ARG_ACTION->reset(stream_ARG_ACTION);

            	        	        }

            	        	        // ANTLRv3.g:340:70: ( elementOptions )?
            	        	        {
            	        	        	if ( (stream_elementOptions != NULL && stream_elementOptions->hasNext(stream_elementOptions))  )
            	        	        	{
            	        	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_elementOptions == NULL ? NULL : stream_elementOptions->nextTree(stream_elementOptions));

            	        	        	}
            	        	        	if ( stream_elementOptions != NULL) stream_elementOptions->reset(stream_elementOptions);

            	        	        }

            	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	        	    }

            	        	}


            	        	retval.tree = root_0; // set result root
            	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


            	        }
            	    }
            	    break;
            	case 3:
            	    // ANTLRv3.g:341:5: STRING_LITERAL ( elementOptions )?
            	    {
            	        STRING_LITERAL140 = (pANTLR3_COMMON_TOKEN) MATCHT(STRING_LITERAL, &FOLLOW_STRING_LITERAL_in_terminal2233);
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleterminalEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }
            	         
            	        if ( BACKTRACKING==0 ) { CREATE_stream_STRING_LITERAL; stream_STRING_LITERAL->add(stream_STRING_LITERAL, STRING_LITERAL140, NULL); }


            	        // ANTLRv3.g:341:20: ( elementOptions )?
            	        {
            	            int alt65=2;
            	            switch ( LA(1) )
            	            {
            	                case 82:
            	                	{
            	                		alt65=1;
            	                	}
            	                    break;
            	            }

            	            switch (alt65)
            	            {
            	        	case 1:
            	        	    // ANTLRv3.g:341:20: elementOptions
            	        	    {
            	        	        FOLLOWPUSH(FOLLOW_elementOptions_in_terminal2235);
            	        	        elementOptions141=elementOptions(ctx);

            	        	        FOLLOWPOP();
            	        	        if  (HASEXCEPTION())
            	        	        {
            	        	            goto ruleterminalEx;
            	        	        }
            	        	        if (HASFAILED())
            	        	        {
            	        	            return retval;
            	        	        }

            	        	        if ( BACKTRACKING==0 ) { CREATE_stream_elementOptions; stream_elementOptions->add(stream_elementOptions, elementOptions141.tree, NULL); }

            	        	    }
            	        	    break;

            	            }
            	        }

            	        /* AST REWRITE
            	         * elements          : STRING_LITERAL, elementOptions
            	         * token labels      : 
            	         * rule labels       : retval
            	         * token list labels : 
            	         * rule list labels  : 
            	         */
            	        if ( BACKTRACKING==0 ) 

            	        {
            	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	retval.tree    = root_0;
            	        	// 341:39: -> ^( STRING_LITERAL ( elementOptions )? )
            	        	{
            	        	    // ANTLRv3.g:341:42: ^( STRING_LITERAL ( elementOptions )? )
            	        	    {
            	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
            	        	        stream_STRING_LITERAL == NULL ? NULL : stream_STRING_LITERAL->nextNode(stream_STRING_LITERAL)
            	        	        , root_1));

            	        	        // ANTLRv3.g:341:59: ( elementOptions )?
            	        	        {
            	        	        	if ( (stream_elementOptions != NULL && stream_elementOptions->hasNext(stream_elementOptions))  )
            	        	        	{
            	        	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_elementOptions == NULL ? NULL : stream_elementOptions->nextTree(stream_elementOptions));

            	        	        	}
            	        	        	if ( stream_elementOptions != NULL) stream_elementOptions->reset(stream_elementOptions);

            	        	        }

            	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	        	    }

            	        	}


            	        	retval.tree = root_0; // set result root
            	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


            	        }
            	    }
            	    break;
            	case 4:
            	    // ANTLRv3.g:342:5: DOT_SYM ( elementOptions )?
            	    {
            	        DOT_SYM142 = (pANTLR3_COMMON_TOKEN) MATCHT(DOT_SYM, &FOLLOW_DOT_SYM_in_terminal2254);
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleterminalEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }
            	         
            	        if ( BACKTRACKING==0 ) { CREATE_stream_DOT_SYM; stream_DOT_SYM->add(stream_DOT_SYM, DOT_SYM142, NULL); }


            	        // ANTLRv3.g:342:13: ( elementOptions )?
            	        {
            	            int alt66=2;
            	            switch ( LA(1) )
            	            {
            	                case 82:
            	                	{
            	                		alt66=1;
            	                	}
            	                    break;
            	            }

            	            switch (alt66)
            	            {
            	        	case 1:
            	        	    // ANTLRv3.g:342:13: elementOptions
            	        	    {
            	        	        FOLLOWPUSH(FOLLOW_elementOptions_in_terminal2256);
            	        	        elementOptions143=elementOptions(ctx);

            	        	        FOLLOWPOP();
            	        	        if  (HASEXCEPTION())
            	        	        {
            	        	            goto ruleterminalEx;
            	        	        }
            	        	        if (HASFAILED())
            	        	        {
            	        	            return retval;
            	        	        }

            	        	        if ( BACKTRACKING==0 ) { CREATE_stream_elementOptions; stream_elementOptions->add(stream_elementOptions, elementOptions143.tree, NULL); }

            	        	    }
            	        	    break;

            	            }
            	        }

            	        /* AST REWRITE
            	         * elements          : elementOptions, DOT_SYM
            	         * token labels      : 
            	         * rule labels       : retval
            	         * token list labels : 
            	         * rule list labels  : 
            	         */
            	        if ( BACKTRACKING==0 ) 

            	        {
            	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	retval.tree    = root_0;
            	        	// 342:36: -> ^( DOT_SYM ( elementOptions )? )
            	        	{
            	        	    // ANTLRv3.g:342:39: ^( DOT_SYM ( elementOptions )? )
            	        	    {
            	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
            	        	        stream_DOT_SYM == NULL ? NULL : stream_DOT_SYM->nextNode(stream_DOT_SYM)
            	        	        , root_1));

            	        	        // ANTLRv3.g:342:49: ( elementOptions )?
            	        	        {
            	        	        	if ( (stream_elementOptions != NULL && stream_elementOptions->hasNext(stream_elementOptions))  )
            	        	        	{
            	        	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_elementOptions == NULL ? NULL : stream_elementOptions->nextTree(stream_elementOptions));

            	        	        	}
            	        	        	if ( stream_elementOptions != NULL) stream_elementOptions->reset(stream_elementOptions);

            	        	        }

            	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	        	    }

            	        	}


            	        	retval.tree = root_0; // set result root
            	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


            	        }
            	    }
            	    break;

                }
            }

            // ANTLRv3.g:344:2: ( ROOT_V3TOK -> ^( ROOT_V3TOK $terminal) | BANG_V3TOK -> ^( BANG_V3TOK $terminal) )?
            {
                int alt68=3;
                switch ( LA(1) )
                {
                    case ROOT_V3TOK:
                    	{
                    		alt68=1;
                    	}
                        break;
                    case BANG_V3TOK:
                    	{
                    		alt68=2;
                    	}
                        break;
                }

                switch (alt68)
                {
            	case 1:
            	    // ANTLRv3.g:345:3: ROOT_V3TOK
            	    {
            	        ROOT_V3TOK144 = (pANTLR3_COMMON_TOKEN) MATCHT(ROOT_V3TOK, &FOLLOW_ROOT_V3TOK_in_terminal2283);
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleterminalEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }
            	         
            	        if ( BACKTRACKING==0 ) { CREATE_stream_ROOT_V3TOK; stream_ROOT_V3TOK->add(stream_ROOT_V3TOK, ROOT_V3TOK144, NULL); }


            	        /* AST REWRITE
            	         * elements          : ROOT_V3TOK, terminal
            	         * token labels      : 
            	         * rule labels       : retval
            	         * token list labels : 
            	         * rule list labels  : 
            	         */
            	        if ( BACKTRACKING==0 ) 

            	        {
            	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	retval.tree    = root_0;
            	        	// 345:14: -> ^( ROOT_V3TOK $terminal)
            	        	{
            	        	    // ANTLRv3.g:345:17: ^( ROOT_V3TOK $terminal)
            	        	    {
            	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
            	        	        stream_ROOT_V3TOK == NULL ? NULL : stream_ROOT_V3TOK->nextNode(stream_ROOT_V3TOK)
            	        	        , root_1));

            	        	        ADAPTOR->addChild(ADAPTOR, root_1, stream_retval == NULL ? NULL : stream_retval->nextTree(stream_retval));

            	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	        	    }

            	        	}


            	        	retval.tree = root_0; // set result root
            	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


            	        }
            	    }
            	    break;
            	case 2:
            	    // ANTLRv3.g:346:5: BANG_V3TOK
            	    {
            	        BANG_V3TOK145 = (pANTLR3_COMMON_TOKEN) MATCHT(BANG_V3TOK, &FOLLOW_BANG_V3TOK_in_terminal2298);
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleterminalEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }
            	         
            	        if ( BACKTRACKING==0 ) { CREATE_stream_BANG_V3TOK; stream_BANG_V3TOK->add(stream_BANG_V3TOK, BANG_V3TOK145, NULL); }


            	        /* AST REWRITE
            	         * elements          : terminal, BANG_V3TOK
            	         * token labels      : 
            	         * rule labels       : retval
            	         * token list labels : 
            	         * rule list labels  : 
            	         */
            	        if ( BACKTRACKING==0 ) 

            	        {
            	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	retval.tree    = root_0;
            	        	// 346:16: -> ^( BANG_V3TOK $terminal)
            	        	{
            	        	    // ANTLRv3.g:346:19: ^( BANG_V3TOK $terminal)
            	        	    {
            	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
            	        	        stream_BANG_V3TOK == NULL ? NULL : stream_BANG_V3TOK->nextNode(stream_BANG_V3TOK)
            	        	        , root_1));

            	        	        ADAPTOR->addChild(ADAPTOR, root_1, stream_retval == NULL ? NULL : stream_retval->nextTree(stream_retval));

            	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	        	    }

            	        	}


            	        	retval.tree = root_0; // set result root
            	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


            	        }
            	    }
            	    break;

                }
            }

        }

    }

    // This is where rules clean up and exit
    //
    goto ruleterminalEx; /* Prevent compiler warnings */
    ruleterminalEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_ROOT_V3TOK != NULL) stream_ROOT_V3TOK->free(stream_ROOT_V3TOK);
        if (stream_DOT_SYM != NULL) stream_DOT_SYM->free(stream_DOT_SYM);
        if (stream_STRING_LITERAL != NULL) stream_STRING_LITERAL->free(stream_STRING_LITERAL);
        if (stream_BANG_V3TOK != NULL) stream_BANG_V3TOK->free(stream_BANG_V3TOK);
        if (stream_CHAR_LITERAL != NULL) stream_CHAR_LITERAL->free(stream_CHAR_LITERAL);
        if (stream_TOKEN_REF != NULL) stream_TOKEN_REF->free(stream_TOKEN_REF);
        if (stream_ARG_ACTION != NULL) stream_ARG_ACTION->free(stream_ARG_ACTION);
        if (stream_elementOptions != NULL) stream_elementOptions->free(stream_elementOptions);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end terminal */

/**
 * $ANTLR start ebnf
 * ANTLRv3.g:351:1: ebnf : block (op= '?' -> ^( OPTIONAL_V3TOK[op] block ) |op= '*' -> ^( CLOSURE_V3TOK[op] block ) |op= '+' -> ^( POSITIVE_CLOSURE_V3TOK[op] block ) | '=>' -> { gtype == COMBINED_GRAMMAR_V3TOK && isupper($rule::name->charAt($rule::name, 0)) }? ^( SYNPRED_V3TOK[\"=>\"] block ) -> SYN_SEMPRED_V3TOK | -> block ) ( ROOT_V3TOK -> ^( ROOT_V3TOK $ebnf) | BANG_V3TOK -> ^( BANG_V3TOK $ebnf) )? ;
 */
static ANTLRv3Parser_ebnf_return
ebnf(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_ebnf_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    op;
    pANTLR3_COMMON_TOKEN    string_literal147;
    pANTLR3_COMMON_TOKEN    ROOT_V3TOK148;
    pANTLR3_COMMON_TOKEN    BANG_V3TOK149;
    ANTLRv3Parser_block_return block146;
    #undef	RETURN_TYPE_block146
    #define	RETURN_TYPE_block146 ANTLRv3Parser_block_return

    pANTLR3_BASE_TREE op_tree;
    pANTLR3_BASE_TREE string_literal147_tree;
    pANTLR3_BASE_TREE ROOT_V3TOK148_tree;
    pANTLR3_BASE_TREE BANG_V3TOK149_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_ROOT_V3TOK;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_77;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_BANG_V3TOK;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_83;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_76;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_85;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_block;
    /* Initialize rule variables
     */

    root_0 = NULL;


        pANTLR3_COMMON_TOKEN firstToken = LT(1);

    op       = NULL;
    string_literal147       = NULL;
    ROOT_V3TOK148       = NULL;
    BANG_V3TOK149       = NULL;
    block146.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    op_tree   = NULL;
    string_literal147_tree   = NULL;
    ROOT_V3TOK148_tree   = NULL;
    BANG_V3TOK149_tree   = NULL;

    stream_ROOT_V3TOK   = NULL;
    #define CREATE_stream_ROOT_V3TOK  if (stream_ROOT_V3TOK == NULL) {stream_ROOT_V3TOK = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token ROOT_V3TOK"); } 
    stream_77   = NULL;
    #define CREATE_stream_77  if (stream_77 == NULL) {stream_77 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 77"); } 
    stream_BANG_V3TOK   = NULL;
    #define CREATE_stream_BANG_V3TOK  if (stream_BANG_V3TOK == NULL) {stream_BANG_V3TOK = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token BANG_V3TOK"); } 
    stream_83   = NULL;
    #define CREATE_stream_83  if (stream_83 == NULL) {stream_83 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 83"); } 
    stream_76   = NULL;
    #define CREATE_stream_76  if (stream_76 == NULL) {stream_76 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 76"); } 
    stream_85   = NULL;
    #define CREATE_stream_85  if (stream_85 == NULL) {stream_85 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 85"); } 
    stream_block   = NULL;
    #define CREATE_stream_block  if (stream_block == NULL) {stream_block = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule block"); }

    retval.tree  = NULL;

    {
        // ANTLRv3.g:359:2: ( block (op= '?' -> ^( OPTIONAL_V3TOK[op] block ) |op= '*' -> ^( CLOSURE_V3TOK[op] block ) |op= '+' -> ^( POSITIVE_CLOSURE_V3TOK[op] block ) | '=>' -> { gtype == COMBINED_GRAMMAR_V3TOK && isupper($rule::name->charAt($rule::name, 0)) }? ^( SYNPRED_V3TOK[\"=>\"] block ) -> SYN_SEMPRED_V3TOK | -> block ) ( ROOT_V3TOK -> ^( ROOT_V3TOK $ebnf) | BANG_V3TOK -> ^( BANG_V3TOK $ebnf) )? )
        // ANTLRv3.g:360:2: block (op= '?' -> ^( OPTIONAL_V3TOK[op] block ) |op= '*' -> ^( CLOSURE_V3TOK[op] block ) |op= '+' -> ^( POSITIVE_CLOSURE_V3TOK[op] block ) | '=>' -> { gtype == COMBINED_GRAMMAR_V3TOK && isupper($rule::name->charAt($rule::name, 0)) }? ^( SYNPRED_V3TOK[\"=>\"] block ) -> SYN_SEMPRED_V3TOK | -> block ) ( ROOT_V3TOK -> ^( ROOT_V3TOK $ebnf) | BANG_V3TOK -> ^( BANG_V3TOK $ebnf) )?
        {
            FOLLOWPUSH(FOLLOW_block_in_ebnf2332);
            block146=block(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto ruleebnfEx;
            }
            if (HASFAILED())
            {
                return retval;
            }

            if ( BACKTRACKING==0 ) { CREATE_stream_block; stream_block->add(stream_block, block146.tree, NULL); }

            // ANTLRv3.g:361:2: (op= '?' -> ^( OPTIONAL_V3TOK[op] block ) |op= '*' -> ^( CLOSURE_V3TOK[op] block ) |op= '+' -> ^( POSITIVE_CLOSURE_V3TOK[op] block ) | '=>' -> { gtype == COMBINED_GRAMMAR_V3TOK && isupper($rule::name->charAt($rule::name, 0)) }? ^( SYNPRED_V3TOK[\"=>\"] block ) -> SYN_SEMPRED_V3TOK | -> block )
            {
                int alt69=5;
                switch ( LA(1) )
                {
                case 85:
                	{
                		alt69=1;
                	}
                    break;
                case 76:
                	{
                		alt69=2;
                	}
                    break;
                case 77:
                	{
                		alt69=3;
                	}
                    break;
                case 83:
                	{
                		alt69=4;
                	}
                    break;
                case EOF:
                case ACTION:
                case BANG_V3TOK:
                case CHAR_LITERAL:
                case DOT_SYM:
                case REWRITE_V3TOK:
                case ROOT_V3TOK:
                case RULE_REF:
                case SEMPRED_V3TOK:
                case STRING_LITERAL:
                case TOKEN_REF:
                case TREE_BEGIN_V3TOK:
                case 74:
                case 75:
                case 81:
                case 94:
                case 96:
                	{
                		alt69=5;
                	}
                    break;

                default:
                    if (BACKTRACKING>0)
                    {
                        FAILEDFLAG = ANTLR3_TRUE;
                        return retval;
                    }

                    CONSTRUCTEX();
                    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
                    EXCEPTION->message      = (void *)"";
                    EXCEPTION->decisionNum  = 69;
                    EXCEPTION->state        = 0;


                    goto ruleebnfEx;

                }

                switch (alt69)
                {
            	case 1:
            	    // ANTLRv3.g:362:3: op= '?'
            	    {
            	        op = (pANTLR3_COMMON_TOKEN) MATCHT(85, &FOLLOW_85_in_ebnf2341);
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleebnfEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }
            	         
            	        if ( BACKTRACKING==0 ) { CREATE_stream_85; stream_85->add(stream_85, op, NULL); }


            	        /* AST REWRITE
            	         * elements          : block
            	         * token labels      : 
            	         * rule labels       : retval
            	         * token list labels : 
            	         * rule list labels  : 
            	         */
            	        if ( BACKTRACKING==0 ) 

            	        {
            	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	retval.tree    = root_0;
            	        	// 362:10: -> ^( OPTIONAL_V3TOK[op] block )
            	        	{
            	        	    // ANTLRv3.g:362:13: ^( OPTIONAL_V3TOK[op] block )
            	        	    {
            	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 

            	        	        #if 1 == 2
            	        	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, OPTIONAL_V3TOK, TOKTEXT(op))
            	        	        #else
            	        	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, OPTIONAL_V3TOK, (pANTLR3_UINT8)op)
            	        	        #endif

            	        	        , root_1));

            	        	        ADAPTOR->addChild(ADAPTOR, root_1, stream_block == NULL ? NULL : stream_block->nextTree(stream_block));

            	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	        	    }

            	        	}


            	        	retval.tree = root_0; // set result root
            	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


            	        }
            	    }
            	    break;
            	case 2:
            	    // ANTLRv3.g:363:5: op= '*'
            	    {
            	        op = (pANTLR3_COMMON_TOKEN) MATCHT(76, &FOLLOW_76_in_ebnf2358);
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleebnfEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }
            	         
            	        if ( BACKTRACKING==0 ) { CREATE_stream_76; stream_76->add(stream_76, op, NULL); }


            	        /* AST REWRITE
            	         * elements          : block
            	         * token labels      : 
            	         * rule labels       : retval
            	         * token list labels : 
            	         * rule list labels  : 
            	         */
            	        if ( BACKTRACKING==0 ) 

            	        {
            	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	retval.tree    = root_0;
            	        	// 363:12: -> ^( CLOSURE_V3TOK[op] block )
            	        	{
            	        	    // ANTLRv3.g:363:15: ^( CLOSURE_V3TOK[op] block )
            	        	    {
            	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 

            	        	        #if 1 == 2
            	        	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, CLOSURE_V3TOK, TOKTEXT(op))
            	        	        #else
            	        	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, CLOSURE_V3TOK, (pANTLR3_UINT8)op)
            	        	        #endif

            	        	        , root_1));

            	        	        ADAPTOR->addChild(ADAPTOR, root_1, stream_block == NULL ? NULL : stream_block->nextTree(stream_block));

            	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	        	    }

            	        	}


            	        	retval.tree = root_0; // set result root
            	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


            	        }
            	    }
            	    break;
            	case 3:
            	    // ANTLRv3.g:364:5: op= '+'
            	    {
            	        op = (pANTLR3_COMMON_TOKEN) MATCHT(77, &FOLLOW_77_in_ebnf2375);
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleebnfEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }
            	         
            	        if ( BACKTRACKING==0 ) { CREATE_stream_77; stream_77->add(stream_77, op, NULL); }


            	        /* AST REWRITE
            	         * elements          : block
            	         * token labels      : 
            	         * rule labels       : retval
            	         * token list labels : 
            	         * rule list labels  : 
            	         */
            	        if ( BACKTRACKING==0 ) 

            	        {
            	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	retval.tree    = root_0;
            	        	// 364:12: -> ^( POSITIVE_CLOSURE_V3TOK[op] block )
            	        	{
            	        	    // ANTLRv3.g:364:15: ^( POSITIVE_CLOSURE_V3TOK[op] block )
            	        	    {
            	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 

            	        	        #if 1 == 2
            	        	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, POSITIVE_CLOSURE_V3TOK, TOKTEXT(op))
            	        	        #else
            	        	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, POSITIVE_CLOSURE_V3TOK, (pANTLR3_UINT8)op)
            	        	        #endif

            	        	        , root_1));

            	        	        ADAPTOR->addChild(ADAPTOR, root_1, stream_block == NULL ? NULL : stream_block->nextTree(stream_block));

            	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	        	    }

            	        	}


            	        	retval.tree = root_0; // set result root
            	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


            	        }
            	    }
            	    break;
            	case 4:
            	    // ANTLRv3.g:365:7: '=>'
            	    {
            	        string_literal147 = (pANTLR3_COMMON_TOKEN) MATCHT(83, &FOLLOW_83_in_ebnf2392);
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleebnfEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }
            	         
            	        if ( BACKTRACKING==0 ) { CREATE_stream_83; stream_83->add(stream_83, string_literal147, NULL); }


            	        /* AST REWRITE
            	         * elements          : block
            	         * token labels      : 
            	         * rule labels       : retval
            	         * token list labels : 
            	         * rule list labels  : 
            	         */
            	        if ( BACKTRACKING==0 ) 

            	        {
            	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	retval.tree    = root_0;
            	        	// 366:6: -> { gtype == COMBINED_GRAMMAR_V3TOK && isupper($rule::name->charAt($rule::name, 0)) }? ^( SYNPRED_V3TOK[\"=>\"] block )
            	        	if ( gtype == COMBINED_GRAMMAR_V3TOK && isupper((SCOPE_TOP(rule))->name->charAt((SCOPE_TOP(rule))->name, 0)) )
            	        	{
            	        	    // ANTLRv3.g:368:9: ^( SYNPRED_V3TOK[\"=>\"] block )
            	        	    {
            	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 

            	        	        #if 1 == 2
            	        	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, SYNPRED_V3TOK, TOKTEXT("=>"))
            	        	        #else
            	        	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, SYNPRED_V3TOK, (pANTLR3_UINT8)"=>")
            	        	        #endif

            	        	        , root_1));

            	        	        ADAPTOR->addChild(ADAPTOR, root_1, stream_block == NULL ? NULL : stream_block->nextTree(stream_block));

            	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	        	    }

            	        	}

            	        	else // 369:6: -> SYN_SEMPRED_V3TOK
            	        	{
            	        	    ADAPTOR->addChild(ADAPTOR, root_0, 
            	        	    (pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, SYN_SEMPRED_V3TOK, (pANTLR3_UINT8)"SYN_SEMPRED_V3TOK")
            	        	    );

            	        	}


            	        	retval.tree = root_0; // set result root
            	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


            	        }
            	    }
            	    break;
            	case 5:
            	    // ANTLRv3.g:370:11: 
            	    {
            	        /* AST REWRITE
            	         * elements          : block
            	         * token labels      : 
            	         * rule labels       : retval
            	         * token list labels : 
            	         * rule list labels  : 
            	         */
            	        if ( BACKTRACKING==0 ) 

            	        {
            	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	retval.tree    = root_0;
            	        	// 370:11: -> block
            	        	{
            	        	    ADAPTOR->addChild(ADAPTOR, root_0, stream_block == NULL ? NULL : stream_block->nextTree(stream_block));

            	        	}


            	        	retval.tree = root_0; // set result root
            	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


            	        }
            	    }
            	    break;

                }
            }

            // ANTLRv3.g:372:2: ( ROOT_V3TOK -> ^( ROOT_V3TOK $ebnf) | BANG_V3TOK -> ^( BANG_V3TOK $ebnf) )?
            {
                int alt70=3;
                switch ( LA(1) )
                {
                    case ROOT_V3TOK:
                    	{
                    		alt70=1;
                    	}
                        break;
                    case BANG_V3TOK:
                    	{
                    		alt70=2;
                    	}
                        break;
                }

                switch (alt70)
                {
            	case 1:
            	    // ANTLRv3.g:373:3: ROOT_V3TOK
            	    {
            	        ROOT_V3TOK148 = (pANTLR3_COMMON_TOKEN) MATCHT(ROOT_V3TOK, &FOLLOW_ROOT_V3TOK_in_ebnf2459);
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleebnfEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }
            	         
            	        if ( BACKTRACKING==0 ) { CREATE_stream_ROOT_V3TOK; stream_ROOT_V3TOK->add(stream_ROOT_V3TOK, ROOT_V3TOK148, NULL); }


            	        /* AST REWRITE
            	         * elements          : ebnf, ROOT_V3TOK
            	         * token labels      : 
            	         * rule labels       : retval
            	         * token list labels : 
            	         * rule list labels  : 
            	         */
            	        if ( BACKTRACKING==0 ) 

            	        {
            	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	retval.tree    = root_0;
            	        	// 373:14: -> ^( ROOT_V3TOK $ebnf)
            	        	{
            	        	    // ANTLRv3.g:373:17: ^( ROOT_V3TOK $ebnf)
            	        	    {
            	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
            	        	        stream_ROOT_V3TOK == NULL ? NULL : stream_ROOT_V3TOK->nextNode(stream_ROOT_V3TOK)
            	        	        , root_1));

            	        	        ADAPTOR->addChild(ADAPTOR, root_1, stream_retval == NULL ? NULL : stream_retval->nextTree(stream_retval));

            	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	        	    }

            	        	}


            	        	retval.tree = root_0; // set result root
            	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


            	        }
            	    }
            	    break;
            	case 2:
            	    // ANTLRv3.g:374:5: BANG_V3TOK
            	    {
            	        BANG_V3TOK149 = (pANTLR3_COMMON_TOKEN) MATCHT(BANG_V3TOK, &FOLLOW_BANG_V3TOK_in_ebnf2474);
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleebnfEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }
            	         
            	        if ( BACKTRACKING==0 ) { CREATE_stream_BANG_V3TOK; stream_BANG_V3TOK->add(stream_BANG_V3TOK, BANG_V3TOK149, NULL); }


            	        /* AST REWRITE
            	         * elements          : BANG_V3TOK, ebnf
            	         * token labels      : 
            	         * rule labels       : retval
            	         * token list labels : 
            	         * rule list labels  : 
            	         */
            	        if ( BACKTRACKING==0 ) 

            	        {
            	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	retval.tree    = root_0;
            	        	// 374:16: -> ^( BANG_V3TOK $ebnf)
            	        	{
            	        	    // ANTLRv3.g:374:19: ^( BANG_V3TOK $ebnf)
            	        	    {
            	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
            	        	        stream_BANG_V3TOK == NULL ? NULL : stream_BANG_V3TOK->nextNode(stream_BANG_V3TOK)
            	        	        , root_1));

            	        	        ADAPTOR->addChild(ADAPTOR, root_1, stream_retval == NULL ? NULL : stream_retval->nextTree(stream_retval));

            	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	        	    }

            	        	}


            	        	retval.tree = root_0; // set result root
            	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


            	        }
            	    }
            	    break;

                }
            }

        }

    }

    // This is where rules clean up and exit
    //
    goto ruleebnfEx; /* Prevent compiler warnings */
    ruleebnfEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_ROOT_V3TOK != NULL) stream_ROOT_V3TOK->free(stream_ROOT_V3TOK);
        if (stream_77 != NULL) stream_77->free(stream_77);
        if (stream_BANG_V3TOK != NULL) stream_BANG_V3TOK->free(stream_BANG_V3TOK);
        if (stream_83 != NULL) stream_83->free(stream_83);
        if (stream_76 != NULL) stream_76->free(stream_76);
        if (stream_85 != NULL) stream_85->free(stream_85);
        if (stream_block != NULL) stream_block->free(stream_block);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
            else
            {
                {

                    	pANTLR3_COMMON_TOKEN token = retval.tree->getToken(retval.tree);
                    	token->setLine(token, firstToken->getLine(firstToken));
                    	token->setCharPositionInLine(token, firstToken->getCharPositionInLine(firstToken));

                }
            }


    return retval;
}
/* $ANTLR end ebnf */

/**
 * $ANTLR start ebnfSuffix
 * ANTLRv3.g:378:1: ebnfSuffix : ( '?' -> OPTIONAL_V3TOK[op] | '*' -> CLOSURE_V3TOK[op] | '+' -> POSITIVE_CLOSURE_V3TOK[op] );
 */
static ANTLRv3Parser_ebnfSuffix_return
ebnfSuffix(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_ebnfSuffix_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    char_literal150;
    pANTLR3_COMMON_TOKEN    char_literal151;
    pANTLR3_COMMON_TOKEN    char_literal152;

    pANTLR3_BASE_TREE char_literal150_tree;
    pANTLR3_BASE_TREE char_literal151_tree;
    pANTLR3_BASE_TREE char_literal152_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_77;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_76;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_85;

    /* Initialize rule variables
     */

    root_0 = NULL;


    	pANTLR3_COMMON_TOKEN op = LT(1);

    char_literal150       = NULL;
    char_literal151       = NULL;
    char_literal152       = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    char_literal150_tree   = NULL;
    char_literal151_tree   = NULL;
    char_literal152_tree   = NULL;

    stream_77   = NULL;
    #define CREATE_stream_77  if (stream_77 == NULL) {stream_77 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 77"); } 
    stream_76   = NULL;
    #define CREATE_stream_76  if (stream_76 == NULL) {stream_76 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 76"); } 
    stream_85   = NULL;
    #define CREATE_stream_85  if (stream_85 == NULL) {stream_85 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 85"); } 

    retval.tree  = NULL;

    {
        {
            //  ANTLRv3.g:382:2: ( '?' -> OPTIONAL_V3TOK[op] | '*' -> CLOSURE_V3TOK[op] | '+' -> POSITIVE_CLOSURE_V3TOK[op] )

            ANTLR3_UINT32 alt71;

            alt71=3;

            switch ( LA(1) )
            {
            case 85:
            	{
            		alt71=1;
            	}
                break;
            case 76:
            	{
            		alt71=2;
            	}
                break;
            case 77:
            	{
            		alt71=3;
            	}
                break;

            default:
                if (BACKTRACKING>0)
                {
                    FAILEDFLAG = ANTLR3_TRUE;
                    return retval;
                }

                CONSTRUCTEX();
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
                EXCEPTION->message      = (void *)"";
                EXCEPTION->decisionNum  = 71;
                EXCEPTION->state        = 0;


                goto ruleebnfSuffixEx;

            }

            switch (alt71)
            {
        	case 1:
        	    // ANTLRv3.g:382:4: '?'
        	    {
        	        char_literal150 = (pANTLR3_COMMON_TOKEN) MATCHT(85, &FOLLOW_85_in_ebnfSuffix2502);
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleebnfSuffixEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }
        	         
        	        if ( BACKTRACKING==0 ) { CREATE_stream_85; stream_85->add(stream_85, char_literal150, NULL); }


        	        /* AST REWRITE
        	         * elements          : 
        	         * token labels      : 
        	         * rule labels       : retval
        	         * token list labels : 
        	         * rule list labels  : 
        	         */
        	        if ( BACKTRACKING==0 ) 

        	        {
        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	retval.tree    = root_0;
        	        	// 382:8: -> OPTIONAL_V3TOK[op]
        	        	{
        	        	    ADAPTOR->addChild(ADAPTOR, root_0, 

        	        	    #if 1 == 2
        	        	    	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, OPTIONAL_V3TOK, TOKTEXT(op))
        	        	    #else
        	        	    	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, OPTIONAL_V3TOK, (pANTLR3_UINT8)op)
        	        	    #endif

        	        	    );

        	        	}


        	        	retval.tree = root_0; // set result root
        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        }
        	    }
        	    break;
        	case 2:
        	    // ANTLRv3.g:383:6: '*'
        	    {
        	        char_literal151 = (pANTLR3_COMMON_TOKEN) MATCHT(76, &FOLLOW_76_in_ebnfSuffix2514);
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleebnfSuffixEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }
        	         
        	        if ( BACKTRACKING==0 ) { CREATE_stream_76; stream_76->add(stream_76, char_literal151, NULL); }


        	        /* AST REWRITE
        	         * elements          : 
        	         * token labels      : 
        	         * rule labels       : retval
        	         * token list labels : 
        	         * rule list labels  : 
        	         */
        	        if ( BACKTRACKING==0 ) 

        	        {
        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	retval.tree    = root_0;
        	        	// 383:10: -> CLOSURE_V3TOK[op]
        	        	{
        	        	    ADAPTOR->addChild(ADAPTOR, root_0, 

        	        	    #if 1 == 2
        	        	    	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, CLOSURE_V3TOK, TOKTEXT(op))
        	        	    #else
        	        	    	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, CLOSURE_V3TOK, (pANTLR3_UINT8)op)
        	        	    #endif

        	        	    );

        	        	}


        	        	retval.tree = root_0; // set result root
        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        }
        	    }
        	    break;
        	case 3:
        	    // ANTLRv3.g:384:7: '+'
        	    {
        	        char_literal152 = (pANTLR3_COMMON_TOKEN) MATCHT(77, &FOLLOW_77_in_ebnfSuffix2527);
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleebnfSuffixEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }
        	         
        	        if ( BACKTRACKING==0 ) { CREATE_stream_77; stream_77->add(stream_77, char_literal152, NULL); }


        	        /* AST REWRITE
        	         * elements          : 
        	         * token labels      : 
        	         * rule labels       : retval
        	         * token list labels : 
        	         * rule list labels  : 
        	         */
        	        if ( BACKTRACKING==0 ) 

        	        {
        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	retval.tree    = root_0;
        	        	// 384:11: -> POSITIVE_CLOSURE_V3TOK[op]
        	        	{
        	        	    ADAPTOR->addChild(ADAPTOR, root_0, 

        	        	    #if 1 == 2
        	        	    	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, POSITIVE_CLOSURE_V3TOK, TOKTEXT(op))
        	        	    #else
        	        	    	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, POSITIVE_CLOSURE_V3TOK, (pANTLR3_UINT8)op)
        	        	    #endif

        	        	    );

        	        	}


        	        	retval.tree = root_0; // set result root
        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        }
        	    }
        	    break;

            }
        }
    }

    // This is where rules clean up and exit
    //
    goto ruleebnfSuffixEx; /* Prevent compiler warnings */
    ruleebnfSuffixEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_77 != NULL) stream_77->free(stream_77);
        if (stream_76 != NULL) stream_76->free(stream_76);
        if (stream_85 != NULL) stream_85->free(stream_85);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end ebnfSuffix */

/**
 * $ANTLR start rewrite
 * ANTLRv3.g:391:1: rewrite : ( (rew+= '->' preds+= SEMPRED_V3TOK predicated+= rewrite_alternative )* rew2= '->' last= rewrite_alternative -> ( ^( $rew $preds $predicated) )* ^( $rew2 $last) |);
 */
static ANTLRv3Parser_rewrite_return
rewrite(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_rewrite_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    rew2;
    pANTLR3_COMMON_TOKEN    rew;
    pANTLR3_COMMON_TOKEN    preds;
    pANTLR3_VECTOR    list_rew;
    pANTLR3_VECTOR    list_preds;
    pANTLR3_VECTOR    list_predicated;
    ANTLRv3Parser_rewrite_alternative_return last;
    #undef	RETURN_TYPE_last
    #define	RETURN_TYPE_last ANTLRv3Parser_rewrite_alternative_return

    ANTLRv3Parser_rewrite_alternative_return predicated;
    #undef	RETURN_TYPE_predicated
    #define	RETURN_TYPE_predicated ANTLRv3Parser_rewrite_alternative_return

    pANTLR3_BASE_TREE rew2_tree;
    pANTLR3_BASE_TREE rew_tree;
    pANTLR3_BASE_TREE preds_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_SEMPRED_V3TOK;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_REWRITE_V3TOK;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_rewrite_alternative;
    /* Initialize rule variables
     */

    root_0 = NULL;

    rew2       = NULL;
    rew       = NULL;
    preds       = NULL;
    list_rew     = NULL;
    list_preds     = NULL;
    list_predicated     = NULL;
    last.tree = NULL;

    predicated.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    rew2_tree   = NULL;
    rew_tree   = NULL;
    preds_tree   = NULL;

    stream_SEMPRED_V3TOK   = NULL;
    #define CREATE_stream_SEMPRED_V3TOK  if (stream_SEMPRED_V3TOK == NULL) {stream_SEMPRED_V3TOK = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token SEMPRED_V3TOK"); } 
    stream_REWRITE_V3TOK   = NULL;
    #define CREATE_stream_REWRITE_V3TOK  if (stream_REWRITE_V3TOK == NULL) {stream_REWRITE_V3TOK = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token REWRITE_V3TOK"); } 
    stream_rewrite_alternative   = NULL;
    #define CREATE_stream_rewrite_alternative  if (stream_rewrite_alternative == NULL) {stream_rewrite_alternative = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule rewrite_alternative"); }

    retval.tree  = NULL;

    {
        {
            //  ANTLRv3.g:392:2: ( (rew+= '->' preds+= SEMPRED_V3TOK predicated+= rewrite_alternative )* rew2= '->' last= rewrite_alternative -> ( ^( $rew $preds $predicated) )* ^( $rew2 $last) |)

            ANTLR3_UINT32 alt73;

            alt73=2;

            switch ( LA(1) )
            {
            case REWRITE_V3TOK:
            	{
            		alt73=1;
            	}
                break;
            case EOF:
            case 75:
            case 81:
            case 94:
            	{
            		alt73=2;
            	}
                break;

            default:
                if (BACKTRACKING>0)
                {
                    FAILEDFLAG = ANTLR3_TRUE;
                    return retval;
                }

                CONSTRUCTEX();
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
                EXCEPTION->message      = (void *)"";
                EXCEPTION->decisionNum  = 73;
                EXCEPTION->state        = 0;


                goto rulerewriteEx;

            }

            switch (alt73)
            {
        	case 1:
        	    // ANTLRv3.g:392:4: (rew+= '->' preds+= SEMPRED_V3TOK predicated+= rewrite_alternative )* rew2= '->' last= rewrite_alternative
        	    {
        	        // ANTLRv3.g:392:4: (rew+= '->' preds+= SEMPRED_V3TOK predicated+= rewrite_alternative )*

        	        for (;;)
        	        {
        	            int alt72=2;
        	            switch ( LA(1) )
        	            {
        	            case REWRITE_V3TOK:
        	            	{
        	            		switch ( LA(2) )
        	            		{
        	            		case SEMPRED_V3TOK:
        	            			{
        	            				alt72=1;
        	            			}
        	            		    break;

        	            		}

        	            	}
        	                break;

        	            }

        	            switch (alt72)
        	            {
        	        	case 1:
        	        	    // ANTLRv3.g:392:5: rew+= '->' preds+= SEMPRED_V3TOK predicated+= rewrite_alternative
        	        	    {
        	        	        rew = (pANTLR3_COMMON_TOKEN) MATCHT(REWRITE_V3TOK, &FOLLOW_REWRITE_V3TOK_in_rewrite2551);
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto rulerewriteEx;
        	        	        }
        	        	        if (HASFAILED())
        	        	        {
        	        	            return retval;
        	        	        }
        	        	         
        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_REWRITE_V3TOK; stream_REWRITE_V3TOK->add(stream_REWRITE_V3TOK, rew, NULL); }

        	        	        if (list_rew == NULL)
        	        	        {
        	        	            list_rew=ctx->vectors->newVector(ctx->vectors);
        	        	        }
        	        	        list_rew->add(list_rew, rew, NULL);

        	        	        preds = (pANTLR3_COMMON_TOKEN) MATCHT(SEMPRED_V3TOK, &FOLLOW_SEMPRED_V3TOK_in_rewrite2555);
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto rulerewriteEx;
        	        	        }
        	        	        if (HASFAILED())
        	        	        {
        	        	            return retval;
        	        	        }
        	        	         
        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_SEMPRED_V3TOK; stream_SEMPRED_V3TOK->add(stream_SEMPRED_V3TOK, preds, NULL); }

        	        	        if (list_preds == NULL)
        	        	        {
        	        	            list_preds=ctx->vectors->newVector(ctx->vectors);
        	        	        }
        	        	        list_preds->add(list_preds, preds, NULL);

        	        	        FOLLOWPUSH(FOLLOW_rewrite_alternative_in_rewrite2559);
        	        	        predicated=rewrite_alternative(ctx);

        	        	        FOLLOWPOP();
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto rulerewriteEx;
        	        	        }
        	        	        if (HASFAILED())
        	        	        {
        	        	            return retval;
        	        	        }

        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_rewrite_alternative; stream_rewrite_alternative->add(stream_rewrite_alternative, predicated.tree, NULL); }
        	        	        /* listLabelTrack(label)
        	        	         */
        	        	        if (list_predicated == NULL)
        	        	        {
        	        	            list_predicated=ctx->vectors->newVector(ctx->vectors);
        	        	        }
        	        	        list_predicated->add(list_predicated, predicated.tree, NULL);

        	        	    }
        	        	    break;

        	        	default:
        	        	    goto loop72;	/* break out of the loop */
        	        	    break;
        	            }
        	        }
        	        loop72: ; /* Jump out to here if this rule does not match */


        	        rew2 = (pANTLR3_COMMON_TOKEN) MATCHT(REWRITE_V3TOK, &FOLLOW_REWRITE_V3TOK_in_rewrite2567);
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulerewriteEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }
        	         
        	        if ( BACKTRACKING==0 ) { CREATE_stream_REWRITE_V3TOK; stream_REWRITE_V3TOK->add(stream_REWRITE_V3TOK, rew2, NULL); }


        	        FOLLOWPUSH(FOLLOW_rewrite_alternative_in_rewrite2571);
        	        last=rewrite_alternative(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulerewriteEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) { CREATE_stream_rewrite_alternative; stream_rewrite_alternative->add(stream_rewrite_alternative, last.tree, NULL); }

        	        /* AST REWRITE
        	         * elements          : rew2, preds, last, rew, predicated
        	         * token labels      : rew2
        	         * rule labels       : retval, last
        	         * token list labels : rew, preds
        	         * rule list labels  : predicated
        	         */
        	        if ( BACKTRACKING==0 ) 

        	        {
        	        	pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_rew2;
        	        	pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_rew;
        	        	pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_preds;
        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;
        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_last;
        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_predicated;
        	        	stream_rew2=antlr3RewriteRuleTOKENStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token rew2", rew2);
        	        	stream_rew=antlr3RewriteRuleTOKENStreamNewAEV(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token rew", list_rew); 
        	        	stream_preds=antlr3RewriteRuleTOKENStreamNewAEV(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token preds", list_preds); 
        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);
        	        	stream_last=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token last", last.tree != NULL ? last.tree : NULL);
        	        	stream_predicated=antlr3RewriteRuleSubtreeStreamNewAEV(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token predicated", list_predicated);
        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	retval.tree    = root_0;
        	        	// 394:9: -> ( ^( $rew $preds $predicated) )* ^( $rew2 $last)
        	        	{
        	        	    // ANTLRv3.g:394:12: ( ^( $rew $preds $predicated) )*
        	        	    {
        	        	    	while ( (stream_preds != NULL && stream_preds->hasNext(stream_preds)) || (stream_rew != NULL && stream_rew->hasNext(stream_rew)) || (stream_predicated != NULL && stream_predicated->hasNext(stream_predicated))  )
        	        	    	{
        	        	    		// ANTLRv3.g:394:12: ^( $rew $preds $predicated)
        	        	    		{
        	        	    		    pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	    		    root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRootToken(ADAPTOR, stream_rew == NULL ? NULL : stream_rew->nextToken(stream_rew), root_1));

        	        	    		    ADAPTOR->addChild(ADAPTOR, root_1, stream_preds == NULL ? NULL : stream_preds->nextNode(stream_preds));

        	        	    		    ADAPTOR->addChild(ADAPTOR, root_1, stream_predicated == NULL ? NULL : stream_predicated->nextTree(stream_predicated));

        	        	    		    ADAPTOR->addChild(ADAPTOR, root_0, root_1);
        	        	    		}

        	        	    	}
        	        	    	if (stream_preds != NULL) stream_preds->reset(stream_preds);
        	        	    	if (stream_rew != NULL) stream_rew->reset(stream_rew);
        	        	    	if (stream_predicated != NULL) stream_predicated->reset(stream_predicated);

        	        	    }

        	        	    // ANTLRv3.g:394:40: ^( $rew2 $last)
        	        	    {
        	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRootToken(ADAPTOR, stream_rew2 == NULL ? NULL : stream_rew2->nextToken(stream_rew2), root_1));

        	        	        ADAPTOR->addChild(ADAPTOR, root_1, stream_last == NULL ? NULL : stream_last->nextTree(stream_last));

        	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
        	        	    }

        	        	}


        	        	retval.tree = root_0; // set result root
        	        	if (stream_rew2 != NULL) stream_rew2->free(stream_rew2); 
        	        	if (stream_rew != NULL) stream_rew->free(stream_rew);
        	        	if (stream_preds != NULL) stream_preds->free(stream_preds);
        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);
        	        	if (stream_last != NULL) stream_last->free(stream_last);
        	        	if (stream_predicated != NULL) stream_predicated->free(stream_predicated);

        	        }
        	    }
        	    break;
        	case 2:
        	    // ANTLRv3.g:396:2: 
        	    {
        	        root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


        	    }
        	    break;

            }
        }
    }

    // This is where rules clean up and exit
    //
    goto rulerewriteEx; /* Prevent compiler warnings */
    rulerewriteEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_SEMPRED_V3TOK != NULL) stream_SEMPRED_V3TOK->free(stream_SEMPRED_V3TOK);
        if (stream_REWRITE_V3TOK != NULL) stream_REWRITE_V3TOK->free(stream_REWRITE_V3TOK);
        if (stream_rewrite_alternative != NULL) stream_rewrite_alternative->free(stream_rewrite_alternative);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end rewrite */

/**
 * $ANTLR start rewrite_alternative
 * ANTLRv3.g:398:1: rewrite_alternative options {backtrack=true; } : ( rewrite_template | rewrite_tree_alternative | -> ^( ALT_V3TOK[\"ALT\"] EPSILON_V3TOK[\"EPSILON\"] EOA_V3TOK[\"EOA\"] ) );
 */
static ANTLRv3Parser_rewrite_alternative_return
rewrite_alternative(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_rewrite_alternative_return retval;


    pANTLR3_BASE_TREE root_0;

    ANTLRv3Parser_rewrite_template_return rewrite_template153;
    #undef	RETURN_TYPE_rewrite_template153
    #define	RETURN_TYPE_rewrite_template153 ANTLRv3Parser_rewrite_template_return

    ANTLRv3Parser_rewrite_tree_alternative_return rewrite_tree_alternative154;
    #undef	RETURN_TYPE_rewrite_tree_alternative154
    #define	RETURN_TYPE_rewrite_tree_alternative154 ANTLRv3Parser_rewrite_tree_alternative_return


    /* Initialize rule variables
     */

    root_0 = NULL;

    rewrite_template153.tree = NULL;

    rewrite_tree_alternative154.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;




    retval.tree  = NULL;

    {
        {
            //  ANTLRv3.g:400:2: ( rewrite_template | rewrite_tree_alternative | -> ^( ALT_V3TOK[\"ALT\"] EPSILON_V3TOK[\"EPSILON\"] EOA_V3TOK[\"EOA\"] ) )

            ANTLR3_UINT32 alt74;

            alt74=3;

            switch ( LA(1) )
            {
            case TOKEN_REF:
            	{
            		switch ( LA(2) )
            		{
            		case 74:
            			{
            				switch ( LA(3) )
            				{
            				case TOKEN_REF:
            					{
            						switch ( LA(4) )
            						{
            						case LABEL_ASSIGN_V3TOK:
            							{
            								alt74=1;
            							}
            						    break;
            						case ACTION:
            						case ARG_ACTION:
            						case CHAR_LITERAL:
            						case RULE_REF:
            						case STRING_LITERAL:
            						case TOKEN_REF:
            						case TREE_BEGIN_V3TOK:
            						case 73:
            						case 74:
            						case 75:
            						case 76:
            						case 77:
            						case 85:
            							{
            								alt74=2;
            							}
            						    break;

            						default:
            						    if (BACKTRACKING>0)
            						    {
            						        FAILEDFLAG = ANTLR3_TRUE;
            						        return retval;
            						    }

            						    CONSTRUCTEX();
            						    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            						    EXCEPTION->message      = (void *)"";
            						    EXCEPTION->decisionNum  = 74;
            						    EXCEPTION->state        = 10;


            						    goto rulerewrite_alternativeEx;

            						}

            					}
            				    break;
            				case 75:
            					{
            						alt74=1;
            					}
            				    break;
            				case ACTION:
            				case CHAR_LITERAL:
            				case STRING_LITERAL:
            				case TREE_BEGIN_V3TOK:
            				case 73:
            				case 74:
            					{
            						alt74=2;
            					}
            				    break;
            				case RULE_REF:
            					{
            						switch ( LA(4) )
            						{
            						case LABEL_ASSIGN_V3TOK:
            							{
            								alt74=1;
            							}
            						    break;
            						case ACTION:
            						case CHAR_LITERAL:
            						case RULE_REF:
            						case STRING_LITERAL:
            						case TOKEN_REF:
            						case TREE_BEGIN_V3TOK:
            						case 73:
            						case 74:
            						case 75:
            						case 76:
            						case 77:
            						case 85:
            							{
            								alt74=2;
            							}
            						    break;

            						default:
            						    if (BACKTRACKING>0)
            						    {
            						        FAILEDFLAG = ANTLR3_TRUE;
            						        return retval;
            						    }

            						    CONSTRUCTEX();
            						    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            						    EXCEPTION->message      = (void *)"";
            						    EXCEPTION->decisionNum  = 74;
            						    EXCEPTION->state        = 11;


            						    goto rulerewrite_alternativeEx;

            						}

            					}
            				    break;

            				default:
            				    if (BACKTRACKING>0)
            				    {
            				        FAILEDFLAG = ANTLR3_TRUE;
            				        return retval;
            				    }

            				    CONSTRUCTEX();
            				    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            				    EXCEPTION->message      = (void *)"";
            				    EXCEPTION->decisionNum  = 74;
            				    EXCEPTION->state        = 7;


            				    goto rulerewrite_alternativeEx;

            				}

            			}
            		    break;
            		case EOF:
            		case ACTION:
            		case ARG_ACTION:
            		case CHAR_LITERAL:
            		case REWRITE_V3TOK:
            		case RULE_REF:
            		case STRING_LITERAL:
            		case TOKEN_REF:
            		case TREE_BEGIN_V3TOK:
            		case 73:
            		case 75:
            		case 76:
            		case 77:
            		case 81:
            		case 85:
            		case 94:
            			{
            				alt74=2;
            			}
            		    break;

            		default:
            		    if (BACKTRACKING>0)
            		    {
            		        FAILEDFLAG = ANTLR3_TRUE;
            		        return retval;
            		    }

            		    CONSTRUCTEX();
            		    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            		    EXCEPTION->message      = (void *)"";
            		    EXCEPTION->decisionNum  = 74;
            		    EXCEPTION->state        = 1;


            		    goto rulerewrite_alternativeEx;

            		}

            	}
                break;
            case 74:
            	{
            		switch ( LA(2) )
            		{
            		case ACTION:
            			{
            				switch ( LA(3) )
            				{
            				case 75:
            					{
            						switch ( LA(4) )
            						{
            						case 74:
            							{
            								alt74=1;
            							}
            						    break;
            						case 76:
            						case 77:
            						case 85:
            							{
            								alt74=2;
            							}
            						    break;

            						default:
            						    if (BACKTRACKING>0)
            						    {
            						        FAILEDFLAG = ANTLR3_TRUE;
            						        return retval;
            						    }

            						    CONSTRUCTEX();
            						    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            						    EXCEPTION->message      = (void *)"";
            						    EXCEPTION->decisionNum  = 74;
            						    EXCEPTION->state        = 12;


            						    goto rulerewrite_alternativeEx;

            						}

            					}
            				    break;
            				case ACTION:
            				case CHAR_LITERAL:
            				case RULE_REF:
            				case STRING_LITERAL:
            				case TOKEN_REF:
            				case TREE_BEGIN_V3TOK:
            				case 73:
            				case 74:
            				case 76:
            				case 77:
            				case 85:
            					{
            						alt74=2;
            					}
            				    break;

            				default:
            				    if (BACKTRACKING>0)
            				    {
            				        FAILEDFLAG = ANTLR3_TRUE;
            				        return retval;
            				    }

            				    CONSTRUCTEX();
            				    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            				    EXCEPTION->message      = (void *)"";
            				    EXCEPTION->decisionNum  = 74;
            				    EXCEPTION->state        = 8;


            				    goto rulerewrite_alternativeEx;

            				}

            			}
            		    break;
            		case CHAR_LITERAL:
            		case RULE_REF:
            		case STRING_LITERAL:
            		case TOKEN_REF:
            		case TREE_BEGIN_V3TOK:
            		case 73:
            		case 74:
            			{
            				alt74=2;
            			}
            		    break;

            		default:
            		    if (BACKTRACKING>0)
            		    {
            		        FAILEDFLAG = ANTLR3_TRUE;
            		        return retval;
            		    }

            		    CONSTRUCTEX();
            		    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            		    EXCEPTION->message      = (void *)"";
            		    EXCEPTION->decisionNum  = 74;
            		    EXCEPTION->state        = 2;


            		    goto rulerewrite_alternativeEx;

            		}

            	}
                break;
            case ACTION:
            	{
            		{
            		    int LA74_3 = LA(2);
            		    if ( (synpred100_ANTLRv3(ctx)))
            		    {
            		        alt74=1;
            		    }
            		    else if ( (synpred101_ANTLRv3(ctx)))
            		    {
            		        alt74=2;
            		    }
            		    else
            		    {
            		        if (BACKTRACKING>0)
            		        {
            		            FAILEDFLAG = ANTLR3_TRUE;
            		            return retval;
            		        }


            		        CONSTRUCTEX();
            		        EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            		        EXCEPTION->message      = (void *)"";
            		        EXCEPTION->decisionNum  = 74;
            		        EXCEPTION->state        = 3;


            		        goto rulerewrite_alternativeEx;

            		    }
            		}
            	}
                break;
            case CHAR_LITERAL:
            case STRING_LITERAL:
            case TREE_BEGIN_V3TOK:
            case 73:
            	{
            		alt74=2;
            	}
                break;
            case RULE_REF:
            	{
            		switch ( LA(2) )
            		{
            		case 74:
            			{
            				switch ( LA(3) )
            				{
            				case TOKEN_REF:
            					{
            						switch ( LA(4) )
            						{
            						case LABEL_ASSIGN_V3TOK:
            							{
            								alt74=1;
            							}
            						    break;
            						case ACTION:
            						case ARG_ACTION:
            						case CHAR_LITERAL:
            						case RULE_REF:
            						case STRING_LITERAL:
            						case TOKEN_REF:
            						case TREE_BEGIN_V3TOK:
            						case 73:
            						case 74:
            						case 75:
            						case 76:
            						case 77:
            						case 85:
            							{
            								alt74=2;
            							}
            						    break;

            						default:
            						    if (BACKTRACKING>0)
            						    {
            						        FAILEDFLAG = ANTLR3_TRUE;
            						        return retval;
            						    }

            						    CONSTRUCTEX();
            						    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            						    EXCEPTION->message      = (void *)"";
            						    EXCEPTION->decisionNum  = 74;
            						    EXCEPTION->state        = 10;


            						    goto rulerewrite_alternativeEx;

            						}

            					}
            				    break;
            				case 75:
            					{
            						alt74=1;
            					}
            				    break;
            				case ACTION:
            				case CHAR_LITERAL:
            				case STRING_LITERAL:
            				case TREE_BEGIN_V3TOK:
            				case 73:
            				case 74:
            					{
            						alt74=2;
            					}
            				    break;
            				case RULE_REF:
            					{
            						switch ( LA(4) )
            						{
            						case LABEL_ASSIGN_V3TOK:
            							{
            								alt74=1;
            							}
            						    break;
            						case ACTION:
            						case CHAR_LITERAL:
            						case RULE_REF:
            						case STRING_LITERAL:
            						case TOKEN_REF:
            						case TREE_BEGIN_V3TOK:
            						case 73:
            						case 74:
            						case 75:
            						case 76:
            						case 77:
            						case 85:
            							{
            								alt74=2;
            							}
            						    break;

            						default:
            						    if (BACKTRACKING>0)
            						    {
            						        FAILEDFLAG = ANTLR3_TRUE;
            						        return retval;
            						    }

            						    CONSTRUCTEX();
            						    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            						    EXCEPTION->message      = (void *)"";
            						    EXCEPTION->decisionNum  = 74;
            						    EXCEPTION->state        = 11;


            						    goto rulerewrite_alternativeEx;

            						}

            					}
            				    break;

            				default:
            				    if (BACKTRACKING>0)
            				    {
            				        FAILEDFLAG = ANTLR3_TRUE;
            				        return retval;
            				    }

            				    CONSTRUCTEX();
            				    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            				    EXCEPTION->message      = (void *)"";
            				    EXCEPTION->decisionNum  = 74;
            				    EXCEPTION->state        = 7;


            				    goto rulerewrite_alternativeEx;

            				}

            			}
            		    break;
            		case EOF:
            		case ACTION:
            		case CHAR_LITERAL:
            		case REWRITE_V3TOK:
            		case RULE_REF:
            		case STRING_LITERAL:
            		case TOKEN_REF:
            		case TREE_BEGIN_V3TOK:
            		case 73:
            		case 75:
            		case 76:
            		case 77:
            		case 81:
            		case 85:
            		case 94:
            			{
            				alt74=2;
            			}
            		    break;

            		default:
            		    if (BACKTRACKING>0)
            		    {
            		        FAILEDFLAG = ANTLR3_TRUE;
            		        return retval;
            		    }

            		    CONSTRUCTEX();
            		    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            		    EXCEPTION->message      = (void *)"";
            		    EXCEPTION->decisionNum  = 74;
            		    EXCEPTION->state        = 5;


            		    goto rulerewrite_alternativeEx;

            		}

            	}
                break;
            case EOF:
            case REWRITE_V3TOK:
            case 75:
            case 81:
            case 94:
            	{
            		alt74=3;
            	}
                break;

            default:
                if (BACKTRACKING>0)
                {
                    FAILEDFLAG = ANTLR3_TRUE;
                    return retval;
                }

                CONSTRUCTEX();
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
                EXCEPTION->message      = (void *)"";
                EXCEPTION->decisionNum  = 74;
                EXCEPTION->state        = 0;


                goto rulerewrite_alternativeEx;

            }

            switch (alt74)
            {
        	case 1:
        	    // ANTLRv3.g:400:4: rewrite_template
        	    {
        	        root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


        	        FOLLOWPUSH(FOLLOW_rewrite_template_in_rewrite_alternative2622);
        	        rewrite_template153=rewrite_template(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulerewrite_alternativeEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, rewrite_template153.tree);

        	    }
        	    break;
        	case 2:
        	    // ANTLRv3.g:401:4: rewrite_tree_alternative
        	    {
        	        root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


        	        FOLLOWPUSH(FOLLOW_rewrite_tree_alternative_in_rewrite_alternative2627);
        	        rewrite_tree_alternative154=rewrite_tree_alternative(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulerewrite_alternativeEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, rewrite_tree_alternative154.tree);

        	    }
        	    break;
        	case 3:
        	    // ANTLRv3.g:402:29: 
        	    {
        	        /* AST REWRITE
        	         * elements          : 
        	         * token labels      : 
        	         * rule labels       : retval
        	         * token list labels : 
        	         * rule list labels  : 
        	         */
        	        if ( BACKTRACKING==0 ) 

        	        {
        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	retval.tree    = root_0;
        	        	// 402:29: -> ^( ALT_V3TOK[\"ALT\"] EPSILON_V3TOK[\"EPSILON\"] EOA_V3TOK[\"EOA\"] )
        	        	{
        	        	    // ANTLRv3.g:402:32: ^( ALT_V3TOK[\"ALT\"] EPSILON_V3TOK[\"EPSILON\"] EOA_V3TOK[\"EOA\"] )
        	        	    {
        	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 

        	        	        #if 1 == 2
        	        	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, ALT_V3TOK, TOKTEXT("ALT"))
        	        	        #else
        	        	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, ALT_V3TOK, (pANTLR3_UINT8)"ALT")
        	        	        #endif

        	        	        , root_1));

        	        	        ADAPTOR->addChild(ADAPTOR, root_1, 

        	        	        #if 1 == 2
        	        	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, EPSILON_V3TOK, TOKTEXT("EPSILON"))
        	        	        #else
        	        	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, EPSILON_V3TOK, (pANTLR3_UINT8)"EPSILON")
        	        	        #endif

        	        	        );

        	        	        ADAPTOR->addChild(ADAPTOR, root_1, 

        	        	        #if 1 == 2
        	        	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, EOA_V3TOK, TOKTEXT("EOA"))
        	        	        #else
        	        	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, EOA_V3TOK, (pANTLR3_UINT8)"EOA")
        	        	        #endif

        	        	        );

        	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
        	        	    }

        	        	}


        	        	retval.tree = root_0; // set result root
        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        }
        	    }
        	    break;

            }
        }
    }

    // This is where rules clean up and exit
    //
    goto rulerewrite_alternativeEx; /* Prevent compiler warnings */
    rulerewrite_alternativeEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end rewrite_alternative */

/**
 * $ANTLR start rewrite_tree_block
 * ANTLRv3.g:405:1: rewrite_tree_block : lp= '(' rewrite_tree_alternative ')' -> ^( BLOCK_V3TOK[$lp,\"BLOCK\"] rewrite_tree_alternative EOB_V3TOK[$lp,\"EOB\"] ) ;
 */
static ANTLRv3Parser_rewrite_tree_block_return
rewrite_tree_block(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_rewrite_tree_block_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    lp;
    pANTLR3_COMMON_TOKEN    char_literal156;
    ANTLRv3Parser_rewrite_tree_alternative_return rewrite_tree_alternative155;
    #undef	RETURN_TYPE_rewrite_tree_alternative155
    #define	RETURN_TYPE_rewrite_tree_alternative155 ANTLRv3Parser_rewrite_tree_alternative_return

    pANTLR3_BASE_TREE lp_tree;
    pANTLR3_BASE_TREE char_literal156_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_74;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_75;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_rewrite_tree_alternative;
    /* Initialize rule variables
     */

    root_0 = NULL;

    lp       = NULL;
    char_literal156       = NULL;
    rewrite_tree_alternative155.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    lp_tree   = NULL;
    char_literal156_tree   = NULL;

    stream_74   = NULL;
    #define CREATE_stream_74  if (stream_74 == NULL) {stream_74 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 74"); } 
    stream_75   = NULL;
    #define CREATE_stream_75  if (stream_75 == NULL) {stream_75 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 75"); } 
    stream_rewrite_tree_alternative   = NULL;
    #define CREATE_stream_rewrite_tree_alternative  if (stream_rewrite_tree_alternative == NULL) {stream_rewrite_tree_alternative = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule rewrite_tree_alternative"); }

    retval.tree  = NULL;

    {
        // ANTLRv3.g:406:5: (lp= '(' rewrite_tree_alternative ')' -> ^( BLOCK_V3TOK[$lp,\"BLOCK\"] rewrite_tree_alternative EOB_V3TOK[$lp,\"EOB\"] ) )
        // ANTLRv3.g:406:9: lp= '(' rewrite_tree_alternative ')'
        {
            lp = (pANTLR3_COMMON_TOKEN) MATCHT(74, &FOLLOW_74_in_rewrite_tree_block2669);
            if  (HASEXCEPTION())
            {
                goto rulerewrite_tree_blockEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_74; stream_74->add(stream_74, lp, NULL); }


            FOLLOWPUSH(FOLLOW_rewrite_tree_alternative_in_rewrite_tree_block2671);
            rewrite_tree_alternative155=rewrite_tree_alternative(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto rulerewrite_tree_blockEx;
            }
            if (HASFAILED())
            {
                return retval;
            }

            if ( BACKTRACKING==0 ) { CREATE_stream_rewrite_tree_alternative; stream_rewrite_tree_alternative->add(stream_rewrite_tree_alternative, rewrite_tree_alternative155.tree, NULL); }

            char_literal156 = (pANTLR3_COMMON_TOKEN) MATCHT(75, &FOLLOW_75_in_rewrite_tree_block2673);
            if  (HASEXCEPTION())
            {
                goto rulerewrite_tree_blockEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_75; stream_75->add(stream_75, char_literal156, NULL); }


            /* AST REWRITE
             * elements          : rewrite_tree_alternative
             * token labels      : 
             * rule labels       : retval
             * token list labels : 
             * rule list labels  : 
             */
            if ( BACKTRACKING==0 ) 

            {
            	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	retval.tree    = root_0;
            	// 407:6: -> ^( BLOCK_V3TOK[$lp,\"BLOCK\"] rewrite_tree_alternative EOB_V3TOK[$lp,\"EOB\"] )
            	{
            	    // ANTLRv3.g:407:9: ^( BLOCK_V3TOK[$lp,\"BLOCK\"] rewrite_tree_alternative EOB_V3TOK[$lp,\"EOB\"] )
            	    {
            	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 

            	        #if 2 == 2
            	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, BLOCK_V3TOK, TOKTEXT(lp, "BLOCK"))
            	        #else
            	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, BLOCK_V3TOK, (pANTLR3_UINT8)lp, "BLOCK")
            	        #endif

            	        , root_1));

            	        ADAPTOR->addChild(ADAPTOR, root_1, stream_rewrite_tree_alternative == NULL ? NULL : stream_rewrite_tree_alternative->nextTree(stream_rewrite_tree_alternative));

            	        ADAPTOR->addChild(ADAPTOR, root_1, 

            	        #if 2 == 2
            	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, EOB_V3TOK, TOKTEXT(lp, "EOB"))
            	        #else
            	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, EOB_V3TOK, (pANTLR3_UINT8)lp, "EOB")
            	        #endif

            	        );

            	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	    }

            	}


            	retval.tree = root_0; // set result root
            	if (stream_retval != NULL) stream_retval->free(stream_retval);


            }
        }

    }

    // This is where rules clean up and exit
    //
    goto rulerewrite_tree_blockEx; /* Prevent compiler warnings */
    rulerewrite_tree_blockEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_74 != NULL) stream_74->free(stream_74);
        if (stream_75 != NULL) stream_75->free(stream_75);
        if (stream_rewrite_tree_alternative != NULL) stream_rewrite_tree_alternative->free(stream_rewrite_tree_alternative);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end rewrite_tree_block */

/**
 * $ANTLR start rewrite_tree_alternative
 * ANTLRv3.g:410:1: rewrite_tree_alternative : ( rewrite_tree_element )+ -> ^( ALT_V3TOK[\"ALT\"] ( rewrite_tree_element )+ EOA_V3TOK[\"EOA\"] ) ;
 */
static ANTLRv3Parser_rewrite_tree_alternative_return
rewrite_tree_alternative(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_rewrite_tree_alternative_return retval;


    pANTLR3_BASE_TREE root_0;

    ANTLRv3Parser_rewrite_tree_element_return rewrite_tree_element157;
    #undef	RETURN_TYPE_rewrite_tree_element157
    #define	RETURN_TYPE_rewrite_tree_element157 ANTLRv3Parser_rewrite_tree_element_return

    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_rewrite_tree_element;
    /* Initialize rule variables
     */

    root_0 = NULL;

    rewrite_tree_element157.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;



    stream_rewrite_tree_element   = NULL;
    #define CREATE_stream_rewrite_tree_element  if (stream_rewrite_tree_element == NULL) {stream_rewrite_tree_element = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule rewrite_tree_element"); }

    retval.tree  = NULL;

    {
        // ANTLRv3.g:411:5: ( ( rewrite_tree_element )+ -> ^( ALT_V3TOK[\"ALT\"] ( rewrite_tree_element )+ EOA_V3TOK[\"EOA\"] ) )
        // ANTLRv3.g:411:7: ( rewrite_tree_element )+
        {
            // ANTLRv3.g:411:7: ( rewrite_tree_element )+
            {
                int cnt75=0;

                for (;;)
                {
                    int alt75=2;
            	switch ( LA(1) )
            	{
            	case ACTION:
            	case CHAR_LITERAL:
            	case RULE_REF:
            	case STRING_LITERAL:
            	case TOKEN_REF:
            	case TREE_BEGIN_V3TOK:
            	case 73:
            	case 74:
            		{
            			alt75=1;
            		}
            	    break;

            	}

            	switch (alt75)
            	{
            	    case 1:
            	        // ANTLRv3.g:411:7: rewrite_tree_element
            	        {
            	            FOLLOWPUSH(FOLLOW_rewrite_tree_element_in_rewrite_tree_alternative2707);
            	            rewrite_tree_element157=rewrite_tree_element(ctx);

            	            FOLLOWPOP();
            	            if  (HASEXCEPTION())
            	            {
            	                goto rulerewrite_tree_alternativeEx;
            	            }
            	            if (HASFAILED())
            	            {
            	                return retval;
            	            }

            	            if ( BACKTRACKING==0 ) { CREATE_stream_rewrite_tree_element; stream_rewrite_tree_element->add(stream_rewrite_tree_element, rewrite_tree_element157.tree, NULL); }

            	        }
            	        break;

            	    default:

            		if ( cnt75 >= 1 )
            		{
            		    goto loop75;
            		}
            		if (BACKTRACKING>0)
            		{
            		    FAILEDFLAG = ANTLR3_TRUE;
            		    return retval;
            		}

            		/* mismatchedSetEx()
            		 */
            		CONSTRUCTEX();
            		EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
            		EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;


            		goto rulerewrite_tree_alternativeEx;
            	}
            	cnt75++;
                }
                loop75: ;	/* Jump to here if this rule does not match */
            }

            /* AST REWRITE
             * elements          : rewrite_tree_element
             * token labels      : 
             * rule labels       : retval
             * token list labels : 
             * rule list labels  : 
             */
            if ( BACKTRACKING==0 ) 

            {
            	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	retval.tree    = root_0;
            	// 411:29: -> ^( ALT_V3TOK[\"ALT\"] ( rewrite_tree_element )+ EOA_V3TOK[\"EOA\"] )
            	{
            	    // ANTLRv3.g:411:32: ^( ALT_V3TOK[\"ALT\"] ( rewrite_tree_element )+ EOA_V3TOK[\"EOA\"] )
            	    {
            	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 

            	        #if 1 == 2
            	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, ALT_V3TOK, TOKTEXT("ALT"))
            	        #else
            	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, ALT_V3TOK, (pANTLR3_UINT8)"ALT")
            	        #endif

            	        , root_1));

            	        if ((stream_rewrite_tree_element == NULL || !stream_rewrite_tree_element->hasNext(stream_rewrite_tree_element))  )
            	        {
            	            CONSTRUCTEX();
            	            EXCEPTION->type         = ANTLR3_REWRITE_EARLY_EXCEPTION;
            	            EXCEPTION->name         = (void *)ANTLR3_REWRITE_EARLY_EXCEPTION_NAME;
            	        }
            	        else
            	        {
            	        	while ( (stream_rewrite_tree_element->hasNext(stream_rewrite_tree_element))  ) {
            	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_rewrite_tree_element == NULL ? NULL : stream_rewrite_tree_element->nextTree(stream_rewrite_tree_element));

            	        	}
            	        	stream_rewrite_tree_element->reset(stream_rewrite_tree_element);

            	        }
            	        ADAPTOR->addChild(ADAPTOR, root_1, 

            	        #if 1 == 2
            	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, EOA_V3TOK, TOKTEXT("EOA"))
            	        #else
            	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, EOA_V3TOK, (pANTLR3_UINT8)"EOA")
            	        #endif

            	        );

            	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	    }

            	}


            	retval.tree = root_0; // set result root
            	if (stream_retval != NULL) stream_retval->free(stream_retval);


            }
        }

    }

    // This is where rules clean up and exit
    //
    goto rulerewrite_tree_alternativeEx; /* Prevent compiler warnings */
    rulerewrite_tree_alternativeEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_rewrite_tree_element != NULL) stream_rewrite_tree_element->free(stream_rewrite_tree_element);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end rewrite_tree_alternative */

/**
 * $ANTLR start rewrite_tree_element
 * ANTLRv3.g:414:1: rewrite_tree_element : ( rewrite_tree_atom | rewrite_tree_atom ebnfSuffix -> ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] rewrite_tree_atom EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) ) | rewrite_tree ( ebnfSuffix -> ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] rewrite_tree EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) ) | -> rewrite_tree ) | rewrite_tree_ebnf );
 */
static ANTLRv3Parser_rewrite_tree_element_return
rewrite_tree_element(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_rewrite_tree_element_return retval;


    pANTLR3_BASE_TREE root_0;

    ANTLRv3Parser_rewrite_tree_atom_return rewrite_tree_atom158;
    #undef	RETURN_TYPE_rewrite_tree_atom158
    #define	RETURN_TYPE_rewrite_tree_atom158 ANTLRv3Parser_rewrite_tree_atom_return

    ANTLRv3Parser_rewrite_tree_atom_return rewrite_tree_atom159;
    #undef	RETURN_TYPE_rewrite_tree_atom159
    #define	RETURN_TYPE_rewrite_tree_atom159 ANTLRv3Parser_rewrite_tree_atom_return

    ANTLRv3Parser_ebnfSuffix_return ebnfSuffix160;
    #undef	RETURN_TYPE_ebnfSuffix160
    #define	RETURN_TYPE_ebnfSuffix160 ANTLRv3Parser_ebnfSuffix_return

    ANTLRv3Parser_rewrite_tree_return rewrite_tree161;
    #undef	RETURN_TYPE_rewrite_tree161
    #define	RETURN_TYPE_rewrite_tree161 ANTLRv3Parser_rewrite_tree_return

    ANTLRv3Parser_ebnfSuffix_return ebnfSuffix162;
    #undef	RETURN_TYPE_ebnfSuffix162
    #define	RETURN_TYPE_ebnfSuffix162 ANTLRv3Parser_ebnfSuffix_return

    ANTLRv3Parser_rewrite_tree_ebnf_return rewrite_tree_ebnf163;
    #undef	RETURN_TYPE_rewrite_tree_ebnf163
    #define	RETURN_TYPE_rewrite_tree_ebnf163 ANTLRv3Parser_rewrite_tree_ebnf_return

    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_rewrite_tree;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_ebnfSuffix;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_rewrite_tree_atom;
    /* Initialize rule variables
     */

    root_0 = NULL;

    rewrite_tree_atom158.tree = NULL;

    rewrite_tree_atom159.tree = NULL;

    ebnfSuffix160.tree = NULL;

    rewrite_tree161.tree = NULL;

    ebnfSuffix162.tree = NULL;

    rewrite_tree_ebnf163.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;



    stream_rewrite_tree   = NULL;
    #define CREATE_stream_rewrite_tree  if (stream_rewrite_tree == NULL) {stream_rewrite_tree = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule rewrite_tree"); }
    stream_ebnfSuffix   = NULL;
    #define CREATE_stream_ebnfSuffix  if (stream_ebnfSuffix == NULL) {stream_ebnfSuffix = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule ebnfSuffix"); }
    stream_rewrite_tree_atom   = NULL;
    #define CREATE_stream_rewrite_tree_atom  if (stream_rewrite_tree_atom == NULL) {stream_rewrite_tree_atom = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule rewrite_tree_atom"); }

    retval.tree  = NULL;

    {
        {
            //  ANTLRv3.g:415:2: ( rewrite_tree_atom | rewrite_tree_atom ebnfSuffix -> ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] rewrite_tree_atom EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) ) | rewrite_tree ( ebnfSuffix -> ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] rewrite_tree EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) ) | -> rewrite_tree ) | rewrite_tree_ebnf )

            ANTLR3_UINT32 alt77;

            alt77=4;

            switch ( LA(1) )
            {
            case CHAR_LITERAL:
            	{
            		switch ( LA(2) )
            		{
            		case EOF:
            		case ACTION:
            		case CHAR_LITERAL:
            		case REWRITE_V3TOK:
            		case RULE_REF:
            		case STRING_LITERAL:
            		case TOKEN_REF:
            		case TREE_BEGIN_V3TOK:
            		case 73:
            		case 74:
            		case 75:
            		case 81:
            		case 94:
            			{
            				alt77=1;
            			}
            		    break;
            		case 76:
            		case 77:
            		case 85:
            			{
            				alt77=2;
            			}
            		    break;

            		default:
            		    if (BACKTRACKING>0)
            		    {
            		        FAILEDFLAG = ANTLR3_TRUE;
            		        return retval;
            		    }

            		    CONSTRUCTEX();
            		    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            		    EXCEPTION->message      = (void *)"";
            		    EXCEPTION->decisionNum  = 77;
            		    EXCEPTION->state        = 1;


            		    goto rulerewrite_tree_elementEx;

            		}

            	}
                break;
            case TOKEN_REF:
            	{
            		switch ( LA(2) )
            		{
            		case ARG_ACTION:
            			{
            				switch ( LA(3) )
            				{
            				case EOF:
            				case ACTION:
            				case CHAR_LITERAL:
            				case REWRITE_V3TOK:
            				case RULE_REF:
            				case STRING_LITERAL:
            				case TOKEN_REF:
            				case TREE_BEGIN_V3TOK:
            				case 73:
            				case 74:
            				case 75:
            				case 81:
            				case 94:
            					{
            						alt77=1;
            					}
            				    break;
            				case 76:
            				case 77:
            				case 85:
            					{
            						alt77=2;
            					}
            				    break;

            				default:
            				    if (BACKTRACKING>0)
            				    {
            				        FAILEDFLAG = ANTLR3_TRUE;
            				        return retval;
            				    }

            				    CONSTRUCTEX();
            				    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            				    EXCEPTION->message      = (void *)"";
            				    EXCEPTION->decisionNum  = 77;
            				    EXCEPTION->state        = 11;


            				    goto rulerewrite_tree_elementEx;

            				}

            			}
            		    break;
            		case EOF:
            		case ACTION:
            		case CHAR_LITERAL:
            		case REWRITE_V3TOK:
            		case RULE_REF:
            		case STRING_LITERAL:
            		case TOKEN_REF:
            		case TREE_BEGIN_V3TOK:
            		case 73:
            		case 74:
            		case 75:
            		case 81:
            		case 94:
            			{
            				alt77=1;
            			}
            		    break;
            		case 76:
            		case 77:
            		case 85:
            			{
            				alt77=2;
            			}
            		    break;

            		default:
            		    if (BACKTRACKING>0)
            		    {
            		        FAILEDFLAG = ANTLR3_TRUE;
            		        return retval;
            		    }

            		    CONSTRUCTEX();
            		    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            		    EXCEPTION->message      = (void *)"";
            		    EXCEPTION->decisionNum  = 77;
            		    EXCEPTION->state        = 2;


            		    goto rulerewrite_tree_elementEx;

            		}

            	}
                break;
            case RULE_REF:
            	{
            		switch ( LA(2) )
            		{
            		case EOF:
            		case ACTION:
            		case CHAR_LITERAL:
            		case REWRITE_V3TOK:
            		case RULE_REF:
            		case STRING_LITERAL:
            		case TOKEN_REF:
            		case TREE_BEGIN_V3TOK:
            		case 73:
            		case 74:
            		case 75:
            		case 81:
            		case 94:
            			{
            				alt77=1;
            			}
            		    break;
            		case 76:
            		case 77:
            		case 85:
            			{
            				alt77=2;
            			}
            		    break;

            		default:
            		    if (BACKTRACKING>0)
            		    {
            		        FAILEDFLAG = ANTLR3_TRUE;
            		        return retval;
            		    }

            		    CONSTRUCTEX();
            		    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            		    EXCEPTION->message      = (void *)"";
            		    EXCEPTION->decisionNum  = 77;
            		    EXCEPTION->state        = 3;


            		    goto rulerewrite_tree_elementEx;

            		}

            	}
                break;
            case STRING_LITERAL:
            	{
            		switch ( LA(2) )
            		{
            		case EOF:
            		case ACTION:
            		case CHAR_LITERAL:
            		case REWRITE_V3TOK:
            		case RULE_REF:
            		case STRING_LITERAL:
            		case TOKEN_REF:
            		case TREE_BEGIN_V3TOK:
            		case 73:
            		case 74:
            		case 75:
            		case 81:
            		case 94:
            			{
            				alt77=1;
            			}
            		    break;
            		case 76:
            		case 77:
            		case 85:
            			{
            				alt77=2;
            			}
            		    break;

            		default:
            		    if (BACKTRACKING>0)
            		    {
            		        FAILEDFLAG = ANTLR3_TRUE;
            		        return retval;
            		    }

            		    CONSTRUCTEX();
            		    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            		    EXCEPTION->message      = (void *)"";
            		    EXCEPTION->decisionNum  = 77;
            		    EXCEPTION->state        = 4;


            		    goto rulerewrite_tree_elementEx;

            		}

            	}
                break;
            case 73:
            	{
            		switch ( LA(2) )
            		{
            		case RULE_REF:
            		case TOKEN_REF:
            			{
            				switch ( LA(3) )
            				{
            				case EOF:
            				case ACTION:
            				case CHAR_LITERAL:
            				case REWRITE_V3TOK:
            				case RULE_REF:
            				case STRING_LITERAL:
            				case TOKEN_REF:
            				case TREE_BEGIN_V3TOK:
            				case 73:
            				case 74:
            				case 75:
            				case 81:
            				case 94:
            					{
            						alt77=1;
            					}
            				    break;
            				case 76:
            				case 77:
            				case 85:
            					{
            						alt77=2;
            					}
            				    break;

            				default:
            				    if (BACKTRACKING>0)
            				    {
            				        FAILEDFLAG = ANTLR3_TRUE;
            				        return retval;
            				    }

            				    CONSTRUCTEX();
            				    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            				    EXCEPTION->message      = (void *)"";
            				    EXCEPTION->decisionNum  = 77;
            				    EXCEPTION->state        = 12;


            				    goto rulerewrite_tree_elementEx;

            				}

            			}
            		    break;

            		default:
            		    if (BACKTRACKING>0)
            		    {
            		        FAILEDFLAG = ANTLR3_TRUE;
            		        return retval;
            		    }

            		    CONSTRUCTEX();
            		    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            		    EXCEPTION->message      = (void *)"";
            		    EXCEPTION->decisionNum  = 77;
            		    EXCEPTION->state        = 5;


            		    goto rulerewrite_tree_elementEx;

            		}

            	}
                break;
            case ACTION:
            	{
            		switch ( LA(2) )
            		{
            		case EOF:
            		case ACTION:
            		case CHAR_LITERAL:
            		case REWRITE_V3TOK:
            		case RULE_REF:
            		case STRING_LITERAL:
            		case TOKEN_REF:
            		case TREE_BEGIN_V3TOK:
            		case 73:
            		case 74:
            		case 75:
            		case 81:
            		case 94:
            			{
            				alt77=1;
            			}
            		    break;
            		case 76:
            		case 77:
            		case 85:
            			{
            				alt77=2;
            			}
            		    break;

            		default:
            		    if (BACKTRACKING>0)
            		    {
            		        FAILEDFLAG = ANTLR3_TRUE;
            		        return retval;
            		    }

            		    CONSTRUCTEX();
            		    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
            		    EXCEPTION->message      = (void *)"";
            		    EXCEPTION->decisionNum  = 77;
            		    EXCEPTION->state        = 6;


            		    goto rulerewrite_tree_elementEx;

            		}

            	}
                break;
            case TREE_BEGIN_V3TOK:
            	{
            		alt77=3;
            	}
                break;
            case 74:
            	{
            		alt77=4;
            	}
                break;

            default:
                if (BACKTRACKING>0)
                {
                    FAILEDFLAG = ANTLR3_TRUE;
                    return retval;
                }

                CONSTRUCTEX();
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
                EXCEPTION->message      = (void *)"";
                EXCEPTION->decisionNum  = 77;
                EXCEPTION->state        = 0;


                goto rulerewrite_tree_elementEx;

            }

            switch (alt77)
            {
        	case 1:
        	    // ANTLRv3.g:415:4: rewrite_tree_atom
        	    {
        	        root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


        	        FOLLOWPUSH(FOLLOW_rewrite_tree_atom_in_rewrite_tree_element2735);
        	        rewrite_tree_atom158=rewrite_tree_atom(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulerewrite_tree_elementEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, rewrite_tree_atom158.tree);

        	    }
        	    break;
        	case 2:
        	    // ANTLRv3.g:416:4: rewrite_tree_atom ebnfSuffix
        	    {
        	        FOLLOWPUSH(FOLLOW_rewrite_tree_atom_in_rewrite_tree_element2740);
        	        rewrite_tree_atom159=rewrite_tree_atom(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulerewrite_tree_elementEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) { CREATE_stream_rewrite_tree_atom; stream_rewrite_tree_atom->add(stream_rewrite_tree_atom, rewrite_tree_atom159.tree, NULL); }

        	        FOLLOWPUSH(FOLLOW_ebnfSuffix_in_rewrite_tree_element2742);
        	        ebnfSuffix160=ebnfSuffix(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulerewrite_tree_elementEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) { CREATE_stream_ebnfSuffix; stream_ebnfSuffix->add(stream_ebnfSuffix, ebnfSuffix160.tree, NULL); }

        	        /* AST REWRITE
        	         * elements          : ebnfSuffix, rewrite_tree_atom
        	         * token labels      : 
        	         * rule labels       : retval
        	         * token list labels : 
        	         * rule list labels  : 
        	         */
        	        if ( BACKTRACKING==0 ) 

        	        {
        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	retval.tree    = root_0;
        	        	// 417:3: -> ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] rewrite_tree_atom EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) )
        	        	{
        	        	    // ANTLRv3.g:417:6: ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] rewrite_tree_atom EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) )
        	        	    {
        	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_ebnfSuffix == NULL ? NULL : stream_ebnfSuffix->nextNode(stream_ebnfSuffix), root_1));

        	        	        // ANTLRv3.g:417:20: ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] rewrite_tree_atom EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] )
        	        	        {
        	        	            pANTLR3_BASE_TREE root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	            root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 

        	        	            #if 1 == 2
        	        	            	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, BLOCK_V3TOK, TOKTEXT("BLOCK"))
        	        	            #else
        	        	            	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, BLOCK_V3TOK, (pANTLR3_UINT8)"BLOCK")
        	        	            #endif

        	        	            , root_2));

        	        	            // ANTLRv3.g:417:43: ^( ALT_V3TOK[\"ALT\"] rewrite_tree_atom EOA_V3TOK[\"EOA\"] )
        	        	            {
        	        	                pANTLR3_BASE_TREE root_3 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	                root_3 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 

        	        	                #if 1 == 2
        	        	                	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, ALT_V3TOK, TOKTEXT("ALT"))
        	        	                #else
        	        	                	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, ALT_V3TOK, (pANTLR3_UINT8)"ALT")
        	        	                #endif

        	        	                , root_3));

        	        	                ADAPTOR->addChild(ADAPTOR, root_3, stream_rewrite_tree_atom == NULL ? NULL : stream_rewrite_tree_atom->nextTree(stream_rewrite_tree_atom));

        	        	                ADAPTOR->addChild(ADAPTOR, root_3, 

        	        	                #if 1 == 2
        	        	                	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, EOA_V3TOK, TOKTEXT("EOA"))
        	        	                #else
        	        	                	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, EOA_V3TOK, (pANTLR3_UINT8)"EOA")
        	        	                #endif

        	        	                );

        	        	                ADAPTOR->addChild(ADAPTOR, root_2, root_3);
        	        	            }

        	        	            ADAPTOR->addChild(ADAPTOR, root_2, 

        	        	            #if 1 == 2
        	        	            	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, EOB_V3TOK, TOKTEXT("EOB"))
        	        	            #else
        	        	            	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, EOB_V3TOK, (pANTLR3_UINT8)"EOB")
        	        	            #endif

        	        	            );

        	        	            ADAPTOR->addChild(ADAPTOR, root_1, root_2);
        	        	        }

        	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
        	        	    }

        	        	}


        	        	retval.tree = root_0; // set result root
        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        }
        	    }
        	    break;
        	case 3:
        	    // ANTLRv3.g:418:6: rewrite_tree ( ebnfSuffix -> ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] rewrite_tree EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) ) | -> rewrite_tree )
        	    {
        	        FOLLOWPUSH(FOLLOW_rewrite_tree_in_rewrite_tree_element2776);
        	        rewrite_tree161=rewrite_tree(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulerewrite_tree_elementEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) { CREATE_stream_rewrite_tree; stream_rewrite_tree->add(stream_rewrite_tree, rewrite_tree161.tree, NULL); }

        	        // ANTLRv3.g:419:3: ( ebnfSuffix -> ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] rewrite_tree EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) ) | -> rewrite_tree )
        	        {
        	            int alt76=2;
        	            switch ( LA(1) )
        	            {
        	            case 76:
        	            case 77:
        	            case 85:
        	            	{
        	            		alt76=1;
        	            	}
        	                break;
        	            case EOF:
        	            case ACTION:
        	            case CHAR_LITERAL:
        	            case REWRITE_V3TOK:
        	            case RULE_REF:
        	            case STRING_LITERAL:
        	            case TOKEN_REF:
        	            case TREE_BEGIN_V3TOK:
        	            case 73:
        	            case 74:
        	            case 75:
        	            case 81:
        	            case 94:
        	            	{
        	            		alt76=2;
        	            	}
        	                break;

        	            default:
        	                if (BACKTRACKING>0)
        	                {
        	                    FAILEDFLAG = ANTLR3_TRUE;
        	                    return retval;
        	                }

        	                CONSTRUCTEX();
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
        	                EXCEPTION->message      = (void *)"";
        	                EXCEPTION->decisionNum  = 76;
        	                EXCEPTION->state        = 0;


        	                goto rulerewrite_tree_elementEx;

        	            }

        	            switch (alt76)
        	            {
        	        	case 1:
        	        	    // ANTLRv3.g:419:5: ebnfSuffix
        	        	    {
        	        	        FOLLOWPUSH(FOLLOW_ebnfSuffix_in_rewrite_tree_element2782);
        	        	        ebnfSuffix162=ebnfSuffix(ctx);

        	        	        FOLLOWPOP();
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto rulerewrite_tree_elementEx;
        	        	        }
        	        	        if (HASFAILED())
        	        	        {
        	        	            return retval;
        	        	        }

        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_ebnfSuffix; stream_ebnfSuffix->add(stream_ebnfSuffix, ebnfSuffix162.tree, NULL); }

        	        	        /* AST REWRITE
        	        	         * elements          : ebnfSuffix, rewrite_tree
        	        	         * token labels      : 
        	        	         * rule labels       : retval
        	        	         * token list labels : 
        	        	         * rule list labels  : 
        	        	         */
        	        	        if ( BACKTRACKING==0 ) 

        	        	        {
        	        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	retval.tree    = root_0;
        	        	        	// 420:4: -> ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] rewrite_tree EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) )
        	        	        	{
        	        	        	    // ANTLRv3.g:420:7: ^( ebnfSuffix ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] rewrite_tree EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] ) )
        	        	        	    {
        	        	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_ebnfSuffix == NULL ? NULL : stream_ebnfSuffix->nextNode(stream_ebnfSuffix), root_1));

        	        	        	        // ANTLRv3.g:420:20: ^( BLOCK_V3TOK[\"BLOCK\"] ^( ALT_V3TOK[\"ALT\"] rewrite_tree EOA_V3TOK[\"EOA\"] ) EOB_V3TOK[\"EOB\"] )
        	        	        	        {
        	        	        	            pANTLR3_BASE_TREE root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	            root_2 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 

        	        	        	            #if 1 == 2
        	        	        	            	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, BLOCK_V3TOK, TOKTEXT("BLOCK"))
        	        	        	            #else
        	        	        	            	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, BLOCK_V3TOK, (pANTLR3_UINT8)"BLOCK")
        	        	        	            #endif

        	        	        	            , root_2));

        	        	        	            // ANTLRv3.g:420:43: ^( ALT_V3TOK[\"ALT\"] rewrite_tree EOA_V3TOK[\"EOA\"] )
        	        	        	            {
        	        	        	                pANTLR3_BASE_TREE root_3 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	                root_3 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 

        	        	        	                #if 1 == 2
        	        	        	                	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, ALT_V3TOK, TOKTEXT("ALT"))
        	        	        	                #else
        	        	        	                	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, ALT_V3TOK, (pANTLR3_UINT8)"ALT")
        	        	        	                #endif

        	        	        	                , root_3));

        	        	        	                ADAPTOR->addChild(ADAPTOR, root_3, stream_rewrite_tree == NULL ? NULL : stream_rewrite_tree->nextTree(stream_rewrite_tree));

        	        	        	                ADAPTOR->addChild(ADAPTOR, root_3, 

        	        	        	                #if 1 == 2
        	        	        	                	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, EOA_V3TOK, TOKTEXT("EOA"))
        	        	        	                #else
        	        	        	                	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, EOA_V3TOK, (pANTLR3_UINT8)"EOA")
        	        	        	                #endif

        	        	        	                );

        	        	        	                ADAPTOR->addChild(ADAPTOR, root_2, root_3);
        	        	        	            }

        	        	        	            ADAPTOR->addChild(ADAPTOR, root_2, 

        	        	        	            #if 1 == 2
        	        	        	            	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, EOB_V3TOK, TOKTEXT("EOB"))
        	        	        	            #else
        	        	        	            	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, EOB_V3TOK, (pANTLR3_UINT8)"EOB")
        	        	        	            #endif

        	        	        	            );

        	        	        	            ADAPTOR->addChild(ADAPTOR, root_1, root_2);
        	        	        	        }

        	        	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
        	        	        	    }

        	        	        	}


        	        	        	retval.tree = root_0; // set result root
        	        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        	        }
        	        	    }
        	        	    break;
        	        	case 2:
        	        	    // ANTLRv3.g:421:5: 
        	        	    {
        	        	        /* AST REWRITE
        	        	         * elements          : rewrite_tree
        	        	         * token labels      : 
        	        	         * rule labels       : retval
        	        	         * token list labels : 
        	        	         * rule list labels  : 
        	        	         */
        	        	        if ( BACKTRACKING==0 ) 

        	        	        {
        	        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        	retval.tree    = root_0;
        	        	        	// 421:5: -> rewrite_tree
        	        	        	{
        	        	        	    ADAPTOR->addChild(ADAPTOR, root_0, stream_rewrite_tree == NULL ? NULL : stream_rewrite_tree->nextTree(stream_rewrite_tree));

        	        	        	}


        	        	        	retval.tree = root_0; // set result root
        	        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        	        }
        	        	    }
        	        	    break;

        	            }
        	        }

        	    }
        	    break;
        	case 4:
        	    // ANTLRv3.g:423:6: rewrite_tree_ebnf
        	    {
        	        root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


        	        FOLLOWPUSH(FOLLOW_rewrite_tree_ebnf_in_rewrite_tree_element2828);
        	        rewrite_tree_ebnf163=rewrite_tree_ebnf(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulerewrite_tree_elementEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, rewrite_tree_ebnf163.tree);

        	    }
        	    break;

            }
        }
    }

    // This is where rules clean up and exit
    //
    goto rulerewrite_tree_elementEx; /* Prevent compiler warnings */
    rulerewrite_tree_elementEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_rewrite_tree != NULL) stream_rewrite_tree->free(stream_rewrite_tree);
        if (stream_ebnfSuffix != NULL) stream_ebnfSuffix->free(stream_ebnfSuffix);
        if (stream_rewrite_tree_atom != NULL) stream_rewrite_tree_atom->free(stream_rewrite_tree_atom);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end rewrite_tree_element */

/**
 * $ANTLR start rewrite_tree_atom
 * ANTLRv3.g:426:1: rewrite_tree_atom : ( CHAR_LITERAL | TOKEN_REF ( ARG_ACTION )? -> ^( TOKEN_REF ( ARG_ACTION )? ) | RULE_REF | STRING_LITERAL |d= '$' id -> LABEL_V3TOK[$d,$id.text] | ACTION );
 */
static ANTLRv3Parser_rewrite_tree_atom_return
rewrite_tree_atom(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_rewrite_tree_atom_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    d;
    pANTLR3_COMMON_TOKEN    CHAR_LITERAL164;
    pANTLR3_COMMON_TOKEN    TOKEN_REF165;
    pANTLR3_COMMON_TOKEN    ARG_ACTION166;
    pANTLR3_COMMON_TOKEN    RULE_REF167;
    pANTLR3_COMMON_TOKEN    STRING_LITERAL168;
    pANTLR3_COMMON_TOKEN    ACTION170;
    ANTLRv3Parser_id_return id169;
    #undef	RETURN_TYPE_id169
    #define	RETURN_TYPE_id169 ANTLRv3Parser_id_return

    pANTLR3_BASE_TREE d_tree;
    pANTLR3_BASE_TREE CHAR_LITERAL164_tree;
    pANTLR3_BASE_TREE TOKEN_REF165_tree;
    pANTLR3_BASE_TREE ARG_ACTION166_tree;
    pANTLR3_BASE_TREE RULE_REF167_tree;
    pANTLR3_BASE_TREE STRING_LITERAL168_tree;
    pANTLR3_BASE_TREE ACTION170_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_73;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_TOKEN_REF;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_ARG_ACTION;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_id;
    /* Initialize rule variables
     */

    root_0 = NULL;

    d       = NULL;
    CHAR_LITERAL164       = NULL;
    TOKEN_REF165       = NULL;
    ARG_ACTION166       = NULL;
    RULE_REF167       = NULL;
    STRING_LITERAL168       = NULL;
    ACTION170       = NULL;
    id169.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    d_tree   = NULL;
    CHAR_LITERAL164_tree   = NULL;
    TOKEN_REF165_tree   = NULL;
    ARG_ACTION166_tree   = NULL;
    RULE_REF167_tree   = NULL;
    STRING_LITERAL168_tree   = NULL;
    ACTION170_tree   = NULL;

    stream_73   = NULL;
    #define CREATE_stream_73  if (stream_73 == NULL) {stream_73 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 73"); } 
    stream_TOKEN_REF   = NULL;
    #define CREATE_stream_TOKEN_REF  if (stream_TOKEN_REF == NULL) {stream_TOKEN_REF = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token TOKEN_REF"); } 
    stream_ARG_ACTION   = NULL;
    #define CREATE_stream_ARG_ACTION  if (stream_ARG_ACTION == NULL) {stream_ARG_ACTION = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token ARG_ACTION"); } 
    stream_id   = NULL;
    #define CREATE_stream_id  if (stream_id == NULL) {stream_id = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule id"); }

    retval.tree  = NULL;

    {
        {
            //  ANTLRv3.g:427:5: ( CHAR_LITERAL | TOKEN_REF ( ARG_ACTION )? -> ^( TOKEN_REF ( ARG_ACTION )? ) | RULE_REF | STRING_LITERAL |d= '$' id -> LABEL_V3TOK[$d,$id.text] | ACTION )

            ANTLR3_UINT32 alt79;

            alt79=6;

            switch ( LA(1) )
            {
            case CHAR_LITERAL:
            	{
            		alt79=1;
            	}
                break;
            case TOKEN_REF:
            	{
            		alt79=2;
            	}
                break;
            case RULE_REF:
            	{
            		alt79=3;
            	}
                break;
            case STRING_LITERAL:
            	{
            		alt79=4;
            	}
                break;
            case 73:
            	{
            		alt79=5;
            	}
                break;
            case ACTION:
            	{
            		alt79=6;
            	}
                break;

            default:
                if (BACKTRACKING>0)
                {
                    FAILEDFLAG = ANTLR3_TRUE;
                    return retval;
                }

                CONSTRUCTEX();
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
                EXCEPTION->message      = (void *)"";
                EXCEPTION->decisionNum  = 79;
                EXCEPTION->state        = 0;


                goto rulerewrite_tree_atomEx;

            }

            switch (alt79)
            {
        	case 1:
        	    // ANTLRv3.g:427:9: CHAR_LITERAL
        	    {
        	        root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


        	        CHAR_LITERAL164 = (pANTLR3_COMMON_TOKEN) MATCHT(CHAR_LITERAL, &FOLLOW_CHAR_LITERAL_in_rewrite_tree_atom2844);
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulerewrite_tree_atomEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) {
        	        CHAR_LITERAL164_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, CHAR_LITERAL164));
        	        ADAPTOR->addChild(ADAPTOR, root_0, CHAR_LITERAL164_tree);
        	        }

        	    }
        	    break;
        	case 2:
        	    // ANTLRv3.g:428:6: TOKEN_REF ( ARG_ACTION )?
        	    {
        	        TOKEN_REF165 = (pANTLR3_COMMON_TOKEN) MATCHT(TOKEN_REF, &FOLLOW_TOKEN_REF_in_rewrite_tree_atom2851);
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulerewrite_tree_atomEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }
        	         
        	        if ( BACKTRACKING==0 ) { CREATE_stream_TOKEN_REF; stream_TOKEN_REF->add(stream_TOKEN_REF, TOKEN_REF165, NULL); }


        	        // ANTLRv3.g:428:16: ( ARG_ACTION )?
        	        {
        	            int alt78=2;
        	            switch ( LA(1) )
        	            {
        	                case ARG_ACTION:
        	                	{
        	                		alt78=1;
        	                	}
        	                    break;
        	            }

        	            switch (alt78)
        	            {
        	        	case 1:
        	        	    // ANTLRv3.g:428:16: ARG_ACTION
        	        	    {
        	        	        ARG_ACTION166 = (pANTLR3_COMMON_TOKEN) MATCHT(ARG_ACTION, &FOLLOW_ARG_ACTION_in_rewrite_tree_atom2853);
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto rulerewrite_tree_atomEx;
        	        	        }
        	        	        if (HASFAILED())
        	        	        {
        	        	            return retval;
        	        	        }
        	        	         
        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_ARG_ACTION; stream_ARG_ACTION->add(stream_ARG_ACTION, ARG_ACTION166, NULL); }


        	        	    }
        	        	    break;

        	            }
        	        }

        	        /* AST REWRITE
        	         * elements          : TOKEN_REF, ARG_ACTION
        	         * token labels      : 
        	         * rule labels       : retval
        	         * token list labels : 
        	         * rule list labels  : 
        	         */
        	        if ( BACKTRACKING==0 ) 

        	        {
        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	retval.tree    = root_0;
        	        	// 428:28: -> ^( TOKEN_REF ( ARG_ACTION )? )
        	        	{
        	        	    // ANTLRv3.g:428:31: ^( TOKEN_REF ( ARG_ACTION )? )
        	        	    {
        	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
        	        	        stream_TOKEN_REF == NULL ? NULL : stream_TOKEN_REF->nextNode(stream_TOKEN_REF)
        	        	        , root_1));

        	        	        // ANTLRv3.g:428:43: ( ARG_ACTION )?
        	        	        {
        	        	        	if ( (stream_ARG_ACTION != NULL && stream_ARG_ACTION->hasNext(stream_ARG_ACTION))  )
        	        	        	{
        	        	        		ADAPTOR->addChild(ADAPTOR, root_1, 
        	        	        		stream_ARG_ACTION == NULL ? NULL : stream_ARG_ACTION->nextNode(stream_ARG_ACTION)
        	        	        		);

        	        	        	}
        	        	        	if ( stream_ARG_ACTION != NULL) stream_ARG_ACTION->reset(stream_ARG_ACTION);

        	        	        }

        	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
        	        	    }

        	        	}


        	        	retval.tree = root_0; // set result root
        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        }
        	    }
        	    break;
        	case 3:
        	    // ANTLRv3.g:429:9: RULE_REF
        	    {
        	        root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


        	        RULE_REF167 = (pANTLR3_COMMON_TOKEN) MATCHT(RULE_REF, &FOLLOW_RULE_REF_in_rewrite_tree_atom2874);
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulerewrite_tree_atomEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) {
        	        RULE_REF167_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, RULE_REF167));
        	        ADAPTOR->addChild(ADAPTOR, root_0, RULE_REF167_tree);
        	        }

        	    }
        	    break;
        	case 4:
        	    // ANTLRv3.g:430:6: STRING_LITERAL
        	    {
        	        root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


        	        STRING_LITERAL168 = (pANTLR3_COMMON_TOKEN) MATCHT(STRING_LITERAL, &FOLLOW_STRING_LITERAL_in_rewrite_tree_atom2881);
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulerewrite_tree_atomEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) {
        	        STRING_LITERAL168_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, STRING_LITERAL168));
        	        ADAPTOR->addChild(ADAPTOR, root_0, STRING_LITERAL168_tree);
        	        }

        	    }
        	    break;
        	case 5:
        	    // ANTLRv3.g:431:6: d= '$' id
        	    {
        	        d = (pANTLR3_COMMON_TOKEN) MATCHT(73, &FOLLOW_73_in_rewrite_tree_atom2890);
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulerewrite_tree_atomEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }
        	         
        	        if ( BACKTRACKING==0 ) { CREATE_stream_73; stream_73->add(stream_73, d, NULL); }


        	        FOLLOWPUSH(FOLLOW_id_in_rewrite_tree_atom2892);
        	        id169=id(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulerewrite_tree_atomEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) { CREATE_stream_id; stream_id->add(stream_id, id169.tree, NULL); }

        	        /* AST REWRITE
        	         * elements          : 
        	         * token labels      : 
        	         * rule labels       : retval
        	         * token list labels : 
        	         * rule list labels  : 
        	         */
        	        if ( BACKTRACKING==0 ) 

        	        {
        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	retval.tree    = root_0;
        	        	// 431:15: -> LABEL_V3TOK[$d,$id.text]
        	        	{
        	        	    ADAPTOR->addChild(ADAPTOR, root_0, 

        	        	    #if 2 == 2
        	        	    	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, LABEL_V3TOK, TOKTEXT(d, 
        	        	    (STRSTREAM->toStringTT(STRSTREAM, id169.start, id169.stop))
        	        	    ))
        	        	    #else
        	        	    	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, LABEL_V3TOK, (pANTLR3_UINT8)d, 
        	        	    (STRSTREAM->toStringTT(STRSTREAM, id169.start, id169.stop))
        	        	    )
        	        	    #endif

        	        	    );

        	        	}


        	        	retval.tree = root_0; // set result root
        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        }
        	    }
        	    break;
        	case 6:
        	    // ANTLRv3.g:432:4: ACTION
        	    {
        	        root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


        	        ACTION170 = (pANTLR3_COMMON_TOKEN) MATCHT(ACTION, &FOLLOW_ACTION_in_rewrite_tree_atom2903);
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulerewrite_tree_atomEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) {
        	        ACTION170_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, ACTION170));
        	        ADAPTOR->addChild(ADAPTOR, root_0, ACTION170_tree);
        	        }

        	    }
        	    break;

            }
        }
    }

    // This is where rules clean up and exit
    //
    goto rulerewrite_tree_atomEx; /* Prevent compiler warnings */
    rulerewrite_tree_atomEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_73 != NULL) stream_73->free(stream_73);
        if (stream_TOKEN_REF != NULL) stream_TOKEN_REF->free(stream_TOKEN_REF);
        if (stream_ARG_ACTION != NULL) stream_ARG_ACTION->free(stream_ARG_ACTION);
        if (stream_id != NULL) stream_id->free(stream_id);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end rewrite_tree_atom */

/**
 * $ANTLR start rewrite_tree_ebnf
 * ANTLRv3.g:435:1: rewrite_tree_ebnf : rewrite_tree_block ebnfSuffix -> ^( ebnfSuffix rewrite_tree_block ) ;
 */
static ANTLRv3Parser_rewrite_tree_ebnf_return
rewrite_tree_ebnf(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_rewrite_tree_ebnf_return retval;


    pANTLR3_BASE_TREE root_0;

    ANTLRv3Parser_rewrite_tree_block_return rewrite_tree_block171;
    #undef	RETURN_TYPE_rewrite_tree_block171
    #define	RETURN_TYPE_rewrite_tree_block171 ANTLRv3Parser_rewrite_tree_block_return

    ANTLRv3Parser_ebnfSuffix_return ebnfSuffix172;
    #undef	RETURN_TYPE_ebnfSuffix172
    #define	RETURN_TYPE_ebnfSuffix172 ANTLRv3Parser_ebnfSuffix_return

    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_ebnfSuffix;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_rewrite_tree_block;
    /* Initialize rule variables
     */

    root_0 = NULL;


        pANTLR3_COMMON_TOKEN firstToken = LT(1);

    rewrite_tree_block171.tree = NULL;

    ebnfSuffix172.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;



    stream_ebnfSuffix   = NULL;
    #define CREATE_stream_ebnfSuffix  if (stream_ebnfSuffix == NULL) {stream_ebnfSuffix = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule ebnfSuffix"); }
    stream_rewrite_tree_block   = NULL;
    #define CREATE_stream_rewrite_tree_block  if (stream_rewrite_tree_block == NULL) {stream_rewrite_tree_block = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule rewrite_tree_block"); }

    retval.tree  = NULL;

    {
        // ANTLRv3.g:444:2: ( rewrite_tree_block ebnfSuffix -> ^( ebnfSuffix rewrite_tree_block ) )
        // ANTLRv3.g:444:4: rewrite_tree_block ebnfSuffix
        {
            FOLLOWPUSH(FOLLOW_rewrite_tree_block_in_rewrite_tree_ebnf2924);
            rewrite_tree_block171=rewrite_tree_block(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto rulerewrite_tree_ebnfEx;
            }
            if (HASFAILED())
            {
                return retval;
            }

            if ( BACKTRACKING==0 ) { CREATE_stream_rewrite_tree_block; stream_rewrite_tree_block->add(stream_rewrite_tree_block, rewrite_tree_block171.tree, NULL); }

            FOLLOWPUSH(FOLLOW_ebnfSuffix_in_rewrite_tree_ebnf2926);
            ebnfSuffix172=ebnfSuffix(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto rulerewrite_tree_ebnfEx;
            }
            if (HASFAILED())
            {
                return retval;
            }

            if ( BACKTRACKING==0 ) { CREATE_stream_ebnfSuffix; stream_ebnfSuffix->add(stream_ebnfSuffix, ebnfSuffix172.tree, NULL); }

            /* AST REWRITE
             * elements          : rewrite_tree_block, ebnfSuffix
             * token labels      : 
             * rule labels       : retval
             * token list labels : 
             * rule list labels  : 
             */
            if ( BACKTRACKING==0 ) 

            {
            	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	retval.tree    = root_0;
            	// 444:34: -> ^( ebnfSuffix rewrite_tree_block )
            	{
            	    // ANTLRv3.g:444:37: ^( ebnfSuffix rewrite_tree_block )
            	    {
            	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, stream_ebnfSuffix == NULL ? NULL : stream_ebnfSuffix->nextNode(stream_ebnfSuffix), root_1));

            	        ADAPTOR->addChild(ADAPTOR, root_1, stream_rewrite_tree_block == NULL ? NULL : stream_rewrite_tree_block->nextTree(stream_rewrite_tree_block));

            	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	    }

            	}


            	retval.tree = root_0; // set result root
            	if (stream_retval != NULL) stream_retval->free(stream_retval);


            }
        }

    }

    // This is where rules clean up and exit
    //
    goto rulerewrite_tree_ebnfEx; /* Prevent compiler warnings */
    rulerewrite_tree_ebnfEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_ebnfSuffix != NULL) stream_ebnfSuffix->free(stream_ebnfSuffix);
        if (stream_rewrite_tree_block != NULL) stream_rewrite_tree_block->free(stream_rewrite_tree_block);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
            else
            {
                {

                    	pANTLR3_COMMON_TOKEN token = retval.tree->getToken(retval.tree);
                    	token->setLine(token, firstToken->getLine(firstToken));
                    	token->setCharPositionInLine(token, firstToken->getCharPositionInLine(firstToken));

                }
            }


    return retval;
}
/* $ANTLR end rewrite_tree_ebnf */

/**
 * $ANTLR start rewrite_tree
 * ANTLRv3.g:447:1: rewrite_tree : '^(' rewrite_tree_atom ( rewrite_tree_element )* ')' -> ^( TREE_BEGIN_V3TOK rewrite_tree_atom ( rewrite_tree_element )* ) ;
 */
static ANTLRv3Parser_rewrite_tree_return
rewrite_tree(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_rewrite_tree_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    string_literal173;
    pANTLR3_COMMON_TOKEN    char_literal176;
    ANTLRv3Parser_rewrite_tree_atom_return rewrite_tree_atom174;
    #undef	RETURN_TYPE_rewrite_tree_atom174
    #define	RETURN_TYPE_rewrite_tree_atom174 ANTLRv3Parser_rewrite_tree_atom_return

    ANTLRv3Parser_rewrite_tree_element_return rewrite_tree_element175;
    #undef	RETURN_TYPE_rewrite_tree_element175
    #define	RETURN_TYPE_rewrite_tree_element175 ANTLRv3Parser_rewrite_tree_element_return

    pANTLR3_BASE_TREE string_literal173_tree;
    pANTLR3_BASE_TREE char_literal176_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_TREE_BEGIN_V3TOK;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_75;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_rewrite_tree_element;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_rewrite_tree_atom;
    /* Initialize rule variables
     */

    root_0 = NULL;

    string_literal173       = NULL;
    char_literal176       = NULL;
    rewrite_tree_atom174.tree = NULL;

    rewrite_tree_element175.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    string_literal173_tree   = NULL;
    char_literal176_tree   = NULL;

    stream_TREE_BEGIN_V3TOK   = NULL;
    #define CREATE_stream_TREE_BEGIN_V3TOK  if (stream_TREE_BEGIN_V3TOK == NULL) {stream_TREE_BEGIN_V3TOK = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token TREE_BEGIN_V3TOK"); } 
    stream_75   = NULL;
    #define CREATE_stream_75  if (stream_75 == NULL) {stream_75 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 75"); } 
    stream_rewrite_tree_element   = NULL;
    #define CREATE_stream_rewrite_tree_element  if (stream_rewrite_tree_element == NULL) {stream_rewrite_tree_element = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule rewrite_tree_element"); }
    stream_rewrite_tree_atom   = NULL;
    #define CREATE_stream_rewrite_tree_atom  if (stream_rewrite_tree_atom == NULL) {stream_rewrite_tree_atom = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule rewrite_tree_atom"); }

    retval.tree  = NULL;

    {
        // ANTLRv3.g:448:2: ( '^(' rewrite_tree_atom ( rewrite_tree_element )* ')' -> ^( TREE_BEGIN_V3TOK rewrite_tree_atom ( rewrite_tree_element )* ) )
        // ANTLRv3.g:448:4: '^(' rewrite_tree_atom ( rewrite_tree_element )* ')'
        {
            string_literal173 = (pANTLR3_COMMON_TOKEN) MATCHT(TREE_BEGIN_V3TOK, &FOLLOW_TREE_BEGIN_V3TOK_in_rewrite_tree2946);
            if  (HASEXCEPTION())
            {
                goto rulerewrite_treeEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_TREE_BEGIN_V3TOK; stream_TREE_BEGIN_V3TOK->add(stream_TREE_BEGIN_V3TOK, string_literal173, NULL); }


            FOLLOWPUSH(FOLLOW_rewrite_tree_atom_in_rewrite_tree2948);
            rewrite_tree_atom174=rewrite_tree_atom(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto rulerewrite_treeEx;
            }
            if (HASFAILED())
            {
                return retval;
            }

            if ( BACKTRACKING==0 ) { CREATE_stream_rewrite_tree_atom; stream_rewrite_tree_atom->add(stream_rewrite_tree_atom, rewrite_tree_atom174.tree, NULL); }

            // ANTLRv3.g:448:27: ( rewrite_tree_element )*

            for (;;)
            {
                int alt80=2;
                switch ( LA(1) )
                {
                case ACTION:
                case CHAR_LITERAL:
                case RULE_REF:
                case STRING_LITERAL:
                case TOKEN_REF:
                case TREE_BEGIN_V3TOK:
                case 73:
                case 74:
                	{
                		alt80=1;
                	}
                    break;

                }

                switch (alt80)
                {
            	case 1:
            	    // ANTLRv3.g:448:27: rewrite_tree_element
            	    {
            	        FOLLOWPUSH(FOLLOW_rewrite_tree_element_in_rewrite_tree2950);
            	        rewrite_tree_element175=rewrite_tree_element(ctx);

            	        FOLLOWPOP();
            	        if  (HASEXCEPTION())
            	        {
            	            goto rulerewrite_treeEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }

            	        if ( BACKTRACKING==0 ) { CREATE_stream_rewrite_tree_element; stream_rewrite_tree_element->add(stream_rewrite_tree_element, rewrite_tree_element175.tree, NULL); }

            	    }
            	    break;

            	default:
            	    goto loop80;	/* break out of the loop */
            	    break;
                }
            }
            loop80: ; /* Jump out to here if this rule does not match */


            char_literal176 = (pANTLR3_COMMON_TOKEN) MATCHT(75, &FOLLOW_75_in_rewrite_tree2953);
            if  (HASEXCEPTION())
            {
                goto rulerewrite_treeEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_75; stream_75->add(stream_75, char_literal176, NULL); }


            /* AST REWRITE
             * elements          : rewrite_tree_atom, rewrite_tree_element
             * token labels      : 
             * rule labels       : retval
             * token list labels : 
             * rule list labels  : 
             */
            if ( BACKTRACKING==0 ) 

            {
            	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	retval.tree    = root_0;
            	// 449:3: -> ^( TREE_BEGIN_V3TOK rewrite_tree_atom ( rewrite_tree_element )* )
            	{
            	    // ANTLRv3.g:449:6: ^( TREE_BEGIN_V3TOK rewrite_tree_atom ( rewrite_tree_element )* )
            	    {
            	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
            	        (pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, TREE_BEGIN_V3TOK, (pANTLR3_UINT8)"TREE_BEGIN_V3TOK")
            	        , root_1));

            	        ADAPTOR->addChild(ADAPTOR, root_1, stream_rewrite_tree_atom == NULL ? NULL : stream_rewrite_tree_atom->nextTree(stream_rewrite_tree_atom));

            	        // ANTLRv3.g:449:43: ( rewrite_tree_element )*
            	        {
            	        	while ( (stream_rewrite_tree_element != NULL && stream_rewrite_tree_element->hasNext(stream_rewrite_tree_element))  )
            	        	{
            	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_rewrite_tree_element == NULL ? NULL : stream_rewrite_tree_element->nextTree(stream_rewrite_tree_element));

            	        	}
            	        	if (stream_rewrite_tree_element != NULL) stream_rewrite_tree_element->reset(stream_rewrite_tree_element);

            	        }

            	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	    }

            	}


            	retval.tree = root_0; // set result root
            	if (stream_retval != NULL) stream_retval->free(stream_retval);


            }
        }

    }

    // This is where rules clean up and exit
    //
    goto rulerewrite_treeEx; /* Prevent compiler warnings */
    rulerewrite_treeEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_TREE_BEGIN_V3TOK != NULL) stream_TREE_BEGIN_V3TOK->free(stream_TREE_BEGIN_V3TOK);
        if (stream_75 != NULL) stream_75->free(stream_75);
        if (stream_rewrite_tree_element != NULL) stream_rewrite_tree_element->free(stream_rewrite_tree_element);
        if (stream_rewrite_tree_atom != NULL) stream_rewrite_tree_atom->free(stream_rewrite_tree_atom);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end rewrite_tree */

/**
 * $ANTLR start rewrite_template
 * ANTLRv3.g:463:1: rewrite_template : ( id lp= '(' rewrite_template_args ')' (str= DOUBLE_QUOTE_STRING_LITERAL |str= DOUBLE_ANGLE_STRING_LITERAL ) -> ^( TEMPLATE_V3TOK[$lp,\"TEMPLATE\"] id rewrite_template_args $str) | rewrite_template_ref | rewrite_indirect_template_head | ACTION );
 */
static ANTLRv3Parser_rewrite_template_return
rewrite_template(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_rewrite_template_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    lp;
    pANTLR3_COMMON_TOKEN    str;
    pANTLR3_COMMON_TOKEN    char_literal179;
    pANTLR3_COMMON_TOKEN    ACTION182;
    ANTLRv3Parser_id_return id177;
    #undef	RETURN_TYPE_id177
    #define	RETURN_TYPE_id177 ANTLRv3Parser_id_return

    ANTLRv3Parser_rewrite_template_args_return rewrite_template_args178;
    #undef	RETURN_TYPE_rewrite_template_args178
    #define	RETURN_TYPE_rewrite_template_args178 ANTLRv3Parser_rewrite_template_args_return

    ANTLRv3Parser_rewrite_template_ref_return rewrite_template_ref180;
    #undef	RETURN_TYPE_rewrite_template_ref180
    #define	RETURN_TYPE_rewrite_template_ref180 ANTLRv3Parser_rewrite_template_ref_return

    ANTLRv3Parser_rewrite_indirect_template_head_return rewrite_indirect_template_head181;
    #undef	RETURN_TYPE_rewrite_indirect_template_head181
    #define	RETURN_TYPE_rewrite_indirect_template_head181 ANTLRv3Parser_rewrite_indirect_template_head_return

    pANTLR3_BASE_TREE lp_tree;
    pANTLR3_BASE_TREE str_tree;
    pANTLR3_BASE_TREE char_literal179_tree;
    pANTLR3_BASE_TREE ACTION182_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_DOUBLE_QUOTE_STRING_LITERAL;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_DOUBLE_ANGLE_STRING_LITERAL;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_74;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_75;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_id;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_rewrite_template_args;
    /* Initialize rule variables
     */

    root_0 = NULL;

    lp       = NULL;
    str       = NULL;
    char_literal179       = NULL;
    ACTION182       = NULL;
    id177.tree = NULL;

    rewrite_template_args178.tree = NULL;

    rewrite_template_ref180.tree = NULL;

    rewrite_indirect_template_head181.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    lp_tree   = NULL;
    str_tree   = NULL;
    char_literal179_tree   = NULL;
    ACTION182_tree   = NULL;

    stream_DOUBLE_QUOTE_STRING_LITERAL   = NULL;
    #define CREATE_stream_DOUBLE_QUOTE_STRING_LITERAL  if (stream_DOUBLE_QUOTE_STRING_LITERAL == NULL) {stream_DOUBLE_QUOTE_STRING_LITERAL = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token DOUBLE_QUOTE_STRING_LITERAL"); } 
    stream_DOUBLE_ANGLE_STRING_LITERAL   = NULL;
    #define CREATE_stream_DOUBLE_ANGLE_STRING_LITERAL  if (stream_DOUBLE_ANGLE_STRING_LITERAL == NULL) {stream_DOUBLE_ANGLE_STRING_LITERAL = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token DOUBLE_ANGLE_STRING_LITERAL"); } 
    stream_74   = NULL;
    #define CREATE_stream_74  if (stream_74 == NULL) {stream_74 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 74"); } 
    stream_75   = NULL;
    #define CREATE_stream_75  if (stream_75 == NULL) {stream_75 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 75"); } 
    stream_id   = NULL;
    #define CREATE_stream_id  if (stream_id == NULL) {stream_id = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule id"); }
    stream_rewrite_template_args   = NULL;
    #define CREATE_stream_rewrite_template_args  if (stream_rewrite_template_args == NULL) {stream_rewrite_template_args = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule rewrite_template_args"); }

    retval.tree  = NULL;

    {
        {
            //  ANTLRv3.g:464:2: ( id lp= '(' rewrite_template_args ')' (str= DOUBLE_QUOTE_STRING_LITERAL |str= DOUBLE_ANGLE_STRING_LITERAL ) -> ^( TEMPLATE_V3TOK[$lp,\"TEMPLATE\"] id rewrite_template_args $str) | rewrite_template_ref | rewrite_indirect_template_head | ACTION )

            ANTLR3_UINT32 alt82;

            alt82=4;

            alt82 = cdfa82.predict(ctx, RECOGNIZER, ISTREAM, &cdfa82);
            if  (HASEXCEPTION())
            {
                goto rulerewrite_templateEx;
            }
            if (HASFAILED())
            {
                return retval;
            }

            switch (alt82)
            {
        	case 1:
        	    // ANTLRv3.g:465:3: id lp= '(' rewrite_template_args ')' (str= DOUBLE_QUOTE_STRING_LITERAL |str= DOUBLE_ANGLE_STRING_LITERAL )
        	    {
        	        FOLLOWPUSH(FOLLOW_id_in_rewrite_template2985);
        	        id177=id(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulerewrite_templateEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) { CREATE_stream_id; stream_id->add(stream_id, id177.tree, NULL); }

        	        lp = (pANTLR3_COMMON_TOKEN) MATCHT(74, &FOLLOW_74_in_rewrite_template2989);
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulerewrite_templateEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }
        	         
        	        if ( BACKTRACKING==0 ) { CREATE_stream_74; stream_74->add(stream_74, lp, NULL); }


        	        FOLLOWPUSH(FOLLOW_rewrite_template_args_in_rewrite_template2991);
        	        rewrite_template_args178=rewrite_template_args(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulerewrite_templateEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) { CREATE_stream_rewrite_template_args; stream_rewrite_template_args->add(stream_rewrite_template_args, rewrite_template_args178.tree, NULL); }

        	        char_literal179 = (pANTLR3_COMMON_TOKEN) MATCHT(75, &FOLLOW_75_in_rewrite_template2993);
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulerewrite_templateEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }
        	         
        	        if ( BACKTRACKING==0 ) { CREATE_stream_75; stream_75->add(stream_75, char_literal179, NULL); }


        	        // ANTLRv3.g:466:3: (str= DOUBLE_QUOTE_STRING_LITERAL |str= DOUBLE_ANGLE_STRING_LITERAL )
        	        {
        	            int alt81=2;
        	            switch ( LA(1) )
        	            {
        	            case DOUBLE_QUOTE_STRING_LITERAL:
        	            	{
        	            		alt81=1;
        	            	}
        	                break;
        	            case DOUBLE_ANGLE_STRING_LITERAL:
        	            	{
        	            		alt81=2;
        	            	}
        	                break;

        	            default:
        	                if (BACKTRACKING>0)
        	                {
        	                    FAILEDFLAG = ANTLR3_TRUE;
        	                    return retval;
        	                }

        	                CONSTRUCTEX();
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
        	                EXCEPTION->message      = (void *)"";
        	                EXCEPTION->decisionNum  = 81;
        	                EXCEPTION->state        = 0;


        	                goto rulerewrite_templateEx;

        	            }

        	            switch (alt81)
        	            {
        	        	case 1:
        	        	    // ANTLRv3.g:466:5: str= DOUBLE_QUOTE_STRING_LITERAL
        	        	    {
        	        	        str = (pANTLR3_COMMON_TOKEN) MATCHT(DOUBLE_QUOTE_STRING_LITERAL, &FOLLOW_DOUBLE_QUOTE_STRING_LITERAL_in_rewrite_template3001);
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto rulerewrite_templateEx;
        	        	        }
        	        	        if (HASFAILED())
        	        	        {
        	        	            return retval;
        	        	        }
        	        	         
        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_DOUBLE_QUOTE_STRING_LITERAL; stream_DOUBLE_QUOTE_STRING_LITERAL->add(stream_DOUBLE_QUOTE_STRING_LITERAL, str, NULL); }


        	        	    }
        	        	    break;
        	        	case 2:
        	        	    // ANTLRv3.g:466:39: str= DOUBLE_ANGLE_STRING_LITERAL
        	        	    {
        	        	        str = (pANTLR3_COMMON_TOKEN) MATCHT(DOUBLE_ANGLE_STRING_LITERAL, &FOLLOW_DOUBLE_ANGLE_STRING_LITERAL_in_rewrite_template3007);
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto rulerewrite_templateEx;
        	        	        }
        	        	        if (HASFAILED())
        	        	        {
        	        	            return retval;
        	        	        }
        	        	         
        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_DOUBLE_ANGLE_STRING_LITERAL; stream_DOUBLE_ANGLE_STRING_LITERAL->add(stream_DOUBLE_ANGLE_STRING_LITERAL, str, NULL); }


        	        	    }
        	        	    break;

        	            }
        	        }

        	        /* AST REWRITE
        	         * elements          : id, rewrite_template_args, str
        	         * token labels      : str
        	         * rule labels       : retval
        	         * token list labels : 
        	         * rule list labels  : 
        	         */
        	        if ( BACKTRACKING==0 ) 

        	        {
        	        	pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_str;
        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	stream_str=antlr3RewriteRuleTOKENStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token str", str);
        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	retval.tree    = root_0;
        	        	// 467:3: -> ^( TEMPLATE_V3TOK[$lp,\"TEMPLATE\"] id rewrite_template_args $str)
        	        	{
        	        	    // ANTLRv3.g:467:6: ^( TEMPLATE_V3TOK[$lp,\"TEMPLATE\"] id rewrite_template_args $str)
        	        	    {
        	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 

        	        	        #if 2 == 2
        	        	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, TEMPLATE_V3TOK, TOKTEXT(lp, "TEMPLATE"))
        	        	        #else
        	        	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, TEMPLATE_V3TOK, (pANTLR3_UINT8)lp, "TEMPLATE")
        	        	        #endif

        	        	        , root_1));

        	        	        ADAPTOR->addChild(ADAPTOR, root_1, stream_id == NULL ? NULL : stream_id->nextTree(stream_id));

        	        	        ADAPTOR->addChild(ADAPTOR, root_1, stream_rewrite_template_args == NULL ? NULL : stream_rewrite_template_args->nextTree(stream_rewrite_template_args));

        	        	        ADAPTOR->addChild(ADAPTOR, root_1, stream_str == NULL ? NULL : stream_str->nextNode(stream_str));

        	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
        	        	    }

        	        	}


        	        	retval.tree = root_0; // set result root
        	        	if (stream_str != NULL) stream_str->free(stream_str); 
        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        }
        	    }
        	    break;
        	case 2:
        	    // ANTLRv3.g:470:3: rewrite_template_ref
        	    {
        	        root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


        	        FOLLOWPUSH(FOLLOW_rewrite_template_ref_in_rewrite_template3034);
        	        rewrite_template_ref180=rewrite_template_ref(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulerewrite_templateEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, rewrite_template_ref180.tree);

        	    }
        	    break;
        	case 3:
        	    // ANTLRv3.g:473:3: rewrite_indirect_template_head
        	    {
        	        root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


        	        FOLLOWPUSH(FOLLOW_rewrite_indirect_template_head_in_rewrite_template3043);
        	        rewrite_indirect_template_head181=rewrite_indirect_template_head(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulerewrite_templateEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, rewrite_indirect_template_head181.tree);

        	    }
        	    break;
        	case 4:
        	    // ANTLRv3.g:476:3: ACTION
        	    {
        	        root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


        	        ACTION182 = (pANTLR3_COMMON_TOKEN) MATCHT(ACTION, &FOLLOW_ACTION_in_rewrite_template3052);
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulerewrite_templateEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) {
        	        ACTION182_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, ACTION182));
        	        ADAPTOR->addChild(ADAPTOR, root_0, ACTION182_tree);
        	        }

        	    }
        	    break;

            }
        }
    }

    // This is where rules clean up and exit
    //
    goto rulerewrite_templateEx; /* Prevent compiler warnings */
    rulerewrite_templateEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_DOUBLE_QUOTE_STRING_LITERAL != NULL) stream_DOUBLE_QUOTE_STRING_LITERAL->free(stream_DOUBLE_QUOTE_STRING_LITERAL);
        if (stream_DOUBLE_ANGLE_STRING_LITERAL != NULL) stream_DOUBLE_ANGLE_STRING_LITERAL->free(stream_DOUBLE_ANGLE_STRING_LITERAL);
        if (stream_74 != NULL) stream_74->free(stream_74);
        if (stream_75 != NULL) stream_75->free(stream_75);
        if (stream_id != NULL) stream_id->free(stream_id);
        if (stream_rewrite_template_args != NULL) stream_rewrite_template_args->free(stream_rewrite_template_args);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end rewrite_template */

/**
 * $ANTLR start rewrite_template_ref
 * ANTLRv3.g:480:1: rewrite_template_ref : id lp= '(' rewrite_template_args ')' -> ^( TEMPLATE_V3TOK[$lp,\"TEMPLATE\"] id rewrite_template_args ) ;
 */
static ANTLRv3Parser_rewrite_template_ref_return
rewrite_template_ref(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_rewrite_template_ref_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    lp;
    pANTLR3_COMMON_TOKEN    char_literal185;
    ANTLRv3Parser_id_return id183;
    #undef	RETURN_TYPE_id183
    #define	RETURN_TYPE_id183 ANTLRv3Parser_id_return

    ANTLRv3Parser_rewrite_template_args_return rewrite_template_args184;
    #undef	RETURN_TYPE_rewrite_template_args184
    #define	RETURN_TYPE_rewrite_template_args184 ANTLRv3Parser_rewrite_template_args_return

    pANTLR3_BASE_TREE lp_tree;
    pANTLR3_BASE_TREE char_literal185_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_74;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_75;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_id;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_rewrite_template_args;
    /* Initialize rule variables
     */

    root_0 = NULL;

    lp       = NULL;
    char_literal185       = NULL;
    id183.tree = NULL;

    rewrite_template_args184.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    lp_tree   = NULL;
    char_literal185_tree   = NULL;

    stream_74   = NULL;
    #define CREATE_stream_74  if (stream_74 == NULL) {stream_74 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 74"); } 
    stream_75   = NULL;
    #define CREATE_stream_75  if (stream_75 == NULL) {stream_75 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 75"); } 
    stream_id   = NULL;
    #define CREATE_stream_id  if (stream_id == NULL) {stream_id = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule id"); }
    stream_rewrite_template_args   = NULL;
    #define CREATE_stream_rewrite_template_args  if (stream_rewrite_template_args == NULL) {stream_rewrite_template_args = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule rewrite_template_args"); }

    retval.tree  = NULL;

    {
        // ANTLRv3.g:481:2: ( id lp= '(' rewrite_template_args ')' -> ^( TEMPLATE_V3TOK[$lp,\"TEMPLATE\"] id rewrite_template_args ) )
        // ANTLRv3.g:481:4: id lp= '(' rewrite_template_args ')'
        {
            FOLLOWPUSH(FOLLOW_id_in_rewrite_template_ref3065);
            id183=id(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto rulerewrite_template_refEx;
            }
            if (HASFAILED())
            {
                return retval;
            }

            if ( BACKTRACKING==0 ) { CREATE_stream_id; stream_id->add(stream_id, id183.tree, NULL); }

            lp = (pANTLR3_COMMON_TOKEN) MATCHT(74, &FOLLOW_74_in_rewrite_template_ref3069);
            if  (HASEXCEPTION())
            {
                goto rulerewrite_template_refEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_74; stream_74->add(stream_74, lp, NULL); }


            FOLLOWPUSH(FOLLOW_rewrite_template_args_in_rewrite_template_ref3071);
            rewrite_template_args184=rewrite_template_args(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto rulerewrite_template_refEx;
            }
            if (HASFAILED())
            {
                return retval;
            }

            if ( BACKTRACKING==0 ) { CREATE_stream_rewrite_template_args; stream_rewrite_template_args->add(stream_rewrite_template_args, rewrite_template_args184.tree, NULL); }

            char_literal185 = (pANTLR3_COMMON_TOKEN) MATCHT(75, &FOLLOW_75_in_rewrite_template_ref3073);
            if  (HASEXCEPTION())
            {
                goto rulerewrite_template_refEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_75; stream_75->add(stream_75, char_literal185, NULL); }


            /* AST REWRITE
             * elements          : rewrite_template_args, id
             * token labels      : 
             * rule labels       : retval
             * token list labels : 
             * rule list labels  : 
             */
            if ( BACKTRACKING==0 ) 

            {
            	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	retval.tree    = root_0;
            	// 482:3: -> ^( TEMPLATE_V3TOK[$lp,\"TEMPLATE\"] id rewrite_template_args )
            	{
            	    // ANTLRv3.g:482:6: ^( TEMPLATE_V3TOK[$lp,\"TEMPLATE\"] id rewrite_template_args )
            	    {
            	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 

            	        #if 2 == 2
            	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, TEMPLATE_V3TOK, TOKTEXT(lp, "TEMPLATE"))
            	        #else
            	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, TEMPLATE_V3TOK, (pANTLR3_UINT8)lp, "TEMPLATE")
            	        #endif

            	        , root_1));

            	        ADAPTOR->addChild(ADAPTOR, root_1, stream_id == NULL ? NULL : stream_id->nextTree(stream_id));

            	        ADAPTOR->addChild(ADAPTOR, root_1, stream_rewrite_template_args == NULL ? NULL : stream_rewrite_template_args->nextTree(stream_rewrite_template_args));

            	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	    }

            	}


            	retval.tree = root_0; // set result root
            	if (stream_retval != NULL) stream_retval->free(stream_retval);


            }
        }

    }

    // This is where rules clean up and exit
    //
    goto rulerewrite_template_refEx; /* Prevent compiler warnings */
    rulerewrite_template_refEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_74 != NULL) stream_74->free(stream_74);
        if (stream_75 != NULL) stream_75->free(stream_75);
        if (stream_id != NULL) stream_id->free(stream_id);
        if (stream_rewrite_template_args != NULL) stream_rewrite_template_args->free(stream_rewrite_template_args);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end rewrite_template_ref */

/**
 * $ANTLR start rewrite_indirect_template_head
 * ANTLRv3.g:486:1: rewrite_indirect_template_head : lp= '(' ACTION ')' '(' rewrite_template_args ')' -> ^( TEMPLATE_V3TOK[$lp,\"TEMPLATE\"] ACTION rewrite_template_args ) ;
 */
static ANTLRv3Parser_rewrite_indirect_template_head_return
rewrite_indirect_template_head(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_rewrite_indirect_template_head_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    lp;
    pANTLR3_COMMON_TOKEN    ACTION186;
    pANTLR3_COMMON_TOKEN    char_literal187;
    pANTLR3_COMMON_TOKEN    char_literal188;
    pANTLR3_COMMON_TOKEN    char_literal190;
    ANTLRv3Parser_rewrite_template_args_return rewrite_template_args189;
    #undef	RETURN_TYPE_rewrite_template_args189
    #define	RETURN_TYPE_rewrite_template_args189 ANTLRv3Parser_rewrite_template_args_return

    pANTLR3_BASE_TREE lp_tree;
    pANTLR3_BASE_TREE ACTION186_tree;
    pANTLR3_BASE_TREE char_literal187_tree;
    pANTLR3_BASE_TREE char_literal188_tree;
    pANTLR3_BASE_TREE char_literal190_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_ACTION;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_74;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_75;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_rewrite_template_args;
    /* Initialize rule variables
     */

    root_0 = NULL;

    lp       = NULL;
    ACTION186       = NULL;
    char_literal187       = NULL;
    char_literal188       = NULL;
    char_literal190       = NULL;
    rewrite_template_args189.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    lp_tree   = NULL;
    ACTION186_tree   = NULL;
    char_literal187_tree   = NULL;
    char_literal188_tree   = NULL;
    char_literal190_tree   = NULL;

    stream_ACTION   = NULL;
    #define CREATE_stream_ACTION  if (stream_ACTION == NULL) {stream_ACTION = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token ACTION"); } 
    stream_74   = NULL;
    #define CREATE_stream_74  if (stream_74 == NULL) {stream_74 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 74"); } 
    stream_75   = NULL;
    #define CREATE_stream_75  if (stream_75 == NULL) {stream_75 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 75"); } 
    stream_rewrite_template_args   = NULL;
    #define CREATE_stream_rewrite_template_args  if (stream_rewrite_template_args == NULL) {stream_rewrite_template_args = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule rewrite_template_args"); }

    retval.tree  = NULL;

    {
        // ANTLRv3.g:487:2: (lp= '(' ACTION ')' '(' rewrite_template_args ')' -> ^( TEMPLATE_V3TOK[$lp,\"TEMPLATE\"] ACTION rewrite_template_args ) )
        // ANTLRv3.g:487:4: lp= '(' ACTION ')' '(' rewrite_template_args ')'
        {
            lp = (pANTLR3_COMMON_TOKEN) MATCHT(74, &FOLLOW_74_in_rewrite_indirect_template_head3101);
            if  (HASEXCEPTION())
            {
                goto rulerewrite_indirect_template_headEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_74; stream_74->add(stream_74, lp, NULL); }


            ACTION186 = (pANTLR3_COMMON_TOKEN) MATCHT(ACTION, &FOLLOW_ACTION_in_rewrite_indirect_template_head3103);
            if  (HASEXCEPTION())
            {
                goto rulerewrite_indirect_template_headEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_ACTION; stream_ACTION->add(stream_ACTION, ACTION186, NULL); }


            char_literal187 = (pANTLR3_COMMON_TOKEN) MATCHT(75, &FOLLOW_75_in_rewrite_indirect_template_head3105);
            if  (HASEXCEPTION())
            {
                goto rulerewrite_indirect_template_headEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_75; stream_75->add(stream_75, char_literal187, NULL); }


            char_literal188 = (pANTLR3_COMMON_TOKEN) MATCHT(74, &FOLLOW_74_in_rewrite_indirect_template_head3107);
            if  (HASEXCEPTION())
            {
                goto rulerewrite_indirect_template_headEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_74; stream_74->add(stream_74, char_literal188, NULL); }


            FOLLOWPUSH(FOLLOW_rewrite_template_args_in_rewrite_indirect_template_head3109);
            rewrite_template_args189=rewrite_template_args(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto rulerewrite_indirect_template_headEx;
            }
            if (HASFAILED())
            {
                return retval;
            }

            if ( BACKTRACKING==0 ) { CREATE_stream_rewrite_template_args; stream_rewrite_template_args->add(stream_rewrite_template_args, rewrite_template_args189.tree, NULL); }

            char_literal190 = (pANTLR3_COMMON_TOKEN) MATCHT(75, &FOLLOW_75_in_rewrite_indirect_template_head3111);
            if  (HASEXCEPTION())
            {
                goto rulerewrite_indirect_template_headEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_75; stream_75->add(stream_75, char_literal190, NULL); }


            /* AST REWRITE
             * elements          : rewrite_template_args, ACTION
             * token labels      : 
             * rule labels       : retval
             * token list labels : 
             * rule list labels  : 
             */
            if ( BACKTRACKING==0 ) 

            {
            	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	retval.tree    = root_0;
            	// 488:3: -> ^( TEMPLATE_V3TOK[$lp,\"TEMPLATE\"] ACTION rewrite_template_args )
            	{
            	    // ANTLRv3.g:488:6: ^( TEMPLATE_V3TOK[$lp,\"TEMPLATE\"] ACTION rewrite_template_args )
            	    {
            	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 

            	        #if 2 == 2
            	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, TEMPLATE_V3TOK, TOKTEXT(lp, "TEMPLATE"))
            	        #else
            	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, TEMPLATE_V3TOK, (pANTLR3_UINT8)lp, "TEMPLATE")
            	        #endif

            	        , root_1));

            	        ADAPTOR->addChild(ADAPTOR, root_1, 
            	        stream_ACTION == NULL ? NULL : stream_ACTION->nextNode(stream_ACTION)
            	        );

            	        ADAPTOR->addChild(ADAPTOR, root_1, stream_rewrite_template_args == NULL ? NULL : stream_rewrite_template_args->nextTree(stream_rewrite_template_args));

            	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	    }

            	}


            	retval.tree = root_0; // set result root
            	if (stream_retval != NULL) stream_retval->free(stream_retval);


            }
        }

    }

    // This is where rules clean up and exit
    //
    goto rulerewrite_indirect_template_headEx; /* Prevent compiler warnings */
    rulerewrite_indirect_template_headEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_ACTION != NULL) stream_ACTION->free(stream_ACTION);
        if (stream_74 != NULL) stream_74->free(stream_74);
        if (stream_75 != NULL) stream_75->free(stream_75);
        if (stream_rewrite_template_args != NULL) stream_rewrite_template_args->free(stream_rewrite_template_args);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end rewrite_indirect_template_head */

/**
 * $ANTLR start rewrite_template_args
 * ANTLRv3.g:491:1: rewrite_template_args : ( rewrite_template_arg ( ',' rewrite_template_arg )* -> ^( ARGLIST_V3TOK ( rewrite_template_arg )+ ) | -> ARGLIST_V3TOK );
 */
static ANTLRv3Parser_rewrite_template_args_return
rewrite_template_args(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_rewrite_template_args_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    char_literal192;
    ANTLRv3Parser_rewrite_template_arg_return rewrite_template_arg191;
    #undef	RETURN_TYPE_rewrite_template_arg191
    #define	RETURN_TYPE_rewrite_template_arg191 ANTLRv3Parser_rewrite_template_arg_return

    ANTLRv3Parser_rewrite_template_arg_return rewrite_template_arg193;
    #undef	RETURN_TYPE_rewrite_template_arg193
    #define	RETURN_TYPE_rewrite_template_arg193 ANTLRv3Parser_rewrite_template_arg_return

    pANTLR3_BASE_TREE char_literal192_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_78;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_rewrite_template_arg;
    /* Initialize rule variables
     */

    root_0 = NULL;

    char_literal192       = NULL;
    rewrite_template_arg191.tree = NULL;

    rewrite_template_arg193.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    char_literal192_tree   = NULL;

    stream_78   = NULL;
    #define CREATE_stream_78  if (stream_78 == NULL) {stream_78 = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token 78"); } 
    stream_rewrite_template_arg   = NULL;
    #define CREATE_stream_rewrite_template_arg  if (stream_rewrite_template_arg == NULL) {stream_rewrite_template_arg = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule rewrite_template_arg"); }

    retval.tree  = NULL;

    {
        {
            //  ANTLRv3.g:492:2: ( rewrite_template_arg ( ',' rewrite_template_arg )* -> ^( ARGLIST_V3TOK ( rewrite_template_arg )+ ) | -> ARGLIST_V3TOK )

            ANTLR3_UINT32 alt84;

            alt84=2;

            switch ( LA(1) )
            {
            case RULE_REF:
            case TOKEN_REF:
            	{
            		alt84=1;
            	}
                break;
            case 75:
            	{
            		alt84=2;
            	}
                break;

            default:
                if (BACKTRACKING>0)
                {
                    FAILEDFLAG = ANTLR3_TRUE;
                    return retval;
                }

                CONSTRUCTEX();
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
                EXCEPTION->message      = (void *)"";
                EXCEPTION->decisionNum  = 84;
                EXCEPTION->state        = 0;


                goto rulerewrite_template_argsEx;

            }

            switch (alt84)
            {
        	case 1:
        	    // ANTLRv3.g:492:4: rewrite_template_arg ( ',' rewrite_template_arg )*
        	    {
        	        FOLLOWPUSH(FOLLOW_rewrite_template_arg_in_rewrite_template_args3135);
        	        rewrite_template_arg191=rewrite_template_arg(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulerewrite_template_argsEx;
        	        }
        	        if (HASFAILED())
        	        {
        	            return retval;
        	        }

        	        if ( BACKTRACKING==0 ) { CREATE_stream_rewrite_template_arg; stream_rewrite_template_arg->add(stream_rewrite_template_arg, rewrite_template_arg191.tree, NULL); }

        	        // ANTLRv3.g:492:25: ( ',' rewrite_template_arg )*

        	        for (;;)
        	        {
        	            int alt83=2;
        	            switch ( LA(1) )
        	            {
        	            case 78:
        	            	{
        	            		alt83=1;
        	            	}
        	                break;

        	            }

        	            switch (alt83)
        	            {
        	        	case 1:
        	        	    // ANTLRv3.g:492:26: ',' rewrite_template_arg
        	        	    {
        	        	        char_literal192 = (pANTLR3_COMMON_TOKEN) MATCHT(78, &FOLLOW_78_in_rewrite_template_args3138);
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto rulerewrite_template_argsEx;
        	        	        }
        	        	        if (HASFAILED())
        	        	        {
        	        	            return retval;
        	        	        }
        	        	         
        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_78; stream_78->add(stream_78, char_literal192, NULL); }


        	        	        FOLLOWPUSH(FOLLOW_rewrite_template_arg_in_rewrite_template_args3140);
        	        	        rewrite_template_arg193=rewrite_template_arg(ctx);

        	        	        FOLLOWPOP();
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto rulerewrite_template_argsEx;
        	        	        }
        	        	        if (HASFAILED())
        	        	        {
        	        	            return retval;
        	        	        }

        	        	        if ( BACKTRACKING==0 ) { CREATE_stream_rewrite_template_arg; stream_rewrite_template_arg->add(stream_rewrite_template_arg, rewrite_template_arg193.tree, NULL); }

        	        	    }
        	        	    break;

        	        	default:
        	        	    goto loop83;	/* break out of the loop */
        	        	    break;
        	            }
        	        }
        	        loop83: ; /* Jump out to here if this rule does not match */


        	        /* AST REWRITE
        	         * elements          : rewrite_template_arg
        	         * token labels      : 
        	         * rule labels       : retval
        	         * token list labels : 
        	         * rule list labels  : 
        	         */
        	        if ( BACKTRACKING==0 ) 

        	        {
        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	retval.tree    = root_0;
        	        	// 493:3: -> ^( ARGLIST_V3TOK ( rewrite_template_arg )+ )
        	        	{
        	        	    // ANTLRv3.g:493:6: ^( ARGLIST_V3TOK ( rewrite_template_arg )+ )
        	        	    {
        	        	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 
        	        	        (pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, ARGLIST_V3TOK, (pANTLR3_UINT8)"ARGLIST_V3TOK")
        	        	        , root_1));

        	        	        if ((stream_rewrite_template_arg == NULL || !stream_rewrite_template_arg->hasNext(stream_rewrite_template_arg))  )
        	        	        {
        	        	            CONSTRUCTEX();
        	        	            EXCEPTION->type         = ANTLR3_REWRITE_EARLY_EXCEPTION;
        	        	            EXCEPTION->name         = (void *)ANTLR3_REWRITE_EARLY_EXCEPTION_NAME;
        	        	        }
        	        	        else
        	        	        {
        	        	        	while ( (stream_rewrite_template_arg->hasNext(stream_rewrite_template_arg))  ) {
        	        	        		ADAPTOR->addChild(ADAPTOR, root_1, stream_rewrite_template_arg == NULL ? NULL : stream_rewrite_template_arg->nextTree(stream_rewrite_template_arg));

        	        	        	}
        	        	        	stream_rewrite_template_arg->reset(stream_rewrite_template_arg);

        	        	        }
        	        	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
        	        	    }

        	        	}


        	        	retval.tree = root_0; // set result root
        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        }
        	    }
        	    break;
        	case 2:
        	    // ANTLRv3.g:494:4: 
        	    {
        	        /* AST REWRITE
        	         * elements          : 
        	         * token labels      : 
        	         * rule labels       : retval
        	         * token list labels : 
        	         * rule list labels  : 
        	         */
        	        if ( BACKTRACKING==0 ) 

        	        {
        	        	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

        	        	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

        	        	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
        	        	retval.tree    = root_0;
        	        	// 494:4: -> ARGLIST_V3TOK
        	        	{
        	        	    ADAPTOR->addChild(ADAPTOR, root_0, 
        	        	    (pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, ARGLIST_V3TOK, (pANTLR3_UINT8)"ARGLIST_V3TOK")
        	        	    );

        	        	}


        	        	retval.tree = root_0; // set result root
        	        	if (stream_retval != NULL) stream_retval->free(stream_retval);


        	        }
        	    }
        	    break;

            }
        }
    }

    // This is where rules clean up and exit
    //
    goto rulerewrite_template_argsEx; /* Prevent compiler warnings */
    rulerewrite_template_argsEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_78 != NULL) stream_78->free(stream_78);
        if (stream_rewrite_template_arg != NULL) stream_rewrite_template_arg->free(stream_rewrite_template_arg);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end rewrite_template_args */

/**
 * $ANTLR start rewrite_template_arg
 * ANTLRv3.g:497:1: rewrite_template_arg : id '=' ACTION -> ^( ARG_V3TOK[$id.start] id ACTION ) ;
 */
static ANTLRv3Parser_rewrite_template_arg_return
rewrite_template_arg(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_rewrite_template_arg_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    char_literal195;
    pANTLR3_COMMON_TOKEN    ACTION196;
    ANTLRv3Parser_id_return id194;
    #undef	RETURN_TYPE_id194
    #define	RETURN_TYPE_id194 ANTLRv3Parser_id_return

    pANTLR3_BASE_TREE char_literal195_tree;
    pANTLR3_BASE_TREE ACTION196_tree;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_ACTION;
    pANTLR3_REWRITE_RULE_TOKEN_STREAM stream_LABEL_ASSIGN_V3TOK;
    pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_id;
    /* Initialize rule variables
     */

    root_0 = NULL;

    char_literal195       = NULL;
    ACTION196       = NULL;
    id194.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    char_literal195_tree   = NULL;
    ACTION196_tree   = NULL;

    stream_ACTION   = NULL;
    #define CREATE_stream_ACTION  if (stream_ACTION == NULL) {stream_ACTION = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token ACTION"); } 
    stream_LABEL_ASSIGN_V3TOK   = NULL;
    #define CREATE_stream_LABEL_ASSIGN_V3TOK  if (stream_LABEL_ASSIGN_V3TOK == NULL) {stream_LABEL_ASSIGN_V3TOK = antlr3RewriteRuleTOKENStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"token LABEL_ASSIGN_V3TOK"); } 
    stream_id   = NULL;
    #define CREATE_stream_id  if (stream_id == NULL) {stream_id = antlr3RewriteRuleSubtreeStreamNewAE(ADAPTOR, RECOGNIZER, (pANTLR3_UINT8)"rule id"); }

    retval.tree  = NULL;

    {
        // ANTLRv3.g:498:2: ( id '=' ACTION -> ^( ARG_V3TOK[$id.start] id ACTION ) )
        // ANTLRv3.g:498:6: id '=' ACTION
        {
            FOLLOWPUSH(FOLLOW_id_in_rewrite_template_arg3173);
            id194=id(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto rulerewrite_template_argEx;
            }
            if (HASFAILED())
            {
                return retval;
            }

            if ( BACKTRACKING==0 ) { CREATE_stream_id; stream_id->add(stream_id, id194.tree, NULL); }

            char_literal195 = (pANTLR3_COMMON_TOKEN) MATCHT(LABEL_ASSIGN_V3TOK, &FOLLOW_LABEL_ASSIGN_V3TOK_in_rewrite_template_arg3175);
            if  (HASEXCEPTION())
            {
                goto rulerewrite_template_argEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_LABEL_ASSIGN_V3TOK; stream_LABEL_ASSIGN_V3TOK->add(stream_LABEL_ASSIGN_V3TOK, char_literal195, NULL); }


            ACTION196 = (pANTLR3_COMMON_TOKEN) MATCHT(ACTION, &FOLLOW_ACTION_in_rewrite_template_arg3177);
            if  (HASEXCEPTION())
            {
                goto rulerewrite_template_argEx;
            }
            if (HASFAILED())
            {
                return retval;
            }
             
            if ( BACKTRACKING==0 ) { CREATE_stream_ACTION; stream_ACTION->add(stream_ACTION, ACTION196, NULL); }


            /* AST REWRITE
             * elements          : ACTION, id
             * token labels      : 
             * rule labels       : retval
             * token list labels : 
             * rule list labels  : 
             */
            if ( BACKTRACKING==0 ) 

            {
            	pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream_retval;

            	stream_retval=antlr3RewriteRuleSubtreeStreamNewAEE(ADAPTOR,  RECOGNIZER, (pANTLR3_UINT8)"token retval", retval.tree != NULL ? retval.tree : NULL);

            	root_0			    = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	retval.tree    = root_0;
            	// 498:20: -> ^( ARG_V3TOK[$id.start] id ACTION )
            	{
            	    // ANTLRv3.g:498:23: ^( ARG_V3TOK[$id.start] id ACTION )
            	    {
            	        pANTLR3_BASE_TREE root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));
            	        root_1 = (pANTLR3_BASE_TREE)(ADAPTOR->becomeRoot(ADAPTOR, 

            	        #if 1 == 2
            	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeTokenText(ADAPTOR, ARG_V3TOK, TOKTEXT((id194.start)))
            	        #else
            	        	(pANTLR3_BASE_TREE)ADAPTOR->createTypeText(ADAPTOR, ARG_V3TOK, (pANTLR3_UINT8)(id194.start))
            	        #endif

            	        , root_1));

            	        ADAPTOR->addChild(ADAPTOR, root_1, stream_id == NULL ? NULL : stream_id->nextTree(stream_id));

            	        ADAPTOR->addChild(ADAPTOR, root_1, 
            	        stream_ACTION == NULL ? NULL : stream_ACTION->nextNode(stream_ACTION)
            	        );

            	        ADAPTOR->addChild(ADAPTOR, root_0, root_1);
            	    }

            	}


            	retval.tree = root_0; // set result root
            	if (stream_retval != NULL) stream_retval->free(stream_retval);


            }
        }

    }

    // This is where rules clean up and exit
    //
    goto rulerewrite_template_argEx; /* Prevent compiler warnings */
    rulerewrite_template_argEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
        if (stream_ACTION != NULL) stream_ACTION->free(stream_ACTION);
        if (stream_LABEL_ASSIGN_V3TOK != NULL) stream_LABEL_ASSIGN_V3TOK->free(stream_LABEL_ASSIGN_V3TOK);
        if (stream_id != NULL) stream_id->free(stream_id);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end rewrite_template_arg */

/**
 * $ANTLR start qid
 * ANTLRv3.g:501:1: qid : id ( DOT_SYM id )* ;
 */
static ANTLRv3Parser_qid_return
qid(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_qid_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    DOT_SYM198;
    ANTLRv3Parser_id_return id197;
    #undef	RETURN_TYPE_id197
    #define	RETURN_TYPE_id197 ANTLRv3Parser_id_return

    ANTLRv3Parser_id_return id199;
    #undef	RETURN_TYPE_id199
    #define	RETURN_TYPE_id199 ANTLRv3Parser_id_return

    pANTLR3_BASE_TREE DOT_SYM198_tree;

    /* Initialize rule variables
     */

    root_0 = NULL;

    DOT_SYM198       = NULL;
    id197.tree = NULL;

    id199.tree = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    DOT_SYM198_tree   = NULL;


    retval.tree  = NULL;

    {
        // ANTLRv3.g:501:5: ( id ( DOT_SYM id )* )
        // ANTLRv3.g:501:7: id ( DOT_SYM id )*
        {
            root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


            FOLLOWPUSH(FOLLOW_id_in_qid3198);
            id197=id(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto ruleqidEx;
            }
            if (HASFAILED())
            {
                return retval;
            }

            if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, id197.tree);

            // ANTLRv3.g:501:10: ( DOT_SYM id )*

            for (;;)
            {
                int alt85=2;
                switch ( LA(1) )
                {
                case DOT_SYM:
                	{
                		alt85=1;
                	}
                    break;

                }

                switch (alt85)
                {
            	case 1:
            	    // ANTLRv3.g:501:11: DOT_SYM id
            	    {
            	        DOT_SYM198 = (pANTLR3_COMMON_TOKEN) MATCHT(DOT_SYM, &FOLLOW_DOT_SYM_in_qid3201);
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleqidEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }

            	        if ( BACKTRACKING==0 ) {
            	        DOT_SYM198_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, DOT_SYM198));
            	        ADAPTOR->addChild(ADAPTOR, root_0, DOT_SYM198_tree);
            	        }

            	        FOLLOWPUSH(FOLLOW_id_in_qid3203);
            	        id199=id(ctx);

            	        FOLLOWPOP();
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleqidEx;
            	        }
            	        if (HASFAILED())
            	        {
            	            return retval;
            	        }

            	        if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, id199.tree);

            	    }
            	    break;

            	default:
            	    goto loop85;	/* break out of the loop */
            	    break;
                }
            }
            loop85: ; /* Jump out to here if this rule does not match */


        }

    }

    // This is where rules clean up and exit
    //
    goto ruleqidEx; /* Prevent compiler warnings */
    ruleqidEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    return retval;
}
/* $ANTLR end qid */

/**
 * $ANTLR start id
 * ANTLRv3.g:503:1: id : ( TOKEN_REF | RULE_REF );
 */
static ANTLRv3Parser_id_return
id(pANTLRv3Parser ctx)
{
    ANTLRv3Parser_id_return retval;


    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    set200;

    pANTLR3_BASE_TREE set200_tree;

    /* Initialize rule variables
     */

    root_0 = NULL;

    set200       = NULL;
    retval.start = LT(1); retval.stop = retval.start;


    set200_tree   = NULL;


    retval.tree  = NULL;

    {
        // ANTLRv3.g:503:4: ( TOKEN_REF | RULE_REF )
        // ANTLRv3.g:
        {
            root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


            set200=(pANTLR3_COMMON_TOKEN)LT(1);

            if ( LA(1) == RULE_REF || LA(1) == TOKEN_REF )
            {
                CONSUME();
                if ( BACKTRACKING==0 ) ADAPTOR->addChild(ADAPTOR, root_0, 
                (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, set200))
                );
                PERRORRECOVERY=ANTLR3_FALSE;
                FAILEDFLAG=ANTLR3_FALSE;

            }
            else
            {
                if (BACKTRACKING>0)
                {
                    FAILEDFLAG = ANTLR3_TRUE;
                    return retval;
                }

                CONSTRUCTEX();
                EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
                EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
                EXCEPTION->expectingSet = NULL;

                goto ruleidEx;
            }


        }

    }

    // This is where rules clean up and exit
    //
    goto ruleidEx; /* Prevent compiler warnings */
    ruleidEx: ;
    retval.stop = LT(-1);


    if ( BACKTRACKING==0 )
    {

    	retval.stop = LT(-1);

    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);
    }


            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }
    {

        	// There are limitations in the C target generator which prevent us
        	// from using the target neutral constructs to change the token type.
        	retval.start->setType(retval.start, ID_V3TOK);

    }

    return retval;
}
/* $ANTLR end id */

// $ANTLR start synpred100_ANTLRv3
static void synpred100_ANTLRv3_fragment(pANTLRv3Parser ctx )
{
    // ANTLRv3.g:400:4: ( rewrite_template )
    // ANTLRv3.g:400:4: rewrite_template
    {
        FOLLOWPUSH(FOLLOW_rewrite_template_in_synpred100_ANTLRv32622);
        rewrite_template(ctx);

        FOLLOWPOP();
        if  (HASEXCEPTION())
        {
            goto rulesynpred100_ANTLRv3Ex;
        }
        if (HASFAILED())
        {
            return ;
        }


    }

// This is where rules clean up and exit
//
goto rulesynpred100_ANTLRv3Ex; /* Prevent compiler warnings */
rulesynpred100_ANTLRv3Ex: ;

}
// $ANTLR end synpred100_ANTLRv3

// $ANTLR start synpred101_ANTLRv3
static void synpred101_ANTLRv3_fragment(pANTLRv3Parser ctx )
{
    // ANTLRv3.g:401:4: ( rewrite_tree_alternative )
    // ANTLRv3.g:401:4: rewrite_tree_alternative
    {
        FOLLOWPUSH(FOLLOW_rewrite_tree_alternative_in_synpred101_ANTLRv32627);
        rewrite_tree_alternative(ctx);

        FOLLOWPOP();
        if  (HASEXCEPTION())
        {
            goto rulesynpred101_ANTLRv3Ex;
        }
        if (HASFAILED())
        {
            return ;
        }


    }

// This is where rules clean up and exit
//
goto rulesynpred101_ANTLRv3Ex; /* Prevent compiler warnings */
rulesynpred101_ANTLRv3Ex: ;

}
// $ANTLR end synpred101_ANTLRv3
/* End of parsing rules
 * ==============================================
 */

/* ==============================================
 * Syntactic predicates
 */
static ANTLR3_BOOLEAN synpred100_ANTLRv3(pANTLRv3Parser ctx)
{
    ANTLR3_MARKER   start;
    ANTLR3_BOOLEAN  success;

    BACKTRACKING++;
    start	= MARK();
    synpred100_ANTLRv3_fragment(ctx);	    // can never throw exception
    success	= !(FAILEDFLAG);
    REWIND(start);
    BACKTRACKING--;
    FAILEDFLAG	= ANTLR3_FALSE;
    return success;
}
static ANTLR3_BOOLEAN synpred101_ANTLRv3(pANTLRv3Parser ctx)
{
    ANTLR3_MARKER   start;
    ANTLR3_BOOLEAN  success;

    BACKTRACKING++;
    start	= MARK();
    synpred101_ANTLRv3_fragment(ctx);	    // can never throw exception
    success	= !(FAILEDFLAG);
    REWIND(start);
    BACKTRACKING--;
    FAILEDFLAG	= ANTLR3_FALSE;
    return success;
}

/* End of syntactic predicates
 * ==============================================
 */






/* End of code
 * =============================================================================
 */
