/** \file
 *  This C header file was generated by $ANTLR version 3.2 debian-5
 *
 *     -  From the grammar source file : RSP.g
 *     -                            On : 2011-09-11 16:17:22
 *     -                for the parser : RSPParserParser *
 * Editing it, at least manually, is not wise. 
 *
 * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
 *
 *
 * The parser RSPParser has the callable functions (rules) shown below,
 * which will invoke the code for the associated rule in the source grammar
 * assuming that the input stream is pointing to a token/text stream that could begin
 * this rule.
 * 
 * For instance if you call the first (topmost) rule in a parser grammar, you will
 * get the results of a full parse, but calling a rule half way through the grammar will
 * allow you to pass part of a full token stream to the parser, such as for syntax checking
 * in editors and so on.
 *
 * The parser entry points are called indirectly (by function pointer to function) via
 * a parser context typedef pRSPParser, which is returned from a call to RSPParserNew().
 *
 * The methods in pRSPParser are  as follows:
 *
 *  - RSPParser_query_return      pRSPParser->query(pRSPParser)
 *  - RSPParser_expr_return      pRSPParser->expr(pRSPParser)
 *  - RSPParser_aexpr_return      pRSPParser->aexpr(pRSPParser)
 *  - RSPParser_crit_return      pRSPParser->crit(pRSPParser)
 *  - RSPParser_strcrit_return      pRSPParser->strcrit(pRSPParser)
 *  - RSPParser_strop_return      pRSPParser->strop(pRSPParser)
 *  - RSPParser_intcrit_return      pRSPParser->intcrit(pRSPParser)
 *  - RSPParser_intop_return      pRSPParser->intop(pRSPParser)
 *  - RSPParser_datecrit_return      pRSPParser->datecrit(pRSPParser)
 *  - RSPParser_dateop_return      pRSPParser->dateop(pRSPParser)
 *  - RSPParser_datespec_return      pRSPParser->datespec(pRSPParser)
 *  - RSPParser_dateref_return      pRSPParser->dateref(pRSPParser)
 *  - RSPParser_dateintval_return      pRSPParser->dateintval(pRSPParser)
 *
 * The return type for any particular rule is of course determined by the source
 * grammar file.
 */
// [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.

#ifndef	_RSPParser_H
#define _RSPParser_H
/* =============================================================================
 * Standard antlr3 C runtime definitions
 */
#include    <antlr3.h>

/* End of standard antlr 3 runtime definitions
 * =============================================================================
 */
 
