/** \file
 *  This C source file was generated by $ANTLR version 3.2 Sep 23, 2009 12:02:23
 *
 *     -  From the grammar source file : /home/luca/NetBeansProjects/7.15/PP.g
 *     -                            On : 2010-09-27 15:01:13
 *     -                for the parser : PPParserParser *
 * Editing it, at least manually, is not wise. 
 *
 * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
 *
 *
*/
// [The "BSD licence"]
// 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.

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

/**
   ANTLR-3.2 grammar for a C PreProcessor recognizing one-line macro definitions
   and expanding them in single-pass operation. Ellipsis as argument list 
   is not recognized.
*/




/* 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)   pPPParser_##scope##_SCOPE
#define SCOPE_STACK(scope)  pPPParser_##scope##Stack
#define	SCOPE_TOP(scope)    ctx->pPPParser_##scope##Top
#define	SCOPE_SIZE(scope)		ctx->pPPParser_##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
#define	    FOLLOWPUSH(x)					FOLLOWSTACK->push(FOLLOWSTACK, ((void *)(&(x))), NULL)
#define	    FOLLOWPOP()						FOLLOWSTACK->pop(FOLLOWSTACK)
#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.
 */



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

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



/** \brief Table of all token names in symbolic order, mainly used for
 *         error reporting.
 */
pANTLR3_UINT8   PPParserTokenNames[8+4]
     = {
        (pANTLR3_UINT8) "<invalid>",       /* String to print to indicate an invalid token */
        (pANTLR3_UINT8) "<EOR>",
        (pANTLR3_UINT8) "<DOWN>", 
        (pANTLR3_UINT8) "<UP>", 
        (pANTLR3_UINT8) "NEWLINE",
        (pANTLR3_UINT8) "DEFINE",
        (pANTLR3_UINT8) "WS",
        (pANTLR3_UINT8) "ID",
        (pANTLR3_UINT8) "LP",
        (pANTLR3_UINT8) "COMMA",
        (pANTLR3_UINT8) "RP",
        (pANTLR3_UINT8) "ANYCHAR"
       };
    const char * 
    ruleNames[] =
    	{
    		"invalidRule", "macroExpansion", "macArgs", "restOfLine", "macroParam", 
    		"sourceText", "macroDefinition", "mArg", "preprocess", "procLine", 
    		"emptyBlock"
    	};
     
    static ANTLR3_UINT32 ruleLevel = 0;
    static ANTLR3_UINT32 getRuleLevel() 
    { 
    	return ruleLevel; 
    }
    static void incRuleLevel() 
    { 
    	ruleLevel++; 
    }
    static void decRuleLevel() 
    { 
    	ruleLevel--; 
    } 

    static ANTLR3_BOOLEAN 
    evalPredicate(pPPParser ctx, ANTLR3_BOOLEAN result, const char * predicate) 
    {
        DBG->semanticPredicate(DBG, result, predicate);
        return result;
    }


// Forward declare the locally static matching functions we have generated.
//
static void	preprocess    (pPPParser ctx);
static void	procLine    (pPPParser ctx);
static PPParser_macroDefinition_return	macroDefinition    (pPPParser ctx);
static void	macroParam    (pPPParser ctx, map<string, int> map);
static PPParser_restOfLine_return	restOfLine    (pPPParser ctx, MacroDef m);
static pANTLR3_STRING	macroExpansion    (pPPParser ctx);
static void	macArgs    (pPPParser ctx);
static void	mArg    (pPPParser ctx);
static void	emptyBlock    (pPPParser ctx);
static PPParser_sourceText_return	sourceText    (pPPParser ctx);
static void	PPParserFree(pPPParser 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[] = "/home/luca/NetBeansProjects/7.15/PP.g";

/** \brief Return the name of the grammar file that generated this code.
 */
static const char * getGrammarFileName()
{
	return fileName;
}
/** \brief Create a new PPParser 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 pPPParser
PPParserNew   (pANTLR3_COMMON_TOKEN_STREAM instream)
{
	// See if we can create a new parser with the standard constructor
	//
	return PPParserNewSSD(instream, NULL);
}

/** \brief Create a new PPParser 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 pPPParser
PPParserNewSSD   (pANTLR3_COMMON_TOKEN_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
{
    pPPParser ctx;	    /* Context structure we will build and return   */
    
    ctx	= (pPPParser) ANTLR3_CALLOC(1, sizeof(PPParser));
    
    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 PPParser.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 PPParser interface
     */
    ctx->preprocess	= preprocess;
    ctx->procLine	= procLine;
    ctx->macroDefinition	= macroDefinition;
    ctx->macroParam	= macroParam;
    ctx->restOfLine	= restOfLine;
    ctx->macroExpansion	= macroExpansion;
    ctx->macArgs	= macArgs;
    ctx->mArg	= mArg;
    ctx->emptyBlock	= emptyBlock;
    ctx->sourceText	= sourceText;
    ctx->free			= PPParserFree;
    ctx->getGrammarFileName	= getGrammarFileName;
    
    /* Install the scope pushing methods.
     */

        
    

	
    /* Install the token table
     */
    PSRSTATE->tokenNames   = PPParserTokenNames;
    
     
    {
    	// DEBUG MODE code
    	//
    	pANTLR3_DEBUG_EVENT_LISTENER	 proxy;
    	proxy = antlr3DebugListenerNew();
    	proxy->grammarFileName = INPUT->tokenSource->strFactory->newStr8(INPUT->tokenSource->strFactory, (pANTLR3_UINT8)ctx->getGrammarFileName());
    	
    	PARSER->setDebugListener(PARSER, proxy);

    	// Try to connect to the debugger (waits forever for a connection)
    	//	
    	proxy->handshake(proxy);
    	
    	// End DEBUG MODE code
    	//
    }
    
    /* Return the newly built parser to the caller
     */
    return  ctx;
}

/** Free the parser resources
 */
 static void
 PPParserFree(pPPParser ctx)
 {
    /* Free any scope memory
     */
    
        
	// 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 PPParserTokenNames; 
}


    	std::string& operator+=(std::string& a, const pANTLR3_STRING& b) {
        		return a += reinterpret_cast<char*>(b->chars);
    	}
    	std::string& std::string::operator=(const pANTLR3_STRING& b) {
        		return string(reinterpret_cast<char*>(b->chars));
    	}
    	/*
    	std::string::operator std::string(const pANTLR3_STRING& b) {
        		return reinterpret_cast<char*>(b->chars);
    	}*/
    	map<string, MacroDef> macro;

    
/* Declare the bitsets
 */

