1 #define yy_create_buffer gras_ddt_parse__create_buffer
2 #define yy_delete_buffer gras_ddt_parse__delete_buffer
3 #define yy_scan_buffer gras_ddt_parse__scan_buffer
4 #define yy_scan_string gras_ddt_parse__scan_string
5 #define yy_scan_bytes gras_ddt_parse__scan_bytes
6 #define yy_flex_debug gras_ddt_parse__flex_debug
7 #define yy_init_buffer gras_ddt_parse__init_buffer
8 #define yy_flush_buffer gras_ddt_parse__flush_buffer
9 #define yy_load_buffer_state gras_ddt_parse__load_buffer_state
10 #define yy_switch_to_buffer gras_ddt_parse__switch_to_buffer
11 #define yyin gras_ddt_parse_in
12 #define yyleng gras_ddt_parse_leng
13 #define yylex gras_ddt_parse_lex
14 #define yyout gras_ddt_parse_out
15 #define yyrestart gras_ddt_parse_restart
16 #define yytext gras_ddt_parse_text
18 #line 19 "gras/DataDesc/ddt_parse.yy.c"
19 /* A lexical scanner generated by flex */
21 /* Scanner skeleton version:
26 #define YY_FLEX_MAJOR_VERSION 2
27 #define YY_FLEX_MINOR_VERSION 5
32 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
47 /* Use prototypes in function declarations. */
50 /* The "const" storage-class-modifier is valid. */
53 #else /* ! __cplusplus */
61 #endif /* ! __cplusplus */
80 #define YY_PROTO(proto) proto
82 #define YY_PROTO(proto) ()
86 /* Returned upon end-of-file. */
89 /* Promotes a possibly negative, possibly signed char to an unsigned
90 * integer for use as an array index. If the signed char is negative,
91 * we want to instead treat it as an 8-bit unsigned char, hence the
94 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
96 /* Enter a start condition. This macro really ought to take a parameter,
97 * but we do it the disgusting crufty way forced on us by the ()-less
98 * definition of BEGIN.
100 #define BEGIN yy_start = 1 + 2 *
102 /* Translate the current start state into a value that can be later handed
103 * to BEGIN to return to the state. The YYSTATE alias is for lex
106 #define YY_START ((yy_start - 1) / 2)
107 #define YYSTATE YY_START
109 /* Action number for EOF rule of a given start state. */
110 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
112 /* Special action meaning "start processing a new file". */
113 #define YY_NEW_FILE yyrestart( yyin )
115 #define YY_END_OF_BUFFER_CHAR 0
117 /* Size of default input buffer. */
118 #define YY_BUF_SIZE 16384
120 typedef struct yy_buffer_state *YY_BUFFER_STATE;
123 extern FILE *yyin, *yyout;
125 #define EOB_ACT_CONTINUE_SCAN 0
126 #define EOB_ACT_END_OF_FILE 1
127 #define EOB_ACT_LAST_MATCH 2
129 /* The funky do-while in the following #define is used to turn the definition
130 * int a single C statement (which needs a semi-colon terminator). This
131 * avoids problems with code like:
133 * if ( condition_holds )
136 * do_something_else();
138 * Prior to using the do-while the compiler would get upset at the
139 * "else" because it interpreted the "if" statement as being all
140 * done when it reached the ';' after the yyless() call.
143 /* Return all but the first 'n' matched characters back to the input stream. */
148 /* Undo effects of setting up yytext. */ \
149 *yy_cp = yy_hold_char; \
150 YY_RESTORE_YY_MORE_OFFSET \
151 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
152 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
156 #define unput(c) yyunput( c, yytext_ptr )
158 /* The following is because we cannot portably get our hands on size_t
159 * (without autoconf's help, which isn't available because we want
160 * flex-generated scanners to compile on their own).
162 typedef unsigned int yy_size_t;
165 struct yy_buffer_state
169 char *yy_ch_buf; /* input buffer */
170 char *yy_buf_pos; /* current position in input buffer */
172 /* Size of input buffer in bytes, not including room for EOB
175 yy_size_t yy_buf_size;
177 /* Number of characters read into yy_ch_buf, not including EOB
182 /* Whether we "own" the buffer - i.e., we know we created it,
183 * and can realloc() it to grow it, and should free() it to
186 int yy_is_our_buffer;
188 /* Whether this is an "interactive" input source; if so, and
189 * if we're using stdio for input, then we want to use getc()
190 * instead of fread(), to make sure we stop fetching input after
193 int yy_is_interactive;
195 /* Whether we're considered to be at the beginning of a line.
196 * If so, '^' rules will be active on the next match, otherwise
201 /* Whether to try to fill the input buffer when we reach the
206 int yy_buffer_status;
207 #define YY_BUFFER_NEW 0
208 #define YY_BUFFER_NORMAL 1
209 /* When an EOF's been seen but there's still some text to process
210 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
211 * shouldn't try reading from the input source any more. We might
212 * still have a bunch of tokens to match, though, because of
213 * possible backing-up.
215 * When we actually see the EOF, we change the status to "new"
216 * (via yyrestart()), so that the user can continue scanning by
217 * just pointing yyin at a new input file.
219 #define YY_BUFFER_EOF_PENDING 2
222 static YY_BUFFER_STATE yy_current_buffer = 0;
224 /* We provide macros for accessing buffer states in case in the
225 * future we want to put the buffer states in a more general
228 #define YY_CURRENT_BUFFER yy_current_buffer
231 /* yy_hold_char holds the character lost when yytext is formed. */
232 static char yy_hold_char;
234 static int yy_n_chars; /* number of characters read into yy_ch_buf */
239 /* Points to current character in buffer. */
240 static char *yy_c_buf_p = (char *) 0;
241 static int yy_init = 1; /* whether we need to initialize */
242 static int yy_start = 0; /* start state number */
244 /* Flag which is used to allow yywrap()'s to do buffer switches
245 * instead of setting up a fresh yyin. A bit of a hack ...
247 static int yy_did_buffer_switch_on_eof;
249 void yyrestart YY_PROTO(( FILE *input_file ));
251 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
252 void yy_load_buffer_state YY_PROTO(( void ));
253 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
254 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
255 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
256 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
257 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
259 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
260 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
261 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
263 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
264 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
265 static void yy_flex_free YY_PROTO(( void * ));
267 #define yy_new_buffer yy_create_buffer
269 #define yy_set_interactive(is_interactive) \
271 if ( ! yy_current_buffer ) \
272 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
273 yy_current_buffer->yy_is_interactive = is_interactive; \
276 #define yy_set_bol(at_bol) \
278 if ( ! yy_current_buffer ) \
279 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
280 yy_current_buffer->yy_at_bol = at_bol; \
283 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
287 #define YY_SKIP_YYWRAP
288 typedef unsigned char YY_CHAR;
289 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
290 typedef int yy_state_type;
292 #define yytext_ptr yytext
294 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
295 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
296 static int yy_get_next_buffer YY_PROTO(( void ));
297 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
299 /* Done after the current pattern has been matched and before the
300 * corresponding action - sets up yytext.
302 #define YY_DO_BEFORE_ACTION \
303 yytext_ptr = yy_bp; \
304 yyleng = (int) (yy_cp - yy_bp); \
305 yy_hold_char = *yy_cp; \
309 #define YY_NUM_RULES 26
310 #define YY_END_OF_BUFFER 27
311 static yyconst short int yy_accept[61] =
313 14, 14, 7, 7, 10, 10, 0, 0, 27, 25,
314 24, 19, 20, 21, 23, 14, 25, 22, 17, 18,
315 15, 16, 7, 7, 6, 7, 7, 10, 12, 11,
316 26, 26, 14, 0, 1, 7, 7, 7, 5, 7,
317 10, 11, 11, 13, 0, 0, 2, 1, 4, 0,
318 3, 0, 2, 0, 3, 0, 0, 8, 9, 0
321 static yyconst int yy_ec[256] =
323 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
324 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
325 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
326 1, 2, 1, 1, 1, 1, 1, 1, 1, 4,
327 5, 6, 1, 7, 8, 8, 9, 10, 10, 10,
328 10, 10, 10, 10, 10, 10, 10, 1, 11, 1,
329 1, 1, 1, 1, 8, 8, 8, 8, 8, 8,
330 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
331 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
332 12, 1, 13, 14, 8, 1, 8, 8, 8, 8,
334 8, 8, 15, 8, 8, 8, 8, 8, 8, 8,
335 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
336 8, 8, 16, 1, 17, 1, 1, 1, 1, 1,
337 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
338 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
339 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
340 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
341 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
342 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
343 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
345 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
346 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
347 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
348 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
349 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
353 static yyconst int yy_meta[18] =
355 1, 1, 2, 1, 1, 3, 1, 4, 1, 4,
359 static yyconst short int yy_base[69] =
361 0, 0, 16, 30, 17, 18, 78, 77, 85, 88,
362 88, 88, 88, 88, 88, 0, 19, 88, 88, 88,
363 88, 88, 0, 24, 88, 75, 77, 0, 88, 21,
364 88, 76, 0, 22, 0, 0, 27, 75, 0, 71,
365 0, 29, 34, 88, 29, 65, 76, 0, 0, 63,
366 74, 60, 72, 56, 65, 51, 50, 88, 88, 88,
367 45, 49, 53, 55, 57, 61, 65, 69
370 static yyconst short int yy_def[69] =
372 60, 1, 61, 61, 62, 62, 63, 63, 60, 60,
373 60, 60, 60, 60, 60, 64, 60, 60, 60, 60,
374 60, 60, 65, 65, 60, 65, 65, 66, 60, 67,
375 60, 60, 64, 60, 68, 65, 65, 65, 65, 65,
376 66, 67, 67, 60, 60, 60, 60, 68, 65, 60,
377 60, 60, 60, 60, 60, 60, 60, 60, 60, 0,
378 60, 60, 60, 60, 60, 60, 60, 60
381 static yyconst short int yy_nxt[106] =
383 10, 10, 11, 12, 13, 14, 15, 16, 17, 16,
384 18, 19, 20, 10, 16, 21, 22, 24, 25, 29,
385 29, 26, 30, 30, 34, 37, 43, 35, 37, 44,
386 27, 24, 25, 46, 60, 26, 47, 60, 38, 43,
387 50, 38, 44, 51, 27, 23, 23, 23, 23, 28,
388 28, 28, 28, 31, 31, 31, 31, 36, 33, 36,
389 36, 41, 59, 58, 41, 42, 55, 42, 42, 48,
390 57, 48, 48, 53, 56, 55, 54, 53, 52, 49,
391 40, 45, 40, 39, 60, 32, 32, 9, 60, 60,
392 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
397 static yyconst short int yy_chk[106] =
399 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
400 1, 1, 1, 1, 1, 1, 1, 3, 3, 5,
401 6, 3, 5, 6, 17, 24, 30, 17, 37, 30,
402 3, 4, 4, 34, 42, 4, 34, 42, 24, 43,
403 45, 37, 43, 45, 4, 61, 61, 61, 61, 62,
404 62, 62, 62, 63, 63, 63, 63, 65, 64, 65,
405 65, 66, 57, 56, 66, 67, 55, 67, 67, 68,
406 54, 68, 68, 53, 52, 51, 50, 47, 46, 40,
407 38, 32, 27, 26, 9, 8, 7, 60, 60, 60,
408 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
413 static yy_state_type yy_last_accepting_state;
414 static char *yy_last_accepting_cpos;
416 /* The intent behind this definition is that it'll catch
417 * any uses of REJECT which flex missed.
419 #define REJECT reject_used_but_not_detected
420 #define yymore() yymore_used_but_not_detected
421 #define YY_MORE_ADJ 0
422 #define YY_RESTORE_YY_MORE_OFFSET
424 #line 1 "gras/DataDesc/ddt_parse.yy.l"
427 /* DataDesc/ddt_parse -- automatic parsing of data structures */
428 /* Authors: Arnaud Legrand, Martin Quinson */
429 /* Copyright (C) 2003, 2004 Martin Quinson. */
430 /* This program is free software; you can redistribute it and/or modify it
431 under the terms of the license (GNU LGPL) which comes with this package. */
432 #line 13 "gras/DataDesc/ddt_parse.yy.l"
433 #include "gras/DataDesc/datadesc_private.h"
434 #include "gras/DataDesc/ddt_parse.yy.h"
436 YY_BUFFER_STATE input_buffer;
439 int gras_ddt_parse_line_pos = 1;
440 int gras_ddt_parse_col_pos = 0;
441 int gras_ddt_parse_char_pos = 0;
442 int gras_ddt_parse_tok_num = 0;
443 const char *definition;
444 GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(lexer,ddt_parse);
445 #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,yytext)
450 #line 451 "gras/DataDesc/ddt_parse.yy.c"
452 /* Macros after this point can all be overridden by user definitions in
456 #ifndef YY_SKIP_YYWRAP
458 extern "C" int yywrap YY_PROTO(( void ));
460 extern int yywrap YY_PROTO(( void ));
465 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
469 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
472 #ifdef YY_NEED_STRLEN
473 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
478 static int yyinput YY_PROTO(( void ));
480 static int input YY_PROTO(( void ));
485 static int yy_start_stack_ptr = 0;
486 static int yy_start_stack_depth = 0;
487 static int *yy_start_stack = 0;
488 #ifndef YY_NO_PUSH_STATE
489 static void yy_push_state YY_PROTO(( int new_state ));
491 #ifndef YY_NO_POP_STATE
492 static void yy_pop_state YY_PROTO(( void ));
494 #ifndef YY_NO_TOP_STATE
495 static int yy_top_state YY_PROTO(( void ));
499 #define YY_NO_PUSH_STATE 1
500 #define YY_NO_POP_STATE 1
501 #define YY_NO_TOP_STATE 1
504 #ifdef YY_MALLOC_DECL
512 /* Just try to get by without declaring the routines. This will fail
513 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
514 * or sizeof(void*) != sizeof(int).
519 /* Amount of stuff to slurp up with each read. */
520 #ifndef YY_READ_BUF_SIZE
521 #define YY_READ_BUF_SIZE 8192
524 /* Copy whatever the last rule matched to the standard output. */
527 /* This used to be an fputs(), but since the string might contain NUL's,
528 * we now use fwrite().
530 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
533 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
534 * is returned in "result".
537 #define YY_INPUT(buf,result,max_size) \
538 if ( yy_current_buffer->yy_is_interactive ) \
541 for ( n = 0; n < max_size && \
542 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
545 buf[n++] = (char) c; \
546 if ( c == EOF && ferror( yyin ) ) \
547 YY_FATAL_ERROR( "input in flex scanner failed" ); \
553 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
555 if( errno != EINTR) \
557 YY_FATAL_ERROR( "input in flex scanner failed" ); \
566 /* No semi-colon after return; correct usage is to write "yyterminate();" -
567 * we don't want an extra ';' after the "return" because that will cause
568 * some compilers to complain about unreachable statements.
571 #define yyterminate() return YY_NULL
574 /* Number of entries by which start-condition stack grows. */
575 #ifndef YY_START_STACK_INCR
576 #define YY_START_STACK_INCR 25
579 /* Report a fatal error. */
580 #ifndef YY_FATAL_ERROR
581 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
584 /* Default declaration of generated scanner - a define so the user can
585 * easily add parameters.
588 #define YY_DECL int yylex YY_PROTO(( void ))
591 /* Code executed at the beginning of each rule, after yytext and yyleng
594 #ifndef YY_USER_ACTION
595 #define YY_USER_ACTION
598 /* Code executed at the end of each rule. */
600 #define YY_BREAK break;
603 #define YY_RULE_SETUP \
608 register yy_state_type yy_current_state;
609 register char *yy_cp, *yy_bp;
612 #line 33 "gras/DataDesc/ddt_parse.yy.l"
614 int comment_caller=0;
615 int annotate_caller=0;
617 char string_buf[GRAS_DDT_PARSE_MAX_STR_CONST];
618 char *string_buf_ptr = NULL;
620 #line 621 "gras/DataDesc/ddt_parse.yy.c"
631 yy_start = 1; /* first start state */
639 if ( ! yy_current_buffer )
641 yy_create_buffer( yyin, YY_BUF_SIZE );
643 yy_load_buffer_state();
646 while ( 1 ) /* loops until end-of-file is reached */
650 /* Support of yytext. */
651 *yy_cp = yy_hold_char;
653 /* yy_bp points to the position in yy_ch_buf of the start of
658 yy_current_state = yy_start;
662 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
663 if ( yy_accept[yy_current_state] )
665 yy_last_accepting_state = yy_current_state;
666 yy_last_accepting_cpos = yy_cp;
668 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
670 yy_current_state = (int) yy_def[yy_current_state];
671 if ( yy_current_state >= 61 )
672 yy_c = yy_meta[(unsigned int) yy_c];
674 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
677 while ( yy_base[yy_current_state] != 88 );
680 yy_act = yy_accept[yy_current_state];
682 { /* have to back up */
683 yy_cp = yy_last_accepting_cpos;
684 yy_current_state = yy_last_accepting_state;
685 yy_act = yy_accept[yy_current_state];
691 do_action: /* This label is used only to access EOF actions. */
695 { /* beginning of action switch */
696 case 0: /* must back up */
697 /* undo the effects of YY_DO_BEFORE_ACTION */
698 *yy_cp = yy_hold_char;
699 yy_cp = yy_last_accepting_cpos;
700 yy_current_state = yy_last_accepting_state;
705 #line 40 "gras/DataDesc/ddt_parse.yy.l"
710 #line 42 "gras/DataDesc/ddt_parse.yy.l"
711 { /****************** ANNOTATION ************************/
712 DEBUG0("Begin annotation");
713 annotate_caller = INITIAL;
714 gras_ddt_parse_char_pos+= strlen(yytext);
715 gras_ddt_parse_col_pos+= strlen(yytext);
721 #line 49 "gras/DataDesc/ddt_parse.yy.l"
722 { /* trim annotation */
723 DEBUG0("Begin annotation");
724 annotate_caller = foo;
725 gras_ddt_parse_char_pos+= strlen(yytext);
726 gras_ddt_parse_col_pos+= strlen(yytext);
732 #line 57 "gras/DataDesc/ddt_parse.yy.l"
734 DEBUG0("End annotation");
735 gras_ddt_parse_char_pos+= strlen(yytext);
736 gras_ddt_parse_col_pos+= strlen(yytext);
737 BEGIN(annotate_caller);
742 #line 64 "gras/DataDesc/ddt_parse.yy.l"
744 PARSE_ERROR0("``/*g'' construct closed by a regular ``*/''");
749 #line 67 "gras/DataDesc/ddt_parse.yy.l"
751 PARSE_ERROR0("Type annotation cannot spread over several lines");
756 #line 71 "gras/DataDesc/ddt_parse.yy.l"
758 gras_ddt_parse_char_pos+= strlen(yytext);
759 gras_ddt_parse_col_pos+= strlen(yytext);
760 return GRAS_DDT_PARSE_TOKEN_ANNOTATE;
765 #line 77 "gras/DataDesc/ddt_parse.yy.l"
766 { /****************** COMMENTS ************************/
767 // constructs like /*g [string] g*/ are not comments but size annotations
768 comment_caller = INITIAL;
774 #line 83 "gras/DataDesc/ddt_parse.yy.l"
776 comment_caller = foo;
782 #line 88 "gras/DataDesc/ddt_parse.yy.l"
783 { /* eat anything that's not a '*' */
788 #line 90 "gras/DataDesc/ddt_parse.yy.l"
789 { /* eat up '*'s not followed by '/'s */
794 #line 92 "gras/DataDesc/ddt_parse.yy.l"
796 ++gras_ddt_parse_line_pos;
797 gras_ddt_parse_col_pos=0;
798 gras_ddt_parse_char_pos++;
803 #line 97 "gras/DataDesc/ddt_parse.yy.l"
805 gras_ddt_parse_char_pos+= strlen(yytext);
806 gras_ddt_parse_col_pos+= strlen(yytext);
807 BEGIN(comment_caller);
812 #line 103 "gras/DataDesc/ddt_parse.yy.l"
813 { /****************** STATEMENTS ************************/
814 gras_ddt_parse_char_pos += strlen(yytext);
815 gras_ddt_parse_col_pos += strlen(yytext);
817 return(GRAS_DDT_PARSE_TOKEN_WORD);
822 #line 109 "gras/DataDesc/ddt_parse.yy.l"
824 gras_ddt_parse_char_pos++;
825 gras_ddt_parse_col_pos++;
827 return(GRAS_DDT_PARSE_TOKEN_LA);
832 #line 115 "gras/DataDesc/ddt_parse.yy.l"
834 gras_ddt_parse_char_pos++;
835 gras_ddt_parse_col_pos++;
837 return(GRAS_DDT_PARSE_TOKEN_RA);
842 #line 121 "gras/DataDesc/ddt_parse.yy.l"
844 gras_ddt_parse_char_pos++;
845 gras_ddt_parse_col_pos++;
847 return(GRAS_DDT_PARSE_TOKEN_LB);
852 #line 127 "gras/DataDesc/ddt_parse.yy.l"
854 gras_ddt_parse_char_pos++;
855 gras_ddt_parse_col_pos++;
857 return(GRAS_DDT_PARSE_TOKEN_RB);
862 #line 133 "gras/DataDesc/ddt_parse.yy.l"
864 gras_ddt_parse_char_pos++;
865 gras_ddt_parse_col_pos++;
867 return(GRAS_DDT_PARSE_TOKEN_LP);
872 #line 139 "gras/DataDesc/ddt_parse.yy.l"
874 gras_ddt_parse_char_pos++;
875 gras_ddt_parse_col_pos++;
877 return(GRAS_DDT_PARSE_TOKEN_RP);
882 #line 145 "gras/DataDesc/ddt_parse.yy.l"
884 gras_ddt_parse_char_pos++;
885 gras_ddt_parse_col_pos++;
887 return(GRAS_DDT_PARSE_TOKEN_STAR);
892 #line 151 "gras/DataDesc/ddt_parse.yy.l"
894 gras_ddt_parse_char_pos++;
895 gras_ddt_parse_col_pos++;
897 return(GRAS_DDT_PARSE_TOKEN_SEMI_COLON);
902 #line 157 "gras/DataDesc/ddt_parse.yy.l"
904 gras_ddt_parse_char_pos++;
905 gras_ddt_parse_col_pos++;
907 return(GRAS_DDT_PARSE_TOKEN_COLON);
912 #line 163 "gras/DataDesc/ddt_parse.yy.l"
914 gras_ddt_parse_line_pos++;
915 gras_ddt_parse_char_pos++;
916 gras_ddt_parse_col_pos=0;
922 #line 169 "gras/DataDesc/ddt_parse.yy.l"
924 gras_ddt_parse_char_pos++;
925 gras_ddt_parse_col_pos++;
931 #line 174 "gras/DataDesc/ddt_parse.yy.l"
934 #line 935 "gras/DataDesc/ddt_parse.yy.c"
935 case YY_STATE_EOF(INITIAL):
936 case YY_STATE_EOF(annotate):
937 case YY_STATE_EOF(comment):
938 case YY_STATE_EOF(foo):
941 case YY_END_OF_BUFFER:
943 /* Amount of text matched not including the EOB char. */
944 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
946 /* Undo the effects of YY_DO_BEFORE_ACTION. */
947 *yy_cp = yy_hold_char;
948 YY_RESTORE_YY_MORE_OFFSET
950 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
952 /* We're scanning a new file or input source. It's
953 * possible that this happened because the user
954 * just pointed yyin at a new source and called
955 * yylex(). If so, then we have to assure
956 * consistency between yy_current_buffer and our
957 * globals. Here is the right place to do so, because
958 * this is the first action (other than possibly a
959 * back-up) that will match for the new input source.
961 yy_n_chars = yy_current_buffer->yy_n_chars;
962 yy_current_buffer->yy_input_file = yyin;
963 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
966 /* Note that here we test for yy_c_buf_p "<=" to the position
967 * of the first EOB in the buffer, since yy_c_buf_p will
968 * already have been incremented past the NUL character
969 * (since all states make transitions on EOB to the
970 * end-of-buffer state). Contrast this with the test
973 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
974 { /* This was really a NUL. */
975 yy_state_type yy_next_state;
977 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
979 yy_current_state = yy_get_previous_state();
981 /* Okay, we're now positioned to make the NUL
982 * transition. We couldn't have
983 * yy_get_previous_state() go ahead and do it
984 * for us because it doesn't know how to deal
985 * with the possibility of jamming (and we don't
986 * want to build jamming into it because then it
987 * will run more slowly).
990 yy_next_state = yy_try_NUL_trans( yy_current_state );
992 yy_bp = yytext_ptr + YY_MORE_ADJ;
996 /* Consume the NUL. */
997 yy_cp = ++yy_c_buf_p;
998 yy_current_state = yy_next_state;
1005 goto yy_find_action;
1009 else switch ( yy_get_next_buffer() )
1011 case EOB_ACT_END_OF_FILE:
1013 yy_did_buffer_switch_on_eof = 0;
1017 /* Note: because we've taken care in
1018 * yy_get_next_buffer() to have set up
1019 * yytext, we can now set up
1020 * yy_c_buf_p so that if some total
1021 * hoser (like flex itself) wants to
1022 * call the scanner after we return the
1023 * YY_NULL, it'll still work - another
1024 * YY_NULL will get returned.
1026 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1028 yy_act = YY_STATE_EOF(YY_START);
1034 if ( ! yy_did_buffer_switch_on_eof )
1040 case EOB_ACT_CONTINUE_SCAN:
1042 yytext_ptr + yy_amount_of_matched_text;
1044 yy_current_state = yy_get_previous_state();
1047 yy_bp = yytext_ptr + YY_MORE_ADJ;
1050 case EOB_ACT_LAST_MATCH:
1052 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1054 yy_current_state = yy_get_previous_state();
1057 yy_bp = yytext_ptr + YY_MORE_ADJ;
1058 goto yy_find_action;
1065 "fatal flex scanner internal error--no action found" );
1066 } /* end of action switch */
1067 } /* end of scanning one token */
1068 } /* end of yylex */
1071 /* yy_get_next_buffer - try to read in a new buffer
1073 * Returns a code representing an action:
1074 * EOB_ACT_LAST_MATCH -
1075 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1076 * EOB_ACT_END_OF_FILE - end of file
1079 static int yy_get_next_buffer()
1081 register char *dest = yy_current_buffer->yy_ch_buf;
1082 register char *source = yytext_ptr;
1083 register int number_to_move, i;
1086 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1088 "fatal flex scanner internal error--end of buffer missed" );
1090 if ( yy_current_buffer->yy_fill_buffer == 0 )
1091 { /* Don't try to fill the buffer, so this is an EOF. */
1092 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1094 /* We matched a single character, the EOB, so
1095 * treat this as a final EOF.
1097 return EOB_ACT_END_OF_FILE;
1102 /* We matched some text prior to the EOB, first
1105 return EOB_ACT_LAST_MATCH;
1109 /* Try to read more data. */
1111 /* First move last chars to start of buffer. */
1112 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1114 for ( i = 0; i < number_to_move; ++i )
1115 *(dest++) = *(source++);
1117 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1118 /* don't do the read, it's not guaranteed to return an EOF,
1121 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1126 yy_current_buffer->yy_buf_size - number_to_move - 1;
1128 while ( num_to_read <= 0 )
1129 { /* Not enough room in the buffer - grow it. */
1130 #ifdef YY_USES_REJECT
1132 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1135 /* just a shorter name for the current buffer */
1136 YY_BUFFER_STATE b = yy_current_buffer;
1138 int yy_c_buf_p_offset =
1139 (int) (yy_c_buf_p - b->yy_ch_buf);
1141 if ( b->yy_is_our_buffer )
1143 int new_size = b->yy_buf_size * 2;
1145 if ( new_size <= 0 )
1146 b->yy_buf_size += b->yy_buf_size / 8;
1148 b->yy_buf_size *= 2;
1150 b->yy_ch_buf = (char *)
1151 /* Include room in for 2 EOB chars. */
1152 yy_flex_realloc( (void *) b->yy_ch_buf,
1153 b->yy_buf_size + 2 );
1156 /* Can't grow it, we don't own it. */
1159 if ( ! b->yy_ch_buf )
1161 "fatal error - scanner input buffer overflow" );
1163 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1165 num_to_read = yy_current_buffer->yy_buf_size -
1170 if ( num_to_read > YY_READ_BUF_SIZE )
1171 num_to_read = YY_READ_BUF_SIZE;
1173 /* Read in more data. */
1174 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1175 yy_n_chars, num_to_read );
1177 yy_current_buffer->yy_n_chars = yy_n_chars;
1180 if ( yy_n_chars == 0 )
1182 if ( number_to_move == YY_MORE_ADJ )
1184 ret_val = EOB_ACT_END_OF_FILE;
1190 ret_val = EOB_ACT_LAST_MATCH;
1191 yy_current_buffer->yy_buffer_status =
1192 YY_BUFFER_EOF_PENDING;
1197 ret_val = EOB_ACT_CONTINUE_SCAN;
1199 yy_n_chars += number_to_move;
1200 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1201 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1203 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1209 /* yy_get_previous_state - get the state just before the EOB char was reached */
1211 static yy_state_type yy_get_previous_state()
1213 register yy_state_type yy_current_state;
1214 register char *yy_cp;
1216 yy_current_state = yy_start;
1218 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1220 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1221 if ( yy_accept[yy_current_state] )
1223 yy_last_accepting_state = yy_current_state;
1224 yy_last_accepting_cpos = yy_cp;
1226 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1228 yy_current_state = (int) yy_def[yy_current_state];
1229 if ( yy_current_state >= 61 )
1230 yy_c = yy_meta[(unsigned int) yy_c];
1232 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1235 return yy_current_state;
1239 /* yy_try_NUL_trans - try to make a transition on the NUL character
1242 * next_state = yy_try_NUL_trans( current_state );
1245 #ifdef YY_USE_PROTOS
1246 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1248 static yy_state_type yy_try_NUL_trans( yy_current_state )
1249 yy_state_type yy_current_state;
1252 register int yy_is_jam;
1253 register char *yy_cp = yy_c_buf_p;
1255 register YY_CHAR yy_c = 1;
1256 if ( yy_accept[yy_current_state] )
1258 yy_last_accepting_state = yy_current_state;
1259 yy_last_accepting_cpos = yy_cp;
1261 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1263 yy_current_state = (int) yy_def[yy_current_state];
1264 if ( yy_current_state >= 61 )
1265 yy_c = yy_meta[(unsigned int) yy_c];
1267 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1268 yy_is_jam = (yy_current_state == 60);
1270 return yy_is_jam ? 0 : yy_current_state;
1275 #ifdef YY_USE_PROTOS
1276 static void yyunput( int c, register char *yy_bp )
1278 static void yyunput( c, yy_bp )
1280 register char *yy_bp;
1283 register char *yy_cp = yy_c_buf_p;
1285 /* undo effects of setting up yytext */
1286 *yy_cp = yy_hold_char;
1288 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1289 { /* need to shift things up to make room */
1290 /* +2 for EOB chars. */
1291 register int number_to_move = yy_n_chars + 2;
1292 register char *dest = &yy_current_buffer->yy_ch_buf[
1293 yy_current_buffer->yy_buf_size + 2];
1294 register char *source =
1295 &yy_current_buffer->yy_ch_buf[number_to_move];
1297 while ( source > yy_current_buffer->yy_ch_buf )
1298 *--dest = *--source;
1300 yy_cp += (int) (dest - source);
1301 yy_bp += (int) (dest - source);
1302 yy_current_buffer->yy_n_chars =
1303 yy_n_chars = yy_current_buffer->yy_buf_size;
1305 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1306 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1309 *--yy_cp = (char) c;
1313 yy_hold_char = *yy_cp;
1316 #endif /* ifndef YY_NO_UNPUT */
1320 static int yyinput()
1327 *yy_c_buf_p = yy_hold_char;
1329 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1331 /* yy_c_buf_p now points to the character we want to return.
1332 * If this occurs *before* the EOB characters, then it's a
1333 * valid NUL; if not, then we've hit the end of the buffer.
1335 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1336 /* This was really a NUL. */
1340 { /* need more input */
1341 int offset = yy_c_buf_p - yytext_ptr;
1344 switch ( yy_get_next_buffer() )
1346 case EOB_ACT_LAST_MATCH:
1347 /* This happens because yy_g_n_b()
1348 * sees that we've accumulated a
1349 * token and flags that we need to
1350 * try matching the token before
1351 * proceeding. But for input(),
1352 * there's no matching to consider.
1353 * So convert the EOB_ACT_LAST_MATCH
1354 * to EOB_ACT_END_OF_FILE.
1357 /* Reset buffer status. */
1362 case EOB_ACT_END_OF_FILE:
1367 if ( ! yy_did_buffer_switch_on_eof )
1376 case EOB_ACT_CONTINUE_SCAN:
1377 yy_c_buf_p = yytext_ptr + offset;
1383 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1384 *yy_c_buf_p = '\0'; /* preserve yytext */
1385 yy_hold_char = *++yy_c_buf_p;
1392 #ifdef YY_USE_PROTOS
1393 void yyrestart( FILE *input_file )
1395 void yyrestart( input_file )
1399 if ( ! yy_current_buffer )
1400 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1402 yy_init_buffer( yy_current_buffer, input_file );
1403 yy_load_buffer_state();
1407 #ifdef YY_USE_PROTOS
1408 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1410 void yy_switch_to_buffer( new_buffer )
1411 YY_BUFFER_STATE new_buffer;
1414 if ( yy_current_buffer == new_buffer )
1417 if ( yy_current_buffer )
1419 /* Flush out information for old buffer. */
1420 *yy_c_buf_p = yy_hold_char;
1421 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1422 yy_current_buffer->yy_n_chars = yy_n_chars;
1425 yy_current_buffer = new_buffer;
1426 yy_load_buffer_state();
1428 /* We don't actually know whether we did this switch during
1429 * EOF (yywrap()) processing, but the only time this flag
1430 * is looked at is after yywrap() is called, so it's safe
1431 * to go ahead and always set it.
1433 yy_did_buffer_switch_on_eof = 1;
1437 #ifdef YY_USE_PROTOS
1438 void yy_load_buffer_state( void )
1440 void yy_load_buffer_state()
1443 yy_n_chars = yy_current_buffer->yy_n_chars;
1444 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1445 yyin = yy_current_buffer->yy_input_file;
1446 yy_hold_char = *yy_c_buf_p;
1450 #ifdef YY_USE_PROTOS
1451 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1453 YY_BUFFER_STATE yy_create_buffer( file, size )
1460 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1462 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1464 b->yy_buf_size = size;
1466 /* yy_ch_buf has to be 2 characters longer than the size given because
1467 * we need to put in 2 end-of-buffer characters.
1469 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1470 if ( ! b->yy_ch_buf )
1471 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1473 b->yy_is_our_buffer = 1;
1475 yy_init_buffer( b, file );
1481 #ifdef YY_USE_PROTOS
1482 void yy_delete_buffer( YY_BUFFER_STATE b )
1484 void yy_delete_buffer( b )
1491 if ( b == yy_current_buffer )
1492 yy_current_buffer = (YY_BUFFER_STATE) 0;
1494 if ( b->yy_is_our_buffer )
1495 yy_flex_free( (void *) b->yy_ch_buf );
1497 yy_flex_free( (void *) b );
1504 #ifndef YY_ALWAYS_INTERACTIVE
1505 #ifndef YY_NEVER_INTERACTIVE
1506 extern int isatty YY_PROTO(( int ));
1511 #ifdef YY_USE_PROTOS
1512 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1514 void yy_init_buffer( b, file )
1521 yy_flush_buffer( b );
1523 b->yy_input_file = file;
1524 b->yy_fill_buffer = 1;
1526 #if YY_ALWAYS_INTERACTIVE
1527 b->yy_is_interactive = 1;
1529 #if YY_NEVER_INTERACTIVE
1530 b->yy_is_interactive = 0;
1532 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1538 #ifdef YY_USE_PROTOS
1539 void yy_flush_buffer( YY_BUFFER_STATE b )
1541 void yy_flush_buffer( b )
1551 /* We always need two end-of-buffer characters. The first causes
1552 * a transition to the end-of-buffer state. The second causes
1553 * a jam in that state.
1555 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1556 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1558 b->yy_buf_pos = &b->yy_ch_buf[0];
1561 b->yy_buffer_status = YY_BUFFER_NEW;
1563 if ( b == yy_current_buffer )
1564 yy_load_buffer_state();
1568 #ifndef YY_NO_SCAN_BUFFER
1569 #ifdef YY_USE_PROTOS
1570 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1572 YY_BUFFER_STATE yy_scan_buffer( base, size )
1580 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1581 base[size-1] != YY_END_OF_BUFFER_CHAR )
1582 /* They forgot to leave room for the EOB's. */
1585 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1587 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1589 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1590 b->yy_buf_pos = b->yy_ch_buf = base;
1591 b->yy_is_our_buffer = 0;
1592 b->yy_input_file = 0;
1593 b->yy_n_chars = b->yy_buf_size;
1594 b->yy_is_interactive = 0;
1596 b->yy_fill_buffer = 0;
1597 b->yy_buffer_status = YY_BUFFER_NEW;
1599 yy_switch_to_buffer( b );
1606 #ifndef YY_NO_SCAN_STRING
1607 #ifdef YY_USE_PROTOS
1608 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1610 YY_BUFFER_STATE yy_scan_string( yy_str )
1611 yyconst char *yy_str;
1615 for ( len = 0; yy_str[len]; ++len )
1618 return yy_scan_bytes( yy_str, len );
1623 #ifndef YY_NO_SCAN_BYTES
1624 #ifdef YY_USE_PROTOS
1625 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1627 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1628 yyconst char *bytes;
1637 /* Get memory for full buffer, including space for trailing EOB's. */
1639 buf = (char *) yy_flex_alloc( n );
1641 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1643 for ( i = 0; i < len; ++i )
1646 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1648 b = yy_scan_buffer( buf, n );
1650 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1652 /* It's okay to grow etc. this buffer, and we should throw it
1653 * away when we're done.
1655 b->yy_is_our_buffer = 1;
1662 #ifndef YY_NO_PUSH_STATE
1663 #ifdef YY_USE_PROTOS
1664 static void yy_push_state( int new_state )
1666 static void yy_push_state( new_state )
1670 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1674 yy_start_stack_depth += YY_START_STACK_INCR;
1675 new_size = yy_start_stack_depth * sizeof( int );
1677 if ( ! yy_start_stack )
1678 yy_start_stack = (int *) yy_flex_alloc( new_size );
1681 yy_start_stack = (int *) yy_flex_realloc(
1682 (void *) yy_start_stack, new_size );
1684 if ( ! yy_start_stack )
1686 "out of memory expanding start-condition stack" );
1689 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1696 #ifndef YY_NO_POP_STATE
1697 static void yy_pop_state()
1699 if ( --yy_start_stack_ptr < 0 )
1700 YY_FATAL_ERROR( "start-condition stack underflow" );
1702 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1707 #ifndef YY_NO_TOP_STATE
1708 static int yy_top_state()
1710 return yy_start_stack[yy_start_stack_ptr - 1];
1714 #ifndef YY_EXIT_FAILURE
1715 #define YY_EXIT_FAILURE 2
1718 #ifdef YY_USE_PROTOS
1719 static void yy_fatal_error( yyconst char msg[] )
1721 static void yy_fatal_error( msg )
1725 (void) fprintf( stderr, "%s\n", msg );
1726 exit( YY_EXIT_FAILURE );
1731 /* Redefine yyless() so it works in section 3 code. */
1737 /* Undo effects of setting up yytext. */ \
1738 yytext[yyleng] = yy_hold_char; \
1739 yy_c_buf_p = yytext + n; \
1740 yy_hold_char = *yy_c_buf_p; \
1741 *yy_c_buf_p = '\0'; \
1747 /* Internal utility routines. */
1750 #ifdef YY_USE_PROTOS
1751 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1753 static void yy_flex_strncpy( s1, s2, n )
1760 for ( i = 0; i < n; ++i )
1765 #ifdef YY_NEED_STRLEN
1766 #ifdef YY_USE_PROTOS
1767 static int yy_flex_strlen( yyconst char *s )
1769 static int yy_flex_strlen( s )
1774 for ( n = 0; s[n]; ++n )
1782 #ifdef YY_USE_PROTOS
1783 static void *yy_flex_alloc( yy_size_t size )
1785 static void *yy_flex_alloc( size )
1789 return (void *) malloc( size );
1792 #ifdef YY_USE_PROTOS
1793 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1795 static void *yy_flex_realloc( ptr, size )
1800 /* The cast to (char *) in the following accommodates both
1801 * implementations that use char* generic pointers, and those
1802 * that use void* generic pointers. It works with the latter
1803 * because both ANSI C and C++ allow castless assignment from
1804 * any pointer type to void*, and deal with argument conversions
1805 * as though doing an assignment.
1807 return (void *) realloc( (char *) ptr, size );
1810 #ifdef YY_USE_PROTOS
1811 static void yy_flex_free( void *ptr )
1813 static void yy_flex_free( ptr )
1827 #line 174 "gras/DataDesc/ddt_parse.yy.l"
1829 /* {space}+ { return(TOKEN_SPACE);} */
1831 void gras_ddt_parse_dump(void) {
1832 switch(gras_ddt_parse_tok_num) {
1833 case GRAS_DDT_PARSE_TOKEN_LA : {printf("TOKEN_LA ");break;}
1834 case GRAS_DDT_PARSE_TOKEN_RA : {printf("TOKEN_RA ");break;}
1835 case GRAS_DDT_PARSE_TOKEN_WORD : {printf("TOKEN_WORD ");break;}
1836 // case GRAS_DDT_PARSE_TOKEN_SPACE : {printf("TOKEN_SPACE ");break;}
1837 // case GRAS_DDT_PARSE_TOKEN_COMMENT : {printf("TOKEN_COMMENT ");break;}
1838 case GRAS_DDT_PARSE_TOKEN_NEWLINE : {printf("TOKEN_NEWLINE\n");return;}
1839 case GRAS_DDT_PARSE_TOKEN_EMPTY : {printf("TOKEN_EMPTY\n");return;}
1840 default : {printf("Unknown token %d\n", gras_ddt_parse_tok_num);return;}
1842 printf("-->%s<-- [line %d, pos %d]\n",yytext,gras_ddt_parse_line_pos,gras_ddt_parse_char_pos);
1846 int gras_ddt_parse_lex_n_dump(void) {
1847 gras_ddt_parse_tok_num = gras_ddt_parse_lex();
1848 // gras_ddt_parse_char_pos += strlen(yytext);
1849 return(gras_ddt_parse_tok_num);
1852 void gras_ddt_parse_pointer_init(const char *file) {
1853 file_to_parse = fopen(file,"r");
1854 input_buffer = yy_create_buffer( file_to_parse, 10 );
1855 yy_switch_to_buffer(input_buffer);
1857 gras_ddt_parse_line_pos = 1;
1858 gras_ddt_parse_char_pos = 0;
1859 gras_ddt_parse_col_pos = 0;
1860 gras_ddt_parse_tok_num = 0;
1863 void gras_ddt_parse_pointer_close(void) {
1864 yy_delete_buffer(input_buffer);
1865 fclose(file_to_parse);
1867 gras_ddt_parse_line_pos = 1;
1868 gras_ddt_parse_char_pos = 0;
1869 gras_ddt_parse_tok_num = 0;
1873 void gras_ddt_parse_pointer_string_init(const char *string_to_parse) {
1874 input_buffer = yy_scan_string (string_to_parse);
1875 definition = string_to_parse;
1876 yy_switch_to_buffer(input_buffer);
1878 gras_ddt_parse_line_pos = 1;
1879 gras_ddt_parse_char_pos = 0;
1880 gras_ddt_parse_tok_num = 0;
1883 void gras_ddt_parse_pointer_string_close(void) {
1884 yy_delete_buffer(input_buffer);
1886 gras_ddt_parse_line_pos = 1;
1887 gras_ddt_parse_char_pos = 0;
1888 gras_ddt_parse_tok_num = 0;