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