#ifdef __cplusplus
extern "C" {
#endif

// Forward declare the context typedef so that we can use it before it is
// properly defined. Delegators and delegates (from import statements) are
// interdependent and their context structures contain pointers to each other
// C only allows such things to be declared if you pre-declare the typedef.
//
typedef struct RSPParser_Ctx_struct RSPParser, * pRSPParser;



#ifdef	ANTLR3_WINDOWS
// Disable: Unreferenced parameter,							- Rules with parameters that are not used
//          constant conditional,							- ANTLR realizes that a prediction is always true (synpred usually)
//          initialized but unused variable					- tree rewrite variables declared but not needed
//          Unreferenced local variable						- lexer rule declares but does not always use _type
//          potentially unitialized variable used			- retval always returned from a rule 
//			unreferenced local function has been removed	- susually getTokenNames or freeScope, they can go without warnigns
//
// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
// usually generated when a parser rule is given a parameter that it does not use. Mostly though
// this is a matter of orthogonality hence I disable that one.
//
#pragma warning( disable : 4100 )
#pragma warning( disable : 4101 )
#pragma warning( disable : 4127 )
#pragma warning( disable : 4189 )
#pragma warning( disable : 4505 )
#pragma warning( disable : 4701 )
#endif
typedef struct RSPParser_query_return_struct
{
    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
     */
    pANTLR3_COMMON_TOKEN    start;
    pANTLR3_COMMON_TOKEN    stop;
    pANTLR3_BASE_TREE	tree;
   
}
    RSPParser_query_return;

typedef struct RSPParser_expr_return_struct
{
    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
     */
    pANTLR3_COMMON_TOKEN    start;
    pANTLR3_COMMON_TOKEN    stop;
    pANTLR3_BASE_TREE	tree;
   
}
    RSPParser_expr_return;

typedef struct RSPParser_aexpr_return_struct
{
    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
     */
    pANTLR3_COMMON_TOKEN    start;
    pANTLR3_COMMON_TOKEN    stop;
    pANTLR3_BASE_TREE	tree;
   
}
    RSPParser_aexpr_return;

typedef struct RSPParser_crit_return_struct
{
    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
     */
    pANTLR3_COMMON_TOKEN    start;
    pANTLR3_COMMON_TOKEN    stop;
    pANTLR3_BASE_TREE	tree;
   
}
    RSPParser_crit_return;

typedef struct RSPParser_strcrit_return_struct
{
    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
     */
    pANTLR3_COMMON_TOKEN    start;
    pANTLR3_COMMON_TOKEN    stop;
    pANTLR3_BASE_TREE	tree;
   
}
    RSPParser_strcrit_return;

typedef struct RSPParser_strop_return_struct
{
    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
     */
    pANTLR3_COMMON_TOKEN    start;
    pANTLR3_COMMON_TOKEN    stop;
    pANTLR3_BASE_TREE	tree;
   
}
    RSPParser_strop_return;

typedef struct RSPParser_intcrit_return_struct
{
    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
     */
    pANTLR3_COMMON_TOKEN    start;
    pANTLR3_COMMON_TOKEN    stop;
    pANTLR3_BASE_TREE	tree;
   
}
    RSPParser_intcrit_return;

typedef struct RSPParser_intop_return_struct
{
    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
     */
    pANTLR3_COMMON_TOKEN    start;
    pANTLR3_COMMON_TOKEN    stop;
    pANTLR3_BASE_TREE	tree;
   
}
    RSPParser_intop_return;

typedef struct RSPParser_datecrit_return_struct
{
    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
     */
    pANTLR3_COMMON_TOKEN    start;
    pANTLR3_COMMON_TOKEN    stop;
    pANTLR3_BASE_TREE	tree;
   
}
    RSPParser_datecrit_return;

typedef struct RSPParser_dateop_return_struct
{
    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
     */
    pANTLR3_COMMON_TOKEN    start;
    pANTLR3_COMMON_TOKEN    stop;
    pANTLR3_BASE_TREE	tree;
   
}
    RSPParser_dateop_return;

typedef struct RSPParser_datespec_return_struct
{
    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
     */
    pANTLR3_COMMON_TOKEN    start;
    pANTLR3_COMMON_TOKEN    stop;
    pANTLR3_BASE_TREE	tree;
   
}
    RSPParser_datespec_return;

typedef struct RSPParser_dateref_return_struct
{
    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
     */
    pANTLR3_COMMON_TOKEN    start;
    pANTLR3_COMMON_TOKEN    stop;
    pANTLR3_BASE_TREE	tree;
   
}
    RSPParser_dateref_return;

typedef struct RSPParser_dateintval_return_struct
{
    /** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
     */
    pANTLR3_COMMON_TOKEN    start;
    pANTLR3_COMMON_TOKEN    stop;
    pANTLR3_BASE_TREE	tree;
   
}
    RSPParser_dateintval_return;



/** Context tracking structure for RSPParser
 */
struct RSPParser_Ctx_struct
{
    /** Built in ANTLR3 context tracker contains all the generic elements
     *  required for context tracking.
     */
    pANTLR3_PARSER   pParser;


     RSPParser_query_return (*query)	(struct RSPParser_Ctx_struct * ctx);
     RSPParser_expr_return (*expr)	(struct RSPParser_Ctx_struct * ctx);
     RSPParser_aexpr_return (*aexpr)	(struct RSPParser_Ctx_struct * ctx);
     RSPParser_crit_return (*crit)	(struct RSPParser_Ctx_struct * ctx);
     RSPParser_strcrit_return (*strcrit)	(struct RSPParser_Ctx_struct * ctx);
     RSPParser_strop_return (*strop)	(struct RSPParser_Ctx_struct * ctx);
     RSPParser_intcrit_return (*intcrit)	(struct RSPParser_Ctx_struct * ctx);
     RSPParser_intop_return (*intop)	(struct RSPParser_Ctx_struct * ctx);
     RSPParser_datecrit_return (*datecrit)	(struct RSPParser_Ctx_struct * ctx);
     RSPParser_dateop_return (*dateop)	(struct RSPParser_Ctx_struct * ctx);
     RSPParser_datespec_return (*datespec)	(struct RSPParser_Ctx_struct * ctx);
     RSPParser_dateref_return (*dateref)	(struct RSPParser_Ctx_struct * ctx);
     RSPParser_dateintval_return (*dateintval)	(struct RSPParser_Ctx_struct * ctx);
    // Delegated rules
    const char * (*getGrammarFileName)();
    void	    (*free)   (struct RSPParser_Ctx_struct * ctx);
    /* @headerFile.members() */
    pANTLR3_BASE_TREE_ADAPTOR	adaptor;
    pANTLR3_VECTOR_FACTORY		vectors;
    /* End @headerFile.members() */
};

// Function protoypes for the constructor functions that external translation units
// such as delegators and delegates may wish to call.
//
ANTLR3_API pRSPParser RSPParserNew         (pANTLR3_COMMON_TOKEN_STREAM instream);
ANTLR3_API pRSPParser RSPParserNewSSD      (pANTLR3_COMMON_TOKEN_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state);

/** Symbolic definitions of all the tokens that the parser will work with.
 * \{
 *
 * Antlr will define EOF, but we can't use that as it it is too common in
 * in C header files and that would be confusing. There is no way to filter this out at the moment
 * so we just undef it here for now. That isn't the value we get back from C recognizers
 * anyway. We are looking for ANTLR3_TOKEN_EOF.
 */
#ifdef	EOF
#undef	EOF
#endif
#ifdef	Tokens
#undef	Tokens
#endif 
#define STARTSW      14
#define WEEK      26
#define TODAY      24
#define YEAR      28
#define ENDSW      15
#define GTE      20
#define BEFORE      21
#define DAY      25
#define INT      16
#define NOT      11
#define AFTER      22
#define AND      6
#define EOF      -1
#define LTE      19
#define MONTH      27
#define DIGIT19      31
#define INCLUDES      13
#define STR      10
#define QUOTE      29
#define WS      30
#define GREATER      18
#define LPAR      7
#define NEWLINE      4
#define EQUAL      12
#define OR      5
#define LESS      17
#define RPAR      8
#define FIELD      9
#define ESCAPED      33
#define DATE      23
#define DIGIT09      32
#ifdef	EOF
#undef	EOF
#define	EOF	ANTLR3_TOKEN_EOF
#endif

#ifndef TOKENSOURCE
#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource
#endif

/* End of token definitions for RSPParser
 * =============================================================================
 */
/** \} */

#ifdef __cplusplus
}
#endif

#endif

/* END - Note:Keep extra line feed to satisfy UNIX systems */
