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