Logo AND Algorithmique Numérique Distribuée

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