Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Try to fix #8852 (SimGrid won't compile on Ubuntu 9.10) by betterly checking my argum...
[simgrid.git] / src / gras / DataDesc / ddt_parse.yy.c
1
2 #line 3 "gras/DataDesc/ddt_parse.yy.c"
3
4 #define  YY_INT_ALIGNED short int
5
6 /* A lexical scanner generated by flex */
7
8 #define yy_create_buffer gras_ddt_parse__create_buffer
9 #define yy_delete_buffer gras_ddt_parse__delete_buffer
10 #define yy_flex_debug gras_ddt_parse__flex_debug
11 #define yy_init_buffer gras_ddt_parse__init_buffer
12 #define yy_flush_buffer gras_ddt_parse__flush_buffer
13 #define yy_load_buffer_state gras_ddt_parse__load_buffer_state
14 #define yy_switch_to_buffer gras_ddt_parse__switch_to_buffer
15 #define yyin gras_ddt_parse_in
16 #define yyleng gras_ddt_parse_leng
17 #define yylex gras_ddt_parse_lex
18 #define yylineno gras_ddt_parse_lineno
19 #define yyout gras_ddt_parse_out
20 #define yyrestart gras_ddt_parse_restart
21 #define yytext gras_ddt_parse_text
22 #define yywrap gras_ddt_parse_wrap
23 #define yyalloc gras_ddt_parse_alloc
24 #define yyrealloc gras_ddt_parse_realloc
25 #define yyfree gras_ddt_parse_free
26
27 #define FLEX_SCANNER
28 #define YY_FLEX_MAJOR_VERSION 2
29 #define YY_FLEX_MINOR_VERSION 5
30 #define YY_FLEX_SUBMINOR_VERSION 35
31 #if YY_FLEX_SUBMINOR_VERSION > 0
32 #define FLEX_BETA
33 #endif
34
35 /* First, we deal with  platform-specific or compiler-specific issues. */
36
37 /* begin standard C headers. */
38 #include <stdio.h>
39 #include <string.h>
40 #include <errno.h>
41 #include <stdlib.h>
42
43 /* end standard C headers. */
44
45 /* flex integer type definitions */
46
47 #ifndef FLEXINT_H
48 #define FLEXINT_H
49
50 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
51
52 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
53
54 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
55  * if you want the limit (max/min) macros for int types. 
56  */
57 #ifndef __STDC_LIMIT_MACROS
58 #define __STDC_LIMIT_MACROS 1
59 #endif
60
61 #include <inttypes.h>
62 typedef int8_t flex_int8_t;
63 typedef uint8_t flex_uint8_t;
64 typedef int16_t flex_int16_t;
65 typedef uint16_t flex_uint16_t;
66 typedef int32_t flex_int32_t;
67 typedef uint32_t flex_uint32_t;
68 #else
69 typedef signed char flex_int8_t;
70 typedef short int flex_int16_t;
71 typedef int flex_int32_t;
72 typedef unsigned char flex_uint8_t;
73 typedef unsigned short int flex_uint16_t;
74 typedef unsigned int flex_uint32_t;
75
76 /* Limits of integral types. */
77 #ifndef INT8_MIN
78 #define INT8_MIN               (-128)
79 #endif
80 #ifndef INT16_MIN
81 #define INT16_MIN              (-32767-1)
82 #endif
83 #ifndef INT32_MIN
84 #define INT32_MIN              (-2147483647-1)
85 #endif
86 #ifndef INT8_MAX
87 #define INT8_MAX               (127)
88 #endif
89 #ifndef INT16_MAX
90 #define INT16_MAX              (32767)
91 #endif
92 #ifndef INT32_MAX
93 #define INT32_MAX              (2147483647)
94 #endif
95 #ifndef UINT8_MAX
96 #define UINT8_MAX              (255U)
97 #endif
98 #ifndef UINT16_MAX
99 #define UINT16_MAX             (65535U)
100 #endif
101 #ifndef UINT32_MAX
102 #define UINT32_MAX             (4294967295U)
103 #endif
104
105 #endif /* ! C99 */
106
107 #endif /* ! FLEXINT_H */
108
109 #ifdef __cplusplus
110
111 /* The "const" storage-class-modifier is valid. */
112 #define YY_USE_CONST
113
114 #else /* ! __cplusplus */
115
116 /* C99 requires __STDC__ to be defined as 1. */
117 #if defined (__STDC__)
118
119 #define YY_USE_CONST
120
121 #endif /* defined (__STDC__) */
122 #endif /* ! __cplusplus */
123
124 #ifdef YY_USE_CONST
125 #define yyconst const
126 #else
127 #define yyconst
128 #endif
129
130 /* Returned upon end-of-file. */
131 #define YY_NULL 0
132
133 /* Promotes a possibly negative, possibly signed char to an unsigned
134  * integer for use as an array index.  If the signed char is negative,
135  * we want to instead treat it as an 8-bit unsigned char, hence the
136  * double cast.
137  */
138 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
139
140 /* Enter a start condition.  This macro really ought to take a parameter,
141  * but we do it the disgusting crufty way forced on us by the ()-less
142  * definition of BEGIN.
143  */
144 #define BEGIN (yy_start) = 1 + 2 *
145
146 /* Translate the current start state into a value that can be later handed
147  * to BEGIN to return to the state.  The YYSTATE alias is for lex
148  * compatibility.
149  */
150 #define YY_START (((yy_start) - 1) / 2)
151 #define YYSTATE YY_START
152
153 /* Action number for EOF rule of a given start state. */
154 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
155
156 /* Special action meaning "start processing a new file". */
157 #define YY_NEW_FILE gras_ddt_parse_restart(gras_ddt_parse_in  )
158
159 #define YY_END_OF_BUFFER_CHAR 0
160
161 /* Size of default input buffer. */
162 #ifndef YY_BUF_SIZE
163 #define YY_BUF_SIZE 16384
164 #endif
165
166 /* The state buf must be large enough to hold one state per character in the main buffer.
167  */
168 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
169
170 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
171 #define YY_TYPEDEF_YY_BUFFER_STATE
172 typedef struct yy_buffer_state *YY_BUFFER_STATE;
173 #endif
174
175 extern int gras_ddt_parse_leng;
176
177 extern FILE *gras_ddt_parse_in, *gras_ddt_parse_out;
178
179 #define EOB_ACT_CONTINUE_SCAN 0
180 #define EOB_ACT_END_OF_FILE 1
181 #define EOB_ACT_LAST_MATCH 2
182
183 #define YY_LESS_LINENO(n)
184
185 /* Return all but the first "n" matched characters back to the input stream. */
186 #define yyless(n) \
187         do \
188                 { \
189                 /* Undo effects of setting up gras_ddt_parse_text. */ \
190         int yyless_macro_arg = (n); \
191         YY_LESS_LINENO(yyless_macro_arg);\
192                 *yy_cp = (yy_hold_char); \
193                 YY_RESTORE_YY_MORE_OFFSET \
194                 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
195                 YY_DO_BEFORE_ACTION; /* set up gras_ddt_parse_text again */ \
196                 } \
197         while ( 0 )
198
199 #define unput(c) yyunput( c, (yytext_ptr)  )
200
201 #ifndef YY_TYPEDEF_YY_SIZE_T
202 #define YY_TYPEDEF_YY_SIZE_T
203 typedef size_t yy_size_t;
204 #endif
205
206 #ifndef YY_STRUCT_YY_BUFFER_STATE
207 #define YY_STRUCT_YY_BUFFER_STATE
208 struct yy_buffer_state {
209   FILE *yy_input_file;
210
211   char *yy_ch_buf;              /* input buffer */
212   char *yy_buf_pos;             /* current position in input buffer */
213
214   /* Size of input buffer in bytes, not including room for EOB
215    * characters.
216    */
217   yy_size_t yy_buf_size;
218
219   /* Number of characters read into yy_ch_buf, not including EOB
220    * characters.
221    */
222   int yy_n_chars;
223
224   /* Whether we "own" the buffer - i.e., we know we created it,
225    * and can realloc() it to grow it, and should free() it to
226    * delete it.
227    */
228   int yy_is_our_buffer;
229
230   /* Whether this is an "interactive" input source; if so, and
231    * if we're using stdio for input, then we want to use getc()
232    * instead of fread(), to make sure we stop fetching input after
233    * each newline.
234    */
235   int yy_is_interactive;
236
237   /* Whether we're considered to be at the beginning of a line.
238    * If so, '^' rules will be active on the next match, otherwise
239    * not.
240    */
241   int yy_at_bol;
242
243   int yy_bs_lineno;   /**< The line count. */
244   int yy_bs_column;   /**< The column count. */
245
246   /* Whether to try to fill the input buffer when we reach the
247    * end of it.
248    */
249   int yy_fill_buffer;
250
251   int yy_buffer_status;
252
253 #define YY_BUFFER_NEW 0
254 #define YY_BUFFER_NORMAL 1
255   /* When an EOF's been seen but there's still some text to process
256    * then we mark the buffer as YY_EOF_PENDING, to indicate that we
257    * shouldn't try reading from the input source any more.  We might
258    * still have a bunch of tokens to match, though, because of
259    * possible backing-up.
260    *
261    * When we actually see the EOF, we change the status to "new"
262    * (via gras_ddt_parse_restart()), so that the user can continue scanning by
263    * just pointing gras_ddt_parse_in at a new input file.
264    */
265 #define YY_BUFFER_EOF_PENDING 2
266
267 };
268 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
269
270 /* Stack of input buffers. */
271 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
272 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
273 static YY_BUFFER_STATE *yy_buffer_stack = 0;  /**< Stack as an array. */
274
275 /* We provide macros for accessing buffer states in case in the
276  * future we want to put the buffer states in a more general
277  * "scanner state".
278  *
279  * Returns the top of the stack, or NULL.
280  */
281 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
282                           ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
283                           : NULL)
284
285 /* Same as previous macro, but useful when we know that the buffer stack is not
286  * NULL or when we need an lvalue. For internal use only.
287  */
288 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
289
290 /* yy_hold_char holds the character lost when gras_ddt_parse_text is formed. */
291 static char yy_hold_char;
292 static int yy_n_chars;          /* number of characters read into yy_ch_buf */
293 int gras_ddt_parse_leng;
294
295 /* Points to current character in buffer. */
296 static char *yy_c_buf_p = (char *) 0;
297 static int yy_init = 0;         /* whether we need to initialize */
298 static int yy_start = 0;        /* start state number */
299
300 /* Flag which is used to allow gras_ddt_parse_wrap()'s to do buffer switches
301  * instead of setting up a fresh gras_ddt_parse_in.  A bit of a hack ...
302  */
303 static int yy_did_buffer_switch_on_eof;
304
305 void gras_ddt_parse_restart(FILE * input_file);
306 void gras_ddt_parse__switch_to_buffer(YY_BUFFER_STATE new_buffer);
307 YY_BUFFER_STATE gras_ddt_parse__create_buffer(FILE * file, int size);
308 void gras_ddt_parse__delete_buffer(YY_BUFFER_STATE b);
309 void gras_ddt_parse__flush_buffer(YY_BUFFER_STATE b);
310 void gras_ddt_parse_push_buffer_state(YY_BUFFER_STATE new_buffer);
311 void gras_ddt_parse_pop_buffer_state(void);
312
313 static void gras_ddt_parse_ensure_buffer_stack(void);
314 static void gras_ddt_parse__load_buffer_state(void);
315 static void gras_ddt_parse__init_buffer(YY_BUFFER_STATE b, FILE * file);
316
317 #define YY_FLUSH_BUFFER gras_ddt_parse__flush_buffer(YY_CURRENT_BUFFER )
318
319 YY_BUFFER_STATE gras_ddt_parse__scan_buffer(char *base, yy_size_t size);
320 YY_BUFFER_STATE gras_ddt_parse__scan_string(yyconst char *yy_str);
321 YY_BUFFER_STATE gras_ddt_parse__scan_bytes(yyconst char *bytes, int len);
322
323 void *gras_ddt_parse_alloc(yy_size_t);
324 void *gras_ddt_parse_realloc(void *, yy_size_t);
325 void gras_ddt_parse_free(void *);
326
327 #define yy_new_buffer gras_ddt_parse__create_buffer
328
329 #define yy_set_interactive(is_interactive) \
330         { \
331         if ( ! YY_CURRENT_BUFFER ){ \
332         gras_ddt_parse_ensure_buffer_stack (); \
333                 YY_CURRENT_BUFFER_LVALUE =    \
334             gras_ddt_parse__create_buffer(gras_ddt_parse_in,YY_BUF_SIZE ); \
335         } \
336         YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
337         }
338
339 #define yy_set_bol(at_bol) \
340         { \
341         if ( ! YY_CURRENT_BUFFER ){\
342         gras_ddt_parse_ensure_buffer_stack (); \
343                 YY_CURRENT_BUFFER_LVALUE =    \
344             gras_ddt_parse__create_buffer(gras_ddt_parse_in,YY_BUF_SIZE ); \
345         } \
346         YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
347         }
348
349 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
350
351 /* Begin user sect3 */
352
353 #define gras_ddt_parse_wrap(n) 1
354 #define YY_SKIP_YYWRAP
355
356 typedef unsigned char YY_CHAR;
357
358 FILE *gras_ddt_parse_in = (FILE *) 0, *gras_ddt_parse_out = (FILE *) 0;
359
360 typedef int yy_state_type;
361
362 extern int gras_ddt_parse_lineno;
363
364 int gras_ddt_parse_lineno = 1;
365
366 extern char *gras_ddt_parse_text;
367 #define yytext_ptr gras_ddt_parse_text
368
369 static yy_state_type yy_get_previous_state(void);
370 static yy_state_type yy_try_NUL_trans(yy_state_type current_state);
371 static int yy_get_next_buffer(void);
372 static void yy_fatal_error(yyconst char msg[]);
373
374 /* Done after the current pattern has been matched and before the
375  * corresponding action - sets up gras_ddt_parse_text.
376  */
377 #define YY_DO_BEFORE_ACTION \
378         (yytext_ptr) = yy_bp; \
379         gras_ddt_parse_leng = (size_t) (yy_cp - yy_bp); \
380         (yy_hold_char) = *yy_cp; \
381         *yy_cp = '\0'; \
382         (yy_c_buf_p) = yy_cp;
383
384 #define YY_NUM_RULES 26
385 #define YY_END_OF_BUFFER 27
386 /* This struct is not used in this scanner,
387    but its presence is necessary. */
388 struct yy_trans_info {
389   flex_int32_t yy_verify;
390   flex_int32_t yy_nxt;
391 };
392 static yyconst flex_int16_t yy_accept[61] = { 0,
393   14, 14, 7, 7, 10, 10, 0, 0, 27, 25,
394   24, 19, 20, 21, 23, 14, 25, 22, 17, 18,
395   15, 16, 7, 7, 6, 7, 7, 10, 12, 11,
396   26, 26, 14, 0, 1, 7, 7, 7, 5, 7,
397   10, 11, 11, 13, 0, 0, 2, 1, 4, 0,
398   3, 0, 2, 0, 3, 0, 0, 8, 9, 0
399 };
400
401 static yyconst flex_int32_t yy_ec[256] = { 0,
402   1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
403   1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
404   1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
405   1, 2, 1, 1, 1, 1, 1, 1, 1, 4,
406   5, 6, 1, 7, 8, 8, 9, 10, 10, 10,
407   10, 10, 10, 10, 10, 10, 10, 1, 11, 1,
408   1, 1, 1, 1, 8, 8, 8, 8, 8, 8,
409   8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
410   8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
411   12, 1, 13, 14, 8, 1, 8, 8, 8, 8,
412
413   8, 8, 15, 8, 8, 8, 8, 8, 8, 8,
414   8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
415   8, 8, 16, 1, 17, 1, 1, 1, 1, 1,
416   1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
417   1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
418   1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
419   1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
420   1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
421   1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
422   1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
423
424   1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
425   1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
426   1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
427   1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
428   1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
429   1, 1, 1, 1, 1
430 };
431
432 static yyconst flex_int32_t yy_meta[18] = { 0,
433   1, 1, 2, 1, 1, 3, 1, 4, 1, 4,
434   1, 1, 1, 1, 4, 1, 1
435 };
436
437 static yyconst flex_int16_t yy_base[69] = { 0,
438   0, 0, 16, 30, 17, 18, 78, 77, 85, 88,
439   88, 88, 88, 88, 88, 0, 19, 88, 88, 88,
440   88, 88, 0, 24, 88, 75, 77, 0, 88, 21,
441   88, 76, 0, 22, 0, 0, 27, 75, 0, 71,
442   0, 29, 34, 88, 29, 65, 76, 0, 0, 63,
443   74, 60, 72, 56, 65, 51, 50, 88, 88, 88,
444   45, 49, 53, 55, 57, 61, 65, 69
445 };
446
447 static yyconst flex_int16_t yy_def[69] = { 0,
448   60, 1, 61, 61, 62, 62, 63, 63, 60, 60,
449   60, 60, 60, 60, 60, 64, 60, 60, 60, 60,
450   60, 60, 65, 65, 60, 65, 65, 66, 60, 67,
451   60, 60, 64, 60, 68, 65, 65, 65, 65, 65,
452   66, 67, 67, 60, 60, 60, 60, 68, 65, 60,
453   60, 60, 60, 60, 60, 60, 60, 60, 60, 0,
454   60, 60, 60, 60, 60, 60, 60, 60
455 };
456
457 static yyconst flex_int16_t yy_nxt[106] = { 0,
458   10, 10, 11, 12, 13, 14, 15, 16, 17, 16,
459   18, 19, 20, 10, 16, 21, 22, 24, 25, 29,
460   29, 26, 30, 30, 34, 37, 43, 35, 37, 44,
461   27, 24, 25, 46, 60, 26, 47, 60, 38, 43,
462   50, 38, 44, 51, 27, 23, 23, 23, 23, 28,
463   28, 28, 28, 31, 31, 31, 31, 36, 33, 36,
464   36, 41, 59, 58, 41, 42, 55, 42, 42, 48,
465   57, 48, 48, 53, 56, 55, 54, 53, 52, 49,
466   40, 45, 40, 39, 60, 32, 32, 9, 60, 60,
467   60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
468
469   60, 60, 60, 60, 60
470 };
471
472 static yyconst flex_int16_t yy_chk[106] = { 0,
473   1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
474   1, 1, 1, 1, 1, 1, 1, 3, 3, 5,
475   6, 3, 5, 6, 17, 24, 30, 17, 37, 30,
476   3, 4, 4, 34, 42, 4, 34, 42, 24, 43,
477   45, 37, 43, 45, 4, 61, 61, 61, 61, 62,
478   62, 62, 62, 63, 63, 63, 63, 65, 64, 65,
479   65, 66, 57, 56, 66, 67, 55, 67, 67, 68,
480   54, 68, 68, 53, 52, 51, 50, 47, 46, 40,
481   38, 32, 27, 26, 9, 8, 7, 60, 60, 60,
482   60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
483
484   60, 60, 60, 60, 60
485 };
486
487 static yy_state_type yy_last_accepting_state;
488 static char *yy_last_accepting_cpos;
489
490 extern int gras_ddt_parse__flex_debug;
491 int gras_ddt_parse__flex_debug = 0;
492
493 /* The intent behind this definition is that it'll catch
494  * any uses of REJECT which flex missed.
495  */
496 #define REJECT reject_used_but_not_detected
497 #define yymore() yymore_used_but_not_detected
498 #define YY_MORE_ADJ 0
499 #define YY_RESTORE_YY_MORE_OFFSET
500 char *gras_ddt_parse_text;
501 /* $Id$ */
502 /* DataDesc/ddt_parse -- automatic parsing of data structures */
503 /* Copyright (c) 2004 Arnaud Legrand, Martin Quinson. All rights reserved.  */
504 /* This program is free software; you can redistribute it and/or modify it
505  * under the terms of the license (GNU LGPL) which comes with this package. */
506 #include "gras/DataDesc/datadesc_private.h"
507 #include "gras/DataDesc/ddt_parse.yy.h"
508 #include <string.h>
509 YY_BUFFER_STATE gras_ddt_input_buffer;
510 FILE *gras_ddt_file_to_parse;
511
512 int gras_ddt_parse_line_pos = 1;
513 int gras_ddt_parse_col_pos = 0;
514 int gras_ddt_parse_char_pos = 0;
515 int gras_ddt_parse_tok_num = 0;
516 const char *definition;
517 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(gras_ddt_lexer, gras_ddt_parse,
518                                 "The crude internals of the lexer used for type parsing");
519 #define SHOW_WHERE DEBUG4("%d:%d (char #%d): seen '%s'", gras_ddt_parse_line_pos,gras_ddt_parse_col_pos,gras_ddt_parse_char_pos,gras_ddt_parse_text)
520
521 #define INITIAL 0
522 #define annotate 1
523 #define comment 2
524 #define foo 3
525
526 #ifndef YY_NO_UNISTD_H
527 /* Special case for "unistd.h", since it is non-ANSI. We include it way
528  * down here because we want the user's section 1 to have been scanned first.
529  * The user has a chance to override it with an option.
530  */
531 #include <unistd.h>
532 #endif
533
534 #ifndef YY_EXTRA_TYPE
535 #define YY_EXTRA_TYPE void *
536 #endif
537
538 static int yy_init_globals(void);
539
540 /* Accessor methods to globals.
541    These are made visible to non-reentrant scanners for convenience. */
542
543 int gras_ddt_parse_lex_destroy(void);
544
545 int gras_ddt_parse_get_debug(void);
546
547 void gras_ddt_parse_set_debug(int debug_flag);
548
549 YY_EXTRA_TYPE gras_ddt_parse_get_extra(void);
550
551 void gras_ddt_parse_set_extra(YY_EXTRA_TYPE user_defined);
552
553 FILE *gras_ddt_parse_get_in(void);
554
555 void gras_ddt_parse_set_in(FILE * in_str);
556
557 FILE *gras_ddt_parse_get_out(void);
558
559 void gras_ddt_parse_set_out(FILE * out_str);
560
561 int gras_ddt_parse_get_leng(void);
562
563 char *gras_ddt_parse_get_text(void);
564
565 int gras_ddt_parse_get_lineno(void);
566
567 void gras_ddt_parse_set_lineno(int line_number);
568
569 /* Macros after this point can all be overridden by user definitions in
570  * section 1.
571  */
572
573 #ifndef YY_SKIP_YYWRAP
574 #ifdef __cplusplus
575 extern "C" int gras_ddt_parse_wrap(void);
576 #else
577 extern int gras_ddt_parse_wrap(void);
578 #endif
579 #endif
580
581 static void yyunput(int c, char *buf_ptr);
582
583 #ifndef yytext_ptr
584 static void yy_flex_strncpy(char *, yyconst char *, int);
585 #endif
586
587 #ifdef YY_NEED_STRLEN
588 static int yy_flex_strlen(yyconst char *);
589 #endif
590
591 #ifndef YY_NO_INPUT
592
593 #ifdef __cplusplus
594 static int yyinput(void);
595 #else
596 static int input(void);
597 #endif
598
599 #endif
600
601 /* Amount of stuff to slurp up with each read. */
602 #ifndef YY_READ_BUF_SIZE
603 #define YY_READ_BUF_SIZE 8192
604 #endif
605
606 /* Copy whatever the last rule matched to the standard output. */
607 #ifndef ECHO
608 /* This used to be an fputs(), but since the string might contain NUL's,
609  * we now use fwrite().
610  */
611 #define ECHO do { if (fwrite( gras_ddt_parse_text, gras_ddt_parse_leng, 1, gras_ddt_parse_out )) {} } while (0)
612 #endif
613
614 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
615  * is returned in "result".
616  */
617 #ifndef YY_INPUT
618 #define YY_INPUT(buf,result,max_size) \
619         if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
620                 { \
621                 int c = '*'; \
622                 size_t n; \
623                 for ( n = 0; n < max_size && \
624                              (c = getc( gras_ddt_parse_in )) != EOF && c != '\n'; ++n ) \
625                         buf[n] = (char) c; \
626                 if ( c == '\n' ) \
627                         buf[n++] = (char) c; \
628                 if ( c == EOF && ferror( gras_ddt_parse_in ) ) \
629                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
630                 result = n; \
631                 } \
632         else \
633                 { \
634                 errno=0; \
635                 while ( (result = fread(buf, 1, max_size, gras_ddt_parse_in))==0 && ferror(gras_ddt_parse_in)) \
636                         { \
637                         if( errno != EINTR) \
638                                 { \
639                                 YY_FATAL_ERROR( "input in flex scanner failed" ); \
640                                 break; \
641                                 } \
642                         errno=0; \
643                         clearerr(gras_ddt_parse_in); \
644                         } \
645                 }\
646 \
647
648 #endif
649
650 /* No semi-colon after return; correct usage is to write "yyterminate();" -
651  * we don't want an extra ';' after the "return" because that will cause
652  * some compilers to complain about unreachable statements.
653  */
654 #ifndef yyterminate
655 #define yyterminate() return YY_NULL
656 #endif
657
658 /* Number of entries by which start-condition stack grows. */
659 #ifndef YY_START_STACK_INCR
660 #define YY_START_STACK_INCR 25
661 #endif
662
663 /* Report a fatal error. */
664 #ifndef YY_FATAL_ERROR
665 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
666 #endif
667
668 /* end tables serialization structures and prototypes */
669
670 /* Default declaration of generated scanner - a define so the user can
671  * easily add parameters.
672  */
673 #ifndef YY_DECL
674 #define YY_DECL_IS_OURS 1
675
676 extern int gras_ddt_parse_lex(void);
677
678 #define YY_DECL int gras_ddt_parse_lex (void)
679 #endif /* !YY_DECL */
680
681 /* Code executed at the beginning of each rule, after gras_ddt_parse_text and gras_ddt_parse_leng
682  * have been set up.
683  */
684 #ifndef YY_USER_ACTION
685 #define YY_USER_ACTION
686 #endif
687
688 /* Code executed at the end of each rule. */
689 #ifndef YY_BREAK
690 #define YY_BREAK break;
691 #endif
692
693 #define YY_RULE_SETUP \
694         YY_USER_ACTION
695
696 /** The main scanner function which does all the work.
697  */
698 YY_DECL {
699   register yy_state_type yy_current_state;
700   register char *yy_cp, *yy_bp;
701   register int yy_act;
702
703   int comment_caller = 0;
704   int annotate_caller = 0;
705
706   if (!(yy_init)) {
707     (yy_init) = 1;
708
709 #ifdef YY_USER_INIT
710     YY_USER_INIT;
711 #endif
712
713     if (!(yy_start))
714       (yy_start) = 1;           /* first start state */
715
716     if (!gras_ddt_parse_in)
717       gras_ddt_parse_in = stdin;
718
719     if (!gras_ddt_parse_out)
720       gras_ddt_parse_out = stdout;
721
722     if (!YY_CURRENT_BUFFER) {
723       gras_ddt_parse_ensure_buffer_stack();
724       YY_CURRENT_BUFFER_LVALUE =
725         gras_ddt_parse__create_buffer(gras_ddt_parse_in, YY_BUF_SIZE);
726     }
727
728     gras_ddt_parse__load_buffer_state();
729   }
730
731   while (1) {                   /* loops until end-of-file is reached */
732     yy_cp = (yy_c_buf_p);
733
734     /* Support of gras_ddt_parse_text. */
735     *yy_cp = (yy_hold_char);
736
737     /* yy_bp points to the position in yy_ch_buf of the start of
738      * the current run.
739      */
740     yy_bp = yy_cp;
741
742     yy_current_state = (yy_start);
743   yy_match:
744     do {
745       register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
746       if (yy_accept[yy_current_state]) {
747         (yy_last_accepting_state) = yy_current_state;
748         (yy_last_accepting_cpos) = yy_cp;
749       }
750       while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) {
751         yy_current_state = (int) yy_def[yy_current_state];
752         if (yy_current_state >= 61)
753           yy_c = yy_meta[(unsigned int) yy_c];
754       }
755       yy_current_state =
756         yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
757       ++yy_cp;
758     }
759     while (yy_base[yy_current_state] != 88);
760
761   yy_find_action:
762     yy_act = yy_accept[yy_current_state];
763     if (yy_act == 0) {          /* have to back up */
764       yy_cp = (yy_last_accepting_cpos);
765       yy_current_state = (yy_last_accepting_state);
766       yy_act = yy_accept[yy_current_state];
767     }
768
769     YY_DO_BEFORE_ACTION;
770
771   do_action:                   /* This label is used only to access EOF actions. */
772
773     switch (yy_act) {           /* beginning of action switch */
774     case 0:                    /* must back up */
775       /* undo the effects of YY_DO_BEFORE_ACTION */
776       *yy_cp = (yy_hold_char);
777       yy_cp = (yy_last_accepting_cpos);
778       yy_current_state = (yy_last_accepting_state);
779       goto yy_find_action;
780
781     case 1:
782     YY_RULE_SETUP YY_BREAK case 2:
783       YY_RULE_SETUP {
784   /****************** ANNOTATION ************************/
785         DEBUG0("Begin annotation");
786         annotate_caller = INITIAL;
787         gras_ddt_parse_char_pos += strlen(gras_ddt_parse_text);
788         gras_ddt_parse_col_pos += strlen(gras_ddt_parse_text);
789         BEGIN(annotate);
790       }
791       YY_BREAK case 3:YY_RULE_SETUP {   /* trim annotation */
792         DEBUG0("Begin annotation");
793         annotate_caller = foo;
794         gras_ddt_parse_char_pos += strlen(gras_ddt_parse_text);
795         gras_ddt_parse_col_pos += strlen(gras_ddt_parse_text);
796         BEGIN(annotate);
797       } YY_BREAK case 4:YY_RULE_SETUP {
798         DEBUG0("End annotation");
799         gras_ddt_parse_char_pos += strlen(gras_ddt_parse_text);
800         gras_ddt_parse_col_pos += strlen(gras_ddt_parse_text);
801         BEGIN(annotate_caller);
802       } YY_BREAK case 5:YY_RULE_SETUP {
803         PARSE_ERROR0("``/*g'' construct closed by a regular ``*/''");
804       } YY_BREAK case 6:
805 /* rule 6 can match eol */
806         YY_RULE_SETUP {
807         PARSE_ERROR0("Type annotation cannot spread over several lines");
808       } YY_BREAK case 7:YY_RULE_SETUP { /* eat the rest */
809         gras_ddt_parse_char_pos += strlen(gras_ddt_parse_text);
810         gras_ddt_parse_col_pos += strlen(gras_ddt_parse_text);
811         return GRAS_DDT_PARSE_TOKEN_ANNOTATE;
812       } YY_BREAK case 8:YY_RULE_SETUP {
813   /****************** COMMENTS ************************/
814         /* constructs like : */
815         /*g [string] g */
816         /* are not comments but size annotations */
817         comment_caller = INITIAL;
818         BEGIN(comment);
819       } YY_BREAK case 9:YY_RULE_SETUP {
820         comment_caller = foo;
821         BEGIN(comment);
822       } YY_BREAK case 10:YY_RULE_SETUP {        /* eat anything that's not a '*' */
823       } YY_BREAK case 11:YY_RULE_SETUP {        /* eat up '*'s not followed by '/'s */
824       } YY_BREAK case 12:
825 /* rule 12 can match eol */
826         YY_RULE_SETUP {
827         ++gras_ddt_parse_line_pos;
828         gras_ddt_parse_col_pos = 0;
829         gras_ddt_parse_char_pos++;
830       } YY_BREAK case 13:YY_RULE_SETUP {
831         gras_ddt_parse_char_pos += strlen(gras_ddt_parse_text);
832         gras_ddt_parse_col_pos += strlen(gras_ddt_parse_text);
833         BEGIN(comment_caller);
834       } YY_BREAK case 14:YY_RULE_SETUP {
835    /****************** STATEMENTS ************************/
836         gras_ddt_parse_char_pos += strlen(gras_ddt_parse_text);
837         gras_ddt_parse_col_pos += strlen(gras_ddt_parse_text);
838         SHOW_WHERE;
839         return (GRAS_DDT_PARSE_TOKEN_WORD);
840       } YY_BREAK case 15:YY_RULE_SETUP {
841         gras_ddt_parse_char_pos++;
842         gras_ddt_parse_col_pos++;
843         SHOW_WHERE;
844         return (GRAS_DDT_PARSE_TOKEN_LA);
845       } YY_BREAK case 16:YY_RULE_SETUP {
846         gras_ddt_parse_char_pos++;
847         gras_ddt_parse_col_pos++;
848         SHOW_WHERE;
849         return (GRAS_DDT_PARSE_TOKEN_RA);
850       } YY_BREAK case 17:YY_RULE_SETUP {
851         gras_ddt_parse_char_pos++;
852         gras_ddt_parse_col_pos++;
853         SHOW_WHERE;
854         return (GRAS_DDT_PARSE_TOKEN_LB);
855       } YY_BREAK case 18:YY_RULE_SETUP {
856         gras_ddt_parse_char_pos++;
857         gras_ddt_parse_col_pos++;
858         SHOW_WHERE;
859         return (GRAS_DDT_PARSE_TOKEN_RB);
860       } YY_BREAK case 19:YY_RULE_SETUP {
861         gras_ddt_parse_char_pos++;
862         gras_ddt_parse_col_pos++;
863         SHOW_WHERE;
864         return (GRAS_DDT_PARSE_TOKEN_LP);
865       } YY_BREAK case 20:YY_RULE_SETUP {
866         gras_ddt_parse_char_pos++;
867         gras_ddt_parse_col_pos++;
868         SHOW_WHERE;
869         return (GRAS_DDT_PARSE_TOKEN_RP);
870       } YY_BREAK case 21:YY_RULE_SETUP {
871         gras_ddt_parse_char_pos++;
872         gras_ddt_parse_col_pos++;
873         SHOW_WHERE;
874         return (GRAS_DDT_PARSE_TOKEN_STAR);
875       } YY_BREAK case 22:YY_RULE_SETUP {
876         gras_ddt_parse_char_pos++;
877         gras_ddt_parse_col_pos++;
878         SHOW_WHERE;
879         return (GRAS_DDT_PARSE_TOKEN_SEMI_COLON);
880       } YY_BREAK case 23:YY_RULE_SETUP {
881         gras_ddt_parse_char_pos++;
882         gras_ddt_parse_col_pos++;
883         SHOW_WHERE;
884         return (GRAS_DDT_PARSE_TOKEN_COLON);
885       } YY_BREAK case 24:
886 /* rule 24 can match eol */
887         YY_RULE_SETUP {
888         gras_ddt_parse_line_pos++;
889         gras_ddt_parse_char_pos++;
890         gras_ddt_parse_col_pos = 0;
891         SHOW_WHERE;
892       } YY_BREAK case 25:YY_RULE_SETUP {
893         gras_ddt_parse_char_pos++;
894         gras_ddt_parse_col_pos++;
895         SHOW_WHERE;
896       } YY_BREAK case 26:YY_RULE_SETUP ECHO;
897       YY_BREAK case YY_STATE_EOF(INITIAL):case YY_STATE_EOF(annotate):case
898         YY_STATE_EOF(comment):case YY_STATE_EOF(foo):yyterminate();
899
900     case YY_END_OF_BUFFER:
901       {
902         /* Amount of text matched not including the EOB char. */
903         int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
904
905         /* Undo the effects of YY_DO_BEFORE_ACTION. */
906         *yy_cp = (yy_hold_char);
907         YY_RESTORE_YY_MORE_OFFSET
908           if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW) {
909           /* We're scanning a new file or input source.  It's
910            * possible that this happened because the user
911            * just pointed gras_ddt_parse_in at a new source and called
912            * gras_ddt_parse_lex().  If so, then we have to assure
913            * consistency between YY_CURRENT_BUFFER and our
914            * globals.  Here is the right place to do so, because
915            * this is the first action (other than possibly a
916            * back-up) that will match for the new input source.
917            */
918           (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
919           YY_CURRENT_BUFFER_LVALUE->yy_input_file = gras_ddt_parse_in;
920           YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
921         }
922
923         /* Note that here we test for yy_c_buf_p "<=" to the position
924          * of the first EOB in the buffer, since yy_c_buf_p will
925          * already have been incremented past the NUL character
926          * (since all states make transitions on EOB to the
927          * end-of-buffer state).  Contrast this with the test
928          * in input().
929          */
930         if ((yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]) {       /* This was really a NUL. */
931           yy_state_type yy_next_state;
932
933           (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
934
935           yy_current_state = yy_get_previous_state();
936
937           /* Okay, we're now positioned to make the NUL
938            * transition.  We couldn't have
939            * yy_get_previous_state() go ahead and do it
940            * for us because it doesn't know how to deal
941            * with the possibility of jamming (and we don't
942            * want to build jamming into it because then it
943            * will run more slowly).
944            */
945
946           yy_next_state = yy_try_NUL_trans(yy_current_state);
947
948           yy_bp = (yytext_ptr) + YY_MORE_ADJ;
949
950           if (yy_next_state) {
951             /* Consume the NUL. */
952             yy_cp = ++(yy_c_buf_p);
953             yy_current_state = yy_next_state;
954             goto yy_match;
955           }
956
957           else {
958             yy_cp = (yy_c_buf_p);
959             goto yy_find_action;
960           }
961         }
962
963         else
964           switch (yy_get_next_buffer()) {
965           case EOB_ACT_END_OF_FILE:
966             {
967               (yy_did_buffer_switch_on_eof) = 0;
968
969               if (gras_ddt_parse_wrap()) {
970                 /* Note: because we've taken care in
971                  * yy_get_next_buffer() to have set up
972                  * gras_ddt_parse_text, we can now set up
973                  * yy_c_buf_p so that if some total
974                  * hoser (like flex itself) wants to
975                  * call the scanner after we return the
976                  * YY_NULL, it'll still work - another
977                  * YY_NULL will get returned.
978                  */
979                 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
980
981                 yy_act = YY_STATE_EOF(YY_START);
982                 goto do_action;
983               }
984
985               else {
986                 if (!(yy_did_buffer_switch_on_eof))
987                   YY_NEW_FILE;
988               }
989               break;
990             }
991
992           case EOB_ACT_CONTINUE_SCAN:
993             (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
994
995             yy_current_state = yy_get_previous_state();
996
997             yy_cp = (yy_c_buf_p);
998             yy_bp = (yytext_ptr) + YY_MORE_ADJ;
999             goto yy_match;
1000
1001           case EOB_ACT_LAST_MATCH:
1002             (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1003
1004             yy_current_state = yy_get_previous_state();
1005
1006             yy_cp = (yy_c_buf_p);
1007             yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1008             goto yy_find_action;
1009           }
1010         break;
1011       }
1012
1013     default:
1014       YY_FATAL_ERROR("fatal flex scanner internal error--no action found");
1015     }                           /* end of action switch */
1016   }                             /* end of scanning one token */
1017 }                               /* end of gras_ddt_parse_lex */
1018
1019 /* yy_get_next_buffer - try to read in a new buffer
1020  *
1021  * Returns a code representing an action:
1022  *      EOB_ACT_LAST_MATCH -
1023  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1024  *      EOB_ACT_END_OF_FILE - end of file
1025  */
1026 static int yy_get_next_buffer(void)
1027 {
1028   register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1029   register char *source = (yytext_ptr);
1030   register int number_to_move, i;
1031   int ret_val;
1032
1033   if ((yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1])
1034     YY_FATAL_ERROR("fatal flex scanner internal error--end of buffer missed");
1035
1036   if (YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0) {  /* Don't try to fill the buffer, so this is an EOF. */
1037     if ((yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1) {
1038       /* We matched a single character, the EOB, so
1039        * treat this as a final EOF.
1040        */
1041       return EOB_ACT_END_OF_FILE;
1042     }
1043
1044     else {
1045       /* We matched some text prior to the EOB, first
1046        * process it.
1047        */
1048       return EOB_ACT_LAST_MATCH;
1049     }
1050   }
1051
1052   /* Try to read more data. */
1053
1054   /* First move last chars to start of buffer. */
1055   number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1056
1057   for (i = 0; i < number_to_move; ++i)
1058     *(dest++) = *(source++);
1059
1060   if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING)
1061     /* don't do the read, it's not guaranteed to return an EOF,
1062      * just force an EOF
1063      */
1064     YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1065
1066   else {
1067     int num_to_read =
1068       YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1069
1070     while (num_to_read <= 0) {  /* Not enough room in the buffer - grow it. */
1071
1072       /* just a shorter name for the current buffer */
1073       YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1074
1075       int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf);
1076
1077       if (b->yy_is_our_buffer) {
1078         int new_size = b->yy_buf_size * 2;
1079
1080         if (new_size <= 0)
1081           b->yy_buf_size += b->yy_buf_size / 8;
1082         else
1083           b->yy_buf_size *= 2;
1084
1085         b->yy_ch_buf = (char *)
1086           /* Include room in for 2 EOB chars. */
1087           gras_ddt_parse_realloc((void *) b->yy_ch_buf, b->yy_buf_size + 2);
1088       } else
1089         /* Can't grow it, we don't own it. */
1090         b->yy_ch_buf = 0;
1091
1092       if (!b->yy_ch_buf)
1093         YY_FATAL_ERROR("fatal error - scanner input buffer overflow");
1094
1095       (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1096
1097       num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1098         number_to_move - 1;
1099
1100     }
1101
1102     if (num_to_read > YY_READ_BUF_SIZE)
1103       num_to_read = YY_READ_BUF_SIZE;
1104
1105     /* Read in more data. */
1106     YY_INPUT((&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1107              (yy_n_chars), (size_t) num_to_read);
1108
1109     YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1110   }
1111
1112   if ((yy_n_chars) == 0) {
1113     if (number_to_move == YY_MORE_ADJ) {
1114       ret_val = EOB_ACT_END_OF_FILE;
1115       gras_ddt_parse_restart(gras_ddt_parse_in);
1116     }
1117
1118     else {
1119       ret_val = EOB_ACT_LAST_MATCH;
1120       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING;
1121     }
1122   }
1123
1124   else
1125     ret_val = EOB_ACT_CONTINUE_SCAN;
1126
1127   if ((yy_size_t) ((yy_n_chars) + number_to_move) >
1128       YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1129     /* Extend the array by 50%, plus the number we really need. */
1130     yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1131     YY_CURRENT_BUFFER_LVALUE->yy_ch_buf =
1132       (char *) gras_ddt_parse_realloc((void *)
1133                                       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,
1134                                       new_size);
1135     if (!YY_CURRENT_BUFFER_LVALUE->yy_ch_buf)
1136       YY_FATAL_ERROR("out of dynamic memory in yy_get_next_buffer()");
1137   }
1138
1139   (yy_n_chars) += number_to_move;
1140   YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1141   YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] =
1142     YY_END_OF_BUFFER_CHAR;
1143
1144   (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1145
1146   return ret_val;
1147 }
1148
1149 /* yy_get_previous_state - get the state just before the EOB char was reached */
1150
1151 static yy_state_type yy_get_previous_state(void)
1152 {
1153   register yy_state_type yy_current_state;
1154   register char *yy_cp;
1155
1156   yy_current_state = (yy_start);
1157
1158   for (yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp) {
1159     register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1160     if (yy_accept[yy_current_state]) {
1161       (yy_last_accepting_state) = yy_current_state;
1162       (yy_last_accepting_cpos) = yy_cp;
1163     }
1164     while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) {
1165       yy_current_state = (int) yy_def[yy_current_state];
1166       if (yy_current_state >= 61)
1167         yy_c = yy_meta[(unsigned int) yy_c];
1168     }
1169     yy_current_state =
1170       yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1171   }
1172
1173   return yy_current_state;
1174 }
1175
1176 /* yy_try_NUL_trans - try to make a transition on the NUL character
1177  *
1178  * synopsis
1179  *      next_state = yy_try_NUL_trans( current_state );
1180  */
1181 static yy_state_type yy_try_NUL_trans(yy_state_type yy_current_state)
1182 {
1183   register int yy_is_jam;
1184   register char *yy_cp = (yy_c_buf_p);
1185
1186   register YY_CHAR yy_c = 1;
1187   if (yy_accept[yy_current_state]) {
1188     (yy_last_accepting_state) = yy_current_state;
1189     (yy_last_accepting_cpos) = yy_cp;
1190   }
1191   while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) {
1192     yy_current_state = (int) yy_def[yy_current_state];
1193     if (yy_current_state >= 61)
1194       yy_c = yy_meta[(unsigned int) yy_c];
1195   }
1196   yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1197   yy_is_jam = (yy_current_state == 60);
1198
1199   return yy_is_jam ? 0 : yy_current_state;
1200 }
1201
1202 static void yyunput(int c, register char *yy_bp)
1203 {
1204   register char *yy_cp;
1205
1206   yy_cp = (yy_c_buf_p);
1207
1208   /* undo effects of setting up gras_ddt_parse_text */
1209   *yy_cp = (yy_hold_char);
1210
1211   if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2) {        /* need to shift things up to make room */
1212     /* +2 for EOB chars. */
1213     register int number_to_move = (yy_n_chars) + 2;
1214     register char *dest =
1215       &YY_CURRENT_BUFFER_LVALUE->
1216       yy_ch_buf[YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1217     register char *source =
1218       &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1219
1220     while (source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf)
1221       *--dest = *--source;
1222
1223     yy_cp += (int) (dest - source);
1224     yy_bp += (int) (dest - source);
1225     YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1226       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1227
1228     if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2)
1229       YY_FATAL_ERROR("flex scanner push-back overflow");
1230   }
1231
1232   *--yy_cp = (char) c;
1233
1234   (yytext_ptr) = yy_bp;
1235   (yy_hold_char) = *yy_cp;
1236   (yy_c_buf_p) = yy_cp;
1237 }
1238
1239 #ifndef YY_NO_INPUT
1240 #ifdef __cplusplus
1241 static int yyinput(void)
1242 #else
1243 static int input(void)
1244 #endif
1245 {
1246   int c;
1247
1248   *(yy_c_buf_p) = (yy_hold_char);
1249
1250   if (*(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR) {
1251     /* yy_c_buf_p now points to the character we want to return.
1252      * If this occurs *before* the EOB characters, then it's a
1253      * valid NUL; if not, then we've hit the end of the buffer.
1254      */
1255     if ((yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)])
1256       /* This was really a NUL. */
1257       *(yy_c_buf_p) = '\0';
1258
1259     else {                      /* need more input */
1260       int offset = (yy_c_buf_p) - (yytext_ptr);
1261       ++(yy_c_buf_p);
1262
1263       switch (yy_get_next_buffer()) {
1264       case EOB_ACT_LAST_MATCH:
1265         /* This happens because yy_g_n_b()
1266          * sees that we've accumulated a
1267          * token and flags that we need to
1268          * try matching the token before
1269          * proceeding.  But for input(),
1270          * there's no matching to consider.
1271          * So convert the EOB_ACT_LAST_MATCH
1272          * to EOB_ACT_END_OF_FILE.
1273          */
1274
1275         /* Reset buffer status. */
1276         gras_ddt_parse_restart(gras_ddt_parse_in);
1277
1278        /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE:
1279         {
1280           if (gras_ddt_parse_wrap())
1281             return EOF;
1282
1283           if (!(yy_did_buffer_switch_on_eof))
1284             YY_NEW_FILE;
1285 #ifdef __cplusplus
1286           return yyinput();
1287 #else
1288           return input();
1289 #endif
1290         }
1291
1292       case EOB_ACT_CONTINUE_SCAN:
1293         (yy_c_buf_p) = (yytext_ptr) + offset;
1294         break;
1295       }
1296     }
1297   }
1298
1299   c = *(unsigned char *) (yy_c_buf_p);  /* cast for 8-bit char's */
1300   *(yy_c_buf_p) = '\0';         /* preserve gras_ddt_parse_text */
1301   (yy_hold_char) = *++(yy_c_buf_p);
1302
1303   return c;
1304 }
1305 #endif /* ifndef YY_NO_INPUT */
1306
1307 /** Immediately switch to a different input stream.
1308  * @param input_file A readable stream.
1309  * 
1310  * @note This function does not reset the start condition to @c INITIAL .
1311  */
1312 void gras_ddt_parse_restart(FILE * input_file)
1313 {
1314
1315   if (!YY_CURRENT_BUFFER) {
1316     gras_ddt_parse_ensure_buffer_stack();
1317     YY_CURRENT_BUFFER_LVALUE =
1318       gras_ddt_parse__create_buffer(gras_ddt_parse_in, YY_BUF_SIZE);
1319   }
1320
1321   gras_ddt_parse__init_buffer(YY_CURRENT_BUFFER, input_file);
1322   gras_ddt_parse__load_buffer_state();
1323 }
1324
1325 /** Switch to a different input buffer.
1326  * @param new_buffer The new input buffer.
1327  * 
1328  */
1329 void gras_ddt_parse__switch_to_buffer(YY_BUFFER_STATE new_buffer)
1330 {
1331
1332   /* TODO. We should be able to replace this entire function body
1333    * with
1334    *              gras_ddt_parse_pop_buffer_state();
1335    *              gras_ddt_parse_push_buffer_state(new_buffer);
1336    */
1337   gras_ddt_parse_ensure_buffer_stack();
1338   if (YY_CURRENT_BUFFER == new_buffer)
1339     return;
1340
1341   if (YY_CURRENT_BUFFER) {
1342     /* Flush out information for old buffer. */
1343     *(yy_c_buf_p) = (yy_hold_char);
1344     YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1345     YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1346   }
1347
1348   YY_CURRENT_BUFFER_LVALUE = new_buffer;
1349   gras_ddt_parse__load_buffer_state();
1350
1351   /* We don't actually know whether we did this switch during
1352    * EOF (gras_ddt_parse_wrap()) processing, but the only time this flag
1353    * is looked at is after gras_ddt_parse_wrap() is called, so it's safe
1354    * to go ahead and always set it.
1355    */
1356   (yy_did_buffer_switch_on_eof) = 1;
1357 }
1358
1359 static void gras_ddt_parse__load_buffer_state(void)
1360 {
1361   (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1362   (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1363   gras_ddt_parse_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1364   (yy_hold_char) = *(yy_c_buf_p);
1365 }
1366
1367 /** Allocate and initialize an input buffer state.
1368  * @param file A readable stream.
1369  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1370  * 
1371  * @return the allocated buffer state.
1372  */
1373 YY_BUFFER_STATE gras_ddt_parse__create_buffer(FILE * file, int size)
1374 {
1375   YY_BUFFER_STATE b;
1376
1377   b = (YY_BUFFER_STATE) gras_ddt_parse_alloc(sizeof(struct yy_buffer_state));
1378   if (!b)
1379     YY_FATAL_ERROR
1380       ("out of dynamic memory in gras_ddt_parse__create_buffer()");
1381
1382   b->yy_buf_size = size;
1383
1384   /* yy_ch_buf has to be 2 characters longer than the size given because
1385    * we need to put in 2 end-of-buffer characters.
1386    */
1387   b->yy_ch_buf = (char *) gras_ddt_parse_alloc(b->yy_buf_size + 2);
1388   if (!b->yy_ch_buf)
1389     YY_FATAL_ERROR
1390       ("out of dynamic memory in gras_ddt_parse__create_buffer()");
1391
1392   b->yy_is_our_buffer = 1;
1393
1394   gras_ddt_parse__init_buffer(b, file);
1395
1396   return b;
1397 }
1398
1399 /** Destroy the buffer.
1400  * @param b a buffer created with gras_ddt_parse__create_buffer()
1401  * 
1402  */
1403 void gras_ddt_parse__delete_buffer(YY_BUFFER_STATE b)
1404 {
1405
1406   if (!b)
1407     return;
1408
1409   if (b == YY_CURRENT_BUFFER)   /* Not sure if we should pop here. */
1410     YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1411
1412   if (b->yy_is_our_buffer)
1413     gras_ddt_parse_free((void *) b->yy_ch_buf);
1414
1415   gras_ddt_parse_free((void *) b);
1416 }
1417
1418 #if !defined(__cplusplus) && !defined(WIN32)
1419 extern int isatty(int);
1420 #endif /* __cplusplus */
1421
1422 /* Initializes or reinitializes a buffer.
1423  * This function is sometimes called more than once on the same buffer,
1424  * such as during a gras_ddt_parse_restart() or at EOF.
1425  */
1426 static void gras_ddt_parse__init_buffer(YY_BUFFER_STATE b, FILE * file)
1427 {
1428   int oerrno = errno;
1429
1430   gras_ddt_parse__flush_buffer(b);
1431
1432   b->yy_input_file = file;
1433   b->yy_fill_buffer = 1;
1434
1435   /* If b is the current buffer, then gras_ddt_parse__init_buffer was _probably_
1436    * called from gras_ddt_parse_restart() or through yy_get_next_buffer.
1437    * In that case, we don't want to reset the lineno or column.
1438    */
1439   if (b != YY_CURRENT_BUFFER) {
1440     b->yy_bs_lineno = 1;
1441     b->yy_bs_column = 0;
1442   }
1443
1444   b->yy_is_interactive = file ? (isatty(fileno(file)) > 0) : 0;
1445
1446   errno = oerrno;
1447 }
1448
1449 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1450  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1451  * 
1452  */
1453 void gras_ddt_parse__flush_buffer(YY_BUFFER_STATE b)
1454 {
1455   if (!b)
1456     return;
1457
1458   b->yy_n_chars = 0;
1459
1460   /* We always need two end-of-buffer characters.  The first causes
1461    * a transition to the end-of-buffer state.  The second causes
1462    * a jam in that state.
1463    */
1464   b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1465   b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1466
1467   b->yy_buf_pos = &b->yy_ch_buf[0];
1468
1469   b->yy_at_bol = 1;
1470   b->yy_buffer_status = YY_BUFFER_NEW;
1471
1472   if (b == YY_CURRENT_BUFFER)
1473     gras_ddt_parse__load_buffer_state();
1474 }
1475
1476 /** Pushes the new state onto the stack. The new state becomes
1477  *  the current state. This function will allocate the stack
1478  *  if necessary.
1479  *  @param new_buffer The new state.
1480  *  
1481  */
1482 void gras_ddt_parse_push_buffer_state(YY_BUFFER_STATE new_buffer)
1483 {
1484   if (new_buffer == NULL)
1485     return;
1486
1487   gras_ddt_parse_ensure_buffer_stack();
1488
1489   /* This block is copied from gras_ddt_parse__switch_to_buffer. */
1490   if (YY_CURRENT_BUFFER) {
1491     /* Flush out information for old buffer. */
1492     *(yy_c_buf_p) = (yy_hold_char);
1493     YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1494     YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1495   }
1496
1497   /* Only push if top exists. Otherwise, replace top. */
1498   if (YY_CURRENT_BUFFER)
1499     (yy_buffer_stack_top)++;
1500   YY_CURRENT_BUFFER_LVALUE = new_buffer;
1501
1502   /* copied from gras_ddt_parse__switch_to_buffer. */
1503   gras_ddt_parse__load_buffer_state();
1504   (yy_did_buffer_switch_on_eof) = 1;
1505 }
1506
1507 /** Removes and deletes the top of the stack, if present.
1508  *  The next element becomes the new top.
1509  *  
1510  */
1511 void gras_ddt_parse_pop_buffer_state(void)
1512 {
1513   if (!YY_CURRENT_BUFFER)
1514     return;
1515
1516   gras_ddt_parse__delete_buffer(YY_CURRENT_BUFFER);
1517   YY_CURRENT_BUFFER_LVALUE = NULL;
1518   if ((yy_buffer_stack_top) > 0)
1519     --(yy_buffer_stack_top);
1520
1521   if (YY_CURRENT_BUFFER) {
1522     gras_ddt_parse__load_buffer_state();
1523     (yy_did_buffer_switch_on_eof) = 1;
1524   }
1525 }
1526
1527 /* Allocates the stack if it does not exist.
1528  *  Guarantees space for at least one push.
1529  */
1530 static void gras_ddt_parse_ensure_buffer_stack(void)
1531 {
1532   int num_to_alloc;
1533
1534   if (!(yy_buffer_stack)) {
1535
1536     /* First allocation is just for 2 elements, since we don't know if this
1537      * scanner will even need a stack. We use 2 instead of 1 to avoid an
1538      * immediate realloc on the next call.
1539      */
1540     num_to_alloc = 1;
1541     (yy_buffer_stack) = (struct yy_buffer_state **) gras_ddt_parse_alloc
1542       (num_to_alloc * sizeof(struct yy_buffer_state *)
1543       );
1544     if (!(yy_buffer_stack))
1545       YY_FATAL_ERROR
1546         ("out of dynamic memory in gras_ddt_parse_ensure_buffer_stack()");
1547
1548     memset((yy_buffer_stack), 0,
1549            num_to_alloc * sizeof(struct yy_buffer_state *));
1550
1551     (yy_buffer_stack_max) = num_to_alloc;
1552     (yy_buffer_stack_top) = 0;
1553     return;
1554   }
1555
1556   if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1) {
1557
1558     /* Increase the buffer to prepare for a possible push. */
1559     int grow_size = 8 /* arbitrary grow size */ ;
1560
1561     num_to_alloc = (yy_buffer_stack_max) + grow_size;
1562     (yy_buffer_stack) = (struct yy_buffer_state **) gras_ddt_parse_realloc
1563       ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state *)
1564       );
1565     if (!(yy_buffer_stack))
1566       YY_FATAL_ERROR
1567         ("out of dynamic memory in gras_ddt_parse_ensure_buffer_stack()");
1568
1569     /* zero only the new slots. */
1570     memset((yy_buffer_stack) + (yy_buffer_stack_max), 0,
1571            grow_size * sizeof(struct yy_buffer_state *));
1572     (yy_buffer_stack_max) = num_to_alloc;
1573   }
1574 }
1575
1576 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1577  * @param base the character buffer
1578  * @param size the size in bytes of the character buffer
1579  * 
1580  * @return the newly allocated buffer state object. 
1581  */
1582 YY_BUFFER_STATE gras_ddt_parse__scan_buffer(char *base, yy_size_t size)
1583 {
1584   YY_BUFFER_STATE b;
1585
1586   if (size < 2 ||
1587       base[size - 2] != YY_END_OF_BUFFER_CHAR ||
1588       base[size - 1] != YY_END_OF_BUFFER_CHAR)
1589     /* They forgot to leave room for the EOB's. */
1590     return 0;
1591
1592   b = (YY_BUFFER_STATE) gras_ddt_parse_alloc(sizeof(struct yy_buffer_state));
1593   if (!b)
1594     YY_FATAL_ERROR("out of dynamic memory in gras_ddt_parse__scan_buffer()");
1595
1596   b->yy_buf_size = size - 2;    /* "- 2" to take care of EOB's */
1597   b->yy_buf_pos = b->yy_ch_buf = base;
1598   b->yy_is_our_buffer = 0;
1599   b->yy_input_file = 0;
1600   b->yy_n_chars = b->yy_buf_size;
1601   b->yy_is_interactive = 0;
1602   b->yy_at_bol = 1;
1603   b->yy_fill_buffer = 0;
1604   b->yy_buffer_status = YY_BUFFER_NEW;
1605
1606   gras_ddt_parse__switch_to_buffer(b);
1607
1608   return b;
1609 }
1610
1611 /** Setup the input buffer state to scan a string. The next call to gras_ddt_parse_lex() will
1612  * scan from a @e copy of @a str.
1613  * @param yystr a NUL-terminated string to scan
1614  * 
1615  * @return the newly allocated buffer state object.
1616  * @note If you want to scan bytes that may contain NUL values, then use
1617  *       gras_ddt_parse__scan_bytes() instead.
1618  */
1619 YY_BUFFER_STATE gras_ddt_parse__scan_string(yyconst char *yystr)
1620 {
1621
1622   return gras_ddt_parse__scan_bytes(yystr, strlen(yystr));
1623 }
1624
1625 /** Setup the input buffer state to scan the given bytes. The next call to gras_ddt_parse_lex() will
1626  * scan from a @e copy of @a bytes.
1627  * @param bytes the byte buffer to scan
1628  * @param len the number of bytes in the buffer pointed to by @a bytes.
1629  * 
1630  * @return the newly allocated buffer state object.
1631  */
1632 YY_BUFFER_STATE gras_ddt_parse__scan_bytes(yyconst char *yybytes,
1633                                            int _yybytes_len)
1634 {
1635   YY_BUFFER_STATE b;
1636   char *buf;
1637   yy_size_t n;
1638   int i;
1639
1640   /* Get memory for full buffer, including space for trailing EOB's. */
1641   n = _yybytes_len + 2;
1642   buf = (char *) gras_ddt_parse_alloc(n);
1643   if (!buf)
1644     YY_FATAL_ERROR("out of dynamic memory in gras_ddt_parse__scan_bytes()");
1645
1646   for (i = 0; i < _yybytes_len; ++i)
1647     buf[i] = yybytes[i];
1648
1649   buf[_yybytes_len] = buf[_yybytes_len + 1] = YY_END_OF_BUFFER_CHAR;
1650
1651   b = gras_ddt_parse__scan_buffer(buf, n);
1652   if (!b)
1653     YY_FATAL_ERROR("bad buffer in gras_ddt_parse__scan_bytes()");
1654
1655   /* It's okay to grow etc. this buffer, and we should throw it
1656    * away when we're done.
1657    */
1658   b->yy_is_our_buffer = 1;
1659
1660   return b;
1661 }
1662
1663 #ifndef YY_EXIT_FAILURE
1664 #define YY_EXIT_FAILURE 2
1665 #endif
1666
1667 static void yy_fatal_error(yyconst char *msg)
1668 {
1669   (void) fprintf(stderr, "%s\n", msg);
1670   exit(YY_EXIT_FAILURE);
1671 }
1672
1673 /* Redefine yyless() so it works in section 3 code. */
1674
1675 #undef yyless
1676 #define yyless(n) \
1677         do \
1678                 { \
1679                 /* Undo effects of setting up gras_ddt_parse_text. */ \
1680         int yyless_macro_arg = (n); \
1681         YY_LESS_LINENO(yyless_macro_arg);\
1682                 gras_ddt_parse_text[gras_ddt_parse_leng] = (yy_hold_char); \
1683                 (yy_c_buf_p) = gras_ddt_parse_text + yyless_macro_arg; \
1684                 (yy_hold_char) = *(yy_c_buf_p); \
1685                 *(yy_c_buf_p) = '\0'; \
1686                 gras_ddt_parse_leng = yyless_macro_arg; \
1687                 } \
1688         while ( 0 )
1689
1690 /* Accessor  methods (get/set functions) to struct members. */
1691
1692 /** Get the current line number.
1693  * 
1694  */
1695 int gras_ddt_parse_get_lineno(void)
1696 {
1697
1698   return gras_ddt_parse_lineno;
1699 }
1700
1701 /** Get the input stream.
1702  * 
1703  */
1704 FILE *gras_ddt_parse_get_in(void)
1705 {
1706   return gras_ddt_parse_in;
1707 }
1708
1709 /** Get the output stream.
1710  * 
1711  */
1712 FILE *gras_ddt_parse_get_out(void)
1713 {
1714   return gras_ddt_parse_out;
1715 }
1716
1717 /** Get the length of the current token.
1718  * 
1719  */
1720 int gras_ddt_parse_get_leng(void)
1721 {
1722   return gras_ddt_parse_leng;
1723 }
1724
1725 /** Get the current token.
1726  * 
1727  */
1728
1729 char *gras_ddt_parse_get_text(void)
1730 {
1731   return gras_ddt_parse_text;
1732 }
1733
1734 /** Set the current line number.
1735  * @param line_number
1736  * 
1737  */
1738 void gras_ddt_parse_set_lineno(int line_number)
1739 {
1740
1741   gras_ddt_parse_lineno = line_number;
1742 }
1743
1744 /** Set the input stream. This does not discard the current
1745  * input buffer.
1746  * @param in_str A readable stream.
1747  * 
1748  * @see gras_ddt_parse__switch_to_buffer
1749  */
1750 void gras_ddt_parse_set_in(FILE * in_str)
1751 {
1752   gras_ddt_parse_in = in_str;
1753 }
1754
1755 void gras_ddt_parse_set_out(FILE * out_str)
1756 {
1757   gras_ddt_parse_out = out_str;
1758 }
1759
1760 int gras_ddt_parse_get_debug(void)
1761 {
1762   return gras_ddt_parse__flex_debug;
1763 }
1764
1765 void gras_ddt_parse_set_debug(int bdebug)
1766 {
1767   gras_ddt_parse__flex_debug = bdebug;
1768 }
1769
1770 static int yy_init_globals(void)
1771 {
1772   /* Initialization is the same as for the non-reentrant scanner.
1773    * This function is called from gras_ddt_parse_lex_destroy(), so don't allocate here.
1774    */
1775
1776   (yy_buffer_stack) = 0;
1777   (yy_buffer_stack_top) = 0;
1778   (yy_buffer_stack_max) = 0;
1779   (yy_c_buf_p) = (char *) 0;
1780   (yy_init) = 0;
1781   (yy_start) = 0;
1782
1783 /* Defined in main.c */
1784 #ifdef YY_STDINIT
1785   gras_ddt_parse_in = stdin;
1786   gras_ddt_parse_out = stdout;
1787 #else
1788   gras_ddt_parse_in = (FILE *) 0;
1789   gras_ddt_parse_out = (FILE *) 0;
1790 #endif
1791
1792   /* For future reference: Set errno on error, since we are called by
1793    * gras_ddt_parse_lex_init()
1794    */
1795   return 0;
1796 }
1797
1798 /* gras_ddt_parse_lex_destroy is for both reentrant and non-reentrant scanners. */
1799 int gras_ddt_parse_lex_destroy(void)
1800 {
1801
1802   /* Pop the buffer stack, destroying each element. */
1803   while (YY_CURRENT_BUFFER) {
1804     gras_ddt_parse__delete_buffer(YY_CURRENT_BUFFER);
1805     YY_CURRENT_BUFFER_LVALUE = NULL;
1806     gras_ddt_parse_pop_buffer_state();
1807   }
1808
1809   /* Destroy the stack itself. */
1810   gras_ddt_parse_free((yy_buffer_stack));
1811   (yy_buffer_stack) = NULL;
1812
1813   /* Reset the globals. This is important in a non-reentrant scanner so the next time
1814    * gras_ddt_parse_lex() is called, initialization will occur. */
1815   yy_init_globals();
1816
1817   return 0;
1818 }
1819
1820 /*
1821  * Internal utility routines.
1822  */
1823
1824 #ifndef yytext_ptr
1825 static void yy_flex_strncpy(char *s1, yyconst char *s2, int n)
1826 {
1827   register int i;
1828   for (i = 0; i < n; ++i)
1829     s1[i] = s2[i];
1830 }
1831 #endif
1832
1833 #ifdef YY_NEED_STRLEN
1834 static int yy_flex_strlen(yyconst char *s)
1835 {
1836   register int n;
1837   for (n = 0; s[n]; ++n);
1838
1839   return n;
1840 }
1841 #endif
1842
1843 void *gras_ddt_parse_alloc(yy_size_t size)
1844 {
1845   return (void *) malloc(size);
1846 }
1847
1848 void *gras_ddt_parse_realloc(void *ptr, yy_size_t size)
1849 {
1850   /* The cast to (char *) in the following accommodates both
1851    * implementations that use char* generic pointers, and those
1852    * that use void* generic pointers.  It works with the latter
1853    * because both ANSI C and C++ allow castless assignment from
1854    * any pointer type to void*, and deal with argument conversions
1855    * as though doing an assignment.
1856    */
1857   return (void *) realloc((char *) ptr, size);
1858 }
1859
1860 void gras_ddt_parse_free(void *ptr)
1861 {
1862   free((char *) ptr);           /* see gras_ddt_parse_realloc() for (char *) cast */
1863 }
1864
1865 #define YYTABLES_NAME "yytables"
1866
1867 /* {space}+                { return(TOKEN_SPACE);} */
1868
1869 void gras_ddt_parse_dump(void)
1870 {
1871   switch (gras_ddt_parse_tok_num) {
1872   case GRAS_DDT_PARSE_TOKEN_LA:{
1873       printf("TOKEN_LA ");
1874       break;
1875     }
1876   case GRAS_DDT_PARSE_TOKEN_RA:{
1877       printf("TOKEN_RA ");
1878       break;
1879     }
1880   case GRAS_DDT_PARSE_TOKEN_WORD:{
1881       printf("TOKEN_WORD ");
1882       break;
1883     }
1884     /*  case GRAS_DDT_PARSE_TOKEN_SPACE   : {printf("TOKEN_SPACE ");break;} */
1885     /*  case GRAS_DDT_PARSE_TOKEN_COMMENT : {printf("TOKEN_COMMENT ");break;} */
1886   case GRAS_DDT_PARSE_TOKEN_NEWLINE:{
1887       printf("TOKEN_NEWLINE\n");
1888       return;
1889     }
1890   case GRAS_DDT_PARSE_TOKEN_EMPTY:{
1891       printf("TOKEN_EMPTY\n");
1892       return;
1893     }
1894   default:{
1895       printf("Unknown token %d\n", gras_ddt_parse_tok_num);
1896       return;
1897     }
1898   }
1899   printf("-->%s<-- [line %d, pos %d]\n", gras_ddt_parse_text,
1900          gras_ddt_parse_line_pos, gras_ddt_parse_char_pos);
1901   return;
1902 }
1903
1904 int gras_ddt_parse_lex_n_dump(void)
1905 {
1906   gras_ddt_parse_tok_num = gras_ddt_parse_lex();
1907   /*  gras_ddt_parse_char_pos += strlen(gras_ddt_parse_text); */
1908   return (gras_ddt_parse_tok_num);
1909 }
1910
1911 void gras_ddt_parse_pointer_init(const char *file)
1912 {
1913   gras_ddt_file_to_parse = fopen(file, "r");
1914   gras_ddt_input_buffer =
1915     gras_ddt_parse__create_buffer(gras_ddt_file_to_parse, 10);
1916   gras_ddt_parse__switch_to_buffer(gras_ddt_input_buffer);
1917
1918   gras_ddt_parse_line_pos = 1;
1919   gras_ddt_parse_char_pos = 0;
1920   gras_ddt_parse_col_pos = 0;
1921   gras_ddt_parse_tok_num = 0;
1922 }
1923
1924 void gras_ddt_parse_pointer_close(void)
1925 {
1926   gras_ddt_parse__delete_buffer(gras_ddt_input_buffer);
1927   fclose(gras_ddt_file_to_parse);
1928
1929   gras_ddt_parse_line_pos = 1;
1930   gras_ddt_parse_char_pos = 0;
1931   gras_ddt_parse_tok_num = 0;
1932 }
1933
1934 void gras_ddt_parse_pointer_string_init(const char *string_to_parse)
1935 {
1936   gras_ddt_input_buffer = gras_ddt_parse__scan_string(string_to_parse);
1937   definition = string_to_parse;
1938   gras_ddt_parse__switch_to_buffer(gras_ddt_input_buffer);
1939
1940   gras_ddt_parse_line_pos = 1;
1941   gras_ddt_parse_char_pos = 0;
1942   gras_ddt_parse_tok_num = 0;
1943 }
1944
1945 void gras_ddt_parse_pointer_string_close(void)
1946 {
1947   gras_ddt_parse__delete_buffer(gras_ddt_input_buffer);
1948
1949   gras_ddt_parse_line_pos = 1;
1950   gras_ddt_parse_char_pos = 0;
1951   gras_ddt_parse_tok_num = 0;
1952
1953   if (0)
1954     yyunput('\0', NULL);        /* fake a use of this function to calm gcc down */
1955 }
1956
1957 /* Local variables:*/
1958 /* mode: c */
1959 /* End: */