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 6
31 #define YY_FLEX_SUBMINOR_VERSION 1
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 */
110 /* TODO: this is always defined, so inline it */
111 #define yyconst const
113 #if defined(__GNUC__) && __GNUC__ >= 3
114 #define yynoreturn __attribute__((__noreturn__))
119 /* Returned upon end-of-file. */
122 /* Promotes a possibly negative, possibly signed char to an unsigned
123 * integer for use as an array index. If the signed char is negative,
124 * we want to instead treat it as an 8-bit unsigned char, hence the
127 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
129 /* Enter a start condition. This macro really ought to take a parameter,
130 * but we do it the disgusting crufty way forced on us by the ()-less
131 * definition of BEGIN.
133 #define BEGIN (yy_start) = 1 + 2 *
135 /* Translate the current start state into a value that can be later handed
136 * to BEGIN to return to the state. The YYSTATE alias is for lex
139 #define YY_START (((yy_start) - 1) / 2)
140 #define YYSTATE YY_START
142 /* Action number for EOF rule of a given start state. */
143 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
145 /* Special action meaning "start processing a new file". */
146 #define YY_NEW_FILE xbt_automaton_parser_restart(xbt_automaton_parser_in )
148 #define YY_END_OF_BUFFER_CHAR 0
150 /* Size of default input buffer. */
153 /* On IA-64, the buffer size is 16k, not 8k.
154 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
155 * Ditto for the __ia64__ case accordingly.
157 #define YY_BUF_SIZE 32768
159 #define YY_BUF_SIZE 16384
160 #endif /* __ia64__ */
163 /* The state buf must be large enough to hold one state per character in the main buffer.
165 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
167 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
168 #define YY_TYPEDEF_YY_BUFFER_STATE
169 typedef struct yy_buffer_state *YY_BUFFER_STATE;
172 #ifndef YY_TYPEDEF_YY_SIZE_T
173 #define YY_TYPEDEF_YY_SIZE_T
174 typedef size_t yy_size_t;
177 extern int xbt_automaton_parser_leng;
179 extern FILE *xbt_automaton_parser_in, *xbt_automaton_parser_out;
181 #define EOB_ACT_CONTINUE_SCAN 0
182 #define EOB_ACT_END_OF_FILE 1
183 #define EOB_ACT_LAST_MATCH 2
185 #define YY_LESS_LINENO(n)
186 #define YY_LINENO_REWIND_TO(ptr)
188 /* Return all but the first "n" matched characters back to the input stream. */
191 /* Undo effects of setting up xbt_automaton_parser_text. */ \
192 int yyless_macro_arg = (n); \
193 YY_LESS_LINENO(yyless_macro_arg); \
194 *yy_cp = (yy_hold_char); \
195 YY_RESTORE_YY_MORE_OFFSET(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
196 YY_DO_BEFORE_ACTION; /* set up xbt_automaton_parser_text again */ \
199 #define unput(c) yyunput( c, (yytext_ptr) )
201 #ifndef YY_STRUCT_YY_BUFFER_STATE
202 #define YY_STRUCT_YY_BUFFER_STATE
203 struct yy_buffer_state {
206 char* yy_ch_buf; /* input buffer */
207 char* yy_buf_pos; /* current position in input buffer */
209 /* Size of input buffer in bytes, not including room for EOB
214 /* Number of characters read into yy_ch_buf, not including EOB
219 /* Whether we "own" the buffer - i.e., we know we created it,
220 * and can realloc() it to grow it, and should free() it to
223 int yy_is_our_buffer;
225 /* Whether this is an "interactive" input source; if so, and
226 * if we're using stdio for input, then we want to use getc()
227 * instead of fread(), to make sure we stop fetching input after
230 int yy_is_interactive;
232 /* Whether we're considered to be at the beginning of a line.
233 * If so, '^' rules will be active on the next match, otherwise
238 int yy_bs_lineno; /**< The line count. */
239 int yy_bs_column; /**< The column count. */
241 /* Whether to try to fill the input buffer when we reach the
246 int yy_buffer_status;
248 #define YY_BUFFER_NEW 0
249 #define YY_BUFFER_NORMAL 1
250 /* When an EOF's been seen but there's still some text to process
251 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
252 * shouldn't try reading from the input source any more. We might
253 * still have a bunch of tokens to match, though, because of
254 * possible backing-up.
256 * When we actually see the EOF, we change the status to "new"
257 * (via xbt_automaton_parser_restart()), so that the user can continue scanning by
258 * just pointing xbt_automaton_parser_in at a new input file.
260 #define YY_BUFFER_EOF_PENDING 2
262 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
264 /* Stack of input buffers. */
265 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
266 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
267 static YY_BUFFER_STATE* yy_buffer_stack = NULL; /**< Stack as an array. */
269 /* We provide macros for accessing buffer states in case in the
270 * future we want to put the buffer states in a more general
273 * Returns the top of the stack, or NULL.
275 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
276 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
279 /* Same as previous macro, but useful when we know that the buffer stack is not
280 * NULL or when we need an lvalue. For internal use only.
282 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
284 /* yy_hold_char holds the character lost when xbt_automaton_parser_text is formed. */
285 static char yy_hold_char;
286 static int yy_n_chars; /* number of characters read into yy_ch_buf */
287 int xbt_automaton_parser_leng;
289 /* Points to current character in buffer. */
290 static char* yy_c_buf_p = NULL;
291 static int yy_init = 0; /* whether we need to initialize */
292 static int yy_start = 0; /* start state number */
294 /* Flag which is used to allow xbt_automaton_parser_wrap()'s to do buffer switches
295 * instead of setting up a fresh xbt_automaton_parser_in. A bit of a hack ...
297 static int yy_did_buffer_switch_on_eof;
299 void xbt_automaton_parser_restart (FILE *input_file );
300 void xbt_automaton_parser__switch_to_buffer (YY_BUFFER_STATE new_buffer );
301 YY_BUFFER_STATE xbt_automaton_parser__create_buffer (FILE *file,int size );
302 void xbt_automaton_parser__delete_buffer (YY_BUFFER_STATE b );
303 void xbt_automaton_parser__flush_buffer (YY_BUFFER_STATE b );
304 void xbt_automaton_parser_push_buffer_state (YY_BUFFER_STATE new_buffer );
305 void xbt_automaton_parser_pop_buffer_state (void );
307 static void xbt_automaton_parser_ensure_buffer_stack (void );
308 static void xbt_automaton_parser__load_buffer_state (void );
309 static void xbt_automaton_parser__init_buffer (YY_BUFFER_STATE b,FILE *file );
311 #define YY_FLUSH_BUFFER xbt_automaton_parser__flush_buffer(YY_CURRENT_BUFFER )
313 YY_BUFFER_STATE xbt_automaton_parser__scan_buffer (char *base,yy_size_t size );
314 YY_BUFFER_STATE xbt_automaton_parser__scan_string (yyconst char *yy_str );
315 YY_BUFFER_STATE xbt_automaton_parser__scan_bytes(yyconst char* bytes, int len);
317 void *xbt_automaton_parser_alloc (yy_size_t );
318 void *xbt_automaton_parser_realloc (void *,yy_size_t );
319 void xbt_automaton_parser_free (void * );
321 #define yy_new_buffer xbt_automaton_parser__create_buffer
323 #define yy_set_interactive(is_interactive) \
325 if (!YY_CURRENT_BUFFER) { \
326 xbt_automaton_parser_ensure_buffer_stack(); \
327 YY_CURRENT_BUFFER_LVALUE = xbt_automaton_parser__create_buffer(xbt_automaton_parser_in, YY_BUF_SIZE); \
329 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
332 #define yy_set_bol(at_bol) \
334 if (!YY_CURRENT_BUFFER) { \
335 xbt_automaton_parser_ensure_buffer_stack(); \
336 YY_CURRENT_BUFFER_LVALUE = xbt_automaton_parser__create_buffer(xbt_automaton_parser_in, YY_BUF_SIZE); \
338 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
341 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
343 /* Begin user sect3 */
345 #define xbt_automaton_parser_wrap() (/*CONSTCOND*/1)
346 #define YY_SKIP_YYWRAP
348 typedef unsigned char YY_CHAR;
350 FILE *xbt_automaton_parser_in = NULL, *xbt_automaton_parser_out = NULL;
352 typedef int yy_state_type;
354 extern int xbt_automaton_parser_lineno;
356 int xbt_automaton_parser_lineno = 1;
358 extern char *xbt_automaton_parser_text;
362 #define yytext_ptr xbt_automaton_parser_text
364 static yy_state_type yy_get_previous_state (void );
365 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
366 static int yy_get_next_buffer (void );
367 static void yynoreturn yy_fatal_error(yyconst char* msg);
369 /* Done after the current pattern has been matched and before the
370 * corresponding action - sets up xbt_automaton_parser_text.
372 #define YY_DO_BEFORE_ACTION \
373 (yytext_ptr) = yy_bp; \
374 xbt_automaton_parser_leng = (int)(yy_cp - yy_bp); \
375 (yy_hold_char) = *yy_cp; \
377 (yy_c_buf_p) = yy_cp;
379 #define YY_NUM_RULES 25
380 #define YY_END_OF_BUFFER 26
381 /* This struct is not used in this scanner,
382 but its presence is necessary. */
383 struct yy_trans_info {
384 flex_int32_t yy_verify;
387 static yyconst flex_int16_t yy_accept[54] =
389 0, 0, 26, 24, 18, 23, 8, 24, 24, 9,
390 10, 24, 24, 20, 14, 12, 13, 22, 22, 22,
391 22, 22, 15, 24, 16, 18, 0, 0, 21, 0,
392 6, 4, 0, 0, 20, 11, 22, 3, 22, 2,
393 22, 7, 0, 0, 0, 19, 22, 22, 17, 5,
397 static yyconst YY_CHAR yy_ec[256] =
399 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
400 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
401 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
402 1, 4, 5, 6, 1, 1, 1, 7, 1, 8,
403 9, 10, 1, 1, 11, 12, 13, 14, 15, 14,
404 14, 14, 14, 14, 14, 14, 14, 16, 17, 1,
405 1, 18, 1, 1, 19, 19, 19, 19, 19, 19,
406 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
407 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
408 1, 20, 1, 1, 21, 1, 19, 19, 19, 19,
410 22, 23, 24, 19, 25, 19, 19, 19, 19, 26,
411 27, 19, 19, 28, 19, 29, 19, 30, 19, 19,
412 19, 19, 31, 32, 33, 1, 1, 1, 1, 1,
413 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
414 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
415 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
416 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
417 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
418 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
419 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
421 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
422 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
423 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
424 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
425 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
429 static yyconst YY_CHAR yy_meta[34] =
431 1, 1, 2, 2, 1, 2, 1, 1, 1, 1,
432 1, 1, 3, 4, 4, 1, 1, 1, 4, 2,
433 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
437 static yyconst flex_uint16_t yy_base[57] =
439 0, 0, 89, 90, 32, 90, 90, 34, 81, 90,
440 90, 69, 76, 27, 31, 69, 90, 0, 59, 56,
441 58, 55, 90, 42, 90, 45, 47, 0, 0, 0,
442 90, 90, 52, 43, 49, 90, 0, 0, 44, 0,
443 42, 90, 56, 65, 52, 56, 25, 26, 90, 0,
444 16, 0, 90, 74, 31, 78
447 static yyconst flex_int16_t yy_def[57] =
449 53, 1, 53, 53, 53, 53, 53, 54, 53, 53,
450 53, 53, 53, 53, 53, 53, 53, 55, 55, 55,
451 55, 55, 53, 53, 53, 53, 54, 27, 27, 27,
452 53, 53, 56, 53, 53, 53, 55, 55, 55, 55,
453 55, 53, 56, 56, 53, 53, 55, 55, 53, 55,
454 55, 55, 0, 53, 53, 53
457 static yyconst flex_uint16_t yy_nxt[124] =
459 4, 5, 6, 5, 7, 8, 9, 10, 11, 4,
460 12, 4, 13, 14, 15, 16, 17, 4, 18, 4,
461 4, 18, 19, 20, 21, 22, 18, 18, 18, 18,
462 23, 24, 25, 26, 37, 26, 27, 28, 34, 29,
463 35, 35, 34, 52, 35, 35, 26, 51, 26, 27,
464 28, 50, 29, 27, 44, 44, 46, 46, 44, 44,
465 34, 45, 35, 35, 49, 45, 27, 44, 44, 46,
466 46, 48, 47, 42, 45, 30, 41, 30, 43, 43,
467 40, 43, 39, 38, 36, 33, 32, 31, 53, 3,
468 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
470 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
471 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
475 static yyconst flex_int16_t yy_chk[124] =
477 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
478 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
479 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
480 1, 1, 1, 5, 55, 5, 8, 8, 14, 8,
481 14, 14, 15, 51, 15, 15, 26, 48, 26, 27,
482 27, 47, 27, 8, 33, 33, 34, 34, 43, 43,
483 35, 33, 35, 35, 45, 43, 27, 44, 44, 46,
484 46, 41, 39, 24, 44, 54, 22, 54, 56, 56,
485 21, 56, 20, 19, 16, 13, 12, 9, 3, 53,
486 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
488 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
489 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
493 static yy_state_type yy_last_accepting_state;
494 static char *yy_last_accepting_cpos;
496 extern int xbt_automaton_parser__flex_debug;
497 int xbt_automaton_parser__flex_debug = 0;
499 /* The intent behind this definition is that it'll catch
500 * any uses of REJECT which flex missed.
502 #define REJECT reject_used_but_not_detected
503 #define yymore() yymore_used_but_not_detected
504 #define YY_MORE_ADJ 0
505 #define YY_RESTORE_YY_MORE_OFFSET
506 char *xbt_automaton_parser_text;
507 #line 1 "parserPromela.lex"
508 /* Copyright (c) 2012-2018. The SimGrid Team.
509 * All rights reserved. */
510 /* This program is free software; you can redistribute it and/or modify it
511 * under the terms of the license (GNU LGPL) which comes with this package. */
512 #line 10 "parserPromela.lex"
514 #include "simgrid/config.h"
516 #define YY_NO_UNISTD_H /* hello Windows */
520 #include "parserPromela.tab.hacc"
522 extern YYSTYPE yylval;
524 #line 533 "automaton_lexer.yy.c"
528 #ifndef YY_NO_UNISTD_H
529 /* Special case for "unistd.h", since it is non-ANSI. We include it way
530 * down here because we want the user's section 1 to have been scanned first.
531 * The user has a chance to override it with an option.
536 #ifndef YY_EXTRA_TYPE
537 #define YY_EXTRA_TYPE void *
540 static int yy_init_globals (void );
542 /* Accessor methods to globals.
543 These are made visible to non-reentrant scanners for convenience. */
545 int xbt_automaton_parser_lex_destroy (void );
547 int xbt_automaton_parser_get_debug (void );
549 void xbt_automaton_parser_set_debug (int debug_flag );
551 YY_EXTRA_TYPE xbt_automaton_parser_get_extra (void );
553 void xbt_automaton_parser_set_extra (YY_EXTRA_TYPE user_defined );
555 FILE *xbt_automaton_parser_get_in (void );
557 void xbt_automaton_parser_set_in (FILE * _in_str );
559 FILE *xbt_automaton_parser_get_out (void );
561 void xbt_automaton_parser_set_out (FILE * _out_str );
563 int xbt_automaton_parser_get_leng(void);
565 char *xbt_automaton_parser_get_text (void );
567 int xbt_automaton_parser_get_lineno (void );
569 void xbt_automaton_parser_set_lineno (int _line_number );
571 /* Macros after this point can all be overridden by user definitions in
575 #ifndef YY_SKIP_YYWRAP
577 extern "C" int xbt_automaton_parser_wrap (void );
579 extern int xbt_automaton_parser_wrap (void );
585 static void yyunput (int c,char *buf_ptr );
590 static void yy_flex_strncpy (char *,yyconst char *,int );
593 #ifdef YY_NEED_STRLEN
594 static int yy_flex_strlen (yyconst char * );
600 static int yyinput (void );
602 static int input (void );
607 /* Amount of stuff to slurp up with each read. */
608 #ifndef YY_READ_BUF_SIZE
610 /* On IA-64, the buffer size is 16k, not 8k */
611 #define YY_READ_BUF_SIZE 16384
613 #define YY_READ_BUF_SIZE 8192
614 #endif /* __ia64__ */
617 /* Copy whatever the last rule matched to the standard output. */
619 /* This used to be an fputs(), but since the string might contain NUL's,
620 * we now use fwrite().
624 if (fwrite(xbt_automaton_parser_text, (size_t)xbt_automaton_parser_leng, 1, xbt_automaton_parser_out)) { \
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) { \
637 for (n = 0; n < max_size && (c = getc(xbt_automaton_parser_in)) != EOF && c != '\n'; ++n) \
640 buf[n++] = (char)c; \
641 if (c == EOF && ferror(xbt_automaton_parser_in)) \
642 YY_FATAL_ERROR("input in flex scanner failed"); \
646 while ((result = (int)fread(buf, 1, max_size, xbt_automaton_parser_in)) == 0 && ferror(xbt_automaton_parser_in)) { \
647 if (errno != EINTR) { \
648 YY_FATAL_ERROR("input in flex scanner failed"); \
652 clearerr(xbt_automaton_parser_in); \
658 /* No semi-colon after return; correct usage is to write "yyterminate();" -
659 * we don't want an extra ';' after the "return" because that will cause
660 * some compilers to complain about unreachable statements.
663 #define yyterminate() return YY_NULL
666 /* Number of entries by which start-condition stack grows. */
667 #ifndef YY_START_STACK_INCR
668 #define YY_START_STACK_INCR 25
671 /* Report a fatal error. */
672 #ifndef YY_FATAL_ERROR
673 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
676 /* end tables serialization structures and prototypes */
678 /* Default declaration of generated scanner - a define so the user can
679 * easily add parameters.
682 #define YY_DECL_IS_OURS 1
684 extern int xbt_automaton_parser_lex (void);
686 #define YY_DECL int xbt_automaton_parser_lex (void)
687 #endif /* !YY_DECL */
689 /* Code executed at the beginning of each rule, after xbt_automaton_parser_text and xbt_automaton_parser_leng
692 #ifndef YY_USER_ACTION
693 #define YY_USER_ACTION
696 /* Code executed at the end of each rule. */
698 #define YY_BREAK /*LINTED*/break;
701 #define YY_RULE_SETUP YY_USER_ACTION
703 /** The main scanner function which does all the work.
707 yy_state_type yy_current_state;
719 (yy_start) = 1; /* first start state */
721 if (!xbt_automaton_parser_in)
722 xbt_automaton_parser_in = stdin;
724 if (!xbt_automaton_parser_out)
725 xbt_automaton_parser_out = stdout;
727 if (!YY_CURRENT_BUFFER) {
728 xbt_automaton_parser_ensure_buffer_stack();
729 YY_CURRENT_BUFFER_LVALUE = xbt_automaton_parser__create_buffer(xbt_automaton_parser_in, YY_BUF_SIZE);
732 xbt_automaton_parser__load_buffer_state();
736 #line 38 "parserPromela.lex"
738 #line 754 "automaton_lexer.yy.c"
740 while (/*CONSTCOND*/ 1) /* loops until end-of-file is reached */
742 yy_cp = (yy_c_buf_p);
744 /* Support of xbt_automaton_parser_text. */
745 *yy_cp = (yy_hold_char);
747 /* yy_bp points to the position in yy_ch_buf of the start of
752 yy_current_state = (yy_start);
755 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
756 if (yy_accept[yy_current_state]) {
757 (yy_last_accepting_state) = yy_current_state;
758 (yy_last_accepting_cpos) = yy_cp;
760 while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) {
761 yy_current_state = (int)yy_def[yy_current_state];
762 if (yy_current_state >= 54)
763 yy_c = yy_meta[(unsigned int)yy_c];
765 yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t)yy_c];
767 } while (yy_base[yy_current_state] != 90);
770 yy_act = yy_accept[yy_current_state];
771 if (yy_act == 0) { /* have to back up */
772 yy_cp = (yy_last_accepting_cpos);
773 yy_current_state = (yy_last_accepting_state);
774 yy_act = yy_accept[yy_current_state];
779 do_action: /* This label is used only to access EOF actions. */
781 switch (yy_act) { /* beginning of action switch */
782 case 0: /* must back up */
783 /* undo the effects of YY_DO_BEFORE_ACTION */
784 *yy_cp = (yy_hold_char);
785 yy_cp = (yy_last_accepting_cpos);
786 yy_current_state = (yy_last_accepting_state);
791 #line 40 "parserPromela.lex"
796 #line 41 "parserPromela.lex"
801 #line 42 "parserPromela.lex"
806 #line 43 "parserPromela.lex"
807 { return (IMPLIES); }
811 #line 44 "parserPromela.lex"
816 #line 45 "parserPromela.lex"
821 #line 46 "parserPromela.lex"
826 #line 47 "parserPromela.lex"
831 #line 48 "parserPromela.lex"
832 { return (LEFT_PAR); }
836 #line 49 "parserPromela.lex"
837 { return (RIGHT_PAR); }
841 #line 50 "parserPromela.lex"
846 #line 51 "parserPromela.lex"
851 #line 52 "parserPromela.lex"
852 { return (SEMI_COLON); }
856 #line 53 "parserPromela.lex"
857 { return (CASE_TRUE); }
861 #line 54 "parserPromela.lex"
862 { return (LEFT_BRACE); }
866 #line 55 "parserPromela.lex"
867 { return (RIGHT_BRACE); }
870 /* rule 17 can match eol */
872 #line 58 "parserPromela.lex"
877 #line 60 "parserPromela.lex"
882 #line 63 "parserPromela.lex"
883 { sscanf(xbt_automaton_parser_text,"%lf",&yylval.real);
884 return (LITT_REEL); }
888 #line 66 "parserPromela.lex"
889 { sscanf(xbt_automaton_parser_text,"%d",&yylval.integer);
893 /* rule 21 can match eol */
895 #line 69 "parserPromela.lex"
896 { yylval.string=(char *)malloc(strlen(xbt_automaton_parser_text)+1);
897 sscanf(xbt_automaton_parser_text,"%s",yylval.string);
898 return (LITT_CHAINE); }
902 #line 73 "parserPromela.lex"
903 { yylval.string=(char *)malloc(strlen(xbt_automaton_parser_text)+1);
904 sscanf(xbt_automaton_parser_text,"%s",yylval.string);
909 /* rule 23 can match eol */
911 #line 77 "parserPromela.lex"
916 #line 79 "parserPromela.lex"
921 #line 81 "parserPromela.lex"
924 #line 945 "automaton_lexer.yy.c"
925 case YY_STATE_EOF(INITIAL):
928 case YY_END_OF_BUFFER: {
929 /* Amount of text matched not including the EOB char. */
930 int yy_amount_of_matched_text = (int)(yy_cp - (yytext_ptr)) - 1;
932 /* Undo the effects of YY_DO_BEFORE_ACTION. */
933 *yy_cp = (yy_hold_char);
934 YY_RESTORE_YY_MORE_OFFSET
936 if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW) {
937 /* We're scanning a new file or input source. It's
938 * possible that this happened because the user
939 * just pointed xbt_automaton_parser_in at a new source and called
940 * xbt_automaton_parser_lex(). If so, then we have to assure
941 * consistency between YY_CURRENT_BUFFER and our
942 * globals. Here is the right place to do so, because
943 * this is the first action (other than possibly a
944 * back-up) that will match for the new input source.
946 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
947 YY_CURRENT_BUFFER_LVALUE->yy_input_file = xbt_automaton_parser_in;
948 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
951 /* Note that here we test for yy_c_buf_p "<=" to the position
952 * of the first EOB in the buffer, since yy_c_buf_p will
953 * already have been incremented past the NUL character
954 * (since all states make transitions on EOB to the
955 * end-of-buffer state). Contrast this with the test
958 if ((yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]) { /* This was really a NUL. */
959 yy_state_type yy_next_state;
961 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
963 yy_current_state = yy_get_previous_state();
965 /* Okay, we're now positioned to make the NUL
966 * transition. We couldn't have
967 * yy_get_previous_state() go ahead and do it
968 * for us because it doesn't know how to deal
969 * with the possibility of jamming (and we don't
970 * want to build jamming into it because then it
971 * will run more slowly).
974 yy_next_state = yy_try_NUL_trans(yy_current_state);
976 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
979 /* Consume the NUL. */
980 yy_cp = ++(yy_c_buf_p);
981 yy_current_state = yy_next_state;
986 yy_cp = (yy_c_buf_p);
992 switch (yy_get_next_buffer()) {
993 case EOB_ACT_END_OF_FILE: {
994 (yy_did_buffer_switch_on_eof) = 0;
996 if (xbt_automaton_parser_wrap()) {
997 /* Note: because we've taken care in
998 * yy_get_next_buffer() to have set up
999 * xbt_automaton_parser_text, we can now set up
1000 * yy_c_buf_p so that if some total
1001 * hoser (like flex itself) wants to
1002 * call the scanner after we return the
1003 * YY_NULL, it'll still work - another
1004 * YY_NULL will get returned.
1006 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1008 yy_act = YY_STATE_EOF(YY_START);
1013 if (!(yy_did_buffer_switch_on_eof))
1019 case EOB_ACT_CONTINUE_SCAN:
1020 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1022 yy_current_state = yy_get_previous_state();
1024 yy_cp = (yy_c_buf_p);
1025 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1028 case EOB_ACT_LAST_MATCH:
1029 (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1031 yy_current_state = yy_get_previous_state();
1033 yy_cp = (yy_c_buf_p);
1034 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1035 goto yy_find_action;
1041 YY_FATAL_ERROR("fatal flex scanner internal error--no action found");
1042 } /* end of action switch */
1043 } /* end of scanning one token */
1044 } /* end of user's declarations */
1045 } /* end of xbt_automaton_parser_lex */
1047 /* yy_get_next_buffer - try to read in a new buffer
1049 * Returns a code representing an action:
1050 * EOB_ACT_LAST_MATCH -
1051 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1052 * EOB_ACT_END_OF_FILE - end of file
1054 static int yy_get_next_buffer (void)
1056 char* dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1057 char* source = (yytext_ptr);
1058 int number_to_move, i;
1061 if ((yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1])
1062 YY_FATAL_ERROR("fatal flex scanner internal error--end of buffer missed");
1064 if (YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0) { /* Don't try to fill the buffer, so this is an EOF. */
1065 if ((yy_c_buf_p) - (yytext_ptr)-YY_MORE_ADJ == 1) {
1066 /* We matched a single character, the EOB, so
1067 * treat this as a final EOF.
1069 return EOB_ACT_END_OF_FILE;
1073 /* We matched some text prior to the EOB, first
1076 return EOB_ACT_LAST_MATCH;
1080 /* Try to read more data. */
1082 /* First move last chars to start of buffer. */
1083 number_to_move = (int)((yy_c_buf_p) - (yytext_ptr)-1);
1085 for (i = 0; i < number_to_move; ++i)
1086 *(dest++) = *(source++);
1088 if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING)
1089 /* don't do the read, it's not guaranteed to return an EOF,
1092 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1095 int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1097 while (num_to_read <= 0) { /* Not enough room in the buffer - grow it. */
1099 /* just a shorter name for the current buffer */
1100 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1102 int yy_c_buf_p_offset = (int)((yy_c_buf_p)-b->yy_ch_buf);
1104 if (b->yy_is_our_buffer) {
1105 int new_size = b->yy_buf_size * 2;
1108 b->yy_buf_size += b->yy_buf_size / 8;
1110 b->yy_buf_size *= 2;
1112 b->yy_ch_buf = (char*)
1113 /* Include room in for 2 EOB chars. */
1114 xbt_automaton_parser_realloc((void*)b->yy_ch_buf, b->yy_buf_size + 2);
1116 /* Can't grow it, we don't own it. */
1117 b->yy_ch_buf = NULL;
1120 YY_FATAL_ERROR("fatal error - scanner input buffer overflow");
1122 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1124 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1127 if (num_to_read > YY_READ_BUF_SIZE)
1128 num_to_read = YY_READ_BUF_SIZE;
1130 /* Read in more data. */
1131 YY_INPUT((&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read);
1133 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1136 if ((yy_n_chars) == 0) {
1137 if (number_to_move == YY_MORE_ADJ) {
1138 ret_val = EOB_ACT_END_OF_FILE;
1139 xbt_automaton_parser_restart(xbt_automaton_parser_in);
1143 ret_val = EOB_ACT_LAST_MATCH;
1144 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING;
1149 ret_val = EOB_ACT_CONTINUE_SCAN;
1151 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1152 /* Extend the array by 50%, plus the number we really need. */
1153 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1154 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf =
1155 (char*)xbt_automaton_parser_realloc((void*)YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, new_size);
1156 if (!YY_CURRENT_BUFFER_LVALUE->yy_ch_buf)
1157 YY_FATAL_ERROR("out of dynamic memory in yy_get_next_buffer()");
1160 (yy_n_chars) += number_to_move;
1161 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1162 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1164 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1169 /* yy_get_previous_state - get the state just before the EOB char was reached */
1171 static yy_state_type yy_get_previous_state (void)
1173 yy_state_type yy_current_state;
1176 yy_current_state = (yy_start);
1178 for (yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp) {
1179 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1180 if (yy_accept[yy_current_state]) {
1181 (yy_last_accepting_state) = yy_current_state;
1182 (yy_last_accepting_cpos) = yy_cp;
1184 while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) {
1185 yy_current_state = (int)yy_def[yy_current_state];
1186 if (yy_current_state >= 54)
1187 yy_c = yy_meta[(unsigned int)yy_c];
1189 yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t)yy_c];
1192 return yy_current_state;
1195 /* yy_try_NUL_trans - try to make a transition on the NUL character
1198 * next_state = yy_try_NUL_trans( current_state );
1200 static yy_state_type yy_try_NUL_trans(yy_state_type yy_current_state)
1203 char* yy_cp = (yy_c_buf_p);
1206 if (yy_accept[yy_current_state]) {
1207 (yy_last_accepting_state) = yy_current_state;
1208 (yy_last_accepting_cpos) = yy_cp;
1210 while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) {
1211 yy_current_state = (int)yy_def[yy_current_state];
1212 if (yy_current_state >= 54)
1213 yy_c = yy_meta[(unsigned int)yy_c];
1215 yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t)yy_c];
1216 yy_is_jam = (yy_current_state == 53);
1218 return yy_is_jam ? 0 : yy_current_state;
1223 static void yyunput (int c, char * yy_bp )
1227 yy_cp = (yy_c_buf_p);
1229 /* undo effects of setting up xbt_automaton_parser_text */
1230 *yy_cp = (yy_hold_char);
1232 if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2) { /* need to shift things up to make room */
1233 /* +2 for EOB chars. */
1234 int number_to_move = (yy_n_chars) + 2;
1235 char* dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1236 char* source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1238 while (source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf)
1239 *--dest = *--source;
1241 yy_cp += (int)(dest - source);
1242 yy_bp += (int)(dest - source);
1243 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = (int)YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1245 if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2)
1246 YY_FATAL_ERROR("flex scanner push-back overflow");
1251 (yytext_ptr) = yy_bp;
1252 (yy_hold_char) = *yy_cp;
1253 (yy_c_buf_p) = yy_cp;
1260 static int yyinput (void)
1262 static int input (void)
1268 *(yy_c_buf_p) = (yy_hold_char);
1270 if (*(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR) {
1271 /* yy_c_buf_p now points to the character we want to return.
1272 * If this occurs *before* the EOB characters, then it's a
1273 * valid NUL; if not, then we've hit the end of the buffer.
1275 if ((yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)])
1276 /* This was really a NUL. */
1277 *(yy_c_buf_p) = '\0';
1279 else { /* need more input */
1280 int offset = (yy_c_buf_p) - (yytext_ptr);
1283 switch (yy_get_next_buffer()) {
1284 case EOB_ACT_LAST_MATCH:
1285 /* This happens because yy_g_n_b()
1286 * sees that we've accumulated a
1287 * token and flags that we need to
1288 * try matching the token before
1289 * proceeding. But for input(),
1290 * there's no matching to consider.
1291 * So convert the EOB_ACT_LAST_MATCH
1292 * to EOB_ACT_END_OF_FILE.
1295 /* Reset buffer status. */
1296 xbt_automaton_parser_restart(xbt_automaton_parser_in);
1300 case EOB_ACT_END_OF_FILE: {
1301 if (xbt_automaton_parser_wrap())
1304 if (!(yy_did_buffer_switch_on_eof))
1313 case EOB_ACT_CONTINUE_SCAN:
1314 (yy_c_buf_p) = (yytext_ptr) + offset;
1320 c = *(unsigned char*)(yy_c_buf_p); /* cast for 8-bit char's */
1321 *(yy_c_buf_p) = '\0'; /* preserve xbt_automaton_parser_text */
1322 (yy_hold_char) = *++(yy_c_buf_p);
1326 #endif /* ifndef YY_NO_INPUT */
1328 /** Immediately switch to a different input stream.
1329 * @param input_file A readable stream.
1331 * @note This function does not reset the start condition to @c INITIAL .
1333 void xbt_automaton_parser_restart(FILE* input_file)
1336 if (!YY_CURRENT_BUFFER) {
1337 xbt_automaton_parser_ensure_buffer_stack();
1338 YY_CURRENT_BUFFER_LVALUE = xbt_automaton_parser__create_buffer(xbt_automaton_parser_in, YY_BUF_SIZE);
1341 xbt_automaton_parser__init_buffer(YY_CURRENT_BUFFER, input_file);
1342 xbt_automaton_parser__load_buffer_state();
1345 /** Switch to a different input buffer.
1346 * @param new_buffer The new input buffer.
1349 void xbt_automaton_parser__switch_to_buffer(YY_BUFFER_STATE new_buffer)
1352 /* TODO. We should be able to replace this entire function body
1354 * xbt_automaton_parser_pop_buffer_state();
1355 * xbt_automaton_parser_push_buffer_state(new_buffer);
1357 xbt_automaton_parser_ensure_buffer_stack();
1358 if (YY_CURRENT_BUFFER == new_buffer)
1361 if (YY_CURRENT_BUFFER) {
1362 /* Flush out information for old buffer. */
1363 *(yy_c_buf_p) = (yy_hold_char);
1364 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1365 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1368 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1369 xbt_automaton_parser__load_buffer_state();
1371 /* We don't actually know whether we did this switch during
1372 * EOF (xbt_automaton_parser_wrap()) processing, but the only time this flag
1373 * is looked at is after xbt_automaton_parser_wrap() is called, so it's safe
1374 * to go ahead and always set it.
1376 (yy_did_buffer_switch_on_eof) = 1;
1379 static void xbt_automaton_parser__load_buffer_state (void)
1381 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1382 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1383 xbt_automaton_parser_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1384 (yy_hold_char) = *(yy_c_buf_p);
1387 /** Allocate and initialize an input buffer state.
1388 * @param file A readable stream.
1389 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1391 * @return the allocated buffer state.
1393 YY_BUFFER_STATE xbt_automaton_parser__create_buffer(FILE* file, int size)
1397 b = (YY_BUFFER_STATE)xbt_automaton_parser_alloc(sizeof(struct yy_buffer_state));
1399 YY_FATAL_ERROR("out of dynamic memory in xbt_automaton_parser__create_buffer()");
1401 b->yy_buf_size = (yy_size_t)size;
1403 /* yy_ch_buf has to be 2 characters longer than the size given because
1404 * we need to put in 2 end-of-buffer characters.
1406 b->yy_ch_buf = (char*)xbt_automaton_parser_alloc(b->yy_buf_size + 2);
1408 YY_FATAL_ERROR("out of dynamic memory in xbt_automaton_parser__create_buffer()");
1410 b->yy_is_our_buffer = 1;
1412 xbt_automaton_parser__init_buffer(b, file);
1417 /** Destroy the buffer.
1418 * @param b a buffer created with xbt_automaton_parser__create_buffer()
1421 void xbt_automaton_parser__delete_buffer(YY_BUFFER_STATE b)
1427 if (b == YY_CURRENT_BUFFER) /* Not sure if we should pop here. */
1428 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE)0;
1430 if (b->yy_is_our_buffer)
1431 xbt_automaton_parser_free((void*)b->yy_ch_buf);
1433 xbt_automaton_parser_free((void*)b);
1436 /* Initializes or reinitializes a buffer.
1437 * This function is sometimes called more than once on the same buffer,
1438 * such as during a xbt_automaton_parser_restart() or at EOF.
1440 static void xbt_automaton_parser__init_buffer (YY_BUFFER_STATE b, FILE * file )
1445 xbt_automaton_parser__flush_buffer(b);
1447 b->yy_input_file = file;
1448 b->yy_fill_buffer = 1;
1450 /* If b is the current buffer, then xbt_automaton_parser__init_buffer was _probably_
1451 * called from xbt_automaton_parser_restart() or through yy_get_next_buffer.
1452 * In that case, we don't want to reset the lineno or column.
1454 if (b != YY_CURRENT_BUFFER) {
1455 b->yy_bs_lineno = 1;
1456 b->yy_bs_column = 0;
1459 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1464 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1465 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1468 void xbt_automaton_parser__flush_buffer(YY_BUFFER_STATE b)
1475 /* We always need two end-of-buffer characters. The first causes
1476 * a transition to the end-of-buffer state. The second causes
1477 * a jam in that state.
1479 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1480 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1482 b->yy_buf_pos = &b->yy_ch_buf[0];
1485 b->yy_buffer_status = YY_BUFFER_NEW;
1487 if (b == YY_CURRENT_BUFFER)
1488 xbt_automaton_parser__load_buffer_state();
1491 /** Pushes the new state onto the stack. The new state becomes
1492 * the current state. This function will allocate the stack
1494 * @param new_buffer The new state.
1497 void xbt_automaton_parser_push_buffer_state (YY_BUFFER_STATE new_buffer )
1499 if (new_buffer == NULL)
1502 xbt_automaton_parser_ensure_buffer_stack();
1504 /* This block is copied from xbt_automaton_parser__switch_to_buffer. */
1505 if (YY_CURRENT_BUFFER) {
1506 /* Flush out information for old buffer. */
1507 *(yy_c_buf_p) = (yy_hold_char);
1508 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1509 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1512 /* Only push if top exists. Otherwise, replace top. */
1513 if (YY_CURRENT_BUFFER)
1514 (yy_buffer_stack_top)++;
1515 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1517 /* copied from xbt_automaton_parser__switch_to_buffer. */
1518 xbt_automaton_parser__load_buffer_state();
1519 (yy_did_buffer_switch_on_eof) = 1;
1522 /** Removes and deletes the top of the stack, if present.
1523 * The next element becomes the new top.
1526 void xbt_automaton_parser_pop_buffer_state (void)
1528 if (!YY_CURRENT_BUFFER)
1531 xbt_automaton_parser__delete_buffer(YY_CURRENT_BUFFER);
1532 YY_CURRENT_BUFFER_LVALUE = NULL;
1533 if ((yy_buffer_stack_top) > 0)
1534 --(yy_buffer_stack_top);
1536 if (YY_CURRENT_BUFFER) {
1537 xbt_automaton_parser__load_buffer_state();
1538 (yy_did_buffer_switch_on_eof) = 1;
1542 /* Allocates the stack if it does not exist.
1543 * Guarantees space for at least one push.
1545 static void xbt_automaton_parser_ensure_buffer_stack (void)
1549 if (!(yy_buffer_stack)) {
1551 /* First allocation is just for 2 elements, since we don't know if this
1552 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1553 * immediate realloc on the next call.
1555 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1557 (struct yy_buffer_state**)xbt_automaton_parser_alloc(num_to_alloc * sizeof(struct yy_buffer_state*));
1558 if (!(yy_buffer_stack))
1559 YY_FATAL_ERROR("out of dynamic memory in xbt_automaton_parser_ensure_buffer_stack()");
1561 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1563 (yy_buffer_stack_max) = num_to_alloc;
1564 (yy_buffer_stack_top) = 0;
1568 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1) {
1570 /* Increase the buffer to prepare for a possible push. */
1571 yy_size_t grow_size = 8 /* arbitrary grow size */;
1573 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1574 (yy_buffer_stack) = (struct yy_buffer_state**)xbt_automaton_parser_realloc(
1575 (yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*));
1576 if (!(yy_buffer_stack))
1577 YY_FATAL_ERROR("out of dynamic memory in xbt_automaton_parser_ensure_buffer_stack()");
1579 /* zero only the new slots.*/
1580 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1581 (yy_buffer_stack_max) = num_to_alloc;
1585 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1586 * @param base the character buffer
1587 * @param size the size in bytes of the character buffer
1589 * @return the newly allocated buffer state object.
1591 YY_BUFFER_STATE xbt_automaton_parser__scan_buffer (char * base, yy_size_t size )
1595 if (size < 2 || base[size - 2] != YY_END_OF_BUFFER_CHAR || base[size - 1] != YY_END_OF_BUFFER_CHAR)
1596 /* They forgot to leave room for the EOB's. */
1599 b = (YY_BUFFER_STATE)xbt_automaton_parser_alloc(sizeof(struct yy_buffer_state));
1601 YY_FATAL_ERROR("out of dynamic memory in xbt_automaton_parser__scan_buffer()");
1603 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1604 b->yy_buf_pos = b->yy_ch_buf = base;
1605 b->yy_is_our_buffer = 0;
1606 b->yy_input_file = NULL;
1607 b->yy_n_chars = b->yy_buf_size;
1608 b->yy_is_interactive = 0;
1610 b->yy_fill_buffer = 0;
1611 b->yy_buffer_status = YY_BUFFER_NEW;
1613 xbt_automaton_parser__switch_to_buffer(b);
1618 /** Setup the input buffer state to scan a string. The next call to xbt_automaton_parser_lex() will
1619 * scan from a @e copy of @a str.
1620 * @param yystr a NUL-terminated string to scan
1622 * @return the newly allocated buffer state object.
1623 * @note If you want to scan bytes that may contain NUL values, then use
1624 * xbt_automaton_parser__scan_bytes() instead.
1626 YY_BUFFER_STATE xbt_automaton_parser__scan_string (yyconst char * yystr )
1629 return xbt_automaton_parser__scan_bytes(yystr, (int)strlen(yystr));
1632 /** Setup the input buffer state to scan the given bytes. The next call to xbt_automaton_parser_lex() will
1633 * scan from a @e copy of @a bytes.
1634 * @param yybytes the byte buffer to scan
1635 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1637 * @return the newly allocated buffer state object.
1639 YY_BUFFER_STATE xbt_automaton_parser__scan_bytes(yyconst char* yybytes, int _yybytes_len)
1646 /* Get memory for full buffer, including space for trailing EOB's. */
1647 n = (yy_size_t)(_yybytes_len + 2);
1648 buf = (char*)xbt_automaton_parser_alloc(n);
1650 YY_FATAL_ERROR("out of dynamic memory in xbt_automaton_parser__scan_bytes()");
1652 for (i = 0; i < _yybytes_len; ++i)
1653 buf[i] = yybytes[i];
1655 buf[_yybytes_len] = buf[_yybytes_len + 1] = YY_END_OF_BUFFER_CHAR;
1657 b = xbt_automaton_parser__scan_buffer(buf, n);
1659 YY_FATAL_ERROR("bad buffer in xbt_automaton_parser__scan_bytes()");
1661 /* It's okay to grow etc. this buffer, and we should throw it
1662 * away when we're done.
1664 b->yy_is_our_buffer = 1;
1669 #ifndef YY_EXIT_FAILURE
1670 #define YY_EXIT_FAILURE 2
1673 static void yynoreturn yy_fatal_error(yyconst char* msg)
1675 (void)fprintf(stderr, "%s\n", msg);
1676 exit(YY_EXIT_FAILURE);
1679 /* Redefine yyless() so it works in section 3 code. */
1684 /* Undo effects of setting up xbt_automaton_parser_text. */ \
1685 int yyless_macro_arg = (n); \
1686 YY_LESS_LINENO(yyless_macro_arg); \
1687 xbt_automaton_parser_text[xbt_automaton_parser_leng] = (yy_hold_char); \
1688 (yy_c_buf_p) = xbt_automaton_parser_text + yyless_macro_arg; \
1689 (yy_hold_char) = *(yy_c_buf_p); \
1690 *(yy_c_buf_p) = '\0'; \
1691 xbt_automaton_parser_leng = yyless_macro_arg; \
1694 /* Accessor methods (get/set functions) to struct members. */
1696 /** Get the current line number.
1699 int xbt_automaton_parser_get_lineno (void)
1702 return xbt_automaton_parser_lineno;
1705 /** Get the input stream.
1708 FILE *xbt_automaton_parser_get_in (void)
1710 return xbt_automaton_parser_in;
1713 /** Get the output stream.
1716 FILE *xbt_automaton_parser_get_out (void)
1718 return xbt_automaton_parser_out;
1721 /** Get the length of the current token.
1724 int xbt_automaton_parser_get_leng(void)
1726 return xbt_automaton_parser_leng;
1729 /** Get the current token.
1733 char *xbt_automaton_parser_get_text (void)
1735 return xbt_automaton_parser_text;
1738 /** Set the current line number.
1739 * @param _line_number line number
1742 void xbt_automaton_parser_set_lineno (int _line_number )
1745 xbt_automaton_parser_lineno = _line_number;
1748 /** Set the input stream. This does not discard the current
1750 * @param _in_str A readable stream.
1752 * @see xbt_automaton_parser__switch_to_buffer
1754 void xbt_automaton_parser_set_in (FILE * _in_str )
1756 xbt_automaton_parser_in = _in_str ;
1759 void xbt_automaton_parser_set_out (FILE * _out_str )
1761 xbt_automaton_parser_out = _out_str ;
1764 int xbt_automaton_parser_get_debug (void)
1766 return xbt_automaton_parser__flex_debug;
1769 void xbt_automaton_parser_set_debug (int _bdebug )
1771 xbt_automaton_parser__flex_debug = _bdebug ;
1774 static int yy_init_globals (void)
1776 /* Initialization is the same as for the non-reentrant scanner.
1777 * This function is called from xbt_automaton_parser_lex_destroy(), so don't allocate here.
1780 (yy_buffer_stack) = NULL;
1781 (yy_buffer_stack_top) = 0;
1782 (yy_buffer_stack_max) = 0;
1783 (yy_c_buf_p) = NULL;
1787 /* Defined in main.c */
1789 xbt_automaton_parser_in = stdin;
1790 xbt_automaton_parser_out = stdout;
1792 xbt_automaton_parser_in = NULL;
1793 xbt_automaton_parser_out = NULL;
1796 /* For future reference: Set errno on error, since we are called by
1797 * xbt_automaton_parser_lex_init()
1802 /* xbt_automaton_parser_lex_destroy is for both reentrant and non-reentrant scanners. */
1803 int xbt_automaton_parser_lex_destroy (void)
1806 /* Pop the buffer stack, destroying each element. */
1807 while (YY_CURRENT_BUFFER) {
1808 xbt_automaton_parser__delete_buffer(YY_CURRENT_BUFFER);
1809 YY_CURRENT_BUFFER_LVALUE = NULL;
1810 xbt_automaton_parser_pop_buffer_state();
1813 /* Destroy the stack itself. */
1814 xbt_automaton_parser_free((yy_buffer_stack));
1815 (yy_buffer_stack) = NULL;
1817 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1818 * xbt_automaton_parser_lex() is called, initialization will occur. */
1825 * Internal utility routines.
1829 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1833 for (i = 0; i < n; ++i)
1838 #ifdef YY_NEED_STRLEN
1839 static int yy_flex_strlen (yyconst char * s )
1842 for (n = 0; s[n]; ++n)
1849 void *xbt_automaton_parser_alloc (yy_size_t size )
1851 return malloc(size);
1854 void *xbt_automaton_parser_realloc (void * ptr, yy_size_t size )
1857 /* The cast to (char *) in the following accommodates both
1858 * implementations that use char* generic pointers, and those
1859 * that use void* generic pointers. It works with the latter
1860 * because both ANSI C and C++ allow castless assignment from
1861 * any pointer type to void*, and deal with argument conversions
1862 * as though doing an assignment.
1864 return realloc(ptr, size);
1867 void xbt_automaton_parser_free (void * ptr )
1869 free((char*)ptr); /* see xbt_automaton_parser_realloc() for (char *) cast */
1872 #define YYTABLES_NAME "yytables"
1874 #line 81 "parserPromela.lex"