487b53160ee1df6110c445c875f35fc6ac80a587
[samba.git] / source4 / 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                 ACTIONS => {
885                         'IDENTIFIER' => 9,
886                         "enum" => 69,
887                         'void' => 70
888                 },
889                 DEFAULT => -49,
890                 GOTOS => {
891                         'identifier' => 72,
892                         'struct' => 73,
893                         'enum' => 74,
894                         'type' => 75,
895                         'union' => 76,
896                         'property_list' => 71
897                 }
898         },
899         {#State 48
900                 DEFAULT => -12
901         },
902         {#State 49
903                 ACTIONS => {
904                         "}" => 77,
905                         "typedef" => 47,
906                         "const" => 53
907                 },
908                 DEFAULT => -49,
909                 GOTOS => {
910                         'const' => 52,
911                         'function' => 48,
912                         'typedef' => 54,
913                         'definition' => 78,
914                         'property_list' => 50
915                 }
916         },
917         {#State 50
918                 ACTIONS => {
919                         'IDENTIFIER' => 9,
920                         "enum" => 69,
921                         "[" => 7,
922                         'void' => 70
923                 },
924                 DEFAULT => -49,
925                 GOTOS => {
926                         'identifier' => 72,
927                         'struct' => 73,
928                         'enum' => 74,
929                         'type' => 79,
930                         'union' => 76,
931                         'property_list' => 71
932                 }
933         },
934         {#State 51
935                 DEFAULT => -10
936         },
937         {#State 52
938                 DEFAULT => -13
939         },
940         {#State 53
941                 ACTIONS => {
942                         'IDENTIFIER' => 9
943                 },
944                 GOTOS => {
945                         'identifier' => 80
946                 }
947         },
948         {#State 54
949                 DEFAULT => -14
950         },
951         {#State 55
952                 DEFAULT => -4
953         },
954         {#State 56
955                 DEFAULT => -77
956         },
957         {#State 57
958                 ACTIONS => {
959                         "{" => 37
960                 },
961                 DEFAULT => -63
962         },
963         {#State 58
964                 ACTIONS => {
965                         "{" => 37
966                 },
967                 DEFAULT => -70
968         },
969         {#State 59
970                 ACTIONS => {
971                         "-" => 35,
972                         "+" => 36,
973                         "&" => 38,
974                         "{" => 37,
975                         "/" => 39,
976                         "(" => 41,
977                         "|" => 40,
978                         "*" => 42,
979                         "." => 43,
980                         ">" => 44
981                 },
982                 DEFAULT => -57
983         },
984         {#State 60
985                 ACTIONS => {
986                         "}" => 81,
987                         "," => 82
988                 }
989         },
990         {#State 61
991                 ACTIONS => {
992                         "{" => 37
993                 },
994                 DEFAULT => -68
995         },
996         {#State 62
997                 ACTIONS => {
998                         "{" => 37
999                 },
1000                 DEFAULT => -69
1001         },
1002         {#State 63
1003                 ACTIONS => {
1004                         "{" => 37
1005                 },
1006                 DEFAULT => -67
1007         },
1008         {#State 64
1009                 ACTIONS => {
1010                         "," => 82,
1011                         ")" => 83
1012                 }
1013         },
1014         {#State 65
1015                 ACTIONS => {
1016                         "{" => 37
1017                 },
1018                 DEFAULT => -65
1019         },
1020         {#State 66
1021                 ACTIONS => {
1022                         "{" => 37
1023                 },
1024                 DEFAULT => -64
1025         },
1026         {#State 67
1027                 ACTIONS => {
1028                         "{" => 37
1029                 },
1030                 DEFAULT => -66
1031         },
1032         {#State 68
1033                 ACTIONS => {
1034                         "-" => 35,
1035                         "+" => 36,
1036                         "&" => 38,
1037                         "{" => 37,
1038                         "/" => 39,
1039                         "(" => 41,
1040                         "|" => 40,
1041                         "*" => 42,
1042                         "." => 43,
1043                         ">" => 44
1044                 },
1045                 DEFAULT => -56
1046         },
1047         {#State 69
1048                 ACTIONS => {
1049                         "{" => 84
1050                 }
1051         },
1052         {#State 70
1053                 DEFAULT => -23
1054         },
1055         {#State 71
1056                 ACTIONS => {
1057                         "union" => 85,
1058                         "[" => 7,
1059                         "struct" => 86
1060                 }
1061         },
1062         {#State 72
1063                 DEFAULT => -22
1064         },
1065         {#State 73
1066                 DEFAULT => -19
1067         },
1068         {#State 74
1069                 DEFAULT => -21
1070         },
1071         {#State 75
1072                 ACTIONS => {
1073                         'IDENTIFIER' => 9
1074                 },
1075                 GOTOS => {
1076                         'identifier' => 87
1077                 }
1078         },
1079         {#State 76
1080                 DEFAULT => -20
1081         },
1082         {#State 77
1083                 ACTIONS => {
1084                         ";" => 56
1085                 },
1086                 DEFAULT => -76,
1087                 GOTOS => {
1088                         'optional_semicolon' => 88
1089                 }
1090         },
1091         {#State 78
1092                 DEFAULT => -11
1093         },
1094         {#State 79
1095                 ACTIONS => {
1096                         'IDENTIFIER' => 9
1097                 },
1098                 GOTOS => {
1099                         'identifier' => 89
1100                 }
1101         },
1102         {#State 80
1103                 ACTIONS => {
1104                         'IDENTIFIER' => 9
1105                 },
1106                 GOTOS => {
1107                         'identifier' => 90
1108                 }
1109         },
1110         {#State 81
1111                 ACTIONS => {
1112                         'CONSTANT' => 28,
1113                         'TEXT' => 22,
1114                         'IDENTIFIER' => 9
1115                 },
1116                 DEFAULT => -59,
1117                 GOTOS => {
1118                         'identifier' => 23,
1119                         'text' => 24,
1120                         'anytext' => 91,
1121                         'constant' => 27
1122                 }
1123         },
1124         {#State 82
1125                 ACTIONS => {
1126                         'CONSTANT' => 28,
1127                         'TEXT' => 22,
1128                         'IDENTIFIER' => 9
1129                 },
1130                 DEFAULT => -59,
1131                 GOTOS => {
1132                         'identifier' => 23,
1133                         'text' => 24,
1134                         'anytext' => 92,
1135                         'constant' => 27
1136                 }
1137         },
1138         {#State 83
1139                 ACTIONS => {
1140                         'CONSTANT' => 28,
1141                         'TEXT' => 22,
1142                         'IDENTIFIER' => 9
1143                 },
1144                 DEFAULT => -59,
1145                 GOTOS => {
1146                         'identifier' => 23,
1147                         'text' => 24,
1148                         'anytext' => 93,
1149                         'constant' => 27
1150                 }
1151         },
1152         {#State 84
1153                 ACTIONS => {
1154                         'IDENTIFIER' => 9
1155                 },
1156                 GOTOS => {
1157                         'identifier' => 94,
1158                         'enum_element' => 95,
1159                         'enum_elements' => 96
1160                 }
1161         },
1162         {#State 85
1163                 ACTIONS => {
1164                         "{" => 97
1165                 }
1166         },
1167         {#State 86
1168                 ACTIONS => {
1169                         "{" => 98
1170                 }
1171         },
1172         {#State 87
1173                 ACTIONS => {
1174                         "[" => 100
1175                 },
1176                 DEFAULT => -46,
1177                 GOTOS => {
1178                         'array_len' => 99
1179                 }
1180         },
1181         {#State 88
1182                 DEFAULT => -7
1183         },
1184         {#State 89
1185                 ACTIONS => {
1186                         "(" => 101
1187                 }
1188         },
1189         {#State 90
1190                 ACTIONS => {
1191                         "[" => 100,
1192                         "=" => 103
1193                 },
1194                 GOTOS => {
1195                         'array_len' => 102
1196                 }
1197         },
1198         {#State 91
1199                 ACTIONS => {
1200                         "-" => 35,
1201                         "+" => 36,
1202                         "*" => 42,
1203                         "{" => 37,
1204                         "&" => 38,
1205                         "/" => 39,
1206                         "|" => 40,
1207                         "(" => 41,
1208                         "." => 43,
1209                         ">" => 44
1210                 },
1211                 DEFAULT => -72
1212         },
1213         {#State 92
1214                 ACTIONS => {
1215                         "-" => 35,
1216                         "+" => 36,
1217                         "&" => 38,
1218                         "{" => 37,
1219                         "/" => 39,
1220                         "(" => 41,
1221                         "|" => 40,
1222                         "*" => 42,
1223                         "." => 43,
1224                         ">" => 44
1225                 },
1226                 DEFAULT => -58
1227         },
1228         {#State 93
1229                 ACTIONS => {
1230                         "{" => 37
1231                 },
1232                 DEFAULT => -71
1233         },
1234         {#State 94
1235                 ACTIONS => {
1236                         "=" => 104
1237                 },
1238                 DEFAULT => -27
1239         },
1240         {#State 95
1241                 DEFAULT => -25
1242         },
1243         {#State 96
1244                 ACTIONS => {
1245                         "}" => 105,
1246                         "," => 106
1247                 }
1248         },
1249         {#State 97
1250                 ACTIONS => {
1251                         "[" => 109
1252                 },
1253                 GOTOS => {
1254                         'union_elements' => 107,
1255                         'union_element' => 108
1256                 }
1257         },
1258         {#State 98
1259                 DEFAULT => -40,
1260                 GOTOS => {
1261                         'element_list1' => 110
1262                 }
1263         },
1264         {#State 99
1265                 ACTIONS => {
1266                         ";" => 111
1267                 }
1268         },
1269         {#State 100
1270                 ACTIONS => {
1271                         'IDENTIFIER' => 9,
1272                         'CONSTANT' => 28,
1273                         'TEXT' => 22,
1274                         "]" => 113
1275                 },
1276                 DEFAULT => -59,
1277                 GOTOS => {
1278                         'identifier' => 23,
1279                         'text' => 24,
1280                         'anytext' => 112,
1281                         'constant' => 27
1282                 }
1283         },
1284         {#State 101
1285                 ACTIONS => {
1286                         "," => -42,
1287                         "void" => 116,
1288                         ")" => -42
1289                 },
1290                 DEFAULT => -49,
1291                 GOTOS => {
1292                         'base_element' => 114,
1293                         'element_list2' => 117,
1294                         'property_list' => 115
1295                 }
1296         },
1297         {#State 102
1298                 ACTIONS => {
1299                         "=" => 118
1300                 }
1301         },
1302         {#State 103
1303                 ACTIONS => {
1304                         'IDENTIFIER' => 9,
1305                         'CONSTANT' => 28,
1306                         'TEXT' => 22
1307                 },
1308                 DEFAULT => -59,
1309                 GOTOS => {
1310                         'identifier' => 23,
1311                         'text' => 24,
1312                         'anytext' => 119,
1313                         'constant' => 27
1314                 }
1315         },
1316         {#State 104
1317                 ACTIONS => {
1318                         'CONSTANT' => 28,
1319                         'TEXT' => 22,
1320                         'IDENTIFIER' => 9
1321                 },
1322                 DEFAULT => -59,
1323                 GOTOS => {
1324                         'identifier' => 23,
1325                         'text' => 24,
1326                         'anytext' => 120,
1327                         'constant' => 27
1328                 }
1329         },
1330         {#State 105
1331                 DEFAULT => -24
1332         },
1333         {#State 106
1334                 ACTIONS => {
1335                         'IDENTIFIER' => 9
1336                 },
1337                 GOTOS => {
1338                         'identifier' => 94,
1339                         'enum_element' => 121
1340                 }
1341         },
1342         {#State 107
1343                 ACTIONS => {
1344                         "}" => 122,
1345                         "[" => 109
1346                 },
1347                 GOTOS => {
1348                         'union_element' => 123
1349                 }
1350         },
1351         {#State 108
1352                 DEFAULT => -31
1353         },
1354         {#State 109
1355                 ACTIONS => {
1356                         "case" => 124,
1357                         "default" => 125
1358                 }
1359         },
1360         {#State 110
1361                 ACTIONS => {
1362                         "}" => 126
1363                 },
1364                 DEFAULT => -49,
1365                 GOTOS => {
1366                         'base_element' => 127,
1367                         'property_list' => 115
1368                 }
1369         },
1370         {#State 111
1371                 DEFAULT => -18
1372         },
1373         {#State 112
1374                 ACTIONS => {
1375                         "-" => 35,
1376                         "+" => 36,
1377                         "&" => 38,
1378                         "{" => 37,
1379                         "/" => 39,
1380                         "(" => 41,
1381                         "|" => 40,
1382                         "*" => 42,
1383                         "." => 43,
1384                         "]" => 128,
1385                         ">" => 44
1386                 }
1387         },
1388         {#State 113
1389                 DEFAULT => -47
1390         },
1391         {#State 114
1392                 DEFAULT => -44
1393         },
1394         {#State 115
1395                 ACTIONS => {
1396                         'IDENTIFIER' => 9,
1397                         "enum" => 69,
1398                         "[" => 7,
1399                         'void' => 70
1400                 },
1401                 DEFAULT => -49,
1402                 GOTOS => {
1403                         'identifier' => 72,
1404                         'struct' => 73,
1405                         'enum' => 74,
1406                         'type' => 129,
1407                         'union' => 76,
1408                         'property_list' => 71
1409                 }
1410         },
1411         {#State 116
1412                 DEFAULT => -43
1413         },
1414         {#State 117
1415                 ACTIONS => {
1416                         "," => 130,
1417                         ")" => 131
1418                 }
1419         },
1420         {#State 118
1421                 ACTIONS => {
1422                         'IDENTIFIER' => 9,
1423                         'CONSTANT' => 28,
1424                         'TEXT' => 22
1425                 },
1426                 DEFAULT => -59,
1427                 GOTOS => {
1428                         'identifier' => 23,
1429                         'text' => 24,
1430                         'anytext' => 132,
1431                         'constant' => 27
1432                 }
1433         },
1434         {#State 119
1435                 ACTIONS => {
1436                         "-" => 35,
1437                         ";" => 133,
1438                         "+" => 36,
1439                         "&" => 38,
1440                         "{" => 37,
1441                         "/" => 39,
1442                         "(" => 41,
1443                         "|" => 40,
1444                         "*" => 42,
1445                         "." => 43,
1446                         ">" => 44
1447                 }
1448         },
1449         {#State 120
1450                 ACTIONS => {
1451                         "-" => 35,
1452                         "+" => 36,
1453                         "&" => 38,
1454                         "{" => 37,
1455                         "/" => 39,
1456                         "(" => 41,
1457                         "|" => 40,
1458                         "*" => 42,
1459                         "." => 43,
1460                         ">" => 44
1461                 },
1462                 DEFAULT => -28
1463         },
1464         {#State 121
1465                 DEFAULT => -26
1466         },
1467         {#State 122
1468                 DEFAULT => -30
1469         },
1470         {#State 123
1471                 DEFAULT => -32
1472         },
1473         {#State 124
1474                 ACTIONS => {
1475                         "(" => 134
1476                 }
1477         },
1478         {#State 125
1479                 ACTIONS => {
1480                         "]" => 135
1481                 }
1482         },
1483         {#State 126
1484                 DEFAULT => -29
1485         },
1486         {#State 127
1487                 ACTIONS => {
1488                         ";" => 136
1489                 }
1490         },
1491         {#State 128
1492                 DEFAULT => -48
1493         },
1494         {#State 129
1495                 DEFAULT => -38,
1496                 GOTOS => {
1497                         'pointers' => 137
1498                 }
1499         },
1500         {#State 130
1501                 DEFAULT => -49,
1502                 GOTOS => {
1503                         'base_element' => 138,
1504                         'property_list' => 115
1505                 }
1506         },
1507         {#State 131
1508                 ACTIONS => {
1509                         ";" => 139
1510                 }
1511         },
1512         {#State 132
1513                 ACTIONS => {
1514                         "-" => 35,
1515                         ";" => 140,
1516                         "+" => 36,
1517                         "&" => 38,
1518                         "{" => 37,
1519                         "/" => 39,
1520                         "(" => 41,
1521                         "|" => 40,
1522                         "*" => 42,
1523                         "." => 43,
1524                         ">" => 44
1525                 }
1526         },
1527         {#State 133
1528                 DEFAULT => -15
1529         },
1530         {#State 134
1531                 ACTIONS => {
1532                         'IDENTIFIER' => 9,
1533                         'CONSTANT' => 28,
1534                         'TEXT' => 22
1535                 },
1536                 DEFAULT => -59,
1537                 GOTOS => {
1538                         'identifier' => 23,
1539                         'text' => 24,
1540                         'anytext' => 141,
1541                         'constant' => 27
1542                 }
1543         },
1544         {#State 135
1545                 ACTIONS => {
1546                         ";" => 142
1547                 },
1548                 DEFAULT => -49,
1549                 GOTOS => {
1550                         'base_element' => 143,
1551                         'property_list' => 115
1552                 }
1553         },
1554         {#State 136
1555                 DEFAULT => -41
1556         },
1557         {#State 137
1558                 ACTIONS => {
1559                         'IDENTIFIER' => 9,
1560                         "*" => 145
1561                 },
1562                 GOTOS => {
1563                         'identifier' => 144
1564                 }
1565         },
1566         {#State 138
1567                 DEFAULT => -45
1568         },
1569         {#State 139
1570                 DEFAULT => -17
1571         },
1572         {#State 140
1573                 DEFAULT => -16
1574         },
1575         {#State 141
1576                 ACTIONS => {
1577                         "-" => 35,
1578                         "+" => 36,
1579                         "&" => 38,
1580                         "{" => 37,
1581                         "/" => 39,
1582                         "(" => 41,
1583                         "|" => 40,
1584                         "*" => 42,
1585                         "." => 43,
1586                         ")" => 146,
1587                         ">" => 44
1588                 }
1589         },
1590         {#State 142
1591                 DEFAULT => -36
1592         },
1593         {#State 143
1594                 ACTIONS => {
1595                         ";" => 147
1596                 }
1597         },
1598         {#State 144
1599                 ACTIONS => {
1600                         "[" => 100
1601                 },
1602                 DEFAULT => -46,
1603                 GOTOS => {
1604                         'array_len' => 148
1605                 }
1606         },
1607         {#State 145
1608                 DEFAULT => -39
1609         },
1610         {#State 146
1611                 ACTIONS => {
1612                         "]" => 149
1613                 }
1614         },
1615         {#State 147
1616                 DEFAULT => -35
1617         },
1618         {#State 148
1619                 DEFAULT => -37
1620         },
1621         {#State 149
1622                 ACTIONS => {
1623                         ";" => 150
1624                 },
1625                 DEFAULT => -49,
1626                 GOTOS => {
1627                         'base_element' => 151,
1628                         'property_list' => 115
1629                 }
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', 5,
1762 sub
1763 #line 90 "build/pidl/idl.yp"
1764 {{
1765                      "TYPE" => "TYPEDEF", 
1766                      "NAME" => $_[3],
1767                      "DATA" => $_[2],
1768                      "ARRAY_LEN" => $_[4]
1769         }}
1770         ],
1771         [#Rule 19
1772                  'type', 1, undef
1773         ],
1774         [#Rule 20
1775                  'type', 1, undef
1776         ],
1777         [#Rule 21
1778                  'type', 1, undef
1779         ],
1780         [#Rule 22
1781                  'type', 1, undef
1782         ],
1783         [#Rule 23
1784                  'type', 1,
1785 sub
1786 #line 99 "build/pidl/idl.yp"
1787 { "void" }
1788         ],
1789         [#Rule 24
1790                  'enum', 4,
1791 sub
1792 #line 104 "build/pidl/idl.yp"
1793 {{
1794                      "TYPE" => "ENUM", 
1795                      "ELEMENTS" => $_[3]
1796         }}
1797         ],
1798         [#Rule 25
1799                  'enum_elements', 1,
1800 sub
1801 #line 111 "build/pidl/idl.yp"
1802 { [ $_[1] ] }
1803         ],
1804         [#Rule 26
1805                  'enum_elements', 3,
1806 sub
1807 #line 112 "build/pidl/idl.yp"
1808 { push(@{$_[1]}, $_[3]); $_[1] }
1809         ],
1810         [#Rule 27
1811                  'enum_element', 1, undef
1812         ],
1813         [#Rule 28
1814                  'enum_element', 3,
1815 sub
1816 #line 116 "build/pidl/idl.yp"
1817 { "$_[1]$_[2]$_[3]" }
1818         ],
1819         [#Rule 29
1820                  'struct', 5,
1821 sub
1822 #line 120 "build/pidl/idl.yp"
1823 {{
1824                      "TYPE" => "STRUCT", 
1825                      "PROPERTIES" => $_[1],
1826                      "ELEMENTS" => $_[4]
1827         }}
1828         ],
1829         [#Rule 30
1830                  'union', 5,
1831 sub
1832 #line 128 "build/pidl/idl.yp"
1833 {{
1834                 "TYPE" => "UNION",
1835                 "PROPERTIES" => $_[1],
1836                 "DATA" => $_[4]
1837          }}
1838         ],
1839         [#Rule 31
1840                  'union_elements', 1,
1841 sub
1842 #line 136 "build/pidl/idl.yp"
1843 { [ $_[1] ] }
1844         ],
1845         [#Rule 32
1846                  'union_elements', 2,
1847 sub
1848 #line 137 "build/pidl/idl.yp"
1849 { push(@{$_[1]}, $_[2]); $_[1] }
1850         ],
1851         [#Rule 33
1852                  'union_element', 8,
1853 sub
1854 #line 142 "build/pidl/idl.yp"
1855 {{
1856                 "TYPE" => "UNION_ELEMENT",
1857                 "CASE" => $_[4],
1858                 "DATA" => $_[7]
1859          }}
1860         ],
1861         [#Rule 34
1862                  'union_element', 7,
1863 sub
1864 #line 148 "build/pidl/idl.yp"
1865 {{
1866                 "TYPE" => "EMPTY",
1867                 "CASE" => $_[4],
1868          }}
1869         ],
1870         [#Rule 35
1871                  'union_element', 5,
1872 sub
1873 #line 153 "build/pidl/idl.yp"
1874 {{
1875                 "TYPE" => "UNION_ELEMENT",
1876                 "CASE" => "default",
1877                 "DATA" => $_[4]
1878          }}
1879         ],
1880         [#Rule 36
1881                  'union_element', 4,
1882 sub
1883 #line 159 "build/pidl/idl.yp"
1884 {{
1885                 "TYPE" => "EMPTY",
1886                 "CASE" => "default",
1887          }}
1888         ],
1889         [#Rule 37
1890                  'base_element', 5,
1891 sub
1892 #line 166 "build/pidl/idl.yp"
1893 {{
1894                            "NAME" => $_[4],
1895                            "TYPE" => $_[2],
1896                            "PROPERTIES" => $_[1],
1897                            "POINTERS" => $_[3],
1898                            "ARRAY_LEN" => $_[5]
1899               }}
1900         ],
1901         [#Rule 38
1902                  'pointers', 0,
1903 sub
1904 #line 178 "build/pidl/idl.yp"
1905 { 0 }
1906         ],
1907         [#Rule 39
1908                  'pointers', 2,
1909 sub
1910 #line 179 "build/pidl/idl.yp"
1911 { $_[1]+1 }
1912         ],
1913         [#Rule 40
1914                  'element_list1', 0, undef
1915         ],
1916         [#Rule 41
1917                  'element_list1', 3,
1918 sub
1919 #line 186 "build/pidl/idl.yp"
1920 { push(@{$_[1]}, $_[2]); $_[1] }
1921         ],
1922         [#Rule 42
1923                  'element_list2', 0, undef
1924         ],
1925         [#Rule 43
1926                  'element_list2', 1, undef
1927         ],
1928         [#Rule 44
1929                  'element_list2', 1,
1930 sub
1931 #line 192 "build/pidl/idl.yp"
1932 { [ $_[1] ] }
1933         ],
1934         [#Rule 45
1935                  'element_list2', 3,
1936 sub
1937 #line 193 "build/pidl/idl.yp"
1938 { push(@{$_[1]}, $_[3]); $_[1] }
1939         ],
1940         [#Rule 46
1941                  'array_len', 0, undef
1942         ],
1943         [#Rule 47
1944                  'array_len', 2,
1945 sub
1946 #line 198 "build/pidl/idl.yp"
1947 { "*" }
1948         ],
1949         [#Rule 48
1950                  'array_len', 3,
1951 sub
1952 #line 199 "build/pidl/idl.yp"
1953 { "$_[2]" }
1954         ],
1955         [#Rule 49
1956                  'property_list', 0, undef
1957         ],
1958         [#Rule 50
1959                  'property_list', 4,
1960 sub
1961 #line 205 "build/pidl/idl.yp"
1962 { util::FlattenHash([$_[1],$_[3]]); }
1963         ],
1964         [#Rule 51
1965                  'properties', 1,
1966 sub
1967 #line 208 "build/pidl/idl.yp"
1968 { $_[1] }
1969         ],
1970         [#Rule 52
1971                  'properties', 3,
1972 sub
1973 #line 209 "build/pidl/idl.yp"
1974 { util::FlattenHash([$_[1], $_[3]]); }
1975         ],
1976         [#Rule 53
1977                  'property', 1,
1978 sub
1979 #line 212 "build/pidl/idl.yp"
1980 {{ "$_[1]" => "1"     }}
1981         ],
1982         [#Rule 54
1983                  'property', 4,
1984 sub
1985 #line 213 "build/pidl/idl.yp"
1986 {{ "$_[1]" => "$_[3]" }}
1987         ],
1988         [#Rule 55
1989                  'listtext', 1, undef
1990         ],
1991         [#Rule 56
1992                  'listtext', 3,
1993 sub
1994 #line 218 "build/pidl/idl.yp"
1995 { "$_[1] $_[3]" }
1996         ],
1997         [#Rule 57
1998                  'commalisttext', 1, undef
1999         ],
2000         [#Rule 58
2001                  'commalisttext', 3,
2002 sub
2003 #line 223 "build/pidl/idl.yp"
2004 { "$_[1],$_[3]" }
2005         ],
2006         [#Rule 59
2007                  'anytext', 0,
2008 sub
2009 #line 227 "build/pidl/idl.yp"
2010 { "" }
2011         ],
2012         [#Rule 60
2013                  'anytext', 1, undef
2014         ],
2015         [#Rule 61
2016                  'anytext', 1, undef
2017         ],
2018         [#Rule 62
2019                  'anytext', 1, undef
2020         ],
2021         [#Rule 63
2022                  'anytext', 3,
2023 sub
2024 #line 229 "build/pidl/idl.yp"
2025 { "$_[1]$_[2]$_[3]" }
2026         ],
2027         [#Rule 64
2028                  'anytext', 3,
2029 sub
2030 #line 230 "build/pidl/idl.yp"
2031 { "$_[1]$_[2]$_[3]" }
2032         ],
2033         [#Rule 65
2034                  'anytext', 3,
2035 sub
2036 #line 231 "build/pidl/idl.yp"
2037 { "$_[1]$_[2]$_[3]" }
2038         ],
2039         [#Rule 66
2040                  'anytext', 3,
2041 sub
2042 #line 232 "build/pidl/idl.yp"
2043 { "$_[1]$_[2]$_[3]" }
2044         ],
2045         [#Rule 67
2046                  'anytext', 3,
2047 sub
2048 #line 233 "build/pidl/idl.yp"
2049 { "$_[1]$_[2]$_[3]" }
2050         ],
2051         [#Rule 68
2052                  'anytext', 3,
2053 sub
2054 #line 234 "build/pidl/idl.yp"
2055 { "$_[1]$_[2]$_[3]" }
2056         ],
2057         [#Rule 69
2058                  'anytext', 3,
2059 sub
2060 #line 235 "build/pidl/idl.yp"
2061 { "$_[1]$_[2]$_[3]" }
2062         ],
2063         [#Rule 70
2064                  'anytext', 3,
2065 sub
2066 #line 236 "build/pidl/idl.yp"
2067 { "$_[1]$_[2]$_[3]" }
2068         ],
2069         [#Rule 71
2070                  'anytext', 5,
2071 sub
2072 #line 237 "build/pidl/idl.yp"
2073 { "$_[1]$_[2]$_[3]$_[4]$_[5]" }
2074         ],
2075         [#Rule 72
2076                  'anytext', 5,
2077 sub
2078 #line 238 "build/pidl/idl.yp"
2079 { "$_[1]$_[2]$_[3]$_[4]$_[5]" }
2080         ],
2081         [#Rule 73
2082                  'identifier', 1, undef
2083         ],
2084         [#Rule 74
2085                  'constant', 1, undef
2086         ],
2087         [#Rule 75
2088                  'text', 1,
2089 sub
2090 #line 247 "build/pidl/idl.yp"
2091 { "\"$_[1]\"" }
2092         ],
2093         [#Rule 76
2094                  'optional_semicolon', 0, undef
2095         ],
2096         [#Rule 77
2097                  'optional_semicolon', 1, undef
2098         ]
2099 ],
2100                                   @_);
2101     bless($self,$class);
2102 }
2103
2104 #line 258 "build/pidl/idl.yp"
2105
2106
2107 use util;
2108
2109 sub _Error {
2110         if (exists $_[0]->YYData->{ERRMSG}) {
2111                 print $_[0]->YYData->{ERRMSG};
2112                 delete $_[0]->YYData->{ERRMSG};
2113                 return;
2114         };
2115         my $line = $_[0]->YYData->{LINE};
2116         my $last_token = $_[0]->YYData->{LAST_TOKEN};
2117         my $file = $_[0]->YYData->{INPUT_FILENAME};
2118         
2119         print "$file:$line: Syntax error near '$last_token'\n";
2120 }
2121
2122 sub _Lexer($)
2123 {
2124         my($parser)=shift;
2125
2126         $parser->YYData->{INPUT}
2127         or  return('',undef);
2128
2129 again:
2130         $parser->YYData->{INPUT} =~ s/^[ \t]*//;
2131
2132         for ($parser->YYData->{INPUT}) {
2133                 if (/^\#/) {
2134                         if (s/^\# (\d+) \"(.*?)\"( \d+|)//) {
2135                                 $parser->YYData->{LINE} = $1-1;
2136                                 $parser->YYData->{INPUT_FILENAME} = $2;
2137                                 goto again;
2138                         }
2139                         if (s/^\#line (\d+) \"(.*?)\"( \d+|)//) {
2140                                 $parser->YYData->{LINE} = $1-1;
2141                                 $parser->YYData->{INPUT_FILENAME} = $2;
2142                                 goto again;
2143                         }
2144                         if (s/^(\#.*)$//m) {
2145                                 goto again;
2146                         }
2147                 }
2148                 if (s/^(\n)//) {
2149                         $parser->YYData->{LINE}++;
2150                         goto again;
2151                 }
2152                 if (s/^\"(.*?)\"//) {
2153                         $parser->YYData->{LAST_TOKEN} = $1;
2154                         return('TEXT',$1); 
2155                 }
2156                 if (s/^(\d+)(\W|$)/$2/) {
2157                         $parser->YYData->{LAST_TOKEN} = $1;
2158                         return('CONSTANT',$1); 
2159                 }
2160                 if (s/^([\w_]+)//) {
2161                         $parser->YYData->{LAST_TOKEN} = $1;
2162                         if ($1 =~ 
2163                             /^(coclass|interface|const|typedef|union
2164                               |struct|enum|void|case|default)$/x) {
2165                                 return $1;
2166                         }
2167                         return('IDENTIFIER',$1);
2168                 }
2169                 if (s/^(.)//s) {
2170                         $parser->YYData->{LAST_TOKEN} = $1;
2171                         return($1,$1);
2172                 }
2173         }
2174 }
2175
2176 sub parse_idl($$)
2177 {
2178         my $self = shift;
2179         my $filename = shift;
2180
2181         my $saved_delim = $/;
2182         undef $/;
2183         my $cpp = $ENV{CPP};
2184         if (! defined $cpp) {
2185                 $cpp = "cpp"
2186         }
2187         my $data = `$cpp -xc $filename`;
2188         $/ = $saved_delim;
2189
2190     $self->YYData->{INPUT} = $data;
2191     $self->YYData->{LINE} = 0;
2192     $self->YYData->{LAST_TOKEN} = "NONE";
2193
2194         my $idl = $self->YYParse( yylex => \&_Lexer, yyerror => \&_Error );
2195
2196         foreach my $x (@{$idl}) {
2197                 # Add [in] ORPCTHIS *this, [out] ORPCTHAT *that
2198                 # for 'object' interfaces
2199                 if (defined($x->{PROPERTIES}->{object})) {
2200                         foreach my $e (@{$x->{DATA}}) {
2201                                 if($e->{TYPE} eq "FUNCTION") {
2202                                         $e->{PROPERTIES}->{object} = 1;
2203                                         unshift(@{$e->{DATA}}, 
2204                         { 'NAME' => 'ORPCthis',
2205                           'POINTERS' => 0,
2206                           'PROPERTIES' => { 'in' => '1' },
2207                           'TYPE' => 'ORPCTHIS'
2208                         });
2209                                         unshift(@{$e->{DATA}},
2210                         { 'NAME' => 'ORPCthat',
2211                           'POINTERS' => 0,
2212                           'PROPERTIES' => { 'out' => '1' },
2213                                                   'TYPE' => 'ORPCTHAT'
2214                         });
2215                                 }
2216                         }
2217                 }
2218                 
2219                 # Do the inheritance
2220                 if (defined($x->{BASE}) and $x->{BASE} ne "") {
2221                         my $parent = util::get_interface($idl, $x->{BASE});
2222
2223                         if(not defined($parent)) { 
2224                                 die("No such parent interface " . $x->{BASE});
2225                         }
2226                         
2227                         @{$x->{INHERITED_DATA}} = (@{$parent->{INHERITED_DATA}}, @{$x->{DATA}});
2228                 } else {
2229                         $x->{INHERITED_DATA} = $x->{DATA};
2230                 }
2231         }
2232
2233         return $idl;
2234 }
2235
2236 1;