1 #line 2 "automaton_lexer.yy.c"
3 #line 4 "automaton_lexer.yy.c"
5 #define YY_INT_ALIGNED short int
7 /* A lexical scanner generated by flex */
9 #define yy_create_buffer xbt_automaton_parser__create_buffer
10 #define yy_delete_buffer xbt_automaton_parser__delete_buffer
11 #define yy_flex_debug xbt_automaton_parser__flex_debug
12 #define yy_init_buffer xbt_automaton_parser__init_buffer
13 #define yy_flush_buffer xbt_automaton_parser__flush_buffer
14 #define yy_load_buffer_state xbt_automaton_parser__load_buffer_state
15 #define yy_switch_to_buffer xbt_automaton_parser__switch_to_buffer
16 #define yyin xbt_automaton_parser_in
17 #define yyleng xbt_automaton_parser_leng
18 #define yylex xbt_automaton_parser_lex
19 #define yylineno xbt_automaton_parser_lineno
20 #define yyout xbt_automaton_parser_out
21 #define yyrestart xbt_automaton_parser_restart
22 #define yytext xbt_automaton_parser_text
23 #define yywrap xbt_automaton_parser_wrap
24 #define yyalloc xbt_automaton_parser_alloc
25 #define yyrealloc xbt_automaton_parser_realloc
26 #define yyfree xbt_automaton_parser_free
29 #define YY_FLEX_MAJOR_VERSION 2
30 #define YY_FLEX_MINOR_VERSION 5
31 #define YY_FLEX_SUBMINOR_VERSION 39
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_parser_restart(xbt_automaton_parser_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 #ifndef YY_TYPEDEF_YY_SIZE_T
185 #define YY_TYPEDEF_YY_SIZE_T
186 typedef size_t yy_size_t;
189 extern yy_size_t xbt_automaton_parser_leng;
191 extern FILE *xbt_automaton_parser_in, *xbt_automaton_parser_out;
193 #define EOB_ACT_CONTINUE_SCAN 0
194 #define EOB_ACT_END_OF_FILE 1
195 #define EOB_ACT_LAST_MATCH 2
197 #define YY_LESS_LINENO(n)
198 #define YY_LINENO_REWIND_TO(ptr)
200 /* Return all but the first "n" matched characters back to the input stream. */
204 /* Undo effects of setting up xbt_automaton_parser_text. */ \
205 int yyless_macro_arg = (n); \
206 YY_LESS_LINENO(yyless_macro_arg);\
207 *yy_cp = (yy_hold_char); \
208 YY_RESTORE_YY_MORE_OFFSET \
209 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
210 YY_DO_BEFORE_ACTION; /* set up xbt_automaton_parser_text again */ \
214 #define unput(c) yyunput( c, (yytext_ptr) )
216 #ifndef YY_STRUCT_YY_BUFFER_STATE
217 #define YY_STRUCT_YY_BUFFER_STATE
218 struct yy_buffer_state
222 char *yy_ch_buf; /* input buffer */
223 char *yy_buf_pos; /* current position in input buffer */
225 /* Size of input buffer in bytes, not including room for EOB
228 yy_size_t yy_buf_size;
230 /* Number of characters read into yy_ch_buf, not including EOB
233 yy_size_t yy_n_chars;
235 /* Whether we "own" the buffer - i.e., we know we created it,
236 * and can realloc() it to grow it, and should free() it to
239 int yy_is_our_buffer;
241 /* Whether this is an "interactive" input source; if so, and
242 * if we're using stdio for input, then we want to use getc()
243 * instead of fread(), to make sure we stop fetching input after
246 int yy_is_interactive;
248 /* Whether we're considered to be at the beginning of a line.
249 * If so, '^' rules will be active on the next match, otherwise
254 int yy_bs_lineno; /**< The line count. */
255 int yy_bs_column; /**< The column count. */
257 /* Whether to try to fill the input buffer when we reach the
262 int yy_buffer_status;
264 #define YY_BUFFER_NEW 0
265 #define YY_BUFFER_NORMAL 1
266 /* When an EOF's been seen but there's still some text to process
267 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
268 * shouldn't try reading from the input source any more. We might
269 * still have a bunch of tokens to match, though, because of
270 * possible backing-up.
272 * When we actually see the EOF, we change the status to "new"
273 * (via xbt_automaton_parser_restart()), so that the user can continue scanning by
274 * just pointing xbt_automaton_parser_in at a new input file.
276 #define YY_BUFFER_EOF_PENDING 2
279 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
281 /* Stack of input buffers. */
282 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
283 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
284 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
286 /* We provide macros for accessing buffer states in case in the
287 * future we want to put the buffer states in a more general
290 * Returns the top of the stack, or NULL.
292 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
293 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
296 /* Same as previous macro, but useful when we know that the buffer stack is not
297 * NULL or when we need an lvalue. For internal use only.
299 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
301 /* yy_hold_char holds the character lost when xbt_automaton_parser_text is formed. */
302 static char yy_hold_char;
303 static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
304 yy_size_t xbt_automaton_parser_leng;
306 /* Points to current character in buffer. */
307 static char *yy_c_buf_p = (char *) 0;
308 static int yy_init = 0; /* whether we need to initialize */
309 static int yy_start = 0; /* start state number */
311 /* Flag which is used to allow xbt_automaton_parser_wrap()'s to do buffer switches
312 * instead of setting up a fresh xbt_automaton_parser_in. A bit of a hack ...
314 static int yy_did_buffer_switch_on_eof;
316 void xbt_automaton_parser_restart (FILE *input_file );
317 void xbt_automaton_parser__switch_to_buffer (YY_BUFFER_STATE new_buffer );
318 YY_BUFFER_STATE xbt_automaton_parser__create_buffer (FILE *file,int size );
319 void xbt_automaton_parser__delete_buffer (YY_BUFFER_STATE b );
320 void xbt_automaton_parser__flush_buffer (YY_BUFFER_STATE b );
321 void xbt_automaton_parser_push_buffer_state (YY_BUFFER_STATE new_buffer );
322 void xbt_automaton_parser_pop_buffer_state (void );
324 static void xbt_automaton_parser_ensure_buffer_stack (void );
325 static void xbt_automaton_parser__load_buffer_state (void );
326 static void xbt_automaton_parser__init_buffer (YY_BUFFER_STATE b,FILE *file );
328 #define YY_FLUSH_BUFFER xbt_automaton_parser__flush_buffer(YY_CURRENT_BUFFER )
330 YY_BUFFER_STATE xbt_automaton_parser__scan_buffer (char *base,yy_size_t size );
331 YY_BUFFER_STATE xbt_automaton_parser__scan_string (yyconst char *yy_str );
332 YY_BUFFER_STATE xbt_automaton_parser__scan_bytes (yyconst char *bytes,yy_size_t len );
334 void *xbt_automaton_parser_alloc (yy_size_t );
335 void *xbt_automaton_parser_realloc (void *,yy_size_t );
336 void xbt_automaton_parser_free (void * );
338 #define yy_new_buffer xbt_automaton_parser__create_buffer
340 #define yy_set_interactive(is_interactive) \
342 if ( ! YY_CURRENT_BUFFER ){ \
343 xbt_automaton_parser_ensure_buffer_stack (); \
344 YY_CURRENT_BUFFER_LVALUE = \
345 xbt_automaton_parser__create_buffer(xbt_automaton_parser_in,YY_BUF_SIZE ); \
347 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
350 #define yy_set_bol(at_bol) \
352 if ( ! YY_CURRENT_BUFFER ){\
353 xbt_automaton_parser_ensure_buffer_stack (); \
354 YY_CURRENT_BUFFER_LVALUE = \
355 xbt_automaton_parser__create_buffer(xbt_automaton_parser_in,YY_BUF_SIZE ); \
357 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
360 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
362 /* Begin user sect3 */
364 #define xbt_automaton_parser_wrap() 1
365 #define YY_SKIP_YYWRAP
367 typedef unsigned char YY_CHAR;
369 FILE *xbt_automaton_parser_in = (FILE *) 0, *xbt_automaton_parser_out = (FILE *) 0;
371 typedef int yy_state_type;
373 extern int xbt_automaton_parser_lineno;
375 int xbt_automaton_parser_lineno = 1;
377 extern char *xbt_automaton_parser_text;
378 #define yytext_ptr xbt_automaton_parser_text
380 static yy_state_type yy_get_previous_state (void );
381 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
382 static int yy_get_next_buffer (void );
383 static void yy_fatal_error (yyconst char msg[] );
385 /* Done after the current pattern has been matched and before the
386 * corresponding action - sets up xbt_automaton_parser_text.
388 #define YY_DO_BEFORE_ACTION \
389 (yytext_ptr) = yy_bp; \
390 xbt_automaton_parser_leng = (size_t) (yy_cp - yy_bp); \
391 (yy_hold_char) = *yy_cp; \
393 (yy_c_buf_p) = yy_cp;
395 #define YY_NUM_RULES 25
396 #define YY_END_OF_BUFFER 26
397 /* This struct is not used in this scanner,
398 but its presence is necessary. */
401 flex_int32_t yy_verify;
404 static yyconst flex_int16_t yy_accept[54] =
406 0, 0, 26, 24, 18, 23, 8, 24, 24, 9,
407 10, 24, 24, 20, 14, 12, 13, 22, 22, 22,
408 22, 22, 15, 24, 16, 18, 0, 0, 21, 0,
409 6, 4, 0, 0, 20, 11, 22, 3, 22, 2,
410 22, 7, 0, 0, 0, 19, 22, 22, 17, 5,
414 static yyconst flex_int32_t yy_ec[256] =
416 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
417 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
418 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
419 1, 4, 5, 6, 1, 1, 1, 7, 1, 8,
420 9, 10, 1, 1, 11, 12, 13, 14, 15, 14,
421 14, 14, 14, 14, 14, 14, 14, 16, 17, 1,
422 1, 18, 1, 1, 19, 19, 19, 19, 19, 19,
423 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
424 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
425 1, 20, 1, 1, 21, 1, 19, 19, 19, 19,
427 22, 23, 24, 19, 25, 19, 19, 19, 19, 26,
428 27, 19, 19, 28, 19, 29, 19, 30, 19, 19,
429 19, 19, 31, 32, 33, 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,
436 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,
442 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
446 static yyconst flex_int32_t yy_meta[34] =
448 1, 1, 2, 2, 1, 2, 1, 1, 1, 1,
449 1, 1, 3, 4, 4, 1, 1, 1, 4, 2,
450 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
454 static yyconst flex_int16_t yy_base[57] =
456 0, 0, 89, 90, 32, 90, 90, 34, 81, 90,
457 90, 69, 76, 27, 31, 69, 90, 0, 59, 56,
458 58, 55, 90, 42, 90, 45, 47, 0, 0, 0,
459 90, 90, 52, 43, 49, 90, 0, 0, 44, 0,
460 42, 90, 56, 65, 52, 56, 25, 26, 90, 0,
461 16, 0, 90, 74, 31, 78
464 static yyconst flex_int16_t yy_def[57] =
466 53, 1, 53, 53, 53, 53, 53, 54, 53, 53,
467 53, 53, 53, 53, 53, 53, 53, 55, 55, 55,
468 55, 55, 53, 53, 53, 53, 54, 27, 27, 27,
469 53, 53, 56, 53, 53, 53, 55, 55, 55, 55,
470 55, 53, 56, 56, 53, 53, 55, 55, 53, 55,
471 55, 55, 0, 53, 53, 53
474 static yyconst flex_int16_t yy_nxt[124] =
476 4, 5, 6, 5, 7, 8, 9, 10, 11, 4,
477 12, 4, 13, 14, 15, 16, 17, 4, 18, 4,
478 4, 18, 19, 20, 21, 22, 18, 18, 18, 18,
479 23, 24, 25, 26, 37, 26, 27, 28, 34, 29,
480 35, 35, 34, 52, 35, 35, 26, 51, 26, 27,
481 28, 50, 29, 27, 44, 44, 46, 46, 44, 44,
482 34, 45, 35, 35, 49, 45, 27, 44, 44, 46,
483 46, 48, 47, 42, 45, 30, 41, 30, 43, 43,
484 40, 43, 39, 38, 36, 33, 32, 31, 53, 3,
485 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
487 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
488 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
492 static yyconst flex_int16_t yy_chk[124] =
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, 1, 1, 1, 1, 1, 1, 1,
497 1, 1, 1, 5, 55, 5, 8, 8, 14, 8,
498 14, 14, 15, 51, 15, 15, 26, 48, 26, 27,
499 27, 47, 27, 8, 33, 33, 34, 34, 43, 43,
500 35, 33, 35, 35, 45, 43, 27, 44, 44, 46,
501 46, 41, 39, 24, 44, 54, 22, 54, 56, 56,
502 21, 56, 20, 19, 16, 13, 12, 9, 3, 53,
503 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
505 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
506 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
510 static yy_state_type yy_last_accepting_state;
511 static char *yy_last_accepting_cpos;
513 extern int xbt_automaton_parser__flex_debug;
514 int xbt_automaton_parser__flex_debug = 0;
516 /* The intent behind this definition is that it'll catch
517 * any uses of REJECT which flex missed.
519 #define REJECT reject_used_but_not_detected
520 #define yymore() yymore_used_but_not_detected
521 #define YY_MORE_ADJ 0
522 #define YY_RESTORE_YY_MORE_OFFSET
523 char *xbt_automaton_parser_text;
524 #line 1 "parserPromela.lex"
525 /* Copyright (c) 2012, 2014. The SimGrid Team.
526 * All rights reserved. */
527 /* This program is free software; you can redistribute it and/or modify it
528 * under the terms of the license (GNU LGPL) which comes with this package. */
529 #line 10 "parserPromela.lex"
531 #include "simgrid_config.h"
532 #ifndef HAVE_UNISTD_H
533 #define YY_NO_UNISTD_H /* hello Windows */
537 #include "parserPromela.tab.hacc"
539 extern YYSTYPE yylval;
541 #line 542 "automaton_lexer.yy.c"
545 #ifndef YY_NO_UNISTD_H
546 /* Special case for "unistd.h", since it is non-ANSI. We include it way
547 * down here because we want the user's section 1 to have been scanned first.
548 * The user has a chance to override it with an option.
553 #ifndef YY_EXTRA_TYPE
554 #define YY_EXTRA_TYPE void *
557 static int yy_init_globals (void );
559 /* Accessor methods to globals.
560 These are made visible to non-reentrant scanners for convenience. */
562 int xbt_automaton_parser_lex_destroy (void );
564 int xbt_automaton_parser_get_debug (void );
566 void xbt_automaton_parser_set_debug (int debug_flag );
568 YY_EXTRA_TYPE xbt_automaton_parser_get_extra (void );
570 void xbt_automaton_parser_set_extra (YY_EXTRA_TYPE user_defined );
572 FILE *xbt_automaton_parser_get_in (void );
574 void xbt_automaton_parser_set_in (FILE * in_str );
576 FILE *xbt_automaton_parser_get_out (void );
578 void xbt_automaton_parser_set_out (FILE * out_str );
580 yy_size_t xbt_automaton_parser_get_leng (void );
582 char *xbt_automaton_parser_get_text (void );
584 int xbt_automaton_parser_get_lineno (void );
586 void xbt_automaton_parser_set_lineno (int line_number );
588 /* Macros after this point can all be overridden by user definitions in
592 #ifndef YY_SKIP_YYWRAP
594 extern "C" int xbt_automaton_parser_wrap (void );
596 extern int xbt_automaton_parser_wrap (void );
600 static void yyunput (int c,char *buf_ptr );
603 static void yy_flex_strncpy (char *,yyconst char *,int );
606 #ifdef YY_NEED_STRLEN
607 static int yy_flex_strlen (yyconst char * );
613 static int yyinput (void );
615 static int input (void );
620 /* Amount of stuff to slurp up with each read. */
621 #ifndef YY_READ_BUF_SIZE
623 /* On IA-64, the buffer size is 16k, not 8k */
624 #define YY_READ_BUF_SIZE 16384
626 #define YY_READ_BUF_SIZE 8192
627 #endif /* __ia64__ */
630 /* Copy whatever the last rule matched to the standard output. */
632 /* This used to be an fputs(), but since the string might contain NUL's,
633 * we now use fwrite().
635 #define ECHO do { if (fwrite( xbt_automaton_parser_text, xbt_automaton_parser_leng, 1, xbt_automaton_parser_out )) {} } while (0)
638 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
639 * is returned in "result".
642 #define YY_INPUT(buf,result,max_size) \
643 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
647 for ( n = 0; n < max_size && \
648 (c = getc( xbt_automaton_parser_in )) != EOF && c != '\n'; ++n ) \
651 buf[n++] = (char) c; \
652 if ( c == EOF && ferror( xbt_automaton_parser_in ) ) \
653 YY_FATAL_ERROR( "input in flex scanner failed" ); \
659 while ( (result = fread(buf, 1, max_size, xbt_automaton_parser_in))==0 && ferror(xbt_automaton_parser_in)) \
661 if( errno != EINTR) \
663 YY_FATAL_ERROR( "input in flex scanner failed" ); \
667 clearerr(xbt_automaton_parser_in); \
674 /* No semi-colon after return; correct usage is to write "yyterminate();" -
675 * we don't want an extra ';' after the "return" because that will cause
676 * some compilers to complain about unreachable statements.
679 #define yyterminate() return YY_NULL
682 /* Number of entries by which start-condition stack grows. */
683 #ifndef YY_START_STACK_INCR
684 #define YY_START_STACK_INCR 25
687 /* Report a fatal error. */
688 #ifndef YY_FATAL_ERROR
689 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
692 /* end tables serialization structures and prototypes */
694 /* Default declaration of generated scanner - a define so the user can
695 * easily add parameters.
698 #define YY_DECL_IS_OURS 1
700 extern int xbt_automaton_parser_lex (void);
702 #define YY_DECL int xbt_automaton_parser_lex (void)
703 #endif /* !YY_DECL */
705 /* Code executed at the beginning of each rule, after xbt_automaton_parser_text and xbt_automaton_parser_leng
708 #ifndef YY_USER_ACTION
709 #define YY_USER_ACTION
712 /* Code executed at the end of each rule. */
714 #define YY_BREAK break;
717 #define YY_RULE_SETUP \
720 /** The main scanner function which does all the work.
724 register yy_state_type yy_current_state;
725 register char *yy_cp, *yy_bp;
737 (yy_start) = 1; /* first start state */
739 if ( ! xbt_automaton_parser_in )
740 xbt_automaton_parser_in = stdin;
742 if ( ! xbt_automaton_parser_out )
743 xbt_automaton_parser_out = stdout;
745 if ( ! YY_CURRENT_BUFFER ) {
746 xbt_automaton_parser_ensure_buffer_stack ();
747 YY_CURRENT_BUFFER_LVALUE =
748 xbt_automaton_parser__create_buffer(xbt_automaton_parser_in,YY_BUF_SIZE );
751 xbt_automaton_parser__load_buffer_state( );
755 #line 38 "parserPromela.lex"
758 #line 759 "automaton_lexer.yy.c"
760 while ( 1 ) /* loops until end-of-file is reached */
762 yy_cp = (yy_c_buf_p);
764 /* Support of xbt_automaton_parser_text. */
765 *yy_cp = (yy_hold_char);
767 /* yy_bp points to the position in yy_ch_buf of the start of
772 yy_current_state = (yy_start);
776 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
777 if ( yy_accept[yy_current_state] )
779 (yy_last_accepting_state) = yy_current_state;
780 (yy_last_accepting_cpos) = yy_cp;
782 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
784 yy_current_state = (int) yy_def[yy_current_state];
785 if ( yy_current_state >= 54 )
786 yy_c = yy_meta[(unsigned int) yy_c];
788 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
791 while ( yy_base[yy_current_state] != 90 );
794 yy_act = yy_accept[yy_current_state];
796 { /* have to back up */
797 yy_cp = (yy_last_accepting_cpos);
798 yy_current_state = (yy_last_accepting_state);
799 yy_act = yy_accept[yy_current_state];
804 do_action: /* This label is used only to access EOF actions. */
807 { /* beginning of action switch */
808 case 0: /* must back up */
809 /* undo the effects of YY_DO_BEFORE_ACTION */
810 *yy_cp = (yy_hold_char);
811 yy_cp = (yy_last_accepting_cpos);
812 yy_current_state = (yy_last_accepting_state);
817 #line 40 "parserPromela.lex"
822 #line 41 "parserPromela.lex"
827 #line 42 "parserPromela.lex"
832 #line 43 "parserPromela.lex"
833 { return (IMPLIES); }
837 #line 44 "parserPromela.lex"
842 #line 45 "parserPromela.lex"
847 #line 46 "parserPromela.lex"
852 #line 47 "parserPromela.lex"
857 #line 48 "parserPromela.lex"
858 { return (LEFT_PAR); }
862 #line 49 "parserPromela.lex"
863 { return (RIGHT_PAR); }
867 #line 50 "parserPromela.lex"
872 #line 51 "parserPromela.lex"
877 #line 52 "parserPromela.lex"
878 { return (SEMI_COLON); }
882 #line 53 "parserPromela.lex"
883 { return (CASE_TRUE); }
887 #line 54 "parserPromela.lex"
888 { return (LEFT_BRACE); }
892 #line 55 "parserPromela.lex"
893 { return (RIGHT_BRACE); }
896 /* rule 17 can match eol */
898 #line 58 "parserPromela.lex"
903 #line 60 "parserPromela.lex"
908 #line 63 "parserPromela.lex"
909 { sscanf(xbt_automaton_parser_text,"%lf",&yylval.real);
910 return (LITT_REEL); }
914 #line 66 "parserPromela.lex"
915 { sscanf(xbt_automaton_parser_text,"%d",&yylval.integer);
919 /* rule 21 can match eol */
921 #line 69 "parserPromela.lex"
922 { yylval.string=(char *)malloc(strlen(xbt_automaton_parser_text)+1);
923 sscanf(xbt_automaton_parser_text,"%s",yylval.string);
924 return (LITT_CHAINE); }
928 #line 73 "parserPromela.lex"
929 { yylval.string=(char *)malloc(strlen(xbt_automaton_parser_text)+1);
930 sscanf(xbt_automaton_parser_text,"%s",yylval.string);
934 /* rule 23 can match eol */
936 #line 77 "parserPromela.lex"
941 #line 79 "parserPromela.lex"
946 #line 81 "parserPromela.lex"
949 #line 950 "automaton_lexer.yy.c"
950 case YY_STATE_EOF(INITIAL):
953 case YY_END_OF_BUFFER:
955 /* Amount of text matched not including the EOB char. */
956 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
958 /* Undo the effects of YY_DO_BEFORE_ACTION. */
959 *yy_cp = (yy_hold_char);
960 YY_RESTORE_YY_MORE_OFFSET
962 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
964 /* We're scanning a new file or input source. It's
965 * possible that this happened because the user
966 * just pointed xbt_automaton_parser_in at a new source and called
967 * xbt_automaton_parser_lex(). If so, then we have to assure
968 * consistency between YY_CURRENT_BUFFER and our
969 * globals. Here is the right place to do so, because
970 * this is the first action (other than possibly a
971 * back-up) that will match for the new input source.
973 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
974 YY_CURRENT_BUFFER_LVALUE->yy_input_file = xbt_automaton_parser_in;
975 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
978 /* Note that here we test for yy_c_buf_p "<=" to the position
979 * of the first EOB in the buffer, since yy_c_buf_p will
980 * already have been incremented past the NUL character
981 * (since all states make transitions on EOB to the
982 * end-of-buffer state). Contrast this with the test
985 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
986 { /* This was really a NUL. */
987 yy_state_type yy_next_state;
989 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
991 yy_current_state = yy_get_previous_state( );
993 /* Okay, we're now positioned to make the NUL
994 * transition. We couldn't have
995 * yy_get_previous_state() go ahead and do it
996 * for us because it doesn't know how to deal
997 * with the possibility of jamming (and we don't
998 * want to build jamming into it because then it
999 * will run more slowly).
1002 yy_next_state = yy_try_NUL_trans( yy_current_state );
1004 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1006 if ( yy_next_state )
1008 /* Consume the NUL. */
1009 yy_cp = ++(yy_c_buf_p);
1010 yy_current_state = yy_next_state;
1016 yy_cp = (yy_c_buf_p);
1017 goto yy_find_action;
1021 else switch ( yy_get_next_buffer( ) )
1023 case EOB_ACT_END_OF_FILE:
1025 (yy_did_buffer_switch_on_eof) = 0;
1027 if ( xbt_automaton_parser_wrap( ) )
1029 /* Note: because we've taken care in
1030 * yy_get_next_buffer() to have set up
1031 * xbt_automaton_parser_text, we can now set up
1032 * yy_c_buf_p so that if some total
1033 * hoser (like flex itself) wants to
1034 * call the scanner after we return the
1035 * YY_NULL, it'll still work - another
1036 * YY_NULL will get returned.
1038 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1040 yy_act = YY_STATE_EOF(YY_START);
1046 if ( ! (yy_did_buffer_switch_on_eof) )
1052 case EOB_ACT_CONTINUE_SCAN:
1054 (yytext_ptr) + yy_amount_of_matched_text;
1056 yy_current_state = yy_get_previous_state( );
1058 yy_cp = (yy_c_buf_p);
1059 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1062 case EOB_ACT_LAST_MATCH:
1064 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1066 yy_current_state = yy_get_previous_state( );
1068 yy_cp = (yy_c_buf_p);
1069 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1070 goto yy_find_action;
1077 "fatal flex scanner internal error--no action found" );
1078 } /* end of action switch */
1079 } /* end of scanning one token */
1080 } /* end of user's declarations */
1081 } /* end of xbt_automaton_parser_lex */
1083 /* yy_get_next_buffer - try to read in a new buffer
1085 * Returns a code representing an action:
1086 * EOB_ACT_LAST_MATCH -
1087 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1088 * EOB_ACT_END_OF_FILE - end of file
1090 static int yy_get_next_buffer (void)
1092 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1093 register char *source = (yytext_ptr);
1094 register int number_to_move, i;
1097 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1099 "fatal flex scanner internal error--end of buffer missed" );
1101 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1102 { /* Don't try to fill the buffer, so this is an EOF. */
1103 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1105 /* We matched a single character, the EOB, so
1106 * treat this as a final EOF.
1108 return EOB_ACT_END_OF_FILE;
1113 /* We matched some text prior to the EOB, first
1116 return EOB_ACT_LAST_MATCH;
1120 /* Try to read more data. */
1122 /* First move last chars to start of buffer. */
1123 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1125 for ( i = 0; i < number_to_move; ++i )
1126 *(dest++) = *(source++);
1128 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1129 /* don't do the read, it's not guaranteed to return an EOF,
1132 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1136 yy_size_t num_to_read =
1137 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1139 while ( num_to_read <= 0 )
1140 { /* Not enough room in the buffer - grow it. */
1142 /* just a shorter name for the current buffer */
1143 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1145 int yy_c_buf_p_offset =
1146 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1148 if ( b->yy_is_our_buffer )
1150 yy_size_t new_size = b->yy_buf_size * 2;
1152 if ( new_size <= 0 )
1153 b->yy_buf_size += b->yy_buf_size / 8;
1155 b->yy_buf_size *= 2;
1157 b->yy_ch_buf = (char *)
1158 /* Include room in for 2 EOB chars. */
1159 xbt_automaton_parser_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1162 /* Can't grow it, we don't own it. */
1165 if ( ! b->yy_ch_buf )
1167 "fatal error - scanner input buffer overflow" );
1169 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1171 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1176 if ( num_to_read > YY_READ_BUF_SIZE )
1177 num_to_read = YY_READ_BUF_SIZE;
1179 /* Read in more data. */
1180 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1181 (yy_n_chars), num_to_read );
1183 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1186 if ( (yy_n_chars) == 0 )
1188 if ( number_to_move == YY_MORE_ADJ )
1190 ret_val = EOB_ACT_END_OF_FILE;
1191 xbt_automaton_parser_restart(xbt_automaton_parser_in );
1196 ret_val = EOB_ACT_LAST_MATCH;
1197 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1198 YY_BUFFER_EOF_PENDING;
1203 ret_val = EOB_ACT_CONTINUE_SCAN;
1205 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1206 /* Extend the array by 50%, plus the number we really need. */
1207 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1208 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) xbt_automaton_parser_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1209 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1210 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1213 (yy_n_chars) += number_to_move;
1214 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1215 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1217 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1222 /* yy_get_previous_state - get the state just before the EOB char was reached */
1224 static yy_state_type yy_get_previous_state (void)
1226 register yy_state_type yy_current_state;
1227 register char *yy_cp;
1229 yy_current_state = (yy_start);
1231 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1233 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1234 if ( yy_accept[yy_current_state] )
1236 (yy_last_accepting_state) = yy_current_state;
1237 (yy_last_accepting_cpos) = yy_cp;
1239 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1241 yy_current_state = (int) yy_def[yy_current_state];
1242 if ( yy_current_state >= 54 )
1243 yy_c = yy_meta[(unsigned int) yy_c];
1245 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1248 return yy_current_state;
1251 /* yy_try_NUL_trans - try to make a transition on the NUL character
1254 * next_state = yy_try_NUL_trans( current_state );
1256 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1258 register int yy_is_jam;
1259 register char *yy_cp = (yy_c_buf_p);
1261 register YY_CHAR yy_c = 1;
1262 if ( yy_accept[yy_current_state] )
1264 (yy_last_accepting_state) = yy_current_state;
1265 (yy_last_accepting_cpos) = yy_cp;
1267 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1269 yy_current_state = (int) yy_def[yy_current_state];
1270 if ( yy_current_state >= 54 )
1271 yy_c = yy_meta[(unsigned int) yy_c];
1273 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1274 yy_is_jam = (yy_current_state == 53);
1276 return yy_is_jam ? 0 : yy_current_state;
1279 static void yyunput (int c, register char * yy_bp )
1281 register char *yy_cp;
1283 yy_cp = (yy_c_buf_p);
1285 /* undo effects of setting up xbt_automaton_parser_text */
1286 *yy_cp = (yy_hold_char);
1288 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1289 { /* need to shift things up to make room */
1290 /* +2 for EOB chars. */
1291 register yy_size_t number_to_move = (yy_n_chars) + 2;
1292 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1293 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1294 register char *source =
1295 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1297 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1298 *--dest = *--source;
1300 yy_cp += (int) (dest - source);
1301 yy_bp += (int) (dest - source);
1302 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1303 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1305 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1306 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1309 *--yy_cp = (char) c;
1311 (yytext_ptr) = yy_bp;
1312 (yy_hold_char) = *yy_cp;
1313 (yy_c_buf_p) = yy_cp;
1318 static int yyinput (void)
1320 static int input (void)
1326 *(yy_c_buf_p) = (yy_hold_char);
1328 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1330 /* yy_c_buf_p now points to the character we want to return.
1331 * If this occurs *before* the EOB characters, then it's a
1332 * valid NUL; if not, then we've hit the end of the buffer.
1334 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1335 /* This was really a NUL. */
1336 *(yy_c_buf_p) = '\0';
1339 { /* need more input */
1340 yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1343 switch ( yy_get_next_buffer( ) )
1345 case EOB_ACT_LAST_MATCH:
1346 /* This happens because yy_g_n_b()
1347 * sees that we've accumulated a
1348 * token and flags that we need to
1349 * try matching the token before
1350 * proceeding. But for input(),
1351 * there's no matching to consider.
1352 * So convert the EOB_ACT_LAST_MATCH
1353 * to EOB_ACT_END_OF_FILE.
1356 /* Reset buffer status. */
1357 xbt_automaton_parser_restart(xbt_automaton_parser_in );
1361 case EOB_ACT_END_OF_FILE:
1363 if ( xbt_automaton_parser_wrap( ) )
1366 if ( ! (yy_did_buffer_switch_on_eof) )
1375 case EOB_ACT_CONTINUE_SCAN:
1376 (yy_c_buf_p) = (yytext_ptr) + offset;
1382 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1383 *(yy_c_buf_p) = '\0'; /* preserve xbt_automaton_parser_text */
1384 (yy_hold_char) = *++(yy_c_buf_p);
1388 #endif /* ifndef YY_NO_INPUT */
1390 /** Immediately switch to a different input stream.
1391 * @param input_file A readable stream.
1393 * @note This function does not reset the start condition to @c INITIAL .
1395 void xbt_automaton_parser_restart (FILE * input_file )
1398 if ( ! YY_CURRENT_BUFFER ){
1399 xbt_automaton_parser_ensure_buffer_stack ();
1400 YY_CURRENT_BUFFER_LVALUE =
1401 xbt_automaton_parser__create_buffer(xbt_automaton_parser_in,YY_BUF_SIZE );
1404 xbt_automaton_parser__init_buffer(YY_CURRENT_BUFFER,input_file );
1405 xbt_automaton_parser__load_buffer_state( );
1408 /** Switch to a different input buffer.
1409 * @param new_buffer The new input buffer.
1412 void xbt_automaton_parser__switch_to_buffer (YY_BUFFER_STATE new_buffer )
1415 /* TODO. We should be able to replace this entire function body
1417 * xbt_automaton_parser_pop_buffer_state();
1418 * xbt_automaton_parser_push_buffer_state(new_buffer);
1420 xbt_automaton_parser_ensure_buffer_stack ();
1421 if ( YY_CURRENT_BUFFER == new_buffer )
1424 if ( YY_CURRENT_BUFFER )
1426 /* Flush out information for old buffer. */
1427 *(yy_c_buf_p) = (yy_hold_char);
1428 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1429 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1432 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1433 xbt_automaton_parser__load_buffer_state( );
1435 /* We don't actually know whether we did this switch during
1436 * EOF (xbt_automaton_parser_wrap()) processing, but the only time this flag
1437 * is looked at is after xbt_automaton_parser_wrap() is called, so it's safe
1438 * to go ahead and always set it.
1440 (yy_did_buffer_switch_on_eof) = 1;
1443 static void xbt_automaton_parser__load_buffer_state (void)
1445 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1446 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1447 xbt_automaton_parser_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1448 (yy_hold_char) = *(yy_c_buf_p);
1451 /** Allocate and initialize an input buffer state.
1452 * @param file A readable stream.
1453 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1455 * @return the allocated buffer state.
1457 YY_BUFFER_STATE xbt_automaton_parser__create_buffer (FILE * file, int size )
1461 b = (YY_BUFFER_STATE) xbt_automaton_parser_alloc(sizeof( struct yy_buffer_state ) );
1463 YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser__create_buffer()" );
1465 b->yy_buf_size = size;
1467 /* yy_ch_buf has to be 2 characters longer than the size given because
1468 * we need to put in 2 end-of-buffer characters.
1470 b->yy_ch_buf = (char *) xbt_automaton_parser_alloc(b->yy_buf_size + 2 );
1471 if ( ! b->yy_ch_buf )
1472 YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser__create_buffer()" );
1474 b->yy_is_our_buffer = 1;
1476 xbt_automaton_parser__init_buffer(b,file );
1481 /** Destroy the buffer.
1482 * @param b a buffer created with xbt_automaton_parser__create_buffer()
1485 void xbt_automaton_parser__delete_buffer (YY_BUFFER_STATE b )
1491 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1492 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1494 if ( b->yy_is_our_buffer )
1495 xbt_automaton_parser_free((void *) b->yy_ch_buf );
1497 xbt_automaton_parser_free((void *) b );
1500 /* Initializes or reinitializes a buffer.
1501 * This function is sometimes called more than once on the same buffer,
1502 * such as during a xbt_automaton_parser_restart() or at EOF.
1504 static void xbt_automaton_parser__init_buffer (YY_BUFFER_STATE b, FILE * file )
1509 xbt_automaton_parser__flush_buffer(b );
1511 b->yy_input_file = file;
1512 b->yy_fill_buffer = 1;
1514 /* If b is the current buffer, then xbt_automaton_parser__init_buffer was _probably_
1515 * called from xbt_automaton_parser_restart() or through yy_get_next_buffer.
1516 * In that case, we don't want to reset the lineno or column.
1518 if (b != YY_CURRENT_BUFFER){
1519 b->yy_bs_lineno = 1;
1520 b->yy_bs_column = 0;
1523 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1528 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1529 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1532 void xbt_automaton_parser__flush_buffer (YY_BUFFER_STATE b )
1539 /* We always need two end-of-buffer characters. The first causes
1540 * a transition to the end-of-buffer state. The second causes
1541 * a jam in that state.
1543 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1544 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1546 b->yy_buf_pos = &b->yy_ch_buf[0];
1549 b->yy_buffer_status = YY_BUFFER_NEW;
1551 if ( b == YY_CURRENT_BUFFER )
1552 xbt_automaton_parser__load_buffer_state( );
1555 /** Pushes the new state onto the stack. The new state becomes
1556 * the current state. This function will allocate the stack
1558 * @param new_buffer The new state.
1561 void xbt_automaton_parser_push_buffer_state (YY_BUFFER_STATE new_buffer )
1563 if (new_buffer == NULL)
1566 xbt_automaton_parser_ensure_buffer_stack();
1568 /* This block is copied from xbt_automaton_parser__switch_to_buffer. */
1569 if ( YY_CURRENT_BUFFER )
1571 /* Flush out information for old buffer. */
1572 *(yy_c_buf_p) = (yy_hold_char);
1573 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1574 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1577 /* Only push if top exists. Otherwise, replace top. */
1578 if (YY_CURRENT_BUFFER)
1579 (yy_buffer_stack_top)++;
1580 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1582 /* copied from xbt_automaton_parser__switch_to_buffer. */
1583 xbt_automaton_parser__load_buffer_state( );
1584 (yy_did_buffer_switch_on_eof) = 1;
1587 /** Removes and deletes the top of the stack, if present.
1588 * The next element becomes the new top.
1591 void xbt_automaton_parser_pop_buffer_state (void)
1593 if (!YY_CURRENT_BUFFER)
1596 xbt_automaton_parser__delete_buffer(YY_CURRENT_BUFFER );
1597 YY_CURRENT_BUFFER_LVALUE = NULL;
1598 if ((yy_buffer_stack_top) > 0)
1599 --(yy_buffer_stack_top);
1601 if (YY_CURRENT_BUFFER) {
1602 xbt_automaton_parser__load_buffer_state( );
1603 (yy_did_buffer_switch_on_eof) = 1;
1607 /* Allocates the stack if it does not exist.
1608 * Guarantees space for at least one push.
1610 static void xbt_automaton_parser_ensure_buffer_stack (void)
1612 yy_size_t num_to_alloc;
1614 if (!(yy_buffer_stack)) {
1616 /* First allocation is just for 2 elements, since we don't know if this
1617 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1618 * immediate realloc on the next call.
1621 (yy_buffer_stack) = (struct yy_buffer_state**)xbt_automaton_parser_alloc
1622 (num_to_alloc * sizeof(struct yy_buffer_state*)
1624 if ( ! (yy_buffer_stack) )
1625 YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser_ensure_buffer_stack()" );
1627 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1629 (yy_buffer_stack_max) = num_to_alloc;
1630 (yy_buffer_stack_top) = 0;
1634 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1636 /* Increase the buffer to prepare for a possible push. */
1637 int grow_size = 8 /* arbitrary grow size */;
1639 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1640 (yy_buffer_stack) = (struct yy_buffer_state**)xbt_automaton_parser_realloc
1642 num_to_alloc * sizeof(struct yy_buffer_state*)
1644 if ( ! (yy_buffer_stack) )
1645 YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser_ensure_buffer_stack()" );
1647 /* zero only the new slots.*/
1648 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1649 (yy_buffer_stack_max) = num_to_alloc;
1653 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1654 * @param base the character buffer
1655 * @param size the size in bytes of the character buffer
1657 * @return the newly allocated buffer state object.
1659 YY_BUFFER_STATE xbt_automaton_parser__scan_buffer (char * base, yy_size_t size )
1664 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1665 base[size-1] != YY_END_OF_BUFFER_CHAR )
1666 /* They forgot to leave room for the EOB's. */
1669 b = (YY_BUFFER_STATE) xbt_automaton_parser_alloc(sizeof( struct yy_buffer_state ) );
1671 YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser__scan_buffer()" );
1673 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1674 b->yy_buf_pos = b->yy_ch_buf = base;
1675 b->yy_is_our_buffer = 0;
1676 b->yy_input_file = 0;
1677 b->yy_n_chars = b->yy_buf_size;
1678 b->yy_is_interactive = 0;
1680 b->yy_fill_buffer = 0;
1681 b->yy_buffer_status = YY_BUFFER_NEW;
1683 xbt_automaton_parser__switch_to_buffer(b );
1688 /** Setup the input buffer state to scan a string. The next call to xbt_automaton_parser_lex() will
1689 * scan from a @e copy of @a str.
1690 * @param yystr a NUL-terminated string to scan
1692 * @return the newly allocated buffer state object.
1693 * @note If you want to scan bytes that may contain NUL values, then use
1694 * xbt_automaton_parser__scan_bytes() instead.
1696 YY_BUFFER_STATE xbt_automaton_parser__scan_string (yyconst char * yystr )
1699 return xbt_automaton_parser__scan_bytes(yystr,strlen(yystr) );
1702 /** Setup the input buffer state to scan the given bytes. The next call to xbt_automaton_parser_lex() will
1703 * scan from a @e copy of @a bytes.
1704 * @param yybytes the byte buffer to scan
1705 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1707 * @return the newly allocated buffer state object.
1709 YY_BUFFER_STATE xbt_automaton_parser__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
1716 /* Get memory for full buffer, including space for trailing EOB's. */
1717 n = _yybytes_len + 2;
1718 buf = (char *) xbt_automaton_parser_alloc(n );
1720 YY_FATAL_ERROR( "out of dynamic memory in xbt_automaton_parser__scan_bytes()" );
1722 for ( i = 0; i < _yybytes_len; ++i )
1723 buf[i] = yybytes[i];
1725 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1727 b = xbt_automaton_parser__scan_buffer(buf,n );
1729 YY_FATAL_ERROR( "bad buffer in xbt_automaton_parser__scan_bytes()" );
1731 /* It's okay to grow etc. this buffer, and we should throw it
1732 * away when we're done.
1734 b->yy_is_our_buffer = 1;
1739 #ifndef YY_EXIT_FAILURE
1740 #define YY_EXIT_FAILURE 2
1743 static void yy_fatal_error (yyconst char* msg )
1745 (void) fprintf( stderr, "%s\n", msg );
1746 exit( YY_EXIT_FAILURE );
1749 /* Redefine yyless() so it works in section 3 code. */
1755 /* Undo effects of setting up xbt_automaton_parser_text. */ \
1756 int yyless_macro_arg = (n); \
1757 YY_LESS_LINENO(yyless_macro_arg);\
1758 xbt_automaton_parser_text[xbt_automaton_parser_leng] = (yy_hold_char); \
1759 (yy_c_buf_p) = xbt_automaton_parser_text + yyless_macro_arg; \
1760 (yy_hold_char) = *(yy_c_buf_p); \
1761 *(yy_c_buf_p) = '\0'; \
1762 xbt_automaton_parser_leng = yyless_macro_arg; \
1766 /* Accessor methods (get/set functions) to struct members. */
1768 /** Get the current line number.
1771 int xbt_automaton_parser_get_lineno (void)
1774 return xbt_automaton_parser_lineno;
1777 /** Get the input stream.
1780 FILE *xbt_automaton_parser_get_in (void)
1782 return xbt_automaton_parser_in;
1785 /** Get the output stream.
1788 FILE *xbt_automaton_parser_get_out (void)
1790 return xbt_automaton_parser_out;
1793 /** Get the length of the current token.
1796 yy_size_t xbt_automaton_parser_get_leng (void)
1798 return xbt_automaton_parser_leng;
1801 /** Get the current token.
1805 char *xbt_automaton_parser_get_text (void)
1807 return xbt_automaton_parser_text;
1810 /** Set the current line number.
1811 * @param line_number
1814 void xbt_automaton_parser_set_lineno (int line_number )
1817 xbt_automaton_parser_lineno = line_number;
1820 /** Set the input stream. This does not discard the current
1822 * @param in_str A readable stream.
1824 * @see xbt_automaton_parser__switch_to_buffer
1826 void xbt_automaton_parser_set_in (FILE * in_str )
1828 xbt_automaton_parser_in = in_str ;
1831 void xbt_automaton_parser_set_out (FILE * out_str )
1833 xbt_automaton_parser_out = out_str ;
1836 int xbt_automaton_parser_get_debug (void)
1838 return xbt_automaton_parser__flex_debug;
1841 void xbt_automaton_parser_set_debug (int bdebug )
1843 xbt_automaton_parser__flex_debug = bdebug ;
1846 static int yy_init_globals (void)
1848 /* Initialization is the same as for the non-reentrant scanner.
1849 * This function is called from xbt_automaton_parser_lex_destroy(), so don't allocate here.
1852 (yy_buffer_stack) = 0;
1853 (yy_buffer_stack_top) = 0;
1854 (yy_buffer_stack_max) = 0;
1855 (yy_c_buf_p) = (char *) 0;
1859 /* Defined in main.c */
1861 xbt_automaton_parser_in = stdin;
1862 xbt_automaton_parser_out = stdout;
1864 xbt_automaton_parser_in = (FILE *) 0;
1865 xbt_automaton_parser_out = (FILE *) 0;
1868 /* For future reference: Set errno on error, since we are called by
1869 * xbt_automaton_parser_lex_init()
1874 /* xbt_automaton_parser_lex_destroy is for both reentrant and non-reentrant scanners. */
1875 int xbt_automaton_parser_lex_destroy (void)
1878 /* Pop the buffer stack, destroying each element. */
1879 while(YY_CURRENT_BUFFER){
1880 xbt_automaton_parser__delete_buffer(YY_CURRENT_BUFFER );
1881 YY_CURRENT_BUFFER_LVALUE = NULL;
1882 xbt_automaton_parser_pop_buffer_state();
1885 /* Destroy the stack itself. */
1886 xbt_automaton_parser_free((yy_buffer_stack) );
1887 (yy_buffer_stack) = NULL;
1889 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1890 * xbt_automaton_parser_lex() is called, initialization will occur. */
1897 * Internal utility routines.
1901 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1904 for ( i = 0; i < n; ++i )
1909 #ifdef YY_NEED_STRLEN
1910 static int yy_flex_strlen (yyconst char * s )
1913 for ( n = 0; s[n]; ++n )
1920 void *xbt_automaton_parser_alloc (yy_size_t size )
1922 return (void *) malloc( size );
1925 void *xbt_automaton_parser_realloc (void * ptr, yy_size_t size )
1927 /* The cast to (char *) in the following accommodates both
1928 * implementations that use char* generic pointers, and those
1929 * that use void* generic pointers. It works with the latter
1930 * because both ANSI C and C++ allow castless assignment from
1931 * any pointer type to void*, and deal with argument conversions
1932 * as though doing an assignment.
1934 return (void *) realloc( (char *) ptr, size );
1937 void xbt_automaton_parser_free (void * ptr )
1939 free( (char *) ptr ); /* see xbt_automaton_parser_realloc() for (char *) cast */
1942 #define YYTABLES_NAME "yytables"
1944 #line 80 "parserPromela.lex"