/** Bitset defining follow set for error recovery in rule state: FOLLOW_procLine_in_preprocess59  */
static	ANTLR3_BITWORD FOLLOW_procLine_in_preprocess59_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000FF0) };
static  ANTLR3_BITSET_LIST FOLLOW_procLine_in_preprocess59	= { FOLLOW_procLine_in_preprocess59_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_EOF_in_preprocess62  */
static	ANTLR3_BITWORD FOLLOW_EOF_in_preprocess62_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_EOF_in_preprocess62	= { FOLLOW_EOF_in_preprocess62_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_NEWLINE_in_procLine115  */
static	ANTLR3_BITWORD FOLLOW_NEWLINE_in_procLine115_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000FF0) };
static  ANTLR3_BITSET_LIST FOLLOW_NEWLINE_in_procLine115	= { FOLLOW_NEWLINE_in_procLine115_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_macroDefinition_in_procLine125  */
static	ANTLR3_BITWORD FOLLOW_macroDefinition_in_procLine125_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000012) };
static  ANTLR3_BITSET_LIST FOLLOW_macroDefinition_in_procLine125	= { FOLLOW_macroDefinition_in_procLine125_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_NEWLINE_in_procLine129  */
static	ANTLR3_BITWORD FOLLOW_NEWLINE_in_procLine129_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_NEWLINE_in_procLine129	= { FOLLOW_NEWLINE_in_procLine129_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_macroExpansion_in_procLine159  */
static	ANTLR3_BITWORD FOLLOW_macroExpansion_in_procLine159_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_macroExpansion_in_procLine159	= { FOLLOW_macroExpansion_in_procLine159_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_sourceText_in_procLine188  */
static	ANTLR3_BITWORD FOLLOW_sourceText_in_procLine188_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000012) };
static  ANTLR3_BITSET_LIST FOLLOW_sourceText_in_procLine188	= { FOLLOW_sourceText_in_procLine188_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_NEWLINE_in_procLine195  */
static	ANTLR3_BITWORD FOLLOW_NEWLINE_in_procLine195_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000012) };
static  ANTLR3_BITSET_LIST FOLLOW_NEWLINE_in_procLine195	= { FOLLOW_NEWLINE_in_procLine195_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_DEFINE_in_macroDefinition250  */
static	ANTLR3_BITWORD FOLLOW_DEFINE_in_macroDefinition250_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000040) };
static  ANTLR3_BITSET_LIST FOLLOW_DEFINE_in_macroDefinition250	= { FOLLOW_DEFINE_in_macroDefinition250_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_WS_in_macroDefinition252  */
static	ANTLR3_BITWORD FOLLOW_WS_in_macroDefinition252_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000080) };
static  ANTLR3_BITSET_LIST FOLLOW_WS_in_macroDefinition252	= { FOLLOW_WS_in_macroDefinition252_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_macroDefinition256  */
static	ANTLR3_BITWORD FOLLOW_ID_in_macroDefinition256_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000100) };
static  ANTLR3_BITSET_LIST FOLLOW_ID_in_macroDefinition256	= { FOLLOW_ID_in_macroDefinition256_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LP_in_macroDefinition258  */
static	ANTLR3_BITWORD FOLLOW_LP_in_macroDefinition258_bits[]	= { ANTLR3_UINT64_LIT(0x00000000000004C0) };
static  ANTLR3_BITSET_LIST FOLLOW_LP_in_macroDefinition258	= { FOLLOW_LP_in_macroDefinition258_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_WS_in_macroDefinition260  */
static	ANTLR3_BITWORD FOLLOW_WS_in_macroDefinition260_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000480) };
static  ANTLR3_BITSET_LIST FOLLOW_WS_in_macroDefinition260	= { FOLLOW_WS_in_macroDefinition260_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_macroParam_in_macroDefinition264  */
static	ANTLR3_BITWORD FOLLOW_macroParam_in_macroDefinition264_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000640) };
static  ANTLR3_BITSET_LIST FOLLOW_macroParam_in_macroDefinition264	= { FOLLOW_macroParam_in_macroDefinition264_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_WS_in_macroDefinition267  */
static	ANTLR3_BITWORD FOLLOW_WS_in_macroDefinition267_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000600) };
static  ANTLR3_BITSET_LIST FOLLOW_WS_in_macroDefinition267	= { FOLLOW_WS_in_macroDefinition267_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_macroDefinition271  */
static	ANTLR3_BITWORD FOLLOW_COMMA_in_macroDefinition271_bits[]	= { ANTLR3_UINT64_LIT(0x00000000000000C0) };
static  ANTLR3_BITSET_LIST FOLLOW_COMMA_in_macroDefinition271	= { FOLLOW_COMMA_in_macroDefinition271_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_WS_in_macroDefinition273  */
static	ANTLR3_BITWORD FOLLOW_WS_in_macroDefinition273_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000080) };
static  ANTLR3_BITSET_LIST FOLLOW_WS_in_macroDefinition273	= { FOLLOW_WS_in_macroDefinition273_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_macroParam_in_macroDefinition276  */
static	ANTLR3_BITWORD FOLLOW_macroParam_in_macroDefinition276_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000640) };
static  ANTLR3_BITSET_LIST FOLLOW_macroParam_in_macroDefinition276	= { FOLLOW_macroParam_in_macroDefinition276_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_WS_in_macroDefinition279  */
static	ANTLR3_BITWORD FOLLOW_WS_in_macroDefinition279_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000600) };
static  ANTLR3_BITSET_LIST FOLLOW_WS_in_macroDefinition279	= { FOLLOW_WS_in_macroDefinition279_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RP_in_macroDefinition286  */
static	ANTLR3_BITWORD FOLLOW_RP_in_macroDefinition286_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000FE0) };
static  ANTLR3_BITSET_LIST FOLLOW_RP_in_macroDefinition286	= { FOLLOW_RP_in_macroDefinition286_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_WS_in_macroDefinition288  */
static	ANTLR3_BITWORD FOLLOW_WS_in_macroDefinition288_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000FE0) };
static  ANTLR3_BITSET_LIST FOLLOW_WS_in_macroDefinition288	= { FOLLOW_WS_in_macroDefinition288_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_restOfLine_in_macroDefinition293  */
static	ANTLR3_BITWORD FOLLOW_restOfLine_in_macroDefinition293_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_restOfLine_in_macroDefinition293	= { FOLLOW_restOfLine_in_macroDefinition293_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_DEFINE_in_macroDefinition332  */
static	ANTLR3_BITWORD FOLLOW_DEFINE_in_macroDefinition332_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000040) };
static  ANTLR3_BITSET_LIST FOLLOW_DEFINE_in_macroDefinition332	= { FOLLOW_DEFINE_in_macroDefinition332_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_WS_in_macroDefinition334  */
static	ANTLR3_BITWORD FOLLOW_WS_in_macroDefinition334_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000080) };
static  ANTLR3_BITSET_LIST FOLLOW_WS_in_macroDefinition334	= { FOLLOW_WS_in_macroDefinition334_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_macroDefinition338  */
static	ANTLR3_BITWORD FOLLOW_ID_in_macroDefinition338_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000FE0) };
static  ANTLR3_BITSET_LIST FOLLOW_ID_in_macroDefinition338	= { FOLLOW_ID_in_macroDefinition338_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_WS_in_macroDefinition340  */
static	ANTLR3_BITWORD FOLLOW_WS_in_macroDefinition340_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000FE0) };
static  ANTLR3_BITSET_LIST FOLLOW_WS_in_macroDefinition340	= { FOLLOW_WS_in_macroDefinition340_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_restOfLine_in_macroDefinition345  */
static	ANTLR3_BITWORD FOLLOW_restOfLine_in_macroDefinition345_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_restOfLine_in_macroDefinition345	= { FOLLOW_restOfLine_in_macroDefinition345_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_macroParam405  */
static	ANTLR3_BITWORD FOLLOW_ID_in_macroParam405_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_ID_in_macroParam405	= { FOLLOW_ID_in_macroParam405_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_restOfLine436  */
static	ANTLR3_BITWORD FOLLOW_set_in_restOfLine436_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000FE2) };
static  ANTLR3_BITSET_LIST FOLLOW_set_in_restOfLine436	= { FOLLOW_set_in_restOfLine436_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_macroExpansion475  */
static	ANTLR3_BITWORD FOLLOW_ID_in_macroExpansion475_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000150) };
static  ANTLR3_BITSET_LIST FOLLOW_ID_in_macroExpansion475	= { FOLLOW_ID_in_macroExpansion475_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_emptyBlock_in_macroExpansion477  */
static	ANTLR3_BITWORD FOLLOW_emptyBlock_in_macroExpansion477_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000150) };
static  ANTLR3_BITSET_LIST FOLLOW_emptyBlock_in_macroExpansion477	= { FOLLOW_emptyBlock_in_macroExpansion477_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LP_in_macroExpansion480  */
static	ANTLR3_BITWORD FOLLOW_LP_in_macroExpansion480_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000450) };
static  ANTLR3_BITSET_LIST FOLLOW_LP_in_macroExpansion480	= { FOLLOW_LP_in_macroExpansion480_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_emptyBlock_in_macroExpansion482  */
static	ANTLR3_BITWORD FOLLOW_emptyBlock_in_macroExpansion482_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000450) };
static  ANTLR3_BITSET_LIST FOLLOW_emptyBlock_in_macroExpansion482	= { FOLLOW_emptyBlock_in_macroExpansion482_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RP_in_macroExpansion485  */
static	ANTLR3_BITWORD FOLLOW_RP_in_macroExpansion485_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_RP_in_macroExpansion485	= { FOLLOW_RP_in_macroExpansion485_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_ID_in_macroExpansion505  */
static	ANTLR3_BITWORD FOLLOW_ID_in_macroExpansion505_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000150) };
static  ANTLR3_BITSET_LIST FOLLOW_ID_in_macroExpansion505	= { FOLLOW_ID_in_macroExpansion505_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_emptyBlock_in_macroExpansion507  */
static	ANTLR3_BITWORD FOLLOW_emptyBlock_in_macroExpansion507_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000150) };
static  ANTLR3_BITSET_LIST FOLLOW_emptyBlock_in_macroExpansion507	= { FOLLOW_emptyBlock_in_macroExpansion507_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_LP_in_macroExpansion510  */
static	ANTLR3_BITWORD FOLLOW_LP_in_macroExpansion510_bits[]	= { ANTLR3_UINT64_LIT(0x00000000000009F0) };
static  ANTLR3_BITSET_LIST FOLLOW_LP_in_macroExpansion510	= { FOLLOW_LP_in_macroExpansion510_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_emptyBlock_in_macroExpansion512  */
static	ANTLR3_BITWORD FOLLOW_emptyBlock_in_macroExpansion512_bits[]	= { ANTLR3_UINT64_LIT(0x00000000000009F0) };
static  ANTLR3_BITSET_LIST FOLLOW_emptyBlock_in_macroExpansion512	= { FOLLOW_emptyBlock_in_macroExpansion512_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_macArgs_in_macroExpansion515  */
static	ANTLR3_BITWORD FOLLOW_macArgs_in_macroExpansion515_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000450) };
static  ANTLR3_BITSET_LIST FOLLOW_macArgs_in_macroExpansion515	= { FOLLOW_macArgs_in_macroExpansion515_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_emptyBlock_in_macroExpansion517  */
static	ANTLR3_BITWORD FOLLOW_emptyBlock_in_macroExpansion517_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000450) };
static  ANTLR3_BITSET_LIST FOLLOW_emptyBlock_in_macroExpansion517	= { FOLLOW_emptyBlock_in_macroExpansion517_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_RP_in_macroExpansion520  */
static	ANTLR3_BITWORD FOLLOW_RP_in_macroExpansion520_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_RP_in_macroExpansion520	= { FOLLOW_RP_in_macroExpansion520_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_mArg_in_macArgs548  */
static	ANTLR3_BITWORD FOLLOW_mArg_in_macArgs548_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000252) };
static  ANTLR3_BITSET_LIST FOLLOW_mArg_in_macArgs548	= { FOLLOW_mArg_in_macArgs548_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_emptyBlock_in_macArgs551  */
static	ANTLR3_BITWORD FOLLOW_emptyBlock_in_macArgs551_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000250) };
static  ANTLR3_BITSET_LIST FOLLOW_emptyBlock_in_macArgs551	= { FOLLOW_emptyBlock_in_macArgs551_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_COMMA_in_macArgs554  */
static	ANTLR3_BITWORD FOLLOW_COMMA_in_macArgs554_bits[]	= { ANTLR3_UINT64_LIT(0x00000000000009F0) };
static  ANTLR3_BITSET_LIST FOLLOW_COMMA_in_macArgs554	= { FOLLOW_COMMA_in_macArgs554_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_emptyBlock_in_macArgs556  */
static	ANTLR3_BITWORD FOLLOW_emptyBlock_in_macArgs556_bits[]	= { ANTLR3_UINT64_LIT(0x00000000000009F0) };
static  ANTLR3_BITSET_LIST FOLLOW_emptyBlock_in_macArgs556	= { FOLLOW_emptyBlock_in_macArgs556_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_mArg_in_macArgs559  */
static	ANTLR3_BITWORD FOLLOW_mArg_in_macArgs559_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000252) };
static  ANTLR3_BITSET_LIST FOLLOW_mArg_in_macArgs559	= { FOLLOW_mArg_in_macArgs559_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_mArg597  */
static	ANTLR3_BITWORD FOLLOW_set_in_mArg597_bits[]	= { ANTLR3_UINT64_LIT(0x00000000000009F2) };
static  ANTLR3_BITSET_LIST FOLLOW_set_in_mArg597	= { FOLLOW_set_in_mArg597_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_emptyBlock0  */
static	ANTLR3_BITWORD FOLLOW_set_in_emptyBlock0_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_set_in_emptyBlock0	= { FOLLOW_set_in_emptyBlock0_bits, 1	};
/** Bitset defining follow set for error recovery in rule state: FOLLOW_set_in_sourceText634  */
static	ANTLR3_BITWORD FOLLOW_set_in_sourceText634_bits[]	= { ANTLR3_UINT64_LIT(0x0000000000000002) };
static  ANTLR3_BITSET_LIST FOLLOW_set_in_sourceText634	= { FOLLOW_set_in_sourceText634_bits, 1	};
     


/* =========================================================================
 * DFA tables for the parser
 */
/** Static dfa state tables for Cyclic dfa:
 *    40:57: (d= macroDefinition (n= NEWLINE )? | e= macroExpansion | t= sourceText (n= NEWLINE )* )
 */
static const ANTLR3_INT32 dfa5_eot[87] =
    {
	-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, -1, -1, -1, 
	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
    };
static const ANTLR3_INT32 dfa5_eof[87] =
    {
	-1, 3, 3, -1, 3, 3, 3, 3, -1, 3, 3, 3, 3, 3, -1, 3, 3, 3, -1, 3, 3, 3, 
	-1, 3, -1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, -1, 3, 3, 3, 
	3, 3, -1, 3, 3, -1, -1, -1, -1, -1, -1, -1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 
	3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1
    };
static const ANTLR3_INT32 dfa5_min[87] =
    {
	5, 4, 4, -1, 4, 4, 4, 4, -1, 4, 4, 4, 4, 4, -1, 4, 4, 4, -1, 4, 4, 4, -1, 
	4, -1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, -1, 4, 4, 4, 4, 
	4, -1, 4, 4, -1, -1, -1, -1, -1, -1, -1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
	4, 4, 4, 4, 4, 4, 4, 4, 4, 4, -1, -1, -1, -1, -1, -1, 4, -1, -1, -1
    };
static const ANTLR3_INT32 dfa5_max[87] =
    {
	11, 11, 11, -1, 11, 11, 11, 11, -1, 11, 11, 11, 11, 11, -1, 11, 11, 11, 
	-1, 11, 11, 11, -1, 11, -1, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 
	11, 11, 11, 11, 11, -1, 11, 11, 11, 11, 11, -1, 11, 11, -1, -1, -1, -1, 
	-1, -1, -1, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 
	11, 11, 11, 11, 11, -1, -1, -1, -1, -1, -1, 11, -1, -1, -1
    };
static const ANTLR3_INT32 dfa5_accept[87] =
    {
	-1, -1, -1, 3, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 2, -1, -1, -1, 2, 
	-1, -1, -1, 2, -1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
	-1, -1, -1, 2, -1, -1, -1, -1, -1, 2, -1, -1, 2, 2, 2, 2, 2, 2, 2, -1, 
	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
	-1, 2, 2, 2, 2, 2, 2, -1, 2, 2, 2
    };
static const ANTLR3_INT32 dfa5_special[87] =
    {	
	-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, -1, -1, -1, 
	-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 dfa5_T_empty	    NULL

static const ANTLR3_INT32 dfa5_T0[] =
    {
	37, 28, 39, 29, 38, 17, 22, 31
    };static const ANTLR3_INT32 dfa5_T1[] =
    {
	3, 3, 3, 8, 3, 3, 3, 3
    };static const ANTLR3_INT32 dfa5_T2[] =
    {
	34, 28, 33, 29, 31, 17, 22, 31
    };static const ANTLR3_INT32 dfa5_T3[] =
    {
	3, 3, 4, 3, 3, 3, 3, 3
    };static const ANTLR3_INT32 dfa5_T4[] =
    {
	27, 28, 30, 29, 31, 3, 3, 31
    };static const ANTLR3_INT32 dfa5_T5[] =
    {
	36, 28, 40, 29, 31, 17, 22, 31
    };static const ANTLR3_INT32 dfa5_T6[] =
    {
	23, 10, 25, 12, 24, 17, 22, 13
    };static const ANTLR3_INT32 dfa5_T7[] =
    {
	68, 61, 67, 62, 66, 46, 47, 64
    };static const ANTLR3_INT32 dfa5_T8[] =
    {
	44, 43, 57, 45, 56, 46, 47, 48
    };static const ANTLR3_INT32 dfa5_T9[] =
    {
	21, 10, 26, 12, 13, 17, 22, 13
    };static const ANTLR3_INT32 dfa5_T10[] =
    {
	36, 28, 35, 29, 31, 17, 22, 31
    };static const ANTLR3_INT32 dfa5_T11[] =
    {
	36, 28, 40, 49, 31, 17, 22, 31
    };static const ANTLR3_INT32 dfa5_T12[] =
    {
	60, 61, 63, 62, 64, 3, 3, 64
    };static const ANTLR3_INT32 dfa5_T13[] =
    {
	77, 78, 79, 80, 81, 46, 82, 81
    };static const ANTLR3_INT32 dfa5_T14[] =
    {
	68, 61, 73, 62, 72, 46, 47, 64
    };static const ANTLR3_INT32 dfa5_T15[] =
    {
	59, 43, 65, 45, 48, 46, 47, 48
    };static const ANTLR3_INT32 dfa5_T16[] =
    {
	50, 51, 53, 54, 55, 17, 52, 55
    };static const ANTLR3_INT32 dfa5_T17[] =
    {
	71, 61, 76, 62, 64, 46, 47, 64
    };static const ANTLR3_INT32 dfa5_T18[] =
    {
	15, 3, 7, 3, 6, 3, 3, 3
    };static const ANTLR3_INT32 dfa5_T19[] =
    {
	5, 3, 7, 3, 6, 3, 3, 3
    };static const ANTLR3_INT32 dfa5_T20[] =
    {
	59, 43, 58, 45, 48, 46, 47, 48
    };static const ANTLR3_INT32 dfa5_T21[] =
    {
	19, 10, 16, 12, 13, 17, 18, 13
    };static const ANTLR3_INT32 dfa5_T22[] =
    {
	1, 3, 2, 3, 3, 3, 3
    };static const ANTLR3_INT32 dfa5_T23[] =
    {
	21, 10, 26, 32, 13, 17, 22, 13
    };static const ANTLR3_INT32 dfa5_T24[] =
    {
	71, 61, 76, 83, 64, 46, 47, 64
    };static const ANTLR3_INT32 dfa5_T25[] =
    {
	44, 43, 42, 45, 41, 46, 47, 48
    };static const ANTLR3_INT32 dfa5_T26[] =
    {
	59, 43, 65, 69, 48, 46, 47, 48
    };static const ANTLR3_INT32 dfa5_T27[] =
    {
	77, 78, 84, 85, 81, 46, 86, 81
    };static const ANTLR3_INT32 dfa5_T28[] =
    {
	21, 10, 20, 12, 13, 17, 22, 13
    };static const ANTLR3_INT32 dfa5_T29[] =
    {
	74, 61, 75, 62, 64, 46, 47, 64
    };static const ANTLR3_INT32 dfa5_T30[] =
    {
	9, 10, 11, 12, 13, 3, 14, 13
    };static const ANTLR3_INT32 dfa5_T31[] =
    {
	71, 61, 70, 62, 64, 46, 47, 64
    };

/* Transition tables are a table of sub tables, with some tables
 * reused for efficiency.
 */
static const ANTLR3_INT32 * const dfa5_transitions[] =
{
    dfa5_T22, dfa5_T3, dfa5_T19, dfa5_T_empty, dfa5_T1, dfa5_T19, dfa5_T30, 
    dfa5_T18, dfa5_T_empty, dfa5_T21, dfa5_T28, dfa5_T21, dfa5_T6, dfa5_T9, 
    dfa5_T_empty, dfa5_T18, dfa5_T21, dfa5_T4, dfa5_T_empty, dfa5_T21, dfa5_T23, 
    dfa5_T9, dfa5_T_empty, dfa5_T6, dfa5_T_empty, dfa5_T6, dfa5_T9, dfa5_T2, 
    dfa5_T10, dfa5_T0, dfa5_T2, dfa5_T5, dfa5_T25, dfa5_T2, dfa5_T2, dfa5_T11, 
    dfa5_T5, dfa5_T0, dfa5_T16, dfa5_T0, dfa5_T5, dfa5_T_empty, dfa5_T8, 
    dfa5_T20, dfa5_T6, dfa5_T8, dfa5_T12, dfa5_T_empty, dfa5_T15, dfa5_T7, 
    dfa5_T_empty, dfa5_T_empty, dfa5_T_empty, dfa5_T_empty, dfa5_T_empty, 
    dfa5_T_empty, dfa5_T_empty, dfa5_T8, dfa5_T26, dfa5_T9, dfa5_T2, dfa5_T31, 
    dfa5_T14, dfa5_T29, dfa5_T17, dfa5_T15, dfa5_T13, dfa5_T14, dfa5_T0, 
    dfa5_T25, dfa5_T24, dfa5_T5, dfa5_T27, dfa5_T14, dfa5_T2, dfa5_T29, 
    dfa5_T17, dfa5_T_empty, dfa5_T_empty, dfa5_T_empty, dfa5_T_empty, dfa5_T_empty, 
    dfa5_T_empty, dfa5_T7, dfa5_T_empty, dfa5_T_empty, dfa5_T_empty	
};

//static void 
//dfaError(pPPParser ctx) 
//{
//    DBG->recognitionException(DBG, EXCEPTION);
//}

/* Declare tracking structure for Cyclic DFA 5
 */
static
ANTLR3_CYCLIC_DFA cdfa5
    =	{
	    5,		    /* Decision number of this dfa	    */
	    /* Which decision this represents:   */
	    (const pANTLR3_UCHAR)"40:57: (d= macroDefinition (n= NEWLINE )? | e= macroExpansion | t= sourceText (n= NEWLINE )* )",	
	    (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 */
	    dfa5_eot,	    /* EOT table			    */
	    dfa5_eof,	    /* EOF table			    */
	    dfa5_min,	    /* Minimum tokens for each state    */
	    dfa5_max,	    /* Maximum tokens for each state    */
	    dfa5_accept,	/* Accept table			    */
	    dfa5_special,	/* Special transition states	    */
	    dfa5_transitions	/* Table of transition tables	    */

	};	    
/* End of Cyclic DFA 5
 * ---------------------
 *//** Static dfa state tables for Cyclic dfa:
 *    44:1: macroDefinition : ( DEFINE WS id= ID LP ( WS )? ( macroParam[m.params] ( WS )? ( COMMA ( WS )? macroParam[m.params] ( WS )? )* )? RP ( WS )? r= restOfLine[m] | DEFINE WS id= ID ( WS )? r= restOfLine[m] );
 */
static const ANTLR3_INT32 dfa14_eot[14] =
    {
	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
    };
static const ANTLR3_INT32 dfa14_eof[14] =
    {
	-1, -1, -1, 5, 5, -1, 5, 5, -1, 5, 5, 5, 5, 5
    };
static const ANTLR3_INT32 dfa14_min[14] =
    {
	5, 6, 7, 4, 4, -1, 4, 4, -1, 4, 4, 4, 4, 4
    };
static const ANTLR3_INT32 dfa14_max[14] =
    {
	5, 6, 7, 11, 11, -1, 11, 11, -1, 11, 11, 11, 11, 11
    };
static const ANTLR3_INT32 dfa14_accept[14] =
    {
	-1, -1, -1, -1, -1, 2, -1, -1, 1, -1, -1, -1, -1, -1
    };
static const ANTLR3_INT32 dfa14_special[14] =
    {	
	-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 dfa14_T_empty	    NULL

static const ANTLR3_INT32 dfa14_T0[] =
    {
	5, 5, 5, 5, 5, 10, 8, 5
    };static const ANTLR3_INT32 dfa14_T1[] =
    {
	5, 5, 5, 5, 4, 5, 5, 5
    };static const ANTLR3_INT32 dfa14_T2[] =
    {
	3
    };static const ANTLR3_INT32 dfa14_T3[] =
    {
	2
    };static const ANTLR3_INT32 dfa14_T4[] =
    {
	5, 5, 13, 5, 5, 10, 8, 5
    };static const ANTLR3_INT32 dfa14_T5[] =
    {
	5, 5, 9, 5, 5, 10, 8, 5
    };static const ANTLR3_INT32 dfa14_T6[] =
    {
	5, 5, 7, 6, 5, 5, 8, 5
    };static const ANTLR3_INT32 dfa14_T7[] =
    {
	1
    };static const ANTLR3_INT32 dfa14_T8[] =
    {
	5, 5, 12, 11, 5, 5, 5, 5
    };static const ANTLR3_INT32 dfa14_T9[] =
    {
	5, 5, 5, 6, 5, 5, 8, 5
    };static const ANTLR3_INT32 dfa14_T10[] =
    {
	5, 5, 5, 11, 5, 5, 5, 5
    };

/* Transition tables are a table of sub tables, with some tables
 * reused for efficiency.
 */
static const ANTLR3_INT32 * const dfa14_transitions[] =
{
    dfa14_T7, dfa14_T3, dfa14_T2, dfa14_T1, dfa14_T6, dfa14_T_empty, dfa14_T5, 
    dfa14_T9, dfa14_T_empty, dfa14_T0, dfa14_T8, dfa14_T4, dfa14_T10, dfa14_T0	
};

//static void 
//dfaError(pPPParser ctx) 
//{
//    DBG->recognitionException(DBG, EXCEPTION);
//}

/* Declare tracking structure for Cyclic DFA 14
 */
static
ANTLR3_CYCLIC_DFA cdfa14
    =	{
	    14,		    /* Decision number of this dfa	    */
	    /* Which decision this represents:   */
	    (const pANTLR3_UCHAR)"44:1: macroDefinition : ( DEFINE WS id= ID LP ( WS )? ( macroParam[m.params] ( WS )? ( COMMA ( WS )? macroParam[m.params] ( WS )? )* )? RP ( WS )? r= restOfLine[m] | DEFINE WS id= ID ( WS )? r= restOfLine[m] );",	
	    (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 */
	    dfa14_eot,	    /* EOT table			    */
	    dfa14_eof,	    /* EOF table			    */
	    dfa14_min,	    /* Minimum tokens for each state    */
	    dfa14_max,	    /* Maximum tokens for each state    */
	    dfa14_accept,	/* Accept table			    */
	    dfa14_special,	/* Special transition states	    */
	    dfa14_transitions	/* Table of transition tables	    */

	};	    
/* End of Cyclic DFA 14
 * ---------------------
 *//** Static dfa state tables for Cyclic dfa:
 *    67:1: macroExpansion returns [pANTLR3_STRING exp] : ( ID ( emptyBlock )* LP ( emptyBlock )* RP | ID ( emptyBlock )* LP ( emptyBlock )* macArgs ( emptyBlock )* RP );
 */
static const ANTLR3_INT32 dfa21_eot[9] =
    {
	-1, -1, -1, -1, -1, -1, -1, -1, -1
    };
static const ANTLR3_INT32 dfa21_eof[9] =
    {
	-1, -1, -1, -1, -1, -1, -1, -1, -1
    };
static const ANTLR3_INT32 dfa21_min[9] =
    {
	7, 4, 4, 4, 4, -1, -1, 4, -1
    };
static const ANTLR3_INT32 dfa21_max[9] =
    {
	7, 8, 8, 11, 11, -1, -1, 11, -1
    };
static const ANTLR3_INT32 dfa21_accept[9] =
    {
	-1, -1, -1, -1, -1, 1, 2, -1, 1
    };
static const ANTLR3_INT32 dfa21_special[9] =
    {	
	-1, -1, -1, -1, -1, -1, -1, -1, -1
    };

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

static const ANTLR3_INT32 dfa21_T0[] =
    {
	1
    };static const ANTLR3_INT32 dfa21_T1[] =
    {
	7, 6, 7, 6, 6, 6, 8, 6
    };static const ANTLR3_INT32 dfa21_T2[] =
    {
	2, -1, 2, -1, 3
    };static const ANTLR3_INT32 dfa21_T3[] =
    {
	4, 6, 4, 6, 6, -1, 5, 6
    };

/* Transition tables are a table of sub tables, with some tables
 * reused for efficiency.
 */
static const ANTLR3_INT32 * const dfa21_transitions[] =
{
    dfa21_T0, dfa21_T2, dfa21_T2, dfa21_T3, dfa21_T1, dfa21_T_empty, dfa21_T_empty, 
    dfa21_T1, dfa21_T_empty	
};

//static void 
//dfaError(pPPParser ctx) 
//{
//    DBG->recognitionException(DBG, EXCEPTION);
//}

/* Declare tracking structure for Cyclic DFA 21
 */
static
ANTLR3_CYCLIC_DFA cdfa21
    =	{
	    21,		    /* Decision number of this dfa	    */
	    /* Which decision this represents:   */
	    (const pANTLR3_UCHAR)"67:1: macroExpansion returns [pANTLR3_STRING exp] : ( ID ( emptyBlock )* LP ( emptyBlock )* RP | ID ( emptyBlock )* LP ( emptyBlock )* macArgs ( emptyBlock )* RP );",	
	    (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 */
	    dfa21_eot,	    /* EOT table			    */
	    dfa21_eof,	    /* EOF table			    */
	    dfa21_min,	    /* Minimum tokens for each state    */
	    dfa21_max,	    /* Maximum tokens for each state    */
	    dfa21_accept,	/* Accept table			    */
	    dfa21_special,	/* Special transition states	    */
	    dfa21_transitions	/* Table of transition tables	    */

	};	    
/* End of Cyclic DFA 21
 * ---------------------
 *//** Static dfa state tables for Cyclic dfa:
 *    ()* loopback of 72:10: ( ( emptyBlock )* COMMA ( emptyBlock )* mArg )*
 */
static const ANTLR3_INT32 dfa24_eot[4] =
    {
	-1, -1, -1, -1
    };
static const ANTLR3_INT32 dfa24_eof[4] =
    {
	-1, -1, -1, -1
    };
static const ANTLR3_INT32 dfa24_min[4] =
    {
	4, 4, -1, -1
    };
static const ANTLR3_INT32 dfa24_max[4] =
    {
	10, 10, -1, -1
    };
static const ANTLR3_INT32 dfa24_accept[4] =
    {
	-1, -1, 2, 1
    };
static const ANTLR3_INT32 dfa24_special[4] =
    {	
	-1, -1, -1, -1
    };

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

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

/* Transition tables are a table of sub tables, with some tables
 * reused for efficiency.
 */
static const ANTLR3_INT32 * const dfa24_transitions[] =
{
    dfa24_T0, dfa24_T0, dfa24_T_empty, dfa24_T_empty	
};

//static void 
//dfaError(pPPParser ctx) 
//{
//    DBG->recognitionException(DBG, EXCEPTION);
//}

/* Declare tracking structure for Cyclic DFA 24
 */
static
ANTLR3_CYCLIC_DFA cdfa24
    =	{
	    24,		    /* Decision number of this dfa	    */
	    /* Which decision this represents:   */
	    (const pANTLR3_UCHAR)"()* loopback of 72:10: ( ( emptyBlock )* COMMA ( emptyBlock )* mArg )*",	
	    (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 */
	    dfa24_eot,	    /* EOT table			    */
	    dfa24_eof,	    /* EOF table			    */
	    dfa24_min,	    /* Minimum tokens for each state    */
	    dfa24_max,	    /* Maximum tokens for each state    */
	    dfa24_accept,	/* Accept table			    */
	    dfa24_special,	/* Special transition states	    */
	    dfa24_transitions	/* Table of transition tables	    */

	};	    
/* End of Cyclic DFA 24
 * ---------------------
 */ 
/* =========================================================================
 * End of DFA tables for the parser
 */ 
 
/* ==============================================
 * Parsing rules
 */
/** 
 * $ANTLR start preprocess
 * /home/luca/NetBeansProjects/7.15/PP.g:30:1: preprocess : ( procLine )* EOF ;
 */
static void
preprocess(pPPParser ctx)
{   
    /* Initialize rule variables
     */


    DBG->enterRule(DBG, getGrammarFileName(), (const char *)"preprocess");
    if ( getRuleLevel()==0 ) 
    {
    	DBG->commence(DBG);
    }
    incRuleLevel();
    DBG->location(DBG, 30, 1);

    {
        // /home/luca/NetBeansProjects/7.15/PP.g:31:17: ( ( procLine )* EOF )
        DBG->enterAlt(DBG, 1);

        // /home/luca/NetBeansProjects/7.15/PP.g:31:19: ( procLine )* EOF
        {
            DBG->location(DBG, 31, 19);

            // /home/luca/NetBeansProjects/7.15/PP.g:31:19: ( procLine )*

            DBG->enterSubRule(DBG, 1);

            for (;;)
            {
                int alt1=2;
                DBG->enterDecision(DBG, 1);

                switch ( LA(1) ) 
                {
                case NEWLINE:
                case DEFINE:
                case WS:
                case ID:
                case LP:
                case COMMA:
                case RP:
                case ANYCHAR:
                	{
                		alt1=1;
                	}
                    break;

                }

                DBG->exitDecision(DBG, 1);

                switch (alt1) 
                {
            	case 1:
            	    DBG->enterAlt(DBG, 1);

            	    // /home/luca/NetBeansProjects/7.15/PP.g:31:19: procLine
            	    {
            	        DBG->location(DBG, 31, 19);
            	        FOLLOWPUSH(FOLLOW_procLine_in_preprocess59);
            	        procLine(ctx);

            	        FOLLOWPOP();
            	        if  (HASEXCEPTION())
            	        {
            	            goto rulepreprocessEx;
            	        }


            	    }
            	    break;

            	default:
            	    goto loop1;	/* break out of the loop */
            	    break;
                }
            }
            loop1: ; /* Jump out to here if this rule does not match */
            DBG->exitSubRule(DBG, 1);

            DBG->location(DBG, 31, 29);
             MATCHT(EOF, &FOLLOW_EOF_in_preprocess62); 
            if  (HASEXCEPTION())
            {
                goto rulepreprocessEx;
            }


        }

    }
    

    // This is where rules clean up and exit
    //
    goto rulepreprocessEx; /* Prevent compiler warnings */
    rulepreprocessEx: ;

            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
            }


    DBG->location(DBG, 32, 17);

    DBG->exitRule(DBG, getGrammarFileName(), (const char *)"preprocess");
    decRuleLevel();
    if ( getRuleLevel()==0 ) 
    {
    	DBG->terminate(DBG);
    }


    return ;
}
/* $ANTLR end preprocess */

/** 
 * $ANTLR start procLine
 * /home/luca/NetBeansProjects/7.15/PP.g:33:1: procLine : (n= NEWLINE )* (d= macroDefinition (n= NEWLINE )? | e= macroExpansion | t= sourceText (n= NEWLINE )* ) ;
 */
static void
procLine(pPPParser ctx)
{   
    pANTLR3_COMMON_TOKEN    n;
    PPParser_macroDefinition_return d;
    #undef	RETURN_TYPE_d
    #define	RETURN_TYPE_d PPParser_macroDefinition_return

    pANTLR3_STRING e;
    #undef	RETURN_TYPE_e
    #define	RETURN_TYPE_e pANTLR3_STRING

    PPParser_sourceText_return t;
    #undef	RETURN_TYPE_t
    #define	RETURN_TYPE_t PPParser_sourceText_return

    /* Initialize rule variables
     */



    	string output;

    n       = NULL;
    e = NULL;

    DBG->enterRule(DBG, getGrammarFileName(), (const char *)"procLine");
    if ( getRuleLevel()==0 ) 
    {
    	DBG->commence(DBG);
    }
    incRuleLevel();
    DBG->location(DBG, 33, 1);

    {
        // /home/luca/NetBeansProjects/7.15/PP.g:40:17: ( (n= NEWLINE )* (d= macroDefinition (n= NEWLINE )? | e= macroExpansion | t= sourceText (n= NEWLINE )* ) )
        DBG->enterAlt(DBG, 1);

        // /home/luca/NetBeansProjects/7.15/PP.g:40:19: (n= NEWLINE )* (d= macroDefinition (n= NEWLINE )? | e= macroExpansion | t= sourceText (n= NEWLINE )* )
        {
            DBG->location(DBG, 40, 19);

            // /home/luca/NetBeansProjects/7.15/PP.g:40:19: (n= NEWLINE )*

            DBG->enterSubRule(DBG, 2);

            for (;;)
            {
                int alt2=2;
                DBG->enterDecision(DBG, 2);

                switch ( LA(1) ) 
                {
                case NEWLINE:
                	{
                		alt2=1;
                	}
                    break;

                }

                DBG->exitDecision(DBG, 2);

                switch (alt2) 
                {
            	case 1:
            	    DBG->enterAlt(DBG, 1);

            	    // /home/luca/NetBeansProjects/7.15/PP.g:40:20: n= NEWLINE
            	    {
            	        DBG->location(DBG, 40, 21);
            	        n = (pANTLR3_COMMON_TOKEN) MATCHT(NEWLINE, &FOLLOW_NEWLINE_in_procLine115); 
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleprocLineEx;
            	        }

            	        DBG->location(DBG, 40, 30);
            	        {
            	             output += ((n->getText(n))); 
            	        }

            	    }
            	    break;

            	default:
            	    goto loop2;	/* break out of the loop */
            	    break;
                }
            }
            loop2: ; /* Jump out to here if this rule does not match */
            DBG->exitSubRule(DBG, 2);

            DBG->location(DBG, 40, 57);

            // /home/luca/NetBeansProjects/7.15/PP.g:40:57: (d= macroDefinition (n= NEWLINE )? | e= macroExpansion | t= sourceText (n= NEWLINE )* )
            {
                int alt5=3;
                DBG->enterSubRule(DBG, 5);
                DBG->enterDecision(DBG, 5);

                alt5 = cdfa5.predict(ctx, RECOGNIZER, ISTREAM, &cdfa5);
                if  (HASEXCEPTION())
                {
                	DBG->recognitionException(DBG, EXCEPTION);
                    goto ruleprocLineEx;
                }
                if  (HASEXCEPTION())
                {
                    goto ruleprocLineEx;
                }

                DBG->exitDecision(DBG, 5);

                switch (alt5) 
                {
            	case 1:
            	    DBG->enterAlt(DBG, 1);

            	    // /home/luca/NetBeansProjects/7.15/PP.g:40:59: d= macroDefinition (n= NEWLINE )?
            	    {
            	        DBG->location(DBG, 40, 60);
            	        FOLLOWPUSH(FOLLOW_macroDefinition_in_procLine125);
            	        d=macroDefinition(ctx);

            	        FOLLOWPOP();
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleprocLineEx;
            	        }

            	        DBG->location(DBG, 40, 78);

            	        // /home/luca/NetBeansProjects/7.15/PP.g:40:78: (n= NEWLINE )?
            	        {
            	            int alt3=2;
            	            DBG->enterSubRule(DBG, 3);
            	            DBG->enterDecision(DBG, 3);

            	            switch ( LA(1) ) 
            	            {
            	                case NEWLINE:
            	                	{
            	                		alt3=1;
            	                	}
            	                    break;
            	            }

            	            DBG->exitDecision(DBG, 3);

            	            switch (alt3) 
            	            {
            	        	case 1:
            	        	    DBG->enterAlt(DBG, 1);

            	        	    // /home/luca/NetBeansProjects/7.15/PP.g:40:78: n= NEWLINE
            	        	    {
            	        	        DBG->location(DBG, 40, 78);
            	        	        n = (pANTLR3_COMMON_TOKEN) MATCHT(NEWLINE, &FOLLOW_NEWLINE_in_procLine129); 
            	        	        if  (HASEXCEPTION())
            	        	        {
            	        	            goto ruleprocLineEx;
            	        	        }


            	        	    }
            	        	    break;

            	            }
            	            DBG->exitSubRule(DBG, 3);

            	        }
            	        DBG->location(DBG, 40, 88);
            	        {
            	             output += (STRSTREAM->toStringTT(STRSTREAM, d.start, d.stop)); output += (n->getText(n)); 
            	        }

            	    }
            	    break;
            	case 2:
            	    DBG->enterAlt(DBG, 2);

            	    // /home/luca/NetBeansProjects/7.15/PP.g:41:24: e= macroExpansion
            	    {
            	        DBG->location(DBG, 41, 25);
            	        FOLLOWPUSH(FOLLOW_macroExpansion_in_procLine159);
            	        e=macroExpansion(ctx);

            	        FOLLOWPOP();
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleprocLineEx;
            	        }

            	        DBG->location(DBG, 41, 41);
            	        {
            	             output += (e); 
            	        }

            	    }
            	    break;
            	case 3:
            	    DBG->enterAlt(DBG, 3);

            	    // /home/luca/NetBeansProjects/7.15/PP.g:42:24: t= sourceText (n= NEWLINE )*
            	    {
            	        DBG->location(DBG, 42, 25);
            	        FOLLOWPUSH(FOLLOW_sourceText_in_procLine188);
            	        t=sourceText(ctx);

            	        FOLLOWPOP();
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleprocLineEx;
            	        }

            	        DBG->location(DBG, 42, 37);
            	        {
            	             output += ((STRSTREAM->toStringTT(STRSTREAM, t.start, t.stop))); 
            	        }
            	        DBG->location(DBG, 42, 62);

            	        // /home/luca/NetBeansProjects/7.15/PP.g:42:62: (n= NEWLINE )*

            	        DBG->enterSubRule(DBG, 4);

            	        for (;;)
            	        {
            	            int alt4=2;
            	            DBG->enterDecision(DBG, 4);

            	            switch ( LA(1) ) 
            	            {
            	            case NEWLINE:
            	            	{
            	            		alt4=1;
            	            	}
            	                break;

            	            }

            	            DBG->exitDecision(DBG, 4);

            	            switch (alt4) 
            	            {
            	        	case 1:
            	        	    DBG->enterAlt(DBG, 1);

            	        	    // /home/luca/NetBeansProjects/7.15/PP.g:42:63: n= NEWLINE
            	        	    {
            	        	        DBG->location(DBG, 42, 64);
            	        	        n = (pANTLR3_COMMON_TOKEN) MATCHT(NEWLINE, &FOLLOW_NEWLINE_in_procLine195); 
            	        	        if  (HASEXCEPTION())
            	        	        {
            	        	            goto ruleprocLineEx;
            	        	        }

            	        	        DBG->location(DBG, 42, 73);
            	        	        {
            	        	             output += ((n->getText(n))); 
            	        	        }

            	        	    }
            	        	    break;

            	        	default:
            	        	    goto loop4;	/* break out of the loop */
            	        	    break;
            	            }
            	        }
            	        loop4: ; /* Jump out to here if this rule does not match */
            	        DBG->exitSubRule(DBG, 4);


            	    }
            	    break;

                }
                DBG->exitSubRule(DBG, 5);

            }

        }

    }
    

    // This is where rules clean up and exit
    //
    goto ruleprocLineEx; /* Prevent compiler warnings */
    ruleprocLineEx: ;

            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
            }
            else
            {
                {

                    	cout << output;

                }
            }


    DBG->location(DBG, 43, 17);

    DBG->exitRule(DBG, getGrammarFileName(), (const char *)"procLine");
    decRuleLevel();
    if ( getRuleLevel()==0 ) 
    {
    	DBG->terminate(DBG);
    }


    return ;
}
/* $ANTLR end procLine */

/** 
 * $ANTLR start macroDefinition
 * /home/luca/NetBeansProjects/7.15/PP.g:44:1: macroDefinition : ( DEFINE WS id= ID LP ( WS )? ( macroParam[m.params] ( WS )? ( COMMA ( WS )? macroParam[m.params] ( WS )? )* )? RP ( WS )? r= restOfLine[m] | DEFINE WS id= ID ( WS )? r= restOfLine[m] );
 */
static PPParser_macroDefinition_return
macroDefinition(pPPParser ctx)
{   
    PPParser_macroDefinition_return retval;

    pANTLR3_COMMON_TOKEN    id;
    PPParser_restOfLine_return r;
    #undef	RETURN_TYPE_r
    #define	RETURN_TYPE_r PPParser_restOfLine_return

    /* Initialize rule variables
     */



          	MacroDef m;

    id       = NULL;
    retval.start = LT(1); retval.stop = retval.start;

    DBG->enterRule(DBG, getGrammarFileName(), (const char *)"macroDefinition");
    if ( getRuleLevel()==0 ) 
    {
    	DBG->commence(DBG);
    }
    incRuleLevel();
    DBG->location(DBG, 44, 1);

    {
        {
            //  /home/luca/NetBeansProjects/7.15/PP.g:52:17: ( DEFINE WS id= ID LP ( WS )? ( macroParam[m.params] ( WS )? ( COMMA ( WS )? macroParam[m.params] ( WS )? )* )? RP ( WS )? r= restOfLine[m] | DEFINE WS id= ID ( WS )? r= restOfLine[m] )
            
            ANTLR3_UINT32 alt14;

            alt14=2;

            DBG->enterDecision(DBG, 14);

            alt14 = cdfa14.predict(ctx, RECOGNIZER, ISTREAM, &cdfa14);
            if  (HASEXCEPTION())
            {
            	DBG->recognitionException(DBG, EXCEPTION);
                goto rulemacroDefinitionEx;
            }
            if  (HASEXCEPTION())
            {
                goto rulemacroDefinitionEx;
            }

            DBG->exitDecision(DBG, 14);

            switch (alt14) 
            {
        	case 1:
        	    DBG->enterAlt(DBG, 1);

        	    // /home/luca/NetBeansProjects/7.15/PP.g:52:19: DEFINE WS id= ID LP ( WS )? ( macroParam[m.params] ( WS )? ( COMMA ( WS )? macroParam[m.params] ( WS )? )* )? RP ( WS )? r= restOfLine[m]
        	    {
        	        DBG->location(DBG, 52, 19);
        	         MATCHT(DEFINE, &FOLLOW_DEFINE_in_macroDefinition250); 
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulemacroDefinitionEx;
        	        }

        	        DBG->location(DBG, 52, 26);
        	         MATCHT(WS, &FOLLOW_WS_in_macroDefinition252); 
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulemacroDefinitionEx;
        	        }

        	        DBG->location(DBG, 52, 31);
        	        id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_macroDefinition256); 
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulemacroDefinitionEx;
        	        }

        	        DBG->location(DBG, 52, 35);
        	         MATCHT(LP, &FOLLOW_LP_in_macroDefinition258); 
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulemacroDefinitionEx;
        	        }

        	        DBG->location(DBG, 52, 38);

        	        // /home/luca/NetBeansProjects/7.15/PP.g:52:38: ( WS )?
        	        {
        	            int alt6=2;
        	            DBG->enterSubRule(DBG, 6);
        	            DBG->enterDecision(DBG, 6);

        	            switch ( LA(1) ) 
        	            {
        	                case WS:
        	                	{
        	                		alt6=1;
        	                	}
        	                    break;
        	            }

        	            DBG->exitDecision(DBG, 6);

        	            switch (alt6) 
        	            {
        	        	case 1:
        	        	    DBG->enterAlt(DBG, 1);

        	        	    // /home/luca/NetBeansProjects/7.15/PP.g:52:38: WS
        	        	    {
        	        	        DBG->location(DBG, 52, 38);
        	        	         MATCHT(WS, &FOLLOW_WS_in_macroDefinition260); 
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto rulemacroDefinitionEx;
        	        	        }


        	        	    }
        	        	    break;

        	            }
        	            DBG->exitSubRule(DBG, 6);

        	        }
        	        DBG->location(DBG, 52, 42);

        	        // /home/luca/NetBeansProjects/7.15/PP.g:52:42: ( macroParam[m.params] ( WS )? ( COMMA ( WS )? macroParam[m.params] ( WS )? )* )?
        	        {
        	            int alt11=2;
        	            DBG->enterSubRule(DBG, 11);
        	            DBG->enterDecision(DBG, 11);

        	            switch ( LA(1) ) 
        	            {
        	                case ID:
        	                	{
        	                		alt11=1;
        	                	}
        	                    break;
        	            }

        	            DBG->exitDecision(DBG, 11);

        	            switch (alt11) 
        	            {
        	        	case 1:
        	        	    DBG->enterAlt(DBG, 1);

        	        	    // /home/luca/NetBeansProjects/7.15/PP.g:52:43: macroParam[m.params] ( WS )? ( COMMA ( WS )? macroParam[m.params] ( WS )? )*
        	        	    {
        	        	        DBG->location(DBG, 52, 43);
        	        	        FOLLOWPUSH(FOLLOW_macroParam_in_macroDefinition264);
        	        	        macroParam(ctx, m.params);

        	        	        FOLLOWPOP();
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto rulemacroDefinitionEx;
        	        	        }

        	        	        DBG->location(DBG, 52, 64);

        	        	        // /home/luca/NetBeansProjects/7.15/PP.g:52:64: ( WS )?
        	        	        {
        	        	            int alt7=2;
        	        	            DBG->enterSubRule(DBG, 7);
        	        	            DBG->enterDecision(DBG, 7);

        	        	            switch ( LA(1) ) 
        	        	            {
        	        	                case WS:
        	        	                	{
        	        	                		alt7=1;
        	        	                	}
        	        	                    break;
        	        	            }

        	        	            DBG->exitDecision(DBG, 7);

        	        	            switch (alt7) 
        	        	            {
        	        	        	case 1:
        	        	        	    DBG->enterAlt(DBG, 1);

        	        	        	    // /home/luca/NetBeansProjects/7.15/PP.g:52:64: WS
        	        	        	    {
        	        	        	        DBG->location(DBG, 52, 64);
        	        	        	         MATCHT(WS, &FOLLOW_WS_in_macroDefinition267); 
        	        	        	        if  (HASEXCEPTION())
        	        	        	        {
        	        	        	            goto rulemacroDefinitionEx;
        	        	        	        }


        	        	        	    }
        	        	        	    break;

        	        	            }
        	        	            DBG->exitSubRule(DBG, 7);

        	        	        }
        	        	        DBG->location(DBG, 52, 68);

        	        	        // /home/luca/NetBeansProjects/7.15/PP.g:52:68: ( COMMA ( WS )? macroParam[m.params] ( WS )? )*

        	        	        DBG->enterSubRule(DBG, 10);

        	        	        for (;;)
        	        	        {
        	        	            int alt10=2;
        	        	            DBG->enterDecision(DBG, 10);

        	        	            switch ( LA(1) ) 
        	        	            {
        	        	            case COMMA:
        	        	            	{
        	        	            		alt10=1;
        	        	            	}
        	        	                break;

        	        	            }

        	        	            DBG->exitDecision(DBG, 10);

        	        	            switch (alt10) 
        	        	            {
        	        	        	case 1:
        	        	        	    DBG->enterAlt(DBG, 1);

        	        	        	    // /home/luca/NetBeansProjects/7.15/PP.g:52:69: COMMA ( WS )? macroParam[m.params] ( WS )?
        	        	        	    {
        	        	        	        DBG->location(DBG, 52, 69);
        	        	        	         MATCHT(COMMA, &FOLLOW_COMMA_in_macroDefinition271); 
        	        	        	        if  (HASEXCEPTION())
        	        	        	        {
        	        	        	            goto rulemacroDefinitionEx;
        	        	        	        }

        	        	        	        DBG->location(DBG, 52, 75);

        	        	        	        // /home/luca/NetBeansProjects/7.15/PP.g:52:75: ( WS )?
        	        	        	        {
        	        	        	            int alt8=2;
        	        	        	            DBG->enterSubRule(DBG, 8);
        	        	        	            DBG->enterDecision(DBG, 8);

        	        	        	            switch ( LA(1) ) 
        	        	        	            {
        	        	        	                case WS:
        	        	        	                	{
        	        	        	                		alt8=1;
        	        	        	                	}
        	        	        	                    break;
        	        	        	            }

        	        	        	            DBG->exitDecision(DBG, 8);

        	        	        	            switch (alt8) 
        	        	        	            {
        	        	        	        	case 1:
        	        	        	        	    DBG->enterAlt(DBG, 1);

        	        	        	        	    // /home/luca/NetBeansProjects/7.15/PP.g:52:75: WS
        	        	        	        	    {
        	        	        	        	        DBG->location(DBG, 52, 75);
        	        	        	        	         MATCHT(WS, &FOLLOW_WS_in_macroDefinition273); 
        	        	        	        	        if  (HASEXCEPTION())
        	        	        	        	        {
        	        	        	        	            goto rulemacroDefinitionEx;
        	        	        	        	        }


        	        	        	        	    }
        	        	        	        	    break;

        	        	        	            }
        	        	        	            DBG->exitSubRule(DBG, 8);

        	        	        	        }
        	        	        	        DBG->location(DBG, 52, 79);
        	        	        	        FOLLOWPUSH(FOLLOW_macroParam_in_macroDefinition276);
        	        	        	        macroParam(ctx, m.params);

        	        	        	        FOLLOWPOP();
        	        	        	        if  (HASEXCEPTION())
        	        	        	        {
        	        	        	            goto rulemacroDefinitionEx;
        	        	        	        }

        	        	        	        DBG->location(DBG, 52, 100);

        	        	        	        // /home/luca/NetBeansProjects/7.15/PP.g:52:100: ( WS )?
        	        	        	        {
        	        	        	            int alt9=2;
        	        	        	            DBG->enterSubRule(DBG, 9);
        	        	        	            DBG->enterDecision(DBG, 9);

        	        	        	            switch ( LA(1) ) 
        	        	        	            {
        	        	        	                case WS:
        	        	        	                	{
        	        	        	                		alt9=1;
        	        	        	                	}
        	        	        	                    break;
        	        	        	            }

        	        	        	            DBG->exitDecision(DBG, 9);

        	        	        	            switch (alt9) 
        	        	        	            {
        	        	        	        	case 1:
        	        	        	        	    DBG->enterAlt(DBG, 1);

        	        	        	        	    // /home/luca/NetBeansProjects/7.15/PP.g:52:100: WS
        	        	        	        	    {
        	        	        	        	        DBG->location(DBG, 52, 100);
        	        	        	        	         MATCHT(WS, &FOLLOW_WS_in_macroDefinition279); 
        	        	        	        	        if  (HASEXCEPTION())
        	        	        	        	        {
        	        	        	        	            goto rulemacroDefinitionEx;
        	        	        	        	        }


        	        	        	        	    }
        	        	        	        	    break;

        	        	        	            }
        	        	        	            DBG->exitSubRule(DBG, 9);

        	        	        	        }

        	        	        	    }
        	        	        	    break;

        	        	        	default:
        	        	        	    goto loop10;	/* break out of the loop */
        	        	        	    break;
        	        	            }
        	        	        }
        	        	        loop10: ; /* Jump out to here if this rule does not match */
        	        	        DBG->exitSubRule(DBG, 10);


        	        	    }
        	        	    break;

        	            }
        	            DBG->exitSubRule(DBG, 11);

        	        }
        	        DBG->location(DBG, 52, 108);
        	         MATCHT(RP, &FOLLOW_RP_in_macroDefinition286); 
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulemacroDefinitionEx;
        	        }

        	        DBG->location(DBG, 52, 111);

        	        // /home/luca/NetBeansProjects/7.15/PP.g:52:111: ( WS )?
        	        {
        	            int alt12=2;
        	            DBG->enterSubRule(DBG, 12);
        	            DBG->enterDecision(DBG, 12);

        	            switch ( LA(1) ) 
        	            {
        	                case WS:
        	                	{
        	                		alt12=1;
        	                	}
        	                    break;
        	            }

        	            DBG->exitDecision(DBG, 12);

        	            switch (alt12) 
        	            {
        	        	case 1:
        	        	    DBG->enterAlt(DBG, 1);

        	        	    // /home/luca/NetBeansProjects/7.15/PP.g:52:111: WS
        	        	    {
        	        	        DBG->location(DBG, 52, 111);
        	        	         MATCHT(WS, &FOLLOW_WS_in_macroDefinition288); 
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto rulemacroDefinitionEx;
        	        	        }


        	        	    }
        	        	    break;

        	            }
        	            DBG->exitSubRule(DBG, 12);

        	        }
        	        DBG->location(DBG, 52, 116);
        	        FOLLOWPUSH(FOLLOW_restOfLine_in_macroDefinition293);
        	        r=restOfLine(ctx, m);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulemacroDefinitionEx;
        	        }

        	        DBG->location(DBG, 53, 17);
        	        {

        	                            	m.type = FUNCTION;
        	                           	
        	        }

        	    }
        	    break;
        	case 2:
        	    DBG->enterAlt(DBG, 2);

        	    // /home/luca/NetBeansProjects/7.15/PP.g:56:19: DEFINE WS id= ID ( WS )? r= restOfLine[m]
        	    {
        	        DBG->location(DBG, 56, 19);
        	         MATCHT(DEFINE, &FOLLOW_DEFINE_in_macroDefinition332); 
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulemacroDefinitionEx;
        	        }

        	        DBG->location(DBG, 56, 26);
        	         MATCHT(WS, &FOLLOW_WS_in_macroDefinition334); 
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulemacroDefinitionEx;
        	        }

        	        DBG->location(DBG, 56, 31);
        	        id = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_macroDefinition338); 
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulemacroDefinitionEx;
        	        }

        	        DBG->location(DBG, 56, 35);

        	        // /home/luca/NetBeansProjects/7.15/PP.g:56:35: ( WS )?
        	        {
        	            int alt13=2;
        	            DBG->enterSubRule(DBG, 13);
        	            DBG->enterDecision(DBG, 13);

        	            switch ( LA(1) ) 
        	            {
        	                case WS:
        	                	{
        	                		alt13=1;
        	                	}
        	                    break;
        	            }

        	            DBG->exitDecision(DBG, 13);

        	            switch (alt13) 
        	            {
        	        	case 1:
        	        	    DBG->enterAlt(DBG, 1);

        	        	    // /home/luca/NetBeansProjects/7.15/PP.g:56:35: WS
        	        	    {
        	        	        DBG->location(DBG, 56, 35);
        	        	         MATCHT(WS, &FOLLOW_WS_in_macroDefinition340); 
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto rulemacroDefinitionEx;
        	        	        }


        	        	    }
        	        	    break;

        	            }
        	            DBG->exitSubRule(DBG, 13);

        	        }
        	        DBG->location(DBG, 56, 40);
        	        FOLLOWPUSH(FOLLOW_restOfLine_in_macroDefinition345);
        	        r=restOfLine(ctx, m);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulemacroDefinitionEx;
        	        }

        	        DBG->location(DBG, 57, 17);
        	        {

        	                            	m.type = OBJECT;
        	                           	
        	        }

        	    }
        	    break;

            }
        }
    }
    

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

            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
            }
            else
            {
                {

                         	m.text = (STRSTREAM->toStringTT(STRSTREAM, r.start, r.stop));
                          	//macro.put((id->getText(id)), m);

                }
            }


    DBG->location(DBG, 60, 17);

    DBG->exitRule(DBG, getGrammarFileName(), (const char *)"macroDefinition");
    decRuleLevel();
    if ( getRuleLevel()==0 ) 
    {
    	DBG->terminate(DBG);
    }


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

