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
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
|
#ifndef lint
char ace_yysccsid[] = "@(#)yaccpar 1.4 (Berkeley) 02/25/90 \n\
Modified 5/2/90 by J. Roskind to support graphic debugging modes";
#endif
#line 2 "Svc_Conf.y"
/* $Id$*/
#include "ace/ARGV.h"
#include "ace/Svc_Conf.h"
#include "ace/Module.h"
#include "ace/Stream.h"
ACE_RCSID(ace, Svc_Conf_y, "$Id$")
/* Prototypes.*/
static ACE_Module_Type *ace_get_module (ACE_Static_Node *str_rec,
ACE_Static_Node *svc_type);
static ACE_Module_Type *ace_get_module (ACE_Static_Node *str_rec,
const ASYS_TCHAR *svc_name);
#define ACE_YYDEBUG_LEXER_TEXT (ace_yytext[ace_yyleng] = '\0', ace_yytext)
/* Force the pretty debugging code to compile.*/
/* #define ACE_YYDEBUG 1*/
/* Efficient memory allocation technique.*/
ACE_Obstack *ace_obstack;
#line 30 "Svc_Conf_y.cpp"
#define ACE_DYNAMIC 257
#define ACE_STATIC 258
#define ACE_SUSPEND 259
#define ACE_RESUME 260
#define ACE_REMOVE 261
#define ACE_USTREAM 262
#define ACE_MODULE_T 263
#define ACE_STREAM_T 264
#define ACE_SVC_OBJ_T 265
#define ACE_ACTIVE 266
#define ACE_INACTIVE 267
#define ACE_PATHNAME 268
#define ACE_IDENT 269
#define ACE_STRING 270
#define ACE_LPAREN 271
#define ACE_RPAREN 272
#define ACE_LBRACE 273
#define ACE_RBRACE 274
#define ACE_STAR 275
#define ACE_COLON 276
#define ACE_YYERRCODE 256
short ace_yylhs[] = { -1,
0, 0, 0, 14, 14, 14, 14, 14, 14, 5,
6, 7, 8, 9, 11, 18, 11, 15, 15, 19,
12, 12, 10, 10, 13, 13, 13, 13, 13, 16,
4, 4, 4, 17, 17, 17, 3, 3, 3, 2,
2, 1, 1,
};
short ace_yylen[] = { 2,
2, 2, 0, 1, 1, 1, 1, 1, 1, 3,
3, 2, 2, 2, 3, 0, 4, 1, 1, 0,
4, 0, 2, 0, 1, 1, 1, 1, 1, 4,
1, 1, 0, 3, 5, 4, 2, 2, 2, 1,
0, 1, 1,
};
short ace_yydefred[] = { 3,
0, 2, 0, 0, 0, 0, 0, 0, 4, 5,
6, 7, 8, 9, 1, 0, 0, 0, 12, 13,
14, 16, 18, 19, 0, 0, 0, 0, 0, 40,
10, 11, 0, 20, 15, 37, 39, 38, 42, 43,
0, 0, 0, 17, 24, 0, 0, 31, 32, 30,
0, 0, 0, 21, 25, 26, 27, 28, 29, 23,
36, 0, 35,
};
short ace_yydgoto[] = { 1,
42, 31, 29, 50, 9, 10, 11, 12, 13, 51,
14, 35, 60, 15, 25, 17, 43, 33, 45,
};
short ace_yysindex[] = { 0,
-228, 0, -266, -260, -254, -246, -244, -247, 0, 0,
0, 0, 0, 0, 0, -251, -235, -235, 0, 0,
0, 0, 0, 0, -237, -249, -238, -236, -252, 0,
0, 0, -237, 0, 0, 0, 0, 0, 0, 0,
-231, -234, -248, 0, 0, -230, -229, 0, 0, 0,
-253, -225, -227, 0, 0, 0, 0, 0, 0, 0,
0, -224, 0,
};
short ace_yyrindex[] = { 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 27, 27, 0, 0,
0, 0, 0, 0, 46, 0, 0, 0, 0, 0,
0, 0, 46, 0, 0, 0, 0, 0, 0, 0,
0, 0, 20, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0,
};
short ace_yygindex[] = { 0,
0, 31, 0, 0, -8, -6, -1, 2, 3, 0,
0, 18, 0, 0, 0, 0, 0, 0, 0,
};
#define ACE_YYTABLESIZE 308
short ace_yytable[] = { 23,
34, 24, 16, 3, 4, 5, 6, 7, 18, 3,
4, 26, 27, 28, 19, 39, 40, 48, 49, 33,
54, 22, 20, 41, 21, 36, 41, 2, 3, 4,
5, 6, 7, 8, 30, 34, 37, 46, 38, 53,
52, 47, 55, 62, 56, 22, 61, 63, 32, 57,
44, 0, 58, 59, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 34, 34, 34, 34,
34, 34, 34, 0, 0, 0, 34, 34, 0, 0,
34, 0, 0, 34, 34, 33, 33, 33, 33, 33,
33, 33, 41, 41, 41, 41, 41, 41, 41, 33,
0, 0, 33, 33, 0, 0, 0, 0, 0, 41,
41, 22, 22, 22, 22, 22, 22, 22,
};
short ace_yycheck[] = { 8,
0, 8, 269, 257, 258, 259, 260, 261, 269, 257,
258, 263, 264, 265, 269, 268, 269, 266, 267, 0,
274, 269, 269, 276, 269, 275, 0, 256, 257, 258,
259, 260, 261, 262, 270, 273, 275, 269, 275, 269,
271, 276, 51, 271, 51, 0, 272, 272, 18, 51,
33, -1, 51, 51, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 256, 257, 258, 259,
260, 261, 262, -1, -1, -1, 266, 267, -1, -1,
270, -1, -1, 273, 274, 256, 257, 258, 259, 260,
261, 262, 256, 257, 258, 259, 260, 261, 262, 270,
-1, -1, 273, 274, -1, -1, -1, -1, -1, 273,
274, 256, 257, 258, 259, 260, 261, 262,
};
#define ACE_YYFINAL 1
#ifndef ACE_YYDEBUG
#define ACE_YYDEBUG 0
#endif
#define ACE_YYMAXTOKEN 276
#if ACE_YYDEBUG
const char *ace_yyname[] = {
"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"ACE_DYNAMIC","ACE_STATIC",
"ACE_SUSPEND","ACE_RESUME","ACE_REMOVE","ACE_USTREAM","ACE_MODULE_T",
"ACE_STREAM_T","ACE_SVC_OBJ_T","ACE_ACTIVE","ACE_INACTIVE","ACE_PATHNAME",
"ACE_IDENT","ACE_STRING","ACE_LPAREN","ACE_RPAREN","ACE_LBRACE","ACE_RBRACE",
"ACE_STAR","ACE_COLON",
};
const char *ace_yyrule[] = {
"$accept : svc_config_entries",
"svc_config_entries : svc_config_entries svc_config_entry",
"svc_config_entries : svc_config_entries error",
"svc_config_entries :",
"svc_config_entry : dynamic",
"svc_config_entry : static",
"svc_config_entry : suspend",
"svc_config_entry : resume",
"svc_config_entry : remove",
"svc_config_entry : stream",
"dynamic : ACE_DYNAMIC svc_location parameters_opt",
"static : ACE_STATIC ACE_IDENT parameters_opt",
"suspend : ACE_SUSPEND ACE_IDENT",
"resume : ACE_RESUME ACE_IDENT",
"remove : ACE_REMOVE ACE_IDENT",
"stream : ACE_USTREAM stream_ops stream_modules",
"$$1 :",
"stream : ACE_USTREAM ACE_IDENT $$1 stream_modules",
"stream_ops : dynamic",
"stream_ops : static",
"$$2 :",
"stream_modules : ACE_LBRACE $$2 module_list ACE_RBRACE",
"stream_modules :",
"module_list : module_list module",
"module_list :",
"module : dynamic",
"module : static",
"module : suspend",
"module : resume",
"module : remove",
"svc_location : ACE_IDENT type svc_initializer status",
"status : ACE_ACTIVE",
"status : ACE_INACTIVE",
"status :",
"svc_initializer : pathname ACE_COLON ACE_IDENT",
"svc_initializer : pathname ACE_COLON ACE_IDENT ACE_LPAREN ACE_RPAREN",
"svc_initializer : ACE_COLON ACE_IDENT ACE_LPAREN ACE_RPAREN",
"type : ACE_MODULE_T ACE_STAR",
"type : ACE_SVC_OBJ_T ACE_STAR",
"type : ACE_STREAM_T ACE_STAR",
"parameters_opt : ACE_STRING",
"parameters_opt :",
"pathname : ACE_PATHNAME",
"pathname : ACE_IDENT",
};
#endif
#define ace_yyclearin (ace_yychar=(-1))
#define ace_yyerrok (ace_yyerrflag=0)
#ifndef ACE_YYSTACKSIZE
#ifdef ACE_YYMAXDEPTH
#define ACE_YYSTACKSIZE ACE_YYMAXDEPTH
#else
#define ACE_YYSTACKSIZE 300
#endif
#endif
int ace_yydebug;
int ace_yynerrs;
int ace_yyerrflag;
int ace_yychar;
short *ace_yyssp;
ACE_YYSTYPE *ace_yyvsp;
ACE_YYSTYPE ace_yyval;
ACE_YYSTYPE ace_yylval;
#define ace_yystacksize ACE_YYSTACKSIZE
short ace_yyss[ACE_YYSTACKSIZE];
ACE_YYSTYPE ace_yyvs[ACE_YYSTACKSIZE];
#line 315 "Svc_Conf.y"
// Prints the error string to standard output. Cleans up the error
// messages.
void
ace_yyerror (const char *s)
{
#if defined (ACE_NLOGGING)
ACE_UNUSED_ARG (s);
#endif /* ACE_NLOGGING */
ACE_ERROR ((LM_ERROR,
ASYS_TEXT ("[error %d] on line %d: %s\n"),
++ace_yyerrno,
ace_yylineno,
ASYS_WIDE_STRING (s)));
}
// Note that SRC_REC represents left context, which is the STREAM *
// record.
static ACE_Module_Type *
ace_get_module (ACE_Static_Node *str_rec,
const ASYS_TCHAR *svc_name)
{
const ACE_Service_Type *sr = str_rec->record ();
const ACE_Service_Type_Impl *type = sr->type ();
ACE_Stream_Type *st = sr == 0
? 0
: ACE_dynamic_cast (ACE_Stream_Type *,
ACE_const_cast (ACE_Service_Type_Impl *,
type));
ACE_Module_Type *mt = st == 0 ? 0 : st->find (svc_name);
if (sr == 0 || st == 0 || mt == 0)
{
ACE_ERROR ((LM_ERROR,
ASYS_TEXT ("cannot locate Module_Type %s in STREAM_Type %s\n"),
svc_name,
str_rec->name ()));
ace_yyerrno++;
}
return mt;
}
static ACE_Module_Type *
ace_get_module (ACE_Static_Node *str_rec,
ACE_Static_Node *svc_type)
{
const ACE_Service_Type *sr = str_rec->record ();
const ACE_Service_Type_Impl *type = sr->type ();
ACE_Stream_Type *st = sr == 0 ? 0 : (ACE_Stream_Type *) type;
const ACE_Service_Type *sv = svc_type->record ();
type = sv->type ();
ACE_Module_Type *mt = (ACE_Module_Type *) type;
const ASYS_TCHAR *module_type_name = svc_type->name ();
if (sr == 0 || st == 0 || mt == 0)
{
ACE_ERROR ((LM_ERROR,
ASYS_TEXT ("cannot locate Module_Type %s or STREAM_Type %s\n"),
module_type_name,
str_rec->name ()));
ace_yyerrno++;
}
// Make sure that the Module has the same name as the
// Module_Type object from the svc.conf file.
ACE_Module<ACE_SYNCH> *mp = (ACE_Module<ACE_SYNCH> *) mt->object ();
if (ACE_OS::strcmp (mp->name (), module_type_name) != 0)
{
ACE_DEBUG ((LM_DEBUG,
ASYS_TEXT ("warning: assigning Module_Type name %s to Module %s since names differ\n"),
module_type_name,
mp->name ()));
mp->name (module_type_name);
}
return mt;
}
ACE_Service_Type_Impl *
ace_create_service_type (const ASYS_TCHAR *name,
int type,
void *symbol,
u_int flags,
ACE_Service_Object_Exterminator gobbler)
{
ACE_Service_Type_Impl *stp = 0;
// Note, the only place we need to put a case statement. This is
// also the place where we'd put the RTTI tests, if the compiler
// actually supported them!
switch (type)
{
case ACE_SVC_OBJ_T:
ACE_NEW_RETURN (stp,
ACE_Service_Object_Type ((ACE_Service_Object *) symbol,
name, flags,
gobbler),
0);
break;
case ACE_MODULE_T:
ACE_NEW_RETURN (stp,
ACE_Module_Type (symbol, name, flags),
0);
break;
case ACE_STREAM_T:
ACE_NEW_RETURN (stp,
ACE_Stream_Type (symbol, name, flags),
0);
break;
default:
ACE_ERROR ((LM_ERROR,
ASYS_TEXT ("unknown case\n")));
ace_yyerrno++;
break;
}
return stp;
}
#if defined (DEBUGGING)
// Current line number.
int ace_yylineno = 1;
// Name given on the command-line to envoke the program.
ASYS_TCHAR *program_name;
// Main driver program.
int
main (int argc, char *argv[])
{
ace_yyin = stdin;
ace_obstack = new ACE_Obstack;
// Try to reopen any filename argument to use ACE_YYIN.
if (argc > 1 && (ace_yyin = freopen (argv[1], "r", stdin)) == 0)
(void) ::fprintf (stderr, "usage: %s [file]\n", argv[0]), exit (1);
return ace_yyparse ();
}
#endif /* DEBUGGING */
#line 400 "Svc_Conf_y.cpp"
#define ACE_YYABORT goto ace_yyabort
#define ACE_YYACCEPT goto ace_yyaccept
#define ACE_YYERROR goto ace_yyerrlab
#ifdef ACE_YYDEBUG
#ifndef ACE_YYDEBUG_LEXER_TEXT /* pointer to the text isolated by the lexer*/
#define ACE_YYDEBUG_LEXER_TEXT "ACE_YYDEBUG_LEXER_TEXT not defined"
#endif
#ifndef ACE_YYDEBUG_INDENT_STRING
#define ACE_YYDEBUG_INDENT_STRING "| "
#endif
#ifndef ACE_YYDEBUG_REDUCE_STRING
#define ACE_YYDEBUG_REDUCE_STRING "+-------"
#endif
#ifndef ACE_YYDEBUG_INDENT
#ifdef __cplusplus
void ACE_YYDEBUG_INDENT(int ace_yyindent)
#else
ACE_YYDEBUG_INDENT(ace_yyindent)
int ace_yyindent;
#endif
{
while(ace_yyindent-- > 0)
printf("%s", ACE_YYDEBUG_INDENT_STRING);
}
#endif /* ACE_YYDEBUG_INDENT */
#ifndef ACE_YYDEBUG_REDUCE
#ifdef __cplusplus
void ACE_YYDEBUG_REDUCE(int /* ace_yynew_state */, int /* ace_yyrule_num */, const char *ace_yyrule_string, int ace_yynew_indent, int ace_yyrhs_count)
#else
ACE_YYDEBUG_REDUCE(ace_yynew_state, ace_yyrule_num, ace_yyrule_string, ace_yynew_indent, ace_yyrhs_count)
int ace_yynew_state;
int ace_yyrule_num;
char * ace_yyrule_string;
int ace_yynew_indent;
int ace_yyrhs_count;
#endif
{
if (1 < ace_yyrhs_count)
{ /* draw the graphics for the reduction */
ACE_YYDEBUG_INDENT(ace_yynew_indent);
while(1 < ace_yyrhs_count--)
printf("%s", ACE_YYDEBUG_REDUCE_STRING);
putchar('+'); /* left rotated L would look nice */
putchar('\n');
ACE_YYDEBUG_INDENT(ace_yynew_indent);
putchar('|'); /* down arrow would look nice */
putchar('\n');
}
ACE_YYDEBUG_INDENT(ace_yynew_indent);
/* Only print the resulting token name */
while (*ace_yyrule_string)
putchar(*ace_yyrule_string++);
putchar('\n');
}
#endif /* ACE_YYDEBUG_REDUCE */
#ifndef ACE_YYDEBUG_SHIFT_LEXEME
#ifdef __cplusplus
void ACE_YYDEBUG_SHIFT_LEXEME(int /* ace_yyold_state */, int /* ace_yynew_state*/, const char *ace_yytoken_string, int ace_yynew_indent)
#else
ACE_YYDEBUG_SHIFT_LEXEME(ace_yyold_state, ace_yynew_state, ace_yytoken_string, ace_yynew_indent)
int ace_yyold_state;
int ace_yynew_state;
char * ace_yytoken_string;
int ace_yynew_indent;
#endif
{
ACE_YYDEBUG_INDENT(ace_yynew_indent);
printf("%s <-- `%s'\n", ace_yytoken_string, ACE_YYDEBUG_LEXER_TEXT);
}
#endif /* ACE_YYDEBUG_SHIFT_LEXEME */
#ifndef ACE_YYDEBUG_LOOK_AHEAD
#ifdef __cplusplus
void ACE_YYDEBUG_LOOK_AHEAD(int /* ace_yynew_state */, int ace_yytoken_num, const char *ace_yytoken_string, int ace_yyindent)
#else
ACE_YYDEBUG_LOOK_AHEAD(ace_yynew_state, ace_yytoken_num, ace_yytoken_string, ace_yyindent)
int ace_yynew_state;
int ace_yytoken_num;
char * ace_yytoken_string;
int ace_yyindent;
#endif
{
ACE_YYDEBUG_INDENT(ace_yyindent);
printf(" .... look ahead at %s `%s'\n",
ace_yytoken_string,
(0 == ace_yytoken_num)? "\0": ACE_YYDEBUG_LEXER_TEXT);
}
#endif /* ACE_YYDEBUG_LOOK_AHEAD */
#ifndef ACE_YYDEBUG_DISCARD_STATE
#ifdef __cplusplus
void ACE_YYDEBUG_DISCARD_STATE(int /* ace_yynew_state */, int ace_yyindent)
#else
ACE_YYDEBUG_DISCARD_STATE(ace_yynew_state, ace_yyindent)
int ace_yynew_state;
int ace_yyindent;
#endif
{
if (0 < ace_yyindent)
{ /* draw the graphics for the reduction */
ACE_YYDEBUG_INDENT(ace_yyindent-1);
printf("%s", ACE_YYDEBUG_REDUCE_STRING);
putchar('+'); /* left rotated L would look nice */
printf(" discarding state\n");
ACE_YYDEBUG_INDENT(ace_yyindent-1);
putchar('|'); /* down arrow would look nice */
putchar('\n');
}
else
{
if (0 == ace_yyindent)
printf("discarding state\n");
else
printf("no more states to discard: parser will abort\n");
}
}
#endif /* ACE_YYDEBUG_DISCARD_STATE */
#ifndef ACE_YYDEBUG_DISCARD_TOKEN
#ifdef __cplusplus
void ACE_YYDEBUG_DISCARD_TOKEN(int /* ace_yynew_state */, int /* ace_yytoken_num */, const char *ace_yytoken_string, int ace_yyindent)
#else
ACE_YYDEBUG_DISCARD_TOKEN(ace_yynew_state, ace_yytoken_num, ace_yytoken_string, ace_yyindent)
int ace_yynew_state;
int ace_yytoken_num;
char * ace_yytoken_string;
int ace_yyindent;
#endif
{
ACE_YYDEBUG_INDENT(ace_yyindent);
printf("discarding token %s\n", ace_yytoken_string);
}
#endif /* ACE_YYDEBUG_DISCARD_TOKEN */
#ifndef ACE_YYDEBUG_SHIFT_ERROR_LEXEME
#ifdef __cplusplus
void ACE_YYDEBUG_SHIFT_ERROR_LEXEME(int /* ace_yyold_state */, int /* ace_yynew_state */, int ace_yyindent)
#else
ACE_YYDEBUG_SHIFT_ERROR_LEXEME(ace_yyold_state, ace_yynew_state, ace_yyindent)
int ace_yyold_state;
int ace_yynew_state;
int ace_yyindent;
#endif
{
ACE_YYDEBUG_INDENT(ace_yyindent);
printf("error\n");
}
#endif /* ACE_YYDEBUG_SHIFT_ERROR_LEXEME */
#endif /* ACE_YYDEBUG */
#ifdef __cplusplus
extern "C" { extern char *ace_foo(const char *); }
#endif
int
ace_yyparse()
{
register int ace_yym, ace_yyn, ace_yystate;
#if ACE_YYDEBUG
register const char *ace_yys;
#ifndef __cplusplus
extern char *ace_foo();
#endif
if ((ace_yys = ACE_OS::getenv("ACE_YYDEBUG")))
{
ace_yyn = *ace_yys;
if (ace_yyn >= '0' && ace_yyn <= '9')
ace_yydebug = ace_yyn - '0';
}
#endif
ace_yynerrs = 0;
ace_yyerrflag = 0;
ace_yychar = (-1);
ace_yyssp = ace_yyss;
ace_yyvsp = ace_yyvs;
*ace_yyssp = ace_yystate = 0;
ace_yyloop:
if ((ace_yyn = ace_yydefred[ace_yystate])) goto ace_yyreduce;
if (ace_yychar < 0)
{
if ((ace_yychar = ace_yylex()) < 0) ace_yychar = 0;
#if ACE_YYDEBUG
if (ace_yydebug)
{
ace_yys = 0;
if (ace_yychar <= ACE_YYMAXTOKEN) ace_yys = ace_yyname[ace_yychar];
if (!ace_yys) ace_yys = "illegal-symbol";
if (5 < ace_yydebug)
printf("ace_yydebug: state %d, reading %d (%s)\n", ace_yystate,
ace_yychar, ace_yys);
else
ACE_YYDEBUG_LOOK_AHEAD(ace_yystate, ace_yychar, ace_yys, ace_yyssp-ace_yyss);
}
#endif
}
if ((ace_yyn = ace_yysindex[ace_yystate]) && (ace_yyn += ace_yychar) >= 0 &&
ace_yyn <= ACE_YYTABLESIZE && ace_yycheck[ace_yyn] == ace_yychar)
{
#if ACE_YYDEBUG
if (ace_yydebug)
if (5 < ace_yydebug)
printf("ace_yydebug: state %d, shifting to state %d\n",
ace_yystate, ace_yytable[ace_yyn]);
else
ACE_YYDEBUG_SHIFT_LEXEME(ace_yystate, ace_yytable[ace_yyn], ace_yys, ace_yyssp-ace_yyss);
#endif
if (ace_yyssp >= ace_yyss + ace_yystacksize - 1)
{
goto ace_yyoverflow;
}
*++ace_yyssp = ace_yystate = ace_yytable[ace_yyn];
*++ace_yyvsp = ace_yylval;
ace_yychar = (-1);
if (ace_yyerrflag > 0) --ace_yyerrflag;
goto ace_yyloop;
}
if ((ace_yyn = ace_yyrindex[ace_yystate]) && (ace_yyn += ace_yychar) >= 0 &&
ace_yyn <= ACE_YYTABLESIZE && ace_yycheck[ace_yyn] == ace_yychar)
{
ace_yyn = ace_yytable[ace_yyn];
goto ace_yyreduce;
}
if (ace_yyerrflag) goto ace_yyinrecovery;
#ifdef lint
goto ace_yynewerror;
#endif
ace_yyerror("syntax error");
#ifdef lint
goto ace_yyerrlab;
#endif
++ace_yynerrs;
ace_yyinrecovery:
if (ace_yyerrflag < 3)
{
ace_yyerrflag = 3;
for (;;)
{
if ((ace_yyn = ace_yysindex[*ace_yyssp]) && (ace_yyn += ACE_YYERRCODE) >= 0 &&
ace_yyn <= ACE_YYTABLESIZE && ace_yycheck[ace_yyn] == ACE_YYERRCODE)
{
#if ACE_YYDEBUG
if (ace_yydebug)
if (5 < ace_yydebug)
printf("ace_yydebug: state %d, error recovery shifting\
to state %d\n", *ace_yyssp, ace_yytable[ace_yyn]);
else
ACE_YYDEBUG_SHIFT_ERROR_LEXEME(*ace_yyssp, ace_yytable[ace_yyn], ace_yyssp-ace_yyss);
#endif
if (ace_yyssp >= ace_yyss + ace_yystacksize - 1)
{
goto ace_yyoverflow;
}
*++ace_yyssp = ace_yystate = ace_yytable[ace_yyn];
*++ace_yyvsp = ace_yylval;
goto ace_yyloop;
}
else
{
#if ACE_YYDEBUG
if (ace_yydebug)
if (5 < ace_yydebug)
printf("ace_yydebug: error recovery discarding state %d\
",
*ace_yyssp);
else
ACE_YYDEBUG_DISCARD_STATE(*ace_yyssp, ace_yyssp-ace_yyss-1);
#endif
if (ace_yyssp <= ace_yyss) goto ace_yyabort;
--ace_yyssp;
--ace_yyvsp;
}
}
}
else
{
if (ace_yychar == 0) goto ace_yyabort;
#if ACE_YYDEBUG
if (ace_yydebug)
{
ace_yys = 0;
if (ace_yychar <= ACE_YYMAXTOKEN) ace_yys = ace_yyname[ace_yychar];
if (!ace_yys) ace_yys = "illegal-symbol";
if (5 < ace_yydebug)
printf("ace_yydebug: state %d, error recovery discards token %d (%s)\n",
ace_yystate, ace_yychar, ace_yys);
else
ACE_YYDEBUG_DISCARD_TOKEN(ace_yystate, ace_yychar, ace_yys, ace_yyssp-ace_yyss);
}
#endif
ace_yychar = (-1);
goto ace_yyloop;
}
ace_yyreduce:
ace_yym = ace_yylen[ace_yyn];
ace_yyval = ace_yyvsp[1-ace_yym];
#if ACE_YYDEBUG
if (ace_yydebug)
if (5 < ace_yydebug)
printf("ace_yydebug: state %d, reducing by rule %d (%s)\n",
ace_yystate, ace_yyn, ace_yyrule[ace_yyn]);
else
ACE_YYDEBUG_REDUCE(ace_yystate, ace_yyn, ace_yyrule[ace_yyn], ace_yyssp-ace_yyss-ace_yym, ace_yym);
#endif
switch (ace_yyn)
{
case 1:
#line 45 "Svc_Conf.y"
{
if (ace_yyvsp[0].parse_node_ != 0)
{
ace_yyvsp[0].parse_node_->apply (); delete ace_yyvsp[0].parse_node_;
}
ace_obstack->release ();
}
break;
case 2:
#line 53 "Svc_Conf.y"
{
ace_obstack->release ();
}
break;
case 10:
#line 70 "Svc_Conf.y"
{
if (ace_yyvsp[-1].svc_record_ != 0)
ace_yyval.parse_node_ = new ACE_Dynamic_Node (ace_yyvsp[-1].svc_record_, ASYS_WIDE_STRING (ace_yyvsp[0].ident_));
else
ace_yyval.parse_node_ = 0;
}
break;
case 11:
#line 80 "Svc_Conf.y"
{
ace_yyval.parse_node_ = new ACE_Static_Node (ASYS_WIDE_STRING (ace_yyvsp[-1].ident_), ASYS_WIDE_STRING (ace_yyvsp[0].ident_));
}
break;
case 12:
#line 87 "Svc_Conf.y"
{
ace_yyval.parse_node_ = new ACE_Suspend_Node (ASYS_WIDE_STRING (ace_yyvsp[0].ident_));
}
break;
case 13:
#line 94 "Svc_Conf.y"
{
ace_yyval.parse_node_ = new ACE_Resume_Node (ASYS_WIDE_STRING (ace_yyvsp[0].ident_));
}
break;
case 14:
#line 101 "Svc_Conf.y"
{
ace_yyval.parse_node_ = new ACE_Remove_Node (ASYS_WIDE_STRING (ace_yyvsp[0].ident_));
}
break;
case 15:
#line 108 "Svc_Conf.y"
{
ace_yyval.parse_node_ = new ACE_Stream_Node (ace_yyvsp[-1].static_node_, ace_yyvsp[0].parse_node_);
}
break;
case 16:
#line 111 "Svc_Conf.y"
{ ace_yyval.static_node_ = new ACE_Static_Node (ASYS_WIDE_STRING (ace_yyvsp[0].ident_)); }
break;
case 17:
#line 112 "Svc_Conf.y"
{
ace_yyval.parse_node_ = new ACE_Dummy_Node (ace_yyvsp[-1].static_node_, ace_yyvsp[0].parse_node_);
}
break;
case 18:
#line 119 "Svc_Conf.y"
{
}
break;
case 19:
#line 122 "Svc_Conf.y"
{
}
break;
case 20:
#line 128 "Svc_Conf.y"
{
/* Initialize left context...*/
ace_yyval.static_node_ = ace_yyvsp[-1].static_node_;
}
break;
case 21:
#line 133 "Svc_Conf.y"
{
ace_yyval.parse_node_ = ace_yyvsp[-1].parse_node_;
}
break;
case 22:
#line 136 "Svc_Conf.y"
{ ace_yyval.parse_node_ = 0; }
break;
case 23:
#line 141 "Svc_Conf.y"
{
if (ace_yyvsp[0].parse_node_ != 0)
{
ace_yyvsp[0].parse_node_->link (ace_yyvsp[-1].parse_node_);
ace_yyval.parse_node_ = ace_yyvsp[0].parse_node_;
}
}
break;
case 24:
#line 148 "Svc_Conf.y"
{ ace_yyval.parse_node_ = 0; }
break;
case 25:
#line 153 "Svc_Conf.y"
{
ACE_Static_Node *svc_type = ace_yyvsp[0].static_node_;
if (svc_type != 0)
{
ACE_Static_Node *module = ace_yyvsp[-2].static_node_;
ACE_ARGV args (svc_type->parameters ());
ACE_Module_Type *mt = ace_get_module (module,
svc_type);
ACE_Stream_Type *st =
ACE_dynamic_cast (ACE_Stream_Type *,
ACE_const_cast (ACE_Service_Type_Impl *,
module->record ()->type ()));
if (mt->init (args.argc (), args.argv ()) == -1
|| st->push (mt) == -1)
{
ACE_ERROR ((LM_ERROR,
ASYS_TEXT ("dynamic initialization failed for Module %s\n"),
svc_type->name ()));
ace_yyerrno++;
}
}
}
break;
case 26:
#line 179 "Svc_Conf.y"
{
ACE_Module_Type *mt = ace_get_module (ace_yyvsp[-2].static_node_, ace_yyvsp[0].static_node_->name ());
if (((ACE_Stream_Type *) (ace_yyvsp[-2].static_node_)->record ()->type ())->push (mt) == -1)
{
ACE_ERROR ((LM_ERROR,
ASYS_TEXT ("Problem with static\n")));
ace_yyerrno++;
}
}
break;
case 27:
#line 190 "Svc_Conf.y"
{
ACE_Module_Type *mt = ace_get_module (ace_yyvsp[-2].static_node_,
ace_yyvsp[0].static_node_->name ());
if (mt != 0)
mt->suspend ();
}
break;
case 28:
#line 197 "Svc_Conf.y"
{
ACE_Module_Type *mt = ace_get_module (ace_yyvsp[-2].static_node_,
ace_yyvsp[0].static_node_->name ());
if (mt != 0)
mt->resume ();
}
break;
case 29:
#line 204 "Svc_Conf.y"
{
ACE_Static_Node *stream = ace_yyvsp[-2].static_node_;
ACE_Static_Node *module = ace_yyvsp[0].static_node_;
ACE_Module_Type *mt = ace_get_module (stream,
module->name ());
ACE_Stream_Type *st =
ACE_dynamic_cast (ACE_Stream_Type *,
ACE_const_cast (ACE_Service_Type_Impl *,
stream->record ()->type ()));
if (mt != 0 && st->remove (mt) == -1)
{
ACE_ERROR ((LM_ERROR,
ASYS_TEXT ("cannot remove Module_Type %s from STREAM_Type %s\n"),
module->name (),
stream->name ()));
ace_yyerrno++;
}
}
break;
case 30:
#line 227 "Svc_Conf.y"
{
u_int flags
= ACE_Service_Type::DELETE_THIS
| (ace_yyvsp[-1].location_node_->dispose () == 0 ? 0 : ACE_Service_Type::DELETE_OBJ);
ACE_Service_Object_Exterminator gobbler = 0;
void *sym = ace_yyvsp[-1].location_node_->symbol (&gobbler);
if (sym != 0)
{
ACE_Service_Type_Impl *stp
= ace_create_service_type (ASYS_WIDE_STRING (ace_yyvsp[-3].ident_),
ace_yyvsp[-2].type_,
sym,
flags,
gobbler);
ace_yyval.svc_record_ = new ACE_Service_Type (ASYS_WIDE_STRING (ace_yyvsp[-3].ident_),
stp,
ace_yyvsp[-1].location_node_->handle (),
ace_yyvsp[0].type_);
}
else
{
ACE_ERROR ((LM_ERROR,
ASYS_TEXT ("Unable to find service: %s\n"),
ASYS_WIDE_STRING (ace_yyvsp[-3].ident_)));
++ace_yyerrno;
ace_yyval.svc_record_ = 0;
}
delete ace_yyvsp[-1].location_node_;
}
break;
case 31:
#line 261 "Svc_Conf.y"
{
ace_yyval.type_ = 1;
}
break;
case 32:
#line 265 "Svc_Conf.y"
{
ace_yyval.type_ = 0;
}
break;
case 33:
#line 269 "Svc_Conf.y"
{
ace_yyval.type_ = 1;
}
break;
case 34:
#line 276 "Svc_Conf.y"
{
ace_yyval.location_node_ = new ACE_Object_Node (ASYS_WIDE_STRING (ace_yyvsp[-2].ident_), ASYS_WIDE_STRING(ace_yyvsp[0].ident_));
}
break;
case 35:
#line 280 "Svc_Conf.y"
{
ace_yyval.location_node_ = new ACE_Function_Node (ASYS_WIDE_STRING (ace_yyvsp[-4].ident_), ASYS_WIDE_STRING (ace_yyvsp[-2].ident_));
}
break;
case 36:
#line 284 "Svc_Conf.y"
{
ace_yyval.location_node_ = new ACE_Static_Function_Node (ASYS_WIDE_STRING (ace_yyvsp[-2].ident_));
}
break;
case 37:
#line 291 "Svc_Conf.y"
{
ace_yyval.type_ = ACE_MODULE_T;
}
break;
case 38:
#line 295 "Svc_Conf.y"
{
ace_yyval.type_ = ACE_SVC_OBJ_T;
}
break;
case 39:
#line 299 "Svc_Conf.y"
{
ace_yyval.type_ = ACE_STREAM_T;
}
break;
case 41:
#line 306 "Svc_Conf.y"
{ ace_yyval.ident_ = 0; }
break;
#line 983 "Svc_Conf_y.cpp"
}
ace_yyssp -= ace_yym;
ace_yystate = *ace_yyssp;
ace_yyvsp -= ace_yym;
ace_yym = ace_yylhs[ace_yyn];
if (ace_yystate == 0 && ace_yym == 0)
{
#ifdef ACE_YYDEBUG
if (5 < ace_yydebug)
printf("ace_yydebug: after reduction, shifting from state 0 to\
state %d\n", ACE_YYFINAL);
#endif
ace_yystate = ACE_YYFINAL;
*++ace_yyssp = ACE_YYFINAL;
*++ace_yyvsp = ace_yyval;
if (ace_yychar < 0)
{
if ((ace_yychar = ace_yylex()) < 0) ace_yychar = 0;
#if ACE_YYDEBUG
if (ace_yydebug)
{
ace_yys = 0;
if (ace_yychar <= ACE_YYMAXTOKEN) ace_yys = ace_yyname[ace_yychar];
if (!ace_yys) ace_yys = "illegal-symbol";
if (5 < ace_yydebug)
printf("ace_yydebug: state %d, reading %d (%s)\n",
ACE_YYFINAL, ace_yychar, ace_yys);
else
ACE_YYDEBUG_LOOK_AHEAD(ACE_YYFINAL, ace_yychar, ace_yys, ace_yyssp-ace_yyss);
}
#endif
}
if (ace_yychar == 0) goto ace_yyaccept;
goto ace_yyloop;
}
if ((ace_yyn = ace_yygindex[ace_yym]) && (ace_yyn += ace_yystate) >= 0 &&
ace_yyn <= ACE_YYTABLESIZE && ace_yycheck[ace_yyn] == ace_yystate)
ace_yystate = ace_yytable[ace_yyn];
else
ace_yystate = ace_yydgoto[ace_yym];
#ifdef ACE_YYDEBUG
if (5 < ace_yydebug)
printf("ace_yydebug: after reduction, shifting from state %d \
to state %d\n", *ace_yyssp, ace_yystate);
#endif
if (ace_yyssp >= ace_yyss + ace_yystacksize - 1)
{
goto ace_yyoverflow;
}
*++ace_yyssp = ace_yystate;
*++ace_yyvsp = ace_yyval;
goto ace_yyloop;
ace_yyoverflow:
ace_yyerror("yacc stack overflow");
ace_yyabort:
return (1);
ace_yyaccept:
return (0);
}
|