0031740: Configuration - recover support of Yacc and Lex generation
[occt.git] / src / ExprIntrp / lex.ExprIntrp.c
CommitLineData
42cf5bc1 1#define yy_create_buffer ExprIntrp_create_buffer
2#define yy_delete_buffer ExprIntrp_delete_buffer
3#define yy_scan_buffer ExprIntrp_scan_buffer
4#define yy_scan_string ExprIntrp_scan_string
5#define yy_scan_bytes ExprIntrp_scan_bytes
6#define yy_flex_debug ExprIntrp_flex_debug
7#define yy_init_buffer ExprIntrp_init_buffer
8#define yy_flush_buffer ExprIntrp_flush_buffer
9#define yy_load_buffer_state ExprIntrp_load_buffer_state
10#define yy_switch_to_buffer ExprIntrp_switch_to_buffer
11#define yyin ExprIntrpin
12#define yyleng ExprIntrpleng
13#define yylex ExprIntrplex
14#define yyout ExprIntrpout
15#define yyrestart ExprIntrprestart
16#define yytext ExprIntrptext
17#define yywrap ExprIntrpwrap
18
19/* A lexical scanner generated by flex */
20
21/* Scanner skeleton version:
22 * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.89 96/05/25 21:02:21 vern Exp $
23 */
24
25#define FLEX_SCANNER
26#define YY_FLEX_MAJOR_VERSION 2
27#define YY_FLEX_MINOR_VERSION 5
28
29#include <stdio.h>
30
fba34cf8 31#ifdef WNT
42cf5bc1 32# include <stdlib.h>
33# include <io.h>
fba34cf8 34#endif /* WNT */
42cf5bc1 35
36
37
38/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
39#ifdef c_plusplus
40#ifndef __cplusplus
41#define __cplusplus
42#endif
43#endif
44
45
46#ifdef __cplusplus
47
48#include <stdlib.h>
49#include <unistd.h>
50
51/* Use prototypes in function declarations. */
52#define YY_USE_PROTOS
53
54/* The "const" storage-class-modifier is valid. */
55#define YY_USE_CONST
56
57#else /* ! __cplusplus */
58
59#if __STDC__
60
61#define YY_USE_PROTOS
62#define YY_USE_CONST
63
64#endif /* __STDC__ */
65#endif /* ! __cplusplus */
66
67#ifdef __TURBOC__
68 #pragma warn -rch
69 #pragma warn -use
70#include <io.h>
71#include <stdlib.h>
72#define YY_USE_CONST
73#define YY_USE_PROTOS
74#endif
75
76#ifdef YY_USE_CONST
77#define yyconst const
78#else
79#define yyconst
80#endif
81
82
83#ifdef YY_USE_PROTOS
84#define YY_PROTO(proto) proto
85#else
86#define YY_PROTO(proto) ()
87#endif
88
89/* Returned upon end-of-file. */
90#define YY_NULL 0
91
92/* Promotes a possibly negative, possibly signed char to an unsigned
93 * integer for use as an array index. If the signed char is negative,
94 * we want to instead treat it as an 8-bit unsigned char, hence the
95 * double cast.
96 */
97#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
98
99/* Enter a start condition. This macro really ought to take a parameter,
100 * but we do it the disgusting crufty way forced on us by the ()-less
101 * definition of BEGIN.
102 */
103#define BEGIN yy_start = 1 + 2 *
104
105/* Translate the current start state into a value that can be later handed
106 * to BEGIN to return to the state. The YYSTATE alias is for lex
107 * compatibility.
108 */
109#define YY_START ((yy_start - 1) / 2)
110#define YYSTATE YY_START
111
112/* Action number for EOF rule of a given start state. */
113#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
114
115/* Special action meaning "start processing a new file". */
116#define YY_NEW_FILE yyrestart( yyin )
117
118#define YY_END_OF_BUFFER_CHAR 0
119
120/* Size of default input buffer. */
121#define YY_BUF_SIZE 16384
122
123typedef struct yy_buffer_state *YY_BUFFER_STATE;
124
125extern int yyleng;
126extern FILE *yyin, *yyout;
127
128#define EOB_ACT_CONTINUE_SCAN 0
129#define EOB_ACT_END_OF_FILE 1
130#define EOB_ACT_LAST_MATCH 2
131
132/* The funky do-while in the following #define is used to turn the definition
133 * int a single C statement (which needs a semi-colon terminator). This
134 * avoids problems with code like:
135 *
136 * if ( condition_holds )
137 * yyless( 5 );
138 * else
139 * do_something_else();
140 *
141 * Prior to using the do-while the compiler would get upset at the
142 * "else" because it interpreted the "if" statement as being all
143 * done when it reached the ';' after the yyless() call.
144 */
145
146/* Return all but the first 'n' matched characters back to the input stream. */
147
148#define yyless(n) \
149 do \
150 { \
151 /* Undo effects of setting up yytext. */ \
152 *yy_cp = yy_hold_char; \
153 YY_RESTORE_YY_MORE_OFFSET \
154 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
155 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
156 } \
157 while ( 0 )
158
159#define unput(c) yyunput( c, yytext_ptr )
160
161/* The following is because we cannot portably get our hands on size_t
162 * (without autoconf's help, which isn't available because we want
163 * flex-generated scanners to compile on their own).
164 */
165typedef unsigned int yy_size_t;
166
167
168struct yy_buffer_state
169 {
170 FILE *yy_input_file;
171
172 char *yy_ch_buf; /* input buffer */
173 char *yy_buf_pos; /* current position in input buffer */
174
175 /* Size of input buffer in bytes, not including room for EOB
176 * characters.
177 */
178 yy_size_t yy_buf_size;
179
180 /* Number of characters read into yy_ch_buf, not including EOB
181 * characters.
182 */
183 int yy_n_chars;
184
185 /* Whether we "own" the buffer - i.e., we know we created it,
186 * and can realloc() it to grow it, and should free() it to
187 * delete it.
188 */
189 int yy_is_our_buffer;
190
191 /* Whether this is an "interactive" input source; if so, and
192 * if we're using stdio for input, then we want to use getc()
193 * instead of fread(), to make sure we stop fetching input after
194 * each newline.
195 */
196 int yy_is_interactive;
197
198 /* Whether we're considered to be at the beginning of a line.
199 * If so, '^' rules will be active on the next match, otherwise
200 * not.
201 */
202 int yy_at_bol;
203
204 /* Whether to try to fill the input buffer when we reach the
205 * end of it.
206 */
207 int yy_fill_buffer;
208
209 int yy_buffer_status;
210#define YY_BUFFER_NEW 0
211#define YY_BUFFER_NORMAL 1
212 /* When an EOF's been seen but there's still some text to process
213 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
214 * shouldn't try reading from the input source any more. We might
215 * still have a bunch of tokens to match, though, because of
216 * possible backing-up.
217 *
218 * When we actually see the EOF, we change the status to "new"
219 * (via yyrestart()), so that the user can continue scanning by
220 * just pointing yyin at a new input file.
221 */
222#define YY_BUFFER_EOF_PENDING 2
223 };
224
225static YY_BUFFER_STATE yy_current_buffer = 0;
226
227/* We provide macros for accessing buffer states in case in the
228 * future we want to put the buffer states in a more general
229 * "scanner state".
230 */
231#define YY_CURRENT_BUFFER yy_current_buffer
232
233
234/* yy_hold_char holds the character lost when yytext is formed. */
235static char yy_hold_char;
236
237static int yy_n_chars; /* number of characters read into yy_ch_buf */
238
239
240int yyleng;
241
242/* Points to current character in buffer. */
243static char *yy_c_buf_p = (char *) 0;
244static int yy_init = 1; /* whether we need to initialize */
245static int yy_start = 0; /* start state number */
246
247/* Flag which is used to allow yywrap()'s to do buffer switches
248 * instead of setting up a fresh yyin. A bit of a hack ...
249 */
250static int yy_did_buffer_switch_on_eof;
251
252void yyrestart YY_PROTO(( FILE *input_file ));
253
254void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
255void yy_load_buffer_state YY_PROTO(( void ));
256YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
257void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
258void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
259void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
260#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
261
262YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
263YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *str ));
264YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
265
266static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
267static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
268static void yy_flex_free YY_PROTO(( void * ));
269
270#define yy_new_buffer yy_create_buffer
271
272#define yy_set_interactive(is_interactive) \
273 { \
274 if ( ! yy_current_buffer ) \
275 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
276 yy_current_buffer->yy_is_interactive = is_interactive; \
277 }
278
279#define yy_set_bol(at_bol) \
280 { \
281 if ( ! yy_current_buffer ) \
282 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
283 yy_current_buffer->yy_at_bol = at_bol; \
284 }
285
286#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
287
288typedef unsigned char YY_CHAR;
289FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
290typedef int yy_state_type;
291extern char *yytext;
292#define yytext_ptr yytext
42cf5bc1 293
294static yy_state_type yy_get_previous_state YY_PROTO(( void ));
295static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
296static int yy_get_next_buffer YY_PROTO(( void ));
297static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
298
299/* Done after the current pattern has been matched and before the
300 * corresponding action - sets up yytext.
301 */
302#define YY_DO_BEFORE_ACTION \
303 yytext_ptr = yy_bp; \
304 yyleng = (int) (yy_cp - yy_bp); \
305 yy_hold_char = *yy_cp; \
306 *yy_cp = '\0'; \
307 yy_c_buf_p = yy_cp;
308
309#define YY_NUM_RULES 26
310#define YY_END_OF_BUFFER 27
fba34cf8 311static yyconst short int yy_accept[55] =
42cf5bc1 312 { 0,
313 0, 0, 27, 26, 1, 25, 8, 10, 7, 2,
314 12, 3, 22, 4, 24, 26, 15, 13, 23, 23,
315 23, 23, 23, 9, 11, 5, 25, 6, 22, 0,
316 14, 23, 23, 23, 23, 23, 0, 21, 23, 23,
317 23, 23, 19, 23, 23, 23, 20, 18, 23, 17,
fba34cf8 318 23, 23, 16, 0
42cf5bc1 319 } ;
320
fba34cf8 321static yyconst int yy_ec[256] =
322 { 0,
323 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
324 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
325 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
326 1, 2, 1, 1, 1, 1, 1, 1, 3, 4,
327 5, 6, 7, 8, 9, 10, 11, 12, 12, 12,
328 12, 12, 12, 12, 12, 12, 12, 1, 13, 14,
329 15, 1, 1, 16, 17, 17, 18, 19, 17, 17,
330 17, 17, 17, 17, 17, 17, 17, 17, 17, 20,
331 17, 17, 21, 17, 17, 17, 17, 17, 17, 17,
332 22, 1, 23, 24, 25, 1, 26, 17, 17, 27,
333
334 28, 17, 29, 17, 30, 17, 17, 17, 31, 32,
335 33, 17, 17, 34, 35, 36, 37, 38, 17, 17,
336 17, 17, 1, 39, 1, 1, 1, 1, 1, 1,
337 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
338 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
339 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
340 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
341 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
342 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
343 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
344
345 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
346 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
347 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
348 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
349 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
350 1, 1, 1, 1, 1
351 } ;
352
353static yyconst int yy_meta[40] =
354 { 0,
355 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
356 1, 2, 1, 1, 1, 1, 2, 2, 2, 2,
357 2, 1, 1, 1, 2, 2, 2, 2, 2, 2,
358 2, 2, 2, 2, 2, 2, 2, 2, 1
359 } ;
42cf5bc1 360
fba34cf8 361static yyconst short int yy_base[56] =
42cf5bc1 362 { 0,
fba34cf8 363 0, 0, 75, 77, 77, 71, 77, 77, 67, 77,
364 77, 77, 30, 77, 77, 63, 77, 77, 0, 38,
365 42, 35, 31, 77, 77, 77, 64, 77, 31, 37,
366 77, 0, 34, 19, 32, 33, 51, 50, 26, 25,
367 27, 29, 0, 19, 19, 14, 0, 0, 21, 0,
368 21, 16, 0, 77, 45
42cf5bc1 369 } ;
370
fba34cf8 371static yyconst short int yy_def[56] =
372 { 0,
373 54, 1, 54, 54, 54, 54, 54, 54, 54, 54,
374 54, 54, 54, 54, 54, 54, 54, 54, 55, 55,
375 55, 55, 55, 54, 54, 54, 54, 54, 54, 54,
376 54, 55, 55, 55, 55, 55, 54, 54, 55, 55,
377 55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
378 55, 55, 55, 0, 54
379 } ;
380
381static yyconst short int yy_nxt[117] =
382 { 0,
383 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
384 14, 13, 15, 16, 17, 18, 19, 20, 21, 22,
385 23, 24, 25, 26, 4, 19, 19, 19, 19, 19,
386 19, 19, 19, 19, 19, 19, 19, 19, 4, 29,
387 29, 29, 29, 37, 40, 37, 32, 53, 38, 52,
388 51, 50, 41, 49, 48, 47, 46, 30, 30, 45,
389 44, 38, 38, 43, 42, 39, 27, 36, 35, 34,
390 33, 31, 28, 27, 54, 37, 3, 54, 54, 54,
391 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
392 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
393
394 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
395 54, 54, 54, 54, 54, 54
396 } ;
397
398static yyconst short int yy_chk[117] =
399 { 0,
400 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
401 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
402 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
403 1, 1, 1, 1, 1, 1, 1, 1, 1, 13,
404 29, 13, 29, 30, 34, 30, 55, 52, 30, 51,
405 49, 46, 34, 45, 44, 42, 41, 13, 29, 40,
406 39, 38, 37, 36, 35, 33, 27, 23, 22, 21,
407 20, 16, 9, 6, 3, 30, 54, 54, 54, 54,
408 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
409 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
410
411 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
412 54, 54, 54, 54, 54, 54
413 } ;
414
415static yy_state_type yy_last_accepting_state;
416static char *yy_last_accepting_cpos;
417
42cf5bc1 418/* The intent behind this definition is that it'll catch
419 * any uses of REJECT which flex missed.
420 */
421#define REJECT reject_used_but_not_detected
422#define yymore() yymore_used_but_not_detected
423#define YY_MORE_ADJ 0
424#define YY_RESTORE_YY_MORE_OFFSET
425char *yytext;
426#define INITIAL 0
427/*
428
429 Copyright (c) 1997-1999 Matra Datavision
430 Copyright (c) 1999-2014 OPEN CASCADE SAS
431
432 This file is part of Open CASCADE Technology software library.
433
434 This library is free software; you can redistribute it and/or modify it under
435 the terms of the GNU Lesser General Public License version 2.1 as published
436 by the Free Software Foundation, with special exception defined in the file
437 OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
438 distribution for complete text of the license and disclaimer of any warranty.
439
440 Alternatively, this file may be used under the terms of Open CASCADE
441 commercial license or contractual agreement.
442*/
443#include <ExprIntrp.tab.h>
444
445#include <ExprIntrp_yaccintrf.hxx>
446
447#define YY_SKIP_YYWRAP
448
449static YY_BUFFER_STATE ExprIntrp_bufstring;
450
451void ExprIntrp_start_string(const char* str)
452{
453 // depending on configuration and generator, yyconst may be defined as const or empty
454 ExprIntrp_bufstring = ExprIntrp_scan_string((yyconst char*)str);
455}
456
457void ExprIntrp_stop_string()
458{
459 ExprIntrp_delete_buffer(ExprIntrp_bufstring);
460 ExprIntrp_bufstring = (YY_BUFFER_STATE) 0;
461}
462
463static int yywrap()
464{
465 return 1;
466}
467
468// provide safe error handler (exception instead of exit())
469#define YY_FATAL_ERROR(msg) ExprIntrperror(msg)
470
fba34cf8 471// MSVC specifics
42cf5bc1 472#ifdef _MSC_VER
fba34cf8 473
42cf5bc1 474// add includes for flex 2.91 (Linux version)
475#include <stdlib.h>
476#include <io.h>
477
478// Avoid includion of unistd.h if parser is generated on Linux (flex 2.5.35)
479#define YY_NO_UNISTD_H
480
481// disable MSVC warnings in flex 2.89 and 2.5.35 code
482// Note that Intel compiler also defines _MSC_VER but has different warning ids
483#if defined(__INTEL_COMPILER)
484#pragma warning(disable:177 1786 1736)
1bd04b5a 485#elif defined(__clang__)
486#pragma GCC diagnostic ignored "-Wunused-function"
487#pragma GCC diagnostic ignored "-Winconsistent-dllimport"
488#pragma GCC diagnostic ignored "-Wunneeded-internal-declaration"
42cf5bc1 489#else
490#pragma warning(disable:4131 4244 4273 4127 4267)
491#endif
492
fba34cf8 493#endif /* MSC_VER */
42cf5bc1 494
495#ifdef __GNUC__
496// add includes for flex 2.91 (Linux version)
497#include <unistd.h>
498
499// disable GCC warnings in flex 2.91 code
500#pragma GCC diagnostic ignored "-Wunused-function"
501#endif
502
503
504/* Macros after this point can all be overridden by user definitions in
505 * section 1.
506 */
507
508#ifndef YY_SKIP_YYWRAP
509#ifdef __cplusplus
510extern "C" int yywrap YY_PROTO(( void ));
511#else
512extern int yywrap YY_PROTO(( void ));
513#endif
514#endif
515
516#ifndef YY_NO_UNPUT
517static void yyunput YY_PROTO(( int c, char *buf_ptr ));
518#endif
519
520#ifndef yytext_ptr
521static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
522#endif
523
524#ifdef YY_NEED_STRLEN
525static int yy_flex_strlen YY_PROTO(( yyconst char * ));
526#endif
527
528#ifndef YY_NO_INPUT
529#ifdef __cplusplus
530static int yyinput YY_PROTO(( void ));
531#else
532static int input YY_PROTO(( void ));
533#endif
534#endif
535
536#if YY_STACK_USED
537static int yy_start_stack_ptr = 0;
538static int yy_start_stack_depth = 0;
539static int *yy_start_stack = 0;
540#ifndef YY_NO_PUSH_STATE
541static void yy_push_state YY_PROTO(( int new_state ));
542#endif
543#ifndef YY_NO_POP_STATE
544static void yy_pop_state YY_PROTO(( void ));
545#endif
546#ifndef YY_NO_TOP_STATE
547static int yy_top_state YY_PROTO(( void ));
548#endif
549
550#else
551#define YY_NO_PUSH_STATE 1
552#define YY_NO_POP_STATE 1
553#define YY_NO_TOP_STATE 1
554#endif
555
556#ifdef YY_MALLOC_DECL
557YY_MALLOC_DECL
558#else
559#if __STDC__
560#ifndef __cplusplus
561#include <stdlib.h>
562#endif
563#else
564/* Just try to get by without declaring the routines. This will fail
565 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
566 * or sizeof(void*) != sizeof(int).
567 */
568#endif
569#endif
570
571/* Amount of stuff to slurp up with each read. */
572#ifndef YY_READ_BUF_SIZE
573#define YY_READ_BUF_SIZE 8192
574#endif
575
576/* Copy whatever the last rule matched to the standard output. */
577
578#ifndef ECHO
579/* This used to be an fputs(), but since the string might contain NUL's,
580 * we now use fwrite().
581 */
582#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
583#endif
584
585/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
586 * is returned in "result".
587 */
588#ifndef YY_INPUT
589#define YY_INPUT(buf,result,max_size) \
fba34cf8 590 if ( yy_current_buffer->yy_is_interactive ) \
591 { \
592 int c = '*', n; \
593 for ( n = 0; n < max_size && \
594 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
595 buf[n] = (char) c; \
596 if ( c == '\n' ) \
597 buf[n++] = (char) c; \
598 if ( c == EOF && ferror( yyin ) ) \
599 YY_FATAL_ERROR( "input in flex scanner failed" ); \
600 result = n; \
601 } \
602 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
603 && ferror( yyin ) ) \
42cf5bc1 604 YY_FATAL_ERROR( "input in flex scanner failed" );
605#endif
606
607/* No semi-colon after return; correct usage is to write "yyterminate();" -
608 * we don't want an extra ';' after the "return" because that will cause
609 * some compilers to complain about unreachable statements.
610 */
611#ifndef yyterminate
612#define yyterminate() return YY_NULL
613#endif
614
615/* Number of entries by which start-condition stack grows. */
616#ifndef YY_START_STACK_INCR
617#define YY_START_STACK_INCR 25
618#endif
619
620/* Report a fatal error. */
621#ifndef YY_FATAL_ERROR
622#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
623#endif
624
625/* Default declaration of generated scanner - a define so the user can
626 * easily add parameters.
627 */
628#ifndef YY_DECL
629#define YY_DECL int yylex YY_PROTO(( void ))
630#endif
631
632/* Code executed at the beginning of each rule, after yytext and yyleng
633 * have been set up.
634 */
635#ifndef YY_USER_ACTION
636#define YY_USER_ACTION
637#endif
638
639/* Code executed at the end of each rule. */
640#ifndef YY_BREAK
641#define YY_BREAK break;
642#endif
643
644#define YY_RULE_SETUP \
645 YY_USER_ACTION
646
647YY_DECL
648 {
649 register yy_state_type yy_current_state;
650 register char *yy_cp, *yy_bp;
651 register int yy_act;
652
653
654
655 if ( yy_init )
656 {
657 yy_init = 0;
658
659#ifdef YY_USER_INIT
660 YY_USER_INIT;
661#endif
662
663 if ( ! yy_start )
664 yy_start = 1; /* first start state */
665
666 if ( ! yyin )
667 yyin = stdin;
668
669 if ( ! yyout )
670 yyout = stdout;
671
672 if ( ! yy_current_buffer )
673 yy_current_buffer =
674 yy_create_buffer( yyin, YY_BUF_SIZE );
675
676 yy_load_buffer_state();
677 }
678
679 while ( 1 ) /* loops until end-of-file is reached */
680 {
681 yy_cp = yy_c_buf_p;
682
683 /* Support of yytext. */
684 *yy_cp = yy_hold_char;
685
686 /* yy_bp points to the position in yy_ch_buf of the start of
687 * the current run.
688 */
689 yy_bp = yy_cp;
690
691 yy_current_state = yy_start;
692yy_match:
fba34cf8 693 do
42cf5bc1 694 {
fba34cf8 695 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
42cf5bc1 696 if ( yy_accept[yy_current_state] )
697 {
698 yy_last_accepting_state = yy_current_state;
699 yy_last_accepting_cpos = yy_cp;
700 }
fba34cf8 701 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
702 {
703 yy_current_state = (int) yy_def[yy_current_state];
704 if ( yy_current_state >= 55 )
705 yy_c = yy_meta[(unsigned int) yy_c];
706 }
707 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
42cf5bc1 708 ++yy_cp;
709 }
fba34cf8 710 while ( yy_base[yy_current_state] != 77 );
42cf5bc1 711
712yy_find_action:
713 yy_act = yy_accept[yy_current_state];
fba34cf8 714 if ( yy_act == 0 )
715 { /* have to back up */
716 yy_cp = yy_last_accepting_cpos;
717 yy_current_state = yy_last_accepting_state;
718 yy_act = yy_accept[yy_current_state];
719 }
42cf5bc1 720
721 YY_DO_BEFORE_ACTION;
722
723
724do_action: /* This label is used only to access EOF actions. */
725
726
727 switch ( yy_act )
728 { /* beginning of action switch */
729 case 0: /* must back up */
730 /* undo the effects of YY_DO_BEFORE_ACTION */
731 *yy_cp = yy_hold_char;
fba34cf8 732 yy_cp = yy_last_accepting_cpos;
42cf5bc1 733 yy_current_state = yy_last_accepting_state;
734 goto yy_find_action;
735
736case 1:
737YY_RULE_SETUP
738{;}
739 YY_BREAK
740case 2:
741YY_RULE_SETUP
742{return(SUMOP) ;}
743 YY_BREAK
744case 3:
745YY_RULE_SETUP
746{return(MINUSOP) ;}
747 YY_BREAK
748case 4:
749YY_RULE_SETUP
750{return(DIVIDEOP) ;}
751 YY_BREAK
752case 5:
753YY_RULE_SETUP
754{return(EXPOP) ;}
755 YY_BREAK
756case 6:
757YY_RULE_SETUP
758{return(EXPOP) ;}
759 YY_BREAK
760case 7:
761YY_RULE_SETUP
762{return(MULTOP) ;}
763 YY_BREAK
764case 8:
765YY_RULE_SETUP
766{return(PARENTHESIS);}
767 YY_BREAK
768case 9:
769YY_RULE_SETUP
770{return(BRACKET);}
771 YY_BREAK
772case 10:
773YY_RULE_SETUP
774{return(ENDPARENTHESIS);}
775 YY_BREAK
776case 11:
777YY_RULE_SETUP
778{return(ENDBRACKET);}
779 YY_BREAK
780case 12:
781YY_RULE_SETUP
782{return(COMMA);}
783 YY_BREAK
784case 13:
785YY_RULE_SETUP
786{return(DIFFERENTIAL);}
787 YY_BREAK
788case 14:
789YY_RULE_SETUP
790{return(ASSIGNOP);}
791 YY_BREAK
792case 15:
793YY_RULE_SETUP
794{return(EQUALOP);}
795 YY_BREAK
796case 16:
797YY_RULE_SETUP
798{return(DEASSIGNKEY);}
799 YY_BREAK
800case 17:
801YY_RULE_SETUP
802{return(DERIVKEY);}
803 YY_BREAK
804case 18:
805YY_RULE_SETUP
806{return(CONSTKEY);}
807 YY_BREAK
808case 19:
809YY_RULE_SETUP
810{return(SUMKEY);}
811 YY_BREAK
812case 20:
813YY_RULE_SETUP
814{return(PRODKEY);}
815 YY_BREAK
816case 21:
817YY_RULE_SETUP
818{ExprIntrp_SetResult(); return(VALUE);}
819 YY_BREAK
820case 22:
821YY_RULE_SETUP
822{ExprIntrp_SetResult(); return(VALUE);}
823 YY_BREAK
824case 23:
825YY_RULE_SETUP
826{ExprIntrp_SetResult(); return(IDENTIFIER);}
827 YY_BREAK
828case 24:
829YY_RULE_SETUP
830{return(RELSEPARATOR);}
831 YY_BREAK
832case 25:
833YY_RULE_SETUP
834{ExprIntrp_SetDegree();return(DERIVATE);}
835 YY_BREAK
836case 26:
837YY_RULE_SETUP
838ECHO;
839 YY_BREAK
840case YY_STATE_EOF(INITIAL):
841 yyterminate();
842
843 case YY_END_OF_BUFFER:
844 {
845 /* Amount of text matched not including the EOB char. */
846 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
847
848 /* Undo the effects of YY_DO_BEFORE_ACTION. */
849 *yy_cp = yy_hold_char;
850 YY_RESTORE_YY_MORE_OFFSET
851
852 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
853 {
854 /* We're scanning a new file or input source. It's
855 * possible that this happened because the user
856 * just pointed yyin at a new source and called
857 * yylex(). If so, then we have to assure
858 * consistency between yy_current_buffer and our
859 * globals. Here is the right place to do so, because
860 * this is the first action (other than possibly a
861 * back-up) that will match for the new input source.
862 */
863 yy_n_chars = yy_current_buffer->yy_n_chars;
864 yy_current_buffer->yy_input_file = yyin;
865 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
866 }
867
868 /* Note that here we test for yy_c_buf_p "<=" to the position
869 * of the first EOB in the buffer, since yy_c_buf_p will
870 * already have been incremented past the NUL character
871 * (since all states make transitions on EOB to the
872 * end-of-buffer state). Contrast this with the test
873 * in input().
874 */
875 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
876 { /* This was really a NUL. */
877 yy_state_type yy_next_state;
878
879 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
880
881 yy_current_state = yy_get_previous_state();
882
883 /* Okay, we're now positioned to make the NUL
884 * transition. We couldn't have
885 * yy_get_previous_state() go ahead and do it
886 * for us because it doesn't know how to deal
887 * with the possibility of jamming (and we don't
888 * want to build jamming into it because then it
889 * will run more slowly).
890 */
891
892 yy_next_state = yy_try_NUL_trans( yy_current_state );
893
894 yy_bp = yytext_ptr + YY_MORE_ADJ;
895
896 if ( yy_next_state )
897 {
898 /* Consume the NUL. */
899 yy_cp = ++yy_c_buf_p;
900 yy_current_state = yy_next_state;
901 goto yy_match;
902 }
903
904 else
905 {
906 yy_cp = yy_c_buf_p;
907 goto yy_find_action;
908 }
909 }
910
911 else switch ( yy_get_next_buffer() )
912 {
913 case EOB_ACT_END_OF_FILE:
914 {
915 yy_did_buffer_switch_on_eof = 0;
916
917 if ( yywrap() )
918 {
919 /* Note: because we've taken care in
920 * yy_get_next_buffer() to have set up
921 * yytext, we can now set up
922 * yy_c_buf_p so that if some total
923 * hoser (like flex itself) wants to
924 * call the scanner after we return the
925 * YY_NULL, it'll still work - another
926 * YY_NULL will get returned.
927 */
928 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
929
930 yy_act = YY_STATE_EOF(YY_START);
931 goto do_action;
932 }
933
934 else
935 {
936 if ( ! yy_did_buffer_switch_on_eof )
937 YY_NEW_FILE;
938 }
939 break;
940 }
941
942 case EOB_ACT_CONTINUE_SCAN:
943 yy_c_buf_p =
944 yytext_ptr + yy_amount_of_matched_text;
945
946 yy_current_state = yy_get_previous_state();
947
948 yy_cp = yy_c_buf_p;
949 yy_bp = yytext_ptr + YY_MORE_ADJ;
950 goto yy_match;
951
952 case EOB_ACT_LAST_MATCH:
953 yy_c_buf_p =
954 &yy_current_buffer->yy_ch_buf[yy_n_chars];
955
956 yy_current_state = yy_get_previous_state();
957
958 yy_cp = yy_c_buf_p;
959 yy_bp = yytext_ptr + YY_MORE_ADJ;
960 goto yy_find_action;
961 }
962 break;
963 }
964
965 default:
966 YY_FATAL_ERROR(
967 "fatal flex scanner internal error--no action found" );
968 } /* end of action switch */
969 } /* end of scanning one token */
970 } /* end of yylex */
971
972
973/* yy_get_next_buffer - try to read in a new buffer
974 *
975 * Returns a code representing an action:
976 * EOB_ACT_LAST_MATCH -
977 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
978 * EOB_ACT_END_OF_FILE - end of file
979 */
980
981static int yy_get_next_buffer()
982 {
983 register char *dest = yy_current_buffer->yy_ch_buf;
984 register char *source = yytext_ptr;
985 register int number_to_move, i;
986 int ret_val;
987
988 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
989 YY_FATAL_ERROR(
990 "fatal flex scanner internal error--end of buffer missed" );
991
992 if ( yy_current_buffer->yy_fill_buffer == 0 )
993 { /* Don't try to fill the buffer, so this is an EOF. */
994 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
995 {
996 /* We matched a single character, the EOB, so
997 * treat this as a final EOF.
998 */
999 return EOB_ACT_END_OF_FILE;
1000 }
1001
1002 else
1003 {
1004 /* We matched some text prior to the EOB, first
1005 * process it.
1006 */
1007 return EOB_ACT_LAST_MATCH;
1008 }
1009 }
1010
1011 /* Try to read more data. */
1012
1013 /* First move last chars to start of buffer. */
1014 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1015
1016 for ( i = 0; i < number_to_move; ++i )
1017 *(dest++) = *(source++);
1018
1019 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1020 /* don't do the read, it's not guaranteed to return an EOF,
1021 * just force an EOF
1022 */
1023 yy_n_chars = 0;
1024
1025 else
1026 {
1027 int num_to_read =
1028 yy_current_buffer->yy_buf_size - number_to_move - 1;
1029
1030 while ( num_to_read <= 0 )
1031 { /* Not enough room in the buffer - grow it. */
1032#ifdef YY_USES_REJECT
1033 YY_FATAL_ERROR(
1034"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1035#else
1036
1037 /* just a shorter name for the current buffer */
1038 YY_BUFFER_STATE b = yy_current_buffer;
1039
1040 int yy_c_buf_p_offset =
1041 (int) (yy_c_buf_p - b->yy_ch_buf);
1042
1043 if ( b->yy_is_our_buffer )
1044 {
1045 int new_size = b->yy_buf_size * 2;
1046
1047 if ( new_size <= 0 )
1048 b->yy_buf_size += b->yy_buf_size / 8;
1049 else
1050 b->yy_buf_size *= 2;
1051
1052 b->yy_ch_buf = (char *)
1053 /* Include room in for 2 EOB chars. */
1054 yy_flex_realloc( (void *) b->yy_ch_buf,
1055 b->yy_buf_size + 2 );
1056 }
1057 else
1058 /* Can't grow it, we don't own it. */
1059 b->yy_ch_buf = 0;
1060
1061 if ( ! b->yy_ch_buf )
1062 YY_FATAL_ERROR(
1063 "fatal error - scanner input buffer overflow" );
1064
1065 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1066
1067 num_to_read = yy_current_buffer->yy_buf_size -
1068 number_to_move - 1;
1069#endif
1070 }
1071
1072 if ( num_to_read > YY_READ_BUF_SIZE )
1073 num_to_read = YY_READ_BUF_SIZE;
1074
1075 /* Read in more data. */
1076 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1077 yy_n_chars, num_to_read );
1078 }
1079
1080 if ( yy_n_chars == 0 )
1081 {
1082 if ( number_to_move == YY_MORE_ADJ )
1083 {
1084 ret_val = EOB_ACT_END_OF_FILE;
1085 yyrestart( yyin );
1086 }
1087
1088 else
1089 {
1090 ret_val = EOB_ACT_LAST_MATCH;
1091 yy_current_buffer->yy_buffer_status =
1092 YY_BUFFER_EOF_PENDING;
1093 }
1094 }
1095
1096 else
1097 ret_val = EOB_ACT_CONTINUE_SCAN;
1098
1099 yy_n_chars += number_to_move;
1100 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1101 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1102
1103 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1104
1105 return ret_val;
1106 }
1107
1108
1109/* yy_get_previous_state - get the state just before the EOB char was reached */
1110
1111static yy_state_type yy_get_previous_state()
1112 {
1113 register yy_state_type yy_current_state;
1114 register char *yy_cp;
1115
1116 yy_current_state = yy_start;
1117
1118 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1119 {
fba34cf8 1120 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
42cf5bc1 1121 if ( yy_accept[yy_current_state] )
1122 {
1123 yy_last_accepting_state = yy_current_state;
1124 yy_last_accepting_cpos = yy_cp;
1125 }
fba34cf8 1126 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1127 {
1128 yy_current_state = (int) yy_def[yy_current_state];
1129 if ( yy_current_state >= 55 )
1130 yy_c = yy_meta[(unsigned int) yy_c];
1131 }
1132 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
42cf5bc1 1133 }
1134
1135 return yy_current_state;
1136 }
1137
1138
1139/* yy_try_NUL_trans - try to make a transition on the NUL character
1140 *
1141 * synopsis
1142 * next_state = yy_try_NUL_trans( current_state );
1143 */
1144
1145#ifdef YY_USE_PROTOS
1146static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1147#else
1148static yy_state_type yy_try_NUL_trans( yy_current_state )
1149yy_state_type yy_current_state;
1150#endif
1151 {
1152 register int yy_is_jam;
1153 register char *yy_cp = yy_c_buf_p;
1154
fba34cf8 1155 register YY_CHAR yy_c = 1;
1156 if ( yy_accept[yy_current_state] )
42cf5bc1 1157 {
fba34cf8 1158 yy_last_accepting_state = yy_current_state;
1159 yy_last_accepting_cpos = yy_cp;
1160 }
1161 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1162 {
1163 yy_current_state = (int) yy_def[yy_current_state];
1164 if ( yy_current_state >= 55 )
1165 yy_c = yy_meta[(unsigned int) yy_c];
42cf5bc1 1166 }
fba34cf8 1167 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1168 yy_is_jam = (yy_current_state == 54);
42cf5bc1 1169
1170 return yy_is_jam ? 0 : yy_current_state;
1171 }
1172
1173
1174#ifndef YY_NO_UNPUT
1175#ifdef YY_USE_PROTOS
1176static void yyunput( int c, register char *yy_bp )
1177#else
1178static void yyunput( c, yy_bp )
1179int c;
1180register char *yy_bp;
1181#endif
1182 {
1183 register char *yy_cp = yy_c_buf_p;
1184
1185 /* undo effects of setting up yytext */
1186 *yy_cp = yy_hold_char;
1187
1188 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1189 { /* need to shift things up to make room */
1190 /* +2 for EOB chars. */
1191 register int number_to_move = yy_n_chars + 2;
1192 register char *dest = &yy_current_buffer->yy_ch_buf[
1193 yy_current_buffer->yy_buf_size + 2];
1194 register char *source =
1195 &yy_current_buffer->yy_ch_buf[number_to_move];
1196
1197 while ( source > yy_current_buffer->yy_ch_buf )
1198 *--dest = *--source;
1199
1200 yy_cp += (int) (dest - source);
1201 yy_bp += (int) (dest - source);
1202 yy_n_chars = yy_current_buffer->yy_buf_size;
1203
1204 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1205 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1206 }
1207
1208 *--yy_cp = (char) c;
1209
1210
1211 yytext_ptr = yy_bp;
1212 yy_hold_char = *yy_cp;
1213 yy_c_buf_p = yy_cp;
1214 }
1215#endif /* ifndef YY_NO_UNPUT */
1216
1217
1218#ifdef __cplusplus
1219static int yyinput()
1220#else
1221static int input()
1222#endif
1223 {
1224 int c;
1225
1226 *yy_c_buf_p = yy_hold_char;
1227
1228 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1229 {
1230 /* yy_c_buf_p now points to the character we want to return.
1231 * If this occurs *before* the EOB characters, then it's a
1232 * valid NUL; if not, then we've hit the end of the buffer.
1233 */
1234 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1235 /* This was really a NUL. */
1236 *yy_c_buf_p = '\0';
1237
1238 else
1239 { /* need more input */
1240 int offset = yy_c_buf_p - yytext_ptr;
1241 ++yy_c_buf_p;
1242
1243 switch ( yy_get_next_buffer() )
1244 {
1245 case EOB_ACT_END_OF_FILE:
1246 {
1247 if ( yywrap() )
1248 {
1249 yy_c_buf_p = yytext_ptr + offset;
1250 return EOF;
1251 }
1252
1253 if ( ! yy_did_buffer_switch_on_eof )
1254 YY_NEW_FILE;
1255#ifdef __cplusplus
1256 return yyinput();
1257#else
1258 return input();
1259#endif
1260 }
1261
1262 case EOB_ACT_CONTINUE_SCAN:
1263 yy_c_buf_p = yytext_ptr + offset;
1264 break;
1265
1266 case EOB_ACT_LAST_MATCH:
1267#ifdef __cplusplus
1268 YY_FATAL_ERROR(
1269 "unexpected last match in yyinput()" );
1270#else
1271 YY_FATAL_ERROR(
1272 "unexpected last match in input()" );
1273#endif
1274 }
1275 }
1276 }
1277
1278 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1279 *yy_c_buf_p = '\0'; /* preserve yytext */
1280 yy_hold_char = *++yy_c_buf_p;
1281
1282
1283 return c;
1284 }
1285
1286
1287#ifdef YY_USE_PROTOS
1288void yyrestart( FILE *input_file )
1289#else
1290void yyrestart( input_file )
1291FILE *input_file;
1292#endif
1293 {
1294 if ( ! yy_current_buffer )
1295 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1296
1297 yy_init_buffer( yy_current_buffer, input_file );
1298 yy_load_buffer_state();
1299 }
1300
1301
1302#ifdef YY_USE_PROTOS
1303void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1304#else
1305void yy_switch_to_buffer( new_buffer )
1306YY_BUFFER_STATE new_buffer;
1307#endif
1308 {
1309 if ( yy_current_buffer == new_buffer )
1310 return;
1311
1312 if ( yy_current_buffer )
1313 {
1314 /* Flush out information for old buffer. */
1315 *yy_c_buf_p = yy_hold_char;
1316 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1317 yy_current_buffer->yy_n_chars = yy_n_chars;
1318 }
1319
1320 yy_current_buffer = new_buffer;
1321 yy_load_buffer_state();
1322
1323 /* We don't actually know whether we did this switch during
1324 * EOF (yywrap()) processing, but the only time this flag
1325 * is looked at is after yywrap() is called, so it's safe
1326 * to go ahead and always set it.
1327 */
1328 yy_did_buffer_switch_on_eof = 1;
1329 }
1330
1331
1332#ifdef YY_USE_PROTOS
1333void yy_load_buffer_state( void )
1334#else
1335void yy_load_buffer_state()
1336#endif
1337 {
1338 yy_n_chars = yy_current_buffer->yy_n_chars;
1339 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1340 yyin = yy_current_buffer->yy_input_file;
1341 yy_hold_char = *yy_c_buf_p;
1342 }
1343
1344
1345#ifdef YY_USE_PROTOS
1346YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1347#else
1348YY_BUFFER_STATE yy_create_buffer( file, size )
1349FILE *file;
1350int size;
1351#endif
1352 {
1353 YY_BUFFER_STATE b;
1354
1355 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1356 if ( ! b )
1357 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1358
1359 b->yy_buf_size = size;
1360
1361 /* yy_ch_buf has to be 2 characters longer than the size given because
1362 * we need to put in 2 end-of-buffer characters.
1363 */
1364 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1365 if ( ! b->yy_ch_buf )
1366 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1367
1368 b->yy_is_our_buffer = 1;
1369
1370 yy_init_buffer( b, file );
1371
1372 return b;
1373 }
1374
1375
1376#ifdef YY_USE_PROTOS
1377void yy_delete_buffer( YY_BUFFER_STATE b )
1378#else
1379void yy_delete_buffer( b )
1380YY_BUFFER_STATE b;
1381#endif
1382 {
1383 if ( ! b )
1384 return;
1385
1386 if ( b == yy_current_buffer )
1387 yy_current_buffer = (YY_BUFFER_STATE) 0;
1388
1389 if ( b->yy_is_our_buffer )
1390 yy_flex_free( (void *) b->yy_ch_buf );
1391
1392 yy_flex_free( (void *) b );
1393 }
1394
1395
1396#ifndef YY_ALWAYS_INTERACTIVE
1397#ifndef YY_NEVER_INTERACTIVE
1398extern int isatty YY_PROTO(( int ));
1399#endif
1400#endif
1401
1402#ifdef YY_USE_PROTOS
1403void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1404#else
1405void yy_init_buffer( b, file )
1406YY_BUFFER_STATE b;
1407FILE *file;
1408#endif
1409
1410
1411 {
1412 yy_flush_buffer( b );
1413
1414 b->yy_input_file = file;
1415 b->yy_fill_buffer = 1;
1416
1417#if YY_ALWAYS_INTERACTIVE
1418 b->yy_is_interactive = 1;
1419#else
1420#if YY_NEVER_INTERACTIVE
1421 b->yy_is_interactive = 0;
1422#else
1423 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1424#endif
1425#endif
1426 }
1427
1428
1429#ifdef YY_USE_PROTOS
1430void yy_flush_buffer( YY_BUFFER_STATE b )
1431#else
1432void yy_flush_buffer( b )
1433YY_BUFFER_STATE b;
1434#endif
1435
1436 {
1437 b->yy_n_chars = 0;
1438
1439 /* We always need two end-of-buffer characters. The first causes
1440 * a transition to the end-of-buffer state. The second causes
1441 * a jam in that state.
1442 */
1443 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1444 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1445
1446 b->yy_buf_pos = &b->yy_ch_buf[0];
1447
1448 b->yy_at_bol = 1;
1449 b->yy_buffer_status = YY_BUFFER_NEW;
1450
1451 if ( b == yy_current_buffer )
1452 yy_load_buffer_state();
1453 }
1454
1455
1456#ifndef YY_NO_SCAN_BUFFER
1457#ifdef YY_USE_PROTOS
1458YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1459#else
1460YY_BUFFER_STATE yy_scan_buffer( base, size )
1461char *base;
1462yy_size_t size;
1463#endif
1464 {
1465 YY_BUFFER_STATE b;
1466
1467 if ( size < 2 ||
1468 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1469 base[size-1] != YY_END_OF_BUFFER_CHAR )
1470 /* They forgot to leave room for the EOB's. */
1471 return 0;
1472
1473 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1474 if ( ! b )
1475 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1476
1477 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1478 b->yy_buf_pos = b->yy_ch_buf = base;
1479 b->yy_is_our_buffer = 0;
1480 b->yy_input_file = 0;
1481 b->yy_n_chars = b->yy_buf_size;
1482 b->yy_is_interactive = 0;
1483 b->yy_at_bol = 1;
1484 b->yy_fill_buffer = 0;
1485 b->yy_buffer_status = YY_BUFFER_NEW;
1486
1487 yy_switch_to_buffer( b );
1488
1489 return b;
1490 }
1491#endif
1492
1493
1494#ifndef YY_NO_SCAN_STRING
1495#ifdef YY_USE_PROTOS
1496YY_BUFFER_STATE yy_scan_string( yyconst char *str )
1497#else
1498YY_BUFFER_STATE yy_scan_string( str )
1499yyconst char *str;
1500#endif
1501 {
1502 int len;
1503 for ( len = 0; str[len]; ++len )
1504 ;
1505
1506 return yy_scan_bytes( str, len );
1507 }
1508#endif
1509
1510
1511#ifndef YY_NO_SCAN_BYTES
1512#ifdef YY_USE_PROTOS
1513YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1514#else
1515YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1516yyconst char *bytes;
1517int len;
1518#endif
1519 {
1520 YY_BUFFER_STATE b;
1521 char *buf;
1522 yy_size_t n;
1523 int i;
1524
1525 /* Get memory for full buffer, including space for trailing EOB's. */
1526 n = len + 2;
1527 buf = (char *) yy_flex_alloc( n );
1528 if ( ! buf )
1529 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1530
1531 for ( i = 0; i < len; ++i )
1532 buf[i] = bytes[i];
1533
1534 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1535
1536 b = yy_scan_buffer( buf, n );
1537 if ( ! b )
1538 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1539
1540 /* It's okay to grow etc. this buffer, and we should throw it
1541 * away when we're done.
1542 */
1543 b->yy_is_our_buffer = 1;
1544
1545 return b;
1546 }
1547#endif
1548
1549
1550#ifndef YY_NO_PUSH_STATE
1551#ifdef YY_USE_PROTOS
1552static void yy_push_state( int new_state )
1553#else
1554static void yy_push_state( new_state )
1555int new_state;
1556#endif
1557 {
1558 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1559 {
1560 yy_size_t new_size;
1561
1562 yy_start_stack_depth += YY_START_STACK_INCR;
1563 new_size = yy_start_stack_depth * sizeof( int );
1564
1565 if ( ! yy_start_stack )
1566 yy_start_stack = (int *) yy_flex_alloc( new_size );
1567
1568 else
1569 yy_start_stack = (int *) yy_flex_realloc(
1570 (void *) yy_start_stack, new_size );
1571
1572 if ( ! yy_start_stack )
1573 YY_FATAL_ERROR(
1574 "out of memory expanding start-condition stack" );
1575 }
1576
1577 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1578
1579 BEGIN(new_state);
1580 }
1581#endif
1582
1583
1584#ifndef YY_NO_POP_STATE
1585static void yy_pop_state()
1586 {
1587 if ( --yy_start_stack_ptr < 0 )
1588 YY_FATAL_ERROR( "start-condition stack underflow" );
1589
1590 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1591 }
1592#endif
1593
1594
1595#ifndef YY_NO_TOP_STATE
1596static int yy_top_state()
1597 {
1598 return yy_start_stack[yy_start_stack_ptr - 1];
1599 }
1600#endif
1601
1602#ifndef YY_EXIT_FAILURE
1603#define YY_EXIT_FAILURE 2
1604#endif
1605
1606#ifdef YY_USE_PROTOS
1607static void yy_fatal_error( yyconst char msg[] )
1608#else
1609static void yy_fatal_error( msg )
1610char msg[];
1611#endif
1612 {
1613 (void) fprintf( stderr, "%s\n", msg );
1614 exit( YY_EXIT_FAILURE );
1615 }
1616
1617
1618
1619/* Redefine yyless() so it works in section 3 code. */
1620
1621#undef yyless
1622#define yyless(n) \
1623 do \
1624 { \
1625 /* Undo effects of setting up yytext. */ \
1626 yytext[yyleng] = yy_hold_char; \
1627 yy_c_buf_p = yytext + n; \
1628 yy_hold_char = *yy_c_buf_p; \
1629 *yy_c_buf_p = '\0'; \
1630 yyleng = n; \
1631 } \
1632 while ( 0 )
1633
1634
1635/* Internal utility routines. */
1636
1637#ifndef yytext_ptr
1638#ifdef YY_USE_PROTOS
1639static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1640#else
1641static void yy_flex_strncpy( s1, s2, n )
1642char *s1;
1643yyconst char *s2;
1644int n;
1645#endif
1646 {
1647 register int i;
1648 for ( i = 0; i < n; ++i )
1649 s1[i] = s2[i];
1650 }
1651#endif
1652
1653#ifdef YY_NEED_STRLEN
1654#ifdef YY_USE_PROTOS
1655static int yy_flex_strlen( yyconst char *s )
1656#else
1657static int yy_flex_strlen( s )
1658yyconst char *s;
1659#endif
1660 {
1661 register int n;
1662 for ( n = 0; s[n]; ++n )
1663 ;
1664
1665 return n;
1666 }
1667#endif
1668
1669
1670#ifdef YY_USE_PROTOS
1671static void *yy_flex_alloc( yy_size_t size )
1672#else
1673static void *yy_flex_alloc( size )
1674yy_size_t size;
1675#endif
1676 {
1677 return (void *) malloc( size );
1678 }
1679
1680#ifdef YY_USE_PROTOS
1681static void *yy_flex_realloc( void *ptr, yy_size_t size )
1682#else
1683static void *yy_flex_realloc( ptr, size )
1684void *ptr;
1685yy_size_t size;
1686#endif
1687 {
1688 /* The cast to (char *) in the following accommodates both
1689 * implementations that use char* generic pointers, and those
1690 * that use void* generic pointers. It works with the latter
1691 * because both ANSI C and C++ allow castless assignment from
1692 * any pointer type to void*, and deal with argument conversions
1693 * as though doing an assignment.
1694 */
1695 return (void *) realloc( (char *) ptr, size );
1696 }
1697
1698#ifdef YY_USE_PROTOS
1699static void yy_flex_free( void *ptr )
1700#else
1701static void yy_flex_free( ptr )
1702void *ptr;
1703#endif
1704 {
1705 free( ptr );
1706 }
1707
1708#if YY_MAIN
1709int main()
1710 {
1711 yylex();
1712 return 0;
1713 }
1714#endif