/** 
 * $ANTLR start macroParam
 * /home/luca/NetBeansProjects/7.15/PP.g:61:1: macroParam[map<string, int> map] : ID ;
 */
static void
macroParam(pPPParser ctx, map<string, int> map)
{   
    pANTLR3_COMMON_TOKEN    ID1;

    /* Initialize rule variables
     */


    ID1       = NULL;

    DBG->enterRule(DBG, getGrammarFileName(), (const char *)"macroParam");
    if ( getRuleLevel()==0 ) 
    {
    	DBG->commence(DBG);
    }
    incRuleLevel();
    DBG->location(DBG, 61, 1);

    {
        // /home/luca/NetBeansProjects/7.15/PP.g:62:17: ( ID )
        DBG->enterAlt(DBG, 1);

        // /home/luca/NetBeansProjects/7.15/PP.g:62:19: ID
        {
            DBG->location(DBG, 62, 19);
            ID1 = (pANTLR3_COMMON_TOKEN) MATCHT(ID, &FOLLOW_ID_in_macroParam405); 
            if  (HASEXCEPTION())
            {
                goto rulemacroParamEx;
            }

            DBG->location(DBG, 62, 22);
            {
                 ANTLR3_FPRINTF(stdout, "macroParam %s\n", (ID1->getText(ID1))->chars); 
            }

        }

    }
    

    // This is where rules clean up and exit
    //
    goto rulemacroParamEx; /* Prevent compiler warnings */
    rulemacroParamEx: ;

            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
            }


    DBG->location(DBG, 63, 17);

    DBG->exitRule(DBG, getGrammarFileName(), (const char *)"macroParam");
    decRuleLevel();
    if ( getRuleLevel()==0 ) 
    {
    	DBG->terminate(DBG);
    }


    return ;
}
/* $ANTLR end macroParam */

