Bug Summary

File:testsuite/difftool/lex.yy.c
Warning:line 1850, column 9
Potential leak of memory pointed to by 's1'

Annotated Source Code

[?] Use j/k keys for keyboard navigation

1
2#line 3 "lex.yy.c"
3
4#define YY_INT_ALIGNEDshort int short int
5
6/* A lexical scanner generated by flex */
7
8#define FLEX_SCANNER
9#define YY_FLEX_MAJOR_VERSION2 2
10#define YY_FLEX_MINOR_VERSION6 6
11#define YY_FLEX_SUBMINOR_VERSION4 4
12#if YY_FLEX_SUBMINOR_VERSION4 > 0
13#define FLEX_BETA
14#endif
15
16/* First, we deal with platform-specific or compiler-specific issues. */
17
18/* begin standard C headers. */
19#include <stdio.h>
20#include <string.h>
21#include <errno(*__errno_location ()).h>
22#include <stdlib.h>
23
24/* end standard C headers. */
25
26/* flex integer type definitions */
27
28#ifndef FLEXINT_H
29#define FLEXINT_H
30
31/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
32
33#if defined (__STDC_VERSION__201112L) && __STDC_VERSION__201112L >= 199901L
34
35/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
36 * if you want the limit (max/min) macros for int types.
37 */
38#ifndef __STDC_LIMIT_MACROS1
39#define __STDC_LIMIT_MACROS1 1
40#endif
41
42#include <inttypes.h>
43typedef int8_t flex_int8_t;
44typedef uint8_t flex_uint8_t;
45typedef int16_t flex_int16_t;
46typedef uint16_t flex_uint16_t;
47typedef int32_t flex_int32_t;
48typedef uint32_t flex_uint32_t;
49#else
50typedef signed char flex_int8_t;
51typedef short int flex_int16_t;
52typedef int flex_int32_t;
53typedef unsigned char flex_uint8_t;
54typedef unsigned short int flex_uint16_t;
55typedef unsigned int flex_uint32_t;
56
57/* Limits of integral types. */
58#ifndef INT8_MIN(-128)
59#define INT8_MIN(-128) (-128)
60#endif
61#ifndef INT16_MIN(-32767-1)
62#define INT16_MIN(-32767-1) (-32767-1)
63#endif
64#ifndef INT32_MIN(-2147483647-1)
65#define INT32_MIN(-2147483647-1) (-2147483647-1)
66#endif
67#ifndef INT8_MAX(127)
68#define INT8_MAX(127) (127)
69#endif
70#ifndef INT16_MAX(32767)
71#define INT16_MAX(32767) (32767)
72#endif
73#ifndef INT32_MAX(2147483647)
74#define INT32_MAX(2147483647) (2147483647)
75#endif
76#ifndef UINT8_MAX(255)
77#define UINT8_MAX(255) (255U)
78#endif
79#ifndef UINT16_MAX(65535)
80#define UINT16_MAX(65535) (65535U)
81#endif
82#ifndef UINT32_MAX(4294967295U)
83#define UINT32_MAX(4294967295U) (4294967295U)
84#endif
85
86#ifndef SIZE_MAX(18446744073709551615UL)
87#define SIZE_MAX(18446744073709551615UL) (~(size_t)0)
88#endif
89
90#endif /* ! C99 */
91
92#endif /* ! FLEXINT_H */
93
94/* begin standard C++ headers. */
95
96/* TODO: this is always defined, so inline it */
97#define yyconstconst const
98
99#if defined(__GNUC__4) && __GNUC__4 >= 3
100#define yynoreturn__attribute__((__noreturn__)) __attribute__((__noreturn__))
101#else
102#define yynoreturn__attribute__((__noreturn__))
103#endif
104
105/* Returned upon end-of-file. */
106#define YY_NULL0 0
107
108/* Promotes a possibly negative, possibly signed char to an
109 * integer in range [0..255] for use as an array index.
110 */
111#define YY_SC_TO_UI(c)((YY_CHAR) (c)) ((YY_CHAR) (c))
112
113/* Enter a start condition. This macro really ought to take a parameter,
114 * but we do it the disgusting crufty way forced on us by the ()-less
115 * definition of BEGIN.
116 */
117#define BEGIN(yy_start) = 1 + 2 * (yy_start) = 1 + 2 *
118/* Translate the current start state into a value that can be later handed
119 * to BEGIN to return to the state. The YYSTATE alias is for lex
120 * compatibility.
121 */
122#define YY_START(((yy_start) - 1) / 2) (((yy_start) - 1) / 2)
123#define YYSTATE(((yy_start) - 1) / 2) YY_START(((yy_start) - 1) / 2)
124/* Action number for EOF rule of a given start state. */
125#define YY_STATE_EOF(state)(5 + state + 1) (YY_END_OF_BUFFER5 + state + 1)
126/* Special action meaning "start processing a new file". */
127#define YY_NEW_FILEyyrestart( yyin ) yyrestart( yyin )
128#define YY_END_OF_BUFFER_CHAR0 0
129
130/* Size of default input buffer. */
131#ifndef YY_BUF_SIZE16384
132#ifdef __ia64__
133/* On IA-64, the buffer size is 16k, not 8k.
134 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
135 * Ditto for the __ia64__ case accordingly.
136 */
137#define YY_BUF_SIZE16384 32768
138#else
139#define YY_BUF_SIZE16384 16384
140#endif /* __ia64__ */
141#endif
142
143/* The state buf must be large enough to hold one state per character in the main buffer.
144 */
145#define YY_STATE_BUF_SIZE((16384 + 2) * sizeof(yy_state_type)) ((YY_BUF_SIZE16384 + 2) * sizeof(yy_state_type))
146
147#ifndef YY_TYPEDEF_YY_BUFFER_STATE
148#define YY_TYPEDEF_YY_BUFFER_STATE
149typedef struct yy_buffer_state *YY_BUFFER_STATE;
150#endif
151
152#ifndef YY_TYPEDEF_YY_SIZE_T
153#define YY_TYPEDEF_YY_SIZE_T
154typedef size_t yy_size_t;
155#endif
156
157extern int yyleng;
158
159extern FILE *yyin, *yyout;
160
161#define EOB_ACT_CONTINUE_SCAN0 0
162#define EOB_ACT_END_OF_FILE1 1
163#define EOB_ACT_LAST_MATCH2 2
164
165 #define YY_LESS_LINENO(n)
166 #define YY_LINENO_REWIND_TO(ptr)
167
168/* Return all but the first "n" matched characters back to the input stream. */
169#define yyless(n)do { int yyless_macro_arg = (n); ; yytext[yyleng] = (yy_hold_char
); (yy_c_buf_p) = yytext + yyless_macro_arg; (yy_hold_char) =
*(yy_c_buf_p); *(yy_c_buf_p) = '\0'; yyleng = yyless_macro_arg
; } while ( 0 )
\
170 do \
171 { \
172 /* Undo effects of setting up yytext. */ \
173 int yyless_macro_arg = (n); \
174 YY_LESS_LINENO(yyless_macro_arg);\
175 *yy_cp = (yy_hold_char); \
176 YY_RESTORE_YY_MORE_OFFSET \
177 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ0; \
178 YY_DO_BEFORE_ACTION(yytext) = yy_bp; yyleng = (int) (yy_cp - yy_bp); (yy_hold_char
) = *yy_cp; *yy_cp = '\0'; (yy_c_buf_p) = yy_cp;
; /* set up yytext again */ \
179 } \
180 while ( 0 )
181#define unput(c)yyunput( c, (yytext) ) yyunput( c, (yytext_ptryytext) )
182
183#ifndef YY_STRUCT_YY_BUFFER_STATE
184#define YY_STRUCT_YY_BUFFER_STATE
185struct yy_buffer_state
186 {
187 FILE *yy_input_file;
188
189 char *yy_ch_buf; /* input buffer */
190 char *yy_buf_pos; /* current position in input buffer */
191
192 /* Size of input buffer in bytes, not including room for EOB
193 * characters.
194 */
195 int yy_buf_size;
196
197 /* Number of characters read into yy_ch_buf, not including EOB
198 * characters.
199 */
200 int yy_n_chars;
201
202 /* Whether we "own" the buffer - i.e., we know we created it,
203 * and can realloc() it to grow it, and should free() it to
204 * delete it.
205 */
206 int yy_is_our_buffer;
207
208 /* Whether this is an "interactive" input source; if so, and
209 * if we're using stdio for input, then we want to use getc()
210 * instead of fread(), to make sure we stop fetching input after
211 * each newline.
212 */
213 int yy_is_interactive;
214
215 /* Whether we're considered to be at the beginning of a line.
216 * If so, '^' rules will be active on the next match, otherwise
217 * not.
218 */
219 int yy_at_bol;
220
221 int yy_bs_lineno; /**< The line count. */
222 int yy_bs_column; /**< The column count. */
223
224 /* Whether to try to fill the input buffer when we reach the
225 * end of it.
226 */
227 int yy_fill_buffer;
228
229 int yy_buffer_status;
230
231#define YY_BUFFER_NEW0 0
232#define YY_BUFFER_NORMAL1 1
233 /* When an EOF's been seen but there's still some text to process
234 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
235 * shouldn't try reading from the input source any more. We might
236 * still have a bunch of tokens to match, though, because of
237 * possible backing-up.
238 *
239 * When we actually see the EOF, we change the status to "new"
240 * (via yyrestart()), so that the user can continue scanning by
241 * just pointing yyin at a new input file.
242 */
243#define YY_BUFFER_EOF_PENDING2 2
244
245 };
246#endif /* !YY_STRUCT_YY_BUFFER_STATE */
247
248/* Stack of input buffers. */
249static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
250static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
251static YY_BUFFER_STATE * yy_buffer_stack = NULL((void*)0); /**< Stack as an array. */
252
253/* We provide macros for accessing buffer states in case in the
254 * future we want to put the buffer states in a more general
255 * "scanner state".
256 *
257 * Returns the top of the stack, or NULL.
258 */
259#define YY_CURRENT_BUFFER( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)
] : ((void*)0))
( (yy_buffer_stack) \
260 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
261 : NULL((void*)0))
262/* Same as previous macro, but useful when we know that the buffer stack is not
263 * NULL or when we need an lvalue. For internal use only.
264 */
265#define YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)] (yy_buffer_stack)[(yy_buffer_stack_top)]
266
267/* yy_hold_char holds the character lost when yytext is formed. */
268static char yy_hold_char;
269static int yy_n_chars; /* number of characters read into yy_ch_buf */
270int yyleng;
271
272/* Points to current character in buffer. */
273static char *yy_c_buf_p = NULL((void*)0);
274static int yy_init = 0; /* whether we need to initialize */
275static int yy_start = 0; /* start state number */
276
277/* Flag which is used to allow yywrap()'s to do buffer switches
278 * instead of setting up a fresh yyin. A bit of a hack ...
279 */
280static int yy_did_buffer_switch_on_eof;
281
282void yyrestart ( FILE *input_file );
283void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer );
284YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
285void yy_delete_buffer ( YY_BUFFER_STATE b );
286void yy_flush_buffer ( YY_BUFFER_STATE b );
287void yypush_buffer_state ( YY_BUFFER_STATE new_buffer );
288void yypop_buffer_state ( void );
289
290static void yyensure_buffer_stack ( void );
291static void yy_load_buffer_state ( void );
292static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
293#define YY_FLUSH_BUFFERyy_flush_buffer( ( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top
)] : ((void*)0)) )
yy_flush_buffer( YY_CURRENT_BUFFER( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)
] : ((void*)0))
)
294
295YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size );
296YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
297YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
298
299void *yyalloc ( yy_size_t );
300void *yyrealloc ( void *, yy_size_t );
301void yyfree ( void * );
302
303#define yy_new_bufferyy_create_buffer yy_create_buffer
304#define yy_set_interactive(is_interactive){ if ( ! ( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top
)] : ((void*)0)) ){ yyensure_buffer_stack (); (yy_buffer_stack
)[(yy_buffer_stack_top)] = yy_create_buffer( yyin, 16384 ); }
(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_is_interactive
= is_interactive; }
\
305 { \
306 if ( ! YY_CURRENT_BUFFER( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)
] : ((void*)0))
){ \
307 yyensure_buffer_stack (); \
308 YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)] = \
309 yy_create_buffer( yyin, YY_BUF_SIZE16384 ); \
310 } \
311 YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_is_interactive = is_interactive; \
312 }
313#define yy_set_bol(at_bol){ if ( ! ( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top
)] : ((void*)0)) ){ yyensure_buffer_stack (); (yy_buffer_stack
)[(yy_buffer_stack_top)] = yy_create_buffer( yyin, 16384 ); }
(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_at_bol = at_bol
; }
\
314 { \
315 if ( ! YY_CURRENT_BUFFER( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)
] : ((void*)0))
){\
316 yyensure_buffer_stack (); \
317 YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)] = \
318 yy_create_buffer( yyin, YY_BUF_SIZE16384 ); \
319 } \
320 YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_at_bol = at_bol; \
321 }
322#define YY_AT_BOL()((yy_buffer_stack)[(yy_buffer_stack_top)]->yy_at_bol) (YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_at_bol)
323
324/* Begin user sect3 */
325typedef flex_uint8_t YY_CHAR;
326
327FILE *yyin = NULL((void*)0), *yyout = NULL((void*)0);
328
329typedef int yy_state_type;
330
331extern int yylineno;
332int yylineno = 1;
333
334extern char *yytext;
335#ifdef yytext_ptryytext
336#undef yytext_ptryytext
337#endif
338#define yytext_ptryytext yytext
339
340static yy_state_type yy_get_previous_state ( void );
341static yy_state_type yy_try_NUL_trans ( yy_state_type current_state );
342static int yy_get_next_buffer ( void );
343static void yynoreturn__attribute__((__noreturn__)) yy_fatal_error ( const char* msg );
344
345/* Done after the current pattern has been matched and before the
346 * corresponding action - sets up yytext.
347 */
348#define YY_DO_BEFORE_ACTION(yytext) = yy_bp; yyleng = (int) (yy_cp - yy_bp); (yy_hold_char
) = *yy_cp; *yy_cp = '\0'; (yy_c_buf_p) = yy_cp;
\
349 (yytext_ptryytext) = yy_bp; \
350 yyleng = (int) (yy_cp - yy_bp); \
351 (yy_hold_char) = *yy_cp; \
352 *yy_cp = '\0'; \
353 (yy_c_buf_p) = yy_cp;
354#define YY_NUM_RULES4 4
355#define YY_END_OF_BUFFER5 5
356/* This struct is not used in this scanner,
357 but its presence is necessary. */
358struct yy_trans_info
359 {
360 flex_int32_t yy_verify;
361 flex_int32_t yy_nxt;
362 };
363static const flex_int16_t yy_accept[18] =
364 { 0,
365 0, 0, 5, 3, 1, 1, 4, 2, 3, 1,
366 2, 0, 0, 2, 0, 2, 0
367 } ;
368
369static const YY_CHAR yy_ec[256] =
370 { 0,
371 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
372 1, 1, 3, 1, 1, 1, 1, 1, 1, 1,
373 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
374 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
375 1, 1, 4, 1, 5, 6, 1, 7, 7, 7,
376 7, 7, 7, 7, 7, 7, 7, 1, 1, 1,
377 1, 1, 1, 1, 1, 1, 1, 1, 8, 1,
378 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
379 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
380 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
381
382 9, 1, 1, 1, 1, 1, 1, 1, 1, 1,
383 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
384 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
385 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
386 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
387 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
388 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
389 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
390 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
391 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
392
393 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
394 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
395 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
396 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
397 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
398 1, 1, 1, 1, 1
399 } ;
400
401static const YY_CHAR yy_meta[10] =
402 { 0,
403 1, 2, 2, 1, 2, 1, 2, 1, 1
404 } ;
405
406static const flex_int16_t yy_base[19] =
407 { 0,
408 0, 0, 27, 0, 23, 23, 17, 4, 0, 28,
409 0, 16, 10, 11, 15, 14, 28, 15
410 } ;
411
412static const flex_int16_t yy_def[19] =
413 { 0,
414 17, 1, 17, 18, 17, 17, 18, 17, 18, 17,
415 8, 17, 17, 17, 17, 17, 0, 17
416 } ;
417
418static const flex_int16_t yy_nxt[38] =
419 { 0,
420 4, 5, 6, 4, 7, 4, 8, 4, 4, 12,
421 11, 13, 13, 15, 15, 9, 16, 14, 13, 13,
422 16, 16, 14, 11, 10, 10, 17, 3, 17, 17,
423 17, 17, 17, 17, 17, 17, 17
424 } ;
425
426static const flex_int16_t yy_chk[38] =
427 { 0,
428 1, 1, 1, 1, 1, 1, 1, 1, 1, 8,
429 8, 8, 8, 13, 13, 18, 13, 14, 14, 14,
430 16, 15, 12, 7, 6, 5, 3, 17, 17, 17,
431 17, 17, 17, 17, 17, 17, 17
432 } ;
433
434static yy_state_type yy_last_accepting_state;
435static char *yy_last_accepting_cpos;
436
437extern int yy_flex_debug;
438int yy_flex_debug = 0;
439
440/* The intent behind this definition is that it'll catch
441 * any uses of REJECT which flex missed.
442 */
443#define REJECTreject_used_but_not_detected reject_used_but_not_detected
444#define yymore()yymore_used_but_not_detected yymore_used_but_not_detected
445#define YY_MORE_ADJ0 0
446#define YY_RESTORE_YY_MORE_OFFSET
447char *yytext;
448#line 1 "omc-diff.l"
449/* 123 -123 123.456 123.45e23 123.45e-23 10e5 */
450#line 3 "omc-diff.l"
451#define T_EOF0 0
452#define T_TEXT1 1
453#define T_REAL2 2
454#define T_NEWLINE3 3
455char* yylval;
456
457#line 458 "lex.yy.c"
458#line 459 "lex.yy.c"
459
460#define INITIAL0 0
461
462#ifndef YY_NO_UNISTD_H
463/* Special case for "unistd.h", since it is non-ANSI. We include it way
464 * down here because we want the user's section 1 to have been scanned first.
465 * The user has a chance to override it with an option.
466 */
467#include <unistd.h>
468#endif
469
470#ifndef YY_EXTRA_TYPEvoid *
471#define YY_EXTRA_TYPEvoid * void *
472#endif
473
474static int yy_init_globals ( void );
475
476/* Accessor methods to globals.
477 These are made visible to non-reentrant scanners for convenience. */
478
479int yylex_destroy ( void );
480
481int yyget_debug ( void );
482
483void yyset_debug ( int debug_flag );
484
485YY_EXTRA_TYPEvoid * yyget_extra ( void );
486
487void yyset_extra ( YY_EXTRA_TYPEvoid * user_defined );
488
489FILE *yyget_in ( void );
490
491void yyset_in ( FILE * _in_str );
492
493FILE *yyget_out ( void );
494
495void yyset_out ( FILE * _out_str );
496
497 int yyget_leng ( void );
498
499char *yyget_text ( void );
500
501int yyget_lineno ( void );
502
503void yyset_lineno ( int _line_number );
504
505/* Macros after this point can all be overridden by user definitions in
506 * section 1.
507 */
508
509#ifndef YY_SKIP_YYWRAP
510#ifdef __cplusplus
511extern "C" int yywrap ( void );
512#else
513extern int yywrap ( void );
514#endif
515#endif
516
517#ifndef YY_NO_UNPUT
518
519 static void yyunput ( int c, char *buf_ptr );
520
521#endif
522
523#ifndef yytext_ptryytext
524static void yy_flex_strncpy ( char *, const char *, int );
525#endif
526
527#ifdef YY_NEED_STRLEN
528static int yy_flex_strlen ( const char * );
529#endif
530
531#ifndef YY_NO_INPUT
532#ifdef __cplusplus
533static int yyinput ( void );
534#else
535static int input ( void );
536#endif
537
538#endif
539
540/* Amount of stuff to slurp up with each read. */
541#ifndef YY_READ_BUF_SIZE8192
542#ifdef __ia64__
543/* On IA-64, the buffer size is 16k, not 8k */
544#define YY_READ_BUF_SIZE8192 16384
545#else
546#define YY_READ_BUF_SIZE8192 8192
547#endif /* __ia64__ */
548#endif
549
550/* Copy whatever the last rule matched to the standard output. */
551#ifndef ECHOdo { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while
(0)
552/* This used to be an fputs(), but since the string might contain NUL's,
553 * we now use fwrite().
554 */
555#define ECHOdo { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while
(0)
do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
556#endif
557
558/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
559 * is returned in "result".
560 */
561#ifndef YY_INPUT
562#define YY_INPUT(buf,result,max_size)if ( (yy_buffer_stack)[(yy_buffer_stack_top)]->yy_is_interactive
) { int c = '*'; int n; for ( n = 0; n < max_size &&
(c = _IO_getc (yyin)) != (-1) && c != '\n'; ++n ) buf
[n] = (char) c; if ( c == '\n' ) buf[n++] = (char) c; if ( c ==
(-1) && ferror( yyin ) ) yy_fatal_error( "input in flex scanner failed"
); result = n; } else { (*__errno_location ())=0; while ( (result
= (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 &&
ferror(yyin)) { if( (*__errno_location ()) != 4) { yy_fatal_error
( "input in flex scanner failed" ); break; } (*__errno_location
())=0; clearerr(yyin); } }
\
563 if ( YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_is_interactive ) \
564 { \
565 int c = '*'; \
566 int n; \
567 for ( n = 0; n < max_size && \
568 (c = getc( yyin )_IO_getc (yyin)) != EOF(-1) && c != '\n'; ++n ) \
569 buf[n] = (char) c; \
570 if ( c == '\n' ) \
571 buf[n++] = (char) c; \
572 if ( c == EOF(-1) && ferror( yyin ) ) \
573 YY_FATAL_ERROR( "input in flex scanner failed" )yy_fatal_error( "input in flex scanner failed" ); \
574 result = n; \
575 } \
576 else \
577 { \
578 errno(*__errno_location ())=0; \
579 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
580 { \
581 if( errno(*__errno_location ()) != EINTR4) \
582 { \
583 YY_FATAL_ERROR( "input in flex scanner failed" )yy_fatal_error( "input in flex scanner failed" ); \
584 break; \
585 } \
586 errno(*__errno_location ())=0; \
587 clearerr(yyin); \
588 } \
589 }\
590\
591
592#endif
593
594/* No semi-colon after return; correct usage is to write "yyterminate();" -
595 * we don't want an extra ';' after the "return" because that will cause
596 * some compilers to complain about unreachable statements.
597 */
598#ifndef yyterminate
599#define yyterminate()return 0 return YY_NULL0
600#endif
601
602/* Number of entries by which start-condition stack grows. */
603#ifndef YY_START_STACK_INCR25
604#define YY_START_STACK_INCR25 25
605#endif
606
607/* Report a fatal error. */
608#ifndef YY_FATAL_ERROR
609#define YY_FATAL_ERROR(msg)yy_fatal_error( msg ) yy_fatal_error( msg )
610#endif
611
612/* end tables serialization structures and prototypes */
613
614/* Default declaration of generated scanner - a define so the user can
615 * easily add parameters.
616 */
617#ifndef YY_DECLint yylex (void)
618#define YY_DECL_IS_OURS1 1
619
620extern int yylex (void);
621
622#define YY_DECLint yylex (void) int yylex (void)
623#endif /* !YY_DECL */
624
625/* Code executed at the beginning of each rule, after yytext and yyleng
626 * have been set up.
627 */
628#ifndef YY_USER_ACTION
629#define YY_USER_ACTION
630#endif
631
632/* Code executed at the end of each rule. */
633#ifndef YY_BREAKbreak;
634#define YY_BREAKbreak; /*LINTED*/break;
635#endif
636
637#define YY_RULE_SETUP \
638 YY_USER_ACTION
639
640/** The main scanner function which does all the work.
641 */
642YY_DECLint yylex (void)
643{
644 yy_state_type yy_current_state;
645 char *yy_cp, *yy_bp;
646 int yy_act;
647
648 if ( !(yy_init) )
649 {
650 (yy_init) = 1;
651
652#ifdef YY_USER_INIT
653 YY_USER_INIT;
654#endif
655
656 if ( ! (yy_start) )
657 (yy_start) = 1; /* first start state */
658
659 if ( ! yyin )
660 yyin = stdinstdin;
661
662 if ( ! yyout )
663 yyout = stdoutstdout;
664
665 if ( ! YY_CURRENT_BUFFER( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)
] : ((void*)0))
) {
666 yyensure_buffer_stack ();
667 YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)] =
668 yy_create_buffer( yyin, YY_BUF_SIZE16384 );
669 }
670
671 yy_load_buffer_state( );
672 }
673
674 {
675#line 15 "omc-diff.l"
676
677
678#line 679 "lex.yy.c"
679
680 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
681 {
682 yy_cp = (yy_c_buf_p);
683
684 /* Support of yytext. */
685 *yy_cp = (yy_hold_char);
686
687 /* yy_bp points to the position in yy_ch_buf of the start of
688 * the current run.
689 */
690 yy_bp = yy_cp;
691
692 yy_current_state = (yy_start);
693yy_match:
694 do
695 {
696 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)((YY_CHAR) (*yy_cp))] ;
697 if ( yy_accept[yy_current_state] )
698 {
699 (yy_last_accepting_state) = yy_current_state;
700 (yy_last_accepting_cpos) = yy_cp;
701 }
702 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
703 {
704 yy_current_state = (int) yy_def[yy_current_state];
705 if ( yy_current_state >= 18 )
706 yy_c = yy_meta[yy_c];
707 }
708 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
709 ++yy_cp;
710 }
711 while ( yy_base[yy_current_state] != 28 );
712
713yy_find_action:
714 yy_act = yy_accept[yy_current_state];
715 if ( yy_act == 0 )
716 { /* have to back up */
717 yy_cp = (yy_last_accepting_cpos);
718 yy_current_state = (yy_last_accepting_state);
719 yy_act = yy_accept[yy_current_state];
720 }
721
722 YY_DO_BEFORE_ACTION(yytext) = yy_bp; yyleng = (int) (yy_cp - yy_bp); (yy_hold_char
) = *yy_cp; *yy_cp = '\0'; (yy_c_buf_p) = yy_cp;
;
723
724do_action: /* This label is used only to access EOF actions. */
725
726 switch ( yy_act )
727 { /* beginning of action switch */
728 case 0: /* must back up */
729 /* undo the effects of YY_DO_BEFORE_ACTION */
730 *yy_cp = (yy_hold_char);
731 yy_cp = (yy_last_accepting_cpos);
732 yy_current_state = (yy_last_accepting_state);
733 goto yy_find_action;
734
735case 1:
736/* rule 1 can match eol */
737YY_RULE_SETUP
738#line 17 "omc-diff.l"
739return T_NEWLINE3;
740 YY_BREAKbreak;
741case 2:
742YY_RULE_SETUP
743#line 18 "omc-diff.l"
744return T_REAL2;
745 YY_BREAKbreak;
746case 3:
747YY_RULE_SETUP
748#line 19 "omc-diff.l"
749return T_TEXT1;
750 YY_BREAKbreak;
751case 4:
752YY_RULE_SETUP
753#line 21 "omc-diff.l"
754ECHOdo { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while
(0)
;
755 YY_BREAKbreak;
756#line 757 "lex.yy.c"
757case YY_STATE_EOF(INITIAL)(5 + 0 + 1):
758 yyterminate()return 0;
759
760 case YY_END_OF_BUFFER5:
761 {
762 /* Amount of text matched not including the EOB char. */
763 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptryytext)) - 1;
764
765 /* Undo the effects of YY_DO_BEFORE_ACTION. */
766 *yy_cp = (yy_hold_char);
767 YY_RESTORE_YY_MORE_OFFSET
768
769 if ( YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_buffer_status == YY_BUFFER_NEW0 )
770 {
771 /* We're scanning a new file or input source. It's
772 * possible that this happened because the user
773 * just pointed yyin at a new source and called
774 * yylex(). If so, then we have to assure
775 * consistency between YY_CURRENT_BUFFER and our
776 * globals. Here is the right place to do so, because
777 * this is the first action (other than possibly a
778 * back-up) that will match for the new input source.
779 */
780 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_n_chars;
781 YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_input_file = yyin;
782 YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_buffer_status = YY_BUFFER_NORMAL1;
783 }
784
785 /* Note that here we test for yy_c_buf_p "<=" to the position
786 * of the first EOB in the buffer, since yy_c_buf_p will
787 * already have been incremented past the NUL character
788 * (since all states make transitions on EOB to the
789 * end-of-buffer state). Contrast this with the test
790 * in input().
791 */
792 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_ch_buf[(yy_n_chars)] )
793 { /* This was really a NUL. */
794 yy_state_type yy_next_state;
795
796 (yy_c_buf_p) = (yytext_ptryytext) + yy_amount_of_matched_text;
797
798 yy_current_state = yy_get_previous_state( );
799
800 /* Okay, we're now positioned to make the NUL
801 * transition. We couldn't have
802 * yy_get_previous_state() go ahead and do it
803 * for us because it doesn't know how to deal
804 * with the possibility of jamming (and we don't
805 * want to build jamming into it because then it
806 * will run more slowly).
807 */
808
809 yy_next_state = yy_try_NUL_trans( yy_current_state );
810
811 yy_bp = (yytext_ptryytext) + YY_MORE_ADJ0;
812
813 if ( yy_next_state )
814 {
815 /* Consume the NUL. */
816 yy_cp = ++(yy_c_buf_p);
817 yy_current_state = yy_next_state;
818 goto yy_match;
819 }
820
821 else
822 {
823 yy_cp = (yy_c_buf_p);
824 goto yy_find_action;
825 }
826 }
827
828 else switch ( yy_get_next_buffer( ) )
829 {
830 case EOB_ACT_END_OF_FILE1:
831 {
832 (yy_did_buffer_switch_on_eof) = 0;
833
834 if ( yywrap( ) )
835 {
836 /* Note: because we've taken care in
837 * yy_get_next_buffer() to have set up
838 * yytext, we can now set up
839 * yy_c_buf_p so that if some total
840 * hoser (like flex itself) wants to
841 * call the scanner after we return the
842 * YY_NULL, it'll still work - another
843 * YY_NULL will get returned.
844 */
845 (yy_c_buf_p) = (yytext_ptryytext) + YY_MORE_ADJ0;
846
847 yy_act = YY_STATE_EOF(YY_START)(5 + (((yy_start) - 1) / 2) + 1);
848 goto do_action;
849 }
850
851 else
852 {
853 if ( ! (yy_did_buffer_switch_on_eof) )
854 YY_NEW_FILEyyrestart( yyin );
855 }
856 break;
857 }
858
859 case EOB_ACT_CONTINUE_SCAN0:
860 (yy_c_buf_p) =
861 (yytext_ptryytext) + yy_amount_of_matched_text;
862
863 yy_current_state = yy_get_previous_state( );
864
865 yy_cp = (yy_c_buf_p);
866 yy_bp = (yytext_ptryytext) + YY_MORE_ADJ0;
867 goto yy_match;
868
869 case EOB_ACT_LAST_MATCH2:
870 (yy_c_buf_p) =
871 &YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_ch_buf[(yy_n_chars)];
872
873 yy_current_state = yy_get_previous_state( );
874
875 yy_cp = (yy_c_buf_p);
876 yy_bp = (yytext_ptryytext) + YY_MORE_ADJ0;
877 goto yy_find_action;
878 }
879 break;
880 }
881
882 default:
883 YY_FATAL_ERROR(yy_fatal_error( "fatal flex scanner internal error--no action found"
)
884 "fatal flex scanner internal error--no action found" )yy_fatal_error( "fatal flex scanner internal error--no action found"
)
;
885 } /* end of action switch */
886 } /* end of scanning one token */
887 } /* end of user's declarations */
888} /* end of yylex */
889
890/* yy_get_next_buffer - try to read in a new buffer
891 *
892 * Returns a code representing an action:
893 * EOB_ACT_LAST_MATCH -
894 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
895 * EOB_ACT_END_OF_FILE - end of file
896 */
897static int yy_get_next_buffer (void)
898{
899 char *dest = YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_ch_buf;
900 char *source = (yytext_ptryytext);
901 int number_to_move, i;
902 int ret_val;
903
904 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_ch_buf[(yy_n_chars) + 1] )
905 YY_FATAL_ERROR(yy_fatal_error( "fatal flex scanner internal error--end of buffer missed"
)
906 "fatal flex scanner internal error--end of buffer missed" )yy_fatal_error( "fatal flex scanner internal error--end of buffer missed"
)
;
907
908 if ( YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_fill_buffer == 0 )
909 { /* Don't try to fill the buffer, so this is an EOF. */
910 if ( (yy_c_buf_p) - (yytext_ptryytext) - YY_MORE_ADJ0 == 1 )
911 {
912 /* We matched a single character, the EOB, so
913 * treat this as a final EOF.
914 */
915 return EOB_ACT_END_OF_FILE1;
916 }
917
918 else
919 {
920 /* We matched some text prior to the EOB, first
921 * process it.
922 */
923 return EOB_ACT_LAST_MATCH2;
924 }
925 }
926
927 /* Try to read more data. */
928
929 /* First move last chars to start of buffer. */
930 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptryytext) - 1);
931
932 for ( i = 0; i < number_to_move; ++i )
933 *(dest++) = *(source++);
934
935 if ( YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_buffer_status == YY_BUFFER_EOF_PENDING2 )
936 /* don't do the read, it's not guaranteed to return an EOF,
937 * just force an EOF
938 */
939 YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_n_chars = (yy_n_chars) = 0;
940
941 else
942 {
943 int num_to_read =
944 YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_buf_size - number_to_move - 1;
945
946 while ( num_to_read <= 0 )
947 { /* Not enough room in the buffer - grow it. */
948
949 /* just a shorter name for the current buffer */
950 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)];
951
952 int yy_c_buf_p_offset =
953 (int) ((yy_c_buf_p) - b->yy_ch_buf);
954
955 if ( b->yy_is_our_buffer )
956 {
957 int new_size = b->yy_buf_size * 2;
958
959 if ( new_size <= 0 )
960 b->yy_buf_size += b->yy_buf_size / 8;
961 else
962 b->yy_buf_size *= 2;
963
964 b->yy_ch_buf = (char *)
965 /* Include room in for 2 EOB chars. */
966 yyrealloc( (void *) b->yy_ch_buf,
967 (yy_size_t) (b->yy_buf_size + 2) );
968 }
969 else
970 /* Can't grow it, we don't own it. */
971 b->yy_ch_buf = NULL((void*)0);
972
973 if ( ! b->yy_ch_buf )
974 YY_FATAL_ERROR(yy_fatal_error( "fatal error - scanner input buffer overflow"
)
975 "fatal error - scanner input buffer overflow" )yy_fatal_error( "fatal error - scanner input buffer overflow"
)
;
976
977 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
978
979 num_to_read = YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_buf_size -
980 number_to_move - 1;
981
982 }
983
984 if ( num_to_read > YY_READ_BUF_SIZE8192 )
985 num_to_read = YY_READ_BUF_SIZE8192;
986
987 /* Read in more data. */
988 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),if ( (yy_buffer_stack)[(yy_buffer_stack_top)]->yy_is_interactive
) { int c = '*'; int n; for ( n = 0; n < num_to_read &&
(c = _IO_getc (yyin)) != (-1) && c != '\n'; ++n ) (&
(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_ch_buf[number_to_move
])[n] = (char) c; if ( c == '\n' ) (&(yy_buffer_stack)[(yy_buffer_stack_top
)]->yy_ch_buf[number_to_move])[n++] = (char) c; if ( c == (
-1) && ferror( yyin ) ) yy_fatal_error( "input in flex scanner failed"
); (yy_n_chars) = n; } else { (*__errno_location ())=0; while
( ((yy_n_chars) = (int) fread((&(yy_buffer_stack)[(yy_buffer_stack_top
)]->yy_ch_buf[number_to_move]), 1, (yy_size_t) num_to_read
, yyin)) == 0 && ferror(yyin)) { if( (*__errno_location
()) != 4) { yy_fatal_error( "input in flex scanner failed" )
; break; } (*__errno_location ())=0; clearerr(yyin); } }
989 (yy_n_chars), num_to_read )if ( (yy_buffer_stack)[(yy_buffer_stack_top)]->yy_is_interactive
) { int c = '*'; int n; for ( n = 0; n < num_to_read &&
(c = _IO_getc (yyin)) != (-1) && c != '\n'; ++n ) (&
(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_ch_buf[number_to_move
])[n] = (char) c; if ( c == '\n' ) (&(yy_buffer_stack)[(yy_buffer_stack_top
)]->yy_ch_buf[number_to_move])[n++] = (char) c; if ( c == (
-1) && ferror( yyin ) ) yy_fatal_error( "input in flex scanner failed"
); (yy_n_chars) = n; } else { (*__errno_location ())=0; while
( ((yy_n_chars) = (int) fread((&(yy_buffer_stack)[(yy_buffer_stack_top
)]->yy_ch_buf[number_to_move]), 1, (yy_size_t) num_to_read
, yyin)) == 0 && ferror(yyin)) { if( (*__errno_location
()) != 4) { yy_fatal_error( "input in flex scanner failed" )
; break; } (*__errno_location ())=0; clearerr(yyin); } }
;
990
991 YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_n_chars = (yy_n_chars);
992 }
993
994 if ( (yy_n_chars) == 0 )
995 {
996 if ( number_to_move == YY_MORE_ADJ0 )
997 {
998 ret_val = EOB_ACT_END_OF_FILE1;
999 yyrestart( yyin );
1000 }
1001
1002 else
1003 {
1004 ret_val = EOB_ACT_LAST_MATCH2;
1005 YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_buffer_status =
1006 YY_BUFFER_EOF_PENDING2;
1007 }
1008 }
1009
1010 else
1011 ret_val = EOB_ACT_CONTINUE_SCAN0;
1012
1013 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_buf_size) {
1014 /* Extend the array by 50%, plus the number we really need. */
1015 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1016 YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_ch_buf = (char *) yyrealloc(
1017 (void *) YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_ch_buf, (yy_size_t) new_size );
1018 if ( ! YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_ch_buf )
1019 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" )yy_fatal_error( "out of dynamic memory in yy_get_next_buffer()"
)
;
1020 /* "- 2" to take care of EOB's */
1021 YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_buf_size = (int) (new_size - 2);
1022 }
1023
1024 (yy_n_chars) += number_to_move;
1025 YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR0;
1026 YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR0;
1027
1028 (yytext_ptryytext) = &YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_ch_buf[0];
1029
1030 return ret_val;
1031}
1032
1033/* yy_get_previous_state - get the state just before the EOB char was reached */
1034
1035 static yy_state_type yy_get_previous_state (void)
1036{
1037 yy_state_type yy_current_state;
1038 char *yy_cp;
1039
1040 yy_current_state = (yy_start);
1041
1042 for ( yy_cp = (yytext_ptryytext) + YY_MORE_ADJ0; yy_cp < (yy_c_buf_p); ++yy_cp )
1043 {
1044 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)((YY_CHAR) (*yy_cp))] : 1);
1045 if ( yy_accept[yy_current_state] )
1046 {
1047 (yy_last_accepting_state) = yy_current_state;
1048 (yy_last_accepting_cpos) = yy_cp;
1049 }
1050 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1051 {
1052 yy_current_state = (int) yy_def[yy_current_state];
1053 if ( yy_current_state >= 18 )
1054 yy_c = yy_meta[yy_c];
1055 }
1056 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1057 }
1058
1059 return yy_current_state;
1060}
1061
1062/* yy_try_NUL_trans - try to make a transition on the NUL character
1063 *
1064 * synopsis
1065 * next_state = yy_try_NUL_trans( current_state );
1066 */
1067 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1068{
1069 int yy_is_jam;
1070 char *yy_cp = (yy_c_buf_p);
1071
1072 YY_CHAR yy_c = 1;
1073 if ( yy_accept[yy_current_state] )
1074 {
1075 (yy_last_accepting_state) = yy_current_state;
1076 (yy_last_accepting_cpos) = yy_cp;
1077 }
1078 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1079 {
1080 yy_current_state = (int) yy_def[yy_current_state];
1081 if ( yy_current_state >= 18 )
1082 yy_c = yy_meta[yy_c];
1083 }
1084 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1085 yy_is_jam = (yy_current_state == 17);
1086
1087 return yy_is_jam ? 0 : yy_current_state;
1088}
1089
1090#ifndef YY_NO_UNPUT
1091
1092 static void yyunput (int c, char * yy_bp )
1093{
1094 char *yy_cp;
1095
1096 yy_cp = (yy_c_buf_p);
1097
1098 /* undo effects of setting up yytext */
1099 *yy_cp = (yy_hold_char);
1100
1101 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_ch_buf + 2 )
1102 { /* need to shift things up to make room */
1103 /* +2 for EOB chars. */
1104 int number_to_move = (yy_n_chars) + 2;
1105 char *dest = &YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_ch_buf[
1106 YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_buf_size + 2];
1107 char *source =
1108 &YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_ch_buf[number_to_move];
1109
1110 while ( source > YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_ch_buf )
1111 *--dest = *--source;
1112
1113 yy_cp += (int) (dest - source);
1114 yy_bp += (int) (dest - source);
1115 YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_n_chars =
1116 (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_buf_size;
1117
1118 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_ch_buf + 2 )
1119 YY_FATAL_ERROR( "flex scanner push-back overflow" )yy_fatal_error( "flex scanner push-back overflow" );
1120 }
1121
1122 *--yy_cp = (char) c;
1123
1124 (yytext_ptryytext) = yy_bp;
1125 (yy_hold_char) = *yy_cp;
1126 (yy_c_buf_p) = yy_cp;
1127}
1128
1129#endif
1130
1131#ifndef YY_NO_INPUT
1132#ifdef __cplusplus
1133 static int yyinput (void)
1134#else
1135 static int input (void)
1136#endif
1137
1138{
1139 int c;
1140
1141 *(yy_c_buf_p) = (yy_hold_char);
1142
1143 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR0 )
1144 {
1145 /* yy_c_buf_p now points to the character we want to return.
1146 * If this occurs *before* the EOB characters, then it's a
1147 * valid NUL; if not, then we've hit the end of the buffer.
1148 */
1149 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_ch_buf[(yy_n_chars)] )
1150 /* This was really a NUL. */
1151 *(yy_c_buf_p) = '\0';
1152
1153 else
1154 { /* need more input */
1155 int offset = (int) ((yy_c_buf_p) - (yytext_ptryytext));
1156 ++(yy_c_buf_p);
1157
1158 switch ( yy_get_next_buffer( ) )
1159 {
1160 case EOB_ACT_LAST_MATCH2:
1161 /* This happens because yy_g_n_b()
1162 * sees that we've accumulated a
1163 * token and flags that we need to
1164 * try matching the token before
1165 * proceeding. But for input(),
1166 * there's no matching to consider.
1167 * So convert the EOB_ACT_LAST_MATCH
1168 * to EOB_ACT_END_OF_FILE.
1169 */
1170
1171 /* Reset buffer status. */
1172 yyrestart( yyin );
1173
1174 /*FALLTHROUGH*/
1175
1176 case EOB_ACT_END_OF_FILE1:
1177 {
1178 if ( yywrap( ) )
1179 return 0;
1180
1181 if ( ! (yy_did_buffer_switch_on_eof) )
1182 YY_NEW_FILEyyrestart( yyin );
1183#ifdef __cplusplus
1184 return yyinput();
1185#else
1186 return input();
1187#endif
1188 }
1189
1190 case EOB_ACT_CONTINUE_SCAN0:
1191 (yy_c_buf_p) = (yytext_ptryytext) + offset;
1192 break;
1193 }
1194 }
1195 }
1196
1197 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1198 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1199 (yy_hold_char) = *++(yy_c_buf_p);
1200
1201 return c;
1202}
1203#endif /* ifndef YY_NO_INPUT */
1204
1205/** Immediately switch to a different input stream.
1206 * @param input_file A readable stream.
1207 *
1208 * @note This function does not reset the start condition to @c INITIAL .
1209 */
1210 void yyrestart (FILE * input_file )
1211{
1212
1213 if ( ! YY_CURRENT_BUFFER( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)
] : ((void*)0))
){
1214 yyensure_buffer_stack ();
1215 YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)] =
1216 yy_create_buffer( yyin, YY_BUF_SIZE16384 );
1217 }
1218
1219 yy_init_buffer( YY_CURRENT_BUFFER( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)
] : ((void*)0))
, input_file );
1220 yy_load_buffer_state( );
1221}
1222
1223/** Switch to a different input buffer.
1224 * @param new_buffer The new input buffer.
1225 *
1226 */
1227 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1228{
1229
1230 /* TODO. We should be able to replace this entire function body
1231 * with
1232 * yypop_buffer_state();
1233 * yypush_buffer_state(new_buffer);
1234 */
1235 yyensure_buffer_stack ();
1236 if ( YY_CURRENT_BUFFER( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)
] : ((void*)0))
== new_buffer )
1237 return;
1238
1239 if ( YY_CURRENT_BUFFER( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)
] : ((void*)0))
)
1240 {
1241 /* Flush out information for old buffer. */
1242 *(yy_c_buf_p) = (yy_hold_char);
1243 YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_buf_pos = (yy_c_buf_p);
1244 YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_n_chars = (yy_n_chars);
1245 }
1246
1247 YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)] = new_buffer;
1248 yy_load_buffer_state( );
1249
1250 /* We don't actually know whether we did this switch during
1251 * EOF (yywrap()) processing, but the only time this flag
1252 * is looked at is after yywrap() is called, so it's safe
1253 * to go ahead and always set it.
1254 */
1255 (yy_did_buffer_switch_on_eof) = 1;
1256}
1257
1258static void yy_load_buffer_state (void)
1259{
1260 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_n_chars;
1261 (yytext_ptryytext) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_buf_pos;
1262 yyin = YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_input_file;
1263 (yy_hold_char) = *(yy_c_buf_p);
1264}
1265
1266/** Allocate and initialize an input buffer state.
1267 * @param file A readable stream.
1268 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1269 *
1270 * @return the allocated buffer state.
1271 */
1272 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1273{
1274 YY_BUFFER_STATE b;
1275
1276 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
1277 if ( ! b )
1278 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" )yy_fatal_error( "out of dynamic memory in yy_create_buffer()"
)
;
1279
1280 b->yy_buf_size = size;
1281
1282 /* yy_ch_buf has to be 2 characters longer than the size given because
1283 * we need to put in 2 end-of-buffer characters.
1284 */
1285 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
1286 if ( ! b->yy_ch_buf )
1287 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" )yy_fatal_error( "out of dynamic memory in yy_create_buffer()"
)
;
1288
1289 b->yy_is_our_buffer = 1;
1290
1291 yy_init_buffer( b, file );
1292
1293 return b;
1294}
1295
1296/** Destroy the buffer.
1297 * @param b a buffer created with yy_create_buffer()
1298 *
1299 */
1300 void yy_delete_buffer (YY_BUFFER_STATE b )
1301{
1302
1303 if ( ! b )
1304 return;
1305
1306 if ( b == YY_CURRENT_BUFFER( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)
] : ((void*)0))
) /* Not sure if we should pop here. */
1307 YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)] = (YY_BUFFER_STATE) 0;
1308
1309 if ( b->yy_is_our_buffer )
1310 yyfree( (void *) b->yy_ch_buf );
1311
1312 yyfree( (void *) b );
1313}
1314
1315/* Initializes or reinitializes a buffer.
1316 * This function is sometimes called more than once on the same buffer,
1317 * such as during a yyrestart() or at EOF.
1318 */
1319 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1320
1321{
1322 int oerrno = errno(*__errno_location ());
1323
1324 yy_flush_buffer( b );
1325
1326 b->yy_input_file = file;
1327 b->yy_fill_buffer = 1;
1328
1329 /* If b is the current buffer, then yy_init_buffer was _probably_
1330 * called from yyrestart() or through yy_get_next_buffer.
1331 * In that case, we don't want to reset the lineno or column.
1332 */
1333 if (b != YY_CURRENT_BUFFER( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)
] : ((void*)0))
){
1334 b->yy_bs_lineno = 1;
1335 b->yy_bs_column = 0;
1336 }
1337
1338 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1339
1340 errno(*__errno_location ()) = oerrno;
1341}
1342
1343/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1344 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1345 *
1346 */
1347 void yy_flush_buffer (YY_BUFFER_STATE b )
1348{
1349 if ( ! b )
1350 return;
1351
1352 b->yy_n_chars = 0;
1353
1354 /* We always need two end-of-buffer characters. The first causes
1355 * a transition to the end-of-buffer state. The second causes
1356 * a jam in that state.
1357 */
1358 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR0;
1359 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR0;
1360
1361 b->yy_buf_pos = &b->yy_ch_buf[0];
1362
1363 b->yy_at_bol = 1;
1364 b->yy_buffer_status = YY_BUFFER_NEW0;
1365
1366 if ( b == YY_CURRENT_BUFFER( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)
] : ((void*)0))
)
1367 yy_load_buffer_state( );
1368}
1369
1370/** Pushes the new state onto the stack. The new state becomes
1371 * the current state. This function will allocate the stack
1372 * if necessary.
1373 * @param new_buffer The new state.
1374 *
1375 */
1376void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1377{
1378 if (new_buffer == NULL((void*)0))
1379 return;
1380
1381 yyensure_buffer_stack();
1382
1383 /* This block is copied from yy_switch_to_buffer. */
1384 if ( YY_CURRENT_BUFFER( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)
] : ((void*)0))
)
1385 {
1386 /* Flush out information for old buffer. */
1387 *(yy_c_buf_p) = (yy_hold_char);
1388 YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_buf_pos = (yy_c_buf_p);
1389 YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)]->yy_n_chars = (yy_n_chars);
1390 }
1391
1392 /* Only push if top exists. Otherwise, replace top. */
1393 if (YY_CURRENT_BUFFER( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)
] : ((void*)0))
)
1394 (yy_buffer_stack_top)++;
1395 YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)] = new_buffer;
1396
1397 /* copied from yy_switch_to_buffer. */
1398 yy_load_buffer_state( );
1399 (yy_did_buffer_switch_on_eof) = 1;
1400}
1401
1402/** Removes and deletes the top of the stack, if present.
1403 * The next element becomes the new top.
1404 *
1405 */
1406void yypop_buffer_state (void)
1407{
1408 if (!YY_CURRENT_BUFFER( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)
] : ((void*)0))
)
1409 return;
1410
1411 yy_delete_buffer(YY_CURRENT_BUFFER( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)
] : ((void*)0))
);
1412 YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)] = NULL((void*)0);
1413 if ((yy_buffer_stack_top) > 0)
1414 --(yy_buffer_stack_top);
1415
1416 if (YY_CURRENT_BUFFER( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)
] : ((void*)0))
) {
1417 yy_load_buffer_state( );
1418 (yy_did_buffer_switch_on_eof) = 1;
1419 }
1420}
1421
1422/* Allocates the stack if it does not exist.
1423 * Guarantees space for at least one push.
1424 */
1425static void yyensure_buffer_stack (void)
1426{
1427 yy_size_t num_to_alloc;
1428
1429 if (!(yy_buffer_stack)) {
1430
1431 /* First allocation is just for 2 elements, since we don't know if this
1432 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1433 * immediate realloc on the next call.
1434 */
1435 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1436 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1437 (num_to_alloc * sizeof(struct yy_buffer_state*)
1438 );
1439 if ( ! (yy_buffer_stack) )
1440 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" )yy_fatal_error( "out of dynamic memory in yyensure_buffer_stack()"
)
;
1441
1442 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1443
1444 (yy_buffer_stack_max) = num_to_alloc;
1445 (yy_buffer_stack_top) = 0;
1446 return;
1447 }
1448
1449 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1450
1451 /* Increase the buffer to prepare for a possible push. */
1452 yy_size_t grow_size = 8 /* arbitrary grow size */;
1453
1454 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1455 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1456 ((yy_buffer_stack),
1457 num_to_alloc * sizeof(struct yy_buffer_state*)
1458 );
1459 if ( ! (yy_buffer_stack) )
1460 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" )yy_fatal_error( "out of dynamic memory in yyensure_buffer_stack()"
)
;
1461
1462 /* zero only the new slots.*/
1463 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1464 (yy_buffer_stack_max) = num_to_alloc;
1465 }
1466}
1467
1468/** Setup the input buffer state to scan directly from a user-specified character buffer.
1469 * @param base the character buffer
1470 * @param size the size in bytes of the character buffer
1471 *
1472 * @return the newly allocated buffer state object.
1473 */
1474YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1475{
1476 YY_BUFFER_STATE b;
1477
1478 if ( size < 2 ||
1479 base[size-2] != YY_END_OF_BUFFER_CHAR0 ||
1480 base[size-1] != YY_END_OF_BUFFER_CHAR0 )
1481 /* They forgot to leave room for the EOB's. */
1482 return NULL((void*)0);
1483
1484 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
1485 if ( ! b )
1486 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" )yy_fatal_error( "out of dynamic memory in yy_scan_buffer()" );
1487
1488 b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
1489 b->yy_buf_pos = b->yy_ch_buf = base;
1490 b->yy_is_our_buffer = 0;
1491 b->yy_input_file = NULL((void*)0);
1492 b->yy_n_chars = b->yy_buf_size;
1493 b->yy_is_interactive = 0;
1494 b->yy_at_bol = 1;
1495 b->yy_fill_buffer = 0;
1496 b->yy_buffer_status = YY_BUFFER_NEW0;
1497
1498 yy_switch_to_buffer( b );
1499
1500 return b;
1501}
1502
1503/** Setup the input buffer state to scan a string. The next call to yylex() will
1504 * scan from a @e copy of @a str.
1505 * @param yystr a NUL-terminated string to scan
1506 *
1507 * @return the newly allocated buffer state object.
1508 * @note If you want to scan bytes that may contain NUL values, then use
1509 * yy_scan_bytes() instead.
1510 */
1511YY_BUFFER_STATE yy_scan_string (const char * yystr )
1512{
1513
1514 return yy_scan_bytes( yystr, (int) strlen(yystr) );
1515}
1516
1517/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1518 * scan from a @e copy of @a bytes.
1519 * @param yybytes the byte buffer to scan
1520 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1521 *
1522 * @return the newly allocated buffer state object.
1523 */
1524YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
1525{
1526 YY_BUFFER_STATE b;
1527 char *buf;
1528 yy_size_t n;
1529 int i;
1530
1531 /* Get memory for full buffer, including space for trailing EOB's. */
1532 n = (yy_size_t) (_yybytes_len + 2);
1533 buf = (char *) yyalloc( n );
1534 if ( ! buf )
1535 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" )yy_fatal_error( "out of dynamic memory in yy_scan_bytes()" );
1536
1537 for ( i = 0; i < _yybytes_len; ++i )
1538 buf[i] = yybytes[i];
1539
1540 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR0;
1541
1542 b = yy_scan_buffer( buf, n );
1543 if ( ! b )
1544 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" )yy_fatal_error( "bad buffer in yy_scan_bytes()" );
1545
1546 /* It's okay to grow etc. this buffer, and we should throw it
1547 * away when we're done.
1548 */
1549 b->yy_is_our_buffer = 1;
1550
1551 return b;
1552}
1553
1554#ifndef YY_EXIT_FAILURE2
1555#define YY_EXIT_FAILURE2 2
1556#endif
1557
1558static void yynoreturn__attribute__((__noreturn__)) yy_fatal_error (const char* msg )
1559{
1560 fprintf( stderrstderr, "%s\n", msg );
1561 exit( YY_EXIT_FAILURE2 );
1562}
1563
1564/* Redefine yyless() so it works in section 3 code. */
1565
1566#undef yyless
1567#define yyless(n)do { int yyless_macro_arg = (n); ; yytext[yyleng] = (yy_hold_char
); (yy_c_buf_p) = yytext + yyless_macro_arg; (yy_hold_char) =
*(yy_c_buf_p); *(yy_c_buf_p) = '\0'; yyleng = yyless_macro_arg
; } while ( 0 )
\
1568 do \
1569 { \
1570 /* Undo effects of setting up yytext. */ \
1571 int yyless_macro_arg = (n); \
1572 YY_LESS_LINENO(yyless_macro_arg);\
1573 yytext[yyleng] = (yy_hold_char); \
1574 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1575 (yy_hold_char) = *(yy_c_buf_p); \
1576 *(yy_c_buf_p) = '\0'; \
1577 yyleng = yyless_macro_arg; \
1578 } \
1579 while ( 0 )
1580
1581/* Accessor methods (get/set functions) to struct members. */
1582
1583/** Get the current line number.
1584 *
1585 */
1586int yyget_lineno (void)
1587{
1588
1589 return yylineno;
1590}
1591
1592/** Get the input stream.
1593 *
1594 */
1595FILE *yyget_in (void)
1596{
1597 return yyin;
1598}
1599
1600/** Get the output stream.
1601 *
1602 */
1603FILE *yyget_out (void)
1604{
1605 return yyout;
1606}
1607
1608/** Get the length of the current token.
1609 *
1610 */
1611int yyget_leng (void)
1612{
1613 return yyleng;
1614}
1615
1616/** Get the current token.
1617 *
1618 */
1619
1620char *yyget_text (void)
1621{
1622 return yytext;
1623}
1624
1625/** Set the current line number.
1626 * @param _line_number line number
1627 *
1628 */
1629void yyset_lineno (int _line_number )
1630{
1631
1632 yylineno = _line_number;
1633}
1634
1635/** Set the input stream. This does not discard the current
1636 * input buffer.
1637 * @param _in_str A readable stream.
1638 *
1639 * @see yy_switch_to_buffer
1640 */
1641void yyset_in (FILE * _in_str )
1642{
1643 yyin = _in_str ;
1644}
1645
1646void yyset_out (FILE * _out_str )
1647{
1648 yyout = _out_str ;
1649}
1650
1651int yyget_debug (void)
1652{
1653 return yy_flex_debug;
1654}
1655
1656void yyset_debug (int _bdebug )
1657{
1658 yy_flex_debug = _bdebug ;
1659}
1660
1661static int yy_init_globals (void)
1662{
1663 /* Initialization is the same as for the non-reentrant scanner.
1664 * This function is called from yylex_destroy(), so don't allocate here.
1665 */
1666
1667 (yy_buffer_stack) = NULL((void*)0);
1668 (yy_buffer_stack_top) = 0;
1669 (yy_buffer_stack_max) = 0;
1670 (yy_c_buf_p) = NULL((void*)0);
1671 (yy_init) = 0;
1672 (yy_start) = 0;
1673
1674/* Defined in main.c */
1675#ifdef YY_STDINIT
1676 yyin = stdinstdin;
1677 yyout = stdoutstdout;
1678#else
1679 yyin = NULL((void*)0);
1680 yyout = NULL((void*)0);
1681#endif
1682
1683 /* For future reference: Set errno on error, since we are called by
1684 * yylex_init()
1685 */
1686 return 0;
1687}
1688
1689/* yylex_destroy is for both reentrant and non-reentrant scanners. */
1690int yylex_destroy (void)
1691{
1692
1693 /* Pop the buffer stack, destroying each element. */
1694 while(YY_CURRENT_BUFFER( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)
] : ((void*)0))
){
1695 yy_delete_buffer( YY_CURRENT_BUFFER( (yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)
] : ((void*)0))
);
1696 YY_CURRENT_BUFFER_LVALUE(yy_buffer_stack)[(yy_buffer_stack_top)] = NULL((void*)0);
1697 yypop_buffer_state();
1698 }
1699
1700 /* Destroy the stack itself. */
1701 yyfree((yy_buffer_stack) );
1702 (yy_buffer_stack) = NULL((void*)0);
1703
1704 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1705 * yylex() is called, initialization will occur. */
1706 yy_init_globals( );
1707
1708 return 0;
1709}
1710
1711/*
1712 * Internal utility routines.
1713 */
1714
1715#ifndef yytext_ptryytext
1716static void yy_flex_strncpy (char* s1, const char * s2, int n )
1717{
1718
1719 int i;
1720 for ( i = 0; i < n; ++i )
1721 s1[i] = s2[i];
1722}
1723#endif
1724
1725#ifdef YY_NEED_STRLEN
1726static int yy_flex_strlen (const char * s )
1727{
1728 int n;
1729 for ( n = 0; s[n]; ++n )
1730 ;
1731
1732 return n;
1733}
1734#endif
1735
1736void *yyalloc (yy_size_t size )
1737{
1738 return malloc(size);
1739}
1740
1741void *yyrealloc (void * ptr, yy_size_t size )
1742{
1743
1744 /* The cast to (char *) in the following accommodates both
1745 * implementations that use char* generic pointers, and those
1746 * that use void* generic pointers. It works with the latter
1747 * because both ANSI C and C++ allow castless assignment from
1748 * any pointer type to void*, and deal with argument conversions
1749 * as though doing an assignment.
1750 */
1751 return realloc(ptr, size);
1752}
1753
1754void yyfree (void * ptr )
1755{
1756 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
1757}
1758
1759#define YYTABLES_NAME"yytables" "yytables"
1760
1761#line 21 "omc-diff.l"
1762
1763
1764#include <string.h>
1765#include <math.h>
1766
1767int yywrap (void ) {
1768 return 1;
1769}
1770
1771#define VERSION_STRING"-v1.4" "-v1.4"
1772
1773int usage(char* exe, char* s1,char* s2) {
1774 printf("Error: %s%s.\n", s1, s2);
1775 printf("Usage (Normal): %s epsilon $file_expected $file_actual\n",exe);
1776 printf(" Compares two files. Floating point numbers are parsed.\n");
1777 printf(" A maximum error of 0.0 < epsilon < 1.0 is tolerated when comparing.\n");
1778 printf("Usage (Version test): %s %s\n", exe, VERSION_STRING"-v1.4");
1779 printf(" Returns exit code 0.\n");
1780 return 2;
1781}
1782
1783static inline const char* consume_whitespace(const char *str)
1784{
1785 while ((*str == ' ') || (*str == '\t')) str++;
1786 return str;
1787}
1788
1789int strcmp_omc_diff(const char* s1, const char* s2) {
1790 s1 = consume_whitespace(s1);
1791 s2 = consume_whitespace(s2);
1792 while (*s1 && *s2) {
1793 if ((*s1 == ' ' || *s1 == '\t') && (*s2 == ' ' || *s2 == '\t')) {
1794 s1 = consume_whitespace(s1);
1795 s2 = consume_whitespace(s2);
1796 }
1797 if (*s1 && *s2) {
1798 if (*s1 != *s2) {
1799 printf("Failed '%c' '%c'\n", *s1, *s2);
1800 return *s1 > *s2 ? 1 : -1;
1801 }
1802 s1++;
1803 s2++;
1804 }
1805 }
1806 s1 = consume_whitespace(s1);
1807 s2 = consume_whitespace(s2);
1808 return *s1 == *s2 ? 0 : *s1 > *s2 ? 1 : -1;
1809}
1810
1811int lex_main(double eps, FILE* f1, FILE* f2) {
1812 YY_BUFFER_STATE y1 = yy_create_buffer(f1,YY_BUF_SIZE16384);
1813 YY_BUFFER_STATE y2 = yy_create_buffer(f2,YY_BUF_SIZE16384);
1814 int v1,v2;
1815 char *s1,*s2;
1816 int line = 1;
1817
1818 while (1) {
12
Loop condition is true. Entering loop body
17
Loop condition is true. Entering loop body
22
Loop condition is true. Entering loop body
27
Loop condition is true. Entering loop body
1819 yy_switch_to_buffer(y1);
1820 v1 = yylex();
1821 s1 = strdup(yytext);
28
Memory is allocated
1822
1823 yy_switch_to_buffer(y2);
1824 v2 = yylex();
1825 s2 = yytext;
1826
1827 if (T_EOF0 == v1 && T_EOF0 == v2)
1828 return 0;
1829 if (T_EOF0 == v1) {
13
Taking false branch
18
Taking false branch
23
Taking false branch
29
Taking false branch
1830 printf("Line %d: Actual file has more input than expected.\n", line);
1831 return 1;
1832 }
1833 if (T_EOF0 == v2) {
14
Taking false branch
19
Taking false branch
24
Taking false branch
30
Taking false branch
1834 printf("Line %d: Expected file has more input than actual.\n", line);
1835 return 1;
1836 }
1837
1838 if (v1 != v2) {
15
Taking false branch
20
Taking false branch
25
Taking false branch
31
Taking false branch
1839 printf("Line %d: Lexical token differs:\nexpected: %s\ngot: %s\n", line, s1, s2);
1840 return 1;
1841 }
1842
1843 switch (v1) {
16
'Default' branch taken. Execution continues on line 1879
21
'Default' branch taken. Execution continues on line 1879
26
'Default' branch taken. Execution continues on line 1879
32
Control jumps to 'case 1:' at line 1847
1844 case T_NEWLINE3:
1845 line++;
1846 break;
1847 case T_TEXT1:
1848 if (strcmp_omc_diff(s1,s2)) {
33
Assuming the condition is true
34
Taking true branch
1849 printf("Line %d: Text differs:\nexpected: %s\ngot: %s\n", line, s1, s2);
1850 return 1;
35
Potential leak of memory pointed to by 's1'
1851 }
1852 break;
1853 case T_REAL2: {
1854 char *end1, *end2;
1855 long l1 = strtol(s1, &end1, 10);
1856 long l2 = strtol(s2, &end2, 10);
1857
1858 if(*end1 == '\0' && *end2 == '\0') {
1859 if (l1 != l2) {
1860 printf("Line %d: Integer %s != %s\n", line, s1, s2);
1861 return 1;
1862 }
1863 }
1864 else {
1865 double d1 = strtod(s1,NULL((void*)0));
1866 double d2 = strtod(s2,NULL((void*)0));
1867 // We should check also for a relative error
1868 // otherwise some tests need to many adjustments
1869 double err = fabs(d2-d1);
1870 if (err > eps*fabs(d2)+eps) {
1871 printf("Line %d: Real %s != %s\n eps: %f, actual diff: %f\n",
1872 line, s1, s2, eps, fabs(d2-d1));
1873 return 1;
1874 }
1875 }
1876 break;
1877 };
1878 }
1879 free(s1);
1880 }
1881}
1882
1883int main(int argc, char** argv) {
1884 int retval;
1885 int line = 1;
1886 FILE *f1, *f2;
1887 char* endptr;
1888 double eps;
1889 if (argc == 2 && 0 == strcmp(argv[1], VERSION_STRING"-v1.4"))
1
Assuming 'argc' is not equal to 2
1890 exit(0);
1891 if (argc != 4)
2
Assuming 'argc' is equal to 4
3
Taking false branch
1892 exit(usage(argv[0],"Wrong number of arguments",""));
1893 eps = strtod(argv[1],&endptr);
1894 if (endptr == argv[1] || endptr[0] != '\0' || eps < 0.0 || eps > 1.0)
4
Assuming the condition is false
5
Assuming the condition is false
6
Taking false branch
1895 exit(usage(argv[0],"Failed to convert epsilon ",argv[1]));
1896 f1 = fopen(argv[2],"r");
1897 if (f1 == NULL((void*)0))
7
Assuming 'f1' is not equal to NULL
8
Taking false branch
1898 exit(usage(argv[0],"Failed to open file ",argv[2]));
1899 f2 = fopen(argv[3],"r");
1900 if (f2 == NULL((void*)0))
9
Assuming 'f2' is not equal to NULL
10
Taking false branch
1901 exit(usage(argv[0],"Failed to open file ",argv[3]));
1902
1903 return lex_main(eps,f1,f2);
11
Calling 'lex_main'
1904}
1905