X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=bundles%2Forg.simantics.databoard%2Fcpp%2FDataBoardTest%2FDataBoard%2FLangLexer.h;h=279c367779eb2cad39488c2b1f29e79290bca553;hb=refs%2Fchanges%2F38%2F238%2F2;hp=dfbd79160b96f0131facfbbc79fe47df1372ea63;hpb=24e2b34260f219f0d1644ca7a138894980e25b14;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/LangLexer.h b/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/LangLexer.h index dfbd79160..279c36777 100644 --- a/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/LangLexer.h +++ b/bundles/org.simantics.databoard/cpp/DataBoardTest/DataBoard/LangLexer.h @@ -1,183 +1,183 @@ -/** \file - * This C header file was generated by $ANTLR version 3.2 Sep 23, 2009 12:02:23 - * - * - From the grammar source file : Lang.g - * - On : 2010-02-24 13:27:55 - * - for the lexer : LangLexerLexer * - * Editing it, at least manually, is not wise. - * - * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws. - * - * - * The lexer LangLexer 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 pLangLexer, which is returned from a call to LangLexerNew(). - * - * As this is a generated lexer, it is unlikely you will call it 'manually'. However - * the methods are provided anyway. - * * The methods in pLangLexer are as follows: - * - * - void pLangLexer->T__10(pLangLexer) - * - void pLangLexer->INTTYPE(pLangLexer) - * - void pLangLexer->FLOATTYPE(pLangLexer) - * - void pLangLexer->ID(pLangLexer) - * - void pLangLexer->INT(pLangLexer) - * - void pLangLexer->WS(pLangLexer) - * - void pLangLexer->Tokens(pLangLexer) - * - * 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 _LangLexer_H -#define _LangLexer_H -/* ============================================================================= - * Standard antlr3 C runtime definitions - */ -#include - -/* 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 LangLexer_Ctx_struct LangLexer, * pLangLexer; - - - -#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 - -/** Context tracking structure for LangLexer - */ -struct LangLexer_Ctx_struct -{ - /** Built in ANTLR3 context tracker contains all the generic elements - * required for context tracking. - */ - pANTLR3_LEXER pLexer; - - - void (*mT__10) (struct LangLexer_Ctx_struct * ctx); - void (*mINTTYPE) (struct LangLexer_Ctx_struct * ctx); - void (*mFLOATTYPE) (struct LangLexer_Ctx_struct * ctx); - void (*mID) (struct LangLexer_Ctx_struct * ctx); - void (*mINT) (struct LangLexer_Ctx_struct * ctx); - void (*mWS) (struct LangLexer_Ctx_struct * ctx); - void (*mTokens) (struct LangLexer_Ctx_struct * ctx); const char * (*getGrammarFileName)(); - void (*free) (struct LangLexer_Ctx_struct * ctx); - -}; - -// Function protoypes for the constructor functions that external translation units -// such as delegators and delegates may wish to call. -// -ANTLR3_API pLangLexer LangLexerNew (pANTLR3_INPUT_STREAM instream); -ANTLR3_API pLangLexer LangLexerNewSSD (pANTLR3_INPUT_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state); - -/** Symbolic definitions of all the tokens that the lexer 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 WS 9 -#define FLOATTYPE 7 -#define DECL 4 -#define T__10 10 -#define INT 8 -#define ID 5 -#define INTTYPE 6 -#define EOF -1 -#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 LangLexer - * ============================================================================= - */ -/** \} */ - -#ifdef __cplusplus -} -#endif - -#endif - -/* END - Note:Keep extra line feed to satisfy UNIX systems */ +/** \file + * This C header file was generated by $ANTLR version 3.2 Sep 23, 2009 12:02:23 + * + * - From the grammar source file : Lang.g + * - On : 2010-02-24 13:27:55 + * - for the lexer : LangLexerLexer * + * Editing it, at least manually, is not wise. + * + * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws. + * + * + * The lexer LangLexer 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 pLangLexer, which is returned from a call to LangLexerNew(). + * + * As this is a generated lexer, it is unlikely you will call it 'manually'. However + * the methods are provided anyway. + * * The methods in pLangLexer are as follows: + * + * - void pLangLexer->T__10(pLangLexer) + * - void pLangLexer->INTTYPE(pLangLexer) + * - void pLangLexer->FLOATTYPE(pLangLexer) + * - void pLangLexer->ID(pLangLexer) + * - void pLangLexer->INT(pLangLexer) + * - void pLangLexer->WS(pLangLexer) + * - void pLangLexer->Tokens(pLangLexer) + * + * 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 _LangLexer_H +#define _LangLexer_H +/* ============================================================================= + * Standard antlr3 C runtime definitions + */ +#include + +/* 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 LangLexer_Ctx_struct LangLexer, * pLangLexer; + + + +#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 + +/** Context tracking structure for LangLexer + */ +struct LangLexer_Ctx_struct +{ + /** Built in ANTLR3 context tracker contains all the generic elements + * required for context tracking. + */ + pANTLR3_LEXER pLexer; + + + void (*mT__10) (struct LangLexer_Ctx_struct * ctx); + void (*mINTTYPE) (struct LangLexer_Ctx_struct * ctx); + void (*mFLOATTYPE) (struct LangLexer_Ctx_struct * ctx); + void (*mID) (struct LangLexer_Ctx_struct * ctx); + void (*mINT) (struct LangLexer_Ctx_struct * ctx); + void (*mWS) (struct LangLexer_Ctx_struct * ctx); + void (*mTokens) (struct LangLexer_Ctx_struct * ctx); const char * (*getGrammarFileName)(); + void (*free) (struct LangLexer_Ctx_struct * ctx); + +}; + +// Function protoypes for the constructor functions that external translation units +// such as delegators and delegates may wish to call. +// +ANTLR3_API pLangLexer LangLexerNew (pANTLR3_INPUT_STREAM instream); +ANTLR3_API pLangLexer LangLexerNewSSD (pANTLR3_INPUT_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state); + +/** Symbolic definitions of all the tokens that the lexer 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 WS 9 +#define FLOATTYPE 7 +#define DECL 4 +#define T__10 10 +#define INT 8 +#define ID 5 +#define INTTYPE 6 +#define EOF -1 +#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 LangLexer + * ============================================================================= + */ +/** \} */ + +#ifdef __cplusplus +} +#endif + +#endif + +/* END - Note:Keep extra line feed to satisfy UNIX systems */