Logo AND Algorithmique Numérique Distribuée

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