summaryrefslogtreecommitdiff
path: root/trunk/TAO/orbsvcs/orbsvcs/ETCL/ETCL_l.cpp.diff
blob: 9709c130de2ac2ec72791be4de70770f44ff3c90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
--- bison_gen\ETCL_l.cpp	2005-07-19 10:09:28.523824100 -0700
+++ ETCL_l.cpp	2005-07-19 09:47:22.138585300 -0700
@@ -1,15 +1,14 @@
+
 /* A lexical scanner generated by flex */
 
 /* Scanner skeleton version:
- * $Header$
+ * $Id$
  */
 
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
 
-#include <stdio.h>
-
 
 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
 #ifdef c_plusplus
@@ -21,8 +20,7 @@
 
 #ifdef __cplusplus
 
-#include <stdlib.h>
-#include <unistd.h>
+#include "ace/OS.h"
 
 /* Use prototypes in function declarations. */
 #define YY_USE_PROTOS
@@ -262,8 +260,8 @@
 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
 
 
-#define yywrap() 1
-#define YY_SKIP_YYWRAP
+//#define yywrap() 1
+//#define YY_SKIP_YYWRAP
 typedef unsigned char YY_CHAR;
 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
 typedef int yy_state_type;
@@ -444,15 +442,15 @@
 #define YY_MORE_ADJ 0
 #define YY_RESTORE_YY_MORE_OFFSET
 char *yytext;
-#line 1 "ETCL.ll"
+//#line 1 "ETCL/ETCL.ll"
 #define INITIAL 0
-#line 4 "ETCL.ll"
+//#line 4 "ETCL/ETCL.ll"
 // $Id$
 // ========================================================================
 //
 // = LIBRARY
 //   orbsvcs/ECTL
-// 
+//
 // = FILENAME
 //   ETCL.ll
 //
@@ -462,12 +460,12 @@
 //
 // ========================================================================
 
-#include "ace/OS.h"
-
+#include "ETCL_Interpreter.h"
 #include "ETCL_Constraint.h"
 #include "ETCL_y.h"
 
-static const char * extract_string(char*);
+static const char* extract_string(char*);
+//static const char * extract_string(char*);
 
 #define TAO_YY_LEX_DEBUG
 
@@ -475,12 +473,11 @@
 #define TAO_YY_LEX_DEBUG TAO_OS::fprintf(stderr, "%s\n", yytext)
 #endif /* TAO_CONSTRAINT_DEBUG */
 
-#define YY_DECL int TAO_ETCL_yylex (TAO_ETCL_YYSTYPE *lvalp, void* state)
+//#define YY_DECL int TAO_ETCL_yylex (TAO_ETCL_YYSTYPE *lvalp, void* state)
 
 #define YY_BREAK
 #define YY_NO_UNPUT
 
-#line 484 "lex.yy.c"
 
 /* Macros after this point can all be overridden by user definitions in
  * section 1.
@@ -494,10 +491,6 @@
 #endif
 #endif
 
-#ifndef YY_NO_UNPUT
-static void yyunput YY_PROTO(( int c, char *buf_ptr ));
-#endif
-
 #ifndef yytext_ptr
 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
 #endif
@@ -556,11 +549,11 @@
 
 /* Copy whatever the last rule matched to the standard output. */
 
-#ifndef ECHO
+#ifndef TAO_ETCL_ECHO
 /* This used to be an fputs(), but since the string might contain NUL's,
  * we now use fwrite().
  */
-#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+#define TAO_ETCL_ECHO (void) fwrite( yytext, yyleng, 1, yyout )
 #endif
 
 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
