libutap  0.93
Uppaal Timed Automata Parser
lexer.cc
Go to the documentation of this file.
1 #line 2 "lexer.cc"
2 
3 #line 4 "lexer.cc"
4 
5 #define YY_INT_ALIGNED short int
6 
7 /* A lexical scanner generated by flex */
8 
9 #define yy_create_buffer utap__create_buffer
10 #define yy_delete_buffer utap__delete_buffer
11 #define yy_scan_buffer utap__scan_buffer
12 #define yy_scan_string utap__scan_string
13 #define yy_scan_bytes utap__scan_bytes
14 #define yy_init_buffer utap__init_buffer
15 #define yy_flush_buffer utap__flush_buffer
16 #define yy_load_buffer_state utap__load_buffer_state
17 #define yy_switch_to_buffer utap__switch_to_buffer
18 #define yypush_buffer_state utap_push_buffer_state
19 #define yypop_buffer_state utap_pop_buffer_state
20 #define yyensure_buffer_stack utap_ensure_buffer_stack
21 #define yy_flex_debug utap__flex_debug
22 #define yyin utap_in
23 #define yyleng utap_leng
24 #define yylex utap_lex
25 #define yylineno utap_lineno
26 #define yyout utap_out
27 #define yyrestart utap_restart
28 #define yytext utap_text
29 #define yywrap utap_wrap
30 #define yyalloc utap_alloc
31 #define yyrealloc utap_realloc
32 #define yyfree utap_free
33 
34 #define FLEX_SCANNER
35 #define YY_FLEX_MAJOR_VERSION 2
36 #define YY_FLEX_MINOR_VERSION 6
37 #define YY_FLEX_SUBMINOR_VERSION 4
38 #if YY_FLEX_SUBMINOR_VERSION > 0
39 #define FLEX_BETA
40 #endif
41 
42 #ifdef yy_create_buffer
43 #define utap__create_buffer_ALREADY_DEFINED
44 #else
45 #define yy_create_buffer utap__create_buffer
46 #endif
47 
48 #ifdef yy_delete_buffer
49 #define utap__delete_buffer_ALREADY_DEFINED
50 #else
51 #define yy_delete_buffer utap__delete_buffer
52 #endif
53 
54 #ifdef yy_scan_buffer
55 #define utap__scan_buffer_ALREADY_DEFINED
56 #else
57 #define yy_scan_buffer utap__scan_buffer
58 #endif
59 
60 #ifdef yy_scan_string
61 #define utap__scan_string_ALREADY_DEFINED
62 #else
63 #define yy_scan_string utap__scan_string
64 #endif
65 
66 #ifdef yy_scan_bytes
67 #define utap__scan_bytes_ALREADY_DEFINED
68 #else
69 #define yy_scan_bytes utap__scan_bytes
70 #endif
71 
72 #ifdef yy_init_buffer
73 #define utap__init_buffer_ALREADY_DEFINED
74 #else
75 #define yy_init_buffer utap__init_buffer
76 #endif
77 
78 #ifdef yy_flush_buffer
79 #define utap__flush_buffer_ALREADY_DEFINED
80 #else
81 #define yy_flush_buffer utap__flush_buffer
82 #endif
83 
84 #ifdef yy_load_buffer_state
85 #define utap__load_buffer_state_ALREADY_DEFINED
86 #else
87 #define yy_load_buffer_state utap__load_buffer_state
88 #endif
89 
90 #ifdef yy_switch_to_buffer
91 #define utap__switch_to_buffer_ALREADY_DEFINED
92 #else
93 #define yy_switch_to_buffer utap__switch_to_buffer
94 #endif
95 
96 #ifdef yypush_buffer_state
97 #define utap_push_buffer_state_ALREADY_DEFINED
98 #else
99 #define yypush_buffer_state utap_push_buffer_state
100 #endif
101 
102 #ifdef yypop_buffer_state
103 #define utap_pop_buffer_state_ALREADY_DEFINED
104 #else
105 #define yypop_buffer_state utap_pop_buffer_state
106 #endif
107 
108 #ifdef yyensure_buffer_stack
109 #define utap_ensure_buffer_stack_ALREADY_DEFINED
110 #else
111 #define yyensure_buffer_stack utap_ensure_buffer_stack
112 #endif
113 
114 #ifdef yylex
115 #define utap_lex_ALREADY_DEFINED
116 #else
117 #define yylex utap_lex
118 #endif
119 
120 #ifdef yyrestart
121 #define utap_restart_ALREADY_DEFINED
122 #else
123 #define yyrestart utap_restart
124 #endif
125 
126 #ifdef yylex_init
127 #define utap_lex_init_ALREADY_DEFINED
128 #else
129 #define yylex_init utap_lex_init
130 #endif
131 
132 #ifdef yylex_init_extra
133 #define utap_lex_init_extra_ALREADY_DEFINED
134 #else
135 #define yylex_init_extra utap_lex_init_extra
136 #endif
137 
138 #ifdef yylex_destroy
139 #define utap_lex_destroy_ALREADY_DEFINED
140 #else
141 #define yylex_destroy utap_lex_destroy
142 #endif
143 
144 #ifdef yyget_debug
145 #define utap_get_debug_ALREADY_DEFINED
146 #else
147 #define yyget_debug utap_get_debug
148 #endif
149 
150 #ifdef yyset_debug
151 #define utap_set_debug_ALREADY_DEFINED
152 #else
153 #define yyset_debug utap_set_debug
154 #endif
155 
156 #ifdef yyget_extra
157 #define utap_get_extra_ALREADY_DEFINED
158 #else
159 #define yyget_extra utap_get_extra
160 #endif
161 
162 #ifdef yyset_extra
163 #define utap_set_extra_ALREADY_DEFINED
164 #else
165 #define yyset_extra utap_set_extra
166 #endif
167 
168 #ifdef yyget_in
169 #define utap_get_in_ALREADY_DEFINED
170 #else
171 #define yyget_in utap_get_in
172 #endif
173 
174 #ifdef yyset_in
175 #define utap_set_in_ALREADY_DEFINED
176 #else
177 #define yyset_in utap_set_in
178 #endif
179 
180 #ifdef yyget_out
181 #define utap_get_out_ALREADY_DEFINED
182 #else
183 #define yyget_out utap_get_out
184 #endif
185 
186 #ifdef yyset_out
187 #define utap_set_out_ALREADY_DEFINED
188 #else
189 #define yyset_out utap_set_out
190 #endif
191 
192 #ifdef yyget_leng
193 #define utap_get_leng_ALREADY_DEFINED
194 #else
195 #define yyget_leng utap_get_leng
196 #endif
197 
198 #ifdef yyget_text
199 #define utap_get_text_ALREADY_DEFINED
200 #else
201 #define yyget_text utap_get_text
202 #endif
203 
204 #ifdef yyget_lineno
205 #define utap_get_lineno_ALREADY_DEFINED
206 #else
207 #define yyget_lineno utap_get_lineno
208 #endif
209 
210 #ifdef yyset_lineno
211 #define utap_set_lineno_ALREADY_DEFINED
212 #else
213 #define yyset_lineno utap_set_lineno
214 #endif
215 
216 #ifdef yywrap
217 #define utap_wrap_ALREADY_DEFINED
218 #else
219 #define yywrap utap_wrap
220 #endif
221 
222 #ifdef yyalloc
223 #define utap_alloc_ALREADY_DEFINED
224 #else
225 #define yyalloc utap_alloc
226 #endif
227 
228 #ifdef yyrealloc
229 #define utap_realloc_ALREADY_DEFINED
230 #else
231 #define yyrealloc utap_realloc
232 #endif
233 
234 #ifdef yyfree
235 #define utap_free_ALREADY_DEFINED
236 #else
237 #define yyfree utap_free
238 #endif
239 
240 #ifdef yytext
241 #define utap_text_ALREADY_DEFINED
242 #else
243 #define yytext utap_text
244 #endif
245 
246 #ifdef yyleng
247 #define utap_leng_ALREADY_DEFINED
248 #else
249 #define yyleng utap_leng
250 #endif
251 
252 #ifdef yyin
253 #define utap_in_ALREADY_DEFINED
254 #else
255 #define yyin utap_in
256 #endif
257 
258 #ifdef yyout
259 #define utap_out_ALREADY_DEFINED
260 #else
261 #define yyout utap_out
262 #endif
263 
264 #ifdef yy_flex_debug
265 #define utap__flex_debug_ALREADY_DEFINED
266 #else
267 #define yy_flex_debug utap__flex_debug
268 #endif
269 
270 #ifdef yylineno
271 #define utap_lineno_ALREADY_DEFINED
272 #else
273 #define yylineno utap_lineno
274 #endif
275 
276 /* First, we deal with platform-specific or compiler-specific issues. */
277 
278 /* begin standard C headers. */
279 #include <stdio.h>
280 #include <string.h>
281 #include <errno.h>
282 #include <stdlib.h>
283 
284 /* end standard C headers. */
285 
286 /* flex integer type definitions */
287 
288 #ifndef FLEXINT_H
289 #define FLEXINT_H
290 
291 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
292 
293 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
294 
295 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
296  * if you want the limit (max/min) macros for int types.
297  */
298 #ifndef __STDC_LIMIT_MACROS
299 #define __STDC_LIMIT_MACROS 1
300 #endif
301 
302 #include <inttypes.h>
303 typedef int8_t flex_int8_t;
304 typedef uint8_t flex_uint8_t;
305 typedef int16_t flex_int16_t;
306 typedef uint16_t flex_uint16_t;
307 typedef int32_t flex_int32_t;
308 typedef uint32_t flex_uint32_t;
309 #else
310 typedef signed char flex_int8_t;
311 typedef short int flex_int16_t;
312 typedef int flex_int32_t;
313 typedef unsigned char flex_uint8_t;
314 typedef unsigned short int flex_uint16_t;
315 typedef unsigned int flex_uint32_t;
316 
317 /* Limits of integral types. */
318 #ifndef INT8_MIN
319 #define INT8_MIN (-128)
320 #endif
321 #ifndef INT16_MIN
322 #define INT16_MIN (-32767-1)
323 #endif
324 #ifndef INT32_MIN
325 #define INT32_MIN (-2147483647-1)
326 #endif
327 #ifndef INT8_MAX
328 #define INT8_MAX (127)
329 #endif
330 #ifndef INT16_MAX
331 #define INT16_MAX (32767)
332 #endif
333 #ifndef INT32_MAX
334 #define INT32_MAX (2147483647)
335 #endif
336 #ifndef UINT8_MAX
337 #define UINT8_MAX (255U)
338 #endif
339 #ifndef UINT16_MAX
340 #define UINT16_MAX (65535U)
341 #endif
342 #ifndef UINT32_MAX
343 #define UINT32_MAX (4294967295U)
344 #endif
345 
346 #ifndef SIZE_MAX
347 #define SIZE_MAX (~(size_t)0)
348 #endif
349 
350 #endif /* ! C99 */
351 
352 #endif /* ! FLEXINT_H */
353 
354 /* begin standard C++ headers. */
355 
356 /* TODO: this is always defined, so inline it */
357 #define yyconst const
358 
359 #if defined(__GNUC__) && __GNUC__ >= 3
360 #define yynoreturn __attribute__((__noreturn__))
361 #else
362 #define yynoreturn
363 #endif
364 
365 /* Returned upon end-of-file. */
366 #define YY_NULL 0
367 
368 /* Promotes a possibly negative, possibly signed char to an
369  * integer in range [0..255] for use as an array index.
370  */
371 #define YY_SC_TO_UI(c) ((YY_CHAR) (c))
372 
373 /* Enter a start condition. This macro really ought to take a parameter,
374  * but we do it the disgusting crufty way forced on us by the ()-less
375  * definition of BEGIN.
376  */
377 #define BEGIN (yy_start) = 1 + 2 *
378 /* Translate the current start state into a value that can be later handed
379  * to BEGIN to return to the state. The YYSTATE alias is for lex
380  * compatibility.
381  */
382 #define YY_START (((yy_start) - 1) / 2)
383 #define YYSTATE YY_START
384 /* Action number for EOF rule of a given start state. */
385 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
386 /* Special action meaning "start processing a new file". */
387 #define YY_NEW_FILE yyrestart( yyin )
388 #define YY_END_OF_BUFFER_CHAR 0
389 
390 /* Size of default input buffer. */
391 #ifndef YY_BUF_SIZE
392 #ifdef __ia64__
393 /* On IA-64, the buffer size is 16k, not 8k.
394  * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
395  * Ditto for the __ia64__ case accordingly.
396  */
397 #define YY_BUF_SIZE 32768
398 #else
399 #define YY_BUF_SIZE 16384
400 #endif /* __ia64__ */
401 #endif
402 
403 /* The state buf must be large enough to hold one state per character in the main buffer.
404  */
405 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
406 
407 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
408 #define YY_TYPEDEF_YY_BUFFER_STATE
409 typedef struct yy_buffer_state *YY_BUFFER_STATE;
410 #endif
411 
412 #ifndef YY_TYPEDEF_YY_SIZE_T
413 #define YY_TYPEDEF_YY_SIZE_T
414 typedef size_t yy_size_t;
415 #endif
416 
417 extern int yyleng;
418 
419 extern FILE *yyin, *yyout;
420 
421 #define EOB_ACT_CONTINUE_SCAN 0
422 #define EOB_ACT_END_OF_FILE 1
423 #define EOB_ACT_LAST_MATCH 2
424 
425  #define YY_LESS_LINENO(n)
426  #define YY_LINENO_REWIND_TO(ptr)
427 
428 /* Return all but the first "n" matched characters back to the input stream. */
429 #define yyless(n) \
430  do \
431  { \
432  /* Undo effects of setting up yytext. */ \
433  int yyless_macro_arg = (n); \
434  YY_LESS_LINENO(yyless_macro_arg);\
435  *yy_cp = (yy_hold_char); \
436  YY_RESTORE_YY_MORE_OFFSET \
437  (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
438  YY_DO_BEFORE_ACTION; /* set up yytext again */ \
439  } \
440  while ( 0 )
441 #define unput(c) yyunput( c, (yytext_ptr) )
442 
443 #ifndef YY_STRUCT_YY_BUFFER_STATE
444 #define YY_STRUCT_YY_BUFFER_STATE
445 struct yy_buffer_state
446  {
447  FILE *yy_input_file;
448 
449  char *yy_ch_buf; /* input buffer */
450  char *yy_buf_pos; /* current position in input buffer */
451 
452  /* Size of input buffer in bytes, not including room for EOB
453  * characters.
454  */
455  int yy_buf_size;
456 
457  /* Number of characters read into yy_ch_buf, not including EOB
458  * characters.
459  */
460  int yy_n_chars;
461 
462  /* Whether we "own" the buffer - i.e., we know we created it,
463  * and can realloc() it to grow it, and should free() it to
464  * delete it.
465  */
466  int yy_is_our_buffer;
467 
468  /* Whether this is an "interactive" input source; if so, and
469  * if we're using stdio for input, then we want to use getc()
470  * instead of fread(), to make sure we stop fetching input after
471  * each newline.
472  */
473  int yy_is_interactive;
474 
475  /* Whether we're considered to be at the beginning of a line.
476  * If so, '^' rules will be active on the next match, otherwise
477  * not.
478  */
479  int yy_at_bol;
480 
481  int yy_bs_lineno;
482  int yy_bs_column;
484  /* Whether to try to fill the input buffer when we reach the
485  * end of it.
486  */
487  int yy_fill_buffer;
488 
489  int yy_buffer_status;
490 
491 #define YY_BUFFER_NEW 0
492 #define YY_BUFFER_NORMAL 1
493  /* When an EOF's been seen but there's still some text to process
494  * then we mark the buffer as YY_EOF_PENDING, to indicate that we
495  * shouldn't try reading from the input source any more. We might
496  * still have a bunch of tokens to match, though, because of
497  * possible backing-up.
498  *
499  * When we actually see the EOF, we change the status to "new"
500  * (via yyrestart()), so that the user can continue scanning by
501  * just pointing yyin at a new input file.
502  */
503 #define YY_BUFFER_EOF_PENDING 2
504 
505  };
506 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
507 
508 /* Stack of input buffers. */
509 static size_t yy_buffer_stack_top = 0;
510 static size_t yy_buffer_stack_max = 0;
513 /* We provide macros for accessing buffer states in case in the
514  * future we want to put the buffer states in a more general
515  * "scanner state".
516  *
517  * Returns the top of the stack, or NULL.
518  */
519 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
520  ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
521  : NULL)
522 /* Same as previous macro, but useful when we know that the buffer stack is not
523  * NULL or when we need an lvalue. For internal use only.
524  */
525 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
526 
527 /* yy_hold_char holds the character lost when yytext is formed. */
528 static char yy_hold_char;
529 static int yy_n_chars; /* number of characters read into yy_ch_buf */
530 int yyleng;
531 
532 /* Points to current character in buffer. */
533 static char *yy_c_buf_p = NULL;
534 static int yy_init = 0; /* whether we need to initialize */
535 static int yy_start = 0; /* start state number */
536 
537 /* Flag which is used to allow yywrap()'s to do buffer switches
538  * instead of setting up a fresh yyin. A bit of a hack ...
539  */
541 
542 void yyrestart ( FILE *input_file );
543 void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer );
544 YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
547 void yypush_buffer_state ( YY_BUFFER_STATE new_buffer );
548 void yypop_buffer_state ( void );
549 
550 static void yyensure_buffer_stack ( void );
551 static void yy_load_buffer_state ( void );
552 static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
553 #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
554 
555 YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size );
556 YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
557 YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
558 
559 void *yyalloc ( yy_size_t );
560 void *yyrealloc ( void *, yy_size_t );
561 void yyfree ( void * );
562 
563 #define yy_new_buffer yy_create_buffer
564 #define yy_set_interactive(is_interactive) \
565  { \
566  if ( ! YY_CURRENT_BUFFER ){ \
567  yyensure_buffer_stack (); \
568  YY_CURRENT_BUFFER_LVALUE = \
569  yy_create_buffer( yyin, YY_BUF_SIZE ); \
570  } \
571  YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
572  }
573 #define yy_set_bol(at_bol) \
574  { \
575  if ( ! YY_CURRENT_BUFFER ){\
576  yyensure_buffer_stack (); \
577  YY_CURRENT_BUFFER_LVALUE = \
578  yy_create_buffer( yyin, YY_BUF_SIZE ); \
579  } \
580  YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
581  }
582 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
583 
584 /* Begin user sect3 */
586 
587 FILE *yyin = NULL, *yyout = NULL;
588 
589 typedef int yy_state_type;
590 
591 extern int yylineno;
592 int yylineno = 1;
593 
594 extern char *yytext;
595 #ifdef yytext_ptr
596 #undef yytext_ptr
597 #endif
598 #define yytext_ptr yytext
599 
600 static yy_state_type yy_get_previous_state ( void );
601 static yy_state_type yy_try_NUL_trans ( yy_state_type current_state );
602 static int yy_get_next_buffer ( void );
603 static void yynoreturn yy_fatal_error ( const char* msg );
604 
605 /* Done after the current pattern has been matched and before the
606  * corresponding action - sets up yytext.
607  */
608 #define YY_DO_BEFORE_ACTION \
609  (yytext_ptr) = yy_bp; \
610  yyleng = (int) (yy_cp - yy_bp); \
611  (yy_hold_char) = *yy_cp; \
612  *yy_cp = '\0'; \
613  (yy_c_buf_p) = yy_cp;
614 #define YY_NUM_RULES 86
615 #define YY_END_OF_BUFFER 87
616 /* This struct is not used in this scanner,
617  but its presence is necessary. */
618 struct yy_trans_info
619  {
620  flex_int32_t yy_verify;
622  };
623 static const flex_int16_t yy_accept[118] =
624  { 0,
625  0, 0, 0, 0, 87, 85, 7, 9, 85, 23,
626  81, 45, 47, 22, 19, 20, 43, 41, 12, 42,
627  11, 44, 83, 14, 13, 59, 27, 60, 21, 65,
628  82, 69, 67, 66, 68, 17, 24, 18, 48, 15,
629  46, 16, 4, 1, 4, 4, 7, 9, 10, 62,
630  33, 52, 35, 31, 63, 29, 64, 30, 25, 0,
631  8, 6, 32, 53, 0, 83, 0, 28, 49, 55,
632  80, 39, 57, 61, 58, 56, 50, 40, 82, 0,
633  0, 0, 0, 79, 0, 5, 54, 36, 34, 51,
634  2, 0, 0, 74, 0, 6, 84, 0, 84, 37,
635 
636  38, 70, 71, 72, 73, 0, 26, 77, 75, 78,
637  76, 0, 0, 0, 3, 3, 0
638  } ;
639 
640 static const YY_CHAR yy_ec[256] =
641  { 0,
642  1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
643  1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
644  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
645  1, 2, 5, 1, 6, 7, 8, 9, 10, 11,
646  12, 13, 14, 15, 16, 17, 18, 19, 19, 19,
647  19, 19, 19, 19, 19, 19, 19, 20, 21, 22,
648  23, 24, 25, 1, 26, 27, 28, 27, 29, 27,
649  27, 27, 27, 27, 27, 27, 27, 27, 27, 30,
650  27, 31, 27, 32, 33, 27, 34, 35, 27, 27,
651  36, 37, 38, 39, 27, 1, 27, 27, 27, 27,
652 
653  40, 27, 27, 27, 27, 27, 27, 27, 27, 27,
654  27, 27, 27, 27, 27, 27, 41, 27, 27, 27,
655  27, 27, 42, 43, 44, 1, 1, 1, 1, 1,
656  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
657  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
658  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
659  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
660  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
661  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
662  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
663 
664  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
665  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
666  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
667  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
668  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
669  1, 1, 1, 1, 1
670  } ;
671 
672 static const YY_CHAR yy_meta[45] =
673  { 0,
674  1, 2, 3, 1, 1, 4, 4, 1, 1, 1,
675  1, 1, 1, 1, 1, 1, 1, 1, 4, 1,
676  1, 4, 1, 1, 1, 4, 4, 4, 4, 4,
677  4, 4, 4, 4, 4, 4, 1, 1, 1, 4,
678  4, 1, 1, 1
679  } ;
680 
681 static const flex_int16_t yy_base[122] =
682  { 0,
683  0, 0, 42, 43, 154, 155, 151, 149, 148, 127,
684  155, 126, 38, 155, 155, 155, 125, 34, 155, 35,
685  155, 47, 33, 124, 155, 44, 55, 57, 155, 27,
686  52, 53, 61, 63, 64, 108, 88, 155, 122, 155,
687  64, 155, 155, 155, 126, 108, 140, 138, 136, 155,
688  155, 155, 155, 155, 155, 155, 115, 155, 155, 122,
689  155, 0, 155, 155, 118, 75, 79, 155, 113, 155,
690  155, 155, 155, 155, 155, 155, 112, 155, 74, 109,
691  94, 105, 83, 155, 51, 155, 155, 155, 155, 155,
692  155, 90, 116, 155, 94, 0, 82, 98, 97, 155,
693 
694  155, 155, 89, 95, 155, 85, 155, 155, 155, 155,
695  155, 85, 80, 85, 0, 0, 155, 122, 60, 126,
696  130
697  } ;
698 
699 static const flex_int16_t yy_def[122] =
700  { 0,
701  117, 1, 118, 118, 117, 117, 117, 117, 117, 117,
702  117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
703  117, 117, 117, 117, 117, 117, 117, 117, 117, 119,
704  119, 119, 119, 119, 119, 117, 117, 117, 117, 117,
705  117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
706  117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
707  117, 120, 117, 117, 117, 117, 117, 117, 117, 117,
708  117, 117, 117, 117, 117, 117, 117, 117, 119, 117,
709  117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
710  117, 117, 117, 117, 117, 120, 117, 117, 117, 117,
711 
712  117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
713  117, 117, 117, 117, 121, 121, 0, 117, 117, 117,
714  117
715  } ;
716 
717 static const flex_int16_t yy_nxt[200] =
718  { 0,
719  6, 7, 8, 9, 10, 11, 6, 12, 13, 14,
720  15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
721  25, 26, 27, 28, 29, 30, 31, 31, 32, 31,
722  33, 31, 34, 35, 31, 36, 37, 38, 39, 31,
723  31, 40, 41, 42, 44, 44, 52, 55, 80, 65,
724  57, 66, 85, 86, 45, 45, 56, 58, 59, 61,
725  53, 67, 81, 79, 62, 69, 70, 71, 72, 63,
726  46, 46, 67, 117, 82, 60, 73, 74, 75, 76,
727  77, 78, 117, 64, 117, 117, 89, 117, 83, 85,
728  86, 65, 98, 66, 98, 117, 117, 99, 117, 117,
729 
730  97, 108, 109, 67, 115, 87, 90, 110, 111, 117,
731  67, 114, 113, 112, 67, 99, 99, 107, 49, 106,
732  105, 67, 43, 43, 43, 43, 96, 96, 104, 96,
733  116, 103, 102, 116, 101, 100, 97, 95, 94, 93,
734  48, 47, 92, 91, 88, 84, 68, 54, 51, 50,
735  49, 48, 47, 117, 5, 117, 117, 117, 117, 117,
736  117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
737  117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
738  117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
739  117, 117, 117, 117, 117, 117, 117, 117, 117
740 
741  } ;
742 
743 static const flex_int16_t yy_chk[200] =
744  { 0,
745  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
746  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
747  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
748  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
749  1, 1, 1, 1, 3, 4, 13, 18, 30, 23,
750  20, 23, 85, 85, 3, 4, 18, 20, 20, 22,
751  13, 23, 30, 119, 22, 26, 26, 26, 26, 22,
752  3, 4, 23, 31, 32, 20, 27, 27, 27, 28,
753  28, 28, 33, 22, 34, 35, 41, 31, 32, 37,
754  37, 66, 67, 66, 67, 79, 33, 67, 34, 35,
755 
756  97, 103, 103, 66, 114, 37, 41, 104, 104, 79,
757  97, 113, 112, 106, 66, 99, 98, 95, 93, 92,
758  83, 97, 118, 118, 118, 118, 120, 120, 82, 120,
759  121, 81, 80, 121, 77, 69, 65, 60, 57, 49,
760  48, 47, 46, 45, 39, 36, 24, 17, 12, 10,
761  9, 8, 7, 5, 117, 117, 117, 117, 117, 117,
762  117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
763  117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
764  117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
765  117, 117, 117, 117, 117, 117, 117, 117, 117
766 
767  } ;
768 
771 
772 extern int yy_flex_debug;
774 
775 /* The intent behind this definition is that it'll catch
776  * any uses of REJECT which flex missed.
777  */
778 #define REJECT reject_used_but_not_detected
779 #define yymore() yymore_used_but_not_detected
780 #define YY_MORE_ADJ 0
781 #define YY_RESTORE_YY_MORE_OFFSET
782 char *yytext;
783 #line 1 "lexer.ll"
784 /* libutap - Uppaal Timed Automata Parser.
785  Copyright (C) 2002-2017 Uppsala University and Aalborg University.
786 
787  This library is free software; you can redistribute it and/or
788  modify it under the terms of the GNU Lesser General Public License
789  as published by the Free Software Foundation; either version 2.1 of
790  the License, or (at your option) any later version.
791 
792  This library is distributed in the hope that it will be useful, but
793  WITHOUT ANY WARRANTY; without even the implied warranty of
794  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
795  Lesser General Public License for more details.
796 
797  You should have received a copy of the GNU Lesser General Public
798  License along with this library; if not, write to the Free Software
799  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
800  USA
801 */
802 #line 24 "lexer.ll"
803 
804 #include <iostream>
805 #include "keywords.cc"
806 #include "libparser.h"
807 
808 using std::ostream;
809 
810 #define YY_DECL int lexer_flex(void)
811 
812 uint32_t PositionTracker::line;
813 uint32_t PositionTracker::offset;
814 uint32_t PositionTracker::position = 0;
815 std::string PositionTracker::path;
816 
817 namespace UTAP
818 {
819  void PositionTracker::setPath(UTAP::ParserBuilder *parser, std::string s) {
820 
821  // Incrementing the position by one avoids the problem where the
822  // end-position happens to bleed into a path. E.g. the range 5-10
823  // contains 5 character (at positions 5, 6, 7, 8 and 9), thus
824  // position 10 could have a new path). An alternative would be to
825  // subtract 1 before calling Positions::find().
826 
827  position++;
828  line = 1;
829  offset = 0;
830  path = s;
831  parser->addPosition(position, offset, line, path);
832  }
833 
834  int PositionTracker::increment(UTAP::ParserBuilder *parser, int n) {
835  parser->setPosition(position, position + n);
836  position += n;
837  offset += n;
838  return position - n;
839  }
840 
841  void PositionTracker::newline(UTAP::ParserBuilder *parser, int n) {
842  line += n;
843  parser->addPosition(position, offset, line, path);
844  }
845 }
846 
847 #define YY_USER_ACTION yylloc.start = PositionTracker::position; PositionTracker::increment(ch, yyleng); yylloc.end = PositionTracker::position;
848 
849 //#define YY_FATAL_ERROR(msg) { throw TypeException(msg); } // unused
850 
851 #line 852 "lexer.cc"
852 
853 #line 854 "lexer.cc"
854 
855 #define INITIAL 0
856 #define comment 1
857 
858 #ifndef YY_NO_UNISTD_H
859 /* Special case for "unistd.h", since it is non-ANSI. We include it way
860  * down here because we want the user's section 1 to have been scanned first.
861  * The user has a chance to override it with an option.
862  */
863 #include <unistd.h>
864 #endif
865 
866 #ifndef YY_EXTRA_TYPE
867 #define YY_EXTRA_TYPE void *
868 #endif
869 
870 static int yy_init_globals ( void );
871 
872 /* Accessor methods to globals.
873  These are made visible to non-reentrant scanners for convenience. */
874 
875 int yylex_destroy ( void );
876 
877 int yyget_debug ( void );
878 
879 void yyset_debug ( int debug_flag );
880 
881 YY_EXTRA_TYPE yyget_extra ( void );
882 
883 void yyset_extra ( YY_EXTRA_TYPE user_defined );
884 
885 FILE *yyget_in ( void );
886 
887 void yyset_in ( FILE * _in_str );
888 
889 FILE *yyget_out ( void );
890 
891 void yyset_out ( FILE * _out_str );
892 
893  int yyget_leng ( void );
894 
895 char *yyget_text ( void );
896 
897 int yyget_lineno ( void );
898 
899 void yyset_lineno ( int _line_number );
900 
901 /* Macros after this point can all be overridden by user definitions in
902  * section 1.
903  */
904 
905 #ifndef YY_SKIP_YYWRAP
906 #ifdef __cplusplus
907 extern "C" int yywrap ( void );
908 #else
909 extern int yywrap ( void );
910 #endif
911 #endif
912 
913 #ifndef YY_NO_UNPUT
914 
915 #endif
916 
917 #ifndef yytext_ptr
918 static void yy_flex_strncpy ( char *, const char *, int );
919 #endif
920 
921 #ifdef YY_NEED_STRLEN
922 static int yy_flex_strlen ( const char * );
923 #endif
924 
925 #ifndef YY_NO_INPUT
926 #ifdef __cplusplus
927 static int yyinput ( void );
928 #else
929 static int input ( void );
930 #endif
931 
932 #endif
933 
934 /* Amount of stuff to slurp up with each read. */
935 #ifndef YY_READ_BUF_SIZE
936 #ifdef __ia64__
937 /* On IA-64, the buffer size is 16k, not 8k */
938 #define YY_READ_BUF_SIZE 16384
939 #else
940 #define YY_READ_BUF_SIZE 8192
941 #endif /* __ia64__ */
942 #endif
943 
944 /* Copy whatever the last rule matched to the standard output. */
945 #ifndef ECHO
946 /* This used to be an fputs(), but since the string might contain NUL's,
947  * we now use fwrite().
948  */
949 #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
950 #endif
951 
952 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
953  * is returned in "result".
954  */
955 #ifndef YY_INPUT
956 #define YY_INPUT(buf,result,max_size) \
957  if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
958  { \
959  int c = '*'; \
960  int n; \
961  for ( n = 0; n < max_size && \
962  (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
963  buf[n] = (char) c; \
964  if ( c == '\n' ) \
965  buf[n++] = (char) c; \
966  if ( c == EOF && ferror( yyin ) ) \
967  YY_FATAL_ERROR( "input in flex scanner failed" ); \
968  result = n; \
969  } \
970  else \
971  { \
972  errno=0; \
973  while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
974  { \
975  if( errno != EINTR) \
976  { \
977  YY_FATAL_ERROR( "input in flex scanner failed" ); \
978  break; \
979  } \
980  errno=0; \
981  clearerr(yyin); \
982  } \
983  }\
984 \
985 
986 #endif
987 
988 /* No semi-colon after return; correct usage is to write "yyterminate();" -
989  * we don't want an extra ';' after the "return" because that will cause
990  * some compilers to complain about unreachable statements.
991  */
992 #ifndef yyterminate
993 #define yyterminate() return YY_NULL
994 #endif
995 
996 /* Number of entries by which start-condition stack grows. */
997 #ifndef YY_START_STACK_INCR
998 #define YY_START_STACK_INCR 25
999 #endif
1000 
1001 /* Report a fatal error. */
1002 #ifndef YY_FATAL_ERROR
1003 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1004 #endif
1005 
1006 /* end tables serialization structures and prototypes */
1007 
1008 /* Default declaration of generated scanner - a define so the user can
1009  * easily add parameters.
1010  */
1011 #ifndef YY_DECL
1012 #define YY_DECL_IS_OURS 1
1013 
1014 extern int yylex (void);
1015 
1016 #define YY_DECL int yylex (void)
1017 #endif /* !YY_DECL */
1018 
1019 /* Code executed at the beginning of each rule, after yytext and yyleng
1020  * have been set up.
1021  */
1022 #ifndef YY_USER_ACTION
1023 #define YY_USER_ACTION
1024 #endif
1025 
1026 /* Code executed at the end of each rule. */
1027 #ifndef YY_BREAK
1028 #define YY_BREAK /*LINTED*/break;
1029 #endif
1030 
1031 #define YY_RULE_SETUP \
1032  YY_USER_ACTION
1033 
1036 YY_DECL
1038  yy_state_type yy_current_state;
1039  char *yy_cp, *yy_bp;
1040  int yy_act;
1041 
1042  if ( !(yy_init) )
1043  {
1044  (yy_init) = 1;
1045 
1046 #ifdef YY_USER_INIT
1047  YY_USER_INIT;
1048 #endif
1049 
1050  if ( ! (yy_start) )
1051  (yy_start) = 1; /* first start state */
1052 
1053  if ( ! yyin )
1054  yyin = stdin;
1055 
1056  if ( ! yyout )
1057  yyout = stdout;
1058 
1059  if ( ! YY_CURRENT_BUFFER ) {
1063  }
1064 
1066  }
1067 
1068  {
1069 #line 80 "lexer.ll"
1070 
1071 
1072 #line 1073 "lexer.cc"
1073 
1074  while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
1075  {
1076  yy_cp = (yy_c_buf_p);
1077 
1078  /* Support of yytext. */
1079  *yy_cp = (yy_hold_char);
1080 
1081  /* yy_bp points to the position in yy_ch_buf of the start of
1082  * the current run.
1083  */
1084  yy_bp = yy_cp;
1085 
1086  yy_current_state = (yy_start);
1087 yy_match:
1088  do
1089  {
1090  YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1091  if ( yy_accept[yy_current_state] )
1092  {
1093  (yy_last_accepting_state) = yy_current_state;
1094  (yy_last_accepting_cpos) = yy_cp;
1095  }
1096  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1097  {
1098  yy_current_state = (int) yy_def[yy_current_state];
1099  if ( yy_current_state >= 118 )
1100  yy_c = yy_meta[yy_c];
1101  }
1102  yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1103  ++yy_cp;
1104  }
1105  while ( yy_current_state != 117 );
1106  yy_cp = (yy_last_accepting_cpos);
1107  yy_current_state = (yy_last_accepting_state);
1108 
1109 yy_find_action:
1110  yy_act = yy_accept[yy_current_state];
1111 
1113 
1114 do_action: /* This label is used only to access EOF actions. */
1115 
1116  switch ( yy_act )
1117  { /* beginning of action switch */
1118  case 0: /* must back up */
1119  /* undo the effects of YY_DO_BEFORE_ACTION */
1120  *yy_cp = (yy_hold_char);
1121  yy_cp = (yy_last_accepting_cpos);
1122  yy_current_state = (yy_last_accepting_state);
1123  goto yy_find_action;
1124 
1125 case 1:
1126 /* rule 1 can match eol */
1128 #line 83 "lexer.ll"
1129 { PositionTracker::newline(ch, 1); }
1130  YY_BREAK
1131 case 2:
1133 #line 84 "lexer.ll"
1134 { BEGIN(INITIAL); }
1135  YY_BREAK
1136 case YY_STATE_EOF(comment):
1137 #line 85 "lexer.ll"
1138 { BEGIN(INITIAL); yyerror("$Comment_not_closed"); return 0; }
1139  YY_BREAK
1140 case 3:
1142 #line 86 "lexer.ll"
1143 { ch->handleExpect(utap_text+7); }
1144  YY_BREAK
1145 case 4:
1147 #line 87 "lexer.ll"
1148 /* ignore (multiline comments)*/
1149  YY_BREAK
1150 
1151 case 5:
1152 /* rule 5 can match eol */
1154 #line 90 "lexer.ll"
1155 { /* Use \ as continuation character */
1156  PositionTracker::newline(ch, 1);
1157  }
1158  YY_BREAK
1159 case 6:
1161 #line 94 "lexer.ll"
1162 /* ignore (singleline comment)*/;
1163  YY_BREAK
1164 case 7:
1166 #line 96 "lexer.ll"
1167 
1168  YY_BREAK
1169 case 8:
1171 #line 98 "lexer.ll"
1172 { BEGIN(comment); }
1173  YY_BREAK
1174 case 9:
1175 /* rule 9 can match eol */
1177 #line 100 "lexer.ll"
1178 {
1179  PositionTracker::newline(ch, yyleng);
1180  if ((syntax & SYNTAX_PROPERTY) != 0)
1181  return '\n';
1182  }
1183  YY_BREAK
1184 case 10:
1185 /* rule 10 can match eol */
1187 #line 106 "lexer.ll"
1188 {
1189  PositionTracker::newline(ch, yyleng / 2);
1190  if ((syntax & SYNTAX_PROPERTY) != 0)
1191  return '\n';
1192  }
1193  YY_BREAK
1194 case 11:
1196 #line 112 "lexer.ll"
1197 { return '.'; }
1198  YY_BREAK
1199 case 12:
1201 #line 113 "lexer.ll"
1202 { return ','; }
1203  YY_BREAK
1204 case 13:
1206 #line 114 "lexer.ll"
1207 { return ';'; }
1208  YY_BREAK
1209 case 14:
1211 #line 115 "lexer.ll"
1212 { return ':'; }
1213  YY_BREAK
1214 case 15:
1216 #line 116 "lexer.ll"
1217 { return '{'; }
1218  YY_BREAK
1219 case 16:
1221 #line 117 "lexer.ll"
1222 { return '}'; }
1223  YY_BREAK
1224 case 17:
1226 #line 118 "lexer.ll"
1227 { return '['; }
1228  YY_BREAK
1229 case 18:
1231 #line 119 "lexer.ll"
1232 { return ']'; }
1233  YY_BREAK
1234 case 19:
1236 #line 120 "lexer.ll"
1237 { return '('; }
1238  YY_BREAK
1239 case 20:
1241 #line 121 "lexer.ll"
1242 { return ')'; }
1243  YY_BREAK
1244 case 21:
1246 #line 122 "lexer.ll"
1247 { return '?'; }
1248  YY_BREAK
1249 case 22:
1251 #line 123 "lexer.ll"
1252 { return '\''; }
1253  YY_BREAK
1254 case 23:
1256 #line 124 "lexer.ll"
1257 { return T_EXCLAM; }
1258  YY_BREAK
1259 case 24:
1261 #line 125 "lexer.ll"
1262 { return '\\'; }
1263  YY_BREAK
1264 case 25:
1266 #line 127 "lexer.ll"
1267 { return T_ARROW; }
1268  YY_BREAK
1269 case 26:
1271 #line 128 "lexer.ll"
1272 { return T_UNCONTROL_ARROW; }
1273  YY_BREAK
1274 case 27:
1276 #line 130 "lexer.ll"
1277 { return T_ASSIGNMENT; }
1278  YY_BREAK
1279 case 28:
1281 #line 131 "lexer.ll"
1282 { return T_ASSIGNMENT; }
1283  YY_BREAK
1284 case 29:
1286 #line 132 "lexer.ll"
1287 { return T_ASSPLUS; }
1288  YY_BREAK
1289 case 30:
1291 #line 133 "lexer.ll"
1292 { return T_ASSMINUS; }
1293  YY_BREAK
1294 case 31:
1296 #line 134 "lexer.ll"
1297 { return T_ASSMULT; }
1298  YY_BREAK
1299 case 32:
1301 #line 135 "lexer.ll"
1302 { return T_ASSDIV; }
1303  YY_BREAK
1304 case 33:
1306 #line 136 "lexer.ll"
1307 { return T_ASSMOD; }
1308  YY_BREAK
1309 case 34:
1311 #line 137 "lexer.ll"
1312 { return T_ASSOR; }
1313  YY_BREAK
1314 case 35:
1316 #line 138 "lexer.ll"
1317 { return T_ASSAND; }
1318  YY_BREAK
1319 case 36:
1321 #line 139 "lexer.ll"
1322 { return T_ASSXOR; }
1323  YY_BREAK
1324 case 37:
1326 #line 140 "lexer.ll"
1327 { return T_ASSLSHIFT; }
1328  YY_BREAK
1329 case 38:
1331 #line 141 "lexer.ll"
1332 { return T_ASSRSHIFT; }
1333  YY_BREAK
1334 case 39:
1336 #line 142 "lexer.ll"
1337 { return T_MIN; }
1338  YY_BREAK
1339 case 40:
1341 #line 143 "lexer.ll"
1342 { return T_MAX; }
1343  YY_BREAK
1344 case 41:
1346 #line 145 "lexer.ll"
1347 { return T_PLUS; }
1348  YY_BREAK
1349 case 42:
1351 #line 146 "lexer.ll"
1352 { return T_MINUS; }
1353  YY_BREAK
1354 case 43:
1356 #line 147 "lexer.ll"
1357 { return T_MULT; }
1358  YY_BREAK
1359 case 44:
1361 #line 148 "lexer.ll"
1362 { return T_DIV; }
1363  YY_BREAK
1364 case 45:
1366 #line 149 "lexer.ll"
1367 { return T_MOD; }
1368  YY_BREAK
1369 case 46:
1371 #line 150 "lexer.ll"
1372 { return T_OR; }
1373  YY_BREAK
1374 case 47:
1376 #line 151 "lexer.ll"
1377 { return '&'; }
1378  YY_BREAK
1379 case 48:
1381 #line 152 "lexer.ll"
1382 { return T_XOR; }
1383  YY_BREAK
1384 case 49:
1386 #line 153 "lexer.ll"
1387 { return T_LSHIFT; }
1388  YY_BREAK
1389 case 50:
1391 #line 154 "lexer.ll"
1392 { return T_RSHIFT; }
1393  YY_BREAK
1394 case 51:
1396 #line 155 "lexer.ll"
1397 { return T_BOOL_OR; }
1398  YY_BREAK
1399 case 52:
1401 #line 156 "lexer.ll"
1402 { return T_BOOL_AND; }
1403  YY_BREAK
1404 case 53:
1406 #line 157 "lexer.ll"
1407 { return T_MITL_AND;}
1408  YY_BREAK
1409 case 54:
1411 #line 158 "lexer.ll"
1412 { return T_MITL_OR;}
1413  YY_BREAK
1414 case 55:
1416 #line 160 "lexer.ll"
1417 { return T_LEQ; }
1418  YY_BREAK
1419 case 56:
1421 #line 161 "lexer.ll"
1422 { return T_GEQ; }
1423  YY_BREAK
1424 case 57:
1426 #line 162 "lexer.ll"
1427 { if (syntax & SYNTAX_OLD)
1428  {
1429  return T_LEQ;
1430  }
1431  utap_error("$Unknown_symbol");
1432  return T_ERROR;
1433  }
1434  YY_BREAK
1435 case 58:
1437 #line 169 "lexer.ll"
1438 { if (syntax & SYNTAX_OLD)
1439  {
1440  return T_GEQ;
1441  }
1442  utap_error("$Unknown_symbol");
1443  return T_ERROR;
1444  }
1445  YY_BREAK
1446 case 59:
1448 #line 176 "lexer.ll"
1449 { return T_LT; }
1450  YY_BREAK
1451 case 60:
1453 #line 177 "lexer.ll"
1454 { return T_GT; }
1455  YY_BREAK
1456 case 61:
1458 #line 178 "lexer.ll"
1459 { return T_EQ; }
1460  YY_BREAK
1461 case 62:
1463 #line 179 "lexer.ll"
1464 { return T_NEQ; }
1465  YY_BREAK
1466 case 63:
1468 #line 181 "lexer.ll"
1469 { return T_INCREMENT; }
1470  YY_BREAK
1471 case 64:
1473 #line 182 "lexer.ll"
1474 { return T_DECREMENT; }
1475  YY_BREAK
1476 case 65:
1478 #line 184 "lexer.ll"
1479 { return 'A'; }
1480  YY_BREAK
1481 case 66:
1483 #line 185 "lexer.ll"
1484 { return 'U'; }
1485  YY_BREAK
1486 case 67:
1488 #line 186 "lexer.ll"
1489 { return 'R'; }
1490  YY_BREAK
1491 case 68:
1493 #line 187 "lexer.ll"
1494 { return 'W'; }
1495  YY_BREAK
1496 case 69:
1498 #line 188 "lexer.ll"
1499 { return 'E'; }
1500  YY_BREAK
1501 case 70:
1503 #line 190 "lexer.ll"
1504 { return T_AF; }
1505  YY_BREAK
1506 case 71:
1508 #line 191 "lexer.ll"
1509 { return T_AG; }
1510  YY_BREAK
1511 case 72:
1513 #line 192 "lexer.ll"
1514 { return T_EF; }
1515  YY_BREAK
1516 case 73:
1518 #line 193 "lexer.ll"
1519 { return T_EG; }
1520  YY_BREAK
1521 case 74:
1523 #line 194 "lexer.ll"
1524 { return T_LEADSTO; }
1525  YY_BREAK
1526 case 75:
1528 #line 195 "lexer.ll"
1529 { return T_AG_PLUS; }
1530  YY_BREAK
1531 case 76:
1533 #line 196 "lexer.ll"
1534 { return T_EF_PLUS; }
1535  YY_BREAK
1536 case 77:
1538 #line 197 "lexer.ll"
1539 { return T_AG_MULT; }
1540  YY_BREAK
1541 case 78:
1543 #line 198 "lexer.ll"
1544 { return T_EF_MULT; }
1545  YY_BREAK
1546 case 79:
1548 #line 199 "lexer.ll"
1549 { return T_BOX; }
1550  YY_BREAK
1551 case 80:
1553 #line 200 "lexer.ll"
1554 { return T_DIAMOND; }
1555  YY_BREAK
1556 case 81:
1558 #line 201 "lexer.ll"
1559 { return T_HASH; }
1560  YY_BREAK
1561 case 82:
1563 #line 203 "lexer.ll"
1564 {
1565  const Keyword *keyword
1566  = Keywords::in_word_set(utap_text, strlen(utap_text));
1567  if (keyword != NULL)
1568  {
1569  int32_t s = keyword->syntax;
1570 #ifndef ENABLE_TIGA
1571  /* Remove all TIGA keywords if tiga is not enabled. */
1572  if (s & SYNTAX_TIGA)
1573  {
1574  s = 0;
1575  }
1576 #endif
1577 #ifndef ENABLE_PROB
1578  /* Remove all PROB keywords if pro is not enabled. */
1579  if (s & SYNTAX_PROB)
1580  {
1581  s = 0;
1582  }
1583 #endif
1584  if (syntax & s)
1585  {
1586  if (keyword->token == T_CONST && (syntax & SYNTAX_OLD))
1587  {
1588  return T_OLDCONST;
1589  }
1590  return keyword->token;
1591  }
1592  }
1593  if (strlen(utap_text) > MAXLEN-1)
1594  {
1595  /* Don't keep the cut of strncpy silent. */
1597  }
1598  if (ch->isType(utap_text))
1599  {
1600  strncpy(utap_lval.string, utap_text, MAXLEN);
1601  utap_lval.string[MAXLEN - 1] = '\0';
1602  return T_TYPENAME;
1603  }
1604  else
1605  {
1606  strncpy(utap_lval.string, utap_text, MAXLEN);
1607  utap_lval.string[MAXLEN - 1] = '\0';
1608  return T_ID;
1609  }
1610  }
1611  YY_BREAK
1612 case 83:
1614 #line 251 "lexer.ll"
1615 {
1616  // Skip 0s.
1617  const char *s = utap_text;
1618  while(*s && *s == '0') s++;
1619  if (!*s) { // We've skipped everything.
1620  utap_lval.number = 0;
1621  return T_NAT;
1622  }
1623 
1624  // Special case for INT_MIN
1625  if (strcmp("2147483648", s) == 0)
1626  {
1627  return T_POS_NEG_MAX;
1628  }
1629 
1630  // Detect overflow.
1631  utap_lval.number = atoi(s);
1632  char check[16];
1633  snprintf(check,sizeof(check),"%d",utap_lval.number);
1634  if (strcmp(check,s) != 0)
1635  {
1636  yyerror("$Overflow");
1637  return T_ERROR;
1638  }
1639 
1640  // Oh, it worked.
1641  return T_NAT;
1642  }
1643  YY_BREAK
1644 case 84:
1646 #line 280 "lexer.ll"
1647 {
1648  // Todo: have some check.
1649  utap_lval.floating = atof(utap_text);
1650  return T_FLOATING;
1651  }
1652  YY_BREAK
1653 case 85:
1655 #line 287 "lexer.ll"
1656 {
1657  utap_error("$Unknown_symbol");
1658  return T_ERROR;
1659  }
1660  YY_BREAK
1661 case YY_STATE_EOF(INITIAL):
1662 #line 292 "lexer.ll"
1663 { return 0; }
1664  YY_BREAK
1665 case 86:
1667 #line 294 "lexer.ll"
1668 YY_FATAL_ERROR( "flex scanner jammed" );
1669  YY_BREAK
1670 #line 1671 "lexer.cc"
1671 
1672  case YY_END_OF_BUFFER:
1673  {
1674  /* Amount of text matched not including the EOB char. */
1675  int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1676 
1677  /* Undo the effects of YY_DO_BEFORE_ACTION. */
1678  *yy_cp = (yy_hold_char);
1680 
1681  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1682  {
1683  /* We're scanning a new file or input source. It's
1684  * possible that this happened because the user
1685  * just pointed yyin at a new source and called
1686  * yylex(). If so, then we have to assure
1687  * consistency between YY_CURRENT_BUFFER and our
1688  * globals. Here is the right place to do so, because
1689  * this is the first action (other than possibly a
1690  * back-up) that will match for the new input source.
1691  */
1692  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1693  YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1694  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1695  }
1696 
1697  /* Note that here we test for yy_c_buf_p "<=" to the position
1698  * of the first EOB in the buffer, since yy_c_buf_p will
1699  * already have been incremented past the NUL character
1700  * (since all states make transitions on EOB to the
1701  * end-of-buffer state). Contrast this with the test
1702  * in input().
1703  */
1704  if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1705  { /* This was really a NUL. */
1706  yy_state_type yy_next_state;
1707 
1708  (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1709 
1710  yy_current_state = yy_get_previous_state( );
1711 
1712  /* Okay, we're now positioned to make the NUL
1713  * transition. We couldn't have
1714  * yy_get_previous_state() go ahead and do it
1715  * for us because it doesn't know how to deal
1716  * with the possibility of jamming (and we don't
1717  * want to build jamming into it because then it
1718  * will run more slowly).
1719  */
1720 
1721  yy_next_state = yy_try_NUL_trans( yy_current_state );
1722 
1723  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1724 
1725  if ( yy_next_state )
1726  {
1727  /* Consume the NUL. */
1728  yy_cp = ++(yy_c_buf_p);
1729  yy_current_state = yy_next_state;
1730  goto yy_match;
1731  }
1732 
1733  else
1734  {
1735  yy_cp = (yy_last_accepting_cpos);
1736  yy_current_state = (yy_last_accepting_state);
1737  goto yy_find_action;
1738  }
1739  }
1740 
1741  else switch ( yy_get_next_buffer( ) )
1742  {
1743  case EOB_ACT_END_OF_FILE:
1744  {
1746 
1747  if ( yywrap( ) )
1748  {
1749  /* Note: because we've taken care in
1750  * yy_get_next_buffer() to have set up
1751  * yytext, we can now set up
1752  * yy_c_buf_p so that if some total
1753  * hoser (like flex itself) wants to
1754  * call the scanner after we return the
1755  * YY_NULL, it'll still work - another
1756  * YY_NULL will get returned.
1757  */
1759 
1760  yy_act = YY_STATE_EOF(YY_START);
1761  goto do_action;
1762  }
1763 
1764  else
1765  {
1766  if ( ! (yy_did_buffer_switch_on_eof) )
1767  YY_NEW_FILE;
1768  }
1769  break;
1770  }
1771 
1772  case EOB_ACT_CONTINUE_SCAN:
1773  (yy_c_buf_p) =
1774  (yytext_ptr) + yy_amount_of_matched_text;
1775 
1776  yy_current_state = yy_get_previous_state( );
1777 
1778  yy_cp = (yy_c_buf_p);
1779  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1780  goto yy_match;
1781 
1782  case EOB_ACT_LAST_MATCH:
1783  (yy_c_buf_p) =
1784  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1785 
1786  yy_current_state = yy_get_previous_state( );
1787 
1788  yy_cp = (yy_c_buf_p);
1789  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1790  goto yy_find_action;
1791  }
1792  break;
1793  }
1794 
1795  default:
1797  "fatal flex scanner internal error--no action found" );
1798  } /* end of action switch */
1799  } /* end of scanning one token */
1800  } /* end of user's declarations */
1801 } /* end of yylex */
1802 
1803 /* yy_get_next_buffer - try to read in a new buffer
1804  *
1805  * Returns a code representing an action:
1806  * EOB_ACT_LAST_MATCH -
1807  * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1808  * EOB_ACT_END_OF_FILE - end of file
1809  */
1810 static int yy_get_next_buffer (void)
1811 {
1812  char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1813  char *source = (yytext_ptr);
1814  int number_to_move, i;
1815  int ret_val;
1816 
1817  if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1819  "fatal flex scanner internal error--end of buffer missed" );
1820 
1821  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1822  { /* Don't try to fill the buffer, so this is an EOF. */
1823  if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1824  {
1825  /* We matched a single character, the EOB, so
1826  * treat this as a final EOF.
1827  */
1828  return EOB_ACT_END_OF_FILE;
1829  }
1830 
1831  else
1832  {
1833  /* We matched some text prior to the EOB, first
1834  * process it.
1835  */
1836  return EOB_ACT_LAST_MATCH;
1837  }
1838  }
1839 
1840  /* Try to read more data. */
1841 
1842  /* First move last chars to start of buffer. */
1843  number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
1844 
1845  for ( i = 0; i < number_to_move; ++i )
1846  *(dest++) = *(source++);
1847 
1848  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1849  /* don't do the read, it's not guaranteed to return an EOF,
1850  * just force an EOF
1851  */
1852  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1853 
1854  else
1855  {
1856  int num_to_read =
1857  YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1858 
1859  while ( num_to_read <= 0 )
1860  { /* Not enough room in the buffer - grow it. */
1861 
1862  /* just a shorter name for the current buffer */
1864 
1865  int yy_c_buf_p_offset =
1866  (int) ((yy_c_buf_p) - b->yy_ch_buf);
1867 
1868  if ( b->yy_is_our_buffer )
1869  {
1870  int new_size = b->yy_buf_size * 2;
1871 
1872  if ( new_size <= 0 )
1873  b->yy_buf_size += b->yy_buf_size / 8;
1874  else
1875  b->yy_buf_size *= 2;
1876 
1877  b->yy_ch_buf = (char *)
1878  /* Include room in for 2 EOB chars. */
1879  yyrealloc( (void *) b->yy_ch_buf,
1880  (yy_size_t) (b->yy_buf_size + 2) );
1881  }
1882  else
1883  /* Can't grow it, we don't own it. */
1884  b->yy_ch_buf = NULL;
1885 
1886  if ( ! b->yy_ch_buf )
1888  "fatal error - scanner input buffer overflow" );
1889 
1890  (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1891 
1892  num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1893  number_to_move - 1;
1894 
1895  }
1896 
1897  if ( num_to_read > YY_READ_BUF_SIZE )
1898  num_to_read = YY_READ_BUF_SIZE;
1899 
1900  /* Read in more data. */
1901  YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1902  (yy_n_chars), num_to_read );
1903 
1904  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1905  }
1906 
1907  if ( (yy_n_chars) == 0 )
1908  {
1909  if ( number_to_move == YY_MORE_ADJ )
1910  {
1911  ret_val = EOB_ACT_END_OF_FILE;
1912  yyrestart( yyin );
1913  }
1914 
1915  else
1916  {
1917  ret_val = EOB_ACT_LAST_MATCH;
1918  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1920  }
1921  }
1922 
1923  else
1924  ret_val = EOB_ACT_CONTINUE_SCAN;
1925 
1926  if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1927  /* Extend the array by 50%, plus the number we really need. */
1928  int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1929  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1930  (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
1931  if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1932  YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1933  /* "- 2" to take care of EOB's */
1934  YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1935  }
1936 
1937  (yy_n_chars) += number_to_move;
1940 
1941  (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1942 
1943  return ret_val;
1944 }
1945 
1946 /* yy_get_previous_state - get the state just before the EOB char was reached */
1947 
1948  static yy_state_type yy_get_previous_state (void)
1949 {
1950  yy_state_type yy_current_state;
1951  char *yy_cp;
1952 
1953  yy_current_state = (yy_start);
1954 
1955  for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1956  {
1957  YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1958  if ( yy_accept[yy_current_state] )
1959  {
1960  (yy_last_accepting_state) = yy_current_state;
1961  (yy_last_accepting_cpos) = yy_cp;
1962  }
1963  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1964  {
1965  yy_current_state = (int) yy_def[yy_current_state];
1966  if ( yy_current_state >= 118 )
1967  yy_c = yy_meta[yy_c];
1968  }
1969  yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1970  }
1971 
1972  return yy_current_state;
1973 }
1974 
1975 /* yy_try_NUL_trans - try to make a transition on the NUL character
1976  *
1977  * synopsis
1978  * next_state = yy_try_NUL_trans( current_state );
1979  */
1980  static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1981 {
1982  int yy_is_jam;
1983  char *yy_cp = (yy_c_buf_p);
1984 
1985  YY_CHAR yy_c = 1;
1986  if ( yy_accept[yy_current_state] )
1987  {
1988  (yy_last_accepting_state) = yy_current_state;
1989  (yy_last_accepting_cpos) = yy_cp;
1990  }
1991  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1992  {
1993  yy_current_state = (int) yy_def[yy_current_state];
1994  if ( yy_current_state >= 118 )
1995  yy_c = yy_meta[yy_c];
1996  }
1997  yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1998  yy_is_jam = (yy_current_state == 117);
1999 
2000  return yy_is_jam ? 0 : yy_current_state;
2001 }
2002 
2003 #ifndef YY_NO_UNPUT
2004 
2005 #endif
2006 
2007 #ifndef YY_NO_INPUT
2008 #ifdef __cplusplus
2009  static int yyinput (void)
2010 #else
2011  static int input (void)
2012 #endif
2013 
2014 {
2015  int c;
2016 
2017  *(yy_c_buf_p) = (yy_hold_char);
2018 
2019  if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
2020  {
2021  /* yy_c_buf_p now points to the character we want to return.
2022  * If this occurs *before* the EOB characters, then it's a
2023  * valid NUL; if not, then we've hit the end of the buffer.
2024  */
2025  if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2026  /* This was really a NUL. */
2027  *(yy_c_buf_p) = '\0';
2028 
2029  else
2030  { /* need more input */
2031  int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
2032  ++(yy_c_buf_p);
2033 
2034  switch ( yy_get_next_buffer( ) )
2035  {
2036  case EOB_ACT_LAST_MATCH:
2037  /* This happens because yy_g_n_b()
2038  * sees that we've accumulated a
2039  * token and flags that we need to
2040  * try matching the token before
2041  * proceeding. But for input(),
2042  * there's no matching to consider.
2043  * So convert the EOB_ACT_LAST_MATCH
2044  * to EOB_ACT_END_OF_FILE.
2045  */
2046 
2047  /* Reset buffer status. */
2048  yyrestart( yyin );
2049 
2050  /*FALLTHROUGH*/
2051 
2052  case EOB_ACT_END_OF_FILE:
2053  {
2054  if ( yywrap( ) )
2055  return 0;
2056 
2057  if ( ! (yy_did_buffer_switch_on_eof) )
2058  YY_NEW_FILE;
2059 #ifdef __cplusplus
2060  return yyinput();
2061 #else
2062  return input();
2063 #endif
2064  }
2065 
2066  case EOB_ACT_CONTINUE_SCAN:
2067  (yy_c_buf_p) = (yytext_ptr) + offset;
2068  break;
2069  }
2070  }
2071  }
2072 
2073  c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
2074  *(yy_c_buf_p) = '\0'; /* preserve yytext */
2075  (yy_hold_char) = *++(yy_c_buf_p);
2076 
2077  return c;
2078 }
2079 #endif /* ifndef YY_NO_INPUT */
2080 
2086  void yyrestart (FILE * input_file )
2087 {
2088 
2089  if ( ! YY_CURRENT_BUFFER ){
2093  }
2094 
2095  yy_init_buffer( YY_CURRENT_BUFFER, input_file );
2097 }
2098 
2103  void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
2104 {
2105 
2106  /* TODO. We should be able to replace this entire function body
2107  * with
2108  * yypop_buffer_state();
2109  * yypush_buffer_state(new_buffer);
2110  */
2112  if ( YY_CURRENT_BUFFER == new_buffer )
2113  return;
2114 
2115  if ( YY_CURRENT_BUFFER )
2116  {
2117  /* Flush out information for old buffer. */
2118  *(yy_c_buf_p) = (yy_hold_char);
2119  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2120  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2121  }
2122 
2123  YY_CURRENT_BUFFER_LVALUE = new_buffer;
2125 
2126  /* We don't actually know whether we did this switch during
2127  * EOF (yywrap()) processing, but the only time this flag
2128  * is looked at is after yywrap() is called, so it's safe
2129  * to go ahead and always set it.
2130  */
2132 }
2133 
2134 static void yy_load_buffer_state (void)
2135 {
2136  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2137  (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2138  yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2139  (yy_hold_char) = *(yy_c_buf_p);
2140 }
2141 
2148  YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
2149 {
2150  YY_BUFFER_STATE b;
2151 
2152  b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
2153  if ( ! b )
2154  YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2155 
2156  b->yy_buf_size = size;
2157 
2158  /* yy_ch_buf has to be 2 characters longer than the size given because
2159  * we need to put in 2 end-of-buffer characters.
2160  */
2161  b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
2162  if ( ! b->yy_ch_buf )
2163  YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2164 
2165  b->yy_is_our_buffer = 1;
2166 
2167  yy_init_buffer( b, file );
2168 
2169  return b;
2170 }
2171 
2177 {
2178 
2179  if ( ! b )
2180  return;
2181 
2182  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2184 
2185  if ( b->yy_is_our_buffer )
2186  yyfree( (void *) b->yy_ch_buf );
2187 
2188  yyfree( (void *) b );
2189 }
2190 
2191 /* Initializes or reinitializes a buffer.
2192  * This function is sometimes called more than once on the same buffer,
2193  * such as during a yyrestart() or at EOF.
2194  */
2195  static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
2196 
2197 {
2198  int oerrno = errno;
2199 
2200  yy_flush_buffer( b );
2201 
2202  b->yy_input_file = file;
2203  b->yy_fill_buffer = 1;
2204 
2205  /* If b is the current buffer, then yy_init_buffer was _probably_
2206  * called from yyrestart() or through yy_get_next_buffer.
2207  * In that case, we don't want to reset the lineno or column.
2208  */
2209  if (b != YY_CURRENT_BUFFER){
2210  b->yy_bs_lineno = 1;
2211  b->yy_bs_column = 0;
2212  }
2213 
2214  b->yy_is_interactive = 0;
2215 
2216  errno = oerrno;
2217 }
2218 
2224 {
2225  if ( ! b )
2226  return;
2227 
2228  b->yy_n_chars = 0;
2229 
2230  /* We always need two end-of-buffer characters. The first causes
2231  * a transition to the end-of-buffer state. The second causes
2232  * a jam in that state.
2233  */
2234  b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2235  b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2236 
2237  b->yy_buf_pos = &b->yy_ch_buf[0];
2238 
2239  b->yy_at_bol = 1;
2240  b->yy_buffer_status = YY_BUFFER_NEW;
2241 
2242  if ( b == YY_CURRENT_BUFFER )
2244 }
2245 
2252 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
2253 {
2254  if (new_buffer == NULL)
2255  return;
2256 
2258 
2259  /* This block is copied from yy_switch_to_buffer. */
2260  if ( YY_CURRENT_BUFFER )
2261  {
2262  /* Flush out information for old buffer. */
2263  *(yy_c_buf_p) = (yy_hold_char);
2264  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2265  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2266  }
2267 
2268  /* Only push if top exists. Otherwise, replace top. */
2269  if (YY_CURRENT_BUFFER)
2270  (yy_buffer_stack_top)++;
2271  YY_CURRENT_BUFFER_LVALUE = new_buffer;
2272 
2273  /* copied from yy_switch_to_buffer. */
2276 }
2277 
2282 void yypop_buffer_state (void)
2283 {
2284  if (!YY_CURRENT_BUFFER)
2285  return;
2286 
2288  YY_CURRENT_BUFFER_LVALUE = NULL;
2289  if ((yy_buffer_stack_top) > 0)
2290  --(yy_buffer_stack_top);
2291 
2292  if (YY_CURRENT_BUFFER) {
2295  }
2296 }
2297 
2298 /* Allocates the stack if it does not exist.
2299  * Guarantees space for at least one push.
2300  */
2301 static void yyensure_buffer_stack (void)
2302 {
2303  yy_size_t num_to_alloc;
2304 
2305  if (!(yy_buffer_stack)) {
2306 
2307  /* First allocation is just for 2 elements, since we don't know if this
2308  * scanner will even need a stack. We use 2 instead of 1 to avoid an
2309  * immediate realloc on the next call.
2310  */
2311  num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
2312  (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
2313  (num_to_alloc * sizeof(struct yy_buffer_state*)
2314  );
2315  if ( ! (yy_buffer_stack) )
2316  YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2317 
2318  memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2319 
2320  (yy_buffer_stack_max) = num_to_alloc;
2321  (yy_buffer_stack_top) = 0;
2322  return;
2323  }
2324 
2325  if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2326 
2327  /* Increase the buffer to prepare for a possible push. */
2328  yy_size_t grow_size = 8 /* arbitrary grow size */;
2329 
2330  num_to_alloc = (yy_buffer_stack_max) + grow_size;
2331  (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
2332  ((yy_buffer_stack),
2333  num_to_alloc * sizeof(struct yy_buffer_state*)
2334  );
2335  if ( ! (yy_buffer_stack) )
2336  YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2337 
2338  /* zero only the new slots.*/
2339  memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2340  (yy_buffer_stack_max) = num_to_alloc;
2341  }
2342 }
2343 
2350 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
2351 {
2352  YY_BUFFER_STATE b;
2353 
2354  if ( size < 2 ||
2355  base[size-2] != YY_END_OF_BUFFER_CHAR ||
2356  base[size-1] != YY_END_OF_BUFFER_CHAR )
2357  /* They forgot to leave room for the EOB's. */
2358  return NULL;
2359 
2360  b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
2361  if ( ! b )
2362  YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2363 
2364  b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
2365  b->yy_buf_pos = b->yy_ch_buf = base;
2366  b->yy_is_our_buffer = 0;
2367  b->yy_input_file = NULL;
2368  b->yy_n_chars = b->yy_buf_size;
2369  b->yy_is_interactive = 0;
2370  b->yy_at_bol = 1;
2371  b->yy_fill_buffer = 0;
2372  b->yy_buffer_status = YY_BUFFER_NEW;
2373 
2374  yy_switch_to_buffer( b );
2375 
2376  return b;
2377 }
2378 
2387 YY_BUFFER_STATE yy_scan_string (const char * yystr )
2388 {
2389 
2390  return yy_scan_bytes( yystr, (int) strlen(yystr) );
2391 }
2392 
2400 YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
2401 {
2402  YY_BUFFER_STATE b;
2403  char *buf;
2404  yy_size_t n;
2405  int i;
2406 
2407  /* Get memory for full buffer, including space for trailing EOB's. */
2408  n = (yy_size_t) (_yybytes_len + 2);
2409  buf = (char *) yyalloc( n );
2410  if ( ! buf )
2411  YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2412 
2413  for ( i = 0; i < _yybytes_len; ++i )
2414  buf[i] = yybytes[i];
2415 
2416  buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2417 
2418  b = yy_scan_buffer( buf, n );
2419  if ( ! b )
2420  YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2421 
2422  /* It's okay to grow etc. this buffer, and we should throw it
2423  * away when we're done.
2424  */
2425  b->yy_is_our_buffer = 1;
2426 
2427  return b;
2428 }
2429 
2430 #ifndef YY_EXIT_FAILURE
2431 #define YY_EXIT_FAILURE 2
2432 #endif
2433 
2434 static void yynoreturn yy_fatal_error (const char* msg )
2435 {
2436  fprintf( stderr, "%s\n", msg );
2437  exit( YY_EXIT_FAILURE );
2438 }
2439 
2440 /* Redefine yyless() so it works in section 3 code. */
2441 
2442 #undef yyless
2443 #define yyless(n) \
2444  do \
2445  { \
2446  /* Undo effects of setting up yytext. */ \
2447  int yyless_macro_arg = (n); \
2448  YY_LESS_LINENO(yyless_macro_arg);\
2449  yytext[yyleng] = (yy_hold_char); \
2450  (yy_c_buf_p) = yytext + yyless_macro_arg; \
2451  (yy_hold_char) = *(yy_c_buf_p); \
2452  *(yy_c_buf_p) = '\0'; \
2453  yyleng = yyless_macro_arg; \
2454  } \
2455  while ( 0 )
2456 
2457 /* Accessor methods (get/set functions) to struct members. */
2458 
2462 int yyget_lineno (void)
2463 {
2464 
2465  return yylineno;
2466 }
2467 
2471 FILE *yyget_in (void)
2472 {
2473  return yyin;
2474 }
2475 
2479 FILE *yyget_out (void)
2480 {
2481  return yyout;
2482 }
2483 
2487 int yyget_leng (void)
2488 {
2489  return yyleng;
2490 }
2491 
2496 char *yyget_text (void)
2497 {
2498  return yytext;
2499 }
2500 
2505 void yyset_lineno (int _line_number )
2506 {
2507 
2508  yylineno = _line_number;
2509 }
2510 
2517 void yyset_in (FILE * _in_str )
2518 {
2519  yyin = _in_str ;
2520 }
2521 
2522 void yyset_out (FILE * _out_str )
2523 {
2524  yyout = _out_str ;
2525 }
2526 
2527 int yyget_debug (void)
2528 {
2529  return yy_flex_debug;
2530 }
2531 
2532 void yyset_debug (int _bdebug )
2533 {
2534  yy_flex_debug = _bdebug ;
2535 }
2536 
2537 static int yy_init_globals (void)
2538 {
2539  /* Initialization is the same as for the non-reentrant scanner.
2540  * This function is called from yylex_destroy(), so don't allocate here.
2541  */
2542 
2543  (yy_buffer_stack) = NULL;
2544  (yy_buffer_stack_top) = 0;
2545  (yy_buffer_stack_max) = 0;
2546  (yy_c_buf_p) = NULL;
2547  (yy_init) = 0;
2548  (yy_start) = 0;
2549 
2550 /* Defined in main.c */
2551 #ifdef YY_STDINIT
2552  yyin = stdin;
2553  yyout = stdout;
2554 #else
2555  yyin = NULL;
2556  yyout = NULL;
2557 #endif
2558 
2559  /* For future reference: Set errno on error, since we are called by
2560  * yylex_init()
2561  */
2562  return 0;
2563 }
2564 
2565 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
2566 int yylex_destroy (void)
2567 {
2568 
2569  /* Pop the buffer stack, destroying each element. */
2570  while(YY_CURRENT_BUFFER){
2572  YY_CURRENT_BUFFER_LVALUE = NULL;
2574  }
2575 
2576  /* Destroy the stack itself. */
2577  yyfree((yy_buffer_stack) );
2578  (yy_buffer_stack) = NULL;
2579 
2580  /* Reset the globals. This is important in a non-reentrant scanner so the next time
2581  * yylex() is called, initialization will occur. */
2582  yy_init_globals( );
2583 
2584  return 0;
2585 }
2586 
2587 /*
2588  * Internal utility routines.
2589  */
2590 
2591 #ifndef yytext_ptr
2592 static void yy_flex_strncpy (char* s1, const char * s2, int n )
2593 {
2594 
2595  int i;
2596  for ( i = 0; i < n; ++i )
2597  s1[i] = s2[i];
2598 }
2599 #endif
2600 
2601 #ifdef YY_NEED_STRLEN
2602 static int yy_flex_strlen (const char * s )
2603 {
2604  int n;
2605  for ( n = 0; s[n]; ++n )
2606  ;
2607 
2608  return n;
2609 }
2610 #endif
2611 
2612 void *yyalloc (yy_size_t size )
2613 {
2614  return malloc(size);
2615 }
2616 
2617 void *yyrealloc (void * ptr, yy_size_t size )
2618 {
2619 
2620  /* The cast to (char *) in the following accommodates both
2621  * implementations that use char* generic pointers, and those
2622  * that use void* generic pointers. It works with the latter
2623  * because both ANSI C and C++ allow castless assignment from
2624  * any pointer type to void*, and deal with argument conversions
2625  * as though doing an assignment.
2626  */
2627  return realloc(ptr, size);
2628 }
2629 
2630 void yyfree (void * ptr )
2631 {
2632  free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2633 }
2634 
2635 #define YYTABLES_NAME "yytables"
2636 
2637 #line 294 "lexer.ll"
2638 
2639 
2640 int utap_wrap() {
2641  return 1;
2642 }
2643 
#define yyget_leng
Definition: lexer.cc:195
#define yyset_debug
Definition: lexer.cc:153
static yy_state_type yy_get_previous_state(void)
#define yylex_destroy
Definition: lexer.cc:141
#define YY_CURRENT_BUFFER
Definition: lexer.cc:519
static ParserBuilder * ch
Definition: parser.cc:105
#define yylex
Definition: lexer.cc:24
#define YY_EXIT_FAILURE
#define yyget_in
Definition: lexer.cc:171
#define yyset_out
Definition: lexer.cc:189
#define YY_BREAK
Definition: lexer.cc:1028
Definition: parser.cc:459
int yy_state_type
Definition: lexer.cc:589
#define yyrealloc
Definition: lexer.cc:31
static char * yy_c_buf_p
Definition: lexer.cc:533
#define yyensure_buffer_stack
Definition: lexer.cc:20
static int yy_start
Definition: lexer.cc:535
#define YY_END_OF_BUFFER
Definition: lexer.cc:615
#define yy_flex_debug
Definition: lexer.cc:21
#define yyout
Definition: lexer.cc:26
#define yyfree
Definition: lexer.cc:32
static char yy_hold_char
Definition: lexer.cc:528
#define yyalloc
Definition: lexer.cc:30
#define yy_scan_buffer
Definition: lexer.cc:11
#define yy_init_buffer
Definition: lexer.cc:14
#define yyget_out
Definition: lexer.cc:183
Definition: parser.cc:338
char * yy_cp
Definition: lexer.cc:1039
static int yy_init_globals(void)
flex_uint8_t YY_CHAR
Definition: lexer.cc:585
#define INITIAL
Definition: lexer.cc:855
#define YY_STATE_EOF(state)
Definition: lexer.cc:385
Definition: parser.cc:256
static const flex_int16_t yy_nxt[200]
Definition: lexer.cc:717
#define yy_scan_bytes
Definition: lexer.cc:13
#define YY_RULE_SETUP
Definition: lexer.cc:1031
#define YY_END_OF_BUFFER_CHAR
Definition: lexer.cc:388
The ParserBuilder interface is used by the parser to output the parsed system.
Definition: builder.h:80
#define yyget_debug
Definition: lexer.cc:147
#define EOB_ACT_CONTINUE_SCAN
Definition: lexer.cc:421
#define yytext_ptr
Definition: lexer.cc:598
#define yypop_buffer_state
Definition: lexer.cc:19
static syntax_t syntax
Definition: parser.cc:106
#define yy_switch_to_buffer
Definition: lexer.cc:17
char * yy_bp
Definition: lexer.cc:1039
virtual void addPosition(uint32_t position, uint32_t offset, uint32_t line, const std::string &path)=0
Add mapping from an absolute position to a relative XML element.
YYSTYPE utap_lval
#define yy_scan_string
Definition: lexer.cc:12
Definition: parser.cc:386
#define YY_SC_TO_UI(c)
Definition: lexer.cc:371
#define yy_load_buffer_state
Definition: lexer.cc:16
static const flex_int16_t yy_base[122]
Definition: lexer.cc:681
#define yyset_extra
Definition: lexer.cc:165
static yy_state_type yy_try_NUL_trans(yy_state_type current_state)
void * malloc(YYSIZE_T)
#define YY_FATAL_ERROR(msg)
Definition: lexer.cc:1003
struct yy_buffer_state * YY_BUFFER_STATE
Definition: lexer.cc:409
Definition: parser.cc:460
#define YY_BUFFER_NEW
Definition: lexer.cc:491
#define comment
Definition: lexer.cc:856
static const YY_CHAR yy_ec[256]
Definition: lexer.cc:640
static const flex_int16_t yy_chk[200]
Definition: lexer.cc:743
Definition: parser.cc:341
#define yy_flush_buffer
Definition: lexer.cc:15
#define ID_TOO_LONG
Definition: libparser.h:39
#define yyget_extra
Definition: lexer.cc:159
#define YY_CURRENT_BUFFER_LVALUE
Definition: lexer.cc:525
static YY_BUFFER_STATE * yy_buffer_stack
Stack as an array.
Definition: lexer.cc:511
size_t yy_size_t
Definition: lexer.cc:414
static void yynoreturn yy_fatal_error(const char *msg)
Definition: parser.cc:257
#define MAXLEN
Definition: libparser.h:32
#define EOB_ACT_END_OF_FILE
Definition: lexer.cc:422
static char * yy_last_accepting_cpos
Definition: lexer.cc:770
int yy_act
Definition: lexer.cc:1040
Definition: parser.cc:259
static size_t yy_buffer_stack_top
index of top of stack.
Definition: lexer.cc:509
int flex_int32_t
Definition: lexer.cc:312
Definition: parser.cc:411
#define YY_READ_BUF_SIZE
Definition: lexer.cc:940
Definition: parser.cc:339
#define YY_BUF_SIZE
Definition: lexer.cc:399
signed char flex_int8_t
Definition: lexer.cc:310
unsigned short int flex_uint16_t
Definition: lexer.cc:314
static const flex_int16_t yy_accept[118]
Definition: lexer.cc:623
Definition: parser.cc:387
#define yyget_lineno
Definition: lexer.cc:207
#define yyget_text
Definition: lexer.cc:201
#define yyset_in
Definition: lexer.cc:177
#define yyin
Definition: lexer.cc:22
Definition: parser.cc:408
static const YY_CHAR yy_meta[45]
Definition: lexer.cc:672
#define YY_RESTORE_YY_MORE_OFFSET
Definition: lexer.cc:781
Definition: parser.cc:337
#define yyset_lineno
Definition: lexer.cc:213
unsigned char flex_uint8_t
Definition: lexer.cc:313
#define yynoreturn
Definition: lexer.cc:362
static size_t yy_buffer_stack_max
capacity of stack.
Definition: lexer.cc:510
Definition: parser.cc:342
#define YY_BUFFER_EOF_PENDING
Definition: lexer.cc:503
Definition: parser.cc:340
#define yy_create_buffer
Definition: lexer.cc:9
static yy_state_type yy_last_accepting_state
Definition: lexer.cc:769
#define YY_INPUT(buf, result, max_size)
Definition: lexer.cc:956
static int yy_n_chars
Definition: lexer.cc:529
#define yyrestart
Definition: lexer.cc:27
#define yyerror
Definition: parser.cc:69
virtual void setPosition(uint32_t a, uint32_t b)=0
Sets the current position.
#define yy_delete_buffer
Definition: lexer.cc:10
static const flex_int16_t yy_def[122]
Definition: lexer.cc:699
#define YY_START
Definition: lexer.cc:382
#define yywrap
Definition: lexer.cc:29
Definition: parser.cc:258
#define YY_DECL
Definition: lexer.cc:810
#define YY_EXTRA_TYPE
Definition: lexer.cc:867
#define yyleng
Definition: lexer.cc:23
#define yypush_buffer_state
Definition: lexer.cc:18
Definition: lexer.cc:817
#define YY_MORE_ADJ
Definition: lexer.cc:780
static int yy_init
Definition: lexer.cc:534
Definition: parser.cc:388
static int input(void)
#define yylineno
Definition: lexer.cc:25
#define YY_DO_BEFORE_ACTION
Definition: lexer.cc:608
short int flex_int16_t
Definition: lexer.cc:311
Definition: parser.cc:413
unsigned int flex_uint32_t
Definition: lexer.cc:315
void free(void *)
#define BEGIN
Definition: lexer.cc:377
static int yy_get_next_buffer(void)
#define YY_BUFFER_NORMAL
Definition: lexer.cc:492
#define EOB_ACT_LAST_MATCH
Definition: lexer.cc:423
#define yytext
Definition: lexer.cc:28
static int yy_did_buffer_switch_on_eof
Definition: lexer.cc:540
static void utap_error(const char *msg)
Definition: parser.cc:8829
#define YY_NEW_FILE
Definition: lexer.cc:387
Definition: parser.cc:385