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