r4523: the PROPERTIES change for typedef was not quite as simple as I thought. This...
[samba.git] / source / build / 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 idl;
11 use vars qw ( @ISA );
12 use strict;
13
14 @ISA= qw ( Parse::Yapp::Driver );
15 #Included Parse/Yapp/Driver.pm file----------------------------------------
16 {
17 #
18 # Module Parse::Yapp::Driver
19 #
20 # This module is part of the Parse::Yapp package available on your
21 # nearest CPAN
22 #
23 # Any use of this module in a standalone parser make the included
24 # text under the same copyright as the Parse::Yapp module itself.
25 #
26 # This notice should remain unchanged.
27 #
28 # (c) Copyright 1998-2001 Francois Desarmenien, all rights reserved.
29 # (see the pod text in Parse::Yapp module for use and distribution rights)
30 #
31
32 package Parse::Yapp::Driver;
33
34 require 5.004;
35
36 use strict;
37
38 use vars qw ( $VERSION $COMPATIBLE $FILENAME );
39
40 $VERSION = '1.05';
41 $COMPATIBLE = '0.07';
42 $FILENAME=__FILE__;
43
44 use Carp;
45
46 #Known parameters, all starting with YY (leading YY will be discarded)
47 my(%params)=(YYLEX => 'CODE', 'YYERROR' => 'CODE', YYVERSION => '',
48                          YYRULES => 'ARRAY', YYSTATES => 'ARRAY', YYDEBUG => '');
49 #Mandatory parameters
50 my(@params)=('LEX','RULES','STATES');
51
52 sub new {
53     my($class)=shift;
54         my($errst,$nberr,$token,$value,$check,$dotpos);
55     my($self)={ ERROR => \&_Error,
56                                 ERRST => \$errst,
57                 NBERR => \$nberr,
58                                 TOKEN => \$token,
59                                 VALUE => \$value,
60                                 DOTPOS => \$dotpos,
61                                 STACK => [],
62                                 DEBUG => 0,
63                                 CHECK => \$check };
64
65         _CheckParams( [], \%params, \@_, $self );
66
67                 exists($$self{VERSION})
68         and     $$self{VERSION} < $COMPATIBLE
69         and     croak "Yapp driver version $VERSION ".
70                           "incompatible with version $$self{VERSION}:\n".
71                           "Please recompile parser module.";
72
73         ref($class)
74     and $class=ref($class);
75
76     bless($self,$class);
77 }
78
79 sub YYParse {
80     my($self)=shift;
81     my($retval);
82
83         _CheckParams( \@params, \%params, \@_, $self );
84
85         if($$self{DEBUG}) {
86                 _DBLoad();
87                 $retval = eval '$self->_DBParse()';#Do not create stab entry on compile
88         $@ and die $@;
89         }
90         else {
91                 $retval = $self->_Parse();
92         }
93     $retval
94 }
95
96 sub YYData {
97         my($self)=shift;
98
99                 exists($$self{USER})
100         or      $$self{USER}={};
101
102         $$self{USER};
103         
104 }
105
106 sub YYErrok {
107         my($self)=shift;
108
109         ${$$self{ERRST}}=0;
110     undef;
111 }
112
113 sub YYNberr {
114         my($self)=shift;
115
116         ${$$self{NBERR}};
117 }
118
119 sub YYRecovering {
120         my($self)=shift;
121
122         ${$$self{ERRST}} != 0;
123 }
124
125 sub YYAbort {
126         my($self)=shift;
127
128         ${$$self{CHECK}}='ABORT';
129     undef;
130 }
131
132 sub YYAccept {
133         my($self)=shift;
134
135         ${$$self{CHECK}}='ACCEPT';
136     undef;
137 }
138
139 sub YYError {
140         my($self)=shift;
141
142         ${$$self{CHECK}}='ERROR';
143     undef;
144 }
145
146 sub YYSemval {
147         my($self)=shift;
148         my($index)= $_[0] - ${$$self{DOTPOS}} - 1;
149
150                 $index < 0
151         and     -$index <= @{$$self{STACK}}
152         and     return $$self{STACK}[$index][1];
153
154         undef;  #Invalid index
155 }
156
157 sub YYCurtok {
158         my($self)=shift;
159
160         @_
161     and ${$$self{TOKEN}}=$_[0];
162     ${$$self{TOKEN}};
163 }
164
165 sub YYCurval {
166         my($self)=shift;
167
168         @_
169     and ${$$self{VALUE}}=$_[0];
170     ${$$self{VALUE}};
171 }
172
173 sub YYExpect {
174     my($self)=shift;
175
176     keys %{$self->{STATES}[$self->{STACK}[-1][0]]{ACTIONS}}
177 }
178
179 sub YYLexer {
180     my($self)=shift;
181
182         $$self{LEX};
183 }
184
185
186 #################
187 # Private stuff #
188 #################
189
190
191 sub _CheckParams {
192         my($mandatory,$checklist,$inarray,$outhash)=@_;
193         my($prm,$value);
194         my($prmlst)={};
195
196         while(($prm,$value)=splice(@$inarray,0,2)) {
197         $prm=uc($prm);
198                         exists($$checklist{$prm})
199                 or      croak("Unknow parameter '$prm'");
200                         ref($value) eq $$checklist{$prm}
201                 or      croak("Invalid value for parameter '$prm'");
202         $prm=unpack('@2A*',$prm);
203                 $$outhash{$prm}=$value;
204         }
205         for (@$mandatory) {
206                         exists($$outhash{$_})
207                 or      croak("Missing mandatory parameter '".lc($_)."'");
208         }
209 }
210
211 sub _Error {
212         print "Parse error.\n";
213 }
214
215 sub _DBLoad {
216         {
217                 no strict 'refs';
218
219                         exists(${__PACKAGE__.'::'}{_DBParse})#Already loaded ?
220                 and     return;
221         }
222         my($fname)=__FILE__;
223         my(@drv);
224         open(DRV,"<$fname") or die "Report this as a BUG: Cannot open $fname";
225         while(<DRV>) {
226                         /^\s*sub\s+_Parse\s*{\s*$/ .. /^\s*}\s*#\s*_Parse\s*$/
227                 and     do {
228                         s/^#DBG>//;
229                         push(@drv,$_);
230                 }
231         }
232         close(DRV);
233
234         $drv[0]=~s/_P/_DBP/;
235         eval join('',@drv);
236 }
237
238 #Note that for loading debugging version of the driver,
239 #this file will be parsed from 'sub _Parse' up to '}#_Parse' inclusive.
240 #So, DO NOT remove comment at end of sub !!!
241 sub _Parse {
242     my($self)=shift;
243
244         my($rules,$states,$lex,$error)
245      = @$self{ 'RULES', 'STATES', 'LEX', 'ERROR' };
246         my($errstatus,$nberror,$token,$value,$stack,$check,$dotpos)
247      = @$self{ 'ERRST', 'NBERR', 'TOKEN', 'VALUE', 'STACK', 'CHECK', 'DOTPOS' };
248
249 #DBG>   my($debug)=$$self{DEBUG};
250 #DBG>   my($dbgerror)=0;
251
252 #DBG>   my($ShowCurToken) = sub {
253 #DBG>           my($tok)='>';
254 #DBG>           for (split('',$$token)) {
255 #DBG>                   $tok.=          (ord($_) < 32 or ord($_) > 126)
256 #DBG>                                   ?       sprintf('<%02X>',ord($_))
257 #DBG>                                   :       $_;
258 #DBG>           }
259 #DBG>           $tok.='<';
260 #DBG>   };
261
262         $$errstatus=0;
263         $$nberror=0;
264         ($$token,$$value)=(undef,undef);
265         @$stack=( [ 0, undef ] );
266         $$check='';
267
268     while(1) {
269         my($actions,$act,$stateno);
270
271         $stateno=$$stack[-1][0];
272         $actions=$$states[$stateno];
273
274 #DBG>   print STDERR ('-' x 40),"\n";
275 #DBG>           $debug & 0x2
276 #DBG>   and     print STDERR "In state $stateno:\n";
277 #DBG>           $debug & 0x08
278 #DBG>   and     print STDERR "Stack:[".
279 #DBG>                                    join(',',map { $$_[0] } @$stack).
280 #DBG>                                    "]\n";
281
282
283         if  (exists($$actions{ACTIONS})) {
284
285                                 defined($$token)
286             or  do {
287                                 ($$token,$$value)=&$lex($self);
288 #DBG>                           $debug & 0x01
289 #DBG>                   and     print STDERR "Need token. Got ".&$ShowCurToken."\n";
290                         };
291
292             $act=   exists($$actions{ACTIONS}{$$token})
293                     ?   $$actions{ACTIONS}{$$token}
294                     :   exists($$actions{DEFAULT})
295                         ?   $$actions{DEFAULT}
296                         :   undef;
297         }
298         else {
299             $act=$$actions{DEFAULT};
300 #DBG>                   $debug & 0x01
301 #DBG>           and     print STDERR "Don't need token.\n";
302         }
303
304             defined($act)
305         and do {
306
307                 $act > 0
308             and do {        #shift
309
310 #DBG>                           $debug & 0x04
311 #DBG>                   and     print STDERR "Shift and go to state $act.\n";
312
313                                         $$errstatus
314                                 and     do {
315                                         --$$errstatus;
316
317 #DBG>                                   $debug & 0x10
318 #DBG>                           and     $dbgerror
319 #DBG>                           and     $$errstatus == 0
320 #DBG>                           and     do {
321 #DBG>                                   print STDERR "**End of Error recovery.\n";
322 #DBG>                                   $dbgerror=0;
323 #DBG>                           };
324                                 };
325
326
327                 push(@$stack,[ $act, $$value ]);
328
329                                         $$token ne ''   #Don't eat the eof
330                                 and     $$token=$$value=undef;
331                 next;
332             };
333
334             #reduce
335             my($lhs,$len,$code,@sempar,$semval);
336             ($lhs,$len,$code)=@{$$rules[-$act]};
337
338 #DBG>                   $debug & 0x04
339 #DBG>           and     $act
340 #DBG>           and     print STDERR "Reduce using rule ".-$act." ($lhs,$len): ";
341
342                 $act
343             or  $self->YYAccept();
344
345             $$dotpos=$len;
346
347                 unpack('A1',$lhs) eq '@'    #In line rule
348             and do {
349                     $lhs =~ /^\@[0-9]+\-([0-9]+)$/
350                 or  die "In line rule name '$lhs' ill formed: ".
351                         "report it as a BUG.\n";
352                 $$dotpos = $1;
353             };
354
355             @sempar =       $$dotpos
356                         ?   map { $$_[1] } @$stack[ -$$dotpos .. -1 ]
357                         :   ();
358
359             $semval = $code ? &$code( $self, @sempar )
360                             : @sempar ? $sempar[0] : undef;
361
362             splice(@$stack,-$len,$len);
363
364                 $$check eq 'ACCEPT'
365             and do {
366
367 #DBG>                   $debug & 0x04
368 #DBG>           and     print STDERR "Accept.\n";
369
370                                 return($semval);
371                         };
372
373                 $$check eq 'ABORT'
374             and do {
375
376 #DBG>                   $debug & 0x04
377 #DBG>           and     print STDERR "Abort.\n";
378
379                                 return(undef);
380
381                         };
382
383 #DBG>                   $debug & 0x04
384 #DBG>           and     print STDERR "Back to state $$stack[-1][0], then ";
385
386                 $$check eq 'ERROR'
387             or  do {
388 #DBG>                           $debug & 0x04
389 #DBG>                   and     print STDERR 
390 #DBG>                               "go to state $$states[$$stack[-1][0]]{GOTOS}{$lhs}.\n";
391
392 #DBG>                           $debug & 0x10
393 #DBG>                   and     $dbgerror
394 #DBG>                   and     $$errstatus == 0
395 #DBG>                   and     do {
396 #DBG>                           print STDERR "**End of Error recovery.\n";
397 #DBG>                           $dbgerror=0;
398 #DBG>                   };
399
400                             push(@$stack,
401                      [ $$states[$$stack[-1][0]]{GOTOS}{$lhs}, $semval ]);
402                 $$check='';
403                 next;
404             };
405
406 #DBG>                   $debug & 0x04
407 #DBG>           and     print STDERR "Forced Error recovery.\n";
408
409             $$check='';
410
411         };
412
413         #Error
414             $$errstatus
415         or   do {
416
417             $$errstatus = 1;
418             &$error($self);
419                 $$errstatus # if 0, then YYErrok has been called
420             or  next;       # so continue parsing
421
422 #DBG>                   $debug & 0x10
423 #DBG>           and     do {
424 #DBG>                   print STDERR "**Entering Error recovery.\n";
425 #DBG>                   ++$dbgerror;
426 #DBG>           };
427
428             ++$$nberror;
429
430         };
431
432                         $$errstatus == 3        #The next token is not valid: discard it
433                 and     do {
434                                 $$token eq ''   # End of input: no hope
435                         and     do {
436 #DBG>                           $debug & 0x10
437 #DBG>                   and     print STDERR "**At eof: aborting.\n";
438                                 return(undef);
439                         };
440
441 #DBG>                   $debug & 0x10
442 #DBG>           and     print STDERR "**Dicard invalid token ".&$ShowCurToken.".\n";
443
444                         $$token=$$value=undef;
445                 };
446
447         $$errstatus=3;
448
449                 while(    @$stack
450                           and (         not exists($$states[$$stack[-1][0]]{ACTIONS})
451                                 or  not exists($$states[$$stack[-1][0]]{ACTIONS}{error})
452                                         or      $$states[$$stack[-1][0]]{ACTIONS}{error} <= 0)) {
453
454 #DBG>                   $debug & 0x10
455 #DBG>           and     print STDERR "**Pop state $$stack[-1][0].\n";
456
457                         pop(@$stack);
458                 }
459
460                         @$stack
461                 or      do {
462
463 #DBG>                   $debug & 0x10
464 #DBG>           and     print STDERR "**No state left on stack: aborting.\n";
465
466                         return(undef);
467                 };
468
469                 #shift the error token
470
471 #DBG>                   $debug & 0x10
472 #DBG>           and     print STDERR "**Shift \$error token and go to state ".
473 #DBG>                                            $$states[$$stack[-1][0]]{ACTIONS}{error}.
474 #DBG>                                            ".\n";
475
476                 push(@$stack, [ $$states[$$stack[-1][0]]{ACTIONS}{error}, undef ]);
477
478     }
479
480     #never reached
481         croak("Error in driver logic. Please, report it as a BUG");
482
483 }#_Parse
484 #DO NOT remove comment
485
486 1;
487
488 }
489 #End of include--------------------------------------------------
490
491
492
493
494 sub new {
495         my($class)=shift;
496         ref($class)
497     and $class=ref($class);
498
499     my($self)=$class->SUPER::new( yyversion => '1.05',
500                                   yystates =>
501 [
502         {#State 0
503                 DEFAULT => -1,
504                 GOTOS => {
505                         'idl' => 1
506                 }
507         },
508         {#State 1
509                 ACTIONS => {
510                         '' => 2
511                 },
512                 DEFAULT => -49,
513                 GOTOS => {
514                         'interface' => 3,
515                         'coclass' => 4,
516                         'property_list' => 5
517                 }
518         },
519         {#State 2
520                 DEFAULT => 0
521         },
522         {#State 3
523                 DEFAULT => -2
524         },
525         {#State 4
526                 DEFAULT => -3
527         },
528         {#State 5
529                 ACTIONS => {
530                         "coclass" => 6,
531                         "interface" => 8,
532                         "[" => 7
533                 }
534         },
535         {#State 6
536                 ACTIONS => {
537                         'IDENTIFIER' => 9
538                 },
539                 GOTOS => {
540                         'identifier' => 10
541                 }
542         },
543         {#State 7
544                 ACTIONS => {
545                         'IDENTIFIER' => 9
546                 },
547                 GOTOS => {
548                         'identifier' => 11,
549                         'properties' => 13,
550                         'property' => 12
551                 }
552         },
553         {#State 8
554                 ACTIONS => {
555                         'IDENTIFIER' => 9
556                 },
557                 GOTOS => {
558                         'identifier' => 14
559                 }
560         },
561         {#State 9
562                 DEFAULT => -73
563         },
564         {#State 10
565                 ACTIONS => {
566                         "{" => 15
567                 }
568         },
569         {#State 11
570                 ACTIONS => {
571                         "(" => 16
572                 },
573                 DEFAULT => -53
574         },
575         {#State 12
576                 DEFAULT => -51
577         },
578         {#State 13
579                 ACTIONS => {
580                         "," => 17,
581                         "]" => 18
582                 }
583         },
584         {#State 14
585                 ACTIONS => {
586                         ":" => 19
587                 },
588                 DEFAULT => -8,
589                 GOTOS => {
590                         'base_interface' => 20
591                 }
592         },
593         {#State 15
594                 DEFAULT => -5,
595                 GOTOS => {
596                         'interfaces' => 21
597                 }
598         },
599         {#State 16
600                 ACTIONS => {
601                         'CONSTANT' => 28,
602                         'TEXT' => 22,
603                         'IDENTIFIER' => 9
604                 },
605                 DEFAULT => -59,
606                 GOTOS => {
607                         'identifier' => 23,
608                         'listtext' => 26,
609                         'anytext' => 25,
610                         'text' => 24,
611                         'constant' => 27
612                 }
613         },
614         {#State 17
615                 ACTIONS => {
616                         'IDENTIFIER' => 9
617                 },
618                 GOTOS => {
619                         'identifier' => 11,
620                         'property' => 29
621                 }
622         },
623         {#State 18
624                 DEFAULT => -50
625         },
626         {#State 19
627                 ACTIONS => {
628                         'IDENTIFIER' => 9
629                 },
630                 GOTOS => {
631                         'identifier' => 30
632                 }
633         },
634         {#State 20
635                 ACTIONS => {
636                         "{" => 31
637                 }
638         },
639         {#State 21
640                 ACTIONS => {
641                         "}" => 32
642                 },
643                 DEFAULT => -49,
644                 GOTOS => {
645                         'interface' => 33,
646                         'property_list' => 34
647                 }
648         },
649         {#State 22
650                 DEFAULT => -75
651         },
652         {#State 23
653                 DEFAULT => -60
654         },
655         {#State 24
656                 DEFAULT => -62
657         },
658         {#State 25
659                 ACTIONS => {
660                         "-" => 35,
661                         "+" => 36,
662                         "&" => 38,
663                         "{" => 37,
664                         "/" => 39,
665                         "|" => 40,
666                         "(" => 41,
667                         "*" => 42,
668                         "." => 43,
669                         ">" => 44
670                 },
671                 DEFAULT => -55
672         },
673         {#State 26
674                 ACTIONS => {
675                         "," => 45,
676                         ")" => 46
677                 }
678         },
679         {#State 27
680                 DEFAULT => -61
681         },
682         {#State 28
683                 DEFAULT => -74
684         },
685         {#State 29
686                 DEFAULT => -52
687         },
688         {#State 30
689                 DEFAULT => -9
690         },
691         {#State 31
692                 ACTIONS => {
693                         "typedef" => 47,
694                         "const" => 53
695                 },
696                 DEFAULT => -49,
697                 GOTOS => {
698                         'const' => 52,
699                         'function' => 48,
700                         'typedef' => 54,
701                         'definitions' => 49,
702                         'definition' => 51,
703                         'property_list' => 50
704                 }
705         },
706         {#State 32
707                 ACTIONS => {
708                         ";" => 56
709                 },
710                 DEFAULT => -76,
711                 GOTOS => {
712                         'optional_semicolon' => 55
713                 }
714         },
715         {#State 33
716                 DEFAULT => -6
717         },
718         {#State 34
719                 ACTIONS => {
720                         "[" => 7,
721                         "interface" => 8
722                 }
723         },
724         {#State 35
725                 ACTIONS => {
726                         'CONSTANT' => 28,
727                         'TEXT' => 22,
728                         'IDENTIFIER' => 9
729                 },
730                 DEFAULT => -59,
731                 GOTOS => {
732                         'identifier' => 23,
733                         'text' => 24,
734                         'anytext' => 57,
735                         'constant' => 27
736                 }
737         },
738         {#State 36
739                 ACTIONS => {
740                         'CONSTANT' => 28,
741                         'TEXT' => 22,
742                         'IDENTIFIER' => 9
743                 },
744                 DEFAULT => -59,
745                 GOTOS => {
746                         'identifier' => 23,
747                         'text' => 24,
748                         'anytext' => 58,
749                         'constant' => 27
750                 }
751         },
752         {#State 37
753                 ACTIONS => {
754                         'CONSTANT' => 28,
755                         'TEXT' => 22,
756                         'IDENTIFIER' => 9
757                 },
758                 DEFAULT => -59,
759                 GOTOS => {
760                         'identifier' => 23,
761                         'text' => 24,
762                         'anytext' => 59,
763                         'constant' => 27,
764                         'commalisttext' => 60
765                 }
766         },
767         {#State 38
768                 ACTIONS => {
769                         'CONSTANT' => 28,
770                         'TEXT' => 22,
771                         'IDENTIFIER' => 9
772                 },
773                 DEFAULT => -59,
774                 GOTOS => {
775                         'identifier' => 23,
776                         'text' => 24,
777                         'anytext' => 61,
778                         'constant' => 27
779                 }
780         },
781         {#State 39
782                 ACTIONS => {
783                         'CONSTANT' => 28,
784                         'TEXT' => 22,
785                         'IDENTIFIER' => 9
786                 },
787                 DEFAULT => -59,
788                 GOTOS => {
789                         'identifier' => 23,
790                         'text' => 24,
791                         'anytext' => 62,
792                         'constant' => 27
793                 }
794         },
795         {#State 40
796                 ACTIONS => {
797                         'CONSTANT' => 28,
798                         'TEXT' => 22,
799                         'IDENTIFIER' => 9
800                 },
801                 DEFAULT => -59,
802                 GOTOS => {
803                         'identifier' => 23,
804                         'text' => 24,
805                         'anytext' => 63,
806                         'constant' => 27
807                 }
808         },
809         {#State 41
810                 ACTIONS => {
811                         'CONSTANT' => 28,
812                         'TEXT' => 22,
813                         'IDENTIFIER' => 9
814                 },
815                 DEFAULT => -59,
816                 GOTOS => {
817                         'identifier' => 23,
818                         'text' => 24,
819                         'anytext' => 59,
820                         'constant' => 27,
821                         'commalisttext' => 64
822                 }
823         },
824         {#State 42
825                 ACTIONS => {
826                         'CONSTANT' => 28,
827                         'TEXT' => 22,
828                         'IDENTIFIER' => 9
829                 },
830                 DEFAULT => -59,
831                 GOTOS => {
832                         'identifier' => 23,
833                         'text' => 24,
834                         'anytext' => 65,
835                         'constant' => 27
836                 }
837         },
838         {#State 43
839                 ACTIONS => {
840                         'CONSTANT' => 28,
841                         'TEXT' => 22,
842                         'IDENTIFIER' => 9
843                 },
844                 DEFAULT => -59,
845                 GOTOS => {
846                         'identifier' => 23,
847                         'text' => 24,
848                         'anytext' => 66,
849                         'constant' => 27
850                 }
851         },
852         {#State 44
853                 ACTIONS => {
854                         'CONSTANT' => 28,
855                         'TEXT' => 22,
856                         'IDENTIFIER' => 9
857                 },
858                 DEFAULT => -59,
859                 GOTOS => {
860                         'identifier' => 23,
861                         'text' => 24,
862                         'anytext' => 67,
863                         'constant' => 27
864                 }
865         },
866         {#State 45
867                 ACTIONS => {
868                         'CONSTANT' => 28,
869                         'TEXT' => 22,
870                         'IDENTIFIER' => 9
871                 },
872                 DEFAULT => -59,
873                 GOTOS => {
874                         'identifier' => 23,
875                         'text' => 24,
876                         'anytext' => 68,
877                         'constant' => 27
878                 }
879         },
880         {#State 46
881                 DEFAULT => -54
882         },
883         {#State 47
884                 DEFAULT => -49,
885                 GOTOS => {
886                         'property_list' => 69
887                 }
888         },
889         {#State 48
890                 DEFAULT => -12
891         },
892         {#State 49
893                 ACTIONS => {
894                         "}" => 70,
895                         "typedef" => 47,
896                         "const" => 53
897                 },
898                 DEFAULT => -49,
899                 GOTOS => {
900                         'const' => 52,
901                         'function' => 48,
902                         'typedef' => 54,
903                         'definition' => 71,
904                         'property_list' => 50
905                 }
906         },
907         {#State 50
908                 ACTIONS => {
909                         'IDENTIFIER' => 9,
910                         "union" => 72,
911                         "enum" => 73,
912                         "[" => 7,
913                         'void' => 74,
914                         "struct" => 80
915                 },
916                 GOTOS => {
917                         'identifier' => 75,
918                         'struct' => 76,
919                         'enum' => 77,
920                         'type' => 78,
921                         'union' => 79
922                 }
923         },
924         {#State 51
925                 DEFAULT => -10
926         },
927         {#State 52
928                 DEFAULT => -13
929         },
930         {#State 53
931                 ACTIONS => {
932                         'IDENTIFIER' => 9
933                 },
934                 GOTOS => {
935                         'identifier' => 81
936                 }
937         },
938         {#State 54
939                 DEFAULT => -14
940         },
941         {#State 55
942                 DEFAULT => -4
943         },
944         {#State 56
945                 DEFAULT => -77
946         },
947         {#State 57
948                 ACTIONS => {
949                         "{" => 37
950                 },
951                 DEFAULT => -63
952         },
953         {#State 58
954                 ACTIONS => {
955                         "{" => 37
956                 },
957                 DEFAULT => -70
958         },
959         {#State 59
960                 ACTIONS => {
961                         "-" => 35,
962                         "+" => 36,
963                         "&" => 38,
964                         "{" => 37,
965                         "/" => 39,
966                         "(" => 41,
967                         "|" => 40,
968                         "*" => 42,
969                         "." => 43,
970                         ">" => 44
971                 },
972                 DEFAULT => -57
973         },
974         {#State 60
975                 ACTIONS => {
976                         "}" => 82,
977                         "," => 83
978                 }
979         },
980         {#State 61
981                 ACTIONS => {
982                         "{" => 37
983                 },
984                 DEFAULT => -68
985         },
986         {#State 62
987                 ACTIONS => {
988                         "{" => 37
989                 },
990                 DEFAULT => -69
991         },
992         {#State 63
993                 ACTIONS => {
994                         "{" => 37
995                 },
996                 DEFAULT => -67
997         },
998         {#State 64
999                 ACTIONS => {
1000                         "," => 83,
1001                         ")" => 84
1002                 }
1003         },
1004         {#State 65
1005                 ACTIONS => {
1006                         "{" => 37
1007                 },
1008                 DEFAULT => -65
1009         },
1010         {#State 66
1011                 ACTIONS => {
1012                         "{" => 37
1013                 },
1014                 DEFAULT => -64
1015         },
1016         {#State 67
1017                 ACTIONS => {
1018                         "{" => 37
1019                 },
1020                 DEFAULT => -66
1021         },
1022         {#State 68
1023                 ACTIONS => {
1024                         "-" => 35,
1025                         "+" => 36,
1026                         "&" => 38,
1027                         "{" => 37,
1028                         "/" => 39,
1029                         "(" => 41,
1030                         "|" => 40,
1031                         "*" => 42,
1032                         "." => 43,
1033                         ">" => 44
1034                 },
1035                 DEFAULT => -56
1036         },
1037         {#State 69
1038                 ACTIONS => {
1039                         'IDENTIFIER' => 9,
1040                         "union" => 72,
1041                         "enum" => 73,
1042                         "[" => 7,
1043                         'void' => 74,
1044                         "struct" => 80
1045                 },
1046                 GOTOS => {
1047                         'identifier' => 75,
1048                         'struct' => 76,
1049                         'enum' => 77,
1050                         'type' => 85,
1051                         'union' => 79
1052                 }
1053         },
1054         {#State 70
1055                 ACTIONS => {
1056                         ";" => 56
1057                 },
1058                 DEFAULT => -76,
1059                 GOTOS => {
1060                         'optional_semicolon' => 86
1061                 }
1062         },
1063         {#State 71
1064                 DEFAULT => -11
1065         },
1066         {#State 72
1067                 ACTIONS => {
1068                         "{" => 87
1069                 }
1070         },
1071         {#State 73
1072                 ACTIONS => {
1073                         "{" => 88
1074                 }
1075         },
1076         {#State 74
1077                 DEFAULT => -23
1078         },
1079         {#State 75
1080                 DEFAULT => -22
1081         },
1082         {#State 76
1083                 DEFAULT => -19
1084         },
1085         {#State 77
1086                 DEFAULT => -21
1087         },
1088         {#State 78
1089                 ACTIONS => {
1090                         'IDENTIFIER' => 9
1091                 },
1092                 GOTOS => {
1093                         'identifier' => 89
1094                 }
1095         },
1096         {#State 79
1097                 DEFAULT => -20
1098         },
1099         {#State 80
1100                 ACTIONS => {
1101                         "{" => 90
1102                 }
1103         },
1104         {#State 81
1105                 ACTIONS => {
1106                         'IDENTIFIER' => 9
1107                 },
1108                 GOTOS => {
1109                         'identifier' => 91
1110                 }
1111         },
1112         {#State 82
1113                 ACTIONS => {
1114                         'CONSTANT' => 28,
1115                         'TEXT' => 22,
1116                         'IDENTIFIER' => 9
1117                 },
1118                 DEFAULT => -59,
1119                 GOTOS => {
1120                         'identifier' => 23,
1121                         'text' => 24,
1122                         'anytext' => 92,
1123                         'constant' => 27
1124                 }
1125         },
1126         {#State 83
1127                 ACTIONS => {
1128                         'CONSTANT' => 28,
1129                         'TEXT' => 22,
1130                         'IDENTIFIER' => 9
1131                 },
1132                 DEFAULT => -59,
1133                 GOTOS => {
1134                         'identifier' => 23,
1135                         'text' => 24,
1136                         'anytext' => 93,
1137                         'constant' => 27
1138                 }
1139         },
1140         {#State 84
1141                 ACTIONS => {
1142                         'CONSTANT' => 28,
1143                         'TEXT' => 22,
1144                         'IDENTIFIER' => 9
1145                 },
1146                 DEFAULT => -59,
1147                 GOTOS => {
1148                         'identifier' => 23,
1149                         'text' => 24,
1150                         'anytext' => 94,
1151                         'constant' => 27
1152                 }
1153         },
1154         {#State 85
1155                 ACTIONS => {
1156                         'IDENTIFIER' => 9
1157                 },
1158                 GOTOS => {
1159                         'identifier' => 95
1160                 }
1161         },
1162         {#State 86
1163                 DEFAULT => -7
1164         },
1165         {#State 87
1166                 ACTIONS => {
1167                         "[" => 98
1168                 },
1169                 GOTOS => {
1170                         'union_elements' => 96,
1171                         'union_element' => 97
1172                 }
1173         },
1174         {#State 88
1175                 ACTIONS => {
1176                         'IDENTIFIER' => 9
1177                 },
1178                 GOTOS => {
1179                         'identifier' => 99,
1180                         'enum_element' => 100,
1181                         'enum_elements' => 101
1182                 }
1183         },
1184         {#State 89
1185                 ACTIONS => {
1186                         "(" => 102
1187                 }
1188         },
1189         {#State 90
1190                 DEFAULT => -40,
1191                 GOTOS => {
1192                         'element_list1' => 103
1193                 }
1194         },
1195         {#State 91
1196                 ACTIONS => {
1197                         "[" => 106,
1198                         "=" => 105
1199                 },
1200                 GOTOS => {
1201                         'array_len' => 104
1202                 }
1203         },
1204         {#State 92
1205                 ACTIONS => {
1206                         "-" => 35,
1207                         "+" => 36,
1208                         "*" => 42,
1209                         "{" => 37,
1210                         "&" => 38,
1211                         "/" => 39,
1212                         "|" => 40,
1213                         "(" => 41,
1214                         "." => 43,
1215                         ">" => 44
1216                 },
1217                 DEFAULT => -72
1218         },
1219         {#State 93
1220                 ACTIONS => {
1221                         "-" => 35,
1222                         "+" => 36,
1223                         "&" => 38,
1224                         "{" => 37,
1225                         "/" => 39,
1226                         "(" => 41,
1227                         "|" => 40,
1228                         "*" => 42,
1229                         "." => 43,
1230                         ">" => 44
1231                 },
1232                 DEFAULT => -58
1233         },
1234         {#State 94
1235                 ACTIONS => {
1236                         "{" => 37
1237                 },
1238                 DEFAULT => -71
1239         },
1240         {#State 95
1241                 ACTIONS => {
1242                         "[" => 106
1243                 },
1244                 DEFAULT => -46,
1245                 GOTOS => {
1246                         'array_len' => 107
1247                 }
1248         },
1249         {#State 96
1250                 ACTIONS => {
1251                         "}" => 108,
1252                         "[" => 98
1253                 },
1254                 GOTOS => {
1255                         'union_element' => 109
1256                 }
1257         },
1258         {#State 97
1259                 DEFAULT => -31
1260         },
1261         {#State 98
1262                 ACTIONS => {
1263                         "case" => 110,
1264                         "default" => 111
1265                 }
1266         },
1267         {#State 99
1268                 ACTIONS => {
1269                         "=" => 112
1270                 },
1271                 DEFAULT => -27
1272         },
1273         {#State 100
1274                 DEFAULT => -25
1275         },
1276         {#State 101
1277                 ACTIONS => {
1278                         "}" => 113,
1279                         "," => 114
1280                 }
1281         },
1282         {#State 102
1283                 ACTIONS => {
1284                         "," => -42,
1285                         "void" => 117,
1286                         ")" => -42
1287                 },
1288                 DEFAULT => -49,
1289                 GOTOS => {
1290                         'base_element' => 115,
1291                         'element_list2' => 118,
1292                         'property_list' => 116
1293                 }
1294         },
1295         {#State 103
1296                 ACTIONS => {
1297                         "}" => 119
1298                 },
1299                 DEFAULT => -49,
1300                 GOTOS => {
1301                         'base_element' => 120,
1302                         'property_list' => 116
1303                 }
1304         },
1305         {#State 104
1306                 ACTIONS => {
1307                         "=" => 121
1308                 }
1309         },
1310         {#State 105
1311                 ACTIONS => {
1312                         'IDENTIFIER' => 9,
1313                         'CONSTANT' => 28,
1314                         'TEXT' => 22
1315                 },
1316                 DEFAULT => -59,
1317                 GOTOS => {
1318                         'identifier' => 23,
1319                         'text' => 24,
1320                         'anytext' => 122,
1321                         'constant' => 27
1322                 }
1323         },
1324         {#State 106
1325                 ACTIONS => {
1326                         'IDENTIFIER' => 9,
1327                         'CONSTANT' => 28,
1328                         'TEXT' => 22,
1329                         "]" => 124
1330                 },
1331                 DEFAULT => -59,
1332                 GOTOS => {
1333                         'identifier' => 23,
1334                         'text' => 24,
1335                         'anytext' => 123,
1336                         'constant' => 27
1337                 }
1338         },
1339         {#State 107
1340                 ACTIONS => {
1341                         ";" => 125
1342                 }
1343         },
1344         {#State 108
1345                 DEFAULT => -30
1346         },
1347         {#State 109
1348                 DEFAULT => -32
1349         },
1350         {#State 110
1351                 ACTIONS => {
1352                         "(" => 126
1353                 }
1354         },
1355         {#State 111
1356                 ACTIONS => {
1357                         "]" => 127
1358                 }
1359         },
1360         {#State 112
1361                 ACTIONS => {
1362                         'CONSTANT' => 28,
1363                         'TEXT' => 22,
1364                         'IDENTIFIER' => 9
1365                 },
1366                 DEFAULT => -59,
1367                 GOTOS => {
1368                         'identifier' => 23,
1369                         'text' => 24,
1370                         'anytext' => 128,
1371                         'constant' => 27
1372                 }
1373         },
1374         {#State 113
1375                 DEFAULT => -24
1376         },
1377         {#State 114
1378                 ACTIONS => {
1379                         'IDENTIFIER' => 9
1380                 },
1381                 GOTOS => {
1382                         'identifier' => 99,
1383                         'enum_element' => 129
1384                 }
1385         },
1386         {#State 115
1387                 DEFAULT => -44
1388         },
1389         {#State 116
1390                 ACTIONS => {
1391                         'IDENTIFIER' => 9,
1392                         "union" => 72,
1393                         "enum" => 73,
1394                         "[" => 7,
1395                         'void' => 74,
1396                         "struct" => 80
1397                 },
1398                 GOTOS => {
1399                         'identifier' => 75,
1400                         'struct' => 76,
1401                         'enum' => 77,
1402                         'type' => 130,
1403                         'union' => 79
1404                 }
1405         },
1406         {#State 117
1407                 DEFAULT => -43
1408         },
1409         {#State 118
1410                 ACTIONS => {
1411                         "," => 131,
1412                         ")" => 132
1413                 }
1414         },
1415         {#State 119
1416                 DEFAULT => -29
1417         },
1418         {#State 120
1419                 ACTIONS => {
1420                         ";" => 133
1421                 }
1422         },
1423         {#State 121
1424                 ACTIONS => {
1425                         'IDENTIFIER' => 9,
1426                         'CONSTANT' => 28,
1427                         'TEXT' => 22
1428                 },
1429                 DEFAULT => -59,
1430                 GOTOS => {
1431                         'identifier' => 23,
1432                         'text' => 24,
1433                         'anytext' => 134,
1434                         'constant' => 27
1435                 }
1436         },
1437         {#State 122
1438                 ACTIONS => {
1439                         "-" => 35,
1440                         ";" => 135,
1441                         "+" => 36,
1442                         "&" => 38,
1443                         "{" => 37,
1444                         "/" => 39,
1445                         "(" => 41,
1446                         "|" => 40,
1447                         "*" => 42,
1448                         "." => 43,
1449                         ">" => 44
1450                 }
1451         },
1452         {#State 123
1453                 ACTIONS => {
1454                         "-" => 35,
1455                         "+" => 36,
1456                         "&" => 38,
1457                         "{" => 37,
1458                         "/" => 39,
1459                         "(" => 41,
1460                         "|" => 40,
1461                         "*" => 42,
1462                         "." => 43,
1463                         "]" => 136,
1464                         ">" => 44
1465                 }
1466         },
1467         {#State 124
1468                 DEFAULT => -47
1469         },
1470         {#State 125
1471                 DEFAULT => -18
1472         },
1473         {#State 126
1474                 ACTIONS => {
1475                         'IDENTIFIER' => 9,
1476                         'CONSTANT' => 28,
1477                         'TEXT' => 22
1478                 },
1479                 DEFAULT => -59,
1480                 GOTOS => {
1481                         'identifier' => 23,
1482                         'text' => 24,
1483                         'anytext' => 137,
1484                         'constant' => 27
1485                 }
1486         },
1487         {#State 127
1488                 ACTIONS => {
1489                         ";" => 138
1490                 },
1491                 DEFAULT => -49,
1492                 GOTOS => {
1493                         'base_element' => 139,
1494                         'property_list' => 116
1495                 }
1496         },
1497         {#State 128
1498                 ACTIONS => {
1499                         "-" => 35,
1500                         "+" => 36,
1501                         "&" => 38,
1502                         "{" => 37,
1503                         "/" => 39,
1504                         "(" => 41,
1505                         "|" => 40,
1506                         "*" => 42,
1507                         "." => 43,
1508                         ">" => 44
1509                 },
1510                 DEFAULT => -28
1511         },
1512         {#State 129
1513                 DEFAULT => -26
1514         },
1515         {#State 130
1516                 DEFAULT => -38,
1517                 GOTOS => {
1518                         'pointers' => 140
1519                 }
1520         },
1521         {#State 131
1522                 DEFAULT => -49,
1523                 GOTOS => {
1524                         'base_element' => 141,
1525                         'property_list' => 116
1526                 }
1527         },
1528         {#State 132
1529                 ACTIONS => {
1530                         ";" => 142
1531                 }
1532         },
1533         {#State 133
1534                 DEFAULT => -41
1535         },
1536         {#State 134
1537                 ACTIONS => {
1538                         "-" => 35,
1539                         ";" => 143,
1540                         "+" => 36,
1541                         "&" => 38,
1542                         "{" => 37,
1543                         "/" => 39,
1544                         "(" => 41,
1545                         "|" => 40,
1546                         "*" => 42,
1547                         "." => 43,
1548                         ">" => 44
1549                 }
1550         },
1551         {#State 135
1552                 DEFAULT => -15
1553         },
1554         {#State 136
1555                 DEFAULT => -48
1556         },
1557         {#State 137
1558                 ACTIONS => {
1559                         "-" => 35,
1560                         "+" => 36,
1561                         "&" => 38,
1562                         "{" => 37,
1563                         "/" => 39,
1564                         "(" => 41,
1565                         "|" => 40,
1566                         "*" => 42,
1567                         "." => 43,
1568                         ")" => 144,
1569                         ">" => 44
1570                 }
1571         },
1572         {#State 138
1573                 DEFAULT => -36
1574         },
1575         {#State 139
1576                 ACTIONS => {
1577                         ";" => 145
1578                 }
1579         },
1580         {#State 140
1581                 ACTIONS => {
1582                         'IDENTIFIER' => 9,
1583                         "*" => 147
1584                 },
1585                 GOTOS => {
1586                         'identifier' => 146
1587                 }
1588         },
1589         {#State 141
1590                 DEFAULT => -45
1591         },
1592         {#State 142
1593                 DEFAULT => -17
1594         },
1595         {#State 143
1596                 DEFAULT => -16
1597         },
1598         {#State 144
1599                 ACTIONS => {
1600                         "]" => 148
1601                 }
1602         },
1603         {#State 145
1604                 DEFAULT => -35
1605         },
1606         {#State 146
1607                 ACTIONS => {
1608                         "[" => 106
1609                 },
1610                 DEFAULT => -46,
1611                 GOTOS => {
1612                         'array_len' => 149
1613                 }
1614         },
1615         {#State 147
1616                 DEFAULT => -39
1617         },
1618         {#State 148
1619                 ACTIONS => {
1620                         ";" => 150
1621                 },
1622                 DEFAULT => -49,
1623                 GOTOS => {
1624                         'base_element' => 151,
1625                         'property_list' => 116
1626                 }
1627         },
1628         {#State 149
1629                 DEFAULT => -37
1630         },
1631         {#State 150
1632                 DEFAULT => -34
1633         },
1634         {#State 151
1635                 ACTIONS => {
1636                         ";" => 152
1637                 }
1638         },
1639         {#State 152
1640                 DEFAULT => -33
1641         }
1642 ],
1643                                   yyrules  =>
1644 [
1645         [#Rule 0
1646                  '$start', 2, undef
1647         ],
1648         [#Rule 1
1649                  'idl', 0, undef
1650         ],
1651         [#Rule 2
1652                  'idl', 2,
1653 sub
1654 #line 19 "build/pidl/idl.yp"
1655 { push(@{$_[1]}, $_[2]); $_[1] }
1656         ],
1657         [#Rule 3
1658                  'idl', 2,
1659 sub
1660 #line 20 "build/pidl/idl.yp"
1661 { push(@{$_[1]}, $_[2]); $_[1] }
1662         ],
1663         [#Rule 4
1664                  'coclass', 7,
1665 sub
1666 #line 24 "build/pidl/idl.yp"
1667 {$_[3] => {
1668                "TYPE" => "COCLASS", 
1669                "PROPERTIES" => $_[1],
1670                "NAME" => $_[3],
1671                "DATA" => $_[5],
1672           }}
1673         ],
1674         [#Rule 5
1675                  'interfaces', 0, undef
1676         ],
1677         [#Rule 6
1678                  'interfaces', 2,
1679 sub
1680 #line 34 "build/pidl/idl.yp"
1681 { push(@{$_[1]}, $_[2]); $_[1] }
1682         ],
1683         [#Rule 7
1684                  'interface', 8,
1685 sub
1686 #line 38 "build/pidl/idl.yp"
1687 {$_[3] => {
1688                "TYPE" => "INTERFACE", 
1689                "PROPERTIES" => $_[1],
1690                "NAME" => $_[3],
1691                "BASE" => $_[4],
1692                "DATA" => $_[6],
1693           }}
1694         ],
1695         [#Rule 8
1696                  'base_interface', 0, undef
1697         ],
1698         [#Rule 9
1699                  'base_interface', 2,
1700 sub
1701 #line 49 "build/pidl/idl.yp"
1702 { $_[2] }
1703         ],
1704         [#Rule 10
1705                  'definitions', 1,
1706 sub
1707 #line 53 "build/pidl/idl.yp"
1708 { [ $_[1] ] }
1709         ],
1710         [#Rule 11
1711                  'definitions', 2,
1712 sub
1713 #line 54 "build/pidl/idl.yp"
1714 { push(@{$_[1]}, $_[2]); $_[1] }
1715         ],
1716         [#Rule 12
1717                  'definition', 1, undef
1718         ],
1719         [#Rule 13
1720                  'definition', 1, undef
1721         ],
1722         [#Rule 14
1723                  'definition', 1, undef
1724         ],
1725         [#Rule 15
1726                  'const', 6,
1727 sub
1728 #line 62 "build/pidl/idl.yp"
1729 {{
1730                      "TYPE"  => "CONST", 
1731                      "DTYPE"  => $_[2],
1732                      "NAME"  => $_[3],
1733                      "VALUE" => $_[5]
1734         }}
1735         ],
1736         [#Rule 16
1737                  'const', 7,
1738 sub
1739 #line 69 "build/pidl/idl.yp"
1740 {{
1741                      "TYPE"  => "CONST", 
1742                      "DTYPE"  => $_[2],
1743                      "NAME"  => $_[3],
1744                      "ARRAY_LEN" => $_[4],
1745                      "VALUE" => $_[6],
1746         }}
1747         ],
1748         [#Rule 17
1749                  'function', 7,
1750 sub
1751 #line 80 "build/pidl/idl.yp"
1752 {{
1753                 "TYPE" => "FUNCTION",
1754                 "NAME" => $_[3],
1755                 "RETURN_TYPE" => $_[2],
1756                 "PROPERTIES" => $_[1],
1757                 "DATA" => $_[5]
1758          }}
1759         ],
1760         [#Rule 18
1761                  'typedef', 6,
1762 sub
1763 #line 90 "build/pidl/idl.yp"
1764 {{
1765                      "TYPE" => "TYPEDEF", 
1766                      "PROPERTIES" => $_[2],
1767                      "NAME" => $_[4],
1768                      "DATA" => $_[3],
1769                      "ARRAY_LEN" => $_[5]
1770         }}
1771         ],
1772         [#Rule 19
1773                  'type', 1, undef
1774         ],
1775         [#Rule 20
1776                  'type', 1, undef
1777         ],
1778         [#Rule 21
1779                  'type', 1, undef
1780         ],
1781         [#Rule 22
1782                  'type', 1, undef
1783         ],
1784         [#Rule 23
1785                  'type', 1,
1786 sub
1787 #line 100 "build/pidl/idl.yp"
1788 { "void" }
1789         ],
1790         [#Rule 24
1791                  'enum', 4,
1792 sub
1793 #line 105 "build/pidl/idl.yp"
1794 {{
1795                      "TYPE" => "ENUM", 
1796                      "ELEMENTS" => $_[3]
1797         }}
1798         ],
1799         [#Rule 25
1800                  'enum_elements', 1,
1801 sub
1802 #line 112 "build/pidl/idl.yp"
1803 { [ $_[1] ] }
1804         ],
1805         [#Rule 26
1806                  'enum_elements', 3,
1807 sub
1808 #line 113 "build/pidl/idl.yp"
1809 { push(@{$_[1]}, $_[3]); $_[1] }
1810         ],
1811         [#Rule 27
1812                  'enum_element', 1, undef
1813         ],
1814         [#Rule 28
1815                  'enum_element', 3,
1816 sub
1817 #line 117 "build/pidl/idl.yp"
1818 { "$_[1]$_[2]$_[3]" }
1819         ],
1820         [#Rule 29
1821                  'struct', 4,
1822 sub
1823 #line 121 "build/pidl/idl.yp"
1824 {{
1825                      "TYPE" => "STRUCT", 
1826                      "ELEMENTS" => $_[3]
1827         }}
1828         ],
1829         [#Rule 30
1830                  'union', 4,
1831 sub
1832 #line 128 "build/pidl/idl.yp"
1833 {{
1834                 "TYPE" => "UNION",
1835                 "DATA" => $_[3]
1836          }}
1837         ],
1838         [#Rule 31
1839                  'union_elements', 1,
1840 sub
1841 #line 135 "build/pidl/idl.yp"
1842 { [ $_[1] ] }
1843         ],
1844         [#Rule 32
1845                  'union_elements', 2,
1846 sub
1847 #line 136 "build/pidl/idl.yp"
1848 { push(@{$_[1]}, $_[2]); $_[1] }
1849         ],
1850         [#Rule 33
1851                  'union_element', 8,
1852 sub
1853 #line 141 "build/pidl/idl.yp"
1854 {{
1855                 "TYPE" => "UNION_ELEMENT",
1856                 "CASE" => $_[4],
1857                 "DATA" => $_[7]
1858          }}
1859         ],
1860         [#Rule 34
1861                  'union_element', 7,
1862 sub
1863 #line 147 "build/pidl/idl.yp"
1864 {{
1865                 "TYPE" => "EMPTY",
1866                 "CASE" => $_[4],
1867          }}
1868         ],
1869         [#Rule 35
1870                  'union_element', 5,
1871 sub
1872 #line 152 "build/pidl/idl.yp"
1873 {{
1874                 "TYPE" => "UNION_ELEMENT",
1875                 "CASE" => "default",
1876                 "DATA" => $_[4]
1877          }}
1878         ],
1879         [#Rule 36
1880                  'union_element', 4,
1881 sub
1882 #line 158 "build/pidl/idl.yp"
1883 {{
1884                 "TYPE" => "EMPTY",
1885                 "CASE" => "default",
1886          }}
1887         ],
1888         [#Rule 37
1889                  'base_element', 5,
1890 sub
1891 #line 165 "build/pidl/idl.yp"
1892 {{
1893                            "NAME" => $_[4],
1894                            "TYPE" => $_[2],
1895                            "PROPERTIES" => $_[1],
1896                            "POINTERS" => $_[3],
1897                            "ARRAY_LEN" => $_[5]
1898               }}
1899         ],
1900         [#Rule 38
1901                  'pointers', 0,
1902 sub
1903 #line 177 "build/pidl/idl.yp"
1904 { 0 }
1905         ],
1906         [#Rule 39
1907                  'pointers', 2,
1908 sub
1909 #line 178 "build/pidl/idl.yp"
1910 { $_[1]+1 }
1911         ],
1912         [#Rule 40
1913                  'element_list1', 0, undef
1914         ],
1915         [#Rule 41
1916                  'element_list1', 3,
1917 sub
1918 #line 185 "build/pidl/idl.yp"
1919 { push(@{$_[1]}, $_[2]); $_[1] }
1920         ],
1921         [#Rule 42
1922                  'element_list2', 0, undef
1923         ],
1924         [#Rule 43
1925                  'element_list2', 1, undef
1926         ],
1927         [#Rule 44
1928                  'element_list2', 1,
1929 sub
1930 #line 191 "build/pidl/idl.yp"
1931 { [ $_[1] ] }
1932         ],
1933         [#Rule 45
1934                  'element_list2', 3,
1935 sub
1936 #line 192 "build/pidl/idl.yp"
1937 { push(@{$_[1]}, $_[3]); $_[1] }
1938         ],
1939         [#Rule 46
1940                  'array_len', 0, undef
1941         ],
1942         [#Rule 47
1943                  'array_len', 2,
1944 sub
1945 #line 197 "build/pidl/idl.yp"
1946 { "*" }
1947         ],
1948         [#Rule 48
1949                  'array_len', 3,
1950 sub
1951 #line 198 "build/pidl/idl.yp"
1952 { "$_[2]" }
1953         ],
1954         [#Rule 49
1955                  'property_list', 0, undef
1956         ],
1957         [#Rule 50
1958                  'property_list', 4,
1959 sub
1960 #line 204 "build/pidl/idl.yp"
1961 { util::FlattenHash([$_[1],$_[3]]); }
1962         ],
1963         [#Rule 51
1964                  'properties', 1,
1965 sub
1966 #line 207 "build/pidl/idl.yp"
1967 { $_[1] }
1968         ],
1969         [#Rule 52
1970                  'properties', 3,
1971 sub
1972 #line 208 "build/pidl/idl.yp"
1973 { util::FlattenHash([$_[1], $_[3]]); }
1974         ],
1975         [#Rule 53
1976                  'property', 1,
1977 sub
1978 #line 211 "build/pidl/idl.yp"
1979 {{ "$_[1]" => "1"     }}
1980         ],
1981         [#Rule 54
1982                  'property', 4,
1983 sub
1984 #line 212 "build/pidl/idl.yp"
1985 {{ "$_[1]" => "$_[3]" }}
1986         ],
1987         [#Rule 55
1988                  'listtext', 1, undef
1989         ],
1990         [#Rule 56
1991                  'listtext', 3,
1992 sub
1993 #line 217 "build/pidl/idl.yp"
1994 { "$_[1] $_[3]" }
1995         ],
1996         [#Rule 57
1997                  'commalisttext', 1, undef
1998         ],
1999         [#Rule 58
2000                  'commalisttext', 3,
2001 sub
2002 #line 222 "build/pidl/idl.yp"
2003 { "$_[1],$_[3]" }
2004         ],
2005         [#Rule 59
2006                  'anytext', 0,
2007 sub
2008 #line 226 "build/pidl/idl.yp"
2009 { "" }
2010         ],
2011         [#Rule 60
2012                  'anytext', 1, undef
2013         ],
2014         [#Rule 61
2015                  'anytext', 1, undef
2016         ],
2017         [#Rule 62
2018                  'anytext', 1, undef
2019         ],
2020         [#Rule 63
2021                  'anytext', 3,
2022 sub
2023 #line 228 "build/pidl/idl.yp"
2024 { "$_[1]$_[2]$_[3]" }
2025         ],
2026         [#Rule 64
2027                  'anytext', 3,
2028 sub
2029 #line 229 "build/pidl/idl.yp"
2030 { "$_[1]$_[2]$_[3]" }
2031         ],
2032         [#Rule 65
2033                  'anytext', 3,
2034 sub
2035 #line 230 "build/pidl/idl.yp"
2036 { "$_[1]$_[2]$_[3]" }
2037         ],
2038         [#Rule 66
2039                  'anytext', 3,
2040 sub
2041 #line 231 "build/pidl/idl.yp"
2042 { "$_[1]$_[2]$_[3]" }
2043         ],
2044         [#Rule 67
2045                  'anytext', 3,
2046 sub
2047 #line 232 "build/pidl/idl.yp"
2048 { "$_[1]$_[2]$_[3]" }
2049         ],
2050         [#Rule 68
2051                  'anytext', 3,
2052 sub
2053 #line 233 "build/pidl/idl.yp"
2054 { "$_[1]$_[2]$_[3]" }
2055         ],
2056         [#Rule 69
2057                  'anytext', 3,
2058 sub
2059 #line 234 "build/pidl/idl.yp"
2060 { "$_[1]$_[2]$_[3]" }
2061         ],
2062         [#Rule 70
2063                  'anytext', 3,
2064 sub
2065 #line 235 "build/pidl/idl.yp"
2066 { "$_[1]$_[2]$_[3]" }
2067         ],
2068         [#Rule 71
2069                  'anytext', 5,
2070 sub
2071 #line 236 "build/pidl/idl.yp"
2072 { "$_[1]$_[2]$_[3]$_[4]$_[5]" }
2073         ],
2074         [#Rule 72
2075                  'anytext', 5,
2076 sub
2077 #line 237 "build/pidl/idl.yp"
2078 { "$_[1]$_[2]$_[3]$_[4]$_[5]" }
2079         ],
2080         [#Rule 73
2081                  'identifier', 1, undef
2082         ],
2083         [#Rule 74
2084                  'constant', 1, undef
2085         ],
2086         [#Rule 75
2087                  'text', 1,
2088 sub
2089 #line 246 "build/pidl/idl.yp"
2090 { "\"$_[1]\"" }
2091         ],
2092         [#Rule 76
2093                  'optional_semicolon', 0, undef
2094         ],
2095         [#Rule 77
2096                  'optional_semicolon', 1, undef
2097         ]
2098 ],
2099                                   @_);
2100     bless($self,$class);
2101 }
2102
2103 #line 257 "build/pidl/idl.yp"
2104
2105
2106 use util;
2107
2108 sub _Error {
2109         if (exists $_[0]->YYData->{ERRMSG}) {
2110                 print $_[0]->YYData->{ERRMSG};
2111                 delete $_[0]->YYData->{ERRMSG};
2112                 return;
2113         };
2114         my $line = $_[0]->YYData->{LINE};
2115         my $last_token = $_[0]->YYData->{LAST_TOKEN};
2116         my $file = $_[0]->YYData->{INPUT_FILENAME};
2117         
2118         print "$file:$line: Syntax error near '$last_token'\n";
2119 }
2120
2121 sub _Lexer($)
2122 {
2123         my($parser)=shift;
2124
2125         $parser->YYData->{INPUT}
2126         or  return('',undef);
2127
2128 again:
2129         $parser->YYData->{INPUT} =~ s/^[ \t]*//;
2130
2131         for ($parser->YYData->{INPUT}) {
2132                 if (/^\#/) {
2133                         if (s/^\# (\d+) \"(.*?)\"( \d+|)//) {
2134                                 $parser->YYData->{LINE} = $1-1;
2135                                 $parser->YYData->{INPUT_FILENAME} = $2;
2136                                 goto again;
2137                         }
2138                         if (s/^\#line (\d+) \"(.*?)\"( \d+|)//) {
2139                                 $parser->YYData->{LINE} = $1-1;
2140                                 $parser->YYData->{INPUT_FILENAME} = $2;
2141                                 goto again;
2142                         }
2143                         if (s/^(\#.*)$//m) {
2144                                 goto again;
2145                         }
2146                 }
2147                 if (s/^(\n)//) {
2148                         $parser->YYData->{LINE}++;
2149                         goto again;
2150                 }
2151                 if (s/^\"(.*?)\"//) {
2152                         $parser->YYData->{LAST_TOKEN} = $1;
2153                         return('TEXT',$1); 
2154                 }
2155                 if (s/^(\d+)(\W|$)/$2/) {
2156                         $parser->YYData->{LAST_TOKEN} = $1;
2157                         return('CONSTANT',$1); 
2158                 }
2159                 if (s/^([\w_]+)//) {
2160                         $parser->YYData->{LAST_TOKEN} = $1;
2161                         if ($1 =~ 
2162                             /^(coclass|interface|const|typedef|union
2163                               |struct|enum|void|case|default)$/x) {
2164                                 return $1;
2165                         }
2166                         return('IDENTIFIER',$1);
2167                 }
2168                 if (s/^(.)//s) {
2169                         $parser->YYData->{LAST_TOKEN} = $1;
2170                         return($1,$1);
2171                 }
2172         }
2173 }
2174
2175 sub parse_idl($$)
2176 {
2177         my $self = shift;
2178         my $filename = shift;
2179
2180         my $saved_delim = $/;
2181         undef $/;
2182         my $cpp = $ENV{CPP};
2183         if (! defined $cpp) {
2184                 $cpp = "cpp"
2185         }
2186         my $data = `$cpp -xc $filename`;
2187         $/ = $saved_delim;
2188
2189     $self->YYData->{INPUT} = $data;
2190     $self->YYData->{LINE} = 0;
2191     $self->YYData->{LAST_TOKEN} = "NONE";
2192
2193         my $idl = $self->YYParse( yylex => \&_Lexer, yyerror => \&_Error );
2194
2195         foreach my $x (@{$idl}) {
2196                 # Add [in] ORPCTHIS *this, [out] ORPCTHAT *that
2197                 # for 'object' interfaces
2198                 if (defined($x->{PROPERTIES}->{object})) {
2199                         foreach my $e (@{$x->{DATA}}) {
2200                                 if($e->{TYPE} eq "FUNCTION") {
2201                                         $e->{PROPERTIES}->{object} = 1;
2202                                         unshift(@{$e->{DATA}}, 
2203                         { 'NAME' => 'ORPCthis',
2204                           'POINTERS' => 0,
2205                           'PROPERTIES' => { 'in' => '1' },
2206                           'TYPE' => 'ORPCTHIS'
2207                         });
2208                                         unshift(@{$e->{DATA}},
2209                         { 'NAME' => 'ORPCthat',
2210                           'POINTERS' => 0,
2211                           'PROPERTIES' => { 'out' => '1' },
2212                                                   'TYPE' => 'ORPCTHAT'
2213                         });
2214                                 }
2215                         }
2216                 }
2217                 
2218                 # Do the inheritance
2219                 if (defined($x->{BASE}) and $x->{BASE} ne "") {
2220                         my $parent = util::get_interface($idl, $x->{BASE});
2221
2222                         if(not defined($parent)) { 
2223                                 die("No such parent interface " . $x->{BASE});
2224                         }
2225                         
2226                         @{$x->{INHERITED_DATA}} = (@{$parent->{INHERITED_DATA}}, @{$x->{DATA}});
2227                 } else {
2228                         $x->{INHERITED_DATA} = $x->{DATA};
2229                 }
2230         }
2231
2232         return $idl;
2233 }
2234
2235 1;