Merge pull request #2220 from DOCGroup/revert-2217-jwi-inetwraning
[ACE_TAO.git] / ACE / ace / ETCL / ETCL_l.cpp
blob1addcb5319e12494a730ca4b6961e86a2a8a6780
2 /* A lexical scanner generated by flex */
4 /* Scanner skeleton version:
5 */
7 #define FLEX_SCANNER
8 #define YY_FLEX_MAJOR_VERSION 2
9 #define YY_FLEX_MINOR_VERSION 5
12 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
13 #ifdef c_plusplus
14 #ifndef __cplusplus
15 #define __cplusplus
16 #endif
17 #endif
19 #include "ace/ETCL/ETCL_Constraint.h"
21 #ifdef __cplusplus
23 #include "ace/OS_NS_unistd.h"
24 #include "ace/OS_NS_stdio.h"
26 /* Use prototypes in function declarations. */
27 #define YY_USE_PROTOS
29 /* The "const" storage-class-modifier is valid. */
30 #define YY_USE_CONST
32 #else /* ! __cplusplus */
34 #if __STDC__
36 #define YY_USE_PROTOS
37 #define YY_USE_CONST
39 #endif /* __STDC__ */
40 #endif /* ! __cplusplus */
42 #ifdef __TURBOC__
43 #pragma warn -rch
44 #pragma warn -use
45 #include <io.h>
46 #include <stdlib.h>
47 #define YY_USE_CONST
48 #define YY_USE_PROTOS
49 #endif
51 #ifdef YY_USE_CONST
52 #define yyconst const
53 #else
54 #define yyconst
55 #endif
58 #ifdef YY_USE_PROTOS
59 #define YY_PROTO(proto) proto
60 #else
61 #define YY_PROTO(proto) ()
62 #endif
64 /* Returned upon end-of-file. */
65 #define YY_NULL 0
67 /* Promotes a possibly negative, possibly signed char to an unsigned
68 * integer for use as an array index. If the signed char is negative,
69 * we want to instead treat it as an 8-bit unsigned char, hence the
70 * double cast.
72 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
74 /* Enter a start condition. This macro really ought to take a parameter,
75 * but we do it the disgusting crufty way forced on us by the ()-less
76 * definition of BEGIN.
78 #define BEGIN yy_start = 1 + 2 *
80 /* Translate the current start state into a value that can be later handed
81 * to BEGIN to return to the state. The YYSTATE alias is for lex
82 * compatibility.
84 #define YY_START ((yy_start - 1) / 2)
85 #define YYSTATE YY_START
87 /* Action number for EOF rule of a given start state. */
88 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
90 /* Special action meaning "start processing a new file". */
91 #define YY_NEW_FILE yyrestart( yyin )
93 #define YY_END_OF_BUFFER_CHAR 0
95 /* Size of default input buffer. */
96 #define YY_BUF_SIZE 16384
98 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
100 typedef struct yy_buffer_state *YY_BUFFER_STATE;
102 extern int yyleng;
103 extern FILE *yyin, *yyout;
105 #define EOB_ACT_CONTINUE_SCAN 0
106 #define EOB_ACT_END_OF_FILE 1
107 #define EOB_ACT_LAST_MATCH 2
109 /* The funky do-while in the following #define is used to turn the definition
110 * int a single C statement (which needs a semi-colon terminator). This
111 * avoids problems with code like:
113 * if ( condition_holds )
114 * yyless( 5 );
115 * else
116 * do_something_else();
118 * Prior to using the do-while the compiler would get upset at the
119 * "else" because it interpreted the "if" statement as being all
120 * done when it reached the ';' after the yyless() call.
123 /* Return all but the first 'n' matched characters back to the input stream. */
125 #define yyless(n) \
126 do \
128 /* Undo effects of setting up yytext. */ \
129 *yy_cp = yy_hold_char; \
130 YY_RESTORE_YY_MORE_OFFSET \
131 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
132 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
134 while ( 0 )
136 #define unput(c) yyunput( c, yytext_ptr )
138 /* The following is because we cannot portably get our hands on size_t
139 * (without autoconf's help, which isn't available because we want
140 * flex-generated scanners to compile on their own).
142 typedef unsigned int yy_size_t;
145 struct yy_buffer_state
147 FILE *yy_input_file;
149 char *yy_ch_buf; /* input buffer */
150 char *yy_buf_pos; /* current position in input buffer */
152 /* Size of input buffer in bytes, not including room for EOB
153 * characters.
155 yy_size_t yy_buf_size;
157 /* Number of characters read into yy_ch_buf, not including EOB
158 * characters.
160 int yy_n_chars;
162 /* Whether we "own" the buffer - i.e., we know we created it,
163 * and can realloc() it to grow it, and should free() it to
164 * delete it.
166 int yy_is_our_buffer;
168 /* Whether this is an "interactive" input source; if so, and
169 * if we're using stdio for input, then we want to use getc()
170 * instead of fread(), to make sure we stop fetching input after
171 * each newline.
173 int yy_is_interactive;
175 /* Whether we're considered to be at the beginning of a line.
176 * If so, '^' rules will be active on the next match, otherwise
177 * not.
179 int yy_at_bol;
181 /* Whether to try to fill the input buffer when we reach the
182 * end of it.
184 int yy_fill_buffer;
186 int yy_buffer_status;
187 #define YY_BUFFER_NEW 0
188 #define YY_BUFFER_NORMAL 1
189 /* When an EOF's been seen but there's still some text to process
190 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
191 * shouldn't try reading from the input source any more. We might
192 * still have a bunch of tokens to match, though, because of
193 * possible backing-up.
195 * When we actually see the EOF, we change the status to "new"
196 * (via yyrestart()), so that the user can continue scanning by
197 * just pointing yyin at a new input file.
199 #define YY_BUFFER_EOF_PENDING 2
202 static YY_BUFFER_STATE yy_current_buffer = 0;
204 /* We provide macros for accessing buffer states in case in the
205 * future we want to put the buffer states in a more general
206 * "scanner state".
208 #define YY_CURRENT_BUFFER yy_current_buffer
211 /* yy_hold_char holds the character lost when yytext is formed. */
212 static char yy_hold_char;
214 static int yy_n_chars; /* number of characters read into yy_ch_buf */
217 int yyleng;
219 /* Points to current character in buffer. */
220 static char *yy_c_buf_p = (char *) 0;
221 static int yy_init = 1; /* whether we need to initialize */
222 static int yy_start = 0; /* start state number */
224 /* Flag which is used to allow yywrap()'s to do buffer switches
225 * instead of setting up a fresh yyin. A bit of a hack ...
227 static int yy_did_buffer_switch_on_eof;
229 void yyrestart YY_PROTO(( FILE *input_file ));
231 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
232 void yy_load_buffer_state YY_PROTO(( void ));
233 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
234 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
235 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
236 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
237 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
239 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
240 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
241 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
243 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
244 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
245 static void yy_flex_free YY_PROTO(( void * ));
247 #define yy_new_buffer yy_create_buffer
249 #define yy_set_interactive(is_interactive) \
251 if ( ! yy_current_buffer ) \
252 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
253 yy_current_buffer->yy_is_interactive = is_interactive; \
256 #define yy_set_bol(at_bol) \
258 if ( ! yy_current_buffer ) \
259 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
260 yy_current_buffer->yy_at_bol = at_bol; \
263 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
266 typedef unsigned char YY_CHAR;
267 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
268 typedef int yy_state_type;
269 extern char *yytext;
270 #define yytext_ptr yytext
272 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
273 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
274 static int yy_get_next_buffer YY_PROTO(( void ));
275 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
277 /* Done after the current pattern has been matched and before the
278 * corresponding action - sets up yytext.
280 #define YY_DO_BEFORE_ACTION \
281 yytext_ptr = yy_bp; \
282 yyleng = (int) (yy_cp - yy_bp); \
283 yy_hold_char = *yy_cp; \
284 *yy_cp = '\0'; \
285 yy_c_buf_p = yy_cp;
287 #define YY_NUM_RULES 41
288 #define YY_END_OF_BUFFER 42
289 static yyconst short int yy_accept[118] =
290 { 0,
291 0, 0, 42, 40, 39, 41, 40, 24, 40, 22,
292 23, 14, 12, 13, 25, 15, 35, 16, 40, 18,
293 38, 38, 38, 31, 40, 32, 40, 38, 38, 38,
294 38, 38, 38, 38, 38, 38, 38, 11, 21, 0,
295 37, 0, 36, 0, 35, 17, 20, 19, 38, 38,
296 38, 38, 27, 0, 0, 0, 38, 38, 38, 38,
297 10, 38, 38, 38, 9, 38, 38, 0, 0, 38,
298 38, 38, 0, 0, 0, 8, 38, 38, 38, 2,
299 1, 7, 38, 38, 0, 36, 38, 33, 0, 0,
300 0, 38, 38, 38, 38, 5, 34, 0, 0, 0,
302 38, 6, 3, 38, 0, 0, 0, 38, 4, 30,
303 0, 0, 26, 0, 28, 29, 0
306 static yyconst int yy_ec[256] =
307 { 0,
308 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
309 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
310 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
311 1, 2, 4, 1, 1, 5, 1, 1, 6, 7,
312 8, 9, 10, 1, 11, 12, 13, 14, 14, 14,
313 14, 14, 14, 14, 14, 14, 14, 1, 1, 15,
314 16, 17, 1, 1, 18, 19, 19, 19, 20, 21,
315 19, 19, 19, 19, 19, 22, 19, 19, 19, 19,
316 19, 23, 24, 25, 26, 19, 19, 19, 19, 19,
317 27, 28, 29, 1, 30, 1, 31, 19, 19, 32,
319 33, 34, 35, 36, 37, 19, 19, 38, 39, 40,
320 41, 42, 19, 43, 44, 45, 46, 19, 47, 48,
321 49, 19, 1, 1, 1, 50, 1, 1, 1, 1,
322 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
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, 1, 1, 1, 1, 1, 1, 1, 1, 1,
327 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
328 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
330 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
331 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
332 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
333 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
334 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
335 1, 1, 1, 1, 1
338 static yyconst int yy_meta[51] =
339 { 0,
340 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
341 1, 1, 1, 2, 1, 1, 1, 3, 3, 3,
342 3, 3, 3, 3, 3, 3, 1, 1, 1, 2,
343 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
344 3, 3, 3, 3, 3, 3, 3, 3, 3, 1
347 static yyconst short int yy_base[122] =
348 { 0,
349 0, 0, 146, 147, 147, 147, 129, 147, 45, 147,
350 147, 147, 147, 147, 130, 147, 40, 127, 126, 125,
351 0, 122, 116, 147, 0, 147, 21, 98, 104, 88,
352 98, 94, 24, 92, 89, 100, 93, 147, 147, 50,
353 147, 51, 48, 115, 46, 147, 147, 147, 0, 106,
354 101, 0, 147, 93, 92, 75, 91, 88, 84, 77,
355 0, 71, 78, 72, 0, 76, 70, 57, 60, 90,
356 93, 0, 72, 69, 68, 0, 78, 64, 63, 0,
357 0, 0, 74, 69, 90, 89, 82, 0, 66, 59,
358 66, 52, 52, 51, 54, 0, 0, 49, 49, 54,
360 45, 0, 0, 43, 44, 47, 39, 30, 0, 147,
361 35, 37, 0, 35, 147, 147, 147, 85, 87, 62,
365 static yyconst short int yy_def[122] =
366 { 0,
367 117, 1, 117, 117, 117, 117, 117, 117, 118, 117,
368 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
369 119, 119, 119, 117, 120, 117, 117, 119, 119, 119,
370 119, 119, 119, 119, 119, 119, 119, 117, 117, 118,
371 117, 117, 117, 117, 117, 117, 117, 117, 119, 119,
372 119, 121, 117, 117, 117, 117, 119, 119, 119, 119,
373 119, 119, 119, 119, 119, 119, 119, 118, 117, 119,
374 119, 121, 117, 117, 117, 119, 119, 119, 119, 119,
375 119, 119, 119, 119, 117, 117, 119, 119, 117, 117,
376 117, 119, 119, 119, 119, 119, 119, 117, 117, 117,
378 119, 119, 119, 119, 117, 117, 117, 119, 119, 117,
379 117, 117, 119, 117, 117, 117, 0, 117, 117, 117,
383 static yyconst short int yy_nxt[198] =
384 { 0,
385 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
386 14, 15, 16, 17, 18, 19, 20, 21, 21, 21,
387 22, 21, 21, 21, 23, 21, 24, 25, 26, 27,
388 28, 29, 30, 31, 21, 21, 32, 21, 33, 34,
389 35, 21, 36, 21, 21, 21, 37, 21, 21, 38,
390 41, 44, 53, 45, 62, 41, 68, 44, 54, 45,
391 63, 43, 41, 55, 52, 56, 116, 69, 115, 85,
392 85, 114, 42, 86, 113, 112, 111, 42, 68, 110,
393 69, 109, 108, 107, 42, 40, 40, 40, 49, 49,
394 72, 72, 106, 105, 104, 103, 102, 101, 100, 99,
396 98, 97, 86, 86, 96, 95, 94, 93, 92, 91,
397 90, 89, 88, 87, 84, 83, 82, 81, 80, 79,
398 78, 77, 76, 75, 74, 73, 71, 70, 43, 67,
399 66, 65, 64, 61, 60, 59, 58, 57, 51, 50,
400 48, 47, 46, 43, 39, 117, 3, 117, 117, 117,
401 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
402 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
403 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
404 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
405 117, 117, 117, 117, 117, 117, 117
409 static yyconst short int yy_chk[198] =
410 { 0,
411 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
412 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
413 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
414 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
415 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
416 9, 17, 27, 17, 33, 40, 42, 45, 27, 45,
417 33, 43, 68, 27, 120, 27, 114, 43, 112, 69,
418 69, 111, 9, 69, 108, 107, 106, 40, 42, 105,
419 43, 104, 101, 100, 68, 118, 118, 118, 119, 119,
420 121, 121, 99, 98, 95, 94, 93, 92, 91, 90,
422 89, 87, 86, 85, 84, 83, 79, 78, 77, 75,
423 74, 73, 71, 70, 67, 66, 64, 63, 62, 60,
424 59, 58, 57, 56, 55, 54, 51, 50, 44, 37,
425 36, 35, 34, 32, 31, 30, 29, 28, 23, 22,
426 20, 19, 18, 15, 7, 3, 117, 117, 117, 117,
427 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
428 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
429 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
430 117, 117, 117, 117, 117, 117, 117, 117, 117, 117,
431 117, 117, 117, 117, 117, 117, 117
435 static yy_state_type yy_last_accepting_state;
436 static char *yy_last_accepting_cpos;
438 /* The intent behind this definition is that it'll catch
439 * any uses of REJECT which flex missed.
441 #define REJECT reject_used_but_not_detected
442 #define yymore() yymore_used_but_not_detected
443 #define YY_MORE_ADJ 0
444 #define YY_RESTORE_YY_MORE_OFFSET
445 char *yytext;
446 #define INITIAL 0
448 ACE_END_VERSIONED_NAMESPACE_DECL
450 //=============================================================================
452 * @file ETCL_l.cpp
454 * @author Carlos O'Ryan <coryan@uci.edu> based on previous work by Seth Widoff <sbw1@cs.wustl.edu>
456 //=============================================================================
459 #include "ace/ETCL/ETCL_Interpreter.h"
460 #include "ace/ETCL/ETCL_y.h"
462 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
464 static const char* extract_string(char*);
466 #define YY_LEX_DEBUG
468 #ifdef CONSTRAINT_DEBUG
469 #define YY_LEX_DEBUG ACE_OS::fprintf(stderr, "%s\n", yytext)
470 #endif /* CONSTRAINT_DEBUG */
472 //#define YY_DECL int ETCL_yylex (ETCL_YYSTYPE *lvalp, void* state)
474 #define YY_BREAK
475 #define YY_NO_UNPUT
476 #define YY_NO_INPUT
478 /* Macros after this point can all be overridden by user definitions in
479 * section 1.
482 #ifndef YY_SKIP_YYWRAP
483 #ifdef __cplusplus
484 extern "C" int yywrap YY_PROTO(( void ));
485 #else
486 extern int yywrap YY_PROTO(( void ));
487 #endif
488 #endif
490 #ifndef yytext_ptr
491 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
492 #endif
494 #ifdef YY_NEED_STRLEN
495 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
496 #endif
498 #ifndef YY_NO_INPUT
499 #ifdef __cplusplus
500 static int yyinput YY_PROTO(( void ));
501 #else
502 static int input YY_PROTO(( void ));
503 #endif
504 #endif
506 #if YY_STACK_USED
507 static int yy_start_stack_ptr = 0;
508 static int yy_start_stack_depth = 0;
509 static int *yy_start_stack = 0;
510 #ifndef YY_NO_PUSH_STATE
511 static void yy_push_state YY_PROTO(( int new_state ));
512 #endif
513 #ifndef YY_NO_POP_STATE
514 static void yy_pop_state YY_PROTO(( void ));
515 #endif
516 #ifndef YY_NO_TOP_STATE
517 static int yy_top_state YY_PROTO(( void ));
518 #endif
520 #else
521 #define YY_NO_PUSH_STATE 1
522 #define YY_NO_POP_STATE 1
523 #define YY_NO_TOP_STATE 1
524 #endif
526 ACE_END_VERSIONED_NAMESPACE_DECL
528 #ifdef YY_MALLOC_DECL
529 YY_MALLOC_DECL
530 #else
531 #if __STDC__
532 #ifndef __cplusplus
533 #include <stdlib.h>
534 #endif
535 #else
536 /* Just try to get by without declaring the routines. This will fail
537 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
538 * or sizeof(void*) != sizeof(int).
540 #endif
541 #endif
543 /* Amount of stuff to slurp up with each read. */
544 #ifndef YY_READ_BUF_SIZE
545 #define YY_READ_BUF_SIZE 8192
546 #endif
548 /* Copy whatever the last rule matched to the standard output. */
550 //FUZZ: disable check_for_lack_ACE_OS
551 #ifndef ETCL_ECHO
552 /* This used to be an fputs(), but since the string might contain NUL's,
553 * we now use fwrite().
555 #define ETCL_ECHO { size_t __dum_ret = fwrite( yytext, yyleng, 1, yyout ); (void) __dum_ret; }
556 #endif
557 //FUZZ: enable check_for_lack_ACE_OS
559 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
560 * is returned in "result".
562 #ifndef YY_INPUT
563 #define YY_INPUT(buf,result,max_size) \
564 if ( yy_current_buffer->yy_is_interactive ) \
566 int c = '*', n; \
567 for ( n = 0; n < max_size && \
568 (c = ACE_OS::getc( yyin )) != EOF && c != '\n'; ++n ) \
569 buf[n] = (char) c; \
570 if ( c == '\n' ) \
571 buf[n++] = (char) c; \
572 if ( c == EOF && ferror( yyin ) ) \
573 YY_FATAL_ERROR( "input in flex scanner failed" ); \
574 result = n; \
576 else if ( ((result = ACE_OS::fread( buf, 1, max_size, yyin )) == 0) \
577 && ferror( yyin ) ) \
578 YY_FATAL_ERROR( "input in flex scanner failed" );
579 #endif
581 /* No semi-colon after return; correct usage is to write "yyterminate();" -
582 * we don't want an extra ';' after the "return" because that will cause
583 * some compilers to complain about unreachable statements.
585 #ifndef yyterminate
586 #define yyterminate() return YY_NULL
587 #endif
589 /* Number of entries by which start-condition stack grows. */
590 #ifndef YY_START_STACK_INCR
591 #define YY_START_STACK_INCR 25
592 #endif
594 /* Report a fatal error. */
595 #ifndef YY_FATAL_ERROR
596 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
597 #endif
599 /* Default declaration of generated scanner - a define so the user can
600 * easily add parameters.
602 #ifndef YY_DECL
603 #define YY_DECL int yylex YY_PROTO(( void ))
604 #endif
606 /* Code executed at the beginning of each rule, after yytext and yyleng
607 * have been set up.
609 #ifndef YY_USER_ACTION
610 #define YY_USER_ACTION
611 #endif
613 /* Code executed at the end of each rule. */
614 #ifndef YY_BREAK
615 #define YY_BREAK break;
616 #endif
618 #define YY_RULE_SETUP \
619 YY_USER_ACTION
621 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
623 YY_DECL
625 yy_state_type yy_current_state;
626 char *yy_cp = 0;
627 char *yy_bp = 0;
628 int yy_act;
630 //#line 50 "ETCL/ETCL.ll"
632 if ( yy_init )
634 yy_init = 0;
636 #ifdef YY_USER_INIT
637 YY_USER_INIT;
638 #endif
640 if ( ! yy_start )
641 yy_start = 1; /* first start state */
643 if ( ! yyin )
644 yyin = stdin;
646 if ( ! yyout )
647 yyout = stdout;
649 if ( ! yy_current_buffer )
650 yy_current_buffer =
651 yy_create_buffer( yyin, YY_BUF_SIZE );
653 yy_load_buffer_state();
656 while ( 1 ) /* loops until end-of-file is reached */
658 yy_cp = yy_c_buf_p;
660 /* Support of yytext. */
661 *yy_cp = yy_hold_char;
663 /* yy_bp points to the position in yy_ch_buf of the start of
664 * the current run.
666 yy_bp = yy_cp;
668 yy_current_state = yy_start;
669 yy_match:
672 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
673 if ( yy_accept[yy_current_state] )
675 yy_last_accepting_state = yy_current_state;
676 yy_last_accepting_cpos = yy_cp;
678 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
680 yy_current_state = (int) yy_def[yy_current_state];
681 if ( yy_current_state >= 118 )
682 yy_c = yy_meta[(unsigned int) yy_c];
684 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
685 ++yy_cp;
687 while ( yy_base[yy_current_state] != 147 );
689 yy_find_action:
690 yy_act = yy_accept[yy_current_state];
691 if ( yy_act == 0 )
692 { /* have to back up */
693 yy_cp = yy_last_accepting_cpos;
694 yy_current_state = yy_last_accepting_state;
695 yy_act = yy_accept[yy_current_state];
698 YY_DO_BEFORE_ACTION;
701 do_action: /* This label is used only to access EOF actions. */
704 switch ( yy_act )
705 { /* beginning of action switch */
706 case 0: /* must back up */
707 /* undo the effects of YY_DO_BEFORE_ACTION */
708 *yy_cp = yy_hold_char;
709 yy_cp = yy_last_accepting_cpos;
710 yy_current_state = yy_last_accepting_state;
711 goto yy_find_action;
713 case 1:
714 YY_RULE_SETUP
715 //#line 52 "ETCL/ETCL.ll"
716 { YY_LEX_DEBUG; return ETCL_MIN; }
717 YY_BREAK
718 case 2:
719 YY_RULE_SETUP
720 //#line 53 "ETCL/ETCL.ll"
721 { YY_LEX_DEBUG; return ETCL_MAX; }
722 YY_BREAK
723 case 3:
724 YY_RULE_SETUP
725 //#line 54 "ETCL/ETCL.ll"
726 { YY_LEX_DEBUG; return ETCL_FIRST; }
727 YY_BREAK
728 case 4:
729 YY_RULE_SETUP
730 //#line 55 "ETCL/ETCL.ll"
731 { YY_LEX_DEBUG; return ETCL_RANDOM; }
732 YY_BREAK
733 case 5:
734 YY_RULE_SETUP
735 //#line 56 "ETCL/ETCL.ll"
736 { YY_LEX_DEBUG; return ETCL_WITH; }
737 YY_BREAK
738 case 6:
739 YY_RULE_SETUP
740 //#line 57 "ETCL/ETCL.ll"
741 { YY_LEX_DEBUG; return ETCL_EXIST; }
742 YY_BREAK
743 case 7:
744 YY_RULE_SETUP
745 //#line 58 "ETCL/ETCL.ll"
746 { YY_LEX_DEBUG; return ETCL_NOT; }
747 YY_BREAK
748 case 8:
749 YY_RULE_SETUP
750 //#line 59 "ETCL/ETCL.ll"
751 { YY_LEX_DEBUG; return ETCL_AND; }
752 YY_BREAK
753 case 9:
754 YY_RULE_SETUP
755 //#line 60 "ETCL/ETCL.ll"
756 { YY_LEX_DEBUG; return ETCL_OR; }
757 YY_BREAK
758 case 10:
759 YY_RULE_SETUP
760 //#line 61 "ETCL/ETCL.ll"
761 { YY_LEX_DEBUG; return ETCL_IN; }
762 YY_BREAK
763 case 11:
764 YY_RULE_SETUP
765 //#line 62 "ETCL/ETCL.ll"
766 { YY_LEX_DEBUG; return ETCL_TWIDDLE; }
767 YY_BREAK
768 case 12:
769 YY_RULE_SETUP
770 //#line 63 "ETCL/ETCL.ll"
771 { YY_LEX_DEBUG; return ETCL_PLUS; }
772 YY_BREAK
773 case 13:
774 YY_RULE_SETUP
775 //#line 64 "ETCL/ETCL.ll"
776 { YY_LEX_DEBUG; return ETCL_MINUS; }
777 YY_BREAK
778 case 14:
779 YY_RULE_SETUP
780 //#line 65 "ETCL/ETCL.ll"
781 { YY_LEX_DEBUG; return ETCL_MULT; }
782 YY_BREAK
783 case 15:
784 YY_RULE_SETUP
785 //#line 66 "ETCL/ETCL.ll"
786 { YY_LEX_DEBUG; return ETCL_DIV; }
787 YY_BREAK
788 case 16:
789 YY_RULE_SETUP
790 //#line 67 "ETCL/ETCL.ll"
791 { YY_LEX_DEBUG; return ETCL_LT; }
792 YY_BREAK
793 case 17:
794 YY_RULE_SETUP
795 //#line 68 "ETCL/ETCL.ll"
796 { YY_LEX_DEBUG; return ETCL_LE; }
797 YY_BREAK
798 case 18:
799 YY_RULE_SETUP
800 //#line 69 "ETCL/ETCL.ll"
801 { YY_LEX_DEBUG; return ETCL_GT; }
802 YY_BREAK
803 case 19:
804 YY_RULE_SETUP
805 //#line 70 "ETCL/ETCL.ll"
806 { YY_LEX_DEBUG; return ETCL_GE; }
807 YY_BREAK
808 case 20:
809 YY_RULE_SETUP
810 //#line 71 "ETCL/ETCL.ll"
811 { YY_LEX_DEBUG; return ETCL_EQ; }
812 YY_BREAK
813 case 21:
814 YY_RULE_SETUP
815 //#line 72 "ETCL/ETCL.ll"
816 { YY_LEX_DEBUG; return ETCL_NE; }
817 YY_BREAK
818 case 22:
819 YY_RULE_SETUP
820 //#line 73 "ETCL/ETCL.ll"
821 { YY_LEX_DEBUG; return ETCL_LPAREN; }
822 YY_BREAK
823 case 23:
824 YY_RULE_SETUP
825 //#line 74 "ETCL/ETCL.ll"
826 { YY_LEX_DEBUG; return ETCL_RPAREN; }
827 YY_BREAK
828 case 24:
829 YY_RULE_SETUP
830 //#line 75 "ETCL/ETCL.ll"
831 { YY_LEX_DEBUG; return ETCL_DOLLAR; }
832 YY_BREAK
833 case 25:
834 YY_RULE_SETUP
835 //#line 76 "ETCL/ETCL.ll"
836 { YY_LEX_DEBUG; return ETCL_DOT; }
837 YY_BREAK
838 case 26:
839 YY_RULE_SETUP
840 //#line 77 "ETCL/ETCL.ll"
841 { YY_LEX_DEBUG; return ETCL_DEFAULT; }
842 YY_BREAK
843 case 27:
844 YY_RULE_SETUP
845 //#line 78 "ETCL/ETCL.ll"
846 { YY_LEX_DEBUG; return ETCL_DISCRIMINANT; }
847 YY_BREAK
848 case 28:
849 YY_RULE_SETUP
850 //#line 79 "ETCL/ETCL.ll"
851 { YY_LEX_DEBUG; return ETCL_TYPE_ID; }
852 YY_BREAK
853 case 29:
854 YY_RULE_SETUP
855 //#line 80 "ETCL/ETCL.ll"
856 { YY_LEX_DEBUG; return ETCL_REPOS_ID; }
857 YY_BREAK
858 case 30:
859 YY_RULE_SETUP
860 //#line 81 "ETCL/ETCL.ll"
861 { YY_LEX_DEBUG; return ETCL_LENGTH; }
862 YY_BREAK
863 case 31:
864 YY_RULE_SETUP
865 //#line 82 "ETCL/ETCL.ll"
866 { YY_LEX_DEBUG; return ETCL_LBRA; }
867 YY_BREAK
868 case 32:
869 YY_RULE_SETUP
870 //#line 83 "ETCL/ETCL.ll"
871 { YY_LEX_DEBUG; return ETCL_RBRA; }
872 YY_BREAK
873 case 33:
874 YY_RULE_SETUP
875 //#line 84 "ETCL/ETCL.ll"
877 yylval.constraint =
878 new ETCL_Literal_Constraint ((ACE_CDR::Boolean) 1);
879 YY_LEX_DEBUG; return ETCL_BOOLEAN;
881 YY_BREAK
882 case 34:
883 YY_RULE_SETUP
884 //#line 89 "ETCL/ETCL.ll"
886 yylval.constraint =
887 new ETCL_Literal_Constraint ((ACE_CDR::Boolean) 0);
888 YY_LEX_DEBUG; return ETCL_BOOLEAN;
890 YY_BREAK
891 case 35:
892 YY_RULE_SETUP
893 //#line 94 "ETCL/ETCL.ll"
895 yylval.constraint =
896 new ETCL_Literal_Constraint (ACE_OS::atoi (yytext));
897 YY_LEX_DEBUG; return ETCL_INTEGER;
899 YY_BREAK
900 case 36:
901 YY_RULE_SETUP
902 //#line 99 "ETCL/ETCL.ll"
904 double v;
905 sscanf (yytext, "%lf", &v);
906 yylval.constraint =
907 new ETCL_Literal_Constraint (v);
908 YY_LEX_DEBUG; return ETCL_FLOAT;
910 YY_BREAK
911 case 37:
912 YY_RULE_SETUP
913 //#line 106 "ETCL/ETCL.ll"
915 yylval.constraint =
916 new ETCL_Literal_Constraint (extract_string(yytext));
917 YY_LEX_DEBUG; return ETCL_STRING;
919 YY_BREAK
920 case 38:
921 YY_RULE_SETUP
922 //#line 111 "ETCL/ETCL.ll"
924 yylval.constraint =
925 new ETCL_Identifier (yytext);
926 YY_LEX_DEBUG; return ETCL_IDENT;
928 YY_BREAK
929 case 39:
930 YY_RULE_SETUP
931 //#line 116 "ETCL/ETCL.ll"
933 YY_LEX_DEBUG; break; // Ignore
935 YY_BREAK
936 case 40:
937 YY_RULE_SETUP
938 //#line 119 "ETCL/ETCL.ll"
940 YY_LEX_DEBUG; break; // @@ TODO
942 YY_BREAK
943 case 41:
944 YY_RULE_SETUP
945 //#line 122 "ETCL/ETCL.ll"
946 ETCL_ECHO;
947 YY_BREAK
948 // Fallthrough
949 case YY_STATE_EOF(INITIAL):
950 yyterminate();
952 case YY_END_OF_BUFFER:
954 /* Amount of text matched not including the EOB char. */
955 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
957 /* Undo the effects of YY_DO_BEFORE_ACTION. */
958 *yy_cp = yy_hold_char;
959 YY_RESTORE_YY_MORE_OFFSET
961 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
963 /* We're scanning a new file or input source. It's
964 * possible that this happened because the user
965 * just pointed yyin at a new source and called
966 * yylex(). If so, then we have to assure
967 * consistency between yy_current_buffer and our
968 * globals. Here is the right place to do so, because
969 * this is the first action (other than possibly a
970 * back-up) that will match for the new input source.
972 yy_n_chars = yy_current_buffer->yy_n_chars;
973 yy_current_buffer->yy_input_file = yyin;
974 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
977 /* Note that here we test for yy_c_buf_p "<=" to the position
978 * of the first EOB in the buffer, since yy_c_buf_p will
979 * already have been incremented past the NUL character
980 * (since all states make transitions on EOB to the
981 * end-of-buffer state). Contrast this with the test
982 * in input().
984 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
985 { /* This was really a NUL. */
986 yy_state_type yy_next_state;
988 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
990 yy_current_state = yy_get_previous_state();
992 /* Okay, we're now positioned to make the NUL
993 * transition. We couldn't have
994 * yy_get_previous_state() go ahead and do it
995 * for us because it doesn't know how to deal
996 * with the possibility of jamming (and we don't
997 * want to build jamming into it because then it
998 * will run more slowly).
1001 yy_next_state = yy_try_NUL_trans( yy_current_state );
1003 yy_bp = yytext_ptr + YY_MORE_ADJ;
1005 if ( yy_next_state )
1007 /* Consume the NUL. */
1008 yy_cp = ++yy_c_buf_p;
1009 yy_current_state = yy_next_state;
1010 goto yy_match;
1013 else
1015 yy_cp = yy_c_buf_p;
1016 goto yy_find_action;
1020 else switch ( yy_get_next_buffer() )
1022 case EOB_ACT_END_OF_FILE:
1024 yy_did_buffer_switch_on_eof = 0;
1026 if ( yywrap() )
1028 /* Note: because we've taken care in
1029 * yy_get_next_buffer() to have set up
1030 * yytext, we can now set up
1031 * yy_c_buf_p so that if some total
1032 * hoser (like flex itself) wants to
1033 * call the scanner after we return the
1034 * YY_NULL, it'll still work - another
1035 * YY_NULL will get returned.
1037 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1039 yy_act = YY_STATE_EOF(YY_START);
1040 goto do_action;
1043 else
1045 if ( ! yy_did_buffer_switch_on_eof )
1046 YY_NEW_FILE;
1048 break;
1051 case EOB_ACT_CONTINUE_SCAN:
1052 yy_c_buf_p =
1053 yytext_ptr + yy_amount_of_matched_text;
1055 yy_current_state = yy_get_previous_state();
1057 yy_cp = yy_c_buf_p;
1058 yy_bp = yytext_ptr + YY_MORE_ADJ;
1059 goto yy_match;
1061 case EOB_ACT_LAST_MATCH:
1062 yy_c_buf_p =
1063 &yy_current_buffer->yy_ch_buf[yy_n_chars];
1065 yy_current_state = yy_get_previous_state();
1067 yy_cp = yy_c_buf_p;
1068 yy_bp = yytext_ptr + YY_MORE_ADJ;
1069 goto yy_find_action;
1071 break;
1074 default:
1075 YY_FATAL_ERROR(
1076 "fatal flex scanner internal error--no action found" );
1077 } /* end of action switch */
1078 } /* end of scanning one token */
1079 } /* end of yylex */
1082 /* yy_get_next_buffer - try to read in a new buffer
1084 * Returns a code representing an action:
1085 * EOB_ACT_LAST_MATCH -
1086 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1087 * EOB_ACT_END_OF_FILE - end of file
1090 static int yy_get_next_buffer()
1092 char *dest = yy_current_buffer->yy_ch_buf;
1093 char *source = yytext_ptr;
1094 int number_to_move, i;
1095 int ret_val;
1097 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1098 YY_FATAL_ERROR(
1099 "fatal flex scanner internal error--end of buffer missed" );
1101 if ( yy_current_buffer->yy_fill_buffer == 0 )
1102 { /* Don't try to fill the buffer, so this is an EOF. */
1103 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1105 /* We matched a single character, the EOB, so
1106 * treat this as a final EOF.
1108 return EOB_ACT_END_OF_FILE;
1111 else
1113 /* We matched some text prior to the EOB, first
1114 * process it.
1116 return EOB_ACT_LAST_MATCH;
1120 /* Try to read more data. */
1122 /* First move last chars to start of buffer. */
1123 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1125 for ( i = 0; i < number_to_move; ++i )
1126 *(dest++) = *(source++);
1128 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1129 /* don't do the read, it's not guaranteed to return an EOF,
1130 * just force an EOF
1132 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1134 else
1136 int num_to_read =
1137 yy_current_buffer->yy_buf_size - number_to_move - 1;
1139 while ( num_to_read <= 0 )
1140 { /* Not enough room in the buffer - grow it. */
1141 #ifdef YY_USES_REJECT
1142 YY_FATAL_ERROR(
1143 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1144 #else
1146 /* just a shorter name for the current buffer */
1147 YY_BUFFER_STATE b = yy_current_buffer;
1149 int yy_c_buf_p_offset =
1150 (int) (yy_c_buf_p - b->yy_ch_buf);
1152 if ( b->yy_is_our_buffer )
1154 int new_size = b->yy_buf_size * 2;
1156 if ( new_size <= 0 )
1157 b->yy_buf_size += b->yy_buf_size / 8;
1158 else
1159 b->yy_buf_size *= 2;
1161 b->yy_ch_buf = (char *)
1162 /* Include room in for 2 EOB chars. */
1163 yy_flex_realloc( (void *) b->yy_ch_buf,
1164 b->yy_buf_size + 2 );
1166 else
1167 /* Can't grow it, we don't own it. */
1168 b->yy_ch_buf = 0;
1170 if ( ! b->yy_ch_buf )
1171 YY_FATAL_ERROR(
1172 "fatal error - scanner input buffer overflow" );
1174 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1176 num_to_read = yy_current_buffer->yy_buf_size -
1177 number_to_move - 1;
1178 #endif
1181 if ( num_to_read > YY_READ_BUF_SIZE )
1182 num_to_read = YY_READ_BUF_SIZE;
1184 /* Read in more data. */
1185 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1186 yy_n_chars, num_to_read );
1188 yy_current_buffer->yy_n_chars = yy_n_chars;
1191 if ( yy_n_chars == 0 )
1193 if ( number_to_move == YY_MORE_ADJ )
1195 ret_val = EOB_ACT_END_OF_FILE;
1196 yyrestart( yyin );
1199 else
1201 ret_val = EOB_ACT_LAST_MATCH;
1202 yy_current_buffer->yy_buffer_status =
1203 YY_BUFFER_EOF_PENDING;
1207 else
1208 ret_val = EOB_ACT_CONTINUE_SCAN;
1210 yy_n_chars += number_to_move;
1211 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1212 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1214 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1216 return ret_val;
1220 /* yy_get_previous_state - get the state just before the EOB char was reached */
1222 static yy_state_type yy_get_previous_state()
1224 yy_state_type yy_current_state;
1225 char *yy_cp;
1227 yy_current_state = yy_start;
1229 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1231 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1232 if ( yy_accept[yy_current_state] )
1234 yy_last_accepting_state = yy_current_state;
1235 yy_last_accepting_cpos = yy_cp;
1237 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1239 yy_current_state = (int) yy_def[yy_current_state];
1240 if ( yy_current_state >= 118 )
1241 yy_c = yy_meta[(unsigned int) yy_c];
1243 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1246 return yy_current_state;
1250 /* yy_try_NUL_trans - try to make a transition on the NUL character
1252 * synopsis
1253 * next_state = yy_try_NUL_trans( current_state );
1256 #ifdef YY_USE_PROTOS
1257 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1258 #else
1259 static yy_state_type yy_try_NUL_trans( yy_current_state )
1260 yy_state_type yy_current_state;
1261 #endif
1263 int yy_is_jam;
1264 char *yy_cp = yy_c_buf_p;
1266 YY_CHAR yy_c = 1;
1267 if ( yy_accept[yy_current_state] )
1269 yy_last_accepting_state = yy_current_state;
1270 yy_last_accepting_cpos = yy_cp;
1272 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1274 yy_current_state = (int) yy_def[yy_current_state];
1275 if ( yy_current_state >= 118 )
1276 yy_c = yy_meta[(unsigned int) yy_c];
1278 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1279 yy_is_jam = (yy_current_state == 117);
1281 return yy_is_jam ? 0 : yy_current_state;
1284 #ifndef YY_NO_UNPUT
1285 #ifdef YY_USE_PROTOS
1286 static void yyunput( int c, char *yy_bp )
1287 #else
1288 static void yyunput( c, yy_bp )
1289 int c;
1290 char *yy_bp;
1291 #endif
1293 char *yy_cp = yy_c_buf_p;
1295 /* undo effects of setting up yytext */
1296 *yy_cp = yy_hold_char;
1298 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1299 { /* need to shift things up to make room */
1300 /* +2 for EOB chars. */
1301 int number_to_move = yy_n_chars + 2;
1302 char *dest = &yy_current_buffer->yy_ch_buf[
1303 yy_current_buffer->yy_buf_size + 2];
1304 char *source =
1305 &yy_current_buffer->yy_ch_buf[number_to_move];
1307 while ( source > yy_current_buffer->yy_ch_buf )
1308 *--dest = *--source;
1310 yy_cp += (int) (dest - source);
1311 yy_bp += (int) (dest - source);
1312 yy_current_buffer->yy_n_chars =
1313 yy_n_chars = yy_current_buffer->yy_buf_size;
1315 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1316 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1319 *--yy_cp = (char) c;
1322 yytext_ptr = yy_bp;
1323 yy_hold_char = *yy_cp;
1324 yy_c_buf_p = yy_cp;
1326 #endif /* ifndef YY_NO_UNPUT */
1328 #ifndef YY_NO_INPUT
1329 #ifdef __cplusplus
1330 static int yyinput()
1331 #else
1332 static int input()
1333 #endif
1335 int c;
1337 *yy_c_buf_p = yy_hold_char;
1339 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1341 /* yy_c_buf_p now points to the character we want to return.
1342 * If this occurs *before* the EOB characters, then it's a
1343 * valid NUL; if not, then we've hit the end of the buffer.
1345 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1346 /* This was really a NUL. */
1347 *yy_c_buf_p = '\0';
1349 else
1350 { /* need more input */
1351 int offset = yy_c_buf_p - yytext_ptr;
1352 ++yy_c_buf_p;
1354 switch ( yy_get_next_buffer() )
1356 case EOB_ACT_LAST_MATCH:
1357 /* This happens because yy_g_n_b()
1358 * sees that we've accumulated a
1359 * token and flags that we need to
1360 * try matching the token before
1361 * proceeding. But for input(),
1362 * there's no matching to consider.
1363 * So convert the EOB_ACT_LAST_MATCH
1364 * to EOB_ACT_END_OF_FILE.
1367 /* Reset buffer status. */
1368 yyrestart( yyin );
1370 /* fall through */
1372 case EOB_ACT_END_OF_FILE:
1374 if ( yywrap() )
1375 return EOF;
1377 if ( ! yy_did_buffer_switch_on_eof )
1378 YY_NEW_FILE;
1379 #ifdef __cplusplus
1380 return yyinput();
1381 #else
1382 return input();
1383 #endif
1386 case EOB_ACT_CONTINUE_SCAN:
1387 yy_c_buf_p = yytext_ptr + offset;
1388 break;
1393 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1394 *yy_c_buf_p = '\0'; /* preserve yytext */
1395 yy_hold_char = *++yy_c_buf_p;
1398 return c;
1400 #endif /* YY_NO_INPUT */
1402 void yyflush_current_buffer ()
1404 YY_FLUSH_BUFFER;
1408 #ifdef YY_USE_PROTOS
1409 void yyrestart( FILE *input_file )
1410 #else
1411 void yyrestart( input_file )
1412 FILE *input_file;
1413 #endif
1415 if ( ! yy_current_buffer )
1416 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1418 yy_init_buffer( yy_current_buffer, input_file );
1419 yy_load_buffer_state();
1423 #ifdef YY_USE_PROTOS
1424 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1425 #else
1426 void yy_switch_to_buffer( new_buffer )
1427 YY_BUFFER_STATE new_buffer;
1428 #endif
1430 if ( yy_current_buffer == new_buffer )
1431 return;
1433 if ( yy_current_buffer )
1435 /* Flush out information for old buffer. */
1436 *yy_c_buf_p = yy_hold_char;
1437 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1438 yy_current_buffer->yy_n_chars = yy_n_chars;
1441 yy_current_buffer = new_buffer;
1442 yy_load_buffer_state();
1444 /* We don't actually know whether we did this switch during
1445 * EOF (yywrap()) processing, but the only time this flag
1446 * is looked at is after yywrap() is called, so it's safe
1447 * to go ahead and always set it.
1449 yy_did_buffer_switch_on_eof = 1;
1453 #ifdef YY_USE_PROTOS
1454 void yy_load_buffer_state()
1455 #else
1456 void yy_load_buffer_state()
1457 #endif
1459 yy_n_chars = yy_current_buffer->yy_n_chars;
1460 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1461 yyin = yy_current_buffer->yy_input_file;
1462 yy_hold_char = *yy_c_buf_p;
1466 #ifdef YY_USE_PROTOS
1467 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1468 #else
1469 YY_BUFFER_STATE yy_create_buffer( file, size )
1470 FILE *file;
1471 int size;
1472 #endif
1474 YY_BUFFER_STATE b;
1476 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1477 if ( ! b )
1478 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1480 b->yy_buf_size = size;
1482 /* yy_ch_buf has to be 2 characters longer than the size given because
1483 * we need to put in 2 end-of-buffer characters.
1485 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1486 if ( ! b->yy_ch_buf )
1487 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1489 b->yy_is_our_buffer = 1;
1491 yy_init_buffer( b, file );
1493 return b;
1497 #ifdef YY_USE_PROTOS
1498 void yy_delete_buffer( YY_BUFFER_STATE b )
1499 #else
1500 void yy_delete_buffer( b )
1501 YY_BUFFER_STATE b;
1502 #endif
1504 if ( ! b )
1505 return;
1507 if ( b == yy_current_buffer )
1508 yy_current_buffer = (YY_BUFFER_STATE) 0;
1510 if ( b->yy_is_our_buffer )
1511 yy_flex_free( (void *) b->yy_ch_buf );
1513 yy_flex_free( (void *) b );
1517 #ifdef YY_USE_PROTOS
1518 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1519 #else
1520 void yy_init_buffer( b, file )
1521 YY_BUFFER_STATE b;
1522 FILE *file;
1523 #endif
1527 yy_flush_buffer( b );
1529 b->yy_input_file = file;
1530 b->yy_fill_buffer = 1;
1532 b->yy_is_interactive = file ? (ACE_OS::isatty( ACE_OS::fileno(file) ) > 0) : 0;
1536 #ifdef YY_USE_PROTOS
1537 void yy_flush_buffer( YY_BUFFER_STATE b )
1538 #else
1539 void yy_flush_buffer( b )
1540 YY_BUFFER_STATE b;
1541 #endif
1544 if ( ! b )
1545 return;
1547 b->yy_n_chars = 0;
1549 /* We always need two end-of-buffer characters. The first causes
1550 * a transition to the end-of-buffer state. The second causes
1551 * a jam in that state.
1553 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1554 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1556 b->yy_buf_pos = &b->yy_ch_buf[0];
1558 b->yy_at_bol = 1;
1559 b->yy_buffer_status = YY_BUFFER_NEW;
1561 if ( b == yy_current_buffer )
1562 yy_load_buffer_state();
1566 #ifndef YY_NO_SCAN_BUFFER
1567 #ifdef YY_USE_PROTOS
1568 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1569 #else
1570 YY_BUFFER_STATE yy_scan_buffer( base, size )
1571 char *base;
1572 yy_size_t size;
1573 #endif
1575 YY_BUFFER_STATE b;
1577 if ( size < 2 ||
1578 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1579 base[size-1] != YY_END_OF_BUFFER_CHAR )
1580 /* They forgot to leave room for the EOB's. */
1581 return 0;
1583 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1584 if ( ! b )
1585 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1587 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1588 b->yy_buf_pos = b->yy_ch_buf = base;
1589 b->yy_is_our_buffer = 0;
1590 b->yy_input_file = 0;
1591 b->yy_n_chars = b->yy_buf_size;
1592 b->yy_is_interactive = 0;
1593 b->yy_at_bol = 1;
1594 b->yy_fill_buffer = 0;
1595 b->yy_buffer_status = YY_BUFFER_NEW;
1597 yy_switch_to_buffer( b );
1599 return b;
1601 #endif
1604 #ifndef YY_NO_SCAN_STRING
1605 #ifdef YY_USE_PROTOS
1606 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1607 #else
1608 YY_BUFFER_STATE yy_scan_string( yy_str )
1609 yyconst char *yy_str;
1610 #endif
1612 int len;
1613 for ( len = 0; yy_str[len]; ++len )
1616 return yy_scan_bytes( yy_str, len );
1618 #endif
1621 #ifndef YY_NO_SCAN_BYTES
1622 #ifdef YY_USE_PROTOS
1623 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1624 #else
1625 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1626 yyconst char *bytes;
1627 int len;
1628 #endif
1630 YY_BUFFER_STATE b;
1631 char *buf;
1632 yy_size_t n;
1633 int i;
1635 /* Get memory for full buffer, including space for trailing EOB's. */
1636 n = len + 2;
1637 buf = (char *) yy_flex_alloc( n );
1638 if ( ! buf )
1639 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1641 for ( i = 0; i < len; ++i )
1642 buf[i] = bytes[i];
1644 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1646 b = yy_scan_buffer( buf, n );
1647 if ( ! b )
1648 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1650 /* It's okay to grow etc. this buffer, and we should throw it
1651 * away when we're done.
1653 b->yy_is_our_buffer = 1;
1655 return b;
1657 #endif
1660 #ifndef YY_NO_PUSH_STATE
1661 #ifdef YY_USE_PROTOS
1662 static void yy_push_state( int new_state )
1663 #else
1664 static void yy_push_state( new_state )
1665 int new_state;
1666 #endif
1668 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1670 yy_size_t new_size;
1672 yy_start_stack_depth += YY_START_STACK_INCR;
1673 new_size = yy_start_stack_depth * sizeof( int );
1675 if ( ! yy_start_stack )
1676 yy_start_stack = (int *) yy_flex_alloc( new_size );
1678 else
1679 yy_start_stack = (int *) yy_flex_realloc(
1680 (void *) yy_start_stack, new_size );
1682 if ( ! yy_start_stack )
1683 YY_FATAL_ERROR(
1684 "out of memory expanding start-condition stack" );
1687 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1689 BEGIN(new_state);
1691 #endif
1694 #ifndef YY_NO_POP_STATE
1695 static void yy_pop_state()
1697 if ( --yy_start_stack_ptr < 0 )
1698 YY_FATAL_ERROR( "start-condition stack underflow" );
1700 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1702 #endif
1705 #ifndef YY_NO_TOP_STATE
1706 static int yy_top_state()
1708 return yy_start_stack[yy_start_stack_ptr - 1];
1710 #endif
1712 #ifndef YY_EXIT_FAILURE
1713 #define YY_EXIT_FAILURE 2
1714 #endif
1716 #ifdef YY_USE_PROTOS
1717 static void yy_fatal_error( yyconst char msg[] )
1718 #else
1719 static void yy_fatal_error( msg )
1720 char msg[];
1721 #endif
1723 (void) ACE_OS::fprintf( stderr, "%s\n", msg );
1724 ACE_OS::exit( YY_EXIT_FAILURE );
1728 /* Redefine yyless() so it works in section 3 code. */
1730 #undef yyless
1731 #define yyless(n) \
1732 do \
1734 /* Undo effects of setting up yytext. */ \
1735 yytext[yyleng] = yy_hold_char; \
1736 yy_c_buf_p = yytext + n; \
1737 yy_hold_char = *yy_c_buf_p; \
1738 *yy_c_buf_p = '\0'; \
1739 yyleng = n; \
1741 while ( 0 )
1744 /* Internal utility routines. */
1746 #ifndef yytext_ptr
1747 #ifdef YY_USE_PROTOS
1748 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1749 #else
1750 static void yy_flex_strncpy( s1, s2, n )
1751 char *s1;
1752 yyconst char *s2;
1753 int n;
1754 #endif
1756 int i;
1757 for ( i = 0; i < n; ++i )
1758 s1[i] = s2[i];
1760 #endif
1762 #ifdef YY_NEED_STRLEN
1763 #ifdef YY_USE_PROTOS
1764 static int yy_flex_strlen( yyconst char *s )
1765 #else
1766 static int yy_flex_strlen( s )
1767 yyconst char *s;
1768 #endif
1770 int n;
1771 for ( n = 0; s[n]; ++n )
1774 return n;
1776 #endif
1779 #ifdef YY_USE_PROTOS
1780 static void *yy_flex_alloc( yy_size_t size )
1781 #else
1782 static void *yy_flex_alloc( size )
1783 yy_size_t size;
1784 #endif
1786 return (void *) ACE_OS::malloc( size );
1789 #ifdef YY_USE_PROTOS
1790 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1791 #else
1792 static void *yy_flex_realloc( ptr, size )
1793 void *ptr;
1794 yy_size_t size;
1795 #endif
1797 /* The cast to (char *) in the following accommodates both
1798 * implementations that use char* generic pointers, and those
1799 * that use void* generic pointers. It works with the latter
1800 * because both ANSI C and C++ allow castless assignment from
1801 * any pointer type to void*, and deal with argument conversions
1802 * as though doing an assignment.
1804 return (void *) ACE_OS::realloc( (char *) ptr, size );
1807 #ifdef YY_USE_PROTOS
1808 static void yy_flex_free( void *ptr )
1809 #else
1810 static void yy_flex_free( ptr )
1811 void *ptr;
1812 #endif
1814 ACE_OS::free( ptr );
1817 #if YY_MAIN
1818 int main()
1820 yylex();
1821 return 0;
1823 #endif
1824 //#line 122 "ETCL/ETCL.ll"
1827 const char*
1828 extract_string(char* str)
1830 char *t = str;
1831 for (char * i = str + 1; *i != '\''; ++i, ++t)
1833 if (*i == '\\')
1835 ++i;
1836 if (*i == 0)
1837 return 0;
1838 else if (*i == 't')
1839 *t = '\t';
1840 else if (*i == 'n')
1841 *t = '\n';
1842 else if (*i == '\\')
1843 *t = '\\';
1844 else
1845 *t = *i;
1846 continue;
1849 *t = *i;
1852 *t = '\0';
1853 return str;
1857 yywrap ()
1859 return 1;
1862 ACE_END_VERSIONED_NAMESPACE_DECL