/** 
 * $ANTLR start restOfLine
 * /home/luca/NetBeansProjects/7.15/PP.g:64:1: restOfLine[MacroDef m] : (~ NEWLINE )* ;
 */
static PPParser_restOfLine_return
restOfLine(pPPParser ctx, MacroDef m)
{   
    PPParser_restOfLine_return retval;

    /* Initialize rule variables
     */


    retval.start = LT(1); retval.stop = retval.start;

    DBG->enterRule(DBG, getGrammarFileName(), (const char *)"restOfLine");
    if ( getRuleLevel()==0 ) 
    {
    	DBG->commence(DBG);
    }
    incRuleLevel();
    DBG->location(DBG, 64, 1);

    {
        // /home/luca/NetBeansProjects/7.15/PP.g:65:3: ( (~ NEWLINE )* )
        DBG->enterAlt(DBG, 1);

        // /home/luca/NetBeansProjects/7.15/PP.g:65:5: (~ NEWLINE )*
        {
            DBG->location(DBG, 65, 5);

            // /home/luca/NetBeansProjects/7.15/PP.g:65:5: (~ NEWLINE )*

            DBG->enterSubRule(DBG, 15);

            for (;;)
            {
                int alt15=2;
                DBG->enterDecision(DBG, 15);

                switch ( LA(1) ) 
                {
                case DEFINE:
                	{
                		alt15=1;
                	}
                    break;
                case ID:
                	{
                		alt15=1;
                	}
                    break;
                case WS:
                case LP:
                case COMMA:
                case RP:
                case ANYCHAR:
                	{
                		alt15=1;
                	}
                    break;

                }

                DBG->exitDecision(DBG, 15);

                switch (alt15) 
                {
            	case 1:
            	    DBG->enterAlt(DBG, 1);

            	    // /home/luca/NetBeansProjects/7.15/PP.g:65:6: ~ NEWLINE
            	    {
            	        DBG->location(DBG, 65, 6);
            	        if ( ((LA(1) >= DEFINE) && (LA(1) <= ANYCHAR)) )
            	        {
            	            CONSUME();
            	            PERRORRECOVERY=ANTLR3_FALSE;
            	        }
            	        else 
            	        {
            	            CONSTRUCTEX();
            	            EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
            	            EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
            	            EXCEPTION->expectingSet = &FOLLOW_set_in_restOfLine436;
            	            DBG->recognitionException(DBG, EXCEPTION);
            	            RECOVERFROMMISMATCHEDSET(&FOLLOW_set_in_restOfLine436);    goto rulerestOfLineEx;
            	        }


            	    }
            	    break;

            	default:
            	    goto loop15;	/* break out of the loop */
            	    break;
                }
            }
            loop15: ; /* Jump out to here if this rule does not match */
            DBG->exitSubRule(DBG, 15);


        }

    }
    

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

            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
            }


    DBG->location(DBG, 66, 3);

    DBG->exitRule(DBG, getGrammarFileName(), (const char *)"restOfLine");
    decRuleLevel();
    if ( getRuleLevel()==0 ) 
    {
    	DBG->terminate(DBG);
    }


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

