TODO pidl/IDL: give anonymous structs and unions a name...
[metze/samba/wip.git] / pidl / lib / Parse / Pidl / IDL.pm
1 ####################################################################
2 #
3 #    This file was generated using Parse::Yapp version 1.05.
4 #
5 #        Don't edit this file, use source file instead.
6 #
7 #             ANY CHANGE MADE HERE WILL BE LOST !
8 #
9 ####################################################################
10 package Parse::Pidl::IDL;
11 use vars qw ( @ISA );
12 use strict;
13
14 @ISA= qw ( Parse::Yapp::Driver );
15 use Parse::Yapp::Driver;
16
17
18
19 sub new {
20         my($class)=shift;
21         ref($class)
22     and $class=ref($class);
23
24     my($self)=$class->SUPER::new( yyversion => '1.05',
25                                   yystates =>
26 [
27         {#State 0
28                 DEFAULT => -1,
29                 GOTOS => {
30                         'idl' => 1
31                 }
32         },
33         {#State 1
34                 ACTIONS => {
35                         '' => 2,
36                         "cpp_quote" => 3,
37                         "importlib" => 4,
38                         "import" => 7,
39                         "include" => 13
40                 },
41                 DEFAULT => -89,
42                 GOTOS => {
43                         'cpp_quote' => 11,
44                         'importlib' => 10,
45                         'interface' => 9,
46                         'include' => 5,
47                         'coclass' => 12,
48                         'import' => 8,
49                         'property_list' => 6
50                 }
51         },
52         {#State 2
53                 DEFAULT => 0
54         },
55         {#State 3
56                 ACTIONS => {
57                         "(" => 14
58                 }
59         },
60         {#State 4
61                 ACTIONS => {
62                         'TEXT' => 16
63                 },
64                 GOTOS => {
65                         'commalist' => 15,
66                         'text' => 17
67                 }
68         },
69         {#State 5
70                 DEFAULT => -5
71         },
72         {#State 6
73                 ACTIONS => {
74                         "coclass" => 18,
75                         "[" => 20,
76                         "interface" => 19
77                 }
78         },
79         {#State 7
80                 ACTIONS => {
81                         'TEXT' => 16
82                 },
83                 GOTOS => {
84                         'commalist' => 21,
85                         'text' => 17
86                 }
87         },
88         {#State 8
89                 DEFAULT => -4
90         },
91         {#State 9
92                 DEFAULT => -2
93         },
94         {#State 10
95                 DEFAULT => -6
96         },
97         {#State 11
98                 DEFAULT => -7
99         },
100         {#State 12
101                 DEFAULT => -3
102         },
103         {#State 13
104                 ACTIONS => {
105                         'TEXT' => 16
106                 },
107                 GOTOS => {
108                         'commalist' => 22,
109                         'text' => 17
110                 }
111         },
112         {#State 14
113                 ACTIONS => {
114                         'TEXT' => 16
115                 },
116                 GOTOS => {
117                         'text' => 23
118                 }
119         },
120         {#State 15
121                 ACTIONS => {
122                         ";" => 24,
123                         "," => 25
124                 }
125         },
126         {#State 16
127                 DEFAULT => -122
128         },
129         {#State 17
130                 DEFAULT => -11
131         },
132         {#State 18
133                 ACTIONS => {
134                         'IDENTIFIER' => 26
135                 },
136                 GOTOS => {
137                         'identifier' => 27
138                 }
139         },
140         {#State 19
141                 ACTIONS => {
142                         'IDENTIFIER' => 26
143                 },
144                 GOTOS => {
145                         'identifier' => 28
146                 }
147         },
148         {#State 20
149                 ACTIONS => {
150                         'IDENTIFIER' => 26
151                 },
152                 GOTOS => {
153                         'identifier' => 30,
154                         'property' => 31,
155                         'properties' => 29
156                 }
157         },
158         {#State 21
159                 ACTIONS => {
160                         ";" => 32,
161                         "," => 25
162                 }
163         },
164         {#State 22
165                 ACTIONS => {
166                         ";" => 33,
167                         "," => 25
168                 }
169         },
170         {#State 23
171                 ACTIONS => {
172                         ")" => 34
173                 }
174         },
175         {#State 24
176                 DEFAULT => -10
177         },
178         {#State 25
179                 ACTIONS => {
180                         'TEXT' => 16
181                 },
182                 GOTOS => {
183                         'text' => 35
184                 }
185         },
186         {#State 26
187                 DEFAULT => -116
188         },
189         {#State 27
190                 ACTIONS => {
191                         "{" => 36
192                 }
193         },
194         {#State 28
195                 ACTIONS => {
196                         ":" => 37
197                 },
198                 DEFAULT => -17,
199                 GOTOS => {
200                         'base_interface' => 38
201                 }
202         },
203         {#State 29
204                 ACTIONS => {
205                         "," => 39,
206                         "]" => 40
207                 }
208         },
209         {#State 30
210                 ACTIONS => {
211                         "(" => 41
212                 },
213                 DEFAULT => -93
214         },
215         {#State 31
216                 DEFAULT => -91
217         },
218         {#State 32
219                 DEFAULT => -8
220         },
221         {#State 33
222                 DEFAULT => -9
223         },
224         {#State 34
225                 DEFAULT => -19
226         },
227         {#State 35
228                 DEFAULT => -12
229         },
230         {#State 36
231                 DEFAULT => -14,
232                 GOTOS => {
233                         'interface_names' => 42
234                 }
235         },
236         {#State 37
237                 ACTIONS => {
238                         'IDENTIFIER' => 26
239                 },
240                 GOTOS => {
241                         'identifier' => 43
242                 }
243         },
244         {#State 38
245                 ACTIONS => {
246                         "{" => 44
247                 }
248         },
249         {#State 39
250                 ACTIONS => {
251                         'IDENTIFIER' => 26
252                 },
253                 GOTOS => {
254                         'identifier' => 30,
255                         'property' => 45
256                 }
257         },
258         {#State 40
259                 DEFAULT => -90
260         },
261         {#State 41
262                 ACTIONS => {
263                         'CONSTANT' => 48,
264                         'TEXT' => 16,
265                         'IDENTIFIER' => 26
266                 },
267                 DEFAULT => -97,
268                 GOTOS => {
269                         'identifier' => 50,
270                         'text' => 51,
271                         'anytext' => 46,
272                         'constant' => 47,
273                         'commalisttext' => 49
274                 }
275         },
276         {#State 42
277                 ACTIONS => {
278                         "}" => 52,
279                         "interface" => 53
280                 }
281         },
282         {#State 43
283                 DEFAULT => -18
284         },
285         {#State 44
286                 ACTIONS => {
287                         "const" => 64
288                 },
289                 DEFAULT => -89,
290                 GOTOS => {
291                         'typedecl' => 54,
292                         'function' => 55,
293                         'pipe' => 56,
294                         'definitions' => 58,
295                         'bitmap' => 57,
296                         'definition' => 61,
297                         'property_list' => 60,
298                         'usertype' => 59,
299                         'const' => 63,
300                         'struct' => 62,
301                         'typedef' => 66,
302                         'enum' => 65,
303                         'union' => 67
304                 }
305         },
306         {#State 45
307                 DEFAULT => -92
308         },
309         {#State 46
310                 ACTIONS => {
311                         "-" => 69,
312                         ":" => 68,
313                         "<" => 71,
314                         "+" => 73,
315                         "~" => 72,
316                         "*" => 80,
317                         "?" => 70,
318                         "{" => 74,
319                         "&" => 75,
320                         "/" => 76,
321                         "=" => 77,
322                         "(" => 78,
323                         "|" => 79,
324                         "." => 81,
325                         ">" => 82
326                 },
327                 DEFAULT => -95
328         },
329         {#State 47
330                 DEFAULT => -99
331         },
332         {#State 48
333                 DEFAULT => -121
334         },
335         {#State 49
336                 ACTIONS => {
337                         "," => 83,
338                         ")" => 84
339                 }
340         },
341         {#State 50
342                 DEFAULT => -98
343         },
344         {#State 51
345                 DEFAULT => -100
346         },
347         {#State 52
348                 ACTIONS => {
349                         ";" => 86
350                 },
351                 DEFAULT => -123,
352                 GOTOS => {
353                         'optional_semicolon' => 85
354                 }
355         },
356         {#State 53
357                 ACTIONS => {
358                         'IDENTIFIER' => 26
359                 },
360                 GOTOS => {
361                         'identifier' => 87
362                 }
363         },
364         {#State 54
365                 DEFAULT => -25
366         },
367         {#State 55
368                 DEFAULT => -22
369         },
370         {#State 56
371                 DEFAULT => -34
372         },
373         {#State 57
374                 DEFAULT => -33
375         },
376         {#State 58
377                 ACTIONS => {
378                         "}" => 88,
379                         "const" => 64
380                 },
381                 DEFAULT => -89,
382                 GOTOS => {
383                         'typedecl' => 54,
384                         'function' => 55,
385                         'pipe' => 56,
386                         'bitmap' => 57,
387                         'definition' => 89,
388                         'property_list' => 60,
389                         'usertype' => 59,
390                         'const' => 63,
391                         'struct' => 62,
392                         'typedef' => 66,
393                         'enum' => 65,
394                         'union' => 67
395                 }
396         },
397         {#State 59
398                 ACTIONS => {
399                         ";" => 90
400                 }
401         },
402         {#State 60
403                 ACTIONS => {
404                         "typedef" => 91,
405                         'IDENTIFIER' => 26,
406                         "signed" => 100,
407                         "union" => 92,
408                         "enum" => 101,
409                         "bitmap" => 102,
410                         'void' => 93,
411                         "pipe" => 103,
412                         "unsigned" => 104,
413                         "[" => 20,
414                         "struct" => 98
415                 },
416                 GOTOS => {
417                         'existingtype' => 99,
418                         'pipe' => 56,
419                         'bitmap' => 57,
420                         'usertype' => 95,
421                         'property_list' => 94,
422                         'identifier' => 96,
423                         'struct' => 62,
424                         'enum' => 65,
425                         'type' => 105,
426                         'union' => 67,
427                         'sign' => 97
428                 }
429         },
430         {#State 61
431                 DEFAULT => -20
432         },
433         {#State 62
434                 DEFAULT => -30
435         },
436         {#State 63
437                 DEFAULT => -23
438         },
439         {#State 64
440                 ACTIONS => {
441                         'IDENTIFIER' => 26
442                 },
443                 GOTOS => {
444                         'identifier' => 106
445                 }
446         },
447         {#State 65
448                 DEFAULT => -32
449         },
450         {#State 66
451                 DEFAULT => -24
452         },
453         {#State 67
454                 DEFAULT => -31
455         },
456         {#State 68
457                 ACTIONS => {
458                         'CONSTANT' => 48,
459                         'TEXT' => 16,
460                         'IDENTIFIER' => 26
461                 },
462                 DEFAULT => -97,
463                 GOTOS => {
464                         'identifier' => 50,
465                         'anytext' => 107,
466                         'text' => 51,
467                         'constant' => 47
468                 }
469         },
470         {#State 69
471                 ACTIONS => {
472                         'CONSTANT' => 48,
473                         'TEXT' => 16,
474                         'IDENTIFIER' => 26
475                 },
476                 DEFAULT => -97,
477                 GOTOS => {
478                         'identifier' => 50,
479                         'anytext' => 108,
480                         'text' => 51,
481                         'constant' => 47
482                 }
483         },
484         {#State 70
485                 ACTIONS => {
486                         'CONSTANT' => 48,
487                         'TEXT' => 16,
488                         'IDENTIFIER' => 26
489                 },
490                 DEFAULT => -97,
491                 GOTOS => {
492                         'identifier' => 50,
493                         'anytext' => 109,
494                         'text' => 51,
495                         'constant' => 47
496                 }
497         },
498         {#State 71
499                 ACTIONS => {
500                         'CONSTANT' => 48,
501                         'TEXT' => 16,
502                         'IDENTIFIER' => 26
503                 },
504                 DEFAULT => -97,
505                 GOTOS => {
506                         'identifier' => 50,
507                         'anytext' => 110,
508                         'text' => 51,
509                         'constant' => 47
510                 }
511         },
512         {#State 72
513                 ACTIONS => {
514                         'CONSTANT' => 48,
515                         'TEXT' => 16,
516                         'IDENTIFIER' => 26
517                 },
518                 DEFAULT => -97,
519                 GOTOS => {
520                         'identifier' => 50,
521                         'anytext' => 111,
522                         'text' => 51,
523                         'constant' => 47
524                 }
525         },
526         {#State 73
527                 ACTIONS => {
528                         'CONSTANT' => 48,
529                         'TEXT' => 16,
530                         'IDENTIFIER' => 26
531                 },
532                 DEFAULT => -97,
533                 GOTOS => {
534                         'identifier' => 50,
535                         'anytext' => 112,
536                         'text' => 51,
537                         'constant' => 47
538                 }
539         },
540         {#State 74
541                 ACTIONS => {
542                         'CONSTANT' => 48,
543                         'TEXT' => 16,
544                         'IDENTIFIER' => 26
545                 },
546                 DEFAULT => -97,
547                 GOTOS => {
548                         'identifier' => 50,
549                         'anytext' => 46,
550                         'text' => 51,
551                         'constant' => 47,
552                         'commalisttext' => 113
553                 }
554         },
555         {#State 75
556                 ACTIONS => {
557                         'CONSTANT' => 48,
558                         'TEXT' => 16,
559                         'IDENTIFIER' => 26
560                 },
561                 DEFAULT => -97,
562                 GOTOS => {
563                         'identifier' => 50,
564                         'anytext' => 114,
565                         'text' => 51,
566                         'constant' => 47
567                 }
568         },
569         {#State 76
570                 ACTIONS => {
571                         'CONSTANT' => 48,
572                         'TEXT' => 16,
573                         'IDENTIFIER' => 26
574                 },
575                 DEFAULT => -97,
576                 GOTOS => {
577                         'identifier' => 50,
578                         'anytext' => 115,
579                         'text' => 51,
580                         'constant' => 47
581                 }
582         },
583         {#State 77
584                 ACTIONS => {
585                         'CONSTANT' => 48,
586                         'TEXT' => 16,
587                         'IDENTIFIER' => 26
588                 },
589                 DEFAULT => -97,
590                 GOTOS => {
591                         'identifier' => 50,
592                         'anytext' => 116,
593                         'text' => 51,
594                         'constant' => 47
595                 }
596         },
597         {#State 78
598                 ACTIONS => {
599                         'CONSTANT' => 48,
600                         'TEXT' => 16,
601                         'IDENTIFIER' => 26
602                 },
603                 DEFAULT => -97,
604                 GOTOS => {
605                         'identifier' => 50,
606                         'anytext' => 46,
607                         'text' => 51,
608                         'constant' => 47,
609                         'commalisttext' => 117
610                 }
611         },
612         {#State 79
613                 ACTIONS => {
614                         'CONSTANT' => 48,
615                         'TEXT' => 16,
616                         'IDENTIFIER' => 26
617                 },
618                 DEFAULT => -97,
619                 GOTOS => {
620                         'identifier' => 50,
621                         'anytext' => 118,
622                         'text' => 51,
623                         'constant' => 47
624                 }
625         },
626         {#State 80
627                 ACTIONS => {
628                         'CONSTANT' => 48,
629                         'TEXT' => 16,
630                         'IDENTIFIER' => 26
631                 },
632                 DEFAULT => -97,
633                 GOTOS => {
634                         'identifier' => 50,
635                         'anytext' => 119,
636                         'text' => 51,
637                         'constant' => 47
638                 }
639         },
640         {#State 81
641                 ACTIONS => {
642                         'CONSTANT' => 48,
643                         'TEXT' => 16,
644                         'IDENTIFIER' => 26
645                 },
646                 DEFAULT => -97,
647                 GOTOS => {
648                         'identifier' => 50,
649                         'anytext' => 120,
650                         'text' => 51,
651                         'constant' => 47
652                 }
653         },
654         {#State 82
655                 ACTIONS => {
656                         'CONSTANT' => 48,
657                         'TEXT' => 16,
658                         'IDENTIFIER' => 26
659                 },
660                 DEFAULT => -97,
661                 GOTOS => {
662                         'identifier' => 50,
663                         'anytext' => 121,
664                         'text' => 51,
665                         'constant' => 47
666                 }
667         },
668         {#State 83
669                 ACTIONS => {
670                         'CONSTANT' => 48,
671                         'TEXT' => 16,
672                         'IDENTIFIER' => 26
673                 },
674                 DEFAULT => -97,
675                 GOTOS => {
676                         'identifier' => 50,
677                         'anytext' => 122,
678                         'text' => 51,
679                         'constant' => 47
680                 }
681         },
682         {#State 84
683                 DEFAULT => -94
684         },
685         {#State 85
686                 DEFAULT => -13
687         },
688         {#State 86
689                 DEFAULT => -124
690         },
691         {#State 87
692                 ACTIONS => {
693                         ";" => 123
694                 }
695         },
696         {#State 88
697                 ACTIONS => {
698                         ";" => 86
699                 },
700                 DEFAULT => -123,
701                 GOTOS => {
702                         'optional_semicolon' => 124
703                 }
704         },
705         {#State 89
706                 DEFAULT => -21
707         },
708         {#State 90
709                 DEFAULT => -35
710         },
711         {#State 91
712                 ACTIONS => {
713                         'IDENTIFIER' => 26,
714                         "signed" => 100,
715                         'void' => 93,
716                         "unsigned" => 104
717                 },
718                 DEFAULT => -89,
719                 GOTOS => {
720                         'existingtype' => 99,
721                         'pipe' => 56,
722                         'bitmap' => 57,
723                         'usertype' => 95,
724                         'property_list' => 94,
725                         'identifier' => 96,
726                         'struct' => 62,
727                         'enum' => 65,
728                         'type' => 125,
729                         'union' => 67,
730                         'sign' => 97
731                 }
732         },
733         {#State 92
734                 ACTIONS => {
735                         'IDENTIFIER' => 126
736                 },
737                 DEFAULT => -119,
738                 GOTOS => {
739                         'optional_anonymous_identifier' => 127
740                 }
741         },
742         {#State 93
743                 DEFAULT => -42
744         },
745         {#State 94
746                 ACTIONS => {
747                         "pipe" => 103,
748                         "union" => 92,
749                         "enum" => 101,
750                         "bitmap" => 102,
751                         "[" => 20,
752                         "struct" => 98
753                 }
754         },
755         {#State 95
756                 DEFAULT => -40
757         },
758         {#State 96
759                 DEFAULT => -39
760         },
761         {#State 97
762                 ACTIONS => {
763                         'IDENTIFIER' => 26
764                 },
765                 GOTOS => {
766                         'identifier' => 128
767                 }
768         },
769         {#State 98
770                 ACTIONS => {
771                         'IDENTIFIER' => 126
772                 },
773                 DEFAULT => -119,
774                 GOTOS => {
775                         'optional_anonymous_identifier' => 129
776                 }
777         },
778         {#State 99
779                 DEFAULT => -41
780         },
781         {#State 100
782                 DEFAULT => -36
783         },
784         {#State 101
785                 ACTIONS => {
786                         'IDENTIFIER' => 130
787                 },
788                 DEFAULT => -117,
789                 GOTOS => {
790                         'optional_identifier' => 131
791                 }
792         },
793         {#State 102
794                 ACTIONS => {
795                         'IDENTIFIER' => 130
796                 },
797                 DEFAULT => -117,
798                 GOTOS => {
799                         'optional_identifier' => 132
800                 }
801         },
802         {#State 103
803                 ACTIONS => {
804                         'IDENTIFIER' => 26,
805                         "signed" => 100,
806                         'void' => 93,
807                         "unsigned" => 104
808                 },
809                 DEFAULT => -89,
810                 GOTOS => {
811                         'existingtype' => 99,
812                         'pipe' => 56,
813                         'bitmap' => 57,
814                         'usertype' => 95,
815                         'property_list' => 94,
816                         'identifier' => 96,
817                         'struct' => 62,
818                         'enum' => 65,
819                         'type' => 133,
820                         'union' => 67,
821                         'sign' => 97
822                 }
823         },
824         {#State 104
825                 DEFAULT => -37
826         },
827         {#State 105
828                 ACTIONS => {
829                         'IDENTIFIER' => 26
830                 },
831                 GOTOS => {
832                         'identifier' => 134
833                 }
834         },
835         {#State 106
836                 DEFAULT => -75,
837                 GOTOS => {
838                         'pointers' => 135
839                 }
840         },
841         {#State 107
842                 ACTIONS => {
843                         "-" => 69,
844                         ":" => 68,
845                         "<" => 71,
846                         "+" => 73,
847                         "~" => 72,
848                         "*" => 80,
849                         "?" => 70,
850                         "{" => 74,
851                         "&" => 75,
852                         "/" => 76,
853                         "=" => 77,
854                         "(" => 78,
855                         "|" => 79,
856                         "." => 81,
857                         ">" => 82
858                 },
859                 DEFAULT => -110
860         },
861         {#State 108
862                 ACTIONS => {
863                         ":" => 68,
864                         "<" => 71,
865                         "~" => 72,
866                         "?" => 70,
867                         "{" => 74,
868                         "=" => 77
869                 },
870                 DEFAULT => -101
871         },
872         {#State 109
873                 ACTIONS => {
874                         "-" => 69,
875                         ":" => 68,
876                         "<" => 71,
877                         "+" => 73,
878                         "~" => 72,
879                         "*" => 80,
880                         "?" => 70,
881                         "{" => 74,
882                         "&" => 75,
883                         "/" => 76,
884                         "=" => 77,
885                         "(" => 78,
886                         "|" => 79,
887                         "." => 81,
888                         ">" => 82
889                 },
890                 DEFAULT => -109
891         },
892         {#State 110
893                 ACTIONS => {
894                         "-" => 69,
895                         ":" => 68,
896                         "<" => 71,
897                         "+" => 73,
898                         "~" => 72,
899                         "*" => 80,
900                         "?" => 70,
901                         "{" => 74,
902                         "&" => 75,
903                         "/" => 76,
904                         "=" => 77,
905                         "(" => 78,
906                         "|" => 79,
907                         "." => 81,
908                         ">" => 82
909                 },
910                 DEFAULT => -105
911         },
912         {#State 111
913                 ACTIONS => {
914                         "-" => 69,
915                         ":" => 68,
916                         "<" => 71,
917                         "+" => 73,
918                         "~" => 72,
919                         "*" => 80,
920                         "?" => 70,
921                         "{" => 74,
922                         "&" => 75,
923                         "/" => 76,
924                         "=" => 77,
925                         "(" => 78,
926                         "|" => 79,
927                         "." => 81,
928                         ">" => 82
929                 },
930                 DEFAULT => -113
931         },
932         {#State 112
933                 ACTIONS => {
934                         ":" => 68,
935                         "<" => 71,
936                         "~" => 72,
937                         "?" => 70,
938                         "{" => 74,
939                         "=" => 77
940                 },
941                 DEFAULT => -112
942         },
943         {#State 113
944                 ACTIONS => {
945                         "}" => 136,
946                         "," => 83
947                 }
948         },
949         {#State 114
950                 ACTIONS => {
951                         ":" => 68,
952                         "<" => 71,
953                         "~" => 72,
954                         "?" => 70,
955                         "{" => 74,
956                         "=" => 77
957                 },
958                 DEFAULT => -107
959         },
960         {#State 115
961                 ACTIONS => {
962                         ":" => 68,
963                         "<" => 71,
964                         "~" => 72,
965                         "?" => 70,
966                         "{" => 74,
967                         "=" => 77
968                 },
969                 DEFAULT => -108
970         },
971         {#State 116
972                 ACTIONS => {
973                         "-" => 69,
974                         ":" => 68,
975                         "<" => 71,
976                         "+" => 73,
977                         "~" => 72,
978                         "*" => 80,
979                         "?" => 70,
980                         "{" => 74,
981                         "&" => 75,
982                         "/" => 76,
983                         "=" => 77,
984                         "(" => 78,
985                         "|" => 79,
986                         "." => 81,
987                         ">" => 82
988                 },
989                 DEFAULT => -111
990         },
991         {#State 117
992                 ACTIONS => {
993                         "," => 83,
994                         ")" => 137
995                 }
996         },
997         {#State 118
998                 ACTIONS => {
999                         ":" => 68,
1000                         "<" => 71,
1001                         "~" => 72,
1002                         "?" => 70,
1003                         "{" => 74,
1004                         "=" => 77
1005                 },
1006                 DEFAULT => -106
1007         },
1008         {#State 119
1009                 ACTIONS => {
1010                         ":" => 68,
1011                         "<" => 71,
1012                         "~" => 72,
1013                         "?" => 70,
1014                         "{" => 74,
1015                         "=" => 77
1016                 },
1017                 DEFAULT => -103
1018         },
1019         {#State 120
1020                 ACTIONS => {
1021                         ":" => 68,
1022                         "<" => 71,
1023                         "~" => 72,
1024                         "?" => 70,
1025                         "{" => 74,
1026                         "=" => 77
1027                 },
1028                 DEFAULT => -102
1029         },
1030         {#State 121
1031                 ACTIONS => {
1032                         ":" => 68,
1033                         "<" => 71,
1034                         "~" => 72,
1035                         "?" => 70,
1036                         "{" => 74,
1037                         "=" => 77
1038                 },
1039                 DEFAULT => -104
1040         },
1041         {#State 122
1042                 ACTIONS => {
1043                         "-" => 69,
1044                         ":" => 68,
1045                         "<" => 71,
1046                         "+" => 73,
1047                         "~" => 72,
1048                         "*" => 80,
1049                         "?" => 70,
1050                         "{" => 74,
1051                         "&" => 75,
1052                         "/" => 76,
1053                         "=" => 77,
1054                         "(" => 78,
1055                         "|" => 79,
1056                         "." => 81,
1057                         ">" => 82
1058                 },
1059                 DEFAULT => -96
1060         },
1061         {#State 123
1062                 DEFAULT => -15
1063         },
1064         {#State 124
1065                 DEFAULT => -16
1066         },
1067         {#State 125
1068                 DEFAULT => -75,
1069                 GOTOS => {
1070                         'pointers' => 138
1071                 }
1072         },
1073         {#State 126
1074                 DEFAULT => -120
1075         },
1076         {#State 127
1077                 ACTIONS => {
1078                         "{" => 140
1079                 },
1080                 DEFAULT => -71,
1081                 GOTOS => {
1082                         'union_body' => 141,
1083                         'opt_union_body' => 139
1084                 }
1085         },
1086         {#State 128
1087                 DEFAULT => -38
1088         },
1089         {#State 129
1090                 ACTIONS => {
1091                         "{" => 143
1092                 },
1093                 DEFAULT => -61,
1094                 GOTOS => {
1095                         'struct_body' => 142,
1096                         'opt_struct_body' => 144
1097                 }
1098         },
1099         {#State 130
1100                 DEFAULT => -118
1101         },
1102         {#State 131
1103                 ACTIONS => {
1104                         "{" => 145
1105                 },
1106                 DEFAULT => -44,
1107                 GOTOS => {
1108                         'opt_enum_body' => 147,
1109                         'enum_body' => 146
1110                 }
1111         },
1112         {#State 132
1113                 ACTIONS => {
1114                         "{" => 149
1115                 },
1116                 DEFAULT => -52,
1117                 GOTOS => {
1118                         'bitmap_body' => 150,
1119                         'opt_bitmap_body' => 148
1120                 }
1121         },
1122         {#State 133
1123                 DEFAULT => -77
1124         },
1125         {#State 134
1126                 ACTIONS => {
1127                         "(" => 151
1128                 }
1129         },
1130         {#State 135
1131                 ACTIONS => {
1132                         'IDENTIFIER' => 26,
1133                         "*" => 153
1134                 },
1135                 GOTOS => {
1136                         'identifier' => 152
1137                 }
1138         },
1139         {#State 136
1140                 ACTIONS => {
1141                         'CONSTANT' => 48,
1142                         'TEXT' => 16,
1143                         'IDENTIFIER' => 26
1144                 },
1145                 DEFAULT => -97,
1146                 GOTOS => {
1147                         'identifier' => 50,
1148                         'anytext' => 154,
1149                         'text' => 51,
1150                         'constant' => 47
1151                 }
1152         },
1153         {#State 137
1154                 ACTIONS => {
1155                         'CONSTANT' => 48,
1156                         'TEXT' => 16,
1157                         'IDENTIFIER' => 26
1158                 },
1159                 DEFAULT => -97,
1160                 GOTOS => {
1161                         'identifier' => 50,
1162                         'anytext' => 155,
1163                         'text' => 51,
1164                         'constant' => 47
1165                 }
1166         },
1167         {#State 138
1168                 ACTIONS => {
1169                         'IDENTIFIER' => 26,
1170                         "*" => 153
1171                 },
1172                 GOTOS => {
1173                         'identifier' => 156
1174                 }
1175         },
1176         {#State 139
1177                 DEFAULT => -73
1178         },
1179         {#State 140
1180                 DEFAULT => -68,
1181                 GOTOS => {
1182                         'union_elements' => 157
1183                 }
1184         },
1185         {#State 141
1186                 DEFAULT => -72
1187         },
1188         {#State 142
1189                 DEFAULT => -62
1190         },
1191         {#State 143
1192                 DEFAULT => -78,
1193                 GOTOS => {
1194                         'element_list1' => 158
1195                 }
1196         },
1197         {#State 144
1198                 DEFAULT => -63
1199         },
1200         {#State 145
1201                 ACTIONS => {
1202                         'IDENTIFIER' => 26
1203                 },
1204                 GOTOS => {
1205                         'identifier' => 159,
1206                         'enum_element' => 160,
1207                         'enum_elements' => 161
1208                 }
1209         },
1210         {#State 146
1211                 DEFAULT => -45
1212         },
1213         {#State 147
1214                 DEFAULT => -46
1215         },
1216         {#State 148
1217                 DEFAULT => -54
1218         },
1219         {#State 149
1220                 ACTIONS => {
1221                         'IDENTIFIER' => 26
1222                 },
1223                 DEFAULT => -57,
1224                 GOTOS => {
1225                         'identifier' => 164,
1226                         'bitmap_element' => 163,
1227                         'bitmap_elements' => 162,
1228                         'opt_bitmap_elements' => 165
1229                 }
1230         },
1231         {#State 150
1232                 DEFAULT => -53
1233         },
1234         {#State 151
1235                 ACTIONS => {
1236                         "," => -82,
1237                         "void" => 169,
1238                         "const" => 167,
1239                         ")" => -82
1240                 },
1241                 DEFAULT => -80,
1242                 GOTOS => {
1243                         'optional_const' => 166,
1244                         'element_list2' => 168
1245                 }
1246         },
1247         {#State 152
1248                 ACTIONS => {
1249                         "[" => 170,
1250                         "=" => 172
1251                 },
1252                 GOTOS => {
1253                         'array_len' => 171
1254                 }
1255         },
1256         {#State 153
1257                 DEFAULT => -76
1258         },
1259         {#State 154
1260                 ACTIONS => {
1261                         "-" => 69,
1262                         ":" => 68,
1263                         "<" => 71,
1264                         "+" => 73,
1265                         "~" => 72,
1266                         "*" => 80,
1267                         "?" => 70,
1268                         "{" => 74,
1269                         "&" => 75,
1270                         "/" => 76,
1271                         "=" => 77,
1272                         "(" => 78,
1273                         "|" => 79,
1274                         "." => 81,
1275                         ">" => 82
1276                 },
1277                 DEFAULT => -115
1278         },
1279         {#State 155
1280                 ACTIONS => {
1281                         ":" => 68,
1282                         "<" => 71,
1283                         "~" => 72,
1284                         "?" => 70,
1285                         "{" => 74,
1286                         "=" => 77
1287                 },
1288                 DEFAULT => -114
1289         },
1290         {#State 156
1291                 ACTIONS => {
1292                         "[" => 170
1293                 },
1294                 DEFAULT => -86,
1295                 GOTOS => {
1296                         'array_len' => 173
1297                 }
1298         },
1299         {#State 157
1300                 ACTIONS => {
1301                         "}" => 174
1302                 },
1303                 DEFAULT => -89,
1304                 GOTOS => {
1305                         'optional_base_element' => 176,
1306                         'property_list' => 175
1307                 }
1308         },
1309         {#State 158
1310                 ACTIONS => {
1311                         "}" => 177
1312                 },
1313                 DEFAULT => -89,
1314                 GOTOS => {
1315                         'base_element' => 178,
1316                         'property_list' => 179
1317                 }
1318         },
1319         {#State 159
1320                 ACTIONS => {
1321                         "=" => 180
1322                 },
1323                 DEFAULT => -49
1324         },
1325         {#State 160
1326                 DEFAULT => -47
1327         },
1328         {#State 161
1329                 ACTIONS => {
1330                         "}" => 181,
1331                         "," => 182
1332                 }
1333         },
1334         {#State 162
1335                 ACTIONS => {
1336                         "," => 183
1337                 },
1338                 DEFAULT => -58
1339         },
1340         {#State 163
1341                 DEFAULT => -55
1342         },
1343         {#State 164
1344                 ACTIONS => {
1345                         "=" => 184
1346                 }
1347         },
1348         {#State 165
1349                 ACTIONS => {
1350                         "}" => 185
1351                 }
1352         },
1353         {#State 166
1354                 DEFAULT => -89,
1355                 GOTOS => {
1356                         'base_element' => 186,
1357                         'property_list' => 179
1358                 }
1359         },
1360         {#State 167
1361                 DEFAULT => -81
1362         },
1363         {#State 168
1364                 ACTIONS => {
1365                         "," => 187,
1366                         ")" => 188
1367                 }
1368         },
1369         {#State 169
1370                 DEFAULT => -83
1371         },
1372         {#State 170
1373                 ACTIONS => {
1374                         'CONSTANT' => 48,
1375                         'TEXT' => 16,
1376                         "]" => 189,
1377                         'IDENTIFIER' => 26
1378                 },
1379                 DEFAULT => -97,
1380                 GOTOS => {
1381                         'identifier' => 50,
1382                         'anytext' => 190,
1383                         'text' => 51,
1384                         'constant' => 47
1385                 }
1386         },
1387         {#State 171
1388                 ACTIONS => {
1389                         "=" => 191
1390                 }
1391         },
1392         {#State 172
1393                 ACTIONS => {
1394                         'CONSTANT' => 48,
1395                         'TEXT' => 16,
1396                         'IDENTIFIER' => 26
1397                 },
1398                 DEFAULT => -97,
1399                 GOTOS => {
1400                         'identifier' => 50,
1401                         'anytext' => 192,
1402                         'text' => 51,
1403                         'constant' => 47
1404                 }
1405         },
1406         {#State 173
1407                 ACTIONS => {
1408                         ";" => 193
1409                 }
1410         },
1411         {#State 174
1412                 DEFAULT => -70
1413         },
1414         {#State 175
1415                 ACTIONS => {
1416                         "[" => 20
1417                 },
1418                 DEFAULT => -89,
1419                 GOTOS => {
1420                         'base_or_empty' => 194,
1421                         'base_element' => 195,
1422                         'empty_element' => 196,
1423                         'property_list' => 197
1424                 }
1425         },
1426         {#State 176
1427                 DEFAULT => -69
1428         },
1429         {#State 177
1430                 DEFAULT => -60
1431         },
1432         {#State 178
1433                 ACTIONS => {
1434                         ";" => 198
1435                 }
1436         },
1437         {#State 179
1438                 ACTIONS => {
1439                         'IDENTIFIER' => 26,
1440                         "signed" => 100,
1441                         'void' => 93,
1442                         "unsigned" => 104,
1443                         "[" => 20
1444                 },
1445                 DEFAULT => -89,
1446                 GOTOS => {
1447                         'existingtype' => 99,
1448                         'pipe' => 56,
1449                         'bitmap' => 57,
1450                         'usertype' => 95,
1451                         'property_list' => 94,
1452                         'identifier' => 96,
1453                         'struct' => 62,
1454                         'enum' => 65,
1455                         'type' => 199,
1456                         'union' => 67,
1457                         'sign' => 97
1458                 }
1459         },
1460         {#State 180
1461                 ACTIONS => {
1462                         'CONSTANT' => 48,
1463                         'TEXT' => 16,
1464                         'IDENTIFIER' => 26
1465                 },
1466                 DEFAULT => -97,
1467                 GOTOS => {
1468                         'identifier' => 50,
1469                         'anytext' => 200,
1470                         'text' => 51,
1471                         'constant' => 47
1472                 }
1473         },
1474         {#State 181
1475                 DEFAULT => -43
1476         },
1477         {#State 182
1478                 ACTIONS => {
1479                         'IDENTIFIER' => 26
1480                 },
1481                 GOTOS => {
1482                         'identifier' => 159,
1483                         'enum_element' => 201
1484                 }
1485         },
1486         {#State 183
1487                 ACTIONS => {
1488                         'IDENTIFIER' => 26
1489                 },
1490                 GOTOS => {
1491                         'identifier' => 164,
1492                         'bitmap_element' => 202
1493                 }
1494         },
1495         {#State 184
1496                 ACTIONS => {
1497                         'CONSTANT' => 48,
1498                         'TEXT' => 16,
1499                         'IDENTIFIER' => 26
1500                 },
1501                 DEFAULT => -97,
1502                 GOTOS => {
1503                         'identifier' => 50,
1504                         'anytext' => 203,
1505                         'text' => 51,
1506                         'constant' => 47
1507                 }
1508         },
1509         {#State 185
1510                 DEFAULT => -51
1511         },
1512         {#State 186
1513                 DEFAULT => -84
1514         },
1515         {#State 187
1516                 ACTIONS => {
1517                         "const" => 167
1518                 },
1519                 DEFAULT => -80,
1520                 GOTOS => {
1521                         'optional_const' => 204
1522                 }
1523         },
1524         {#State 188
1525                 ACTIONS => {
1526                         ";" => 205
1527                 }
1528         },
1529         {#State 189
1530                 ACTIONS => {
1531                         "[" => 170
1532                 },
1533                 DEFAULT => -86,
1534                 GOTOS => {
1535                         'array_len' => 206
1536                 }
1537         },
1538         {#State 190
1539                 ACTIONS => {
1540                         "-" => 69,
1541                         ":" => 68,
1542                         "?" => 70,
1543                         "<" => 71,
1544                         "+" => 73,
1545                         "~" => 72,
1546                         "&" => 75,
1547                         "{" => 74,
1548                         "/" => 76,
1549                         "=" => 77,
1550                         "|" => 79,
1551                         "(" => 78,
1552                         "*" => 80,
1553                         "." => 81,
1554                         "]" => 207,
1555                         ">" => 82
1556                 }
1557         },
1558         {#State 191
1559                 ACTIONS => {
1560                         'CONSTANT' => 48,
1561                         'TEXT' => 16,
1562                         'IDENTIFIER' => 26
1563                 },
1564                 DEFAULT => -97,
1565                 GOTOS => {
1566                         'identifier' => 50,
1567                         'anytext' => 208,
1568                         'text' => 51,
1569                         'constant' => 47
1570                 }
1571         },
1572         {#State 192
1573                 ACTIONS => {
1574                         "-" => 69,
1575                         ":" => 68,
1576                         "?" => 70,
1577                         "<" => 71,
1578                         ";" => 209,
1579                         "+" => 73,
1580                         "~" => 72,
1581                         "&" => 75,
1582                         "{" => 74,
1583                         "/" => 76,
1584                         "=" => 77,
1585                         "|" => 79,
1586                         "(" => 78,
1587                         "*" => 80,
1588                         "." => 81,
1589                         ">" => 82
1590                 }
1591         },
1592         {#State 193
1593                 DEFAULT => -29
1594         },
1595         {#State 194
1596                 DEFAULT => -67
1597         },
1598         {#State 195
1599                 ACTIONS => {
1600                         ";" => 210
1601                 }
1602         },
1603         {#State 196
1604                 DEFAULT => -66
1605         },
1606         {#State 197
1607                 ACTIONS => {
1608                         'IDENTIFIER' => 26,
1609                         "signed" => 100,
1610                         ";" => 211,
1611                         'void' => 93,
1612                         "unsigned" => 104,
1613                         "[" => 20
1614                 },
1615                 DEFAULT => -89,
1616                 GOTOS => {
1617                         'existingtype' => 99,
1618                         'pipe' => 56,
1619                         'bitmap' => 57,
1620                         'usertype' => 95,
1621                         'property_list' => 94,
1622                         'identifier' => 96,
1623                         'struct' => 62,
1624                         'enum' => 65,
1625                         'type' => 199,
1626                         'union' => 67,
1627                         'sign' => 97
1628                 }
1629         },
1630         {#State 198
1631                 DEFAULT => -79
1632         },
1633         {#State 199
1634                 DEFAULT => -75,
1635                 GOTOS => {
1636                         'pointers' => 212
1637                 }
1638         },
1639         {#State 200
1640                 ACTIONS => {
1641                         "-" => 69,
1642                         ":" => 68,
1643                         "<" => 71,
1644                         "+" => 73,
1645                         "~" => 72,
1646                         "*" => 80,
1647                         "?" => 70,
1648                         "{" => 74,
1649                         "&" => 75,
1650                         "/" => 76,
1651                         "=" => 77,
1652                         "(" => 78,
1653                         "|" => 79,
1654                         "." => 81,
1655                         ">" => 82
1656                 },
1657                 DEFAULT => -50
1658         },
1659         {#State 201
1660                 DEFAULT => -48
1661         },
1662         {#State 202
1663                 DEFAULT => -56
1664         },
1665         {#State 203
1666                 ACTIONS => {
1667                         "-" => 69,
1668                         ":" => 68,
1669                         "<" => 71,
1670                         "+" => 73,
1671                         "~" => 72,
1672                         "*" => 80,
1673                         "?" => 70,
1674                         "{" => 74,
1675                         "&" => 75,
1676                         "/" => 76,
1677                         "=" => 77,
1678                         "(" => 78,
1679                         "|" => 79,
1680                         "." => 81,
1681                         ">" => 82
1682                 },
1683                 DEFAULT => -59
1684         },
1685         {#State 204
1686                 DEFAULT => -89,
1687                 GOTOS => {
1688                         'base_element' => 213,
1689                         'property_list' => 179
1690                 }
1691         },
1692         {#State 205
1693                 DEFAULT => -28
1694         },
1695         {#State 206
1696                 DEFAULT => -87
1697         },
1698         {#State 207
1699                 ACTIONS => {
1700                         "[" => 170
1701                 },
1702                 DEFAULT => -86,
1703                 GOTOS => {
1704                         'array_len' => 214
1705                 }
1706         },
1707         {#State 208
1708                 ACTIONS => {
1709                         "-" => 69,
1710                         ":" => 68,
1711                         "?" => 70,
1712                         "<" => 71,
1713                         ";" => 215,
1714                         "+" => 73,
1715                         "~" => 72,
1716                         "&" => 75,
1717                         "{" => 74,
1718                         "/" => 76,
1719                         "=" => 77,
1720                         "|" => 79,
1721                         "(" => 78,
1722                         "*" => 80,
1723                         "." => 81,
1724                         ">" => 82
1725                 }
1726         },
1727         {#State 209
1728                 DEFAULT => -26
1729         },
1730         {#State 210
1731                 DEFAULT => -65
1732         },
1733         {#State 211
1734                 DEFAULT => -64
1735         },
1736         {#State 212
1737                 ACTIONS => {
1738                         'IDENTIFIER' => 26,
1739                         "*" => 153
1740                 },
1741                 GOTOS => {
1742                         'identifier' => 216
1743                 }
1744         },
1745         {#State 213
1746                 DEFAULT => -85
1747         },
1748         {#State 214
1749                 DEFAULT => -88
1750         },
1751         {#State 215
1752                 DEFAULT => -27
1753         },
1754         {#State 216
1755                 ACTIONS => {
1756                         "[" => 170
1757                 },
1758                 DEFAULT => -86,
1759                 GOTOS => {
1760                         'array_len' => 217
1761                 }
1762         },
1763         {#State 217
1764                 DEFAULT => -74
1765         }
1766 ],
1767                                   yyrules  =>
1768 [
1769         [#Rule 0
1770                  '$start', 2, undef
1771         ],
1772         [#Rule 1
1773                  'idl', 0, undef
1774         ],
1775         [#Rule 2
1776                  'idl', 2,
1777 sub
1778 #line 20 "idl.yp"
1779 { push(@{$_[1]}, $_[2]); $_[1] }
1780         ],
1781         [#Rule 3
1782                  'idl', 2,
1783 sub
1784 #line 22 "idl.yp"
1785 { push(@{$_[1]}, $_[2]); $_[1] }
1786         ],
1787         [#Rule 4
1788                  'idl', 2,
1789 sub
1790 #line 24 "idl.yp"
1791 { push(@{$_[1]}, $_[2]); $_[1] }
1792         ],
1793         [#Rule 5
1794                  'idl', 2,
1795 sub
1796 #line 26 "idl.yp"
1797 { push(@{$_[1]}, $_[2]); $_[1] }
1798         ],
1799         [#Rule 6
1800                  'idl', 2,
1801 sub
1802 #line 28 "idl.yp"
1803 { push(@{$_[1]}, $_[2]); $_[1] }
1804         ],
1805         [#Rule 7
1806                  'idl', 2,
1807 sub
1808 #line 30 "idl.yp"
1809 { push(@{$_[1]}, $_[2]); $_[1] }
1810         ],
1811         [#Rule 8
1812                  'import', 3,
1813 sub
1814 #line 35 "idl.yp"
1815 {{
1816                 "TYPE" => "IMPORT",
1817                 "PATHS" => $_[2],
1818                 "FILE" => $_[0]->YYData->{FILE},
1819                 "LINE" => $_[0]->YYData->{LINE},
1820         }}
1821         ],
1822         [#Rule 9
1823                  'include', 3,
1824 sub
1825 #line 45 "idl.yp"
1826 {{
1827                 "TYPE" => "INCLUDE",
1828                 "PATHS" => $_[2],
1829                 "FILE" => $_[0]->YYData->{FILE},
1830                 "LINE" => $_[0]->YYData->{LINE},
1831         }}
1832         ],
1833         [#Rule 10
1834                  'importlib', 3,
1835 sub
1836 #line 55 "idl.yp"
1837 {{
1838                 "TYPE" => "IMPORTLIB",
1839                 "PATHS" => $_[2],
1840                 "FILE" => $_[0]->YYData->{FILE},
1841                 "LINE" => $_[0]->YYData->{LINE},
1842         }}
1843         ],
1844         [#Rule 11
1845                  'commalist', 1,
1846 sub
1847 #line 64 "idl.yp"
1848 { [ $_[1] ] }
1849         ],
1850         [#Rule 12
1851                  'commalist', 3,
1852 sub
1853 #line 66 "idl.yp"
1854 { push(@{$_[1]}, $_[3]); $_[1] }
1855         ],
1856         [#Rule 13
1857                  'coclass', 7,
1858 sub
1859 #line 71 "idl.yp"
1860 {{
1861                 "TYPE" => "COCLASS",
1862                 "PROPERTIES" => $_[1],
1863                 "NAME" => $_[3],
1864                 "DATA" => $_[5],
1865                 "FILE" => $_[0]->YYData->{FILE},
1866                 "LINE" => $_[0]->YYData->{LINE},
1867         }}
1868         ],
1869         [#Rule 14
1870                  'interface_names', 0, undef
1871         ],
1872         [#Rule 15
1873                  'interface_names', 4,
1874 sub
1875 #line 84 "idl.yp"
1876 { push(@{$_[1]}, $_[2]); $_[1] }
1877         ],
1878         [#Rule 16
1879                  'interface', 8,
1880 sub
1881 #line 89 "idl.yp"
1882 {{
1883                 "TYPE" => "INTERFACE",
1884                 "PROPERTIES" => $_[1],
1885                 "NAME" => $_[3],
1886                 "BASE" => $_[4],
1887                 "DATA" => $_[6],
1888                 "FILE" => $_[0]->YYData->{FILE},
1889                 "LINE" => $_[0]->YYData->{LINE},
1890         }}
1891         ],
1892         [#Rule 17
1893                  'base_interface', 0, undef
1894         ],
1895         [#Rule 18
1896                  'base_interface', 2,
1897 sub
1898 #line 103 "idl.yp"
1899 { $_[2] }
1900         ],
1901         [#Rule 19
1902                  'cpp_quote', 4,
1903 sub
1904 #line 109 "idl.yp"
1905 {{
1906                  "TYPE" => "CPP_QUOTE",
1907                  "DATA" => $_[3],
1908                  "FILE" => $_[0]->YYData->{FILE},
1909                  "LINE" => $_[0]->YYData->{LINE},
1910         }}
1911         ],
1912         [#Rule 20
1913                  'definitions', 1,
1914 sub
1915 #line 118 "idl.yp"
1916 { [ $_[1] ] }
1917         ],
1918         [#Rule 21
1919                  'definitions', 2,
1920 sub
1921 #line 120 "idl.yp"
1922 { push(@{$_[1]}, $_[2]); $_[1] }
1923         ],
1924         [#Rule 22
1925                  'definition', 1, undef
1926         ],
1927         [#Rule 23
1928                  'definition', 1, undef
1929         ],
1930         [#Rule 24
1931                  'definition', 1, undef
1932         ],
1933         [#Rule 25
1934                  'definition', 1, undef
1935         ],
1936         [#Rule 26
1937                  'const', 7,
1938 sub
1939 #line 135 "idl.yp"
1940 {{
1941                 "TYPE"  => "CONST",
1942                 "DTYPE"  => $_[2],
1943                 "POINTERS" => $_[3],
1944                 "NAME"  => $_[4],
1945                 "VALUE" => $_[6],
1946                 "FILE" => $_[0]->YYData->{FILE},
1947                 "LINE" => $_[0]->YYData->{LINE},
1948         }}
1949         ],
1950         [#Rule 27
1951                  'const', 8,
1952 sub
1953 #line 146 "idl.yp"
1954 {{
1955                 "TYPE"  => "CONST",
1956                 "DTYPE"  => $_[2],
1957                 "POINTERS" => $_[3],
1958                 "NAME"  => $_[4],
1959                 "ARRAY_LEN" => $_[5],
1960                 "VALUE" => $_[7],
1961                 "FILE" => $_[0]->YYData->{FILE},
1962                 "LINE" => $_[0]->YYData->{LINE},
1963         }}
1964         ],
1965         [#Rule 28
1966                  'function', 7,
1967 sub
1968 #line 160 "idl.yp"
1969 {{
1970                 "TYPE" => "FUNCTION",
1971                 "NAME" => $_[3],
1972                 "RETURN_TYPE" => $_[2],
1973                 "PROPERTIES" => $_[1],
1974                 "ELEMENTS" => $_[5],
1975                 "FILE" => $_[0]->YYData->{FILE},
1976                 "LINE" => $_[0]->YYData->{LINE},
1977         }}
1978         ],
1979         [#Rule 29
1980                  'typedef', 7,
1981 sub
1982 #line 173 "idl.yp"
1983 {{
1984                 "TYPE" => "TYPEDEF",
1985                 "PROPERTIES" => $_[1],
1986                 "NAME" => $_[5],
1987                 "DATA" => $_[3],
1988                 "POINTERS" => $_[4],
1989                 "ARRAY_LEN" => $_[6],
1990                 "FILE" => $_[0]->YYData->{FILE},
1991                 "LINE" => $_[0]->YYData->{LINE},
1992         }}
1993         ],
1994         [#Rule 30
1995                  'usertype', 1, undef
1996         ],
1997         [#Rule 31
1998                  'usertype', 1, undef
1999         ],
2000         [#Rule 32
2001                  'usertype', 1, undef
2002         ],
2003         [#Rule 33
2004                  'usertype', 1, undef
2005         ],
2006         [#Rule 34
2007                  'usertype', 1, undef
2008         ],
2009         [#Rule 35
2010                  'typedecl', 2,
2011 sub
2012 #line 198 "idl.yp"
2013 { $_[1] }
2014         ],
2015         [#Rule 36
2016                  'sign', 1, undef
2017         ],
2018         [#Rule 37
2019                  'sign', 1, undef
2020         ],
2021         [#Rule 38
2022                  'existingtype', 2,
2023 sub
2024 #line 208 "idl.yp"
2025 { ($_[1]?$_[1]:"signed") ." $_[2]" }
2026         ],
2027         [#Rule 39
2028                  'existingtype', 1, undef
2029         ],
2030         [#Rule 40
2031                  'type', 1, undef
2032         ],
2033         [#Rule 41
2034                  'type', 1, undef
2035         ],
2036         [#Rule 42
2037                  'type', 1,
2038 sub
2039 #line 218 "idl.yp"
2040 { "void" }
2041         ],
2042         [#Rule 43
2043                  'enum_body', 3,
2044 sub
2045 #line 222 "idl.yp"
2046 { $_[2] }
2047         ],
2048         [#Rule 44
2049                  'opt_enum_body', 0, undef
2050         ],
2051         [#Rule 45
2052                  'opt_enum_body', 1, undef
2053         ],
2054         [#Rule 46
2055                  'enum', 4,
2056 sub
2057 #line 233 "idl.yp"
2058 {{
2059                 "TYPE" => "ENUM",
2060                 "PROPERTIES" => $_[1],
2061                 "NAME" => $_[3],
2062                 "ELEMENTS" => $_[4],
2063                 "FILE" => $_[0]->YYData->{FILE},
2064                 "LINE" => $_[0]->YYData->{LINE},
2065         }}
2066         ],
2067         [#Rule 47
2068                  'enum_elements', 1,
2069 sub
2070 #line 244 "idl.yp"
2071 { [ $_[1] ] }
2072         ],
2073         [#Rule 48
2074                  'enum_elements', 3,
2075 sub
2076 #line 246 "idl.yp"
2077 { push(@{$_[1]}, $_[3]); $_[1] }
2078         ],
2079         [#Rule 49
2080                  'enum_element', 1, undef
2081         ],
2082         [#Rule 50
2083                  'enum_element', 3,
2084 sub
2085 #line 252 "idl.yp"
2086 { "$_[1]$_[2]$_[3]" }
2087         ],
2088         [#Rule 51
2089                  'bitmap_body', 3,
2090 sub
2091 #line 256 "idl.yp"
2092 { $_[2] }
2093         ],
2094         [#Rule 52
2095                  'opt_bitmap_body', 0, undef
2096         ],
2097         [#Rule 53
2098                  'opt_bitmap_body', 1, undef
2099         ],
2100         [#Rule 54
2101                  'bitmap', 4,
2102 sub
2103 #line 267 "idl.yp"
2104 {{
2105                 "TYPE" => "BITMAP",
2106                 "PROPERTIES" => $_[1],
2107                 "NAME" => $_[3],
2108                 "ELEMENTS" => $_[4],
2109                 "FILE" => $_[0]->YYData->{FILE},
2110                 "LINE" => $_[0]->YYData->{LINE},
2111         }}
2112         ],
2113         [#Rule 55
2114                  'bitmap_elements', 1,
2115 sub
2116 #line 278 "idl.yp"
2117 { [ $_[1] ] }
2118         ],
2119         [#Rule 56
2120                  'bitmap_elements', 3,
2121 sub
2122 #line 280 "idl.yp"
2123 { push(@{$_[1]}, $_[3]); $_[1] }
2124         ],
2125         [#Rule 57
2126                  'opt_bitmap_elements', 0, undef
2127         ],
2128         [#Rule 58
2129                  'opt_bitmap_elements', 1, undef
2130         ],
2131         [#Rule 59
2132                  'bitmap_element', 3,
2133 sub
2134 #line 290 "idl.yp"
2135 { "$_[1] ( $_[3] )" }
2136         ],
2137         [#Rule 60
2138                  'struct_body', 3,
2139 sub
2140 #line 294 "idl.yp"
2141 { $_[2] }
2142         ],
2143         [#Rule 61
2144                  'opt_struct_body', 0, undef
2145         ],
2146         [#Rule 62
2147                  'opt_struct_body', 1, undef
2148         ],
2149         [#Rule 63
2150                  'struct', 4,
2151 sub
2152 #line 305 "idl.yp"
2153 {{
2154                 "TYPE" => "STRUCT",
2155                 "PROPERTIES" => $_[1],
2156                 "NAME" => $_[3],
2157                 "ELEMENTS" => $_[4],
2158                 "FILE" => $_[0]->YYData->{FILE},
2159                 "LINE" => $_[0]->YYData->{LINE},
2160         }}
2161         ],
2162         [#Rule 64
2163                  'empty_element', 2,
2164 sub
2165 #line 317 "idl.yp"
2166 {{
2167                 "NAME" => "",
2168                 "TYPE" => "EMPTY",
2169                 "PROPERTIES" => $_[1],
2170                 "POINTERS" => 0,
2171                 "ARRAY_LEN" => [],
2172                 "FILE" => $_[0]->YYData->{FILE},
2173                 "LINE" => $_[0]->YYData->{LINE},
2174         }}
2175         ],
2176         [#Rule 65
2177                  'base_or_empty', 2, undef
2178         ],
2179         [#Rule 66
2180                  'base_or_empty', 1, undef
2181         ],
2182         [#Rule 67
2183                  'optional_base_element', 2,
2184 sub
2185 #line 334 "idl.yp"
2186 { $_[2]->{PROPERTIES} = FlattenHash([$_[1],$_[2]->{PROPERTIES}]); $_[2] }
2187         ],
2188         [#Rule 68
2189                  'union_elements', 0, undef
2190         ],
2191         [#Rule 69
2192                  'union_elements', 2,
2193 sub
2194 #line 340 "idl.yp"
2195 { push(@{$_[1]}, $_[2]); $_[1] }
2196         ],
2197         [#Rule 70
2198                  'union_body', 3,
2199 sub
2200 #line 344 "idl.yp"
2201 { $_[2] }
2202         ],
2203         [#Rule 71
2204                  'opt_union_body', 0, undef
2205         ],
2206         [#Rule 72
2207                  'opt_union_body', 1, undef
2208         ],
2209         [#Rule 73
2210                  'union', 4,
2211 sub
2212 #line 355 "idl.yp"
2213 {{
2214                 "TYPE" => "UNION",
2215                 "PROPERTIES" => $_[1],
2216                 "NAME" => $_[3],
2217                 "ELEMENTS" => $_[4],
2218                 "FILE" => $_[0]->YYData->{FILE},
2219                 "LINE" => $_[0]->YYData->{LINE},
2220         }}
2221         ],
2222         [#Rule 74
2223                  'base_element', 5,
2224 sub
2225 #line 367 "idl.yp"
2226 {{
2227                 "NAME" => $_[4],
2228                 "TYPE" => $_[2],
2229                 "PROPERTIES" => $_[1],
2230                 "POINTERS" => $_[3],
2231                 "ARRAY_LEN" => $_[5],
2232                 "FILE" => $_[0]->YYData->{FILE},
2233                 "LINE" => $_[0]->YYData->{LINE},
2234         }}
2235         ],
2236         [#Rule 75
2237                  'pointers', 0,
2238 sub
2239 #line 380 "idl.yp"
2240 { 0 }
2241         ],
2242         [#Rule 76
2243                  'pointers', 2,
2244 sub
2245 #line 382 "idl.yp"
2246 { $_[1]+1 }
2247         ],
2248         [#Rule 77
2249                  'pipe', 3,
2250 sub
2251 #line 387 "idl.yp"
2252 {{
2253                 "TYPE" => "PIPE",
2254                 "PROPERTIES" => $_[1],
2255                 "NAME" => undef,
2256                 "DATA" => {
2257                         "TYPE" => "STRUCT",
2258                         "PROPERTIES" => $_[1],
2259                         "NAME" => undef,
2260                         "ELEMENTS" => [{
2261                                 "NAME" => "count",
2262                                 "PROPERTIES" => $_[1],
2263                                 "POINTERS" => 0,
2264                                 "ARRAY_LEN" => [],
2265                                 "TYPE" => "uint3264",
2266                                 "FILE" => $_[0]->YYData->{FILE},
2267                                 "LINE" => $_[0]->YYData->{LINE},
2268                         },{
2269                                 "NAME" => "array",
2270                                 "PROPERTIES" => $_[1],
2271                                 "POINTERS" => 0,
2272                                 "ARRAY_LEN" => [ "count" ],
2273                                 "TYPE" => $_[3],
2274                                 "FILE" => $_[0]->YYData->{FILE},
2275                                 "LINE" => $_[0]->YYData->{LINE},
2276                         }],
2277                         "FILE" => $_[0]->YYData->{FILE},
2278                         "LINE" => $_[0]->YYData->{LINE},
2279                 },
2280                 "FILE" => $_[0]->YYData->{FILE},
2281                 "LINE" => $_[0]->YYData->{LINE},
2282         }}
2283         ],
2284         [#Rule 78
2285                  'element_list1', 0,
2286 sub
2287 #line 422 "idl.yp"
2288 { [] }
2289         ],
2290         [#Rule 79
2291                  'element_list1', 3,
2292 sub
2293 #line 424 "idl.yp"
2294 { push(@{$_[1]}, $_[2]); $_[1] }
2295         ],
2296         [#Rule 80
2297                  'optional_const', 0, undef
2298         ],
2299         [#Rule 81
2300                  'optional_const', 1, undef
2301         ],
2302         [#Rule 82
2303                  'element_list2', 0, undef
2304         ],
2305         [#Rule 83
2306                  'element_list2', 1, undef
2307         ],
2308         [#Rule 84
2309                  'element_list2', 2,
2310 sub
2311 #line 438 "idl.yp"
2312 { [ $_[2] ] }
2313         ],
2314         [#Rule 85
2315                  'element_list2', 4,
2316 sub
2317 #line 440 "idl.yp"
2318 { push(@{$_[1]}, $_[4]); $_[1] }
2319         ],
2320         [#Rule 86
2321                  'array_len', 0, undef
2322         ],
2323         [#Rule 87
2324                  'array_len', 3,
2325 sub
2326 #line 446 "idl.yp"
2327 { push(@{$_[3]}, "*"); $_[3] }
2328         ],
2329         [#Rule 88
2330                  'array_len', 4,
2331 sub
2332 #line 448 "idl.yp"
2333 { push(@{$_[4]}, "$_[2]"); $_[4] }
2334         ],
2335         [#Rule 89
2336                  'property_list', 0, undef
2337         ],
2338         [#Rule 90
2339                  'property_list', 4,
2340 sub
2341 #line 454 "idl.yp"
2342 { FlattenHash([$_[1],$_[3]]); }
2343         ],
2344         [#Rule 91
2345                  'properties', 1,
2346 sub
2347 #line 458 "idl.yp"
2348 { $_[1] }
2349         ],
2350         [#Rule 92
2351                  'properties', 3,
2352 sub
2353 #line 460 "idl.yp"
2354 { FlattenHash([$_[1], $_[3]]); }
2355         ],
2356         [#Rule 93
2357                  'property', 1,
2358 sub
2359 #line 464 "idl.yp"
2360 {{ "$_[1]" => "1"     }}
2361         ],
2362         [#Rule 94
2363                  'property', 4,
2364 sub
2365 #line 466 "idl.yp"
2366 {{ "$_[1]" => "$_[3]" }}
2367         ],
2368         [#Rule 95
2369                  'commalisttext', 1, undef
2370         ],
2371         [#Rule 96
2372                  'commalisttext', 3,
2373 sub
2374 #line 472 "idl.yp"
2375 { "$_[1],$_[3]" }
2376         ],
2377         [#Rule 97
2378                  'anytext', 0,
2379 sub
2380 #line 477 "idl.yp"
2381 { "" }
2382         ],
2383         [#Rule 98
2384                  'anytext', 1, undef
2385         ],
2386         [#Rule 99
2387                  'anytext', 1, undef
2388         ],
2389         [#Rule 100
2390                  'anytext', 1, undef
2391         ],
2392         [#Rule 101
2393                  'anytext', 3,
2394 sub
2395 #line 485 "idl.yp"
2396 { "$_[1]$_[2]$_[3]" }
2397         ],
2398         [#Rule 102
2399                  'anytext', 3,
2400 sub
2401 #line 487 "idl.yp"
2402 { "$_[1]$_[2]$_[3]" }
2403         ],
2404         [#Rule 103
2405                  'anytext', 3,
2406 sub
2407 #line 489 "idl.yp"
2408 { "$_[1]$_[2]$_[3]" }
2409         ],
2410         [#Rule 104
2411                  'anytext', 3,
2412 sub
2413 #line 491 "idl.yp"
2414 { "$_[1]$_[2]$_[3]" }
2415         ],
2416         [#Rule 105
2417                  'anytext', 3,
2418 sub
2419 #line 493 "idl.yp"
2420 { "$_[1]$_[2]$_[3]" }
2421         ],
2422         [#Rule 106
2423                  'anytext', 3,
2424 sub
2425 #line 495 "idl.yp"
2426 { "$_[1]$_[2]$_[3]" }
2427         ],
2428         [#Rule 107
2429                  'anytext', 3,
2430 sub
2431 #line 497 "idl.yp"
2432 { "$_[1]$_[2]$_[3]" }
2433         ],
2434         [#Rule 108
2435                  'anytext', 3,
2436 sub
2437 #line 499 "idl.yp"
2438 { "$_[1]$_[2]$_[3]" }
2439         ],
2440         [#Rule 109
2441                  'anytext', 3,
2442 sub
2443 #line 501 "idl.yp"
2444 { "$_[1]$_[2]$_[3]" }
2445         ],
2446         [#Rule 110
2447                  'anytext', 3,
2448 sub
2449 #line 503 "idl.yp"
2450 { "$_[1]$_[2]$_[3]" }
2451         ],
2452         [#Rule 111
2453                  'anytext', 3,
2454 sub
2455 #line 505 "idl.yp"
2456 { "$_[1]$_[2]$_[3]" }
2457         ],
2458         [#Rule 112
2459                  'anytext', 3,
2460 sub
2461 #line 507 "idl.yp"
2462 { "$_[1]$_[2]$_[3]" }
2463         ],
2464         [#Rule 113
2465                  'anytext', 3,
2466 sub
2467 #line 509 "idl.yp"
2468 { "$_[1]$_[2]$_[3]" }
2469         ],
2470         [#Rule 114
2471                  'anytext', 5,
2472 sub
2473 #line 511 "idl.yp"
2474 { "$_[1]$_[2]$_[3]$_[4]$_[5]" }
2475         ],
2476         [#Rule 115
2477                  'anytext', 5,
2478 sub
2479 #line 513 "idl.yp"
2480 { "$_[1]$_[2]$_[3]$_[4]$_[5]" }
2481         ],
2482         [#Rule 116
2483                  'identifier', 1, undef
2484         ],
2485         [#Rule 117
2486                  'optional_identifier', 0, undef
2487         ],
2488         [#Rule 118
2489                  'optional_identifier', 1, undef
2490         ],
2491         [#Rule 119
2492                  'optional_anonymous_identifier', 0,
2493 sub
2494 #line 503 "idl.yp"
2495 { anonymous_identifier($_[0]) }
2496         ],
2497         [#Rule 120
2498                  'optional_anonymous_identifier', 1, undef
2499         ],
2500         [#Rule 121
2501                  'constant', 1, undef
2502         ],
2503         [#Rule 122
2504                  'text', 1,
2505 sub
2506 <<<<<<< HEAD
2507 #line 531 "idl.yp"
2508 =======
2509 #line 513 "idl.yp"
2510 >>>>>>> 239255a... TODO pidl/IDL: give anonymous structs and unions a name...
2511 { "\"$_[1]\"" }
2512         ],
2513         [#Rule 123
2514                  'optional_semicolon', 0, undef
2515         ],
2516         [#Rule 124
2517                  'optional_semicolon', 1, undef
2518         ]
2519 ],
2520                                   @_);
2521     bless($self,$class);
2522 }
2523
2524 <<<<<<< HEAD
2525 #line 543 "idl.yp"
2526 =======
2527 #line 525 "idl.yp"
2528 >>>>>>> 239255a... TODO pidl/IDL: give anonymous structs and unions a name...
2529
2530
2531 use Parse::Pidl qw(error);
2532 use File::Basename;
2533
2534 #####################################################################
2535 # flatten an array of hashes into a single hash
2536 sub FlattenHash($)
2537 {
2538         my $a = shift;
2539         my %b;
2540         for my $d (@{$a}) {
2541                 for my $k (keys %{$d}) {
2542                 $b{$k} = $d->{$k};
2543                 }
2544         }
2545         return \%b;
2546 }
2547
2548 #####################################################################
2549 # traverse a perl data structure removing any empty arrays or
2550 # hashes and any hash elements that map to undef
2551 sub CleanData($)
2552 {
2553         sub CleanData($);
2554         my($v) = shift;
2555
2556         return undef if (not defined($v));
2557
2558         if (ref($v) eq "ARRAY") {
2559                 foreach my $i (0 .. $#{$v}) {
2560                         CleanData($v->[$i]);
2561                 }
2562                 # this removes any undefined elements from the array
2563                 @{$v} = grep { defined $_ } @{$v};
2564         } elsif (ref($v) eq "HASH") {
2565                 foreach my $x (keys %{$v}) {
2566                         CleanData($v->{$x});
2567                         if (!defined $v->{$x}) {
2568                                 delete($v->{$x});
2569                                 next;
2570                         }
2571                 }
2572         }
2573
2574         return $v;
2575 }
2576
2577 sub anonymous_identifier($)
2578 {
2579         my($parser)=shift;
2580         my $name = "__pidl_anonymous_";
2581         $name .= basename($parser->YYData->{FILE});
2582         $name .= "_";
2583         $name .= $parser->YYData->{LINE};
2584         $name .= "_";
2585         $name .= $parser->YYData->{ANONYMOUS_COUNTER}++;
2586
2587         $name =~ s/\./_/g;
2588         $name =~ s/\//_/g;
2589         $name =~ s/\\/_/g;
2590
2591         return $name;
2592 }
2593
2594 sub _Error {
2595         if (exists $_[0]->YYData->{ERRMSG}) {
2596                 error($_[0]->YYData, $_[0]->YYData->{ERRMSG});
2597                 delete $_[0]->YYData->{ERRMSG};
2598                 return;
2599         }
2600
2601         my $last_token = $_[0]->YYData->{LAST_TOKEN};
2602
2603         error($_[0]->YYData, "Syntax error near '$last_token'");
2604 }
2605
2606 sub _Lexer($)
2607 {
2608         my($parser)=shift;
2609
2610         $parser->YYData->{INPUT} or return('',undef);
2611
2612 again:
2613         $parser->YYData->{INPUT} =~ s/^[ \t]*//;
2614
2615         for ($parser->YYData->{INPUT}) {
2616                 if (/^\#/) {
2617                         # Linemarker format is described at
2618                         # http://gcc.gnu.org/onlinedocs/cpp/Preprocessor-Output.html
2619                         if (s/^\# (\d+) \"(.*?)\"(( \d+){1,4}|)//) {
2620                                 $parser->YYData->{LINE} = $1-1;
2621                                 $parser->YYData->{FILE} = $2;
2622                                 goto again;
2623                         }
2624                         if (s/^\#line (\d+) \"(.*?)\"( \d+|)//) {
2625                                 $parser->YYData->{LINE} = $1-1;
2626                                 $parser->YYData->{FILE} = $2;
2627                                 goto again;
2628                         }
2629                         if (s/^(\#.*)$//m) {
2630                                 goto again;
2631                         }
2632                 }
2633                 if (s/^(\n)//) {
2634                         $parser->YYData->{LINE}++;
2635                         goto again;
2636                 }
2637                 if (s/^\"(.*?)\"//) {
2638                         $parser->YYData->{LAST_TOKEN} = $1;
2639                         return('TEXT',$1);
2640                 }
2641                 if (s/^(\d+)(\W|$)/$2/) {
2642                         $parser->YYData->{LAST_TOKEN} = $1;
2643                         return('CONSTANT',$1);
2644                 }
2645                 if (s/^([\w_]+)//) {
2646                         $parser->YYData->{LAST_TOKEN} = $1;
2647                         if ($1 =~
2648                             /^(coclass|interface|import|importlib
2649                               |include|cpp_quote|typedef
2650                               |union|struct|enum|bitmap|pipe
2651                               |void|const|unsigned|signed)$/x) {
2652                                 return $1;
2653                         }
2654                         return('IDENTIFIER',$1);
2655                 }
2656                 if (s/^(.)//s) {
2657                         $parser->YYData->{LAST_TOKEN} = $1;
2658                         return($1,$1);
2659                 }
2660         }
2661 }
2662
2663 sub parse_string
2664 {
2665         my ($data,$filename) = @_;
2666
2667         my $self = new Parse::Pidl::IDL;
2668
2669         $self->YYData->{FILE} = $filename;
2670         $self->YYData->{INPUT} = $data;
2671         $self->YYData->{LINE} = 0;
2672         $self->YYData->{LAST_TOKEN} = "NONE";
2673         $self->YYData->{ANONYMOUS_COUNTER} = 0;
2674
2675         my $idl = $self->YYParse( yylex => \&_Lexer, yyerror => \&_Error );
2676
2677         return CleanData($idl);
2678 }
2679
2680 sub parse_file($$)
2681 {
2682         my ($filename,$incdirs) = @_;
2683
2684         my $saved_delim = $/;
2685         undef $/;
2686         my $cpp = $ENV{CPP};
2687         my $options = "";
2688         if (! defined $cpp) {
2689                 if (defined $ENV{CC}) {
2690                         $cpp = "$ENV{CC}";
2691                         $options = "-E";
2692                 } else {
2693                         $cpp = "cpp";
2694                 }
2695         }
2696         my $includes = join('',map { " -I$_" } @$incdirs);
2697         my $data = `$cpp $options -D__PIDL__$includes -xc "$filename"`;
2698         $/ = $saved_delim;
2699
2700         return parse_string($data, $filename);
2701 }
2702
2703 1;