r7161: - Add support for "aliases" for pidls scalar types and add a few aliases.
[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 => -60,
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 => -86
563         },
564         {#State 10
565                 ACTIONS => {
566                         "{" => 15
567                 }
568         },
569         {#State 11
570                 ACTIONS => {
571                         "(" => 16
572                 },
573                 DEFAULT => -64
574         },
575         {#State 12
576                 DEFAULT => -62
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                         'interface_names' => 21
597                 }
598         },
599         {#State 16
600                 ACTIONS => {
601                         'CONSTANT' => 28,
602                         'TEXT' => 22,
603                         'IDENTIFIER' => 9
604                 },
605                 DEFAULT => -70,
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 => -61
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                         "interface" => 33
643                 }
644         },
645         {#State 22
646                 DEFAULT => -88
647         },
648         {#State 23
649                 DEFAULT => -71
650         },
651         {#State 24
652                 DEFAULT => -73
653         },
654         {#State 25
655                 ACTIONS => {
656                         "-" => 34,
657                         "<" => 35,
658                         "+" => 37,
659                         "~" => 36,
660                         "&" => 39,
661                         "{" => 38,
662                         "/" => 40,
663                         "(" => 41,
664                         "|" => 42,
665                         "*" => 43,
666                         "." => 44,
667                         ">" => 45
668                 },
669                 DEFAULT => -66
670         },
671         {#State 26
672                 ACTIONS => {
673                         "," => 46,
674                         ")" => 47
675                 }
676         },
677         {#State 27
678                 DEFAULT => -72
679         },
680         {#State 28
681                 DEFAULT => -87
682         },
683         {#State 29
684                 DEFAULT => -63
685         },
686         {#State 30
687                 DEFAULT => -9
688         },
689         {#State 31
690                 ACTIONS => {
691                         "typedef" => 48,
692                         "declare" => 53,
693                         "const" => 56
694                 },
695                 DEFAULT => -60,
696                 GOTOS => {
697                         'const' => 55,
698                         'declare' => 54,
699                         'function' => 49,
700                         'typedef' => 57,
701                         'definitions' => 50,
702                         'definition' => 52,
703                         'property_list' => 51
704                 }
705         },
706         {#State 32
707                 ACTIONS => {
708                         ";" => 59
709                 },
710                 DEFAULT => -89,
711                 GOTOS => {
712                         'optional_semicolon' => 58
713                 }
714         },
715         {#State 33
716                 ACTIONS => {
717                         'IDENTIFIER' => 9
718                 },
719                 GOTOS => {
720                         'identifier' => 60
721                 }
722         },
723         {#State 34
724                 ACTIONS => {
725                         'CONSTANT' => 28,
726                         'TEXT' => 22,
727                         'IDENTIFIER' => 9
728                 },
729                 DEFAULT => -70,
730                 GOTOS => {
731                         'identifier' => 23,
732                         'text' => 24,
733                         'anytext' => 61,
734                         'constant' => 27
735                 }
736         },
737         {#State 35
738                 ACTIONS => {
739                         'CONSTANT' => 28,
740                         'TEXT' => 22,
741                         'IDENTIFIER' => 9
742                 },
743                 DEFAULT => -70,
744                 GOTOS => {
745                         'identifier' => 23,
746                         'text' => 24,
747                         'anytext' => 62,
748                         'constant' => 27
749                 }
750         },
751         {#State 36
752                 ACTIONS => {
753                         'CONSTANT' => 28,
754                         'TEXT' => 22,
755                         'IDENTIFIER' => 9
756                 },
757                 DEFAULT => -70,
758                 GOTOS => {
759                         'identifier' => 23,
760                         'text' => 24,
761                         'anytext' => 63,
762                         'constant' => 27
763                 }
764         },
765         {#State 37
766                 ACTIONS => {
767                         'CONSTANT' => 28,
768                         'TEXT' => 22,
769                         'IDENTIFIER' => 9
770                 },
771                 DEFAULT => -70,
772                 GOTOS => {
773                         'identifier' => 23,
774                         'text' => 24,
775                         'anytext' => 64,
776                         'constant' => 27
777                 }
778         },
779         {#State 38
780                 ACTIONS => {
781                         'CONSTANT' => 28,
782                         'TEXT' => 22,
783                         'IDENTIFIER' => 9
784                 },
785                 DEFAULT => -70,
786                 GOTOS => {
787                         'identifier' => 23,
788                         'text' => 24,
789                         'anytext' => 65,
790                         'constant' => 27,
791                         'commalisttext' => 66
792                 }
793         },
794         {#State 39
795                 ACTIONS => {
796                         'CONSTANT' => 28,
797                         'TEXT' => 22,
798                         'IDENTIFIER' => 9
799                 },
800                 DEFAULT => -70,
801                 GOTOS => {
802                         'identifier' => 23,
803                         'text' => 24,
804                         'anytext' => 67,
805                         'constant' => 27
806                 }
807         },
808         {#State 40
809                 ACTIONS => {
810                         'CONSTANT' => 28,
811                         'TEXT' => 22,
812                         'IDENTIFIER' => 9
813                 },
814                 DEFAULT => -70,
815                 GOTOS => {
816                         'identifier' => 23,
817                         'text' => 24,
818                         'anytext' => 68,
819                         'constant' => 27
820                 }
821         },
822         {#State 41
823                 ACTIONS => {
824                         'CONSTANT' => 28,
825                         'TEXT' => 22,
826                         'IDENTIFIER' => 9
827                 },
828                 DEFAULT => -70,
829                 GOTOS => {
830                         'identifier' => 23,
831                         'text' => 24,
832                         'anytext' => 65,
833                         'constant' => 27,
834                         'commalisttext' => 69
835                 }
836         },
837         {#State 42
838                 ACTIONS => {
839                         'CONSTANT' => 28,
840                         'TEXT' => 22,
841                         'IDENTIFIER' => 9
842                 },
843                 DEFAULT => -70,
844                 GOTOS => {
845                         'identifier' => 23,
846                         'text' => 24,
847                         'anytext' => 70,
848                         'constant' => 27
849                 }
850         },
851         {#State 43
852                 ACTIONS => {
853                         'CONSTANT' => 28,
854                         'TEXT' => 22,
855                         'IDENTIFIER' => 9
856                 },
857                 DEFAULT => -70,
858                 GOTOS => {
859                         'identifier' => 23,
860                         'text' => 24,
861                         'anytext' => 71,
862                         'constant' => 27
863                 }
864         },
865         {#State 44
866                 ACTIONS => {
867                         'CONSTANT' => 28,
868                         'TEXT' => 22,
869                         'IDENTIFIER' => 9
870                 },
871                 DEFAULT => -70,
872                 GOTOS => {
873                         'identifier' => 23,
874                         'text' => 24,
875                         'anytext' => 72,
876                         'constant' => 27
877                 }
878         },
879         {#State 45
880                 ACTIONS => {
881                         'CONSTANT' => 28,
882                         'TEXT' => 22,
883                         'IDENTIFIER' => 9
884                 },
885                 DEFAULT => -70,
886                 GOTOS => {
887                         'identifier' => 23,
888                         'text' => 24,
889                         'anytext' => 73,
890                         'constant' => 27
891                 }
892         },
893         {#State 46
894                 ACTIONS => {
895                         'CONSTANT' => 28,
896                         'TEXT' => 22,
897                         'IDENTIFIER' => 9
898                 },
899                 DEFAULT => -70,
900                 GOTOS => {
901                         'identifier' => 23,
902                         'text' => 24,
903                         'anytext' => 74,
904                         'constant' => 27
905                 }
906         },
907         {#State 47
908                 DEFAULT => -65
909         },
910         {#State 48
911                 DEFAULT => -60,
912                 GOTOS => {
913                         'property_list' => 75
914                 }
915         },
916         {#State 49
917                 DEFAULT => -12
918         },
919         {#State 50
920                 ACTIONS => {
921                         "}" => 76,
922                         "typedef" => 48,
923                         "declare" => 53,
924                         "const" => 56
925                 },
926                 DEFAULT => -60,
927                 GOTOS => {
928                         'const' => 55,
929                         'declare' => 54,
930                         'function' => 49,
931                         'typedef' => 57,
932                         'definition' => 77,
933                         'property_list' => 51
934                 }
935         },
936         {#State 51
937                 ACTIONS => {
938                         'IDENTIFIER' => 9,
939                         "union" => 78,
940                         "enum" => 79,
941                         "[" => 7,
942                         'void' => 81,
943                         "bitmap" => 80,
944                         "struct" => 88
945                 },
946                 GOTOS => {
947                         'identifier' => 83,
948                         'struct' => 84,
949                         'enum' => 85,
950                         'type' => 86,
951                         'union' => 87,
952                         'bitmap' => 82
953                 }
954         },
955         {#State 52
956                 DEFAULT => -10
957         },
958         {#State 53
959                 DEFAULT => -60,
960                 GOTOS => {
961                         'property_list' => 89
962                 }
963         },
964         {#State 54
965                 DEFAULT => -15
966         },
967         {#State 55
968                 DEFAULT => -13
969         },
970         {#State 56
971                 ACTIONS => {
972                         'IDENTIFIER' => 9
973                 },
974                 GOTOS => {
975                         'identifier' => 90
976                 }
977         },
978         {#State 57
979                 DEFAULT => -14
980         },
981         {#State 58
982                 DEFAULT => -4
983         },
984         {#State 59
985                 DEFAULT => -90
986         },
987         {#State 60
988                 ACTIONS => {
989                         ";" => 91
990                 }
991         },
992         {#State 61
993                 ACTIONS => {
994                         "<" => 35,
995                         "~" => 36,
996                         "{" => 38
997                 },
998                 DEFAULT => -74
999         },
1000         {#State 62
1001                 ACTIONS => {
1002                         "-" => 34,
1003                         "<" => 35,
1004                         "+" => 37,
1005                         "~" => 36,
1006                         "*" => 43,
1007                         "{" => 38,
1008                         "&" => 39,
1009                         "/" => 40,
1010                         "|" => 42,
1011                         "(" => 41,
1012                         "." => 44,
1013                         ">" => 45
1014                 },
1015                 DEFAULT => -78
1016         },
1017         {#State 63
1018                 ACTIONS => {
1019                         "-" => 34,
1020                         "<" => 35,
1021                         "+" => 37,
1022                         "~" => 36,
1023                         "*" => 43,
1024                         "{" => 38,
1025                         "&" => 39,
1026                         "/" => 40,
1027                         "|" => 42,
1028                         "(" => 41,
1029                         "." => 44,
1030                         ">" => 45
1031                 },
1032                 DEFAULT => -83
1033         },
1034         {#State 64
1035                 ACTIONS => {
1036                         "<" => 35,
1037                         "~" => 36,
1038                         "{" => 38
1039                 },
1040                 DEFAULT => -82
1041         },
1042         {#State 65
1043                 ACTIONS => {
1044                         "-" => 34,
1045                         "<" => 35,
1046                         "+" => 37,
1047                         "~" => 36,
1048                         "*" => 43,
1049                         "{" => 38,
1050                         "&" => 39,
1051                         "/" => 40,
1052                         "|" => 42,
1053                         "(" => 41,
1054                         "." => 44,
1055                         ">" => 45
1056                 },
1057                 DEFAULT => -68
1058         },
1059         {#State 66
1060                 ACTIONS => {
1061                         "}" => 92,
1062                         "," => 93
1063                 }
1064         },
1065         {#State 67
1066                 ACTIONS => {
1067                         "<" => 35,
1068                         "~" => 36,
1069                         "{" => 38
1070                 },
1071                 DEFAULT => -80
1072         },
1073         {#State 68
1074                 ACTIONS => {
1075                         "<" => 35,
1076                         "~" => 36,
1077                         "{" => 38
1078                 },
1079                 DEFAULT => -81
1080         },
1081         {#State 69
1082                 ACTIONS => {
1083                         "," => 93,
1084                         ")" => 94
1085                 }
1086         },
1087         {#State 70
1088                 ACTIONS => {
1089                         "<" => 35,
1090                         "~" => 36,
1091                         "{" => 38
1092                 },
1093                 DEFAULT => -79
1094         },
1095         {#State 71
1096                 ACTIONS => {
1097                         "<" => 35,
1098                         "~" => 36,
1099                         "{" => 38
1100                 },
1101                 DEFAULT => -76
1102         },
1103         {#State 72
1104                 ACTIONS => {
1105                         "<" => 35,
1106                         "~" => 36,
1107                         "{" => 38
1108                 },
1109                 DEFAULT => -75
1110         },
1111         {#State 73
1112                 ACTIONS => {
1113                         "<" => 35,
1114                         "~" => 36,
1115                         "{" => 38
1116                 },
1117                 DEFAULT => -77
1118         },
1119         {#State 74
1120                 ACTIONS => {
1121                         "-" => 34,
1122                         "<" => 35,
1123                         "+" => 37,
1124                         "~" => 36,
1125                         "&" => 39,
1126                         "{" => 38,
1127                         "/" => 40,
1128                         "(" => 41,
1129                         "|" => 42,
1130                         "*" => 43,
1131                         "." => 44,
1132                         ">" => 45
1133                 },
1134                 DEFAULT => -67
1135         },
1136         {#State 75
1137                 ACTIONS => {
1138                         'IDENTIFIER' => 9,
1139                         "union" => 78,
1140                         "enum" => 79,
1141                         "[" => 7,
1142                         'void' => 81,
1143                         "bitmap" => 80,
1144                         "struct" => 88
1145                 },
1146                 GOTOS => {
1147                         'identifier' => 83,
1148                         'struct' => 84,
1149                         'enum' => 85,
1150                         'type' => 95,
1151                         'union' => 87,
1152                         'bitmap' => 82
1153                 }
1154         },
1155         {#State 76
1156                 ACTIONS => {
1157                         ";" => 59
1158                 },
1159                 DEFAULT => -89,
1160                 GOTOS => {
1161                         'optional_semicolon' => 96
1162                 }
1163         },
1164         {#State 77
1165                 DEFAULT => -11
1166         },
1167         {#State 78
1168                 ACTIONS => {
1169                         "{" => 97
1170                 }
1171         },
1172         {#State 79
1173                 ACTIONS => {
1174                         "{" => 98
1175                 }
1176         },
1177         {#State 80
1178                 ACTIONS => {
1179                         "{" => 99
1180                 }
1181         },
1182         {#State 81
1183                 DEFAULT => -30
1184         },
1185         {#State 82
1186                 DEFAULT => -28
1187         },
1188         {#State 83
1189                 DEFAULT => -29
1190         },
1191         {#State 84
1192                 DEFAULT => -25
1193         },
1194         {#State 85
1195                 DEFAULT => -27
1196         },
1197         {#State 86
1198                 ACTIONS => {
1199                         'IDENTIFIER' => 9
1200                 },
1201                 GOTOS => {
1202                         'identifier' => 100
1203                 }
1204         },
1205         {#State 87
1206                 DEFAULT => -26
1207         },
1208         {#State 88
1209                 ACTIONS => {
1210                         "{" => 101
1211                 }
1212         },
1213         {#State 89
1214                 ACTIONS => {
1215                         "enum" => 102,
1216                         "[" => 7,
1217                         "bitmap" => 103
1218                 },
1219                 GOTOS => {
1220                         'decl_enum' => 104,
1221                         'decl_bitmap' => 105,
1222                         'decl_type' => 106
1223                 }
1224         },
1225         {#State 90
1226                 ACTIONS => {
1227                         'IDENTIFIER' => 9
1228                 },
1229                 GOTOS => {
1230                         'identifier' => 107
1231                 }
1232         },
1233         {#State 91
1234                 DEFAULT => -6
1235         },
1236         {#State 92
1237                 ACTIONS => {
1238                         'CONSTANT' => 28,
1239                         'TEXT' => 22,
1240                         'IDENTIFIER' => 9
1241                 },
1242                 DEFAULT => -70,
1243                 GOTOS => {
1244                         'identifier' => 23,
1245                         'text' => 24,
1246                         'anytext' => 108,
1247                         'constant' => 27
1248                 }
1249         },
1250         {#State 93
1251                 ACTIONS => {
1252                         'CONSTANT' => 28,
1253                         'TEXT' => 22,
1254                         'IDENTIFIER' => 9
1255                 },
1256                 DEFAULT => -70,
1257                 GOTOS => {
1258                         'identifier' => 23,
1259                         'text' => 24,
1260                         'anytext' => 109,
1261                         'constant' => 27
1262                 }
1263         },
1264         {#State 94
1265                 ACTIONS => {
1266                         'CONSTANT' => 28,
1267                         'TEXT' => 22,
1268                         'IDENTIFIER' => 9
1269                 },
1270                 DEFAULT => -70,
1271                 GOTOS => {
1272                         'identifier' => 23,
1273                         'text' => 24,
1274                         'anytext' => 110,
1275                         'constant' => 27
1276                 }
1277         },
1278         {#State 95
1279                 ACTIONS => {
1280                         'IDENTIFIER' => 9
1281                 },
1282                 GOTOS => {
1283                         'identifier' => 111
1284                 }
1285         },
1286         {#State 96
1287                 DEFAULT => -7
1288         },
1289         {#State 97
1290                 DEFAULT => -45,
1291                 GOTOS => {
1292                         'union_elements' => 112
1293                 }
1294         },
1295         {#State 98
1296                 ACTIONS => {
1297                         'IDENTIFIER' => 9
1298                 },
1299                 GOTOS => {
1300                         'identifier' => 113,
1301                         'enum_element' => 114,
1302                         'enum_elements' => 115
1303                 }
1304         },
1305         {#State 99
1306                 ACTIONS => {
1307                         'IDENTIFIER' => 9
1308                 },
1309                 GOTOS => {
1310                         'identifier' => 118,
1311                         'bitmap_elements' => 117,
1312                         'bitmap_element' => 116
1313                 }
1314         },
1315         {#State 100
1316                 ACTIONS => {
1317                         "(" => 119
1318                 }
1319         },
1320         {#State 101
1321                 DEFAULT => -51,
1322                 GOTOS => {
1323                         'element_list1' => 120
1324                 }
1325         },
1326         {#State 102
1327                 DEFAULT => -22
1328         },
1329         {#State 103
1330                 DEFAULT => -23
1331         },
1332         {#State 104
1333                 DEFAULT => -20
1334         },
1335         {#State 105
1336                 DEFAULT => -21
1337         },
1338         {#State 106
1339                 ACTIONS => {
1340                         'IDENTIFIER' => 9
1341                 },
1342                 GOTOS => {
1343                         'identifier' => 121
1344                 }
1345         },
1346         {#State 107
1347                 ACTIONS => {
1348                         "[" => 124,
1349                         "=" => 123
1350                 },
1351                 GOTOS => {
1352                         'array_len' => 122
1353                 }
1354         },
1355         {#State 108
1356                 ACTIONS => {
1357                         "-" => 34,
1358                         "<" => 35,
1359                         "+" => 37,
1360                         "~" => 36,
1361                         "*" => 43,
1362                         "{" => 38,
1363                         "&" => 39,
1364                         "/" => 40,
1365                         "|" => 42,
1366                         "(" => 41,
1367                         "." => 44,
1368                         ">" => 45
1369                 },
1370                 DEFAULT => -85
1371         },
1372         {#State 109
1373                 ACTIONS => {
1374                         "-" => 34,
1375                         "<" => 35,
1376                         "+" => 37,
1377                         "~" => 36,
1378                         "*" => 43,
1379                         "{" => 38,
1380                         "&" => 39,
1381                         "/" => 40,
1382                         "|" => 42,
1383                         "(" => 41,
1384                         "." => 44,
1385                         ">" => 45
1386                 },
1387                 DEFAULT => -69
1388         },
1389         {#State 110
1390                 ACTIONS => {
1391                         "<" => 35,
1392                         "~" => 36,
1393                         "{" => 38
1394                 },
1395                 DEFAULT => -84
1396         },
1397         {#State 111
1398                 ACTIONS => {
1399                         "[" => 124
1400                 },
1401                 DEFAULT => -57,
1402                 GOTOS => {
1403                         'array_len' => 125
1404                 }
1405         },
1406         {#State 112
1407                 ACTIONS => {
1408                         "}" => 126
1409                 },
1410                 DEFAULT => -60,
1411                 GOTOS => {
1412                         'optional_base_element' => 128,
1413                         'property_list' => 127
1414                 }
1415         },
1416         {#State 113
1417                 ACTIONS => {
1418                         "=" => 129
1419                 },
1420                 DEFAULT => -34
1421         },
1422         {#State 114
1423                 DEFAULT => -32
1424         },
1425         {#State 115
1426                 ACTIONS => {
1427                         "}" => 130,
1428                         "," => 131
1429                 }
1430         },
1431         {#State 116
1432                 DEFAULT => -37
1433         },
1434         {#State 117
1435                 ACTIONS => {
1436                         "}" => 132,
1437                         "," => 133
1438                 }
1439         },
1440         {#State 118
1441                 ACTIONS => {
1442                         "=" => 134
1443                 }
1444         },
1445         {#State 119
1446                 ACTIONS => {
1447                         "," => -53,
1448                         "void" => 137,
1449                         ")" => -53
1450                 },
1451                 DEFAULT => -60,
1452                 GOTOS => {
1453                         'base_element' => 135,
1454                         'element_list2' => 138,
1455                         'property_list' => 136
1456                 }
1457         },
1458         {#State 120
1459                 ACTIONS => {
1460                         "}" => 139
1461                 },
1462                 DEFAULT => -60,
1463                 GOTOS => {
1464                         'base_element' => 140,
1465                         'property_list' => 136
1466                 }
1467         },
1468         {#State 121
1469                 ACTIONS => {
1470                         ";" => 141
1471                 }
1472         },
1473         {#State 122
1474                 ACTIONS => {
1475                         "=" => 142
1476                 }
1477         },
1478         {#State 123
1479                 ACTIONS => {
1480                         'CONSTANT' => 28,
1481                         'TEXT' => 22,
1482                         'IDENTIFIER' => 9
1483                 },
1484                 DEFAULT => -70,
1485                 GOTOS => {
1486                         'identifier' => 23,
1487                         'text' => 24,
1488                         'anytext' => 143,
1489                         'constant' => 27
1490                 }
1491         },
1492         {#State 124
1493                 ACTIONS => {
1494                         'CONSTANT' => 28,
1495                         'TEXT' => 22,
1496                         "]" => 145,
1497                         'IDENTIFIER' => 9
1498                 },
1499                 DEFAULT => -70,
1500                 GOTOS => {
1501                         'identifier' => 23,
1502                         'text' => 24,
1503                         'anytext' => 144,
1504                         'constant' => 27
1505                 }
1506         },
1507         {#State 125
1508                 ACTIONS => {
1509                         ";" => 146
1510                 }
1511         },
1512         {#State 126
1513                 DEFAULT => -47
1514         },
1515         {#State 127
1516                 ACTIONS => {
1517                         "[" => 7
1518                 },
1519                 DEFAULT => -60,
1520                 GOTOS => {
1521                         'base_or_empty' => 147,
1522                         'base_element' => 148,
1523                         'empty_element' => 149,
1524                         'property_list' => 150
1525                 }
1526         },
1527         {#State 128
1528                 DEFAULT => -46
1529         },
1530         {#State 129
1531                 ACTIONS => {
1532                         'CONSTANT' => 28,
1533                         'TEXT' => 22,
1534                         'IDENTIFIER' => 9
1535                 },
1536                 DEFAULT => -70,
1537                 GOTOS => {
1538                         'identifier' => 23,
1539                         'text' => 24,
1540                         'anytext' => 151,
1541                         'constant' => 27
1542                 }
1543         },
1544         {#State 130
1545                 DEFAULT => -31
1546         },
1547         {#State 131
1548                 ACTIONS => {
1549                         'IDENTIFIER' => 9
1550                 },
1551                 GOTOS => {
1552                         'identifier' => 113,
1553                         'enum_element' => 152
1554                 }
1555         },
1556         {#State 132
1557                 DEFAULT => -36
1558         },
1559         {#State 133
1560                 ACTIONS => {
1561                         'IDENTIFIER' => 9
1562                 },
1563                 GOTOS => {
1564                         'identifier' => 118,
1565                         'bitmap_element' => 153
1566                 }
1567         },
1568         {#State 134
1569                 ACTIONS => {
1570                         'CONSTANT' => 28,
1571                         'TEXT' => 22,
1572                         'IDENTIFIER' => 9
1573                 },
1574                 DEFAULT => -70,
1575                 GOTOS => {
1576                         'identifier' => 23,
1577                         'text' => 24,
1578                         'anytext' => 154,
1579                         'constant' => 27
1580                 }
1581         },
1582         {#State 135
1583                 DEFAULT => -55
1584         },
1585         {#State 136
1586                 ACTIONS => {
1587                         'IDENTIFIER' => 9,
1588                         "union" => 78,
1589                         "enum" => 79,
1590                         "[" => 7,
1591                         'void' => 81,
1592                         "bitmap" => 80,
1593                         "struct" => 88
1594                 },
1595                 GOTOS => {
1596                         'identifier' => 83,
1597                         'struct' => 84,
1598                         'enum' => 85,
1599                         'type' => 155,
1600                         'union' => 87,
1601                         'bitmap' => 82
1602                 }
1603         },
1604         {#State 137
1605                 DEFAULT => -54
1606         },
1607         {#State 138
1608                 ACTIONS => {
1609                         "," => 156,
1610                         ")" => 157
1611                 }
1612         },
1613         {#State 139
1614                 DEFAULT => -40
1615         },
1616         {#State 140
1617                 ACTIONS => {
1618                         ";" => 158
1619                 }
1620         },
1621         {#State 141
1622                 DEFAULT => -19
1623         },
1624         {#State 142
1625                 ACTIONS => {
1626                         'CONSTANT' => 28,
1627                         'TEXT' => 22,
1628                         'IDENTIFIER' => 9
1629                 },
1630                 DEFAULT => -70,
1631                 GOTOS => {
1632                         'identifier' => 23,
1633                         'text' => 24,
1634                         'anytext' => 159,
1635                         'constant' => 27
1636                 }
1637         },
1638         {#State 143
1639                 ACTIONS => {
1640                         "-" => 34,
1641                         "<" => 35,
1642                         ";" => 160,
1643                         "+" => 37,
1644                         "~" => 36,
1645                         "&" => 39,
1646                         "{" => 38,
1647                         "/" => 40,
1648                         "(" => 41,
1649                         "|" => 42,
1650                         "*" => 43,
1651                         "." => 44,
1652                         ">" => 45
1653                 }
1654         },
1655         {#State 144
1656                 ACTIONS => {
1657                         "-" => 34,
1658                         "<" => 35,
1659                         "+" => 37,
1660                         "~" => 36,
1661                         "&" => 39,
1662                         "{" => 38,
1663                         "/" => 40,
1664                         "(" => 41,
1665                         "|" => 42,
1666                         "*" => 43,
1667                         "]" => 161,
1668                         "." => 44,
1669                         ">" => 45
1670                 }
1671         },
1672         {#State 145
1673                 ACTIONS => {
1674                         "[" => 124
1675                 },
1676                 DEFAULT => -57,
1677                 GOTOS => {
1678                         'array_len' => 162
1679                 }
1680         },
1681         {#State 146
1682                 DEFAULT => -24
1683         },
1684         {#State 147
1685                 DEFAULT => -44
1686         },
1687         {#State 148
1688                 ACTIONS => {
1689                         ";" => 163
1690                 }
1691         },
1692         {#State 149
1693                 DEFAULT => -43
1694         },
1695         {#State 150
1696                 ACTIONS => {
1697                         'IDENTIFIER' => 9,
1698                         "union" => 78,
1699                         ";" => 164,
1700                         "enum" => 79,
1701                         "[" => 7,
1702                         'void' => 81,
1703                         "bitmap" => 80,
1704                         "struct" => 88
1705                 },
1706                 GOTOS => {
1707                         'identifier' => 83,
1708                         'struct' => 84,
1709                         'enum' => 85,
1710                         'type' => 155,
1711                         'union' => 87,
1712                         'bitmap' => 82
1713                 }
1714         },
1715         {#State 151
1716                 ACTIONS => {
1717                         "-" => 34,
1718                         "<" => 35,
1719                         "+" => 37,
1720                         "~" => 36,
1721                         "&" => 39,
1722                         "{" => 38,
1723                         "/" => 40,
1724                         "(" => 41,
1725                         "|" => 42,
1726                         "*" => 43,
1727                         "." => 44,
1728                         ">" => 45
1729                 },
1730                 DEFAULT => -35
1731         },
1732         {#State 152
1733                 DEFAULT => -33
1734         },
1735         {#State 153
1736                 DEFAULT => -38
1737         },
1738         {#State 154
1739                 ACTIONS => {
1740                         "-" => 34,
1741                         "<" => 35,
1742                         "+" => 37,
1743                         "~" => 36,
1744                         "&" => 39,
1745                         "{" => 38,
1746                         "/" => 40,
1747                         "(" => 41,
1748                         "|" => 42,
1749                         "*" => 43,
1750                         "." => 44,
1751                         ">" => 45
1752                 },
1753                 DEFAULT => -39
1754         },
1755         {#State 155
1756                 DEFAULT => -49,
1757                 GOTOS => {
1758                         'pointers' => 165
1759                 }
1760         },
1761         {#State 156
1762                 DEFAULT => -60,
1763                 GOTOS => {
1764                         'base_element' => 166,
1765                         'property_list' => 136
1766                 }
1767         },
1768         {#State 157
1769                 ACTIONS => {
1770                         ";" => 167
1771                 }
1772         },
1773         {#State 158
1774                 DEFAULT => -52
1775         },
1776         {#State 159
1777                 ACTIONS => {
1778                         "-" => 34,
1779                         "<" => 35,
1780                         ";" => 168,
1781                         "+" => 37,
1782                         "~" => 36,
1783                         "&" => 39,
1784                         "{" => 38,
1785                         "/" => 40,
1786                         "(" => 41,
1787                         "|" => 42,
1788                         "*" => 43,
1789                         "." => 44,
1790                         ">" => 45
1791                 }
1792         },
1793         {#State 160
1794                 DEFAULT => -16
1795         },
1796         {#State 161
1797                 ACTIONS => {
1798                         "[" => 124
1799                 },
1800                 DEFAULT => -57,
1801                 GOTOS => {
1802                         'array_len' => 169
1803                 }
1804         },
1805         {#State 162
1806                 DEFAULT => -58
1807         },
1808         {#State 163
1809                 DEFAULT => -42
1810         },
1811         {#State 164
1812                 DEFAULT => -41
1813         },
1814         {#State 165
1815                 ACTIONS => {
1816                         'IDENTIFIER' => 9,
1817                         "*" => 171
1818                 },
1819                 GOTOS => {
1820                         'identifier' => 170
1821                 }
1822         },
1823         {#State 166
1824                 DEFAULT => -56
1825         },
1826         {#State 167
1827                 DEFAULT => -18
1828         },
1829         {#State 168
1830                 DEFAULT => -17
1831         },
1832         {#State 169
1833                 DEFAULT => -59
1834         },
1835         {#State 170
1836                 ACTIONS => {
1837                         "[" => 124
1838                 },
1839                 DEFAULT => -57,
1840                 GOTOS => {
1841                         'array_len' => 172
1842                 }
1843         },
1844         {#State 171
1845                 DEFAULT => -50
1846         },
1847         {#State 172
1848                 DEFAULT => -48
1849         }
1850 ],
1851                                   yyrules  =>
1852 [
1853         [#Rule 0
1854                  '$start', 2, undef
1855         ],
1856         [#Rule 1
1857                  'idl', 0, undef
1858         ],
1859         [#Rule 2
1860                  'idl', 2,
1861 sub
1862 #line 19 "build/pidl/idl.yp"
1863 { push(@{$_[1]}, $_[2]); $_[1] }
1864         ],
1865         [#Rule 3
1866                  'idl', 2,
1867 sub
1868 #line 20 "build/pidl/idl.yp"
1869 { push(@{$_[1]}, $_[2]); $_[1] }
1870         ],
1871         [#Rule 4
1872                  'coclass', 7,
1873 sub
1874 #line 24 "build/pidl/idl.yp"
1875 {$_[3] => {
1876                "TYPE" => "COCLASS", 
1877                "PROPERTIES" => $_[1],
1878                "NAME" => $_[3],
1879                "DATA" => $_[5],
1880                    "FILE" => $_[0]->YYData->{INPUT_FILENAME},
1881                    "LINE" => $_[0]->YYData->{LINE},
1882           }}
1883         ],
1884         [#Rule 5
1885                  'interface_names', 0, undef
1886         ],
1887         [#Rule 6
1888                  'interface_names', 4,
1889 sub
1890 #line 36 "build/pidl/idl.yp"
1891 { push(@{$_[1]}, $_[2]); $_[1] }
1892         ],
1893         [#Rule 7
1894                  'interface', 8,
1895 sub
1896 #line 40 "build/pidl/idl.yp"
1897 {$_[3] => {
1898                "TYPE" => "INTERFACE", 
1899                "PROPERTIES" => $_[1],
1900                "NAME" => $_[3],
1901                "BASE" => $_[4],
1902                "DATA" => $_[6],
1903                    "FILE" => $_[0]->YYData->{INPUT_FILENAME},
1904                    "LINE" => $_[0]->YYData->{LINE},
1905           }}
1906         ],
1907         [#Rule 8
1908                  'base_interface', 0, undef
1909         ],
1910         [#Rule 9
1911                  'base_interface', 2,
1912 sub
1913 #line 53 "build/pidl/idl.yp"
1914 { $_[2] }
1915         ],
1916         [#Rule 10
1917                  'definitions', 1,
1918 sub
1919 #line 57 "build/pidl/idl.yp"
1920 { [ $_[1] ] }
1921         ],
1922         [#Rule 11
1923                  'definitions', 2,
1924 sub
1925 #line 58 "build/pidl/idl.yp"
1926 { push(@{$_[1]}, $_[2]); $_[1] }
1927         ],
1928         [#Rule 12
1929                  'definition', 1, undef
1930         ],
1931         [#Rule 13
1932                  'definition', 1, undef
1933         ],
1934         [#Rule 14
1935                  'definition', 1, undef
1936         ],
1937         [#Rule 15
1938                  'definition', 1, undef
1939         ],
1940         [#Rule 16
1941                  'const', 6,
1942 sub
1943 #line 66 "build/pidl/idl.yp"
1944 {{
1945                      "TYPE"  => "CONST", 
1946                      "DTYPE"  => $_[2],
1947                      "NAME"  => $_[3],
1948                      "VALUE" => $_[5],
1949                      "FILE" => $_[0]->YYData->{INPUT_FILENAME},
1950                      "LINE" => $_[0]->YYData->{LINE},
1951         }}
1952         ],
1953         [#Rule 17
1954                  'const', 7,
1955 sub
1956 #line 75 "build/pidl/idl.yp"
1957 {{
1958                      "TYPE"  => "CONST", 
1959                      "DTYPE"  => $_[2],
1960                      "NAME"  => $_[3],
1961                      "ARRAY_LEN" => $_[4],
1962                      "VALUE" => $_[6],
1963                      "FILE" => $_[0]->YYData->{INPUT_FILENAME},
1964                      "LINE" => $_[0]->YYData->{LINE},
1965         }}
1966         ],
1967         [#Rule 18
1968                  'function', 7,
1969 sub
1970 #line 88 "build/pidl/idl.yp"
1971 {{
1972                 "TYPE" => "FUNCTION",
1973                 "NAME" => $_[3],
1974                 "RETURN_TYPE" => $_[2],
1975                 "PROPERTIES" => $_[1],
1976                 "ELEMENTS" => $_[5],
1977                 "FILE" => $_[0]->YYData->{INPUT_FILENAME},
1978                 "LINE" => $_[0]->YYData->{LINE},
1979           }}
1980         ],
1981         [#Rule 19
1982                  'declare', 5,
1983 sub
1984 #line 100 "build/pidl/idl.yp"
1985 {{
1986                      "TYPE" => "DECLARE", 
1987                      "PROPERTIES" => $_[2],
1988                      "NAME" => $_[4],
1989                      "DATA" => $_[3],
1990                      "FILE" => $_[0]->YYData->{INPUT_FILENAME},
1991                      "LINE" => $_[0]->YYData->{LINE},
1992         }}
1993         ],
1994         [#Rule 20
1995                  'decl_type', 1, undef
1996         ],
1997         [#Rule 21
1998                  'decl_type', 1, undef
1999         ],
2000         [#Rule 22
2001                  'decl_enum', 1,
2002 sub
2003 #line 114 "build/pidl/idl.yp"
2004 {{
2005                      "TYPE" => "ENUM"
2006         }}
2007         ],
2008         [#Rule 23
2009                  'decl_bitmap', 1,
2010 sub
2011 #line 120 "build/pidl/idl.yp"
2012 {{
2013                      "TYPE" => "BITMAP"
2014         }}
2015         ],
2016         [#Rule 24
2017                  'typedef', 6,
2018 sub
2019 #line 126 "build/pidl/idl.yp"
2020 {{
2021                      "TYPE" => "TYPEDEF", 
2022                      "PROPERTIES" => $_[2],
2023                      "NAME" => $_[4],
2024                      "DATA" => $_[3],
2025                      "ARRAY_LEN" => $_[5],
2026                      "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2027                      "LINE" => $_[0]->YYData->{LINE},
2028         }}
2029         ],
2030         [#Rule 25
2031                  'type', 1, undef
2032         ],
2033         [#Rule 26
2034                  'type', 1, undef
2035         ],
2036         [#Rule 27
2037                  'type', 1, undef
2038         ],
2039         [#Rule 28
2040                  'type', 1, undef
2041         ],
2042         [#Rule 29
2043                  'type', 1, undef
2044         ],
2045         [#Rule 30
2046                  'type', 1,
2047 sub
2048 #line 138 "build/pidl/idl.yp"
2049 { "void" }
2050         ],
2051         [#Rule 31
2052                  'enum', 4,
2053 sub
2054 #line 143 "build/pidl/idl.yp"
2055 {{
2056              "TYPE" => "ENUM", 
2057                      "ELEMENTS" => $_[3]
2058         }}
2059         ],
2060         [#Rule 32
2061                  'enum_elements', 1,
2062 sub
2063 #line 150 "build/pidl/idl.yp"
2064 { [ $_[1] ] }
2065         ],
2066         [#Rule 33
2067                  'enum_elements', 3,
2068 sub
2069 #line 151 "build/pidl/idl.yp"
2070 { push(@{$_[1]}, $_[3]); $_[1] }
2071         ],
2072         [#Rule 34
2073                  'enum_element', 1, undef
2074         ],
2075         [#Rule 35
2076                  'enum_element', 3,
2077 sub
2078 #line 155 "build/pidl/idl.yp"
2079 { "$_[1]$_[2]$_[3]" }
2080         ],
2081         [#Rule 36
2082                  'bitmap', 4,
2083 sub
2084 #line 159 "build/pidl/idl.yp"
2085 {{
2086                      "TYPE" => "BITMAP", 
2087                      "ELEMENTS" => $_[3]
2088         }}
2089         ],
2090         [#Rule 37
2091                  'bitmap_elements', 1,
2092 sub
2093 #line 166 "build/pidl/idl.yp"
2094 { [ $_[1] ] }
2095         ],
2096         [#Rule 38
2097                  'bitmap_elements', 3,
2098 sub
2099 #line 167 "build/pidl/idl.yp"
2100 { push(@{$_[1]}, $_[3]); $_[1] }
2101         ],
2102         [#Rule 39
2103                  'bitmap_element', 3,
2104 sub
2105 #line 170 "build/pidl/idl.yp"
2106 { "$_[1] ( $_[3] )" }
2107         ],
2108         [#Rule 40
2109                  'struct', 4,
2110 sub
2111 #line 174 "build/pidl/idl.yp"
2112 {{
2113                      "TYPE" => "STRUCT", 
2114                      "ELEMENTS" => $_[3]
2115         }}
2116         ],
2117         [#Rule 41
2118                  'empty_element', 2,
2119 sub
2120 #line 181 "build/pidl/idl.yp"
2121 {{
2122                  "NAME" => "",
2123                  "TYPE" => "EMPTY",
2124                  "PROPERTIES" => $_[1],
2125                  "POINTERS" => 0,
2126                  "ARRAY_LEN" => [],
2127                  "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2128                  "LINE" => $_[0]->YYData->{LINE},
2129          }}
2130         ],
2131         [#Rule 42
2132                  'base_or_empty', 2, undef
2133         ],
2134         [#Rule 43
2135                  'base_or_empty', 1, undef
2136         ],
2137         [#Rule 44
2138                  'optional_base_element', 2,
2139 sub
2140 #line 195 "build/pidl/idl.yp"
2141 { $_[2]->{PROPERTIES} = util::FlattenHash([$_[1],$_[2]->{PROPERTIES}]); $_[2] }
2142         ],
2143         [#Rule 45
2144                  'union_elements', 0, undef
2145         ],
2146         [#Rule 46
2147                  'union_elements', 2,
2148 sub
2149 #line 200 "build/pidl/idl.yp"
2150 { push(@{$_[1]}, $_[2]); $_[1] }
2151         ],
2152         [#Rule 47
2153                  'union', 4,
2154 sub
2155 #line 204 "build/pidl/idl.yp"
2156 {{
2157                      "TYPE" => "UNION", 
2158                      "ELEMENTS" => $_[3]
2159         }}
2160         ],
2161         [#Rule 48
2162                  'base_element', 5,
2163 sub
2164 #line 211 "build/pidl/idl.yp"
2165 {{
2166                            "NAME" => $_[4],
2167                            "TYPE" => $_[2],
2168                            "PROPERTIES" => $_[1],
2169                            "POINTERS" => $_[3],
2170                            "ARRAY_LEN" => $_[5],
2171                        "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2172                        "LINE" => $_[0]->YYData->{LINE},
2173               }}
2174         ],
2175         [#Rule 49
2176                  'pointers', 0,
2177 sub
2178 #line 225 "build/pidl/idl.yp"
2179 { 0 }
2180         ],
2181         [#Rule 50
2182                  'pointers', 2,
2183 sub
2184 #line 226 "build/pidl/idl.yp"
2185 { $_[1]+1 }
2186         ],
2187         [#Rule 51
2188                  'element_list1', 0, undef
2189         ],
2190         [#Rule 52
2191                  'element_list1', 3,
2192 sub
2193 #line 231 "build/pidl/idl.yp"
2194 { push(@{$_[1]}, $_[2]); $_[1] }
2195         ],
2196         [#Rule 53
2197                  'element_list2', 0, undef
2198         ],
2199         [#Rule 54
2200                  'element_list2', 1, undef
2201         ],
2202         [#Rule 55
2203                  'element_list2', 1,
2204 sub
2205 #line 237 "build/pidl/idl.yp"
2206 { [ $_[1] ] }
2207         ],
2208         [#Rule 56
2209                  'element_list2', 3,
2210 sub
2211 #line 238 "build/pidl/idl.yp"
2212 { push(@{$_[1]}, $_[3]); $_[1] }
2213         ],
2214         [#Rule 57
2215                  'array_len', 0, undef
2216         ],
2217         [#Rule 58
2218                  'array_len', 3,
2219 sub
2220 #line 243 "build/pidl/idl.yp"
2221 { push(@{$_[3]}, "*"); $_[3] }
2222         ],
2223         [#Rule 59
2224                  'array_len', 4,
2225 sub
2226 #line 244 "build/pidl/idl.yp"
2227 { push(@{$_[4]}, "$_[2]"); $_[4] }
2228         ],
2229         [#Rule 60
2230                  'property_list', 0, undef
2231         ],
2232         [#Rule 61
2233                  'property_list', 4,
2234 sub
2235 #line 250 "build/pidl/idl.yp"
2236 { util::FlattenHash([$_[1],$_[3]]); }
2237         ],
2238         [#Rule 62
2239                  'properties', 1,
2240 sub
2241 #line 253 "build/pidl/idl.yp"
2242 { $_[1] }
2243         ],
2244         [#Rule 63
2245                  'properties', 3,
2246 sub
2247 #line 254 "build/pidl/idl.yp"
2248 { util::FlattenHash([$_[1], $_[3]]); }
2249         ],
2250         [#Rule 64
2251                  'property', 1,
2252 sub
2253 #line 257 "build/pidl/idl.yp"
2254 {{ "$_[1]" => "1"     }}
2255         ],
2256         [#Rule 65
2257                  'property', 4,
2258 sub
2259 #line 258 "build/pidl/idl.yp"
2260 {{ "$_[1]" => "$_[3]" }}
2261         ],
2262         [#Rule 66
2263                  'listtext', 1, undef
2264         ],
2265         [#Rule 67
2266                  'listtext', 3,
2267 sub
2268 #line 263 "build/pidl/idl.yp"
2269 { "$_[1] $_[3]" }
2270         ],
2271         [#Rule 68
2272                  'commalisttext', 1, undef
2273         ],
2274         [#Rule 69
2275                  'commalisttext', 3,
2276 sub
2277 #line 268 "build/pidl/idl.yp"
2278 { "$_[1],$_[3]" }
2279         ],
2280         [#Rule 70
2281                  'anytext', 0,
2282 sub
2283 #line 272 "build/pidl/idl.yp"
2284 { "" }
2285         ],
2286         [#Rule 71
2287                  'anytext', 1, undef
2288         ],
2289         [#Rule 72
2290                  'anytext', 1, undef
2291         ],
2292         [#Rule 73
2293                  'anytext', 1, undef
2294         ],
2295         [#Rule 74
2296                  'anytext', 3,
2297 sub
2298 #line 274 "build/pidl/idl.yp"
2299 { "$_[1]$_[2]$_[3]" }
2300         ],
2301         [#Rule 75
2302                  'anytext', 3,
2303 sub
2304 #line 275 "build/pidl/idl.yp"
2305 { "$_[1]$_[2]$_[3]" }
2306         ],
2307         [#Rule 76
2308                  'anytext', 3,
2309 sub
2310 #line 276 "build/pidl/idl.yp"
2311 { "$_[1]$_[2]$_[3]" }
2312         ],
2313         [#Rule 77
2314                  'anytext', 3,
2315 sub
2316 #line 277 "build/pidl/idl.yp"
2317 { "$_[1]$_[2]$_[3]" }
2318         ],
2319         [#Rule 78
2320                  'anytext', 3,
2321 sub
2322 #line 278 "build/pidl/idl.yp"
2323 { "$_[1]$_[2]$_[3]" }
2324         ],
2325         [#Rule 79
2326                  'anytext', 3,
2327 sub
2328 #line 279 "build/pidl/idl.yp"
2329 { "$_[1]$_[2]$_[3]" }
2330         ],
2331         [#Rule 80
2332                  'anytext', 3,
2333 sub
2334 #line 280 "build/pidl/idl.yp"
2335 { "$_[1]$_[2]$_[3]" }
2336         ],
2337         [#Rule 81
2338                  'anytext', 3,
2339 sub
2340 #line 281 "build/pidl/idl.yp"
2341 { "$_[1]$_[2]$_[3]" }
2342         ],
2343         [#Rule 82
2344                  'anytext', 3,
2345 sub
2346 #line 282 "build/pidl/idl.yp"
2347 { "$_[1]$_[2]$_[3]" }
2348         ],
2349         [#Rule 83
2350                  'anytext', 3,
2351 sub
2352 #line 283 "build/pidl/idl.yp"
2353 { "$_[1]$_[2]$_[3]" }
2354         ],
2355         [#Rule 84
2356                  'anytext', 5,
2357 sub
2358 #line 284 "build/pidl/idl.yp"
2359 { "$_[1]$_[2]$_[3]$_[4]$_[5]" }
2360         ],
2361         [#Rule 85
2362                  'anytext', 5,
2363 sub
2364 #line 285 "build/pidl/idl.yp"
2365 { "$_[1]$_[2]$_[3]$_[4]$_[5]" }
2366         ],
2367         [#Rule 86
2368                  'identifier', 1, undef
2369         ],
2370         [#Rule 87
2371                  'constant', 1, undef
2372         ],
2373         [#Rule 88
2374                  'text', 1,
2375 sub
2376 #line 294 "build/pidl/idl.yp"
2377 { "\"$_[1]\"" }
2378         ],
2379         [#Rule 89
2380                  'optional_semicolon', 0, undef
2381         ],
2382         [#Rule 90
2383                  'optional_semicolon', 1, undef
2384         ]
2385 ],
2386                                   @_);
2387     bless($self,$class);
2388 }
2389
2390 #line 305 "build/pidl/idl.yp"
2391
2392
2393 use pidl::util;
2394
2395 sub _Error {
2396     if (exists $_[0]->YYData->{ERRMSG}) {
2397                 print $_[0]->YYData->{ERRMSG};
2398                 delete $_[0]->YYData->{ERRMSG};
2399                 return;
2400         };
2401         my $line = $_[0]->YYData->{LINE};
2402         my $last_token = $_[0]->YYData->{LAST_TOKEN};
2403         my $file = $_[0]->YYData->{INPUT_FILENAME};
2404         
2405         print "$file:$line: Syntax error near '$last_token'\n";
2406 }
2407
2408 sub _Lexer($)
2409 {
2410         my($parser)=shift;
2411
2412         $parser->YYData->{INPUT}
2413         or  return('',undef);
2414
2415 again:
2416         $parser->YYData->{INPUT} =~ s/^[ \t]*//;
2417
2418         for ($parser->YYData->{INPUT}) {
2419                 if (/^\#/) {
2420                         if (s/^\# (\d+) \"(.*?)\"( \d+|)//) {
2421                                 $parser->YYData->{LINE} = $1-1;
2422                                 $parser->YYData->{INPUT_FILENAME} = $2;
2423                                 goto again;
2424                         }
2425                         if (s/^\#line (\d+) \"(.*?)\"( \d+|)//) {
2426                                 $parser->YYData->{LINE} = $1-1;
2427                                 $parser->YYData->{INPUT_FILENAME} = $2;
2428                                 goto again;
2429                         }
2430                         if (s/^(\#.*)$//m) {
2431                                 goto again;
2432                         }
2433                 }
2434                 if (s/^(\n)//) {
2435                         $parser->YYData->{LINE}++;
2436                         goto again;
2437                 }
2438                 if (s/^\"(.*?)\"//) {
2439                         $parser->YYData->{LAST_TOKEN} = $1;
2440                         return('TEXT',$1); 
2441                 }
2442                 if (s/^(\d+)(\W|$)/$2/) {
2443                         $parser->YYData->{LAST_TOKEN} = $1;
2444                         return('CONSTANT',$1); 
2445                 }
2446                 if (s/^([\w_]+)//) {
2447                         $parser->YYData->{LAST_TOKEN} = $1;
2448                         if ($1 =~ 
2449                             /^(coclass|interface|const|typedef|declare|union
2450                               |struct|enum|bitmap|void)$/x) {
2451                                 return $1;
2452                         }
2453                         return('IDENTIFIER',$1);
2454                 }
2455                 if (s/^(.)//s) {
2456                         $parser->YYData->{LAST_TOKEN} = $1;
2457                         return($1,$1);
2458                 }
2459         }
2460 }
2461
2462 sub parse_idl($$)
2463 {
2464         my $self = shift;
2465         my $filename = shift;
2466
2467         my $saved_delim = $/;
2468         undef $/;
2469         my $cpp = $ENV{CPP};
2470         if (! defined $cpp) {
2471                 $cpp = "cpp"
2472         }
2473         my $data = `$cpp -D__PIDL__ -xc $filename`;
2474         $/ = $saved_delim;
2475
2476     $self->YYData->{INPUT} = $data;
2477     $self->YYData->{LINE} = 0;
2478     $self->YYData->{LAST_TOKEN} = "NONE";
2479
2480         my $idl = $self->YYParse( yylex => \&_Lexer, yyerror => \&_Error );
2481
2482         return util::CleanData($idl);
2483 }
2484
2485 1;