/** 
 * $ANTLR start macroExpansion
 * /home/luca/NetBeansProjects/7.15/PP.g:67:1: macroExpansion returns [pANTLR3_STRING exp] : ( ID ( emptyBlock )* LP ( emptyBlock )* RP | ID ( emptyBlock )* LP ( emptyBlock )* macArgs ( emptyBlock )* RP );
 */
static pANTLR3_STRING
macroExpansion(pPPParser ctx)
{   
    pANTLR3_STRING exp = NULL;

    /* Initialize rule variables
     */


    DBG->enterRule(DBG, getGrammarFileName(), (const char *)"macroExpansion");
    if ( getRuleLevel()==0 ) 
    {
    	DBG->commence(DBG);
    }
    incRuleLevel();
    DBG->location(DBG, 67, 1);

    {
        {
            //  /home/luca/NetBeansProjects/7.15/PP.g:68:17: ( ID ( emptyBlock )* LP ( emptyBlock )* RP | ID ( emptyBlock )* LP ( emptyBlock )* macArgs ( emptyBlock )* RP )
            
            ANTLR3_UINT32 alt21;

            alt21=2;

            DBG->enterDecision(DBG, 21);

            alt21 = cdfa21.predict(ctx, RECOGNIZER, ISTREAM, &cdfa21);
            if  (HASEXCEPTION())
            {
            	DBG->recognitionException(DBG, EXCEPTION);
                goto rulemacroExpansionEx;
            }
            if  (HASEXCEPTION())
            {
                goto rulemacroExpansionEx;
            }

            DBG->exitDecision(DBG, 21);

            switch (alt21) 
            {
        	case 1:
        	    DBG->enterAlt(DBG, 1);

        	    // /home/luca/NetBeansProjects/7.15/PP.g:68:19: ID ( emptyBlock )* LP ( emptyBlock )* RP
        	    {
        	        DBG->location(DBG, 68, 19);
        	         MATCHT(ID, &FOLLOW_ID_in_macroExpansion475); 
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulemacroExpansionEx;
        	        }

        	        DBG->location(DBG, 68, 22);

        	        // /home/luca/NetBeansProjects/7.15/PP.g:68:22: ( emptyBlock )*

        	        DBG->enterSubRule(DBG, 16);

        	        for (;;)
        	        {
        	            int alt16=2;
        	            DBG->enterDecision(DBG, 16);

        	            switch ( LA(1) ) 
        	            {
        	            case NEWLINE:
        	            case WS:
        	            	{
        	            		alt16=1;
        	            	}
        	                break;

        	            }

        	            DBG->exitDecision(DBG, 16);

        	            switch (alt16) 
        	            {
        	        	case 1:
        	        	    DBG->enterAlt(DBG, 1);

        	        	    // /home/luca/NetBeansProjects/7.15/PP.g:68:22: emptyBlock
        	        	    {
        	        	        DBG->location(DBG, 68, 22);
        	        	        FOLLOWPUSH(FOLLOW_emptyBlock_in_macroExpansion477);
        	        	        emptyBlock(ctx);

        	        	        FOLLOWPOP();
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto rulemacroExpansionEx;
        	        	        }


        	        	    }
        	        	    break;

        	        	default:
        	        	    goto loop16;	/* break out of the loop */
        	        	    break;
        	            }
        	        }
        	        loop16: ; /* Jump out to here if this rule does not match */
        	        DBG->exitSubRule(DBG, 16);

        	        DBG->location(DBG, 68, 34);
        	         MATCHT(LP, &FOLLOW_LP_in_macroExpansion480); 
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulemacroExpansionEx;
        	        }

        	        DBG->location(DBG, 68, 37);

        	        // /home/luca/NetBeansProjects/7.15/PP.g:68:37: ( emptyBlock )*

        	        DBG->enterSubRule(DBG, 17);

        	        for (;;)
        	        {
        	            int alt17=2;
        	            DBG->enterDecision(DBG, 17);

        	            switch ( LA(1) ) 
        	            {
        	            case NEWLINE:
        	            case WS:
        	            	{
        	            		alt17=1;
        	            	}
        	                break;

        	            }

        	            DBG->exitDecision(DBG, 17);

        	            switch (alt17) 
        	            {
        	        	case 1:
        	        	    DBG->enterAlt(DBG, 1);

        	        	    // /home/luca/NetBeansProjects/7.15/PP.g:68:37: emptyBlock
        	        	    {
        	        	        DBG->location(DBG, 68, 37);
        	        	        FOLLOWPUSH(FOLLOW_emptyBlock_in_macroExpansion482);
        	        	        emptyBlock(ctx);

        	        	        FOLLOWPOP();
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto rulemacroExpansionEx;
        	        	        }


        	        	    }
        	        	    break;

        	        	default:
        	        	    goto loop17;	/* break out of the loop */
        	        	    break;
        	            }
        	        }
        	        loop17: ; /* Jump out to here if this rule does not match */
        	        DBG->exitSubRule(DBG, 17);

        	        DBG->location(DBG, 68, 49);
        	         MATCHT(RP, &FOLLOW_RP_in_macroExpansion485); 
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulemacroExpansionEx;
        	        }


        	    }
        	    break;
        	case 2:
        	    DBG->enterAlt(DBG, 2);

        	    // /home/luca/NetBeansProjects/7.15/PP.g:69:19: ID ( emptyBlock )* LP ( emptyBlock )* macArgs ( emptyBlock )* RP
        	    {
        	        DBG->location(DBG, 69, 19);
        	         MATCHT(ID, &FOLLOW_ID_in_macroExpansion505); 
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulemacroExpansionEx;
        	        }

        	        DBG->location(DBG, 69, 22);

        	        // /home/luca/NetBeansProjects/7.15/PP.g:69:22: ( emptyBlock )*

        	        DBG->enterSubRule(DBG, 18);

        	        for (;;)
        	        {
        	            int alt18=2;
        	            DBG->enterDecision(DBG, 18);

        	            switch ( LA(1) ) 
        	            {
        	            case NEWLINE:
        	            case WS:
        	            	{
        	            		alt18=1;
        	            	}
        	                break;

        	            }

        	            DBG->exitDecision(DBG, 18);

        	            switch (alt18) 
        	            {
        	        	case 1:
        	        	    DBG->enterAlt(DBG, 1);

        	        	    // /home/luca/NetBeansProjects/7.15/PP.g:69:22: emptyBlock
        	        	    {
        	        	        DBG->location(DBG, 69, 22);
        	        	        FOLLOWPUSH(FOLLOW_emptyBlock_in_macroExpansion507);
        	        	        emptyBlock(ctx);

        	        	        FOLLOWPOP();
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto rulemacroExpansionEx;
        	        	        }


        	        	    }
        	        	    break;

        	        	default:
        	        	    goto loop18;	/* break out of the loop */
        	        	    break;
        	            }
        	        }
        	        loop18: ; /* Jump out to here if this rule does not match */
        	        DBG->exitSubRule(DBG, 18);

        	        DBG->location(DBG, 69, 34);
        	         MATCHT(LP, &FOLLOW_LP_in_macroExpansion510); 
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulemacroExpansionEx;
        	        }

        	        DBG->location(DBG, 69, 37);

        	        // /home/luca/NetBeansProjects/7.15/PP.g:69:37: ( emptyBlock )*

        	        DBG->enterSubRule(DBG, 19);

        	        for (;;)
        	        {
        	            int alt19=2;
        	            DBG->enterDecision(DBG, 19);

        	            switch ( LA(1) ) 
        	            {
        	            case NEWLINE:
        	            case WS:
        	            	{
        	            		alt19=1;
        	            	}
        	                break;

        	            }

        	            DBG->exitDecision(DBG, 19);

        	            switch (alt19) 
        	            {
        	        	case 1:
        	        	    DBG->enterAlt(DBG, 1);

        	        	    // /home/luca/NetBeansProjects/7.15/PP.g:69:37: emptyBlock
        	        	    {
        	        	        DBG->location(DBG, 69, 37);
        	        	        FOLLOWPUSH(FOLLOW_emptyBlock_in_macroExpansion512);
        	        	        emptyBlock(ctx);

        	        	        FOLLOWPOP();
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto rulemacroExpansionEx;
        	        	        }


        	        	    }
        	        	    break;

        	        	default:
        	        	    goto loop19;	/* break out of the loop */
        	        	    break;
        	            }
        	        }
        	        loop19: ; /* Jump out to here if this rule does not match */
        	        DBG->exitSubRule(DBG, 19);

        	        DBG->location(DBG, 69, 49);
        	        FOLLOWPUSH(FOLLOW_macArgs_in_macroExpansion515);
        	        macArgs(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulemacroExpansionEx;
        	        }

        	        DBG->location(DBG, 69, 57);

        	        // /home/luca/NetBeansProjects/7.15/PP.g:69:57: ( emptyBlock )*

        	        DBG->enterSubRule(DBG, 20);

        	        for (;;)
        	        {
        	            int alt20=2;
        	            DBG->enterDecision(DBG, 20);

        	            switch ( LA(1) ) 
        	            {
        	            case NEWLINE:
        	            case WS:
        	            	{
        	            		alt20=1;
        	            	}
        	                break;

        	            }

        	            DBG->exitDecision(DBG, 20);

        	            switch (alt20) 
        	            {
        	        	case 1:
        	        	    DBG->enterAlt(DBG, 1);

        	        	    // /home/luca/NetBeansProjects/7.15/PP.g:69:57: emptyBlock
        	        	    {
        	        	        DBG->location(DBG, 69, 57);
        	        	        FOLLOWPUSH(FOLLOW_emptyBlock_in_macroExpansion517);
        	        	        emptyBlock(ctx);

        	        	        FOLLOWPOP();
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto rulemacroExpansionEx;
        	        	        }


        	        	    }
        	        	    break;

        	        	default:
        	        	    goto loop20;	/* break out of the loop */
        	        	    break;
        	            }
        	        }
        	        loop20: ; /* Jump out to here if this rule does not match */
        	        DBG->exitSubRule(DBG, 20);

        	        DBG->location(DBG, 69, 69);
        	         MATCHT(RP, &FOLLOW_RP_in_macroExpansion520); 
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulemacroExpansionEx;
        	        }


        	    }
        	    break;

            }
        }
    }
    

    // This is where rules clean up and exit
    //
    goto rulemacroExpansionEx; /* Prevent compiler warnings */
    rulemacroExpansionEx: ;

            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
            }


    DBG->location(DBG, 70, 17);

    DBG->exitRule(DBG, getGrammarFileName(), (const char *)"macroExpansion");
    decRuleLevel();
    if ( getRuleLevel()==0 ) 
    {
    	DBG->terminate(DBG);
    }


    return exp;
}
/* $ANTLR end macroExpansion */

