mootNgramsParser.h
Go to the documentation of this file.
1 #ifndef YY_mootNgramsParser_h_included
2 #define YY_mootNgramsParser_h_included
3 
4 #line 1 "./bison.h"
5 /* before anything */
6 #ifdef c_plusplus
7 #ifndef __cplusplus
8 #define __cplusplus
9 #endif
10 #endif
11 #ifdef __cplusplus
12 #ifndef YY_USE_CLASS
13 #define YY_USE_CLASS
14 #endif
15 #else
16 #endif
17 #include <stdio.h>
18 
19 /* #line 14 "./bison.h" */
20 #define YY_mootNgramsParser_LSP_NEEDED
21 #define YY_mootNgramsParser_LTYPE mootNgramsParserLType
22 #define YY_mootNgramsParser_DEBUG 1
23 #define YY_mootNgramsParser_ERROR_VERBOSE
24 #define YY_mootNgramsParser_LEX_BODY =0
25 #line 54 "mootNgramsParser.yy"
26 
27 /*============================================================================
28  * Doxygen docs
29  *============================================================================*/
41 #include <stdio.h>
42 #include <stdlib.h>
43 #include <stdarg.h>
44 #include <math.h>
45 #include <string.h>
46 
47 #include <mootNgrams.h>
48 
49 // -- get rid of bumble's macros
50 #undef YYACCEPT
51 #undef YYABORT
52 #undef YYERROR
53 #undef YYRECOVERING
54 
55 /* ?
56  * Location-stack element type for bison++ parser.
57  */
58 typedef struct {
59  int timestamp;
60  int first_line;
61  int first_column;
62  int last_line;
63  int last_column;
64  char *text;
66 #define YY_mootNgramsParser_CLASS mootNgramsParser
67 #define YY_mootNgramsParser_MEMBERS \
68  public: \
69  /* -- public instance members go here */ \
70  \
71  moot::mootNgrams *ngrams; \
72  \
73  std::set<moot::mootTagString> *alltags; \
74  \
75  moot::mootNgrams::Ngram prevngram; \
76  \
77  moot::mootNgrams::Ngram curngram; \
78  private: \
79  /* private instance members go here */ \
80  public: \
81  /* public methods */ \
82 \
83  virtual ~mootNgramsParser(void) {};\
84  /* report warnings */\
85  virtual void yywarn(const char *msg) { \
86  yycarp("mootNgramsParser: Warning: %s", msg);\
87  }; \
88 \
89  virtual void yycarp(const char *fmt, ...);
90 #define YY_mootNgramsParser_CONSTRUCTOR_INIT : \
91  ngrams(NULL), \
92  alltags(NULL)
93 
94 #line 135 "mootNgramsParser.yy"
95 typedef union {
97  moot::mootTagString *tagstr;
100 #define YY_mootNgramsParser_STYPE yy_mootNgramsParser_stype
101 #line 141 "mootNgramsParser.yy"
102 
108 #line 14 "./bison.h"
109  /* %{ and %header{ and %union, during decl */
110 #ifndef YY_mootNgramsParser_COMPATIBILITY
111 #ifndef YY_USE_CLASS
112 #define YY_mootNgramsParser_COMPATIBILITY 1
113 #else
114 #define YY_mootNgramsParser_COMPATIBILITY 0
115 #endif
116 #endif
117 
118 #if YY_mootNgramsParser_COMPATIBILITY != 0
119 /* backward compatibility */
120 #ifdef YYLTYPE
121 #ifndef YY_mootNgramsParser_LTYPE
122 #define YY_mootNgramsParser_LTYPE YYLTYPE
123 /* WARNING obsolete !!! user defined YYLTYPE not reported into generated header */
124 /* use %define LTYPE */
125 #endif
126 #endif
127 #ifdef YYSTYPE
128 #ifndef YY_mootNgramsParser_STYPE
129 #define YY_mootNgramsParser_STYPE YYSTYPE
130 /* WARNING obsolete !!! user defined YYSTYPE not reported into generated header */
131 /* use %define STYPE */
132 #endif
133 #endif
134 #ifdef YYDEBUG
135 #ifndef YY_mootNgramsParser_DEBUG
136 #define YY_mootNgramsParser_DEBUG YYDEBUG
137 /* WARNING obsolete !!! user defined YYDEBUG not reported into generated header */
138 /* use %define DEBUG */
139 #endif
140 #endif
141 #ifdef YY_mootNgramsParser_STYPE
142 #ifndef yystype
143 #define yystype YY_mootNgramsParser_STYPE
144 #endif
145 #endif
146 #endif
147 
148 #ifndef YY_mootNgramsParser_PURE
149 
150 /* #line 54 "./bison.h" */
151 
152 #line 54 "./bison.h"
153 /* YY_mootNgramsParser_PURE */
154 #endif
155 
156 /* #line 56 "./bison.h" */
157 
158 #line 56 "./bison.h"
159 /* prefix */
160 #ifndef YY_mootNgramsParser_DEBUG
161 
162 /* #line 58 "./bison.h" */
163 
164 #line 58 "./bison.h"
165 /* YY_mootNgramsParser_DEBUG */
166 #endif
167 #ifndef YY_mootNgramsParser_LSP_NEEDED
168 
169 /* #line 61 "./bison.h" */
170 
171 #line 61 "./bison.h"
172  /* YY_mootNgramsParser_LSP_NEEDED*/
173 #endif
174 /* DEFAULT LTYPE*/
175 #ifdef YY_mootNgramsParser_LSP_NEEDED
176 #ifndef YY_mootNgramsParser_LTYPE
177 typedef
178  struct yyltype
179  {
180  int timestamp;
181  int first_line;
182  int first_column;
183  int last_line;
184  int last_column;
185  char *text;
186  }
187  yyltype;
188 
189 #define YY_mootNgramsParser_LTYPE yyltype
190 #endif
191 #endif
192 /* DEFAULT STYPE*/
193 #ifndef YY_mootNgramsParser_STYPE
194 #define YY_mootNgramsParser_STYPE int
195 #endif
196 /* DEFAULT MISCELANEOUS */
197 #ifndef YY_mootNgramsParser_PARSE
198 #define YY_mootNgramsParser_PARSE yyparse
199 #endif
200 #ifndef YY_mootNgramsParser_LEX
201 #define YY_mootNgramsParser_LEX yylex
202 #endif
203 #ifndef YY_mootNgramsParser_LVAL
204 #define YY_mootNgramsParser_LVAL yylval
205 #endif
206 #ifndef YY_mootNgramsParser_LLOC
207 #define YY_mootNgramsParser_LLOC yylloc
208 #endif
209 #ifndef YY_mootNgramsParser_CHAR
210 #define YY_mootNgramsParser_CHAR yychar
211 #endif
212 #ifndef YY_mootNgramsParser_NERRS
213 #define YY_mootNgramsParser_NERRS yynerrs
214 #endif
215 #ifndef YY_mootNgramsParser_DEBUG_FLAG
216 #define YY_mootNgramsParser_DEBUG_FLAG yydebug
217 #endif
218 #ifndef YY_mootNgramsParser_ERROR
219 #define YY_mootNgramsParser_ERROR yyerror
220 #endif
221 
222 #ifndef YY_mootNgramsParser_PARSE_PARAM
223 #ifndef __STDC__
224 #ifndef __cplusplus
225 #ifndef YY_USE_CLASS
226 #define YY_mootNgramsParser_PARSE_PARAM
227 #ifndef YY_mootNgramsParser_PARSE_PARAM_DEF
228 #define YY_mootNgramsParser_PARSE_PARAM_DEF
229 #endif
230 #endif
231 #endif
232 #endif
233 #ifndef YY_mootNgramsParser_PARSE_PARAM
234 #define YY_mootNgramsParser_PARSE_PARAM void
235 #endif
236 #endif
237 
238 /* TOKEN C */
239 #ifndef YY_USE_CLASS
240 
241 #ifndef YY_mootNgramsParser_PURE
242 extern YY_mootNgramsParser_STYPE YY_mootNgramsParser_LVAL;
243 #endif
244 
245 
246 /* #line 134 "./bison.h" */
247 #define TAG 258
248 #define COUNT 259
249 #define TAB 260
250 #define NEWLINE 261
251 
252 
253 #line 134 "./bison.h"
254  /* #defines token */
255 /* after #define tokens, before const tokens S5*/
256 #else
257 #ifndef YY_mootNgramsParser_CLASS
258 #define YY_mootNgramsParser_CLASS mootNgramsParser
259 #endif
260 
261 #ifndef YY_mootNgramsParser_INHERIT
262 #define YY_mootNgramsParser_INHERIT
263 #endif
264 #ifndef YY_mootNgramsParser_MEMBERS
265 #define YY_mootNgramsParser_MEMBERS
266 #endif
267 #ifndef YY_mootNgramsParser_LEX_BODY
268 #define YY_mootNgramsParser_LEX_BODY
269 #endif
270 #ifndef YY_mootNgramsParser_ERROR_BODY
271 #define YY_mootNgramsParser_ERROR_BODY
272 #endif
273 #ifndef YY_mootNgramsParser_CONSTRUCTOR_PARAM
274 #define YY_mootNgramsParser_CONSTRUCTOR_PARAM
275 #endif
276 
277 class YY_mootNgramsParser_CLASS YY_mootNgramsParser_INHERIT
278 {
279 public: /* static const int token ... */
280 
281 /* #line 160 "./bison.h" */
282 static const int TAG;
283 static const int COUNT;
284 static const int TAB;
285 static const int NEWLINE;
286 
287 
288 #line 160 "./bison.h"
289  /* decl const */
290 public:
291  int YY_mootNgramsParser_PARSE(YY_mootNgramsParser_PARSE_PARAM);
292  virtual void YY_mootNgramsParser_ERROR(const char *) YY_mootNgramsParser_ERROR_BODY;
293 #ifdef YY_mootNgramsParser_PURE
294 #ifdef YY_mootNgramsParser_LSP_NEEDED
295  virtual int YY_mootNgramsParser_LEX(YY_mootNgramsParser_STYPE *YY_mootNgramsParser_LVAL,YY_mootNgramsParser_LTYPE *YY_mootNgramsParser_LLOC) YY_mootNgramsParser_LEX_BODY;
296 #else
297  virtual int YY_mootNgramsParser_LEX(YY_mootNgramsParser_STYPE *YY_mootNgramsParser_LVAL) YY_mootNgramsParser_LEX_BODY;
298 #endif
299 #else
300  virtual int YY_mootNgramsParser_LEX() YY_mootNgramsParser_LEX_BODY;
301  YY_mootNgramsParser_STYPE YY_mootNgramsParser_LVAL;
302 #ifdef YY_mootNgramsParser_LSP_NEEDED
303  YY_mootNgramsParser_LTYPE YY_mootNgramsParser_LLOC;
304 #endif
305  int YY_mootNgramsParser_NERRS;
306  int YY_mootNgramsParser_CHAR;
307 #endif
308 #if YY_mootNgramsParser_DEBUG != 0
309 public:
310  int YY_mootNgramsParser_DEBUG_FLAG; /* nonzero means print parse trace */
311 #endif
312 public:
313  YY_mootNgramsParser_CLASS(YY_mootNgramsParser_CONSTRUCTOR_PARAM);
314 public:
315  YY_mootNgramsParser_MEMBERS
316 };
317 /* other declare folow */
318 #endif
319 
320 
321 #if YY_mootNgramsParser_COMPATIBILITY != 0
322 /* backward compatibility */
323 #ifndef YYSTYPE
324 #define YYSTYPE YY_mootNgramsParser_STYPE
325 #endif
326 
327 #ifndef YYLTYPE
328 #define YYLTYPE YY_mootNgramsParser_LTYPE
329 #endif
330 #ifndef YYDEBUG
331 #ifdef YY_mootNgramsParser_DEBUG
332 #define YYDEBUG YY_mootNgramsParser_DEBUG
333 #endif
334 #endif
335 
336 #endif
337 /* END */
338 
339 /* #line 209 "./bison.h" */
340 #endif
CountT NgramCount
Definition: mootNgrams.h:50
Definition: mootNgramsParser.h:40
string mootTagString
Definition: mootToken.h:59
Definition: mootNgrams.h:80
Definition: mootNgramsParser.h:32
HMM training data: n-gram frequencies: raw.