Logo AND Algorithmique Numérique Distribuée

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