/** 
 * $ANTLR start macArgs
 * /home/luca/NetBeansProjects/7.15/PP.g:71:1: macArgs : mArg ( ( emptyBlock )* COMMA ( emptyBlock )* mArg )* ;
 */
static void
macArgs(pPPParser ctx)
{   
    /* Initialize rule variables
     */


    DBG->enterRule(DBG, getGrammarFileName(), (const char *)"macArgs");
    if ( getRuleLevel()==0 ) 
    {
    	DBG->commence(DBG);
    }
    incRuleLevel();
    DBG->location(DBG, 71, 1);

    {
        // /home/luca/NetBeansProjects/7.15/PP.g:72:3: ( mArg ( ( emptyBlock )* COMMA ( emptyBlock )* mArg )* )
        DBG->enterAlt(DBG, 1);

        // /home/luca/NetBeansProjects/7.15/PP.g:72:5: mArg ( ( emptyBlock )* COMMA ( emptyBlock )* mArg )*
        {
            DBG->location(DBG, 72, 5);
            FOLLOWPUSH(FOLLOW_mArg_in_macArgs548);
            mArg(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto rulemacArgsEx;
            }

            DBG->location(DBG, 72, 10);

            // /home/luca/NetBeansProjects/7.15/PP.g:72:10: ( ( emptyBlock )* COMMA ( emptyBlock )* mArg )*

            DBG->enterSubRule(DBG, 24);

            for (;;)
            {
                int alt24=2;
                DBG->enterDecision(DBG, 24);

                alt24 = cdfa24.predict(ctx, RECOGNIZER, ISTREAM, &cdfa24);
                if  (HASEXCEPTION())
                {
                	DBG->recognitionException(DBG, EXCEPTION);
                    goto rulemacArgsEx;
                }
                if  (HASEXCEPTION())
                {
                    goto rulemacArgsEx;
                }

                DBG->exitDecision(DBG, 24);

                switch (alt24) 
                {
            	case 1:
            	    DBG->enterAlt(DBG, 1);

            	    // /home/luca/NetBeansProjects/7.15/PP.g:72:11: ( emptyBlock )* COMMA ( emptyBlock )* mArg
            	    {
            	        DBG->location(DBG, 72, 11);

            	        // /home/luca/NetBeansProjects/7.15/PP.g:72:11: ( emptyBlock )*

            	        DBG->enterSubRule(DBG, 22);

            	        for (;;)
            	        {
            	            int alt22=2;
            	            DBG->enterDecision(DBG, 22);

            	            switch ( LA(1) ) 
            	            {
            	            case NEWLINE:
            	            case WS:
            	            	{
            	            		alt22=1;
            	            	}
            	                break;

            	            }

            	            DBG->exitDecision(DBG, 22);

            	            switch (alt22) 
            	            {
            	        	case 1:
            	        	    DBG->enterAlt(DBG, 1);

            	        	    // /home/luca/NetBeansProjects/7.15/PP.g:72:11: emptyBlock
            	        	    {
            	        	        DBG->location(DBG, 72, 11);
            	        	        FOLLOWPUSH(FOLLOW_emptyBlock_in_macArgs551);
            	        	        emptyBlock(ctx);

            	        	        FOLLOWPOP();
            	        	        if  (HASEXCEPTION())
            	        	        {
            	        	            goto rulemacArgsEx;
            	        	        }


            	        	    }
            	        	    break;

            	        	default:
            	        	    goto loop22;	/* break out of the loop */
            	        	    break;
            	            }
            	        }
            	        loop22: ; /* Jump out to here if this rule does not match */
            	        DBG->exitSubRule(DBG, 22);

            	        DBG->location(DBG, 72, 23);
            	         MATCHT(COMMA, &FOLLOW_COMMA_in_macArgs554); 
            	        if  (HASEXCEPTION())
            	        {
            	            goto rulemacArgsEx;
            	        }

            	        DBG->location(DBG, 72, 29);

            	        // /home/luca/NetBeansProjects/7.15/PP.g:72:29: ( emptyBlock )*

            	        DBG->enterSubRule(DBG, 23);

            	        for (;;)
            	        {
            	            int alt23=2;
            	            DBG->enterDecision(DBG, 23);

            	            switch ( LA(1) ) 
            	            {
            	            case NEWLINE:
            	            case WS:
            	            	{
            	            		alt23=1;
            	            	}
            	                break;

            	            }

            	            DBG->exitDecision(DBG, 23);

            	            switch (alt23) 
            	            {
            	        	case 1:
            	        	    DBG->enterAlt(DBG, 1);

            	        	    // /home/luca/NetBeansProjects/7.15/PP.g:72:29: emptyBlock
            	        	    {
            	        	        DBG->location(DBG, 72, 29);
            	        	        FOLLOWPUSH(FOLLOW_emptyBlock_in_macArgs556);
            	        	        emptyBlock(ctx);

            	        	        FOLLOWPOP();
            	        	        if  (HASEXCEPTION())
            	        	        {
            	        	            goto rulemacArgsEx;
            	        	        }


            	        	    }
            	        	    break;

            	        	default:
            	        	    goto loop23;	/* break out of the loop */
            	        	    break;
            	            }
            	        }
            	        loop23: ; /* Jump out to here if this rule does not match */
            	        DBG->exitSubRule(DBG, 23);

            	        DBG->location(DBG, 72, 41);
            	        FOLLOWPUSH(FOLLOW_mArg_in_macArgs559);
            	        mArg(ctx);

            	        FOLLOWPOP();
            	        if  (HASEXCEPTION())
            	        {
            	            goto rulemacArgsEx;
            	        }


            	    }
            	    break;

            	default:
            	    goto loop24;	/* break out of the loop */
            	    break;
                }
            }
            loop24: ; /* Jump out to here if this rule does not match */
            DBG->exitSubRule(DBG, 24);


        }

    }
    

    // This is where rules clean up and exit
    //
    goto rulemacArgsEx; /* Prevent compiler warnings */
    rulemacArgsEx: ;

            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
            }


    DBG->location(DBG, 73, 17);

    DBG->exitRule(DBG, getGrammarFileName(), (const char *)"macArgs");
    decRuleLevel();
    if ( getRuleLevel()==0 ) 
    {
    	DBG->terminate(DBG);
    }


    return ;
}
/* $ANTLR end macArgs */

