Logo AND Algorithmique Numérique Distribuée

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