1 --- bison_gen\ETCL_l.cpp 2005-07-19 10:09:28.523824100 -0700
2 +++ ETCL_l.cpp 2005-07-19 09:47:22.138585300 -0700
5 /* A lexical scanner generated by flex */
7 /* Scanner skeleton version:
12 #define YY_FLEX_MAJOR_VERSION 2
13 #define YY_FLEX_MINOR_VERSION 5
18 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
26 +#include "ace/OS_NS_unistd.h"
27 +#include "ace/OS_NS_stdio.h"
29 /* Use prototypes in function declarations. */
32 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
36 -#define YY_SKIP_YYWRAP
38 +//#define YY_SKIP_YYWRAP
39 typedef unsigned char YY_CHAR;
40 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
41 typedef int yy_state_type;
44 #define YY_RESTORE_YY_MORE_OFFSET
47 +//#line 1 "ETCL/ETCL.ll"
50 +//#line 4 "ETCL/ETCL.ll"
51 // ========================================================================
62 // ========================================================================
66 +#include "ETCL_Interpreter.h"
67 #include "ETCL_Constraint.h"
70 -static const char * extract_string(char*);
71 +static const char* extract_string(char*);
72 +//static const char * extract_string(char*);
74 #define TAO_YY_LEX_DEBUG
77 #define TAO_YY_LEX_DEBUG TAO_OS::fprintf(stderr, "%s\n", yytext)
78 #endif /* TAO_CONSTRAINT_DEBUG */
80 -#define YY_DECL int TAO_ETCL_yylex (TAO_ETCL_YYSTYPE *lvalp, void* state)
81 +//#define YY_DECL int TAO_ETCL_yylex (TAO_ETCL_YYSTYPE *lvalp, void* state)
88 /* Macros after this point can all be overridden by user definitions in
95 -static void yyunput YY_PROTO(( int c, char *buf_ptr ));
99 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
101 @@ -556,11 +549,11 @@
103 /* Copy whatever the last rule matched to the standard output. */
106 +#ifndef TAO_ETCL_ECHO
107 /* This used to be an fputs(), but since the string might contain NUL's,
108 * we now use fwrite().
110 -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
111 +#define TAO_ETCL_ECHO (void) fwrite( yytext, yyleng, 1, yyout )
114 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
115 @@ -628,13 +621,11 @@
118 ACE_REGISTER yy_state_type yy_current_state;
119 - ACE_REGISTER char *yy_cp, *yy_bp;
120 + ACE_REGISTER char *yy_cp = 0;
121 + ACE_REGISTER char *yy_bp = 0;
122 ACE_REGISTER int yy_act;
127 -#line 638 "lex.yy.c"
128 +//#line 50 "ETCL/ETCL.ll"
132 @@ -719,240 +710,239 @@
137 +//#line 52 "ETCL/ETCL.ll"
138 { TAO_YY_LEX_DEBUG; return TAO_ETCL_MIN; }
143 +//#line 53 "ETCL/ETCL.ll"
144 { TAO_YY_LEX_DEBUG; return TAO_ETCL_MAX; }
149 +//#line 54 "ETCL/ETCL.ll"
150 { TAO_YY_LEX_DEBUG; return TAO_ETCL_FIRST; }
155 +//#line 55 "ETCL/ETCL.ll"
156 { TAO_YY_LEX_DEBUG; return TAO_ETCL_RANDOM; }
161 +//#line 56 "ETCL/ETCL.ll"
162 { TAO_YY_LEX_DEBUG; return TAO_ETCL_WITH; }
167 +//#line 57 "ETCL/ETCL.ll"
168 { TAO_YY_LEX_DEBUG; return TAO_ETCL_EXIST; }
173 +//#line 58 "ETCL/ETCL.ll"
174 { TAO_YY_LEX_DEBUG; return TAO_ETCL_NOT; }
179 +//#line 59 "ETCL/ETCL.ll"
180 { TAO_YY_LEX_DEBUG; return TAO_ETCL_AND; }
185 +//#line 60 "ETCL/ETCL.ll"
186 { TAO_YY_LEX_DEBUG; return TAO_ETCL_OR; }
191 +//#line 61 "ETCL/ETCL.ll"
192 { TAO_YY_LEX_DEBUG; return TAO_ETCL_IN; }
197 +//#line 62 "ETCL/ETCL.ll"
198 { TAO_YY_LEX_DEBUG; return TAO_ETCL_TWIDDLE; }
203 +//#line 63 "ETCL/ETCL.ll"
204 { TAO_YY_LEX_DEBUG; return TAO_ETCL_PLUS; }
209 +//#line 64 "ETCL/ETCL.ll"
210 { TAO_YY_LEX_DEBUG; return TAO_ETCL_MINUS; }
215 +//#line 65 "ETCL/ETCL.ll"
216 { TAO_YY_LEX_DEBUG; return TAO_ETCL_MULT; }
221 +//#line 66 "ETCL/ETCL.ll"
222 { TAO_YY_LEX_DEBUG; return TAO_ETCL_DIV; }
227 +//#line 67 "ETCL/ETCL.ll"
228 { TAO_YY_LEX_DEBUG; return TAO_ETCL_LT; }
233 +//#line 68 "ETCL/ETCL.ll"
234 { TAO_YY_LEX_DEBUG; return TAO_ETCL_LE; }
239 +//#line 69 "ETCL/ETCL.ll"
240 { TAO_YY_LEX_DEBUG; return TAO_ETCL_GT; }
245 +//#line 70 "ETCL/ETCL.ll"
246 { TAO_YY_LEX_DEBUG; return TAO_ETCL_GE; }
251 +//#line 71 "ETCL/ETCL.ll"
252 { TAO_YY_LEX_DEBUG; return TAO_ETCL_EQ; }
257 +//#line 72 "ETCL/ETCL.ll"
258 { TAO_YY_LEX_DEBUG; return TAO_ETCL_NE; }
263 +//#line 73 "ETCL/ETCL.ll"
264 { TAO_YY_LEX_DEBUG; return TAO_ETCL_LPAREN; }
269 +//#line 74 "ETCL/ETCL.ll"
270 { TAO_YY_LEX_DEBUG; return TAO_ETCL_RPAREN; }
275 +//#line 75 "ETCL/ETCL.ll"
276 { TAO_YY_LEX_DEBUG; return TAO_ETCL_DOLLAR; }
281 +//#line 76 "ETCL/ETCL.ll"
282 { TAO_YY_LEX_DEBUG; return TAO_ETCL_DOT; }
287 +//#line 77 "ETCL/ETCL.ll"
288 { TAO_YY_LEX_DEBUG; return TAO_ETCL_DEFAULT; }
293 +//#line 78 "ETCL/ETCL.ll"
294 { TAO_YY_LEX_DEBUG; return TAO_ETCL_DISCRIMINANT; }
299 +//#line 79 "ETCL/ETCL.ll"
300 { TAO_YY_LEX_DEBUG; return TAO_ETCL_TYPE_ID; }
305 +//#line 80 "ETCL/ETCL.ll"
306 { TAO_YY_LEX_DEBUG; return TAO_ETCL_REPOS_ID; }
311 +//#line 81 "ETCL/ETCL.ll"
312 { TAO_YY_LEX_DEBUG; return TAO_ETCL_LENGTH; }
317 +//#line 82 "ETCL/ETCL.ll"
318 { TAO_YY_LEX_DEBUG; return TAO_ETCL_LBRA; }
323 +//#line 83 "ETCL/ETCL.ll"
324 { TAO_YY_LEX_DEBUG; return TAO_ETCL_RBRA; }
330 - lvalp->constraint =
331 +//#line 84 "ETCL/ETCL.ll"
333 + yylval.constraint =
334 new TAO_ETCL_Literal_Constraint ((CORBA::Boolean) 1);
335 TAO_YY_LEX_DEBUG; return TAO_ETCL_BOOLEAN;
342 - lvalp->constraint =
343 +//#line 89 "ETCL/ETCL.ll"
345 + yylval.constraint =
346 new TAO_ETCL_Literal_Constraint ((CORBA::Boolean) 0);
347 TAO_YY_LEX_DEBUG; return TAO_ETCL_BOOLEAN;
354 - lvalp->constraint =
355 +//#line 94 "ETCL/ETCL.ll"
357 + yylval.constraint =
358 new TAO_ETCL_Literal_Constraint (ACE_OS::atoi (yytext));
359 - TAO_YY_LEX_DEBUG; return TAO_ETCL_INTEGER;
360 + TAO_YY_LEX_DEBUG; return TAO_ETCL_INTEGER;
366 +//#line 99 "ETCL/ETCL.ll"
369 - sscanf (yytext, "%lf", &v);
370 - lvalp->constraint =
371 + sscanf (yytext, "%lf", &v);
372 + yylval.constraint =
373 new TAO_ETCL_Literal_Constraint (v);
374 - TAO_YY_LEX_DEBUG; return TAO_ETCL_FLOAT;
375 + TAO_YY_LEX_DEBUG; return TAO_ETCL_FLOAT;
382 - lvalp->constraint =
383 - new TAO_ETCL_Literal_Constraint (extract_string (yytext));
384 - TAO_YY_LEX_DEBUG; return TAO_ETCL_STRING;
385 +//#line 106 "ETCL/ETCL.ll"
387 + yylval.constraint =
388 + new TAO_ETCL_Literal_Constraint (extract_string(yytext));
389 + TAO_YY_LEX_DEBUG; return TAO_ETCL_STRING;
396 - lvalp->constraint =
397 +//#line 111 "ETCL/ETCL.ll"
399 + yylval.constraint =
400 new TAO_ETCL_Identifier (yytext);
401 - TAO_YY_LEX_DEBUG; return TAO_ETCL_IDENT;
402 + TAO_YY_LEX_DEBUG; return TAO_ETCL_IDENT;
409 +//#line 116 "ETCL/ETCL.ll"
411 TAO_YY_LEX_DEBUG; break; // Ignore
418 +//#line 119 "ETCL/ETCL.ll"
420 TAO_YY_LEX_DEBUG; break; // @@ TODO
427 +//#line 122 "ETCL/ETCL.ll"
430 -#line 956 "lex.yy.c"
431 case YY_STATE_EOF(INITIAL):
434 @@ -1288,7 +1278,7 @@
435 return yy_is_jam ? 0 : yy_current_state;
442 static void yyunput( int c, ACE_REGISTER char *yy_bp )
443 @@ -1332,7 +1322,7 @@
446 #endif /* ifndef YY_NO_UNPUT */
452 @@ -1406,6 +1396,11 @@
456 +void yyflush_current_buffer (void)
463 void yyrestart( FILE *input_file )
464 @@ -1516,11 +1511,6 @@
468 -#ifndef YY_ALWAYS_INTERACTIVE
469 -#ifndef YY_NEVER_INTERACTIVE
470 -extern int isatty YY_PROTO(( int ));
475 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
476 @@ -1537,15 +1527,18 @@
477 b->yy_input_file = file;
478 b->yy_fill_buffer = 1;
480 -#if YY_ALWAYS_INTERACTIVE
481 - b->yy_is_interactive = 1;
483 -#if YY_NEVER_INTERACTIVE
484 - b->yy_is_interactive = 0;
485 +#if defined (ACE_HAS_WINCE)
486 + // Mimic the behavior as WinCE does not have isatty().
487 + if ((file != 0) && (file == ACE_OS::fileno(file))) {
488 + b->yy_is_interactive = 1;
491 + b->yy_is_interactive = 0;
494 b->yy_is_interactive = file ? (ACE_OS::isatty( ACE_OS::fileno(file) ) > 0) : 0;
497 +#endif // ACE_HAS_WINCE
502 @@ -1838,7 +1831,7 @@
507 +//#line 122 "ETCL/ETCL.ll"