19525e42f361495c02e3b0b3c20be1e9a98da652
[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 => -48,
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 => -71
563         },
564         {#State 10
565                 ACTIONS => {
566                         "{" => 15
567                 }
568         },
569         {#State 11
570                 ACTIONS => {
571                         "(" => 16
572                 },
573                 DEFAULT => -52
574         },
575         {#State 12
576                 DEFAULT => -50
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                         'IDENTIFIER' => 9,
602                         'CONSTANT' => 28,
603                         'TEXT' => 22
604                 },
605                 DEFAULT => -58,
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 => -49
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 => -48,
644                 GOTOS => {
645                         'interface' => 33,
646                         'property_list' => 34
647                 }
648         },
649         {#State 22
650                 DEFAULT => -73
651         },
652         {#State 23
653                 DEFAULT => -59
654         },
655         {#State 24
656                 DEFAULT => -61
657         },
658         {#State 25
659                 ACTIONS => {
660                         "-" => 35,
661                         "+" => 36,
662                         "&" => 37,
663                         "/" => 38,
664                         "|" => 39,
665                         "(" => 40,
666                         "*" => 41,
667                         "." => 42,
668                         ">" => 43
669                 },
670                 DEFAULT => -54
671         },
672         {#State 26
673                 ACTIONS => {
674                         "," => 44,
675                         ")" => 45
676                 }
677         },
678         {#State 27
679                 DEFAULT => -60
680         },
681         {#State 28
682                 DEFAULT => -72
683         },
684         {#State 29
685                 DEFAULT => -51
686         },
687         {#State 30
688                 DEFAULT => -9
689         },
690         {#State 31
691                 ACTIONS => {
692                         "typedef" => 46,
693                         "const" => 52
694                 },
695                 DEFAULT => -48,
696                 GOTOS => {
697                         'const' => 51,
698                         'function' => 47,
699                         'typedef' => 53,
700                         'definitions' => 48,
701                         'definition' => 50,
702                         'property_list' => 49
703                 }
704         },
705         {#State 32
706                 ACTIONS => {
707                         ";" => 55
708                 },
709                 DEFAULT => -74,
710                 GOTOS => {
711                         'optional_semicolon' => 54
712                 }
713         },
714         {#State 33
715                 DEFAULT => -6
716         },
717         {#State 34
718                 ACTIONS => {
719                         "[" => 7,
720                         "interface" => 8
721                 }
722         },
723         {#State 35
724                 ACTIONS => {
725                         'CONSTANT' => 28,
726                         'TEXT' => 22,
727                         'IDENTIFIER' => 9
728                 },
729                 DEFAULT => -58,
730                 GOTOS => {
731                         'identifier' => 23,
732                         'text' => 24,
733                         'anytext' => 56,
734                         'constant' => 27
735                 }
736         },
737         {#State 36
738                 ACTIONS => {
739                         'CONSTANT' => 28,
740                         'TEXT' => 22,
741                         'IDENTIFIER' => 9
742                 },
743                 DEFAULT => -58,
744                 GOTOS => {
745                         'identifier' => 23,
746                         'text' => 24,
747                         'anytext' => 57,
748                         'constant' => 27
749                 }
750         },
751         {#State 37
752                 ACTIONS => {
753                         'CONSTANT' => 28,
754                         'TEXT' => 22,
755                         'IDENTIFIER' => 9
756                 },
757                 DEFAULT => -58,
758                 GOTOS => {
759                         'identifier' => 23,
760                         'text' => 24,
761                         'anytext' => 58,
762                         'constant' => 27
763                 }
764         },
765         {#State 38
766                 ACTIONS => {
767                         'CONSTANT' => 28,
768                         'TEXT' => 22,
769                         'IDENTIFIER' => 9
770                 },
771                 DEFAULT => -58,
772                 GOTOS => {
773                         'identifier' => 23,
774                         'text' => 24,
775                         'anytext' => 59,
776                         'constant' => 27
777                 }
778         },
779         {#State 39
780                 ACTIONS => {
781                         'CONSTANT' => 28,
782                         'TEXT' => 22,
783                         'IDENTIFIER' => 9
784                 },
785                 DEFAULT => -58,
786                 GOTOS => {
787                         'identifier' => 23,
788                         'text' => 24,
789                         'anytext' => 60,
790                         'constant' => 27
791                 }
792         },
793         {#State 40
794                 ACTIONS => {
795                         'IDENTIFIER' => 9,
796                         'CONSTANT' => 28,
797                         'TEXT' => 22
798                 },
799                 DEFAULT => -58,
800                 GOTOS => {
801                         'identifier' => 23,
802                         'text' => 24,
803                         'anytext' => 61,
804                         'constant' => 27,
805                         'commalisttext' => 62
806                 }
807         },
808         {#State 41
809                 ACTIONS => {
810                         'CONSTANT' => 28,
811                         'TEXT' => 22,
812                         'IDENTIFIER' => 9
813                 },
814                 DEFAULT => -58,
815                 GOTOS => {
816                         'identifier' => 23,
817                         'text' => 24,
818                         'anytext' => 63,
819                         'constant' => 27
820                 }
821         },
822         {#State 42
823                 ACTIONS => {
824                         'CONSTANT' => 28,
825                         'TEXT' => 22,
826                         'IDENTIFIER' => 9
827                 },
828                 DEFAULT => -58,
829                 GOTOS => {
830                         'identifier' => 23,
831                         'text' => 24,
832                         'anytext' => 64,
833                         'constant' => 27
834                 }
835         },
836         {#State 43
837                 ACTIONS => {
838                         'CONSTANT' => 28,
839                         'TEXT' => 22,
840                         'IDENTIFIER' => 9
841                 },
842                 DEFAULT => -58,
843                 GOTOS => {
844                         'identifier' => 23,
845                         'text' => 24,
846                         'anytext' => 65,
847                         'constant' => 27
848                 }
849         },
850         {#State 44
851                 ACTIONS => {
852                         'IDENTIFIER' => 9,
853                         'CONSTANT' => 28,
854                         'TEXT' => 22
855                 },
856                 DEFAULT => -58,
857                 GOTOS => {
858                         'identifier' => 23,
859                         'text' => 24,
860                         'anytext' => 66,
861                         'constant' => 27
862                 }
863         },
864         {#State 45
865                 DEFAULT => -53
866         },
867         {#State 46
868                 ACTIONS => {
869                         'IDENTIFIER' => 9,
870                         "enum" => 67,
871                         'void' => 68
872                 },
873                 DEFAULT => -48,
874                 GOTOS => {
875                         'identifier' => 70,
876                         'struct' => 71,
877                         'enum' => 72,
878                         'type' => 73,
879                         'union' => 74,
880                         'property_list' => 69
881                 }
882         },
883         {#State 47
884                 DEFAULT => -12
885         },
886         {#State 48
887                 ACTIONS => {
888                         "}" => 75,
889                         "typedef" => 46,
890                         "const" => 52
891                 },
892                 DEFAULT => -48,
893                 GOTOS => {
894                         'const' => 51,
895                         'function' => 47,
896                         'typedef' => 53,
897                         'definition' => 76,
898                         'property_list' => 49
899                 }
900         },
901         {#State 49
902                 ACTIONS => {
903                         'IDENTIFIER' => 9,
904                         "enum" => 67,
905                         "[" => 7,
906                         'void' => 68
907                 },
908                 DEFAULT => -48,
909                 GOTOS => {
910                         'identifier' => 70,
911                         'struct' => 71,
912                         'enum' => 72,
913                         'type' => 77,
914                         'union' => 74,
915                         'property_list' => 69
916                 }
917         },
918         {#State 50
919                 DEFAULT => -10
920         },
921         {#State 51
922                 DEFAULT => -13
923         },
924         {#State 52
925                 ACTIONS => {
926                         'IDENTIFIER' => 9
927                 },
928                 GOTOS => {
929                         'identifier' => 78
930                 }
931         },
932         {#State 53
933                 DEFAULT => -14
934         },
935         {#State 54
936                 DEFAULT => -4
937         },
938         {#State 55
939                 DEFAULT => -75
940         },
941         {#State 56
942                 DEFAULT => -62
943         },
944         {#State 57
945                 DEFAULT => -69
946         },
947         {#State 58
948                 DEFAULT => -67
949         },
950         {#State 59
951                 DEFAULT => -68
952         },
953         {#State 60
954                 DEFAULT => -66
955         },
956         {#State 61
957                 ACTIONS => {
958                         "-" => 35,
959                         "+" => 36,
960                         "&" => 37,
961                         "/" => 38,
962                         "(" => 40,
963                         "|" => 39,
964                         "*" => 41,
965                         "." => 42,
966                         ">" => 43
967                 },
968                 DEFAULT => -56
969         },
970         {#State 62
971                 ACTIONS => {
972                         "," => 79,
973                         ")" => 80
974                 }
975         },
976         {#State 63
977                 DEFAULT => -64
978         },
979         {#State 64
980                 DEFAULT => -63
981         },
982         {#State 65
983                 DEFAULT => -65
984         },
985         {#State 66
986                 ACTIONS => {
987                         "-" => 35,
988                         "+" => 36,
989                         "&" => 37,
990                         "/" => 38,
991                         "(" => 40,
992                         "|" => 39,
993                         "*" => 41,
994                         "." => 42,
995                         ">" => 43
996                 },
997                 DEFAULT => -55
998         },
999         {#State 67
1000                 ACTIONS => {
1001                         "{" => 81
1002                 }
1003         },
1004         {#State 68
1005                 DEFAULT => -22
1006         },
1007         {#State 69
1008                 ACTIONS => {
1009                         "union" => 82,
1010                         "[" => 7,
1011                         "struct" => 83
1012                 }
1013         },
1014         {#State 70
1015                 DEFAULT => -21
1016         },
1017         {#State 71
1018                 DEFAULT => -18
1019         },
1020         {#State 72
1021                 DEFAULT => -20
1022         },
1023         {#State 73
1024                 ACTIONS => {
1025                         'IDENTIFIER' => 9
1026                 },
1027                 GOTOS => {
1028                         'identifier' => 84
1029                 }
1030         },
1031         {#State 74
1032                 DEFAULT => -19
1033         },
1034         {#State 75
1035                 ACTIONS => {
1036                         ";" => 55
1037                 },
1038                 DEFAULT => -74,
1039                 GOTOS => {
1040                         'optional_semicolon' => 85
1041                 }
1042         },
1043         {#State 76
1044                 DEFAULT => -11
1045         },
1046         {#State 77
1047                 ACTIONS => {
1048                         'IDENTIFIER' => 9
1049                 },
1050                 GOTOS => {
1051                         'identifier' => 86
1052                 }
1053         },
1054         {#State 78
1055                 ACTIONS => {
1056                         'IDENTIFIER' => 9
1057                 },
1058                 GOTOS => {
1059                         'identifier' => 87
1060                 }
1061         },
1062         {#State 79
1063                 ACTIONS => {
1064                         'IDENTIFIER' => 9,
1065                         'CONSTANT' => 28,
1066                         'TEXT' => 22
1067                 },
1068                 DEFAULT => -58,
1069                 GOTOS => {
1070                         'identifier' => 23,
1071                         'text' => 24,
1072                         'anytext' => 88,
1073                         'constant' => 27
1074                 }
1075         },
1076         {#State 80
1077                 ACTIONS => {
1078                         'CONSTANT' => 28,
1079                         'TEXT' => 22,
1080                         'IDENTIFIER' => 9
1081                 },
1082                 DEFAULT => -58,
1083                 GOTOS => {
1084                         'identifier' => 23,
1085                         'text' => 24,
1086                         'anytext' => 89,
1087                         'constant' => 27
1088                 }
1089         },
1090         {#State 81
1091                 ACTIONS => {
1092                         'IDENTIFIER' => 9
1093                 },
1094                 GOTOS => {
1095                         'identifier' => 90,
1096                         'enum_element' => 91,
1097                         'enum_elements' => 92
1098                 }
1099         },
1100         {#State 82
1101                 ACTIONS => {
1102                         "{" => 93
1103                 }
1104         },
1105         {#State 83
1106                 ACTIONS => {
1107                         "{" => 94
1108                 }
1109         },
1110         {#State 84
1111                 ACTIONS => {
1112                         "[" => 96
1113                 },
1114                 DEFAULT => -45,
1115                 GOTOS => {
1116                         'array_len' => 95
1117                 }
1118         },
1119         {#State 85
1120                 DEFAULT => -7
1121         },
1122         {#State 86
1123                 ACTIONS => {
1124                         "(" => 97
1125                 }
1126         },
1127         {#State 87
1128                 ACTIONS => {
1129                         "=" => 98
1130                 }
1131         },
1132         {#State 88
1133                 ACTIONS => {
1134                         "-" => 35,
1135                         "+" => 36,
1136                         "&" => 37,
1137                         "/" => 38,
1138                         "(" => 40,
1139                         "|" => 39,
1140                         "*" => 41,
1141                         "." => 42,
1142                         ">" => 43
1143                 },
1144                 DEFAULT => -57
1145         },
1146         {#State 89
1147                 DEFAULT => -70
1148         },
1149         {#State 90
1150                 ACTIONS => {
1151                         "=" => 99
1152                 },
1153                 DEFAULT => -26
1154         },
1155         {#State 91
1156                 DEFAULT => -24
1157         },
1158         {#State 92
1159                 ACTIONS => {
1160                         "}" => 100,
1161                         "," => 101
1162                 }
1163         },
1164         {#State 93
1165                 ACTIONS => {
1166                         "[" => 104
1167                 },
1168                 GOTOS => {
1169                         'union_elements' => 102,
1170                         'union_element' => 103
1171                 }
1172         },
1173         {#State 94
1174                 DEFAULT => -39,
1175                 GOTOS => {
1176                         'element_list1' => 105
1177                 }
1178         },
1179         {#State 95
1180                 ACTIONS => {
1181                         ";" => 106
1182                 }
1183         },
1184         {#State 96
1185                 ACTIONS => {
1186                         'IDENTIFIER' => 9,
1187                         'CONSTANT' => 28,
1188                         'TEXT' => 22,
1189                         "]" => 108
1190                 },
1191                 DEFAULT => -58,
1192                 GOTOS => {
1193                         'identifier' => 23,
1194                         'text' => 24,
1195                         'anytext' => 107,
1196                         'constant' => 27
1197                 }
1198         },
1199         {#State 97
1200                 ACTIONS => {
1201                         "," => -41,
1202                         "void" => 111,
1203                         ")" => -41
1204                 },
1205                 DEFAULT => -48,
1206                 GOTOS => {
1207                         'base_element' => 109,
1208                         'element_list2' => 112,
1209                         'property_list' => 110
1210                 }
1211         },
1212         {#State 98
1213                 ACTIONS => {
1214                         'IDENTIFIER' => 9,
1215                         'CONSTANT' => 28,
1216                         'TEXT' => 22
1217                 },
1218                 DEFAULT => -58,
1219                 GOTOS => {
1220                         'identifier' => 23,
1221                         'text' => 24,
1222                         'anytext' => 113,
1223                         'constant' => 27
1224                 }
1225         },
1226         {#State 99
1227                 ACTIONS => {
1228                         'IDENTIFIER' => 9,
1229                         'CONSTANT' => 28,
1230                         'TEXT' => 22
1231                 },
1232                 DEFAULT => -58,
1233                 GOTOS => {
1234                         'identifier' => 23,
1235                         'text' => 24,
1236                         'anytext' => 114,
1237                         'constant' => 27
1238                 }
1239         },
1240         {#State 100
1241                 DEFAULT => -23
1242         },
1243         {#State 101
1244                 ACTIONS => {
1245                         'IDENTIFIER' => 9
1246                 },
1247                 GOTOS => {
1248                         'identifier' => 90,
1249                         'enum_element' => 115
1250                 }
1251         },
1252         {#State 102
1253                 ACTIONS => {
1254                         "}" => 116,
1255                         "[" => 104
1256                 },
1257                 GOTOS => {
1258                         'union_element' => 117
1259                 }
1260         },
1261         {#State 103
1262                 DEFAULT => -30
1263         },
1264         {#State 104
1265                 ACTIONS => {
1266                         "case" => 118,
1267                         "default" => 119
1268                 }
1269         },
1270         {#State 105
1271                 ACTIONS => {
1272                         "}" => 120
1273                 },
1274                 DEFAULT => -48,
1275                 GOTOS => {
1276                         'base_element' => 121,
1277                         'property_list' => 110
1278                 }
1279         },
1280         {#State 106
1281                 DEFAULT => -17
1282         },
1283         {#State 107
1284                 ACTIONS => {
1285                         "-" => 35,
1286                         "+" => 36,
1287                         "&" => 37,
1288                         "/" => 38,
1289                         "(" => 40,
1290                         "|" => 39,
1291                         "*" => 41,
1292                         "." => 42,
1293                         "]" => 122,
1294                         ">" => 43
1295                 }
1296         },
1297         {#State 108
1298                 DEFAULT => -46
1299         },
1300         {#State 109
1301                 DEFAULT => -43
1302         },
1303         {#State 110
1304                 ACTIONS => {
1305                         'IDENTIFIER' => 9,
1306                         "enum" => 67,
1307                         "[" => 7,
1308                         'void' => 68
1309                 },
1310                 DEFAULT => -48,
1311                 GOTOS => {
1312                         'identifier' => 70,
1313                         'struct' => 71,
1314                         'enum' => 72,
1315                         'type' => 123,
1316                         'union' => 74,
1317                         'property_list' => 69
1318                 }
1319         },
1320         {#State 111
1321                 DEFAULT => -42
1322         },
1323         {#State 112
1324                 ACTIONS => {
1325                         "," => 124,
1326                         ")" => 125
1327                 }
1328         },
1329         {#State 113
1330                 ACTIONS => {
1331                         "-" => 35,
1332                         "|" => 39,
1333                         "(" => 40,
1334                         "*" => 41,
1335                         ";" => 126,
1336                         "+" => 36,
1337                         "&" => 37,
1338                         "/" => 38,
1339                         "." => 42,
1340                         ">" => 43
1341                 }
1342         },
1343         {#State 114
1344                 ACTIONS => {
1345                         "-" => 35,
1346                         "+" => 36,
1347                         "&" => 37,
1348                         "/" => 38,
1349                         "(" => 40,
1350                         "|" => 39,
1351                         "*" => 41,
1352                         "." => 42,
1353                         ">" => 43
1354                 },
1355                 DEFAULT => -27
1356         },
1357         {#State 115
1358                 DEFAULT => -25
1359         },
1360         {#State 116
1361                 DEFAULT => -29
1362         },
1363         {#State 117
1364                 DEFAULT => -31
1365         },
1366         {#State 118
1367                 ACTIONS => {
1368                         "(" => 127
1369                 }
1370         },
1371         {#State 119
1372                 ACTIONS => {
1373                         "]" => 128
1374                 }
1375         },
1376         {#State 120
1377                 DEFAULT => -28
1378         },
1379         {#State 121
1380                 ACTIONS => {
1381                         ";" => 129
1382                 }
1383         },
1384         {#State 122
1385                 DEFAULT => -47
1386         },
1387         {#State 123
1388                 DEFAULT => -37,
1389                 GOTOS => {
1390                         'pointers' => 130
1391                 }
1392         },
1393         {#State 124
1394                 DEFAULT => -48,
1395                 GOTOS => {
1396                         'base_element' => 131,
1397                         'property_list' => 110
1398                 }
1399         },
1400         {#State 125
1401                 ACTIONS => {
1402                         ";" => 132
1403                 }
1404         },
1405         {#State 126
1406                 DEFAULT => -15
1407         },
1408         {#State 127
1409                 ACTIONS => {
1410                         'IDENTIFIER' => 9,
1411                         'CONSTANT' => 28,
1412                         'TEXT' => 22
1413                 },
1414                 DEFAULT => -58,
1415                 GOTOS => {
1416                         'identifier' => 23,
1417                         'text' => 24,
1418                         'anytext' => 133,
1419                         'constant' => 27
1420                 }
1421         },
1422         {#State 128
1423                 ACTIONS => {
1424                         ";" => 134
1425                 },
1426                 DEFAULT => -48,
1427                 GOTOS => {
1428                         'base_element' => 135,
1429                         'property_list' => 110
1430                 }
1431         },
1432         {#State 129
1433                 DEFAULT => -40
1434         },
1435         {#State 130
1436                 ACTIONS => {
1437                         'IDENTIFIER' => 9,
1438                         "*" => 137
1439                 },
1440                 GOTOS => {
1441                         'identifier' => 136
1442                 }
1443         },
1444         {#State 131
1445                 DEFAULT => -44
1446         },
1447         {#State 132
1448                 DEFAULT => -16
1449         },
1450         {#State 133
1451                 ACTIONS => {
1452                         "-" => 35,
1453                         "+" => 36,
1454                         "&" => 37,
1455                         "/" => 38,
1456                         "(" => 40,
1457                         "|" => 39,
1458                         "*" => 41,
1459                         "." => 42,
1460                         ")" => 138,
1461                         ">" => 43
1462                 }
1463         },
1464         {#State 134
1465                 DEFAULT => -35
1466         },
1467         {#State 135
1468                 ACTIONS => {
1469                         ";" => 139
1470                 }
1471         },
1472         {#State 136
1473                 ACTIONS => {
1474                         "[" => 96
1475                 },
1476                 DEFAULT => -45,
1477                 GOTOS => {
1478                         'array_len' => 140
1479                 }
1480         },
1481         {#State 137
1482                 DEFAULT => -38
1483         },
1484         {#State 138
1485                 ACTIONS => {
1486                         "]" => 141
1487                 }
1488         },
1489         {#State 139
1490                 DEFAULT => -34
1491         },
1492         {#State 140
1493                 DEFAULT => -36
1494         },
1495         {#State 141
1496                 ACTIONS => {
1497                         ";" => 142
1498                 },
1499                 DEFAULT => -48,
1500                 GOTOS => {
1501                         'base_element' => 143,
1502                         'property_list' => 110
1503                 }
1504         },
1505         {#State 142
1506                 DEFAULT => -33
1507         },
1508         {#State 143
1509                 ACTIONS => {
1510                         ";" => 144
1511                 }
1512         },
1513         {#State 144
1514                 DEFAULT => -32
1515         }
1516 ],
1517                                   yyrules  =>
1518 [
1519         [#Rule 0
1520                  '$start', 2, undef
1521         ],
1522         [#Rule 1
1523                  'idl', 0, undef
1524         ],
1525         [#Rule 2
1526                  'idl', 2,
1527 sub
1528 #line 19 "build/pidl/idl.yp"
1529 { push(@{$_[1]}, $_[2]); $_[1] }
1530         ],
1531         [#Rule 3
1532                  'idl', 2,
1533 sub
1534 #line 20 "build/pidl/idl.yp"
1535 { push(@{$_[1]}, $_[2]); $_[1] }
1536         ],
1537         [#Rule 4
1538                  'coclass', 7,
1539 sub
1540 #line 24 "build/pidl/idl.yp"
1541 {$_[3] => {
1542                "TYPE" => "COCLASS", 
1543                            "PROPERTIES" => $_[1],
1544                        "NAME" => $_[3],
1545                        "DATA" => $_[5],
1546           }}
1547         ],
1548         [#Rule 5
1549                  'interfaces', 0, undef
1550         ],
1551         [#Rule 6
1552                  'interfaces', 2,
1553 sub
1554 #line 34 "build/pidl/idl.yp"
1555 { push(@{$_[1]}, $_[2]); $_[1] }
1556         ],
1557         [#Rule 7
1558                  'interface', 8,
1559 sub
1560 #line 38 "build/pidl/idl.yp"
1561 {$_[3] => {
1562                "TYPE" => "INTERFACE", 
1563                            "PROPERTIES" => $_[1],
1564                        "NAME" => $_[3],
1565                            "BASE" => $_[4],
1566                        "DATA" => $_[6],
1567           }}
1568         ],
1569         [#Rule 8
1570                  'base_interface', 0, undef
1571         ],
1572         [#Rule 9
1573                  'base_interface', 2,
1574 sub
1575 #line 49 "build/pidl/idl.yp"
1576 { $_[2] }
1577         ],
1578         [#Rule 10
1579                  'definitions', 1,
1580 sub
1581 #line 53 "build/pidl/idl.yp"
1582 { [ $_[1] ] }
1583         ],
1584         [#Rule 11
1585                  'definitions', 2,
1586 sub
1587 #line 54 "build/pidl/idl.yp"
1588 { push(@{$_[1]}, $_[2]); $_[1] }
1589         ],
1590         [#Rule 12
1591                  'definition', 1, undef
1592         ],
1593         [#Rule 13
1594                  'definition', 1, undef
1595         ],
1596         [#Rule 14
1597                  'definition', 1, undef
1598         ],
1599         [#Rule 15
1600                  'const', 6,
1601 sub
1602 #line 62 "build/pidl/idl.yp"
1603 {{
1604                      "TYPE"  => "CONST", 
1605                      "DTYPE"  => $_[2],
1606                      "NAME"  => $_[3],
1607                      "VALUE" => $_[5]
1608         }}
1609         ],
1610         [#Rule 16
1611                  'function', 7,
1612 sub
1613 #line 72 "build/pidl/idl.yp"
1614 {{
1615                 "TYPE" => "FUNCTION",
1616                 "NAME" => $_[3],
1617                 "RETURN_TYPE" => $_[2],
1618                 "PROPERTIES" => $_[1],
1619                 "DATA" => $_[5]
1620          }}
1621         ],
1622         [#Rule 17
1623                  'typedef', 5,
1624 sub
1625 #line 82 "build/pidl/idl.yp"
1626 {{
1627                      "TYPE" => "TYPEDEF", 
1628                      "NAME" => $_[3],
1629                      "DATA" => $_[2],
1630                      "ARRAY_LEN" => $_[4]
1631         }}
1632         ],
1633         [#Rule 18
1634                  'type', 1, undef
1635         ],
1636         [#Rule 19
1637                  'type', 1, undef
1638         ],
1639         [#Rule 20
1640                  'type', 1, undef
1641         ],
1642         [#Rule 21
1643                  'type', 1, undef
1644         ],
1645         [#Rule 22
1646                  'type', 1,
1647 sub
1648 #line 91 "build/pidl/idl.yp"
1649 { "void" }
1650         ],
1651         [#Rule 23
1652                  'enum', 4,
1653 sub
1654 #line 96 "build/pidl/idl.yp"
1655 {{
1656                      "TYPE" => "ENUM", 
1657                      "ELEMENTS" => $_[3]
1658         }}
1659         ],
1660         [#Rule 24
1661                  'enum_elements', 1,
1662 sub
1663 #line 103 "build/pidl/idl.yp"
1664 { [ $_[1] ] }
1665         ],
1666         [#Rule 25
1667                  'enum_elements', 3,
1668 sub
1669 #line 104 "build/pidl/idl.yp"
1670 { push(@{$_[1]}, $_[3]); $_[1] }
1671         ],
1672         [#Rule 26
1673                  'enum_element', 1, undef
1674         ],
1675         [#Rule 27
1676                  'enum_element', 3,
1677 sub
1678 #line 108 "build/pidl/idl.yp"
1679 { "$_[1]$_[2]$_[3]" }
1680         ],
1681         [#Rule 28
1682                  'struct', 5,
1683 sub
1684 #line 112 "build/pidl/idl.yp"
1685 {{
1686                      "TYPE" => "STRUCT", 
1687                      "PROPERTIES" => $_[1],
1688                      "ELEMENTS" => $_[4]
1689         }}
1690         ],
1691         [#Rule 29
1692                  'union', 5,
1693 sub
1694 #line 120 "build/pidl/idl.yp"
1695 {{
1696                 "TYPE" => "UNION",
1697                 "PROPERTIES" => $_[1],
1698                 "DATA" => $_[4]
1699          }}
1700         ],
1701         [#Rule 30
1702                  'union_elements', 1,
1703 sub
1704 #line 128 "build/pidl/idl.yp"
1705 { [ $_[1] ] }
1706         ],
1707         [#Rule 31
1708                  'union_elements', 2,
1709 sub
1710 #line 129 "build/pidl/idl.yp"
1711 { push(@{$_[1]}, $_[2]); $_[1] }
1712         ],
1713         [#Rule 32
1714                  'union_element', 8,
1715 sub
1716 #line 134 "build/pidl/idl.yp"
1717 {{
1718                 "TYPE" => "UNION_ELEMENT",
1719                 "CASE" => $_[4],
1720                 "DATA" => $_[7]
1721          }}
1722         ],
1723         [#Rule 33
1724                  'union_element', 7,
1725 sub
1726 #line 140 "build/pidl/idl.yp"
1727 {{
1728                 "TYPE" => "EMPTY",
1729                 "CASE" => $_[4],
1730          }}
1731         ],
1732         [#Rule 34
1733                  'union_element', 5,
1734 sub
1735 #line 145 "build/pidl/idl.yp"
1736 {{
1737                 "TYPE" => "UNION_ELEMENT",
1738                 "CASE" => "default",
1739                 "DATA" => $_[4]
1740          }}
1741         ],
1742         [#Rule 35
1743                  'union_element', 4,
1744 sub
1745 #line 151 "build/pidl/idl.yp"
1746 {{
1747                 "TYPE" => "EMPTY",
1748                 "CASE" => "default",
1749          }}
1750         ],
1751         [#Rule 36
1752                  'base_element', 5,
1753 sub
1754 #line 158 "build/pidl/idl.yp"
1755 {{
1756                            "NAME" => $_[4],
1757                            "TYPE" => $_[2],
1758                            "PROPERTIES" => $_[1],
1759                            "POINTERS" => $_[3],
1760                            "ARRAY_LEN" => $_[5]
1761               }}
1762         ],
1763         [#Rule 37
1764                  'pointers', 0,
1765 sub
1766 #line 170 "build/pidl/idl.yp"
1767 { 0 }
1768         ],
1769         [#Rule 38
1770                  'pointers', 2,
1771 sub
1772 #line 171 "build/pidl/idl.yp"
1773 { $_[1]+1 }
1774         ],
1775         [#Rule 39
1776                  'element_list1', 0, undef
1777         ],
1778         [#Rule 40
1779                  'element_list1', 3,
1780 sub
1781 #line 178 "build/pidl/idl.yp"
1782 { push(@{$_[1]}, $_[2]); $_[1] }
1783         ],
1784         [#Rule 41
1785                  'element_list2', 0, undef
1786         ],
1787         [#Rule 42
1788                  'element_list2', 1, undef
1789         ],
1790         [#Rule 43
1791                  'element_list2', 1,
1792 sub
1793 #line 184 "build/pidl/idl.yp"
1794 { [ $_[1] ] }
1795         ],
1796         [#Rule 44
1797                  'element_list2', 3,
1798 sub
1799 #line 185 "build/pidl/idl.yp"
1800 { push(@{$_[1]}, $_[3]); $_[1] }
1801         ],
1802         [#Rule 45
1803                  'array_len', 0, undef
1804         ],
1805         [#Rule 46
1806                  'array_len', 2,
1807 sub
1808 #line 190 "build/pidl/idl.yp"
1809 { "*" }
1810         ],
1811         [#Rule 47
1812                  'array_len', 3,
1813 sub
1814 #line 191 "build/pidl/idl.yp"
1815 { "$_[2]" }
1816         ],
1817         [#Rule 48
1818                  'property_list', 0, undef
1819         ],
1820         [#Rule 49
1821                  'property_list', 4,
1822 sub
1823 #line 197 "build/pidl/idl.yp"
1824 { util::FlattenHash([$_[1],$_[3]]); }
1825         ],
1826         [#Rule 50
1827                  'properties', 1,
1828 sub
1829 #line 200 "build/pidl/idl.yp"
1830 { $_[1] }
1831         ],
1832         [#Rule 51
1833                  'properties', 3,
1834 sub
1835 #line 201 "build/pidl/idl.yp"
1836 { util::FlattenHash([$_[1], $_[3]]); }
1837         ],
1838         [#Rule 52
1839                  'property', 1,
1840 sub
1841 #line 204 "build/pidl/idl.yp"
1842 {{ "$_[1]" => "1"     }}
1843         ],
1844         [#Rule 53
1845                  'property', 4,
1846 sub
1847 #line 205 "build/pidl/idl.yp"
1848 {{ "$_[1]" => "$_[3]" }}
1849         ],
1850         [#Rule 54
1851                  'listtext', 1, undef
1852         ],
1853         [#Rule 55
1854                  'listtext', 3,
1855 sub
1856 #line 210 "build/pidl/idl.yp"
1857 { "$_[1] $_[3]" }
1858         ],
1859         [#Rule 56
1860                  'commalisttext', 1, undef
1861         ],
1862         [#Rule 57
1863                  'commalisttext', 3,
1864 sub
1865 #line 215 "build/pidl/idl.yp"
1866 { "$_[1],$_[3]" }
1867         ],
1868         [#Rule 58
1869                  'anytext', 0,
1870 sub
1871 #line 219 "build/pidl/idl.yp"
1872 { "" }
1873         ],
1874         [#Rule 59
1875                  'anytext', 1, undef
1876         ],
1877         [#Rule 60
1878                  'anytext', 1, undef
1879         ],
1880         [#Rule 61
1881                  'anytext', 1, undef
1882         ],
1883         [#Rule 62
1884                  'anytext', 3,
1885 sub
1886 #line 221 "build/pidl/idl.yp"
1887 { "$_[1]$_[2]$_[3]" }
1888         ],
1889         [#Rule 63
1890                  'anytext', 3,
1891 sub
1892 #line 222 "build/pidl/idl.yp"
1893 { "$_[1]$_[2]$_[3]" }
1894         ],
1895         [#Rule 64
1896                  'anytext', 3,
1897 sub
1898 #line 223 "build/pidl/idl.yp"
1899 { "$_[1]$_[2]$_[3]" }
1900         ],
1901         [#Rule 65
1902                  'anytext', 3,
1903 sub
1904 #line 224 "build/pidl/idl.yp"
1905 { "$_[1]$_[2]$_[3]" }
1906         ],
1907         [#Rule 66
1908                  'anytext', 3,
1909 sub
1910 #line 225 "build/pidl/idl.yp"
1911 { "$_[1]$_[2]$_[3]" }
1912         ],
1913         [#Rule 67
1914                  'anytext', 3,
1915 sub
1916 #line 226 "build/pidl/idl.yp"
1917 { "$_[1]$_[2]$_[3]" }
1918         ],
1919         [#Rule 68
1920                  'anytext', 3,
1921 sub
1922 #line 227 "build/pidl/idl.yp"
1923 { "$_[1]$_[2]$_[3]" }
1924         ],
1925         [#Rule 69
1926                  'anytext', 3,
1927 sub
1928 #line 228 "build/pidl/idl.yp"
1929 { "$_[1]$_[2]$_[3]" }
1930         ],
1931         [#Rule 70
1932                  'anytext', 5,
1933 sub
1934 #line 229 "build/pidl/idl.yp"
1935 { "$_[1]$_[2]$_[3]$_[4]$_[5]" }
1936         ],
1937         [#Rule 71
1938                  'identifier', 1, undef
1939         ],
1940         [#Rule 72
1941                  'constant', 1, undef
1942         ],
1943         [#Rule 73
1944                  'text', 1,
1945 sub
1946 #line 238 "build/pidl/idl.yp"
1947 { "\"$_[1]\"" }
1948         ],
1949         [#Rule 74
1950                  'optional_semicolon', 0, undef
1951         ],
1952         [#Rule 75
1953                  'optional_semicolon', 1, undef
1954         ]
1955 ],
1956                                   @_);
1957     bless($self,$class);
1958 }
1959
1960 #line 249 "build/pidl/idl.yp"
1961
1962
1963 use util;
1964
1965 sub _Error {
1966         if (exists $_[0]->YYData->{ERRMSG}) {
1967                 print $_[0]->YYData->{ERRMSG};
1968                 delete $_[0]->YYData->{ERRMSG};
1969                 return;
1970         };
1971         my $line = $_[0]->YYData->{LINE};
1972         my $last_token = $_[0]->YYData->{LAST_TOKEN};
1973         my $file = $_[0]->YYData->{INPUT_FILENAME};
1974         
1975         print "$file:$line: Syntax error near '$last_token'\n";
1976 }
1977
1978 sub _Lexer($)
1979 {
1980         my($parser)=shift;
1981
1982         $parser->YYData->{INPUT}
1983         or  return('',undef);
1984
1985 again:
1986         $parser->YYData->{INPUT} =~ s/^[ \t]*//;
1987
1988         for ($parser->YYData->{INPUT}) {
1989                 if (/^\#/) {
1990                         if (s/^\# (\d+) \"(.*?)\"( \d+|)//) {
1991                                 $parser->YYData->{LINE} = $1-1;
1992                                 $parser->YYData->{INPUT_FILENAME} = $2;
1993                                 goto again;
1994                         }
1995                         if (s/^\#line (\d+) \"(.*?)\"( \d+|)//) {
1996                                 $parser->YYData->{LINE} = $1-1;
1997                                 $parser->YYData->{INPUT_FILENAME} = $2;
1998                                 goto again;
1999                         }
2000                         if (s/^(\#.*)$//m) {
2001                                 goto again;
2002                         }
2003                 }
2004                 if (s/^(\n)//) {
2005                         $parser->YYData->{LINE}++;
2006                         goto again;
2007                 }
2008                 if (s/^\"(.*?)\"//) {
2009                         $parser->YYData->{LAST_TOKEN} = $1;
2010                         return('TEXT',$1); 
2011                 }
2012                 if (s/^(\d+)(\W|$)/$2/) {
2013                         $parser->YYData->{LAST_TOKEN} = $1;
2014                         return('CONSTANT',$1); 
2015                 }
2016                 if (s/^([\w_]+)//) {
2017                         $parser->YYData->{LAST_TOKEN} = $1;
2018                         if ($1 =~ 
2019                             /^(coclass|interface|const|typedef|union
2020                               |struct|enum|void|case|default)$/x) {
2021                                 return $1;
2022                         }
2023                         return('IDENTIFIER',$1);
2024                 }
2025                 if (s/^(.)//s) {
2026                         $parser->YYData->{LAST_TOKEN} = $1;
2027                         return($1,$1);
2028                 }
2029         }
2030 }
2031
2032 sub parse_idl($$)
2033 {
2034         my $self = shift;
2035         my $filename = shift;
2036
2037         my $saved_delim = $/;
2038         undef $/;
2039         my $cpp = $ENV{CPP};
2040         if (! defined $cpp) {
2041                 $cpp = "cpp"
2042         }
2043         my $data = `$cpp -xc $filename`;
2044         $/ = $saved_delim;
2045
2046     $self->YYData->{INPUT} = $data;
2047     $self->YYData->{LINE} = 0;
2048     $self->YYData->{LAST_TOKEN} = "NONE";
2049
2050         my $idl = $self->YYParse( yylex => \&_Lexer, yyerror => \&_Error );
2051
2052         foreach my $x (@{$idl}) {
2053                 # Add [in] ORPCTHIS *this, [out] ORPCTHAT *that
2054                 # for 'object' interfaces
2055                 if (defined($x->{PROPERTIES}->{object})) {
2056                         foreach my $e (@{$x->{DATA}}) {
2057                                 if($e->{TYPE} eq "FUNCTION") {
2058                                         $e->{PROPERTIES}->{object} = 1;
2059                                         unshift(@{$e->{DATA}}, 
2060                         { 'NAME' => 'ORPCthis',
2061                           'POINTERS' => 0,
2062                           'PROPERTIES' => { 'in' => '1' },
2063                           'TYPE' => 'ORPCTHIS'
2064                         });
2065                                         unshift(@{$e->{DATA}},
2066                         { 'NAME' => 'ORPCthat',
2067                           'POINTERS' => 0,
2068                           'PROPERTIES' => { 'out' => '1' },
2069                                                   'TYPE' => 'ORPCTHAT'
2070                         });
2071                                 }
2072                         }
2073                 }
2074                 
2075                 # Do the inheritance
2076                 if (defined($x->{BASE}) and $x->{BASE} ne "") {
2077                         my $parent = util::get_interface($idl, $x->{BASE});
2078
2079                         if(not defined($parent)) { 
2080                                 die("No such parent interface " . $x->{BASE});
2081                         }
2082                         
2083                         @{$x->{INHERITED_DATA}} = (@{$parent->{INHERITED_DATA}}, @{$x->{DATA}});
2084                 } else {
2085                         $x->{INHERITED_DATA} = $x->{DATA};
2086                 }
2087         }
2088
2089         return $idl;
2090 }
2091
2092 1;