@@ -628,13 +621,11 @@
 YY_DECL
 	{
 	register yy_state_type yy_current_state;
-	register char *yy_cp, *yy_bp;
+	register char *yy_cp = 0;
+  register char *yy_bp = 0;
 	register int yy_act;
 
-#line 50 "ETCL.ll"
-
-
-#line 638 "lex.yy.c"
+//#line 50 "ETCL/ETCL.ll"
 
 	if ( yy_init )
 		{
@@ -719,240 +710,239 @@
 
 case 1:
 YY_RULE_SETUP
-#line 52 "ETCL.ll"
+//#line 52 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_MIN; }
 	YY_BREAK
 case 2:
 YY_RULE_SETUP
-#line 53 "ETCL.ll"
+//#line 53 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_MAX; }
 	YY_BREAK
 case 3:
 YY_RULE_SETUP
-#line 54 "ETCL.ll"
+//#line 54 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_FIRST; }
 	YY_BREAK
 case 4:
 YY_RULE_SETUP
-#line 55 "ETCL.ll"
+//#line 55 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_RANDOM; }
 	YY_BREAK
 case 5:
 YY_RULE_SETUP
-#line 56 "ETCL.ll"
+//#line 56 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_WITH; }
 	YY_BREAK
 case 6:
 YY_RULE_SETUP
-#line 57 "ETCL.ll"
+//#line 57 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_EXIST; }
 	YY_BREAK
 case 7:
 YY_RULE_SETUP
-#line 58 "ETCL.ll"
+//#line 58 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_NOT; }
 	YY_BREAK
 case 8:
 YY_RULE_SETUP
-#line 59 "ETCL.ll"
+//#line 59 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_AND; }
 	YY_BREAK
 case 9:
 YY_RULE_SETUP
-#line 60 "ETCL.ll"
+//#line 60 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_OR; }
 	YY_BREAK
 case 10:
 YY_RULE_SETUP
-#line 61 "ETCL.ll"
+//#line 61 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_IN; }
 	YY_BREAK
 case 11:
 YY_RULE_SETUP
-#line 62 "ETCL.ll"
+//#line 62 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_TWIDDLE; }
 	YY_BREAK
 case 12:
 YY_RULE_SETUP
-#line 63 "ETCL.ll"
+//#line 63 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_PLUS; }
 	YY_BREAK
 case 13:
 YY_RULE_SETUP
-#line 64 "ETCL.ll"
+//#line 64 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_MINUS; }
 	YY_BREAK
 case 14:
 YY_RULE_SETUP
-#line 65 "ETCL.ll"
+//#line 65 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_MULT; }
 	YY_BREAK
 case 15:
 YY_RULE_SETUP
-#line 66 "ETCL.ll"
+//#line 66 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_DIV; }
 	YY_BREAK
 case 16:
 YY_RULE_SETUP
-#line 67 "ETCL.ll"
+//#line 67 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_LT; }
 	YY_BREAK
 case 17:
 YY_RULE_SETUP
-#line 68 "ETCL.ll"
+//#line 68 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_LE; }
 	YY_BREAK
 case 18:
 YY_RULE_SETUP
-#line 69 "ETCL.ll"
+//#line 69 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_GT; }
 	YY_BREAK
 case 19:
 YY_RULE_SETUP
-#line 70 "ETCL.ll"
+//#line 70 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_GE; }
 	YY_BREAK
 case 20:
 YY_RULE_SETUP
-#line 71 "ETCL.ll"
+//#line 71 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_EQ; }
 	YY_BREAK
 case 21:
 YY_RULE_SETUP
-#line 72 "ETCL.ll"
+//#line 72 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_NE; }
 	YY_BREAK
 case 22:
 YY_RULE_SETUP
-#line 73 "ETCL.ll"
+//#line 73 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_LPAREN; }
 	YY_BREAK
 case 23:
 YY_RULE_SETUP
-#line 74 "ETCL.ll"
+//#line 74 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_RPAREN; }
 	YY_BREAK
 case 24:
 YY_RULE_SETUP
-#line 75 "ETCL.ll"
+//#line 75 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_DOLLAR; }
 	YY_BREAK
 case 25:
 YY_RULE_SETUP
-#line 76 "ETCL.ll"
+//#line 76 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_DOT; }
 	YY_BREAK
 case 26:
 YY_RULE_SETUP
-#line 77 "ETCL.ll"
+//#line 77 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_DEFAULT; }
 	YY_BREAK
 case 27:
 YY_RULE_SETUP
-#line 78 "ETCL.ll"
+//#line 78 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_DISCRIMINANT; }
 	YY_BREAK
 case 28:
 YY_RULE_SETUP
-#line 79 "ETCL.ll"
+//#line 79 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_TYPE_ID; }
 	YY_BREAK
 case 29:
 YY_RULE_SETUP
-#line 80 "ETCL.ll"
+//#line 80 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_REPOS_ID; }
 	YY_BREAK
 case 30:
 YY_RULE_SETUP
-#line 81 "ETCL.ll"
+//#line 81 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_LENGTH; }
 	YY_BREAK
 case 31:
 YY_RULE_SETUP
-#line 82 "ETCL.ll"
+//#line 82 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_LBRA; }
 	YY_BREAK
 case 32:
 YY_RULE_SETUP
-#line 83 "ETCL.ll"
+//#line 83 "ETCL/ETCL.ll"
 { TAO_YY_LEX_DEBUG; return TAO_ETCL_RBRA; }
 	YY_BREAK
 case 33:
 YY_RULE_SETUP
-#line 84 "ETCL.ll"
-{ 
-		  lvalp->constraint = 
+//#line 84 "ETCL/ETCL.ll"
+{
+		  yylval.constraint =
 		    new TAO_ETCL_Literal_Constraint ((CORBA::Boolean) 1);
 		  TAO_YY_LEX_DEBUG; return TAO_ETCL_BOOLEAN;
 		}
 	YY_BREAK
 case 34:
 YY_RULE_SETUP
-#line 89 "ETCL.ll"
-{ 
-		  lvalp->constraint = 
+//#line 89 "ETCL/ETCL.ll"
+{
+		  yylval.constraint =
 		    new TAO_ETCL_Literal_Constraint ((CORBA::Boolean) 0);
 		  TAO_YY_LEX_DEBUG; return TAO_ETCL_BOOLEAN;
 		}
 	YY_BREAK
 case 35:
 YY_RULE_SETUP
-#line 94 "ETCL.ll"
-{ 
-		  lvalp->constraint = 
+//#line 94 "ETCL/ETCL.ll"
+{
+		  yylval.constraint =
 		    new TAO_ETCL_Literal_Constraint (ACE_OS::atoi (yytext));
-		  TAO_YY_LEX_DEBUG; return TAO_ETCL_INTEGER; 
+		  TAO_YY_LEX_DEBUG; return TAO_ETCL_INTEGER;
 		}
 	YY_BREAK
 case 36:
 YY_RULE_SETUP
-#line 99 "ETCL.ll"
+//#line 99 "ETCL/ETCL.ll"
 {
 		  double v;
-		  sscanf (yytext, "%lf", &v); 
-		  lvalp->constraint = 
+		  sscanf (yytext, "%lf", &v);
+		  yylval.constraint =
 		    new TAO_ETCL_Literal_Constraint (v);
-		  TAO_YY_LEX_DEBUG; return TAO_ETCL_FLOAT; 
+		  TAO_YY_LEX_DEBUG; return TAO_ETCL_FLOAT;
 		}
 	YY_BREAK
 case 37:
 YY_RULE_SETUP
-#line 106 "ETCL.ll"
-{ 
-		  lvalp->constraint =
-		    new TAO_ETCL_Literal_Constraint (extract_string (yytext));
-		  TAO_YY_LEX_DEBUG; return TAO_ETCL_STRING; 
+//#line 106 "ETCL/ETCL.ll"
+{
+		  yylval.constraint =
+		    new TAO_ETCL_Literal_Constraint (extract_string(yytext));
+		  TAO_YY_LEX_DEBUG; return TAO_ETCL_STRING;
 		}
 	YY_BREAK
 case 38:
 YY_RULE_SETUP
-#line 111 "ETCL.ll"
-{ 
-		  lvalp->constraint = 
+//#line 111 "ETCL/ETCL.ll"
+{
+		  yylval.constraint =
 		    new TAO_ETCL_Identifier (yytext);
-		  TAO_YY_LEX_DEBUG; return TAO_ETCL_IDENT; 
+		  TAO_YY_LEX_DEBUG; return TAO_ETCL_IDENT;
 		}
 	YY_BREAK
 case 39:
 YY_RULE_SETUP
-#line 116 "ETCL.ll"
-{ 
+//#line 116 "ETCL/ETCL.ll"
+{
                   TAO_YY_LEX_DEBUG; break; // Ignore
                 }
 	YY_BREAK
 case 40:
 YY_RULE_SETUP
-#line 119 "ETCL.ll"
-{ 
+//#line 119 "ETCL/ETCL.ll"
+{
                   TAO_YY_LEX_DEBUG; break; // @@ TODO
                 }
 	YY_BREAK
 case 41:
 YY_RULE_SETUP
-#line 122 "ETCL.ll"
-ECHO;
+//#line 122 "ETCL/ETCL.ll"
+TAO_ETCL_ECHO;
 	YY_BREAK
-#line 956 "lex.yy.c"
 case YY_STATE_EOF(INITIAL):
 	yyterminate();
 
@@ -1288,7 +1278,7 @@
 	return yy_is_jam ? 0 : yy_current_state;
 	}
 
-
+#if 0
 #ifndef YY_NO_UNPUT
 #ifdef YY_USE_PROTOS
 static void yyunput( int c, register char *yy_bp )
@@ -1332,7 +1322,7 @@
 	yy_c_buf_p = yy_cp;
 	}
 #endif	/* ifndef YY_NO_UNPUT */
-
+#endif /* 0 */
 
 #ifdef __cplusplus
 static int yyinput()
@@ -1406,6 +1396,11 @@
 	return c;
 	}
 
+void yyflush_current_buffer (void)
+{
+	YY_FLUSH_BUFFER;
+}
+
 
 #ifdef YY_USE_PROTOS
 void yyrestart( FILE *input_file )
@@ -1516,11 +1511,6 @@
 	}
 
 
-#ifndef YY_ALWAYS_INTERACTIVE
-#ifndef YY_NEVER_INTERACTIVE
-extern int isatty YY_PROTO(( int ));
-#endif
-#endif
 
 #ifdef YY_USE_PROTOS
 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
@@ -1537,15 +1527,18 @@
 	b->yy_input_file = file;
 	b->yy_fill_buffer = 1;
 
-#if YY_ALWAYS_INTERACTIVE
-	b->yy_is_interactive = 1;
-#else
-#if YY_NEVER_INTERACTIVE
-	b->yy_is_interactive = 0;
+#if defined (ACE_HAS_WINCE)
+    // Mimic the behavior as WinCE does not have isatty().
+    if ((file != 0) && (file == fileno(file))) {
+        b->yy_is_interactive = 1;
+    }
+    else {
+        b->yy_is_interactive = 0;
+    }
 #else
 	b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-#endif
-#endif
+#endif  // ACE_HAS_WINCE
+
 	}
 
 
@@ -1838,7 +1831,7 @@
 	return 0;
 	}
 #endif
-#line 122 "ETCL.ll"
+//#line 122 "ETCL/ETCL.ll"
 
 
 const char*