/** 
 * $ANTLR start mArg
 * /home/luca/NetBeansProjects/7.15/PP.g:74:1: mArg : (~ ( COMMA | RP ) )+ ;
 */
static void
mArg(pPPParser ctx)
{   
    /* Initialize rule variables
     */


    DBG->enterRule(DBG, getGrammarFileName(), (const char *)"mArg");
    if ( getRuleLevel()==0 ) 
    {
    	DBG->commence(DBG);
    }
    incRuleLevel();
    DBG->location(DBG, 74, 1);

    {
        // /home/luca/NetBeansProjects/7.15/PP.g:75:3: ( (~ ( COMMA | RP ) )+ )
        DBG->enterAlt(DBG, 1);

        // /home/luca/NetBeansProjects/7.15/PP.g:75:5: (~ ( COMMA | RP ) )+
        {
            DBG->location(DBG, 75, 5);
            // /home/luca/NetBeansProjects/7.15/PP.g:75:5: (~ ( COMMA | RP ) )+
            {
                int cnt25=0;
                DBG->enterSubRule(DBG, 25);


                for (;;)
                {
                    int alt25=2;
            	DBG->enterDecision(DBG, 25);

            	switch ( LA(1) ) 
            	{
            	case NEWLINE:
            	case DEFINE:
            	case WS:
            	case ID:
            	case LP:
            	case ANYCHAR:
            		{
            			alt25=1;
            		}
            	    break;

            	}

            	DBG->exitDecision(DBG, 25);

            	switch (alt25) 
            	{
            	    case 1:
            	        DBG->enterAlt(DBG, 1);

            	        // /home/luca/NetBeansProjects/7.15/PP.g:75:6: ~ ( COMMA | RP )
            	        {
            	            DBG->location(DBG, 75, 6);
            	            if ( ((LA(1) >= NEWLINE) && (LA(1) <= LP)) || LA(1) == ANYCHAR )
            	            {
            	                CONSUME();
            	                PERRORRECOVERY=ANTLR3_FALSE;
            	            }
            	            else 
            	            {
            	                CONSTRUCTEX();
            	                EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
            	                EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
            	                EXCEPTION->expectingSet = &FOLLOW_set_in_mArg597;
            	                DBG->recognitionException(DBG, EXCEPTION);
            	                RECOVERFROMMISMATCHEDSET(&FOLLOW_set_in_mArg597);    goto rulemArgEx;
            	            }


            	        }
            	        break;

            	    default:
            	    
            		if ( cnt25 >= 1 )
            		{
            		    goto loop25;
            		}
            		/* mismatchedSetEx()
            		 */
            		CONSTRUCTEX();
            		EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
            		EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;


            		DBG->recognitionException(DBG, EXCEPTION);

            		goto rulemArgEx;
            	}
            	cnt25++;
                }
                loop25: ;	/* Jump to here if this rule does not match */
                DBG->exitSubRule(DBG, 25);

            }

        }

    }
    

    // This is where rules clean up and exit
    //
    goto rulemArgEx; /* Prevent compiler warnings */
    rulemArgEx: ;

            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
            }


    DBG->location(DBG, 76, 3);

    DBG->exitRule(DBG, getGrammarFileName(), (const char *)"mArg");
    decRuleLevel();
    if ( getRuleLevel()==0 ) 
    {
    	DBG->terminate(DBG);
    }


    return ;
}
/* $ANTLR end mArg */

