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