1 #line 2 "automaton_parse.yy.c"
3 #line 4 "automaton_parse.yy.c"
5 #define YY_INT_ALIGNED short int
7 /* A lexical scanner generated by flex */
9 #define yy_create_buffer xbt_automaton_parse__create_buffer
10 #define yy_delete_buffer xbt_automaton_parse__delete_buffer
11 #define yy_flex_debug xbt_automaton_parse__flex_debug
12 #define yy_init_buffer xbt_automaton_parse__init_buffer
13 #define yy_flush_buffer xbt_automaton_parse__flush_buffer
14 #define yy_load_buffer_state xbt_automaton_parse__load_buffer_state
15 #define yy_switch_to_buffer xbt_automaton_parse__switch_to_buffer
16 #define yyin xbt_automaton_parse_in
17 #define yyleng xbt_automaton_parse_leng
18 #define yylex xbt_automaton_parse_lex
19 #define yylineno xbt_automaton_parse_lineno
20 #define yyout xbt_automaton_parse_out
21 #define yyrestart xbt_automaton_parse_restart
22 #define yytext xbt_automaton_parse_text
23 #define yywrap xbt_automaton_parse_wrap
24 #define yyalloc xbt_automaton_parse_alloc
25 #define yyrealloc xbt_automaton_parse_realloc
26 #define yyfree xbt_automaton_parse_free
29 #define YY_FLEX_MAJOR_VERSION 2
30 #define YY_FLEX_MINOR_VERSION 5
31 #define YY_FLEX_SUBMINOR_VERSION 35
32 #if YY_FLEX_SUBMINOR_VERSION > 0
36 /* First, we deal with platform-specific or compiler-specific issues. */
38 /* begin standard C headers. */
44 /* end standard C headers. */
46 /* flex integer type definitions */
51 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
53 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
55 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
56 * if you want the limit (max/min) macros for int types.
58 #ifndef __STDC_LIMIT_MACROS
59 #define __STDC_LIMIT_MACROS 1
63 typedef int8_t flex_int8_t;
64 typedef uint8_t flex_uint8_t;
65 typedef int16_t flex_int16_t;
66 typedef uint16_t flex_uint16_t;
67 typedef int32_t flex_int32_t;
68 typedef uint32_t flex_uint32_t;
70 typedef signed char flex_int8_t;
71 typedef short int flex_int16_t;
72 typedef int flex_int32_t;
73 typedef unsigned char flex_uint8_t;
74 typedef unsigned short int flex_uint16_t;
75 typedef unsigned int flex_uint32_t;
77 /* Limits of integral types. */
79 #define INT8_MIN (-128)
82 #define INT16_MIN (-32767-1)
85 #define INT32_MIN (-2147483647-1)
88 #define INT8_MAX (127)
91 #define INT16_MAX (32767)
94 #define INT32_MAX (2147483647)
97 #define UINT8_MAX (255U)
100 #define UINT16_MAX (65535U)
103 #define UINT32_MAX (4294967295U)
108 #endif /* ! FLEXINT_H */
112 /* The "const" storage-class-modifier is valid. */
115 #else /* ! __cplusplus */
117 /* C99 requires __STDC__ to be defined as 1. */
118 #if defined (__STDC__)
122 #endif /* defined (__STDC__) */
123 #endif /* ! __cplusplus */
126 #define yyconst const
131 /* Returned upon end-of-file. */
134 /* Promotes a possibly negative, possibly signed char to an unsigned
135 * integer for use as an array index. If the signed char is negative,
136 * we want to instead treat it as an 8-bit unsigned char, hence the
139 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
141 /* Enter a start condition. This macro really ought to take a parameter,
142 * but we do it the disgusting crufty way forced on us by the ()-less
143 * definition of BEGIN.
145 #define BEGIN (yy_start) = 1 + 2 *
147 /* Translate the current start state into a value that can be later handed
148 * to BEGIN to return to the state. The YYSTATE alias is for lex
151 #define YY_START (((yy_start) - 1) / 2)
152 #define YYSTATE YY_START
154 /* Action number for EOF rule of a given start state. */
155 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
157 /* Special action meaning "start processing a new file". */
158 #define YY_NEW_FILE xbt_automaton_parse_restart(xbt_automaton_parse_in )
160 #define YY_END_OF_BUFFER_CHAR 0
162 /* Size of default input buffer. */
165 /* On IA-64, the buffer size is 16k, not 8k.
166 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
167 * Ditto for the __ia64__ case accordingly.
169 #define YY_BUF_SIZE 32768
171 #define YY_BUF_SIZE 16384
172 #endif /* __ia64__ */
175 /* The state buf must be large enough to hold one state per character in the main buffer.
177 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
179 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
180 #define YY_TYPEDEF_YY_BUFFER_STATE
181 typedef struct yy_buffer_state *YY_BUFFER_STATE;
184 extern int xbt_automaton_parse_leng;
186 extern FILE *xbt_automaton_parse_in, *xbt_automaton_parse_out;
188 #define EOB_ACT_CONTINUE_SCAN 0
189 #define EOB_ACT_END_OF_FILE 1
190 #define EOB_ACT_LAST_MATCH 2
192 #define YY_LESS_LINENO(n)
194 /* Return all but the first "n" matched characters back to the input stream. */
198 /* Undo effects of setting up xbt_automaton_parse_text. */ \
199 int yyless_macro_arg = (n); \
200 YY_LESS_LINENO(yyless_macro_arg);\
201 *yy_cp = (yy_hold_char); \
202 YY_RESTORE_YY_MORE_OFFSET \
203 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
204 YY_DO_BEFORE_ACTION; /* set up xbt_automaton_parse_text again */ \
208 #define unput(c) yyunput( c, (yytext_ptr) )
210 #ifndef YY_TYPEDEF_YY_SIZE_T
211 #define YY_TYPEDEF_YY_SIZE_T
212 typedef size_t yy_size_t;
215 #ifndef YY_STRUCT_YY_BUFFER_STATE
216 #define YY_STRUCT_YY_BUFFER_STATE
217 struct yy_buffer_state
221 char *yy_ch_buf; /* input buffer */
222 char *yy_buf_pos; /* current position in input buffer */
224 /* Size of input buffer in bytes, not including room for EOB
227 yy_size_t yy_buf_size;
229 /* Number of characters read into yy_ch_buf, not including EOB
234 /* Whether we "own" the buffer - i.e., we know we created it,
235 * and can realloc() it to grow it, and should free() it to
238 int yy_is_our_buffer;
240 /* Whether this is an "interactive" input source; if so, and
241 * if we're using stdio for input, then we want to use getc()
242 * instead of fread(), to make sure we stop fetching input after
245 int yy_is_interactive;
247 /* Whether we're considered to be at the beginning of a line.
248 * If so, '^' rules will be active on the next match, otherwise
253 int yy_bs_lineno; /**< The line count. */
254 int yy_bs_column; /**< The column count. */
256 /* Whether to try to fill the input buffer when we reach the
261 int yy_buffer_status;
263 #define YY_BUFFER_NEW 0
264 #define YY_BUFFER_NORMAL 1
265 /* When an EOF's been seen but there's still some text to process
266 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
267 * shouldn't try reading from the input source any more. We might
268 * still have a bunch of tokens to match, though, because of
269 * possible backing-up.
271 * When we actually see the EOF, we change the status to "new"
272 * (via xbt_automaton_parse_restart()), so that the user can continue scanning by
273 * just pointing xbt_automaton_parse_in at a new input file.
275 #define YY_BUFFER_EOF_PENDING 2
278 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
280 /* Stack of input buffers. */
281 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
282 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
283 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
285 /* We provide macros for accessing buffer states in case in the
286 * future we want to put the buffer states in a more general
289 * Returns the top of the stack, or NULL.
291 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
292 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
295 /* Same as previous macro, but useful when we know that the buffer stack is not
296 * NULL or when we need an lvalue. For internal use only.
298 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
300 /* yy_hold_char holds the character lost when xbt_automaton_parse_text is formed. */
301 static char yy_hold_char;
302 static int yy_n_chars; /* number of characters read into yy_ch_buf */
303 int xbt_automaton_parse_leng;
305 /* Points to current character in buffer. */
306 static char *yy_c_buf_p = (char *) 0;
307 static int yy_init = 0; /* whether we need to initialize */
308 static int yy_start = 0; /* start state number */
310 /* Flag which is used to allow xbt_automaton_parse_wrap()'s to do buffer switches
311 * instead of setting up a fresh xbt_automaton_parse_in. A bit of a hack ...
313 static int yy_did_buffer_switch_on_eof;
315 void xbt_automaton_parse_restart (FILE *input_file );
316 void xbt_automaton_parse__switch_to_buffer (YY_BUFFER_STATE new_buffer );
317 YY_BUFFER_STATE xbt_automaton_parse__create_buffer (FILE *file,int size );
318 void xbt_automaton_parse__delete_buffer (YY_BUFFER_STATE b );
319 void xbt_automaton_parse__flush_buffer (YY_BUFFER_STATE b );
320 void xbt_automaton_parse_push_buffer_state (YY_BUFFER_STATE new_buffer );
321 void xbt_automaton_parse_pop_buffer_state (void );
323 static void xbt_automaton_parse_ensure_buffer_stack (void );
324 static void xbt_automaton_parse__load_buffer_state (void );
325 static void xbt_automaton_parse__init_buffer (YY_BUFFER_STATE b,FILE *file );
327 #define YY_FLUSH_BUFFER xbt_automaton_parse__flush_buffer(YY_CURRENT_BUFFER )
329 YY_BUFFER_STATE xbt_automaton_parse__scan_buffer (char *base,yy_size_t size );
330 YY_BUFFER_STATE xbt_automaton_parse__scan_string (yyconst char *yy_str );
331 YY_BUFFER_STATE xbt_automaton_parse__scan_bytes (yyconst char *bytes,int len );
333 void *xbt_automaton_parse_alloc (yy_size_t );
334 void *xbt_automaton_parse_realloc (void *,yy_size_t );
335 void xbt_automaton_parse_free (void * );
337 #define yy_new_buffer xbt_automaton_parse__create_buffer
339 #define yy_set_interactive(is_interactive) \
341 if ( ! YY_CURRENT_BUFFER ){ \
342 xbt_automaton_parse_ensure_buffer_stack (); \
343 YY_CURRENT_BUFFER_LVALUE = \
344 xbt_automaton_parse__create_buffer(xbt_automaton_parse_in,YY_BUF_SIZE ); \
346 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
349 #define yy_set_bol(at_bol) \
351 if ( ! YY_CURRENT_BUFFER ){\
352 xbt_automaton_parse_ensure_buffer_stack (); \
353 YY_CURRENT_BUFFER_LVALUE = \
354 xbt_automaton_parse__create_buffer(xbt_automaton_parse_in,YY_BUF_SIZE ); \
356 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
359 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
361 /* Begin user sect3 */
363 #define xbt_automaton_parse_wrap(n) 1
364 #define YY_SKIP_YYWRAP
366 typedef unsigned char YY_CHAR;
368 FILE *xbt_automaton_parse_in = (FILE *) 0, *xbt_automaton_parse_out = (FILE *) 0;
370 typedef int yy_state_type;
372 extern int xbt_automaton_parse_lineno;
374 int xbt_automaton_parse_lineno = 1;
376 extern char *xbt_automaton_parse_text;
377 #define yytext_ptr xbt_automaton_parse_text
379 static yy_state_type yy_get_previous_state (void );
380 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
381 static int yy_get_next_buffer (void );
382 static void yy_fatal_error (yyconst char msg[] );
384 /* Done after the current pattern has been matched and before the
385 * corresponding action - sets up xbt_automaton_parse_text.
387 #define YY_DO_BEFORE_ACTION \
388 (yytext_ptr) = yy_bp; \
389 xbt_automaton_parse_leng = (size_t) (yy_cp - yy_bp); \
390 (yy_hold_char) = *yy_cp; \
392 (yy_c_buf_p) = yy_cp;
394 #define YY_NUM_RULES 25
395 #define YY_END_OF_BUFFER 26
396 /* This struct is not used in this scanner,
397 but its presence is necessary. */
400 flex_int32_t yy_verify;
403 static yyconst flex_int16_t yy_accept[54] =
405 0, 0, 26, 24, 18, 23, 8, 24, 24, 9,
406 10, 24, 24, 20, 14, 12, 13, 22, 22, 22,
407 22, 22, 15, 24, 16, 18, 0, 0, 21, 0,
408 6, 4, 0, 0, 20, 11, 22, 3, 22, 2,
409 22, 7, 0, 0, 0, 19, 22, 22, 17, 5,
413 static yyconst flex_int32_t yy_ec[256] =
415 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
416 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
417 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
418 1, 4, 5, 6, 1, 1, 1, 7, 1, 8,
419 9, 10, 1, 1, 11, 12, 13, 14, 15, 14,
420 14, 14, 14, 14, 14, 14, 14, 16, 17, 1,
421 1, 18, 1, 1, 19, 19, 19, 19, 19, 19,
422 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
423 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
424 1, 20, 1, 1, 21, 1, 19, 19, 19, 19,
426 22, 23, 24, 19, 25, 19, 19, 19, 19, 26,
427 27, 19, 19, 28, 19, 29, 19, 30, 19, 19,
428 19, 19, 31, 32, 33, 1, 1, 1, 1, 1,
429 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
430 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
431 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
432 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
433 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
434 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
435 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
437 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
438 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
439 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
440 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
441 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
445 static yyconst flex_int32_t yy_meta[34] =
447 1, 1, 2, 2, 1, 2, 1, 1, 1, 1,
448 1, 1, 3, 4, 4, 1, 1, 1, 4, 2,
449 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
453 static yyconst flex_int16_t yy_base[57] =
455 0, 0, 89, 90, 32, 90, 90, 34, 81, 90,
456 90, 69, 76, 27, 31, 69, 90, 0, 59, 56,
457 58, 55, 90, 42, 90, 45, 47, 0, 0, 0,
458 90, 90, 52, 43, 49, 90, 0, 0, 44, 0,
459 42, 90, 56, 65, 52, 56, 25, 26, 90, 0,
460 16, 0, 90, 74, 31, 78
463 static yyconst flex_int16_t yy_def[57] =
465 53, 1, 53, 53, 53, 53, 53, 54, 53, 53,
466 53, 53, 53, 53, 53, 53, 53, 55, 55, 55,
467 55, 55, 53, 53, 53, 53, 54, 27, 27, 27,
468 53, 53, 56, 53, 53, 53, 55, 55, 55, 55,
469 55, 53, 56, 56, 53, 53, 55, 55, 53, 55,
470 55, 55, 0, 53, 53, 53
473 static yyconst flex_int16_t yy_nxt[124] =
475 4, 5, 6, 5, 7, 8, 9, 10, 11, 4,
476 12, 4, 13, 14, 15, 16, 17, 4, 18, 4,
477 4, 18, 19, 20, 21, 22, 18, 18, 18, 18,
478 23, 24, 25, 26, 37, 26, 27, 28, 34, 29,
479 35, 35, 34, 52, 35, 35, 26, 51, 26, 27,
480 28, 50, 29, 27, 44, 44, 46, 46, 44, 44,
481 34, 45, 35, 35, 49, 45, 27, 44, 44, 46,
482 46, 48, 47, 42, 45, 30, 41, 30, 43, 43,
483 40, 43, 39, 38, 36, 33, 32, 31, 53, 3,
484 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
486 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
487 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
491 static yyconst flex_int16_t yy_chk[124] =
493 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
494 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
495 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
496 1, 1, 1, 5, 55, 5, 8, 8, 14, 8,
497 14, 14, 15, 51, 15, 15, 26, 48, 26, 27,
498 27, 47, 27, 8, 33, 33, 34, 34, 43, 43,
499 35, 33, 35, 35, 45, 43, 27, 44, 44, 46,
500 46, 41, 39, 24, 44, 54, 22, 54, 56, 56,
501 21, 56, 20, 19, 16, 13, 12, 9, 3, 53,
502 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
504 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
505 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
509 static yy_state_type yy_last_accepting_state;
510 static char *yy_last_accepting_cpos;
512 extern int xbt_automaton_parse__flex_debug;
513 int xbt_automaton_parse__flex_debug = 0;
515 /* The intent behind this definition is that it'll catch
516 * any uses of REJECT which flex missed.
518 #define REJECT reject_used_but_not_detected
519 #define yymore() yymore_used_but_not_detected
520 #define YY_MORE_ADJ 0
521 #define YY_RESTORE_YY_MORE_OFFSET
522 char *xbt_automaton_parse_text;
523 #line 1 "parserPromela.lex"
524 #line 4 "parserPromela.lex"
530 extern YYSTYPE yylval;
532 #line 533 "automaton_parse.yy.c"
536 #ifndef YY_NO_UNISTD_H
537 /* Special case for "unistd.h", since it is non-ANSI. We include it way
538 * down here because we want the user's section 1 to have been scanned first.
539 * The user has a chance to override it with an option.
544 #ifndef YY_EXTRA_TYPE
545 #define YY_EXTRA_TYPE void *
548 static int yy_init_globals (void );
550 /* Accessor methods to globals.
551 These are made visible to non-reentrant scanners for convenience. */
553 int xbt_automaton_parse_lex_destroy (void );
555 int xbt_automaton_parse_get_debug (void );
557 void xbt_automaton_parse_set_debug (int debug_flag );
559 YY_EXTRA_TYPE xbt_automaton_parse_get_extra (void );
561 void xbt_automaton_parse_set_extra (YY_EXTRA_TYPE user_defined );
563 FILE *xbt_automaton_parse_get_in (void );
565 void xbt_automaton_parse_set_in (FILE * in_str );
567 FILE *xbt_automaton_parse_get_out (void );
569 void xbt_automaton_parse_set_out (FILE * out_str );
571 int xbt_automaton_parse_get_leng (void );
573 char *xbt_automaton_parse_get_text (void );
575 int xbt_automaton_parse_get_lineno (void );
577 void xbt_automaton_parse_set_lineno (int line_number );
579 /* Macros after this point can all be overridden by user definitions in
583 #ifndef YY_SKIP_YYWRAP
585 extern "C" int xbt_automaton_parse_wrap (void );
587 extern int xbt_automaton_parse_wrap (void );
591 static void yyunput (int c,char *buf_ptr );
594 static void yy_flex_strncpy (char *,yyconst char *,int );
597 #ifdef YY_NEED_STRLEN
598 static int yy_flex_strlen (yyconst char * );
604 static int yyinput (void );
606 static int input (void );
611 /* Amount of stuff to slurp up with each read. */
612 #ifndef YY_READ_BUF_SIZE
614 /* On IA-64, the buffer size is 16k, not 8k */
615 #define YY_READ_BUF_SIZE 16384
617 #define YY_READ_BUF_SIZE 8192
618 #endif /* __ia64__ */
621 /* Copy whatever the last rule matched to the standard output. */
623 /* This used to be an fputs(), but since the string might contain NUL's,
624 * we now use fwrite().
626 #define ECHO do { if (fwrite( xbt_automaton_parse_text, xbt_automaton_parse_leng, 1, xbt_automaton_parse_out )) {} } while (0)
629 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
630 * is returned in "result".
633 #define YY_INPUT(buf,result,max_size) \
634 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
638 for ( n = 0; n < max_size && \
639 (c = getc( xbt_automaton_parse_in )) != EOF && c != '\n'; ++n ) \
642 buf[n++] = (char) c; \
643 if ( c == EOF && ferror( xbt_automaton_parse_in ) ) \
644 YY_FATAL_ERROR( "input in flex scanner failed" ); \
650 while ( (result = fread(buf, 1, max_size, xbt_automaton_parse_in))==0 && ferror(xbt_automaton_parse_in)) \
652 if( errno != EINTR) \
654 YY_FATAL_ERROR( "input in flex scanner failed" ); \
658 clearerr(xbt_automaton_parse_in); \
665 /* No semi-colon after return; correct usage is to write "yyterminate();" -
666 * we don't want an extra ';' after the "return" because that will cause
667 * some compilers to complain about unreachable statements.
670 #define yyterminate() return YY_NULL
673 /* Number of entries by which start-condition stack grows. */
674 #ifndef YY_START_STACK_INCR
675 #define YY_START_STACK_INCR 25
678 /* Report a fatal error. */
679 #ifndef YY_FATAL_ERROR
680 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
683 /* end tables serialization structures and prototypes */
685 /* Default declaration of generated scanner - a define so the user can
686 * easily add parameters.
689 #define YY_DECL_IS_OURS 1
691 extern int xbt_automaton_parse_lex (void);
693 #define YY_DECL int xbt_automaton_parse_lex (void)
694 #endif /* !YY_DECL */
696 /* Code executed at the beginning of each rule, after xbt_automaton_parse_text and xbt_automaton_parse_leng
699 #ifndef YY_USER_ACTION
700 #define YY_USER_ACTION
703 /* Code executed at the end of each rule. */
705 #define YY_BREAK break;
708 #define YY_RULE_SETUP \
711 /** The main scanner function which does all the work.
715 register yy_state_type yy_current_state;
716 register char *yy_cp, *yy_bp;
719 #line 28 "parserPromela.lex"
722 #line 723 "automaton_parse.yy.c"
733 (yy_start) = 1; /* first start state */
735 if ( ! xbt_automaton_parse_in )
736 xbt_automaton_parse_in = stdin;
738 if ( ! xbt_automaton_parse_out )
739 xbt_automaton_parse_out = stdout;
741 if ( ! YY_CURRENT_BUFFER ) {
742 xbt_automaton_parse_ensure_buffer_stack ();
743 YY_CURRENT_BUFFER_LVALUE =
744 xbt_automaton_parse__create_buffer(xbt_automaton_parse_in,YY_BUF_SIZE );
747 xbt_automaton_parse__load_buffer_state( );
750 while ( 1 ) /* loops until end-of-file is reached */
752 yy_cp = (yy_c_buf_p);
754 /* Support of xbt_automaton_parse_text. */
755 *yy_cp = (yy_hold_char);
757 /* yy_bp points to the position in yy_ch_buf of the start of
762 yy_current_state = (yy_start);
766 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
767 if ( yy_accept[yy_current_state] )
769 (yy_last_accepting_state) = yy_current_state;
770 (yy_last_accepting_cpos) = yy_cp;
772 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
774 yy_current_state = (int) yy_def[yy_current_state];
775 if ( yy_current_state >= 54 )
776 yy_c = yy_meta[(unsigned int) yy_c];
778 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
781 while ( yy_base[yy_current_state] != 90 );
784 yy_act = yy_accept[yy_current_state];
786 { /* have to back up */
787 yy_cp = (yy_last_accepting_cpos);
788 yy_current_state = (yy_last_accepting_state);
789 yy_act = yy_accept[yy_current_state];
794 do_action: /* This label is used only to access EOF actions. */
797 { /* beginning of action switch */
798 case 0: /* must back up */
799 /* undo the effects of YY_DO_BEFORE_ACTION */
800 *yy_cp = (yy_hold_char);
801 yy_cp = (yy_last_accepting_cpos);
802 yy_current_state = (yy_last_accepting_state);
807 #line 30 "parserPromela.lex"
808 { printf("%s", xbt_automaton_parse_text); return (NEVER); }
812 #line 31 "parserPromela.lex"
813 { printf("%s", xbt_automaton_parse_text); return (IF); }
817 #line 32 "parserPromela.lex"
818 { printf("%s", xbt_automaton_parse_text);
823 #line 34 "parserPromela.lex"
824 { printf("%s", xbt_automaton_parse_text); return (IMPLIES); }
828 #line 35 "parserPromela.lex"
829 { printf("%s", xbt_automaton_parse_text); return (GOTO); }
833 #line 36 "parserPromela.lex"
834 { printf("%s", xbt_automaton_parse_text); return (AND); }
838 #line 37 "parserPromela.lex"
839 { printf("%s", xbt_automaton_parse_text); return (OR); }
843 #line 38 "parserPromela.lex"
844 { printf("%s", xbt_automaton_parse_text); return (NOT); }
848 #line 39 "parserPromela.lex"
849 { printf("%s", xbt_automaton_parse_text); return (LEFT_PAR); }
853 #line 40 "parserPromela.lex"
854 { printf("%s", xbt_automaton_parse_text); return (RIGHT_PAR); }
858 #line 41 "parserPromela.lex"
859 { printf("%s", xbt_automaton_parse_text); return (CASE); }
863 #line 42 "parserPromela.lex"
864 { printf("%s", xbt_automaton_parse_text); return (COLON); }
868 #line 43 "parserPromela.lex"
869 { printf("%s", xbt_automaton_parse_text); return (SEMI_COLON); }
873 #line 44 "parserPromela.lex"
874 { printf("%s", xbt_automaton_parse_text); return (CASE_TRUE); }
878 #line 45 "parserPromela.lex"
879 { printf("%s", xbt_automaton_parse_text); return (LEFT_BRACE); }
883 #line 46 "parserPromela.lex"
884 { printf("%s", xbt_automaton_parse_text); return (RIGHT_BRACE); }
887 /* rule 17 can match eol */
889 #line 49 "parserPromela.lex"
894 #line 51 "parserPromela.lex"
895 { printf("%s",xbt_automaton_parse_text); }
899 #line 54 "parserPromela.lex"
900 { printf("%s",xbt_automaton_parse_text);
901 sscanf(xbt_automaton_parse_text,"%lf",&yylval.real);
902 return (LITT_REEL); }
906 #line 58 "parserPromela.lex"
907 { printf("%s",xbt_automaton_parse_text);
908 sscanf(xbt_automaton_parse_text,"%d",&yylval.integer);
912 /* rule 21 can match eol */
914 #line 62 "parserPromela.lex"
915 { printf("%s",xbt_automaton_parse_text);
916 yylval.string=(char *)malloc(strlen(xbt_automaton_parse_text)+1);
917 sscanf(xbt_automaton_parse_text,"%s",yylval.string);
918 return (LITT_CHAINE); }
922 #line 67 "parserPromela.lex"
923 { printf("%s",xbt_automaton_parse_text);
924 yylval.string=(char *)malloc(strlen(xbt_automaton_parse_text)+1);
925 sscanf(xbt_automaton_parse_text,"%s",yylval.string);
929 /* rule 23 can match eol */
931 #line 72 "parserPromela.lex"
936 #line 74 "parserPromela.lex"
937 { printf("caractère inconnu\n"); }
941 #line 76 "parserPromela.lex"
944 #line 945 "automaton_parse.yy.c"
945 case YY_STATE_EOF(INITIAL):
948 case YY_END_OF_BUFFER:
950 /* Amount of text matched not including the EOB char. */
951 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
953 /* Undo the effects of YY_DO_BEFORE_ACTION. */
954 *yy_cp = (yy_hold_char);
955 YY_RESTORE_YY_MORE_OFFSET
957 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
959 /* We're scanning a new file or input source. It's
960 * possible that this happened because the user
961 * just pointed xbt_automaton_parse_in at a new source and called
962 * xbt_automaton_parse_lex(). If so, then we have to assure
963 * consistency between YY_CURRENT_BUFFER and our
964 * globals. Here is the right place to do so, because
965 * this is the first action (other than possibly a
966 * back-up) that will match for the new input source.
968 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
969 YY_CURRENT_BUFFER_LVALUE->yy_input_file = xbt_automaton_parse_in;
970 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
973 /* Note that here we test for yy_c_buf_p "<=" to the position
974 * of the first EOB in the buffer, since yy_c_buf_p will
975 * already have been incremented past the NUL character
976 * (since all states make transitions on EOB to the
977 * end-of-buffer state). Contrast this with the test
980 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
981 { /* This was really a NUL. */
982 yy_state_type yy_next_state;
984 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
986 yy_current_state = yy_get_previous_state( );
988 /* Okay, we're now positioned to make the NUL
989 * transition. We couldn't have
990 * yy_get_previous_state() go ahead and do it
991 * for us because it doesn't know how to deal
992 * with the possibility of jamming (and we don't
993 * want to build jamming into it because then it
994 * will run more slowly).
997 yy_next_state = yy_try_NUL_trans( yy_current_state );
999 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1001 if ( yy_next_state )
1003 /* Consume the NUL. */
1004 yy_cp = ++(yy_c_buf_p);
1005 yy_current_state = yy_next_state;
1011 yy_cp = (yy_c_buf_p);
1012 goto yy_find_action;
1016 else switch ( yy_get_next_buffer( ) )
1018 case EOB_ACT_END_OF_FILE:
1020 (yy_did_buffer_switch_on_eof) = 0;
1022 if ( xbt_automaton_parse_wrap( ) )
1024 /* Note: because we've taken care in
1025 * yy_get_next_buffer() to have set up
1026 * xbt_automaton_parse_text, we can now set up
1027 * yy_c_buf_p so that if some total
1028 * hoser (like flex itself) wants to
1029 * call the scanner after we return the
1030 * YY_NULL, it'll still work - another
1031 * YY_NULL will get returned.
1033 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1035 yy_act = YY_STATE_EOF(YY_START);
1041 if ( ! (yy_did_buffer_switch_on_eof) )
1047 case EOB_ACT_CONTINUE_SCAN:
1049 (yytext_ptr) + yy_amount_of_matched_text;
1051 yy_current_state = yy_get_previous_state( );
1053 yy_cp = (yy_c_buf_p);
1054 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1057 case EOB_ACT_LAST_MATCH:
1059 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1061 yy_current_state = yy_get_previous_state( );
1063 yy_cp = (yy_c_buf_p);
1064 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1065 goto yy_find_action;
1072 "fatal flex scanner internal error--no action found" );
1073 } /* end of action switch */
1074 } /* end of scanning one token */
1075 } /* end of xbt_automaton_parse_lex */
1077 /* yy_get_next_buffer - try to read in a new buffer
1079 * Returns a code representing an action:
1080 * EOB_ACT_LAST_MATCH -
1081 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1082 * EOB_ACT_END_OF_FILE - end of file
1084 static int yy_get_next_buffer (void)
1086 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1087 register char *source = (yytext_ptr);
1088 register int number_to_move, i;
1091 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1093 "fatal flex scanner internal error--end of buffer missed" );
1095 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1096 { /* Don't try to fill the buffer, so this is an EOF. */
1097 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1099 /* We matched a single character, the EOB, so
1100 * treat this as a final EOF.
1102 return EOB_ACT_END_OF_FILE;
1107 /* We matched some text prior to the EOB, first
1110 return EOB_ACT_LAST_MATCH;
1114 /* Try to read more data. */
1116 /* First move last chars to start of buffer. */
1117 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1119 for ( i = 0; i < number_to_move; ++i )
1120 *(dest++) = *(source++);
1122 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1123 /* don't do the read, it's not guaranteed to return an EOF,
1126 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1131 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1133 while ( num_to_read <= 0 )
1134 { /* Not enough room in the buffer - grow it. */
1136 /* just a shorter name for the current buffer */
1137 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1139 int yy_c_buf_p_offset =
1140 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1142 if ( b->yy_is_our_buffer )
1144 int new_size = b->yy_buf_size * 2;
1146 if ( new_size <= 0 )
1147 b->yy_buf_size += b->yy_buf_size / 8;
1149 b->yy_buf_size *= 2;
1151 b->yy_ch_buf = (char *)
1152 /* Include room in for 2 EOB chars. */
1153 xbt_automaton_parse_realloc((void *) b->yy_ch_buf,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_LVALUE->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_LVALUE->yy_ch_buf[number_to_move]),
1175 (yy_n_chars), (size_t) num_to_read );
1177 YY_CURRENT_BUFFER_LVALUE->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;
1185 xbt_automaton_parse_restart(xbt_automaton_parse_in );
1190 ret_val = EOB_ACT_LAST_MATCH;
1191 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1192 YY_BUFFER_EOF_PENDING;
1197 ret_val = EOB_ACT_CONTINUE_SCAN;
1199 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1200 /* Extend the array by 50%, plus the number we really need. */
1201 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1202 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) xbt_automaton_parse_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1203 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1204 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1207 (yy_n_chars) += number_to_move;
1208 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1209 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1211 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1216 /* yy_get_previous_state - get the state just before the EOB char was reached */
1218 static yy_state_type yy_get_previous_state (void)
1220 register yy_state_type yy_current_state;
1221 register char *yy_cp;
1223 yy_current_state = (yy_start);
1225 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1227 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1228 if ( yy_accept[yy_current_state] )
1230 (yy_last_accepting_state) = yy_current_state;
1231 (yy_last_accepting_cpos) = yy_cp;
1233 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1235 yy_current_state = (int) yy_def[yy_current_state];
1236 if ( yy_current_state >= 54 )
1237 yy_c = yy_meta[(unsigned int) yy_c];
1239 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1242 return yy_current_state;
1245 /* yy_try_NUL_trans - try to make a transition on the NUL character
1248 * next_state = yy_try_NUL_trans( current_state );
1250 static yy_state_type yy_try_NUL_trans (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 >= 54 )
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 == 53);
1270 return yy_is_jam ? 0 : yy_current_state;
1273 static void yyunput (int c, register char * yy_bp )
1275 register char *yy_cp;
1277 yy_cp = (yy_c_buf_p);
1279 /* undo effects of setting up xbt_automaton_parse_text */
1280 *yy_cp = (yy_hold_char);
1282 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1283 { /* need to shift things up to make room */
1284 /* +2 for EOB chars. */
1285 register int number_to_move = (yy_n_chars) + 2;
1286 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1287 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1288 register char *source =
1289 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1291 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1292 *--dest = *--source;
1294 yy_cp += (int) (dest - source);
1295 yy_bp += (int) (dest - source);
1296 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1297 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1299 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1300 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1303 *--yy_cp = (char) c;
1305 (yytext_ptr) = yy_bp;
1306 (yy_hold_char) = *yy_cp;
1307 (yy_c_buf_p) = yy_cp;
1312 static int yyinput (void)
1314 static int input (void)
1320 *(yy_c_buf_p) = (yy_hold_char);
1322 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1324 /* yy_c_buf_p now points to the character we want to return.
1325 * If this occurs *before* the EOB characters, then it's a
1326 * valid NUL; if not, then we've hit the end of the buffer.
1328 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1329 /* This was really a NUL. */
1330 *(yy_c_buf_p) = '\0';
1333 { /* need more input */
1334 int offset = (yy_c_buf_p) - (yytext_ptr);
1337 switch ( yy_get_next_buffer( ) )
1339 case EOB_ACT_LAST_MATCH:
1340 /* This happens because yy_g_n_b()
1341 * sees that we've accumulated a
1342 * token and flags that we need to
1343 * try matching the token before
1344 * proceeding. But for input(),
1345 * there's no matching to consider.
1346 * So convert the EOB_ACT_LAST_MATCH
1347 * to EOB_ACT_END_OF_FILE.
1350 /* Reset buffer status. */
1351 xbt_automaton_parse_restart(xbt_automaton_parse_in );
1355 case EOB_ACT_END_OF_FILE:
1357 if ( xbt_automaton_parse_wrap( ) )
1360 if ( ! (yy_did_buffer_switch_on_eof) )
1369 case EOB_ACT_CONTINUE_SCAN:
1370 (yy_c_buf_p) = (yytext_ptr) + offset;
1376 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1377 *(yy_c_buf_p) = '\0'; /* preserve xbt_automaton_parse_text */
1378 (yy_hold_char) = *++(yy_c_buf_p);
1382 #endif /* ifndef YY_NO_INPUT */
1384 /** Immediately switch to a different input stream.
1385 * @param input_file A readable stream.
1387 * @note This function does not reset the start condition to @c INITIAL .
1389 void xbt_automaton_parse_restart (FILE * input_file )
1392 if ( ! YY_CURRENT_BUFFER ){
1393 xbt_automaton_parse_ensure_buffer_stack ();
1394 YY_CURRENT_BUFFER_LVALUE =
1395 xbt_automaton_parse__create_buffer(xbt_automaton_parse_in,YY_BUF_SIZE );
1398 xbt_automaton_parse__init_buffer(YY_CURRENT_BUFFER,input_file );
1399 xbt_automaton_parse__load_buffer_state( );
1402 /** Switch to a different input buffer.
1403 * @param new_buffer The new input buffer.
1406 void xbt_automaton_parse__switch_to_buffer (YY_BUFFER_STATE new_buffer )
1409 /* TODO. We should be able to replace this entire function body
1411 * xbt_automaton_parse_pop_buffer_state();
1412 * xbt_automaton_parse_push_buffer_state(new_buffer);
1414 xbt_automaton_parse_ensure_buffer_stack ();
1415 if ( YY_CURRENT_BUFFER == new_buffer )
1418 if ( YY_CURRENT_BUFFER )
1420 /* Flush out information for old buffer. */
1421 *(yy_c_buf_p) = (yy_hold_char);
1422 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1423 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1426 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1427 xbt_automaton_parse__load_buffer_state( );
1429 /* We don't actually know whether we did this switch during
1430 * EOF (xbt_automaton_parse_wrap()) processing, but the only time this flag
1431 * is looked at is after xbt_automaton_parse_wrap() is called, so it's safe
1432 * to go ahead and always set it.
1434 (yy_did_buffer_switch_on_eof) = 1;
1437 static void xbt_automaton_parse__load_buffer_state (void)
1439 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1440 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1441 xbt_automaton_parse_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1442 (yy_hold_char) = *(yy_c_buf_p);
1445 /** Allocate and initialize an input buffer state.
1446 * @param file A readable stream.
1447 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1449 * @return the allocated buffer state.
1451 YY_BUFFER_STATE xbt_automaton_parse__create_buffer (FILE * file, int size )
1455 b = (YY_BUFFER_STATE) xbt_automaton_parse_alloc(sizeof( struct yy_buffer_state ) );
1457 YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parse__create_buffer()" );
1459 b->yy_buf_size = size;
1461 /* yy_ch_buf has to be 2 characters longer than the size given because
1462 * we need to put in 2 end-of-buffer characters.
1464 b->yy_ch_buf = (char *) xbt_automaton_parse_alloc(b->yy_buf_size + 2 );
1465 if ( ! b->yy_ch_buf )
1466 YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parse__create_buffer()" );
1468 b->yy_is_our_buffer = 1;
1470 xbt_automaton_parse__init_buffer(b,file );
1475 /** Destroy the buffer.
1476 * @param b a buffer created with xbt_automaton_parse__create_buffer()
1479 void xbt_automaton_parse__delete_buffer (YY_BUFFER_STATE b )
1485 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1486 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1488 if ( b->yy_is_our_buffer )
1489 xbt_automaton_parse_free((void *) b->yy_ch_buf );
1491 xbt_automaton_parse_free((void *) b );
1495 extern int isatty (int );
1496 #endif /* __cplusplus */
1498 /* Initializes or reinitializes a buffer.
1499 * This function is sometimes called more than once on the same buffer,
1500 * such as during a xbt_automaton_parse_restart() or at EOF.
1502 static void xbt_automaton_parse__init_buffer (YY_BUFFER_STATE b, FILE * file )
1507 xbt_automaton_parse__flush_buffer(b );
1509 b->yy_input_file = file;
1510 b->yy_fill_buffer = 1;
1512 /* If b is the current buffer, then xbt_automaton_parse__init_buffer was _probably_
1513 * called from xbt_automaton_parse_restart() or through yy_get_next_buffer.
1514 * In that case, we don't want to reset the lineno or column.
1516 if (b != YY_CURRENT_BUFFER){
1517 b->yy_bs_lineno = 1;
1518 b->yy_bs_column = 0;
1521 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1526 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1527 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1530 void xbt_automaton_parse__flush_buffer (YY_BUFFER_STATE b )
1537 /* We always need two end-of-buffer characters. The first causes
1538 * a transition to the end-of-buffer state. The second causes
1539 * a jam in that state.
1541 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1542 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1544 b->yy_buf_pos = &b->yy_ch_buf[0];
1547 b->yy_buffer_status = YY_BUFFER_NEW;
1549 if ( b == YY_CURRENT_BUFFER )
1550 xbt_automaton_parse__load_buffer_state( );
1553 /** Pushes the new state onto the stack. The new state becomes
1554 * the current state. This function will allocate the stack
1556 * @param new_buffer The new state.
1559 void xbt_automaton_parse_push_buffer_state (YY_BUFFER_STATE new_buffer )
1561 if (new_buffer == NULL)
1564 xbt_automaton_parse_ensure_buffer_stack();
1566 /* This block is copied from xbt_automaton_parse__switch_to_buffer. */
1567 if ( YY_CURRENT_BUFFER )
1569 /* Flush out information for old buffer. */
1570 *(yy_c_buf_p) = (yy_hold_char);
1571 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1572 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1575 /* Only push if top exists. Otherwise, replace top. */
1576 if (YY_CURRENT_BUFFER)
1577 (yy_buffer_stack_top)++;
1578 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1580 /* copied from xbt_automaton_parse__switch_to_buffer. */
1581 xbt_automaton_parse__load_buffer_state( );
1582 (yy_did_buffer_switch_on_eof) = 1;
1585 /** Removes and deletes the top of the stack, if present.
1586 * The next element becomes the new top.
1589 void xbt_automaton_parse_pop_buffer_state (void)
1591 if (!YY_CURRENT_BUFFER)
1594 xbt_automaton_parse__delete_buffer(YY_CURRENT_BUFFER );
1595 YY_CURRENT_BUFFER_LVALUE = NULL;
1596 if ((yy_buffer_stack_top) > 0)
1597 --(yy_buffer_stack_top);
1599 if (YY_CURRENT_BUFFER) {
1600 xbt_automaton_parse__load_buffer_state( );
1601 (yy_did_buffer_switch_on_eof) = 1;
1605 /* Allocates the stack if it does not exist.
1606 * Guarantees space for at least one push.
1608 static void xbt_automaton_parse_ensure_buffer_stack (void)
1612 if (!(yy_buffer_stack)) {
1614 /* First allocation is just for 2 elements, since we don't know if this
1615 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1616 * immediate realloc on the next call.
1619 (yy_buffer_stack) = (struct yy_buffer_state**)xbt_automaton_parse_alloc
1620 (num_to_alloc * sizeof(struct yy_buffer_state*)
1622 if ( ! (yy_buffer_stack) )
1623 YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parse_ensure_buffer_stack()" );
1625 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1627 (yy_buffer_stack_max) = num_to_alloc;
1628 (yy_buffer_stack_top) = 0;
1632 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1634 /* Increase the buffer to prepare for a possible push. */
1635 int grow_size = 8 /* arbitrary grow size */;
1637 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1638 (yy_buffer_stack) = (struct yy_buffer_state**)xbt_automaton_parse_realloc
1640 num_to_alloc * sizeof(struct yy_buffer_state*)
1642 if ( ! (yy_buffer_stack) )
1643 YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parse_ensure_buffer_stack()" );
1645 /* zero only the new slots.*/
1646 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1647 (yy_buffer_stack_max) = num_to_alloc;
1651 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1652 * @param base the character buffer
1653 * @param size the size in bytes of the character buffer
1655 * @return the newly allocated buffer state object.
1657 YY_BUFFER_STATE xbt_automaton_parse__scan_buffer (char * base, yy_size_t size )
1662 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1663 base[size-1] != YY_END_OF_BUFFER_CHAR )
1664 /* They forgot to leave room for the EOB's. */
1667 b = (YY_BUFFER_STATE) xbt_automaton_parse_alloc(sizeof( struct yy_buffer_state ) );
1669 YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parse__scan_buffer()" );
1671 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1672 b->yy_buf_pos = b->yy_ch_buf = base;
1673 b->yy_is_our_buffer = 0;
1674 b->yy_input_file = 0;
1675 b->yy_n_chars = b->yy_buf_size;
1676 b->yy_is_interactive = 0;
1678 b->yy_fill_buffer = 0;
1679 b->yy_buffer_status = YY_BUFFER_NEW;
1681 xbt_automaton_parse__switch_to_buffer(b );
1686 /** Setup the input buffer state to scan a string. The next call to xbt_automaton_parse_lex() will
1687 * scan from a @e copy of @a str.
1688 * @param yystr a NUL-terminated string to scan
1690 * @return the newly allocated buffer state object.
1691 * @note If you want to scan bytes that may contain NUL values, then use
1692 * xbt_automaton_parse__scan_bytes() instead.
1694 YY_BUFFER_STATE xbt_automaton_parse__scan_string (yyconst char * yystr )
1697 return xbt_automaton_parse__scan_bytes(yystr,strlen(yystr) );
1700 /** Setup the input buffer state to scan the given bytes. The next call to xbt_automaton_parse_lex() will
1701 * scan from a @e copy of @a bytes.
1702 * @param yybytes the byte buffer to scan
1703 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1705 * @return the newly allocated buffer state object.
1707 YY_BUFFER_STATE xbt_automaton_parse__scan_bytes (yyconst char * yybytes, int _yybytes_len )
1714 /* Get memory for full buffer, including space for trailing EOB's. */
1715 n = _yybytes_len + 2;
1716 buf = (char *) xbt_automaton_parse_alloc(n );
1718 YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parse__scan_bytes()" );
1720 for ( i = 0; i < _yybytes_len; ++i )
1721 buf[i] = yybytes[i];
1723 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1725 b = xbt_automaton_parse__scan_buffer(buf,n );
1727 YY_FATAL_ERROR( "bad buffer in xbt_automaton_parse__scan_bytes()" );
1729 /* It's okay to grow etc. this buffer, and we should throw it
1730 * away when we're done.
1732 b->yy_is_our_buffer = 1;
1737 #ifndef YY_EXIT_FAILURE
1738 #define YY_EXIT_FAILURE 2
1741 static void yy_fatal_error (yyconst char* msg )
1743 (void) fprintf( stderr, "%s\n", msg );
1744 exit( YY_EXIT_FAILURE );
1747 /* Redefine yyless() so it works in section 3 code. */
1753 /* Undo effects of setting up xbt_automaton_parse_text. */ \
1754 int yyless_macro_arg = (n); \
1755 YY_LESS_LINENO(yyless_macro_arg);\
1756 xbt_automaton_parse_text[xbt_automaton_parse_leng] = (yy_hold_char); \
1757 (yy_c_buf_p) = xbt_automaton_parse_text + yyless_macro_arg; \
1758 (yy_hold_char) = *(yy_c_buf_p); \
1759 *(yy_c_buf_p) = '\0'; \
1760 xbt_automaton_parse_leng = yyless_macro_arg; \
1764 /* Accessor methods (get/set functions) to struct members. */
1766 /** Get the current line number.
1769 int xbt_automaton_parse_get_lineno (void)
1772 return xbt_automaton_parse_lineno;
1775 /** Get the input stream.
1778 FILE *xbt_automaton_parse_get_in (void)
1780 return xbt_automaton_parse_in;
1783 /** Get the output stream.
1786 FILE *xbt_automaton_parse_get_out (void)
1788 return xbt_automaton_parse_out;
1791 /** Get the length of the current token.
1794 int xbt_automaton_parse_get_leng (void)
1796 return xbt_automaton_parse_leng;
1799 /** Get the current token.
1803 char *xbt_automaton_parse_get_text (void)
1805 return xbt_automaton_parse_text;
1808 /** Set the current line number.
1809 * @param line_number
1812 void xbt_automaton_parse_set_lineno (int line_number )
1815 xbt_automaton_parse_lineno = line_number;
1818 /** Set the input stream. This does not discard the current
1820 * @param in_str A readable stream.
1822 * @see xbt_automaton_parse__switch_to_buffer
1824 void xbt_automaton_parse_set_in (FILE * in_str )
1826 xbt_automaton_parse_in = in_str ;
1829 void xbt_automaton_parse_set_out (FILE * out_str )
1831 xbt_automaton_parse_out = out_str ;
1834 int xbt_automaton_parse_get_debug (void)
1836 return xbt_automaton_parse__flex_debug;
1839 void xbt_automaton_parse_set_debug (int bdebug )
1841 xbt_automaton_parse__flex_debug = bdebug ;
1844 static int yy_init_globals (void)
1846 /* Initialization is the same as for the non-reentrant scanner.
1847 * This function is called from xbt_automaton_parse_lex_destroy(), so don't allocate here.
1850 (yy_buffer_stack) = 0;
1851 (yy_buffer_stack_top) = 0;
1852 (yy_buffer_stack_max) = 0;
1853 (yy_c_buf_p) = (char *) 0;
1857 /* Defined in main.c */
1859 xbt_automaton_parse_in = stdin;
1860 xbt_automaton_parse_out = stdout;
1862 xbt_automaton_parse_in = (FILE *) 0;
1863 xbt_automaton_parse_out = (FILE *) 0;
1866 /* For future reference: Set errno on error, since we are called by
1867 * xbt_automaton_parse_lex_init()
1872 /* xbt_automaton_parse_lex_destroy is for both reentrant and non-reentrant scanners. */
1873 int xbt_automaton_parse_lex_destroy (void)
1876 /* Pop the buffer stack, destroying each element. */
1877 while(YY_CURRENT_BUFFER){
1878 xbt_automaton_parse__delete_buffer(YY_CURRENT_BUFFER );
1879 YY_CURRENT_BUFFER_LVALUE = NULL;
1880 xbt_automaton_parse_pop_buffer_state();
1883 /* Destroy the stack itself. */
1884 xbt_automaton_parse_free((yy_buffer_stack) );
1885 (yy_buffer_stack) = NULL;
1887 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1888 * xbt_automaton_parse_lex() is called, initialization will occur. */
1895 * Internal utility routines.
1899 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1902 for ( i = 0; i < n; ++i )
1907 #ifdef YY_NEED_STRLEN
1908 static int yy_flex_strlen (yyconst char * s )
1911 for ( n = 0; s[n]; ++n )
1918 void *xbt_automaton_parse_alloc (yy_size_t size )
1920 return (void *) malloc( size );
1923 void *xbt_automaton_parse_realloc (void * ptr, yy_size_t size )
1925 /* The cast to (char *) in the following accommodates both
1926 * implementations that use char* generic pointers, and those
1927 * that use void* generic pointers. It works with the latter
1928 * because both ANSI C and C++ allow castless assignment from
1929 * any pointer type to void*, and deal with argument conversions
1930 * as though doing an assignment.
1932 return (void *) realloc( (char *) ptr, size );
1935 void xbt_automaton_parse_free (void * ptr )
1937 free( (char *) ptr ); /* see xbt_automaton_parse_realloc() for (char *) cast */
1940 #define YYTABLES_NAME "yytables"
1942 #line 76 "parserPromela.lex"