/** 
 * $ANTLR start emptyBlock
 * /home/luca/NetBeansProjects/7.15/PP.g:77:1: emptyBlock : ( WS | NEWLINE );
 */
static void
emptyBlock(pPPParser ctx)
{   
    /* Initialize rule variables
     */


    DBG->enterRule(DBG, getGrammarFileName(), (const char *)"emptyBlock");
    if ( getRuleLevel()==0 ) 
    {
    	DBG->commence(DBG);
    }
    incRuleLevel();
    DBG->location(DBG, 77, 1);

    {
        // /home/luca/NetBeansProjects/7.15/PP.g:78:3: ( WS | NEWLINE )
        DBG->enterAlt(DBG, 1);

        // /home/luca/NetBeansProjects/7.15/PP.g:
        {
            DBG->location(DBG, 78, 3);
            if ( LA(1) == NEWLINE || LA(1) == WS )
            {
                CONSUME();
                PERRORRECOVERY=ANTLR3_FALSE;
            }
            else 
            {
                CONSTRUCTEX();
                EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
                EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
                EXCEPTION->expectingSet = &FOLLOW_set_in_emptyBlock0;
                DBG->recognitionException(DBG, EXCEPTION);
                RECOVERFROMMISMATCHEDSET(&FOLLOW_set_in_emptyBlock0);    goto ruleemptyBlockEx;
            }


        }

    }
    

    // This is where rules clean up and exit
    //
    goto ruleemptyBlockEx; /* Prevent compiler warnings */
    ruleemptyBlockEx: ;

            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
            }


    DBG->location(DBG, 79, 3);

    DBG->exitRule(DBG, getGrammarFileName(), (const char *)"emptyBlock");
    decRuleLevel();
    if ( getRuleLevel()==0 ) 
    {
    	DBG->terminate(DBG);
    }


    return ;
}
/* $ANTLR end emptyBlock */

/** 
 * $ANTLR start sourceText
 * /home/luca/NetBeansProjects/7.15/PP.g:80:1: sourceText : ~ ( NEWLINE ) ;
 */
static PPParser_sourceText_return
sourceText(pPPParser ctx)
{   
    PPParser_sourceText_return retval;

    /* Initialize rule variables
     */


    retval.start = LT(1); retval.stop = retval.start;

    DBG->enterRule(DBG, getGrammarFileName(), (const char *)"sourceText");
    if ( getRuleLevel()==0 ) 
    {
    	DBG->commence(DBG);
    }
    incRuleLevel();
    DBG->location(DBG, 80, 1);

    {
        // /home/luca/NetBeansProjects/7.15/PP.g:81:3: (~ ( NEWLINE ) )
        DBG->enterAlt(DBG, 1);

        // /home/luca/NetBeansProjects/7.15/PP.g:81:5: ~ ( NEWLINE )
        {
            DBG->location(DBG, 81, 5);
            if ( ((LA(1) >= DEFINE) && (LA(1) <= ANYCHAR)) )
            {
                CONSUME();
                PERRORRECOVERY=ANTLR3_FALSE;
            }
            else 
            {
                CONSTRUCTEX();
                EXCEPTION->type         = ANTLR3_MISMATCHED_SET_EXCEPTION;
                EXCEPTION->name         = (void *)ANTLR3_MISMATCHED_SET_NAME;
                EXCEPTION->expectingSet = &FOLLOW_set_in_sourceText634;
                DBG->recognitionException(DBG, EXCEPTION);
                RECOVERFROMMISMATCHEDSET(&FOLLOW_set_in_sourceText634);    goto rulesourceTextEx;
            }


        }

    }
    

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

            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
            }


    DBG->location(DBG, 82, 3);

    DBG->exitRule(DBG, getGrammarFileName(), (const char *)"sourceText");
    decRuleLevel();
    if ( getRuleLevel()==0 ) 
    {
    	DBG->terminate(DBG);
    }


    return retval;
}
/* $ANTLR end sourceText */
/* End of parsing rules
 * ==============================================
 */

/* ==============================================
 * Syntactic predicates
 */
/* End of syntactic predicates
 * ==============================================
 */

 
 



/* End of code
 * =============================================================================
 */
