4 #define YY_INT_ALIGNED short int
6 /* A lexical scanner generated by flex */
9 #define YY_FLEX_MAJOR_VERSION 2
10 #define YY_FLEX_MINOR_VERSION 5
11 #define YY_FLEX_SUBMINOR_VERSION 35
12 #if YY_FLEX_SUBMINOR_VERSION > 0
16 /* First, we deal with platform-specific or compiler-specific issues. */
18 /* begin standard C headers. */
24 /* end standard C headers. */
26 /* flex integer type definitions */
31 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
35 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
36 * if you want the limit (max/min) macros for int types.
38 #ifndef __STDC_LIMIT_MACROS
39 #define __STDC_LIMIT_MACROS 1
43 typedef int8_t flex_int8_t;
44 typedef uint8_t flex_uint8_t;
45 typedef int16_t flex_int16_t;
46 typedef uint16_t flex_uint16_t;
47 typedef int32_t flex_int32_t;
48 typedef uint32_t flex_uint32_t;
50 typedef signed char flex_int8_t;
51 typedef short int flex_int16_t;
52 typedef int flex_int32_t;
53 typedef unsigned char flex_uint8_t;
54 typedef unsigned short int flex_uint16_t;
55 typedef unsigned int flex_uint32_t;
57 /* Limits of integral types. */
59 #define INT8_MIN (-128)
62 #define INT16_MIN (-32767-1)
65 #define INT32_MIN (-2147483647-1)
68 #define INT8_MAX (127)
71 #define INT16_MAX (32767)
74 #define INT32_MAX (2147483647)
77 #define UINT8_MAX (255U)
80 #define UINT16_MAX (65535U)
83 #define UINT32_MAX (4294967295U)
88 #endif /* ! FLEXINT_H */
92 /* The "const" storage-class-modifier is valid. */
95 #else /* ! __cplusplus */
97 /* C99 requires __STDC__ to be defined as 1. */
98 #if defined (__STDC__)
102 #endif /* defined (__STDC__) */
103 #endif /* ! __cplusplus */
106 #define yyconst const
111 /* Returned upon end-of-file. */
114 /* Promotes a possibly negative, possibly signed char to an unsigned
115 * integer for use as an array index. If the signed char is negative,
116 * we want to instead treat it as an 8-bit unsigned char, hence the
119 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
121 /* Enter a start condition. This macro really ought to take a parameter,
122 * but we do it the disgusting crufty way forced on us by the ()-less
123 * definition of BEGIN.
125 #define BEGIN (yy_start) = 1 + 2 *
127 /* Translate the current start state into a value that can be later handed
128 * to BEGIN to return to the state. The YYSTATE alias is for lex
131 #define YY_START (((yy_start) - 1) / 2)
132 #define YYSTATE YY_START
134 /* Action number for EOF rule of a given start state. */
135 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
137 /* Special action meaning "start processing a new file". */
138 #define YY_NEW_FILE yyrestart(yyin )
140 #define YY_END_OF_BUFFER_CHAR 0
142 /* Size of default input buffer. */
145 /* On IA-64, the buffer size is 16k, not 8k.
146 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
147 * Ditto for the __ia64__ case accordingly.
149 #define YY_BUF_SIZE 32768
151 #define YY_BUF_SIZE 16384
152 #endif /* __ia64__ */
155 /* The state buf must be large enough to hold one state per character in the main buffer.
157 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
159 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
160 #define YY_TYPEDEF_YY_BUFFER_STATE
161 typedef struct yy_buffer_state *YY_BUFFER_STATE;
166 extern FILE *yyin, *yyout;
168 #define EOB_ACT_CONTINUE_SCAN 0
169 #define EOB_ACT_END_OF_FILE 1
170 #define EOB_ACT_LAST_MATCH 2
172 #define YY_LESS_LINENO(n)
174 /* Return all but the first "n" matched characters back to the input stream. */
178 /* Undo effects of setting up yytext. */ \
179 int yyless_macro_arg = (n); \
180 YY_LESS_LINENO(yyless_macro_arg);\
181 *yy_cp = (yy_hold_char); \
182 YY_RESTORE_YY_MORE_OFFSET \
183 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
184 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
188 #define unput(c) yyunput( c, (yytext_ptr) )
190 #ifndef YY_TYPEDEF_YY_SIZE_T
191 #define YY_TYPEDEF_YY_SIZE_T
192 typedef size_t yy_size_t;
195 #ifndef YY_STRUCT_YY_BUFFER_STATE
196 #define YY_STRUCT_YY_BUFFER_STATE
197 struct yy_buffer_state
201 char *yy_ch_buf; /* input buffer */
202 char *yy_buf_pos; /* current position in input buffer */
204 /* Size of input buffer in bytes, not including room for EOB
207 yy_size_t yy_buf_size;
209 /* Number of characters read into yy_ch_buf, not including EOB
214 /* Whether we "own" the buffer - i.e., we know we created it,
215 * and can realloc() it to grow it, and should free() it to
218 int yy_is_our_buffer;
220 /* Whether this is an "interactive" input source; if so, and
221 * if we're using stdio for input, then we want to use getc()
222 * instead of fread(), to make sure we stop fetching input after
225 int yy_is_interactive;
227 /* Whether we're considered to be at the beginning of a line.
228 * If so, '^' rules will be active on the next match, otherwise
233 int yy_bs_lineno; /**< The line count. */
234 int yy_bs_column; /**< The column count. */
236 /* Whether to try to fill the input buffer when we reach the
241 int yy_buffer_status;
243 #define YY_BUFFER_NEW 0
244 #define YY_BUFFER_NORMAL 1
245 /* When an EOF's been seen but there's still some text to process
246 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
247 * shouldn't try reading from the input source any more. We might
248 * still have a bunch of tokens to match, though, because of
249 * possible backing-up.
251 * When we actually see the EOF, we change the status to "new"
252 * (via yyrestart()), so that the user can continue scanning by
253 * just pointing yyin at a new input file.
255 #define YY_BUFFER_EOF_PENDING 2
258 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
260 /* Stack of input buffers. */
261 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
262 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
263 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
265 /* We provide macros for accessing buffer states in case in the
266 * future we want to put the buffer states in a more general
269 * Returns the top of the stack, or NULL.
271 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
272 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
275 /* Same as previous macro, but useful when we know that the buffer stack is not
276 * NULL or when we need an lvalue. For internal use only.
278 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
280 /* yy_hold_char holds the character lost when yytext is formed. */
281 static char yy_hold_char;
282 static int yy_n_chars; /* number of characters read into yy_ch_buf */
285 /* Points to current character in buffer. */
286 static char *yy_c_buf_p = (char *) 0;
287 static int yy_init = 0; /* whether we need to initialize */
288 static int yy_start = 0; /* start state number */
290 /* Flag which is used to allow yywrap()'s to do buffer switches
291 * instead of setting up a fresh yyin. A bit of a hack ...
293 static int yy_did_buffer_switch_on_eof;
295 void yyrestart (FILE *input_file );
296 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
297 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
298 void yy_delete_buffer (YY_BUFFER_STATE b );
299 void yy_flush_buffer (YY_BUFFER_STATE b );
300 void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
301 void yypop_buffer_state (void );
303 static void yyensure_buffer_stack (void );
304 static void yy_load_buffer_state (void );
305 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
307 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
309 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
310 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
311 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
313 void *yyalloc (yy_size_t );
314 void *yyrealloc (void *,yy_size_t );
315 void yyfree (void * );
317 #define yy_new_buffer yy_create_buffer
319 #define yy_set_interactive(is_interactive) \
321 if ( ! YY_CURRENT_BUFFER ){ \
322 yyensure_buffer_stack (); \
323 YY_CURRENT_BUFFER_LVALUE = \
324 yy_create_buffer(yyin,YY_BUF_SIZE ); \
326 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
329 #define yy_set_bol(at_bol) \
331 if ( ! YY_CURRENT_BUFFER ){\
332 yyensure_buffer_stack (); \
333 YY_CURRENT_BUFFER_LVALUE = \
334 yy_create_buffer(yyin,YY_BUF_SIZE ); \
336 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
339 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
341 /* Begin user sect3 */
344 #define YY_SKIP_YYWRAP
346 typedef unsigned char YY_CHAR;
348 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
350 typedef int yy_state_type;
357 #define yytext_ptr yytext
359 static yy_state_type yy_get_previous_state (void );
360 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
361 static int yy_get_next_buffer (void );
362 static void yy_fatal_error (yyconst char msg[] );
364 /* Done after the current pattern has been matched and before the
365 * corresponding action - sets up yytext.
367 #define YY_DO_BEFORE_ACTION \
368 (yytext_ptr) = yy_bp; \
369 yyleng = (size_t) (yy_cp - yy_bp); \
370 (yy_hold_char) = *yy_cp; \
372 (yy_c_buf_p) = yy_cp;
374 #define YY_NUM_RULES 25
375 #define YY_END_OF_BUFFER 26
376 /* This struct is not used in this scanner,
377 but its presence is necessary. */
380 flex_int32_t yy_verify;
383 static yyconst flex_int16_t yy_accept[54] =
385 0, 0, 26, 24, 18, 23, 8, 24, 24, 9,
386 10, 24, 24, 20, 14, 12, 13, 22, 22, 22,
387 22, 22, 15, 24, 16, 18, 0, 0, 21, 0,
388 6, 4, 0, 0, 20, 11, 22, 3, 22, 2,
389 22, 7, 0, 0, 0, 19, 22, 22, 17, 5,
393 static yyconst flex_int32_t yy_ec[256] =
395 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
396 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
397 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
398 1, 4, 5, 6, 1, 1, 1, 7, 1, 8,
399 9, 10, 1, 1, 11, 12, 13, 14, 15, 14,
400 14, 14, 14, 14, 14, 14, 14, 16, 17, 1,
401 1, 18, 1, 1, 19, 19, 19, 19, 19, 19,
402 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
403 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
404 1, 20, 1, 1, 21, 1, 19, 19, 19, 19,
406 22, 23, 24, 19, 25, 19, 19, 19, 19, 26,
407 27, 19, 19, 28, 19, 29, 19, 30, 19, 19,
408 19, 19, 31, 32, 33, 1, 1, 1, 1, 1,
409 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
410 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
411 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
412 1, 1, 1, 1, 1, 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,
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,
420 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
421 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
425 static yyconst flex_int32_t yy_meta[34] =
427 1, 1, 2, 2, 1, 2, 1, 1, 1, 1,
428 1, 1, 3, 4, 4, 1, 1, 1, 4, 2,
429 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
433 static yyconst flex_int16_t yy_base[57] =
435 0, 0, 89, 90, 32, 90, 90, 34, 81, 90,
436 90, 69, 76, 27, 31, 69, 90, 0, 59, 56,
437 58, 55, 90, 42, 90, 45, 47, 0, 0, 0,
438 90, 90, 52, 43, 49, 90, 0, 0, 44, 0,
439 42, 90, 56, 65, 52, 56, 25, 26, 90, 0,
440 16, 0, 90, 74, 31, 78
443 static yyconst flex_int16_t yy_def[57] =
445 53, 1, 53, 53, 53, 53, 53, 54, 53, 53,
446 53, 53, 53, 53, 53, 53, 53, 55, 55, 55,
447 55, 55, 53, 53, 53, 53, 54, 27, 27, 27,
448 53, 53, 56, 53, 53, 53, 55, 55, 55, 55,
449 55, 53, 56, 56, 53, 53, 55, 55, 53, 55,
450 55, 55, 0, 53, 53, 53
453 static yyconst flex_int16_t yy_nxt[124] =
455 4, 5, 6, 5, 7, 8, 9, 10, 11, 4,
456 12, 4, 13, 14, 15, 16, 17, 4, 18, 4,
457 4, 18, 19, 20, 21, 22, 18, 18, 18, 18,
458 23, 24, 25, 26, 37, 26, 27, 28, 34, 29,
459 35, 35, 34, 52, 35, 35, 26, 51, 26, 27,
460 28, 50, 29, 27, 44, 44, 46, 46, 44, 44,
461 34, 45, 35, 35, 49, 45, 27, 44, 44, 46,
462 46, 48, 47, 42, 45, 30, 41, 30, 43, 43,
463 40, 43, 39, 38, 36, 33, 32, 31, 53, 3,
464 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
466 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
467 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
471 static yyconst flex_int16_t yy_chk[124] =
473 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
474 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
475 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
476 1, 1, 1, 5, 55, 5, 8, 8, 14, 8,
477 14, 14, 15, 51, 15, 15, 26, 48, 26, 27,
478 27, 47, 27, 8, 33, 33, 34, 34, 43, 43,
479 35, 33, 35, 35, 45, 43, 27, 44, 44, 46,
480 46, 41, 39, 24, 44, 54, 22, 54, 56, 56,
481 21, 56, 20, 19, 16, 13, 12, 9, 3, 53,
482 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
484 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
485 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
489 static yy_state_type yy_last_accepting_state;
490 static char *yy_last_accepting_cpos;
492 extern int yy_flex_debug;
493 int yy_flex_debug = 0;
495 /* The intent behind this definition is that it'll catch
496 * any uses of REJECT which flex missed.
498 #define REJECT reject_used_but_not_detected
499 #define yymore() yymore_used_but_not_detected
500 #define YY_MORE_ADJ 0
501 #define YY_RESTORE_YY_MORE_OFFSET
503 #line 1 "parserPromela.lex"
504 #line 4 "parserPromela.lex"
508 #include "automaton.h"
511 extern YYSTYPE yylval;
517 #ifndef YY_NO_UNISTD_H
518 /* Special case for "unistd.h", since it is non-ANSI. We include it way
519 * down here because we want the user's section 1 to have been scanned first.
520 * The user has a chance to override it with an option.
525 #ifndef YY_EXTRA_TYPE
526 #define YY_EXTRA_TYPE void *
529 static int yy_init_globals (void );
531 /* Accessor methods to globals.
532 These are made visible to non-reentrant scanners for convenience. */
534 int yylex_destroy (void );
536 int yyget_debug (void );
538 void yyset_debug (int debug_flag );
540 YY_EXTRA_TYPE yyget_extra (void );
542 void yyset_extra (YY_EXTRA_TYPE user_defined );
544 FILE *yyget_in (void );
546 void yyset_in (FILE * in_str );
548 FILE *yyget_out (void );
550 void yyset_out (FILE * out_str );
552 int yyget_leng (void );
554 char *yyget_text (void );
556 int yyget_lineno (void );
558 void yyset_lineno (int line_number );
560 /* Macros after this point can all be overridden by user definitions in
564 #ifndef YY_SKIP_YYWRAP
566 extern "C" int yywrap (void );
568 extern int yywrap (void );
572 static void yyunput (int c,char *buf_ptr );
575 static void yy_flex_strncpy (char *,yyconst char *,int );
578 #ifdef YY_NEED_STRLEN
579 static int yy_flex_strlen (yyconst char * );
585 static int yyinput (void );
587 static int input (void );
592 /* Amount of stuff to slurp up with each read. */
593 #ifndef YY_READ_BUF_SIZE
595 /* On IA-64, the buffer size is 16k, not 8k */
596 #define YY_READ_BUF_SIZE 16384
598 #define YY_READ_BUF_SIZE 8192
599 #endif /* __ia64__ */
602 /* Copy whatever the last rule matched to the standard output. */
604 /* This used to be an fputs(), but since the string might contain NUL's,
605 * we now use fwrite().
607 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
610 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
611 * is returned in "result".
614 #define YY_INPUT(buf,result,max_size) \
615 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
619 for ( n = 0; n < max_size && \
620 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
623 buf[n++] = (char) c; \
624 if ( c == EOF && ferror( yyin ) ) \
625 YY_FATAL_ERROR( "input in flex scanner failed" ); \
631 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
633 if( errno != EINTR) \
635 YY_FATAL_ERROR( "input in flex scanner failed" ); \
646 /* No semi-colon after return; correct usage is to write "yyterminate();" -
647 * we don't want an extra ';' after the "return" because that will cause
648 * some compilers to complain about unreachable statements.
651 #define yyterminate() return YY_NULL
654 /* Number of entries by which start-condition stack grows. */
655 #ifndef YY_START_STACK_INCR
656 #define YY_START_STACK_INCR 25
659 /* Report a fatal error. */
660 #ifndef YY_FATAL_ERROR
661 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
664 /* end tables serialization structures and prototypes */
666 /* Default declaration of generated scanner - a define so the user can
667 * easily add parameters.
670 #define YY_DECL_IS_OURS 1
672 extern int yylex (void);
674 #define YY_DECL int yylex (void)
675 #endif /* !YY_DECL */
677 /* Code executed at the beginning of each rule, after yytext and yyleng
680 #ifndef YY_USER_ACTION
681 #define YY_USER_ACTION
684 /* Code executed at the end of each rule. */
686 #define YY_BREAK break;
689 #define YY_RULE_SETUP \
692 /** The main scanner function which does all the work.
696 register yy_state_type yy_current_state;
697 register char *yy_cp, *yy_bp;
700 #line 29 "parserPromela.lex"
714 (yy_start) = 1; /* first start state */
722 if ( ! YY_CURRENT_BUFFER ) {
723 yyensure_buffer_stack ();
724 YY_CURRENT_BUFFER_LVALUE =
725 yy_create_buffer(yyin,YY_BUF_SIZE );
728 yy_load_buffer_state( );
731 while ( 1 ) /* loops until end-of-file is reached */
733 yy_cp = (yy_c_buf_p);
735 /* Support of yytext. */
736 *yy_cp = (yy_hold_char);
738 /* yy_bp points to the position in yy_ch_buf of the start of
743 yy_current_state = (yy_start);
747 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
748 if ( yy_accept[yy_current_state] )
750 (yy_last_accepting_state) = yy_current_state;
751 (yy_last_accepting_cpos) = yy_cp;
753 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
755 yy_current_state = (int) yy_def[yy_current_state];
756 if ( yy_current_state >= 54 )
757 yy_c = yy_meta[(unsigned int) yy_c];
759 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
762 while ( yy_base[yy_current_state] != 90 );
765 yy_act = yy_accept[yy_current_state];
767 { /* have to back up */
768 yy_cp = (yy_last_accepting_cpos);
769 yy_current_state = (yy_last_accepting_state);
770 yy_act = yy_accept[yy_current_state];
775 do_action: /* This label is used only to access EOF actions. */
778 { /* beginning of action switch */
779 case 0: /* must back up */
780 /* undo the effects of YY_DO_BEFORE_ACTION */
781 *yy_cp = (yy_hold_char);
782 yy_cp = (yy_last_accepting_cpos);
783 yy_current_state = (yy_last_accepting_state);
788 #line 31 "parserPromela.lex"
789 { printf("%s", yytext); return (NEVER); }
793 #line 32 "parserPromela.lex"
794 { printf("%s", yytext); return (IF); }
798 #line 33 "parserPromela.lex"
799 { printf("%s", yytext);
804 #line 35 "parserPromela.lex"
805 { printf("%s", yytext); return (IMPLIES); }
809 #line 36 "parserPromela.lex"
810 { printf("%s", yytext); return (GOTO); }
814 #line 37 "parserPromela.lex"
815 { printf("%s", yytext); return (AND); }
819 #line 38 "parserPromela.lex"
820 { printf("%s", yytext); return (OR); }
824 #line 39 "parserPromela.lex"
825 { printf("%s", yytext); return (NOT); }
829 #line 40 "parserPromela.lex"
830 { printf("%s", yytext); return (LEFT_PAR); }
834 #line 41 "parserPromela.lex"
835 { printf("%s", yytext); return (RIGHT_PAR); }
839 #line 42 "parserPromela.lex"
840 { printf("%s", yytext); return (CASE); }
844 #line 43 "parserPromela.lex"
845 { printf("%s", yytext); return (COLON); }
849 #line 44 "parserPromela.lex"
850 { printf("%s", yytext); return (SEMI_COLON); }
854 #line 45 "parserPromela.lex"
855 { printf("%s", yytext); return (CASE_TRUE); }
859 #line 46 "parserPromela.lex"
860 { printf("%s", yytext); return (LEFT_BRACE); }
864 #line 47 "parserPromela.lex"
865 { printf("%s", yytext); return (RIGHT_BRACE); }
868 /* rule 17 can match eol */
870 #line 50 "parserPromela.lex"
875 #line 52 "parserPromela.lex"
876 { printf("%s",yytext); }
880 #line 55 "parserPromela.lex"
881 { printf("%s",yytext);
882 sscanf(yytext,"%lf",&yylval.real);
883 return (LITT_REEL); }
887 #line 59 "parserPromela.lex"
888 { printf("%s",yytext);
889 sscanf(yytext,"%d",&yylval.integer);
893 /* rule 21 can match eol */
895 #line 63 "parserPromela.lex"
896 { printf("%s",yytext);
897 yylval.string=(char *)malloc(strlen(yytext)+1);
898 sscanf(yytext,"%s",yylval.string);
899 return (LITT_CHAINE); }
903 #line 68 "parserPromela.lex"
904 { printf("%s",yytext);
905 yylval.string=(char *)malloc(strlen(yytext)+1);
906 sscanf(yytext,"%s",yylval.string);
910 /* rule 23 can match eol */
912 #line 73 "parserPromela.lex"
917 #line 75 "parserPromela.lex"
918 { printf("caractère inconnu\n"); }
922 #line 77 "parserPromela.lex"
926 case YY_STATE_EOF(INITIAL):
929 case YY_END_OF_BUFFER:
931 /* Amount of text matched not including the EOB char. */
932 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
934 /* Undo the effects of YY_DO_BEFORE_ACTION. */
935 *yy_cp = (yy_hold_char);
936 YY_RESTORE_YY_MORE_OFFSET
938 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
940 /* We're scanning a new file or input source. It's
941 * possible that this happened because the user
942 * just pointed yyin at a new source and called
943 * yylex(). If so, then we have to assure
944 * consistency between YY_CURRENT_BUFFER and our
945 * globals. Here is the right place to do so, because
946 * this is the first action (other than possibly a
947 * back-up) that will match for the new input source.
949 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
950 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
951 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
954 /* Note that here we test for yy_c_buf_p "<=" to the position
955 * of the first EOB in the buffer, since yy_c_buf_p will
956 * already have been incremented past the NUL character
957 * (since all states make transitions on EOB to the
958 * end-of-buffer state). Contrast this with the test
961 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
962 { /* This was really a NUL. */
963 yy_state_type yy_next_state;
965 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
967 yy_current_state = yy_get_previous_state( );
969 /* Okay, we're now positioned to make the NUL
970 * transition. We couldn't have
971 * yy_get_previous_state() go ahead and do it
972 * for us because it doesn't know how to deal
973 * with the possibility of jamming (and we don't
974 * want to build jamming into it because then it
975 * will run more slowly).
978 yy_next_state = yy_try_NUL_trans( yy_current_state );
980 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
984 /* Consume the NUL. */
985 yy_cp = ++(yy_c_buf_p);
986 yy_current_state = yy_next_state;
992 yy_cp = (yy_c_buf_p);
997 else switch ( yy_get_next_buffer( ) )
999 case EOB_ACT_END_OF_FILE:
1001 (yy_did_buffer_switch_on_eof) = 0;
1005 /* Note: because we've taken care in
1006 * yy_get_next_buffer() to have set up
1007 * yytext, we can now set up
1008 * yy_c_buf_p so that if some total
1009 * hoser (like flex itself) wants to
1010 * call the scanner after we return the
1011 * YY_NULL, it'll still work - another
1012 * YY_NULL will get returned.
1014 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1016 yy_act = YY_STATE_EOF(YY_START);
1022 if ( ! (yy_did_buffer_switch_on_eof) )
1028 case EOB_ACT_CONTINUE_SCAN:
1030 (yytext_ptr) + yy_amount_of_matched_text;
1032 yy_current_state = yy_get_previous_state( );
1034 yy_cp = (yy_c_buf_p);
1035 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1038 case EOB_ACT_LAST_MATCH:
1040 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1042 yy_current_state = yy_get_previous_state( );
1044 yy_cp = (yy_c_buf_p);
1045 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1046 goto yy_find_action;
1053 "fatal flex scanner internal error--no action found" );
1054 } /* end of action switch */
1055 } /* end of scanning one token */
1056 } /* end of yylex */
1058 /* yy_get_next_buffer - try to read in a new buffer
1060 * Returns a code representing an action:
1061 * EOB_ACT_LAST_MATCH -
1062 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1063 * EOB_ACT_END_OF_FILE - end of file
1065 static int yy_get_next_buffer (void)
1067 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1068 register char *source = (yytext_ptr);
1069 register int number_to_move, i;
1072 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1074 "fatal flex scanner internal error--end of buffer missed" );
1076 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1077 { /* Don't try to fill the buffer, so this is an EOF. */
1078 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1080 /* We matched a single character, the EOB, so
1081 * treat this as a final EOF.
1083 return EOB_ACT_END_OF_FILE;
1088 /* We matched some text prior to the EOB, first
1091 return EOB_ACT_LAST_MATCH;
1095 /* Try to read more data. */
1097 /* First move last chars to start of buffer. */
1098 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1100 for ( i = 0; i < number_to_move; ++i )
1101 *(dest++) = *(source++);
1103 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1104 /* don't do the read, it's not guaranteed to return an EOF,
1107 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1112 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1114 while ( num_to_read <= 0 )
1115 { /* Not enough room in the buffer - grow it. */
1117 /* just a shorter name for the current buffer */
1118 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1120 int yy_c_buf_p_offset =
1121 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1123 if ( b->yy_is_our_buffer )
1125 int new_size = b->yy_buf_size * 2;
1127 if ( new_size <= 0 )
1128 b->yy_buf_size += b->yy_buf_size / 8;
1130 b->yy_buf_size *= 2;
1132 b->yy_ch_buf = (char *)
1133 /* Include room in for 2 EOB chars. */
1134 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1137 /* Can't grow it, we don't own it. */
1140 if ( ! b->yy_ch_buf )
1142 "fatal error - scanner input buffer overflow" );
1144 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1146 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1151 if ( num_to_read > YY_READ_BUF_SIZE )
1152 num_to_read = YY_READ_BUF_SIZE;
1154 /* Read in more data. */
1155 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1156 (yy_n_chars), (size_t) num_to_read );
1158 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1161 if ( (yy_n_chars) == 0 )
1163 if ( number_to_move == YY_MORE_ADJ )
1165 ret_val = EOB_ACT_END_OF_FILE;
1171 ret_val = EOB_ACT_LAST_MATCH;
1172 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1173 YY_BUFFER_EOF_PENDING;
1178 ret_val = EOB_ACT_CONTINUE_SCAN;
1180 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1181 /* Extend the array by 50%, plus the number we really need. */
1182 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1183 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1184 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1185 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1188 (yy_n_chars) += number_to_move;
1189 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1190 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1192 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1197 /* yy_get_previous_state - get the state just before the EOB char was reached */
1199 static yy_state_type yy_get_previous_state (void)
1201 register yy_state_type yy_current_state;
1202 register char *yy_cp;
1204 yy_current_state = (yy_start);
1206 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1208 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1209 if ( yy_accept[yy_current_state] )
1211 (yy_last_accepting_state) = yy_current_state;
1212 (yy_last_accepting_cpos) = yy_cp;
1214 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1216 yy_current_state = (int) yy_def[yy_current_state];
1217 if ( yy_current_state >= 54 )
1218 yy_c = yy_meta[(unsigned int) yy_c];
1220 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1223 return yy_current_state;
1226 /* yy_try_NUL_trans - try to make a transition on the NUL character
1229 * next_state = yy_try_NUL_trans( current_state );
1231 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1233 register int yy_is_jam;
1234 register char *yy_cp = (yy_c_buf_p);
1236 register YY_CHAR yy_c = 1;
1237 if ( yy_accept[yy_current_state] )
1239 (yy_last_accepting_state) = yy_current_state;
1240 (yy_last_accepting_cpos) = yy_cp;
1242 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1244 yy_current_state = (int) yy_def[yy_current_state];
1245 if ( yy_current_state >= 54 )
1246 yy_c = yy_meta[(unsigned int) yy_c];
1248 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1249 yy_is_jam = (yy_current_state == 53);
1251 return yy_is_jam ? 0 : yy_current_state;
1254 static void yyunput (int c, register char * yy_bp )
1256 register char *yy_cp;
1258 yy_cp = (yy_c_buf_p);
1260 /* undo effects of setting up yytext */
1261 *yy_cp = (yy_hold_char);
1263 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1264 { /* need to shift things up to make room */
1265 /* +2 for EOB chars. */
1266 register int number_to_move = (yy_n_chars) + 2;
1267 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1268 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1269 register char *source =
1270 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1272 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1273 *--dest = *--source;
1275 yy_cp += (int) (dest - source);
1276 yy_bp += (int) (dest - source);
1277 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1278 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1280 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1281 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1284 *--yy_cp = (char) c;
1286 (yytext_ptr) = yy_bp;
1287 (yy_hold_char) = *yy_cp;
1288 (yy_c_buf_p) = yy_cp;
1293 static int yyinput (void)
1295 static int input (void)
1301 *(yy_c_buf_p) = (yy_hold_char);
1303 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1305 /* yy_c_buf_p now points to the character we want to return.
1306 * If this occurs *before* the EOB characters, then it's a
1307 * valid NUL; if not, then we've hit the end of the buffer.
1309 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1310 /* This was really a NUL. */
1311 *(yy_c_buf_p) = '\0';
1314 { /* need more input */
1315 int offset = (yy_c_buf_p) - (yytext_ptr);
1318 switch ( yy_get_next_buffer( ) )
1320 case EOB_ACT_LAST_MATCH:
1321 /* This happens because yy_g_n_b()
1322 * sees that we've accumulated a
1323 * token and flags that we need to
1324 * try matching the token before
1325 * proceeding. But for input(),
1326 * there's no matching to consider.
1327 * So convert the EOB_ACT_LAST_MATCH
1328 * to EOB_ACT_END_OF_FILE.
1331 /* Reset buffer status. */
1336 case EOB_ACT_END_OF_FILE:
1341 if ( ! (yy_did_buffer_switch_on_eof) )
1350 case EOB_ACT_CONTINUE_SCAN:
1351 (yy_c_buf_p) = (yytext_ptr) + offset;
1357 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1358 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1359 (yy_hold_char) = *++(yy_c_buf_p);
1363 #endif /* ifndef YY_NO_INPUT */
1365 /** Immediately switch to a different input stream.
1366 * @param input_file A readable stream.
1368 * @note This function does not reset the start condition to @c INITIAL .
1370 void yyrestart (FILE * input_file )
1373 if ( ! YY_CURRENT_BUFFER ){
1374 yyensure_buffer_stack ();
1375 YY_CURRENT_BUFFER_LVALUE =
1376 yy_create_buffer(yyin,YY_BUF_SIZE );
1379 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1380 yy_load_buffer_state( );
1383 /** Switch to a different input buffer.
1384 * @param new_buffer The new input buffer.
1387 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1390 /* TODO. We should be able to replace this entire function body
1392 * yypop_buffer_state();
1393 * yypush_buffer_state(new_buffer);
1395 yyensure_buffer_stack ();
1396 if ( YY_CURRENT_BUFFER == new_buffer )
1399 if ( YY_CURRENT_BUFFER )
1401 /* Flush out information for old buffer. */
1402 *(yy_c_buf_p) = (yy_hold_char);
1403 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1404 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1407 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1408 yy_load_buffer_state( );
1410 /* We don't actually know whether we did this switch during
1411 * EOF (yywrap()) processing, but the only time this flag
1412 * is looked at is after yywrap() is called, so it's safe
1413 * to go ahead and always set it.
1415 (yy_did_buffer_switch_on_eof) = 1;
1418 static void yy_load_buffer_state (void)
1420 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1421 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1422 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1423 (yy_hold_char) = *(yy_c_buf_p);
1426 /** Allocate and initialize an input buffer state.
1427 * @param file A readable stream.
1428 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1430 * @return the allocated buffer state.
1432 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1436 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1438 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1440 b->yy_buf_size = size;
1442 /* yy_ch_buf has to be 2 characters longer than the size given because
1443 * we need to put in 2 end-of-buffer characters.
1445 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1446 if ( ! b->yy_ch_buf )
1447 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1449 b->yy_is_our_buffer = 1;
1451 yy_init_buffer(b,file );
1456 /** Destroy the buffer.
1457 * @param b a buffer created with yy_create_buffer()
1460 void yy_delete_buffer (YY_BUFFER_STATE b )
1466 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1467 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1469 if ( b->yy_is_our_buffer )
1470 yyfree((void *) b->yy_ch_buf );
1472 yyfree((void *) b );
1476 extern int isatty (int );
1477 #endif /* __cplusplus */
1479 /* Initializes or reinitializes a buffer.
1480 * This function is sometimes called more than once on the same buffer,
1481 * such as during a yyrestart() or at EOF.
1483 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1488 yy_flush_buffer(b );
1490 b->yy_input_file = file;
1491 b->yy_fill_buffer = 1;
1493 /* If b is the current buffer, then yy_init_buffer was _probably_
1494 * called from yyrestart() or through yy_get_next_buffer.
1495 * In that case, we don't want to reset the lineno or column.
1497 if (b != YY_CURRENT_BUFFER){
1498 b->yy_bs_lineno = 1;
1499 b->yy_bs_column = 0;
1502 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1507 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1508 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1511 void yy_flush_buffer (YY_BUFFER_STATE b )
1518 /* We always need two end-of-buffer characters. The first causes
1519 * a transition to the end-of-buffer state. The second causes
1520 * a jam in that state.
1522 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1523 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1525 b->yy_buf_pos = &b->yy_ch_buf[0];
1528 b->yy_buffer_status = YY_BUFFER_NEW;
1530 if ( b == YY_CURRENT_BUFFER )
1531 yy_load_buffer_state( );
1534 /** Pushes the new state onto the stack. The new state becomes
1535 * the current state. This function will allocate the stack
1537 * @param new_buffer The new state.
1540 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1542 if (new_buffer == NULL)
1545 yyensure_buffer_stack();
1547 /* This block is copied from yy_switch_to_buffer. */
1548 if ( YY_CURRENT_BUFFER )
1550 /* Flush out information for old buffer. */
1551 *(yy_c_buf_p) = (yy_hold_char);
1552 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1553 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1556 /* Only push if top exists. Otherwise, replace top. */
1557 if (YY_CURRENT_BUFFER)
1558 (yy_buffer_stack_top)++;
1559 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1561 /* copied from yy_switch_to_buffer. */
1562 yy_load_buffer_state( );
1563 (yy_did_buffer_switch_on_eof) = 1;
1566 /** Removes and deletes the top of the stack, if present.
1567 * The next element becomes the new top.
1570 void yypop_buffer_state (void)
1572 if (!YY_CURRENT_BUFFER)
1575 yy_delete_buffer(YY_CURRENT_BUFFER );
1576 YY_CURRENT_BUFFER_LVALUE = NULL;
1577 if ((yy_buffer_stack_top) > 0)
1578 --(yy_buffer_stack_top);
1580 if (YY_CURRENT_BUFFER) {
1581 yy_load_buffer_state( );
1582 (yy_did_buffer_switch_on_eof) = 1;
1586 /* Allocates the stack if it does not exist.
1587 * Guarantees space for at least one push.
1589 static void yyensure_buffer_stack (void)
1593 if (!(yy_buffer_stack)) {
1595 /* First allocation is just for 2 elements, since we don't know if this
1596 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1597 * immediate realloc on the next call.
1600 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1601 (num_to_alloc * sizeof(struct yy_buffer_state*)
1603 if ( ! (yy_buffer_stack) )
1604 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1606 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1608 (yy_buffer_stack_max) = num_to_alloc;
1609 (yy_buffer_stack_top) = 0;
1613 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1615 /* Increase the buffer to prepare for a possible push. */
1616 int grow_size = 8 /* arbitrary grow size */;
1618 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1619 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1621 num_to_alloc * sizeof(struct yy_buffer_state*)
1623 if ( ! (yy_buffer_stack) )
1624 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1626 /* zero only the new slots.*/
1627 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1628 (yy_buffer_stack_max) = num_to_alloc;
1632 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1633 * @param base the character buffer
1634 * @param size the size in bytes of the character buffer
1636 * @return the newly allocated buffer state object.
1638 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1643 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1644 base[size-1] != YY_END_OF_BUFFER_CHAR )
1645 /* They forgot to leave room for the EOB's. */
1648 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1650 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1652 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1653 b->yy_buf_pos = b->yy_ch_buf = base;
1654 b->yy_is_our_buffer = 0;
1655 b->yy_input_file = 0;
1656 b->yy_n_chars = b->yy_buf_size;
1657 b->yy_is_interactive = 0;
1659 b->yy_fill_buffer = 0;
1660 b->yy_buffer_status = YY_BUFFER_NEW;
1662 yy_switch_to_buffer(b );
1667 /** Setup the input buffer state to scan a string. The next call to yylex() will
1668 * scan from a @e copy of @a str.
1669 * @param yystr a NUL-terminated string to scan
1671 * @return the newly allocated buffer state object.
1672 * @note If you want to scan bytes that may contain NUL values, then use
1673 * yy_scan_bytes() instead.
1675 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1678 return yy_scan_bytes(yystr,strlen(yystr) );
1681 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1682 * scan from a @e copy of @a bytes.
1683 * @param yybytes the byte buffer to scan
1684 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1686 * @return the newly allocated buffer state object.
1688 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1695 /* Get memory for full buffer, including space for trailing EOB's. */
1696 n = _yybytes_len + 2;
1697 buf = (char *) yyalloc(n );
1699 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1701 for ( i = 0; i < _yybytes_len; ++i )
1702 buf[i] = yybytes[i];
1704 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1706 b = yy_scan_buffer(buf,n );
1708 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1710 /* It's okay to grow etc. this buffer, and we should throw it
1711 * away when we're done.
1713 b->yy_is_our_buffer = 1;
1718 #ifndef YY_EXIT_FAILURE
1719 #define YY_EXIT_FAILURE 2
1722 static void yy_fatal_error (yyconst char* msg )
1724 (void) fprintf( stderr, "%s\n", msg );
1725 exit( YY_EXIT_FAILURE );
1728 /* Redefine yyless() so it works in section 3 code. */
1734 /* Undo effects of setting up yytext. */ \
1735 int yyless_macro_arg = (n); \
1736 YY_LESS_LINENO(yyless_macro_arg);\
1737 yytext[yyleng] = (yy_hold_char); \
1738 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1739 (yy_hold_char) = *(yy_c_buf_p); \
1740 *(yy_c_buf_p) = '\0'; \
1741 yyleng = yyless_macro_arg; \
1745 /* Accessor methods (get/set functions) to struct members. */
1747 /** Get the current line number.
1750 int yyget_lineno (void)
1756 /** Get the input stream.
1759 FILE *yyget_in (void)
1764 /** Get the output stream.
1767 FILE *yyget_out (void)
1772 /** Get the length of the current token.
1775 int yyget_leng (void)
1780 /** Get the current token.
1784 char *yyget_text (void)
1789 /** Set the current line number.
1790 * @param line_number
1793 void yyset_lineno (int line_number )
1796 yylineno = line_number;
1799 /** Set the input stream. This does not discard the current
1801 * @param in_str A readable stream.
1803 * @see yy_switch_to_buffer
1805 void yyset_in (FILE * in_str )
1810 void yyset_out (FILE * out_str )
1815 int yyget_debug (void)
1817 return yy_flex_debug;
1820 void yyset_debug (int bdebug )
1822 yy_flex_debug = bdebug ;
1825 static int yy_init_globals (void)
1827 /* Initialization is the same as for the non-reentrant scanner.
1828 * This function is called from yylex_destroy(), so don't allocate here.
1831 (yy_buffer_stack) = 0;
1832 (yy_buffer_stack_top) = 0;
1833 (yy_buffer_stack_max) = 0;
1834 (yy_c_buf_p) = (char *) 0;
1838 /* Defined in main.c */
1847 /* For future reference: Set errno on error, since we are called by
1853 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
1854 int yylex_destroy (void)
1857 /* Pop the buffer stack, destroying each element. */
1858 while(YY_CURRENT_BUFFER){
1859 yy_delete_buffer(YY_CURRENT_BUFFER );
1860 YY_CURRENT_BUFFER_LVALUE = NULL;
1861 yypop_buffer_state();
1864 /* Destroy the stack itself. */
1865 yyfree((yy_buffer_stack) );
1866 (yy_buffer_stack) = NULL;
1868 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1869 * yylex() is called, initialization will occur. */
1876 * Internal utility routines.
1880 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1883 for ( i = 0; i < n; ++i )
1888 #ifdef YY_NEED_STRLEN
1889 static int yy_flex_strlen (yyconst char * s )
1892 for ( n = 0; s[n]; ++n )
1899 void *yyalloc (yy_size_t size )
1901 return (void *) malloc( size );
1904 void *yyrealloc (void * ptr, yy_size_t size )
1906 /* The cast to (char *) in the following accommodates both
1907 * implementations that use char* generic pointers, and those
1908 * that use void* generic pointers. It works with the latter
1909 * because both ANSI C and C++ allow castless assignment from
1910 * any pointer type to void*, and deal with argument conversions
1911 * as though doing an assignment.
1913 return (void *) realloc( (char *) ptr, size );
1916 void yyfree (void * ptr )
1918 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
1921 #define YYTABLES_NAME "yytables"
1923 #line 77 "parserPromela.lex"