Logo AND Algorithmique Numérique Distribuée

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