1/** \file 2 * This C header file was generated by $ANTLR version 3.2 debian-5 3 * 4 * - From the grammar source file : DAAP.g 5 * - On : 2011-09-11 15:48:50 6 * - for the lexer : DAAPLexerLexer * 7 * Editing it, at least manually, is not wise. 8 * 9 * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws. 10 * 11 * 12 * The lexer DAAPLexer has the callable functions (rules) shown below, 13 * which will invoke the code for the associated rule in the source grammar 14 * assuming that the input stream is pointing to a token/text stream that could begin 15 * this rule. 16 * 17 * For instance if you call the first (topmost) rule in a parser grammar, you will 18 * get the results of a full parse, but calling a rule half way through the grammar will 19 * allow you to pass part of a full token stream to the parser, such as for syntax checking 20 * in editors and so on. 21 * 22 * The parser entry points are called indirectly (by function pointer to function) via 23 * a parser context typedef pDAAPLexer, which is returned from a call to DAAPLexerNew(). 24 * 25 * As this is a generated lexer, it is unlikely you will call it 'manually'. However 26 * the methods are provided anyway. 27 * * The methods in pDAAPLexer are as follows: 28 * 29 * - void pDAAPLexer->QUOTE(pDAAPLexer) 30 * - void pDAAPLexer->LPAR(pDAAPLexer) 31 * - void pDAAPLexer->RPAR(pDAAPLexer) 32 * - void pDAAPLexer->OPAND(pDAAPLexer) 33 * - void pDAAPLexer->OPOR(pDAAPLexer) 34 * - void pDAAPLexer->NEWLINE(pDAAPLexer) 35 * - void pDAAPLexer->STR(pDAAPLexer) 36 * - void pDAAPLexer->ESCAPED(pDAAPLexer) 37 * - void pDAAPLexer->Tokens(pDAAPLexer) 38 * 39 * The return type for any particular rule is of course determined by the source 40 * grammar file. 41 */ 42// [The "BSD licence"] 43// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC 44// http://www.temporal-wave.com 45// http://www.linkedin.com/in/jimidle 46// 47// All rights reserved. 48// 49// Redistribution and use in source and binary forms, with or without 50// modification, are permitted provided that the following conditions 51// are met: 52// 1. Redistributions of source code must retain the above copyright 53// notice, this list of conditions and the following disclaimer. 54// 2. Redistributions in binary form must reproduce the above copyright 55// notice, this list of conditions and the following disclaimer in the 56// documentation and/or other materials provided with the distribution. 57// 3. The name of the author may not be used to endorse or promote products 58// derived from this software without specific prior written permission. 59// 60// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 61// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 62// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 63// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 64// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 65// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 66// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 67// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 68// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 69// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 70 71#ifndef _DAAPLexer_H 72#define _DAAPLexer_H 73/* ============================================================================= 74 * Standard antlr3 C runtime definitions 75 */ 76#include <antlr3.h> 77 78/* End of standard antlr 3 runtime definitions 79 * ============================================================================= 80 */ 81 82#ifdef __cplusplus 83extern "C" { 84#endif 85 86// Forward declare the context typedef so that we can use it before it is 87// properly defined. Delegators and delegates (from import statements) are 88// interdependent and their context structures contain pointers to each other 89// C only allows such things to be declared if you pre-declare the typedef. 90// 91typedef struct DAAPLexer_Ctx_struct DAAPLexer, * pDAAPLexer; 92 93 94 95#ifdef ANTLR3_WINDOWS 96// Disable: Unreferenced parameter, - Rules with parameters that are not used 97// constant conditional, - ANTLR realizes that a prediction is always true (synpred usually) 98// initialized but unused variable - tree rewrite variables declared but not needed 99// Unreferenced local variable - lexer rule declares but does not always use _type 100// potentially unitialized variable used - retval always returned from a rule 101// unreferenced local function has been removed - susually getTokenNames or freeScope, they can go without warnigns 102// 103// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at 104// and the codegen must generate some of these warnings by necessity, apart from 4100, which is 105// usually generated when a parser rule is given a parameter that it does not use. Mostly though 106// this is a matter of orthogonality hence I disable that one. 107// 108#pragma warning( disable : 4100 ) 109#pragma warning( disable : 4101 ) 110#pragma warning( disable : 4127 ) 111#pragma warning( disable : 4189 ) 112#pragma warning( disable : 4505 ) 113#pragma warning( disable : 4701 ) 114#endif 115 116/** Context tracking structure for DAAPLexer 117 */ 118struct DAAPLexer_Ctx_struct 119{ 120 /** Built in ANTLR3 context tracker contains all the generic elements 121 * required for context tracking. 122 */ 123 pANTLR3_LEXER pLexer; 124 125 126 void (*mQUOTE) (struct DAAPLexer_Ctx_struct * ctx); 127 void (*mLPAR) (struct DAAPLexer_Ctx_struct * ctx); 128 void (*mRPAR) (struct DAAPLexer_Ctx_struct * ctx); 129 void (*mOPAND) (struct DAAPLexer_Ctx_struct * ctx); 130 void (*mOPOR) (struct DAAPLexer_Ctx_struct * ctx); 131 void (*mNEWLINE) (struct DAAPLexer_Ctx_struct * ctx); 132 void (*mSTR) (struct DAAPLexer_Ctx_struct * ctx); 133 void (*mESCAPED) (struct DAAPLexer_Ctx_struct * ctx); 134 void (*mTokens) (struct DAAPLexer_Ctx_struct * ctx); const char * (*getGrammarFileName)(); 135 void (*free) (struct DAAPLexer_Ctx_struct * ctx); 136 137}; 138 139// Function protoypes for the constructor functions that external translation units 140// such as delegators and delegates may wish to call. 141// 142ANTLR3_API pDAAPLexer DAAPLexerNew (pANTLR3_INPUT_STREAM instream); 143ANTLR3_API pDAAPLexer DAAPLexerNewSSD (pANTLR3_INPUT_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state); 144 145/** Symbolic definitions of all the tokens that the lexer will work with. 146 * \{ 147 * 148 * Antlr will define EOF, but we can't use that as it it is too common in 149 * in C header files and that would be confusing. There is no way to filter this out at the moment 150 * so we just undef it here for now. That isn't the value we get back from C recognizers 151 * anyway. We are looking for ANTLR3_TOKEN_EOF. 152 */ 153#ifdef EOF 154#undef EOF 155#endif 156#ifdef Tokens 157#undef Tokens 158#endif 159#define STR 9 160#define QUOTE 10 161#define NEWLINE 4 162#define LPAR 7 163#define OPOR 5 164#define RPAR 8 165#define ESCAPED 11 166#define OPAND 6 167#define EOF -1 168#ifdef EOF 169#undef EOF 170#define EOF ANTLR3_TOKEN_EOF 171#endif 172 173#ifndef TOKENSOURCE 174#define TOKENSOURCE(lxr) lxr->pLexer->rec->state->tokSource 175#endif 176 177/* End of token definitions for DAAPLexer 178 * ============================================================================= 179 */ 180/** \} */ 181 182#ifdef __cplusplus 183} 184#endif 185 186#endif 187 188/* END - Note:Keep extra line feed to satisfy UNIX systems */ 189