r19580: Add --includedir option.
[samba.git] / source4 / pidl / lib / Parse / 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 Parse::Pidl::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 => -84,
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 => -113
563         },
564         {#State 10
565                 ACTIONS => {
566                         "{" => 15
567                 }
568         },
569         {#State 11
570                 ACTIONS => {
571                         "(" => 16
572                 },
573                 DEFAULT => -88
574         },
575         {#State 12
576                 DEFAULT => -86
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 => -94,
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 => -85
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 => -117
647         },
648         {#State 23
649                 DEFAULT => -95
650         },
651         {#State 24
652                 DEFAULT => -97
653         },
654         {#State 25
655                 ACTIONS => {
656                         "-" => 35,
657                         ":" => 34,
658                         "<" => 37,
659                         "+" => 39,
660                         "~" => 38,
661                         "*" => 46,
662                         "?" => 36,
663                         "{" => 40,
664                         "&" => 41,
665                         "/" => 42,
666                         "=" => 43,
667                         "(" => 44,
668                         "|" => 45,
669                         "." => 47,
670                         ">" => 48
671                 },
672                 DEFAULT => -90
673         },
674         {#State 26
675                 ACTIONS => {
676                         "," => 49,
677                         ")" => 50
678                 }
679         },
680         {#State 27
681                 DEFAULT => -96
682         },
683         {#State 28
684                 DEFAULT => -116
685         },
686         {#State 29
687                 DEFAULT => -87
688         },
689         {#State 30
690                 DEFAULT => -9
691         },
692         {#State 31
693                 ACTIONS => {
694                         "typedef" => 51,
695                         "union" => 52,
696                         "enum" => 65,
697                         "bitmap" => 66,
698                         "declare" => 58,
699                         "const" => 60,
700                         "struct" => 63
701                 },
702                 DEFAULT => -84,
703                 GOTOS => {
704                         'typedecl' => 64,
705                         'function' => 53,
706                         'bitmap' => 67,
707                         'definitions' => 54,
708                         'definition' => 57,
709                         'property_list' => 56,
710                         'usertype' => 55,
711                         'declare' => 69,
712                         'const' => 68,
713                         'struct' => 59,
714                         'enum' => 61,
715                         'typedef' => 62,
716                         'union' => 70
717                 }
718         },
719         {#State 32
720                 ACTIONS => {
721                         ";" => 71
722                 },
723                 DEFAULT => -118,
724                 GOTOS => {
725                         'optional_semicolon' => 72
726                 }
727         },
728         {#State 33
729                 ACTIONS => {
730                         'IDENTIFIER' => 9
731                 },
732                 GOTOS => {
733                         'identifier' => 73
734                 }
735         },
736         {#State 34
737                 ACTIONS => {
738                         'CONSTANT' => 28,
739                         'TEXT' => 22,
740                         'IDENTIFIER' => 9
741                 },
742                 DEFAULT => -94,
743                 GOTOS => {
744                         'identifier' => 23,
745                         'anytext' => 74,
746                         'text' => 24,
747                         'constant' => 27
748                 }
749         },
750         {#State 35
751                 ACTIONS => {
752                         'CONSTANT' => 28,
753                         'TEXT' => 22,
754                         'IDENTIFIER' => 9
755                 },
756                 DEFAULT => -94,
757                 GOTOS => {
758                         'identifier' => 23,
759                         'anytext' => 75,
760                         'text' => 24,
761                         'constant' => 27
762                 }
763         },
764         {#State 36
765                 ACTIONS => {
766                         'CONSTANT' => 28,
767                         'TEXT' => 22,
768                         'IDENTIFIER' => 9
769                 },
770                 DEFAULT => -94,
771                 GOTOS => {
772                         'identifier' => 23,
773                         'anytext' => 76,
774                         'text' => 24,
775                         'constant' => 27
776                 }
777         },
778         {#State 37
779                 ACTIONS => {
780                         'CONSTANT' => 28,
781                         'TEXT' => 22,
782                         'IDENTIFIER' => 9
783                 },
784                 DEFAULT => -94,
785                 GOTOS => {
786                         'identifier' => 23,
787                         'anytext' => 77,
788                         'text' => 24,
789                         'constant' => 27
790                 }
791         },
792         {#State 38
793                 ACTIONS => {
794                         'CONSTANT' => 28,
795                         'TEXT' => 22,
796                         'IDENTIFIER' => 9
797                 },
798                 DEFAULT => -94,
799                 GOTOS => {
800                         'identifier' => 23,
801                         'anytext' => 78,
802                         'text' => 24,
803                         'constant' => 27
804                 }
805         },
806         {#State 39
807                 ACTIONS => {
808                         'CONSTANT' => 28,
809                         'TEXT' => 22,
810                         'IDENTIFIER' => 9
811                 },
812                 DEFAULT => -94,
813                 GOTOS => {
814                         'identifier' => 23,
815                         'anytext' => 79,
816                         'text' => 24,
817                         'constant' => 27
818                 }
819         },
820         {#State 40
821                 ACTIONS => {
822                         'CONSTANT' => 28,
823                         'TEXT' => 22,
824                         'IDENTIFIER' => 9
825                 },
826                 DEFAULT => -94,
827                 GOTOS => {
828                         'identifier' => 23,
829                         'anytext' => 80,
830                         'text' => 24,
831                         'constant' => 27,
832                         'commalisttext' => 81
833                 }
834         },
835         {#State 41
836                 ACTIONS => {
837                         'CONSTANT' => 28,
838                         'TEXT' => 22,
839                         'IDENTIFIER' => 9
840                 },
841                 DEFAULT => -94,
842                 GOTOS => {
843                         'identifier' => 23,
844                         'anytext' => 82,
845                         'text' => 24,
846                         'constant' => 27
847                 }
848         },
849         {#State 42
850                 ACTIONS => {
851                         'CONSTANT' => 28,
852                         'TEXT' => 22,
853                         'IDENTIFIER' => 9
854                 },
855                 DEFAULT => -94,
856                 GOTOS => {
857                         'identifier' => 23,
858                         'anytext' => 83,
859                         'text' => 24,
860                         'constant' => 27
861                 }
862         },
863         {#State 43
864                 ACTIONS => {
865                         'CONSTANT' => 28,
866                         'TEXT' => 22,
867                         'IDENTIFIER' => 9
868                 },
869                 DEFAULT => -94,
870                 GOTOS => {
871                         'identifier' => 23,
872                         'anytext' => 84,
873                         'text' => 24,
874                         'constant' => 27
875                 }
876         },
877         {#State 44
878                 ACTIONS => {
879                         'CONSTANT' => 28,
880                         'TEXT' => 22,
881                         'IDENTIFIER' => 9
882                 },
883                 DEFAULT => -94,
884                 GOTOS => {
885                         'identifier' => 23,
886                         'anytext' => 80,
887                         'text' => 24,
888                         'constant' => 27,
889                         'commalisttext' => 85
890                 }
891         },
892         {#State 45
893                 ACTIONS => {
894                         'CONSTANT' => 28,
895                         'TEXT' => 22,
896                         'IDENTIFIER' => 9
897                 },
898                 DEFAULT => -94,
899                 GOTOS => {
900                         'identifier' => 23,
901                         'anytext' => 86,
902                         'text' => 24,
903                         'constant' => 27
904                 }
905         },
906         {#State 46
907                 ACTIONS => {
908                         'CONSTANT' => 28,
909                         'TEXT' => 22,
910                         'IDENTIFIER' => 9
911                 },
912                 DEFAULT => -94,
913                 GOTOS => {
914                         'identifier' => 23,
915                         'anytext' => 87,
916                         'text' => 24,
917                         'constant' => 27
918                 }
919         },
920         {#State 47
921                 ACTIONS => {
922                         'CONSTANT' => 28,
923                         'TEXT' => 22,
924                         'IDENTIFIER' => 9
925                 },
926                 DEFAULT => -94,
927                 GOTOS => {
928                         'identifier' => 23,
929                         'anytext' => 88,
930                         'text' => 24,
931                         'constant' => 27
932                 }
933         },
934         {#State 48
935                 ACTIONS => {
936                         'CONSTANT' => 28,
937                         'TEXT' => 22,
938                         'IDENTIFIER' => 9
939                 },
940                 DEFAULT => -94,
941                 GOTOS => {
942                         'identifier' => 23,
943                         'anytext' => 89,
944                         'text' => 24,
945                         'constant' => 27
946                 }
947         },
948         {#State 49
949                 ACTIONS => {
950                         'CONSTANT' => 28,
951                         'TEXT' => 22,
952                         'IDENTIFIER' => 9
953                 },
954                 DEFAULT => -94,
955                 GOTOS => {
956                         'identifier' => 23,
957                         'anytext' => 90,
958                         'text' => 24,
959                         'constant' => 27
960                 }
961         },
962         {#State 50
963                 DEFAULT => -89
964         },
965         {#State 51
966                 DEFAULT => -84,
967                 GOTOS => {
968                         'property_list' => 91
969                 }
970         },
971         {#State 52
972                 ACTIONS => {
973                         'IDENTIFIER' => 92
974                 },
975                 DEFAULT => -115,
976                 GOTOS => {
977                         'optional_identifier' => 93
978                 }
979         },
980         {#State 53
981                 DEFAULT => -12
982         },
983         {#State 54
984                 ACTIONS => {
985                         "}" => 94,
986                         "typedef" => 51,
987                         "union" => 52,
988                         "enum" => 65,
989                         "bitmap" => 66,
990                         "declare" => 58,
991                         "const" => 60,
992                         "struct" => 63
993                 },
994                 DEFAULT => -84,
995                 GOTOS => {
996                         'typedecl' => 64,
997                         'function' => 53,
998                         'bitmap' => 67,
999                         'definition' => 95,
1000                         'property_list' => 56,
1001                         'usertype' => 55,
1002                         'const' => 68,
1003                         'struct' => 59,
1004                         'declare' => 69,
1005                         'enum' => 61,
1006                         'typedef' => 62,
1007                         'union' => 70
1008                 }
1009         },
1010         {#State 55
1011                 ACTIONS => {
1012                         ";" => 96
1013                 }
1014         },
1015         {#State 56
1016                 ACTIONS => {
1017                         'IDENTIFIER' => 9,
1018                         "signed" => 102,
1019                         "union" => 52,
1020                         "enum" => 65,
1021                         "bitmap" => 66,
1022                         'void' => 97,
1023                         "unsigned" => 103,
1024                         "[" => 7,
1025                         "struct" => 63
1026                 },
1027                 GOTOS => {
1028                         'existingtype' => 101,
1029                         'bitmap' => 67,
1030                         'usertype' => 98,
1031                         'identifier' => 99,
1032                         'struct' => 59,
1033                         'enum' => 61,
1034                         'type' => 104,
1035                         'union' => 70,
1036                         'sign' => 100
1037                 }
1038         },
1039         {#State 57
1040                 DEFAULT => -10
1041         },
1042         {#State 58
1043                 DEFAULT => -84,
1044                 GOTOS => {
1045                         'property_list' => 105
1046                 }
1047         },
1048         {#State 59
1049                 DEFAULT => -28
1050         },
1051         {#State 60
1052                 ACTIONS => {
1053                         'IDENTIFIER' => 9
1054                 },
1055                 GOTOS => {
1056                         'identifier' => 106
1057                 }
1058         },
1059         {#State 61
1060                 DEFAULT => -30
1061         },
1062         {#State 62
1063                 DEFAULT => -14
1064         },
1065         {#State 63
1066                 ACTIONS => {
1067                         'IDENTIFIER' => 92
1068                 },
1069                 DEFAULT => -115,
1070                 GOTOS => {
1071                         'optional_identifier' => 107
1072                 }
1073         },
1074         {#State 64
1075                 DEFAULT => -16
1076         },
1077         {#State 65
1078                 ACTIONS => {
1079                         'IDENTIFIER' => 92
1080                 },
1081                 DEFAULT => -115,
1082                 GOTOS => {
1083                         'optional_identifier' => 108
1084                 }
1085         },
1086         {#State 66
1087                 ACTIONS => {
1088                         'IDENTIFIER' => 92
1089                 },
1090                 DEFAULT => -115,
1091                 GOTOS => {
1092                         'optional_identifier' => 109
1093                 }
1094         },
1095         {#State 67
1096                 DEFAULT => -31
1097         },
1098         {#State 68
1099                 DEFAULT => -13
1100         },
1101         {#State 69
1102                 DEFAULT => -15
1103         },
1104         {#State 70
1105                 DEFAULT => -29
1106         },
1107         {#State 71
1108                 DEFAULT => -119
1109         },
1110         {#State 72
1111                 DEFAULT => -4
1112         },
1113         {#State 73
1114                 ACTIONS => {
1115                         ";" => 110
1116                 }
1117         },
1118         {#State 74
1119                 ACTIONS => {
1120                         "-" => 35,
1121                         ":" => 34,
1122                         "<" => 37,
1123                         "+" => 39,
1124                         "~" => 38,
1125                         "*" => 46,
1126                         "?" => 36,
1127                         "{" => 40,
1128                         "&" => 41,
1129                         "/" => 42,
1130                         "=" => 43,
1131                         "(" => 44,
1132                         "|" => 45,
1133                         "." => 47,
1134                         ">" => 48
1135                 },
1136                 DEFAULT => -107
1137         },
1138         {#State 75
1139                 ACTIONS => {
1140                         ":" => 34,
1141                         "<" => 37,
1142                         "~" => 38,
1143                         "?" => 36,
1144                         "{" => 40,
1145                         "=" => 43
1146                 },
1147                 DEFAULT => -98
1148         },
1149         {#State 76
1150                 ACTIONS => {
1151                         "-" => 35,
1152                         ":" => 34,
1153                         "<" => 37,
1154                         "+" => 39,
1155                         "~" => 38,
1156                         "*" => 46,
1157                         "?" => 36,
1158                         "{" => 40,
1159                         "&" => 41,
1160                         "/" => 42,
1161                         "=" => 43,
1162                         "(" => 44,
1163                         "|" => 45,
1164                         "." => 47,
1165                         ">" => 48
1166                 },
1167                 DEFAULT => -106
1168         },
1169         {#State 77
1170                 ACTIONS => {
1171                         "-" => 35,
1172                         ":" => 34,
1173                         "<" => 37,
1174                         "+" => 39,
1175                         "~" => 38,
1176                         "*" => 46,
1177                         "?" => 36,
1178                         "{" => 40,
1179                         "&" => 41,
1180                         "/" => 42,
1181                         "=" => 43,
1182                         "(" => 44,
1183                         "|" => 45,
1184                         "." => 47,
1185                         ">" => 48
1186                 },
1187                 DEFAULT => -102
1188         },
1189         {#State 78
1190                 ACTIONS => {
1191                         "-" => 35,
1192                         ":" => 34,
1193                         "<" => 37,
1194                         "+" => 39,
1195                         "~" => 38,
1196                         "*" => 46,
1197                         "?" => 36,
1198                         "{" => 40,
1199                         "&" => 41,
1200                         "/" => 42,
1201                         "=" => 43,
1202                         "(" => 44,
1203                         "|" => 45,
1204                         "." => 47,
1205                         ">" => 48
1206                 },
1207                 DEFAULT => -110
1208         },
1209         {#State 79
1210                 ACTIONS => {
1211                         ":" => 34,
1212                         "<" => 37,
1213                         "~" => 38,
1214                         "?" => 36,
1215                         "{" => 40,
1216                         "=" => 43
1217                 },
1218                 DEFAULT => -109
1219         },
1220         {#State 80
1221                 ACTIONS => {
1222                         "-" => 35,
1223                         ":" => 34,
1224                         "<" => 37,
1225                         "+" => 39,
1226                         "~" => 38,
1227                         "*" => 46,
1228                         "?" => 36,
1229                         "{" => 40,
1230                         "&" => 41,
1231                         "/" => 42,
1232                         "=" => 43,
1233                         "(" => 44,
1234                         "|" => 45,
1235                         "." => 47,
1236                         ">" => 48
1237                 },
1238                 DEFAULT => -92
1239         },
1240         {#State 81
1241                 ACTIONS => {
1242                         "}" => 111,
1243                         "," => 112
1244                 }
1245         },
1246         {#State 82
1247                 ACTIONS => {
1248                         ":" => 34,
1249                         "<" => 37,
1250                         "~" => 38,
1251                         "?" => 36,
1252                         "{" => 40,
1253                         "=" => 43
1254                 },
1255                 DEFAULT => -104
1256         },
1257         {#State 83
1258                 ACTIONS => {
1259                         ":" => 34,
1260                         "<" => 37,
1261                         "~" => 38,
1262                         "?" => 36,
1263                         "{" => 40,
1264                         "=" => 43
1265                 },
1266                 DEFAULT => -105
1267         },
1268         {#State 84
1269                 ACTIONS => {
1270                         "-" => 35,
1271                         ":" => 34,
1272                         "<" => 37,
1273                         "+" => 39,
1274                         "~" => 38,
1275                         "*" => 46,
1276                         "?" => 36,
1277                         "{" => 40,
1278                         "&" => 41,
1279                         "/" => 42,
1280                         "=" => 43,
1281                         "(" => 44,
1282                         "|" => 45,
1283                         "." => 47,
1284                         ">" => 48
1285                 },
1286                 DEFAULT => -108
1287         },
1288         {#State 85
1289                 ACTIONS => {
1290                         "," => 112,
1291                         ")" => 113
1292                 }
1293         },
1294         {#State 86
1295                 ACTIONS => {
1296                         ":" => 34,
1297                         "<" => 37,
1298                         "~" => 38,
1299                         "?" => 36,
1300                         "{" => 40,
1301                         "=" => 43
1302                 },
1303                 DEFAULT => -103
1304         },
1305         {#State 87
1306                 ACTIONS => {
1307                         ":" => 34,
1308                         "<" => 37,
1309                         "~" => 38,
1310                         "?" => 36,
1311                         "{" => 40,
1312                         "=" => 43
1313                 },
1314                 DEFAULT => -100
1315         },
1316         {#State 88
1317                 ACTIONS => {
1318                         ":" => 34,
1319                         "<" => 37,
1320                         "~" => 38,
1321                         "?" => 36,
1322                         "{" => 40,
1323                         "=" => 43
1324                 },
1325                 DEFAULT => -99
1326         },
1327         {#State 89
1328                 ACTIONS => {
1329                         ":" => 34,
1330                         "<" => 37,
1331                         "~" => 38,
1332                         "?" => 36,
1333                         "{" => 40,
1334                         "=" => 43
1335                 },
1336                 DEFAULT => -101
1337         },
1338         {#State 90
1339                 ACTIONS => {
1340                         "-" => 35,
1341                         ":" => 34,
1342                         "<" => 37,
1343                         "+" => 39,
1344                         "~" => 38,
1345                         "*" => 46,
1346                         "?" => 36,
1347                         "{" => 40,
1348                         "&" => 41,
1349                         "/" => 42,
1350                         "=" => 43,
1351                         "(" => 44,
1352                         "|" => 45,
1353                         "." => 47,
1354                         ">" => 48
1355                 },
1356                 DEFAULT => -91
1357         },
1358         {#State 91
1359                 ACTIONS => {
1360                         'IDENTIFIER' => 9,
1361                         "signed" => 102,
1362                         "union" => 52,
1363                         "enum" => 65,
1364                         "bitmap" => 66,
1365                         'void' => 97,
1366                         "unsigned" => 103,
1367                         "[" => 7,
1368                         "struct" => 63
1369                 },
1370                 GOTOS => {
1371                         'existingtype' => 101,
1372                         'bitmap' => 67,
1373                         'usertype' => 98,
1374                         'identifier' => 99,
1375                         'struct' => 59,
1376                         'enum' => 61,
1377                         'type' => 114,
1378                         'union' => 70,
1379                         'sign' => 100
1380                 }
1381         },
1382         {#State 92
1383                 DEFAULT => -114
1384         },
1385         {#State 93
1386                 ACTIONS => {
1387                         "{" => 116
1388                 },
1389                 DEFAULT => -69,
1390                 GOTOS => {
1391                         'union_body' => 117,
1392                         'opt_union_body' => 115
1393                 }
1394         },
1395         {#State 94
1396                 ACTIONS => {
1397                         ";" => 71
1398                 },
1399                 DEFAULT => -118,
1400                 GOTOS => {
1401                         'optional_semicolon' => 118
1402                 }
1403         },
1404         {#State 95
1405                 DEFAULT => -11
1406         },
1407         {#State 96
1408                 DEFAULT => -32
1409         },
1410         {#State 97
1411                 DEFAULT => -40
1412         },
1413         {#State 98
1414                 DEFAULT => -38
1415         },
1416         {#State 99
1417                 DEFAULT => -37
1418         },
1419         {#State 100
1420                 ACTIONS => {
1421                         'IDENTIFIER' => 9
1422                 },
1423                 GOTOS => {
1424                         'identifier' => 119
1425                 }
1426         },
1427         {#State 101
1428                 DEFAULT => -39
1429         },
1430         {#State 102
1431                 DEFAULT => -33
1432         },
1433         {#State 103
1434                 DEFAULT => -34
1435         },
1436         {#State 104
1437                 ACTIONS => {
1438                         'IDENTIFIER' => 9
1439                 },
1440                 GOTOS => {
1441                         'identifier' => 120
1442                 }
1443         },
1444         {#State 105
1445                 ACTIONS => {
1446                         "union" => 121,
1447                         "enum" => 126,
1448                         "bitmap" => 127,
1449                         "[" => 7
1450                 },
1451                 GOTOS => {
1452                         'decl_enum' => 122,
1453                         'decl_bitmap' => 123,
1454                         'decl_type' => 125,
1455                         'decl_union' => 124
1456                 }
1457         },
1458         {#State 106
1459                 DEFAULT => -73,
1460                 GOTOS => {
1461                         'pointers' => 128
1462                 }
1463         },
1464         {#State 107
1465                 ACTIONS => {
1466                         "{" => 130
1467                 },
1468                 DEFAULT => -59,
1469                 GOTOS => {
1470                         'struct_body' => 129,
1471                         'opt_struct_body' => 131
1472                 }
1473         },
1474         {#State 108
1475                 ACTIONS => {
1476                         "{" => 132
1477                 },
1478                 DEFAULT => -42,
1479                 GOTOS => {
1480                         'opt_enum_body' => 134,
1481                         'enum_body' => 133
1482                 }
1483         },
1484         {#State 109
1485                 ACTIONS => {
1486                         "{" => 136
1487                 },
1488                 DEFAULT => -50,
1489                 GOTOS => {
1490                         'bitmap_body' => 137,
1491                         'opt_bitmap_body' => 135
1492                 }
1493         },
1494         {#State 110
1495                 DEFAULT => -6
1496         },
1497         {#State 111
1498                 ACTIONS => {
1499                         'CONSTANT' => 28,
1500                         'TEXT' => 22,
1501                         'IDENTIFIER' => 9
1502                 },
1503                 DEFAULT => -94,
1504                 GOTOS => {
1505                         'identifier' => 23,
1506                         'anytext' => 138,
1507                         'text' => 24,
1508                         'constant' => 27
1509                 }
1510         },
1511         {#State 112
1512                 ACTIONS => {
1513                         'CONSTANT' => 28,
1514                         'TEXT' => 22,
1515                         'IDENTIFIER' => 9
1516                 },
1517                 DEFAULT => -94,
1518                 GOTOS => {
1519                         'identifier' => 23,
1520                         'anytext' => 139,
1521                         'text' => 24,
1522                         'constant' => 27
1523                 }
1524         },
1525         {#State 113
1526                 ACTIONS => {
1527                         'CONSTANT' => 28,
1528                         'TEXT' => 22,
1529                         'IDENTIFIER' => 9
1530                 },
1531                 DEFAULT => -94,
1532                 GOTOS => {
1533                         'identifier' => 23,
1534                         'anytext' => 140,
1535                         'text' => 24,
1536                         'constant' => 27
1537                 }
1538         },
1539         {#State 114
1540                 ACTIONS => {
1541                         'IDENTIFIER' => 9
1542                 },
1543                 GOTOS => {
1544                         'identifier' => 141
1545                 }
1546         },
1547         {#State 115
1548                 DEFAULT => -71
1549         },
1550         {#State 116
1551                 DEFAULT => -66,
1552                 GOTOS => {
1553                         'union_elements' => 142
1554                 }
1555         },
1556         {#State 117
1557                 DEFAULT => -70
1558         },
1559         {#State 118
1560                 DEFAULT => -7
1561         },
1562         {#State 119
1563                 DEFAULT => -36
1564         },
1565         {#State 120
1566                 ACTIONS => {
1567                         "(" => 143
1568                 }
1569         },
1570         {#State 121
1571                 DEFAULT => -26
1572         },
1573         {#State 122
1574                 DEFAULT => -21
1575         },
1576         {#State 123
1577                 DEFAULT => -22
1578         },
1579         {#State 124
1580                 DEFAULT => -23
1581         },
1582         {#State 125
1583                 ACTIONS => {
1584                         'IDENTIFIER' => 9
1585                 },
1586                 GOTOS => {
1587                         'identifier' => 144
1588                 }
1589         },
1590         {#State 126
1591                 DEFAULT => -24
1592         },
1593         {#State 127
1594                 DEFAULT => -25
1595         },
1596         {#State 128
1597                 ACTIONS => {
1598                         'IDENTIFIER' => 9,
1599                         "*" => 146
1600                 },
1601                 GOTOS => {
1602                         'identifier' => 145
1603                 }
1604         },
1605         {#State 129
1606                 DEFAULT => -60
1607         },
1608         {#State 130
1609                 DEFAULT => -75,
1610                 GOTOS => {
1611                         'element_list1' => 147
1612                 }
1613         },
1614         {#State 131
1615                 DEFAULT => -61
1616         },
1617         {#State 132
1618                 ACTIONS => {
1619                         'IDENTIFIER' => 9
1620                 },
1621                 GOTOS => {
1622                         'identifier' => 148,
1623                         'enum_element' => 149,
1624                         'enum_elements' => 150
1625                 }
1626         },
1627         {#State 133
1628                 DEFAULT => -43
1629         },
1630         {#State 134
1631                 DEFAULT => -44
1632         },
1633         {#State 135
1634                 DEFAULT => -52
1635         },
1636         {#State 136
1637                 ACTIONS => {
1638                         'IDENTIFIER' => 9
1639                 },
1640                 DEFAULT => -55,
1641                 GOTOS => {
1642                         'identifier' => 153,
1643                         'bitmap_element' => 152,
1644                         'bitmap_elements' => 151,
1645                         'opt_bitmap_elements' => 154
1646                 }
1647         },
1648         {#State 137
1649                 DEFAULT => -51
1650         },
1651         {#State 138
1652                 ACTIONS => {
1653                         "-" => 35,
1654                         ":" => 34,
1655                         "<" => 37,
1656                         "+" => 39,
1657                         "~" => 38,
1658                         "*" => 46,
1659                         "?" => 36,
1660                         "{" => 40,
1661                         "&" => 41,
1662                         "/" => 42,
1663                         "=" => 43,
1664                         "(" => 44,
1665                         "|" => 45,
1666                         "." => 47,
1667                         ">" => 48
1668                 },
1669                 DEFAULT => -112
1670         },
1671         {#State 139
1672                 ACTIONS => {
1673                         "-" => 35,
1674                         ":" => 34,
1675                         "<" => 37,
1676                         "+" => 39,
1677                         "~" => 38,
1678                         "*" => 46,
1679                         "?" => 36,
1680                         "{" => 40,
1681                         "&" => 41,
1682                         "/" => 42,
1683                         "=" => 43,
1684                         "(" => 44,
1685                         "|" => 45,
1686                         "." => 47,
1687                         ">" => 48
1688                 },
1689                 DEFAULT => -93
1690         },
1691         {#State 140
1692                 ACTIONS => {
1693                         ":" => 34,
1694                         "<" => 37,
1695                         "~" => 38,
1696                         "?" => 36,
1697                         "{" => 40,
1698                         "=" => 43
1699                 },
1700                 DEFAULT => -111
1701         },
1702         {#State 141
1703                 ACTIONS => {
1704                         "[" => 155
1705                 },
1706                 DEFAULT => -81,
1707                 GOTOS => {
1708                         'array_len' => 156
1709                 }
1710         },
1711         {#State 142
1712                 ACTIONS => {
1713                         "}" => 157
1714                 },
1715                 DEFAULT => -84,
1716                 GOTOS => {
1717                         'optional_base_element' => 159,
1718                         'property_list' => 158
1719                 }
1720         },
1721         {#State 143
1722                 ACTIONS => {
1723                         "," => -77,
1724                         "void" => 163,
1725                         ")" => -77
1726                 },
1727                 DEFAULT => -84,
1728                 GOTOS => {
1729                         'base_element' => 160,
1730                         'element_list2' => 162,
1731                         'property_list' => 161
1732                 }
1733         },
1734         {#State 144
1735                 ACTIONS => {
1736                         ";" => 164
1737                 }
1738         },
1739         {#State 145
1740                 ACTIONS => {
1741                         "[" => 155,
1742                         "=" => 166
1743                 },
1744                 GOTOS => {
1745                         'array_len' => 165
1746                 }
1747         },
1748         {#State 146
1749                 DEFAULT => -74
1750         },
1751         {#State 147
1752                 ACTIONS => {
1753                         "}" => 167
1754                 },
1755                 DEFAULT => -84,
1756                 GOTOS => {
1757                         'base_element' => 168,
1758                         'property_list' => 161
1759                 }
1760         },
1761         {#State 148
1762                 ACTIONS => {
1763                         "=" => 169
1764                 },
1765                 DEFAULT => -47
1766         },
1767         {#State 149
1768                 DEFAULT => -45
1769         },
1770         {#State 150
1771                 ACTIONS => {
1772                         "}" => 170,
1773                         "," => 171
1774                 }
1775         },
1776         {#State 151
1777                 ACTIONS => {
1778                         "," => 172
1779                 },
1780                 DEFAULT => -56
1781         },
1782         {#State 152
1783                 DEFAULT => -53
1784         },
1785         {#State 153
1786                 ACTIONS => {
1787                         "=" => 173
1788                 }
1789         },
1790         {#State 154
1791                 ACTIONS => {
1792                         "}" => 174
1793                 }
1794         },
1795         {#State 155
1796                 ACTIONS => {
1797                         'CONSTANT' => 28,
1798                         'TEXT' => 22,
1799                         "]" => 175,
1800                         'IDENTIFIER' => 9
1801                 },
1802                 DEFAULT => -94,
1803                 GOTOS => {
1804                         'identifier' => 23,
1805                         'anytext' => 176,
1806                         'text' => 24,
1807                         'constant' => 27
1808                 }
1809         },
1810         {#State 156
1811                 ACTIONS => {
1812                         ";" => 177
1813                 }
1814         },
1815         {#State 157
1816                 DEFAULT => -68
1817         },
1818         {#State 158
1819                 ACTIONS => {
1820                         "[" => 7
1821                 },
1822                 DEFAULT => -84,
1823                 GOTOS => {
1824                         'base_or_empty' => 178,
1825                         'base_element' => 179,
1826                         'empty_element' => 180,
1827                         'property_list' => 181
1828                 }
1829         },
1830         {#State 159
1831                 DEFAULT => -67
1832         },
1833         {#State 160
1834                 DEFAULT => -79
1835         },
1836         {#State 161
1837                 ACTIONS => {
1838                         'IDENTIFIER' => 9,
1839                         "signed" => 102,
1840                         "union" => 52,
1841                         "enum" => 65,
1842                         "bitmap" => 66,
1843                         'void' => 97,
1844                         "unsigned" => 103,
1845                         "[" => 7,
1846                         "struct" => 63
1847                 },
1848                 DEFAULT => -35,
1849                 GOTOS => {
1850                         'existingtype' => 101,
1851                         'bitmap' => 67,
1852                         'usertype' => 98,
1853                         'identifier' => 99,
1854                         'struct' => 59,
1855                         'enum' => 61,
1856                         'type' => 182,
1857                         'union' => 70,
1858                         'sign' => 100
1859                 }
1860         },
1861         {#State 162
1862                 ACTIONS => {
1863                         "," => 183,
1864                         ")" => 184
1865                 }
1866         },
1867         {#State 163
1868                 DEFAULT => -78
1869         },
1870         {#State 164
1871                 DEFAULT => -20
1872         },
1873         {#State 165
1874                 ACTIONS => {
1875                         "=" => 185
1876                 }
1877         },
1878         {#State 166
1879                 ACTIONS => {
1880                         'CONSTANT' => 28,
1881                         'TEXT' => 22,
1882                         'IDENTIFIER' => 9
1883                 },
1884                 DEFAULT => -94,
1885                 GOTOS => {
1886                         'identifier' => 23,
1887                         'anytext' => 186,
1888                         'text' => 24,
1889                         'constant' => 27
1890                 }
1891         },
1892         {#State 167
1893                 DEFAULT => -58
1894         },
1895         {#State 168
1896                 ACTIONS => {
1897                         ";" => 187
1898                 }
1899         },
1900         {#State 169
1901                 ACTIONS => {
1902                         'CONSTANT' => 28,
1903                         'TEXT' => 22,
1904                         'IDENTIFIER' => 9
1905                 },
1906                 DEFAULT => -94,
1907                 GOTOS => {
1908                         'identifier' => 23,
1909                         'anytext' => 188,
1910                         'text' => 24,
1911                         'constant' => 27
1912                 }
1913         },
1914         {#State 170
1915                 DEFAULT => -41
1916         },
1917         {#State 171
1918                 ACTIONS => {
1919                         'IDENTIFIER' => 9
1920                 },
1921                 GOTOS => {
1922                         'identifier' => 148,
1923                         'enum_element' => 189
1924                 }
1925         },
1926         {#State 172
1927                 ACTIONS => {
1928                         'IDENTIFIER' => 9
1929                 },
1930                 GOTOS => {
1931                         'identifier' => 153,
1932                         'bitmap_element' => 190
1933                 }
1934         },
1935         {#State 173
1936                 ACTIONS => {
1937                         'CONSTANT' => 28,
1938                         'TEXT' => 22,
1939                         'IDENTIFIER' => 9
1940                 },
1941                 DEFAULT => -94,
1942                 GOTOS => {
1943                         'identifier' => 23,
1944                         'anytext' => 191,
1945                         'text' => 24,
1946                         'constant' => 27
1947                 }
1948         },
1949         {#State 174
1950                 DEFAULT => -49
1951         },
1952         {#State 175
1953                 ACTIONS => {
1954                         "[" => 155
1955                 },
1956                 DEFAULT => -81,
1957                 GOTOS => {
1958                         'array_len' => 192
1959                 }
1960         },
1961         {#State 176
1962                 ACTIONS => {
1963                         "-" => 35,
1964                         ":" => 34,
1965                         "?" => 36,
1966                         "<" => 37,
1967                         "+" => 39,
1968                         "~" => 38,
1969                         "&" => 41,
1970                         "{" => 40,
1971                         "/" => 42,
1972                         "=" => 43,
1973                         "|" => 45,
1974                         "(" => 44,
1975                         "*" => 46,
1976                         "." => 47,
1977                         "]" => 193,
1978                         ">" => 48
1979                 }
1980         },
1981         {#State 177
1982                 DEFAULT => -27
1983         },
1984         {#State 178
1985                 DEFAULT => -65
1986         },
1987         {#State 179
1988                 ACTIONS => {
1989                         ";" => 194
1990                 }
1991         },
1992         {#State 180
1993                 DEFAULT => -64
1994         },
1995         {#State 181
1996                 ACTIONS => {
1997                         'IDENTIFIER' => 9,
1998                         "signed" => 102,
1999                         "union" => 52,
2000                         ";" => 195,
2001                         "enum" => 65,
2002                         "bitmap" => 66,
2003                         'void' => 97,
2004                         "unsigned" => 103,
2005                         "[" => 7,
2006                         "struct" => 63
2007                 },
2008                 DEFAULT => -35,
2009                 GOTOS => {
2010                         'existingtype' => 101,
2011                         'bitmap' => 67,
2012                         'usertype' => 98,
2013                         'identifier' => 99,
2014                         'struct' => 59,
2015                         'enum' => 61,
2016                         'type' => 182,
2017                         'union' => 70,
2018                         'sign' => 100
2019                 }
2020         },
2021         {#State 182
2022                 DEFAULT => -73,
2023                 GOTOS => {
2024                         'pointers' => 196
2025                 }
2026         },
2027         {#State 183
2028                 DEFAULT => -84,
2029                 GOTOS => {
2030                         'base_element' => 197,
2031                         'property_list' => 161
2032                 }
2033         },
2034         {#State 184
2035                 ACTIONS => {
2036                         ";" => 198
2037                 }
2038         },
2039         {#State 185
2040                 ACTIONS => {
2041                         'CONSTANT' => 28,
2042                         'TEXT' => 22,
2043                         'IDENTIFIER' => 9
2044                 },
2045                 DEFAULT => -94,
2046                 GOTOS => {
2047                         'identifier' => 23,
2048                         'anytext' => 199,
2049                         'text' => 24,
2050                         'constant' => 27
2051                 }
2052         },
2053         {#State 186
2054                 ACTIONS => {
2055                         "-" => 35,
2056                         ":" => 34,
2057                         "?" => 36,
2058                         "<" => 37,
2059                         ";" => 200,
2060                         "+" => 39,
2061                         "~" => 38,
2062                         "&" => 41,
2063                         "{" => 40,
2064                         "/" => 42,
2065                         "=" => 43,
2066                         "|" => 45,
2067                         "(" => 44,
2068                         "*" => 46,
2069                         "." => 47,
2070                         ">" => 48
2071                 }
2072         },
2073         {#State 187
2074                 DEFAULT => -76
2075         },
2076         {#State 188
2077                 ACTIONS => {
2078                         "-" => 35,
2079                         ":" => 34,
2080                         "<" => 37,
2081                         "+" => 39,
2082                         "~" => 38,
2083                         "*" => 46,
2084                         "?" => 36,
2085                         "{" => 40,
2086                         "&" => 41,
2087                         "/" => 42,
2088                         "=" => 43,
2089                         "(" => 44,
2090                         "|" => 45,
2091                         "." => 47,
2092                         ">" => 48
2093                 },
2094                 DEFAULT => -48
2095         },
2096         {#State 189
2097                 DEFAULT => -46
2098         },
2099         {#State 190
2100                 DEFAULT => -54
2101         },
2102         {#State 191
2103                 ACTIONS => {
2104                         "-" => 35,
2105                         ":" => 34,
2106                         "<" => 37,
2107                         "+" => 39,
2108                         "~" => 38,
2109                         "*" => 46,
2110                         "?" => 36,
2111                         "{" => 40,
2112                         "&" => 41,
2113                         "/" => 42,
2114                         "=" => 43,
2115                         "(" => 44,
2116                         "|" => 45,
2117                         "." => 47,
2118                         ">" => 48
2119                 },
2120                 DEFAULT => -57
2121         },
2122         {#State 192
2123                 DEFAULT => -82
2124         },
2125         {#State 193
2126                 ACTIONS => {
2127                         "[" => 155
2128                 },
2129                 DEFAULT => -81,
2130                 GOTOS => {
2131                         'array_len' => 201
2132                 }
2133         },
2134         {#State 194
2135                 DEFAULT => -63
2136         },
2137         {#State 195
2138                 DEFAULT => -62
2139         },
2140         {#State 196
2141                 ACTIONS => {
2142                         'IDENTIFIER' => 9,
2143                         "*" => 146
2144                 },
2145                 GOTOS => {
2146                         'identifier' => 202
2147                 }
2148         },
2149         {#State 197
2150                 DEFAULT => -80
2151         },
2152         {#State 198
2153                 DEFAULT => -19
2154         },
2155         {#State 199
2156                 ACTIONS => {
2157                         "-" => 35,
2158                         ":" => 34,
2159                         "?" => 36,
2160                         "<" => 37,
2161                         ";" => 203,
2162                         "+" => 39,
2163                         "~" => 38,
2164                         "&" => 41,
2165                         "{" => 40,
2166                         "/" => 42,
2167                         "=" => 43,
2168                         "|" => 45,
2169                         "(" => 44,
2170                         "*" => 46,
2171                         "." => 47,
2172                         ">" => 48
2173                 }
2174         },
2175         {#State 200
2176                 DEFAULT => -17
2177         },
2178         {#State 201
2179                 DEFAULT => -83
2180         },
2181         {#State 202
2182                 ACTIONS => {
2183                         "[" => 155
2184                 },
2185                 DEFAULT => -81,
2186                 GOTOS => {
2187                         'array_len' => 204
2188                 }
2189         },
2190         {#State 203
2191                 DEFAULT => -18
2192         },
2193         {#State 204
2194                 DEFAULT => -72
2195         }
2196 ],
2197                                   yyrules  =>
2198 [
2199         [#Rule 0
2200                  '$start', 2, undef
2201         ],
2202         [#Rule 1
2203                  'idl', 0, undef
2204         ],
2205         [#Rule 2
2206                  'idl', 2,
2207 sub
2208 #line 19 "idl.yp"
2209 { push(@{$_[1]}, $_[2]); $_[1] }
2210         ],
2211         [#Rule 3
2212                  'idl', 2,
2213 sub
2214 #line 20 "idl.yp"
2215 { push(@{$_[1]}, $_[2]); $_[1] }
2216         ],
2217         [#Rule 4
2218                  'coclass', 7,
2219 sub
2220 #line 24 "idl.yp"
2221 {$_[3] => {
2222                "TYPE" => "COCLASS", 
2223                "PROPERTIES" => $_[1],
2224                "NAME" => $_[3],
2225                "DATA" => $_[5],
2226                    "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2227                    "LINE" => $_[0]->YYData->{LINE},
2228           }}
2229         ],
2230         [#Rule 5
2231                  'interface_names', 0, undef
2232         ],
2233         [#Rule 6
2234                  'interface_names', 4,
2235 sub
2236 #line 36 "idl.yp"
2237 { push(@{$_[1]}, $_[2]); $_[1] }
2238         ],
2239         [#Rule 7
2240                  'interface', 8,
2241 sub
2242 #line 40 "idl.yp"
2243 {$_[3] => {
2244                "TYPE" => "INTERFACE", 
2245                "PROPERTIES" => $_[1],
2246                "NAME" => $_[3],
2247                "BASE" => $_[4],
2248                "DATA" => $_[6],
2249                    "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2250                    "LINE" => $_[0]->YYData->{LINE},
2251           }}
2252         ],
2253         [#Rule 8
2254                  'base_interface', 0, undef
2255         ],
2256         [#Rule 9
2257                  'base_interface', 2,
2258 sub
2259 #line 53 "idl.yp"
2260 { $_[2] }
2261         ],
2262         [#Rule 10
2263                  'definitions', 1,
2264 sub
2265 #line 57 "idl.yp"
2266 { [ $_[1] ] }
2267         ],
2268         [#Rule 11
2269                  'definitions', 2,
2270 sub
2271 #line 58 "idl.yp"
2272 { push(@{$_[1]}, $_[2]); $_[1] }
2273         ],
2274         [#Rule 12
2275                  'definition', 1, undef
2276         ],
2277         [#Rule 13
2278                  'definition', 1, undef
2279         ],
2280         [#Rule 14
2281                  'definition', 1, undef
2282         ],
2283         [#Rule 15
2284                  'definition', 1, undef
2285         ],
2286         [#Rule 16
2287                  'definition', 1, undef
2288         ],
2289         [#Rule 17
2290                  'const', 7,
2291 sub
2292 #line 66 "idl.yp"
2293 {{
2294                      "TYPE"  => "CONST", 
2295                      "DTYPE"  => $_[2],
2296                          "POINTERS" => $_[3],
2297                      "NAME"  => $_[4],
2298                      "VALUE" => $_[6],
2299                      "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2300                      "LINE" => $_[0]->YYData->{LINE},
2301         }}
2302         ],
2303         [#Rule 18
2304                  'const', 8,
2305 sub
2306 #line 76 "idl.yp"
2307 {{
2308                      "TYPE"  => "CONST", 
2309                      "DTYPE"  => $_[2],
2310                          "POINTERS" => $_[3],
2311                      "NAME"  => $_[4],
2312                      "ARRAY_LEN" => $_[5],
2313                      "VALUE" => $_[7],
2314                      "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2315                      "LINE" => $_[0]->YYData->{LINE},
2316         }}
2317         ],
2318         [#Rule 19
2319                  'function', 7,
2320 sub
2321 #line 90 "idl.yp"
2322 {{
2323                 "TYPE" => "FUNCTION",
2324                 "NAME" => $_[3],
2325                 "RETURN_TYPE" => $_[2],
2326                 "PROPERTIES" => $_[1],
2327                 "ELEMENTS" => $_[5],
2328                 "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2329                 "LINE" => $_[0]->YYData->{LINE},
2330           }}
2331         ],
2332         [#Rule 20
2333                  'declare', 5,
2334 sub
2335 #line 102 "idl.yp"
2336 {{
2337                      "TYPE" => "DECLARE", 
2338                      "PROPERTIES" => $_[2],
2339                      "NAME" => $_[4],
2340                      "DATA" => $_[3],
2341                      "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2342                      "LINE" => $_[0]->YYData->{LINE},
2343         }}
2344         ],
2345         [#Rule 21
2346                  'decl_type', 1, undef
2347         ],
2348         [#Rule 22
2349                  'decl_type', 1, undef
2350         ],
2351         [#Rule 23
2352                  'decl_type', 1, undef
2353         ],
2354         [#Rule 24
2355                  'decl_enum', 1,
2356 sub
2357 #line 116 "idl.yp"
2358 {{
2359                      "TYPE" => "ENUM"
2360         }}
2361         ],
2362         [#Rule 25
2363                  'decl_bitmap', 1,
2364 sub
2365 #line 122 "idl.yp"
2366 {{
2367                      "TYPE" => "BITMAP"
2368         }}
2369         ],
2370         [#Rule 26
2371                  'decl_union', 1,
2372 sub
2373 #line 128 "idl.yp"
2374 {{
2375                      "TYPE" => "UNION"
2376         }}
2377         ],
2378         [#Rule 27
2379                  'typedef', 6,
2380 sub
2381 #line 134 "idl.yp"
2382 {{
2383                      "TYPE" => "TYPEDEF", 
2384                      "PROPERTIES" => $_[2],
2385                      "NAME" => $_[4],
2386                      "DATA" => $_[3],
2387                      "ARRAY_LEN" => $_[5],
2388                      "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2389                      "LINE" => $_[0]->YYData->{LINE},
2390         }}
2391         ],
2392         [#Rule 28
2393                  'usertype', 1, undef
2394         ],
2395         [#Rule 29
2396                  'usertype', 1, undef
2397         ],
2398         [#Rule 30
2399                  'usertype', 1, undef
2400         ],
2401         [#Rule 31
2402                  'usertype', 1, undef
2403         ],
2404         [#Rule 32
2405                  'typedecl', 2,
2406 sub
2407 #line 147 "idl.yp"
2408 { $_[1] }
2409         ],
2410         [#Rule 33
2411                  'sign', 1, undef
2412         ],
2413         [#Rule 34
2414                  'sign', 1, undef
2415         ],
2416         [#Rule 35
2417                  'existingtype', 0, undef
2418         ],
2419         [#Rule 36
2420                  'existingtype', 2,
2421 sub
2422 #line 152 "idl.yp"
2423 { "$_[1] $_[2]" }
2424         ],
2425         [#Rule 37
2426                  'existingtype', 1, undef
2427         ],
2428         [#Rule 38
2429                  'type', 1, undef
2430         ],
2431         [#Rule 39
2432                  'type', 1, undef
2433         ],
2434         [#Rule 40
2435                  'type', 1,
2436 sub
2437 #line 156 "idl.yp"
2438 { "void" }
2439         ],
2440         [#Rule 41
2441                  'enum_body', 3,
2442 sub
2443 #line 158 "idl.yp"
2444 { $_[2] }
2445         ],
2446         [#Rule 42
2447                  'opt_enum_body', 0, undef
2448         ],
2449         [#Rule 43
2450                  'opt_enum_body', 1, undef
2451         ],
2452         [#Rule 44
2453                  'enum', 3,
2454 sub
2455 #line 161 "idl.yp"
2456 {{
2457              "TYPE" => "ENUM", 
2458                          "NAME" => $_[2],
2459                      "ELEMENTS" => $_[3]
2460         }}
2461         ],
2462         [#Rule 45
2463                  'enum_elements', 1,
2464 sub
2465 #line 169 "idl.yp"
2466 { [ $_[1] ] }
2467         ],
2468         [#Rule 46
2469                  'enum_elements', 3,
2470 sub
2471 #line 170 "idl.yp"
2472 { push(@{$_[1]}, $_[3]); $_[1] }
2473         ],
2474         [#Rule 47
2475                  'enum_element', 1, undef
2476         ],
2477         [#Rule 48
2478                  'enum_element', 3,
2479 sub
2480 #line 174 "idl.yp"
2481 { "$_[1]$_[2]$_[3]" }
2482         ],
2483         [#Rule 49
2484                  'bitmap_body', 3,
2485 sub
2486 #line 177 "idl.yp"
2487 { $_[2] }
2488         ],
2489         [#Rule 50
2490                  'opt_bitmap_body', 0, undef
2491         ],
2492         [#Rule 51
2493                  'opt_bitmap_body', 1, undef
2494         ],
2495         [#Rule 52
2496                  'bitmap', 3,
2497 sub
2498 #line 180 "idl.yp"
2499 {{
2500              "TYPE" => "BITMAP", 
2501                          "NAME" => $_[2],
2502                      "ELEMENTS" => $_[3]
2503         }}
2504         ],
2505         [#Rule 53
2506                  'bitmap_elements', 1,
2507 sub
2508 #line 188 "idl.yp"
2509 { [ $_[1] ] }
2510         ],
2511         [#Rule 54
2512                  'bitmap_elements', 3,
2513 sub
2514 #line 189 "idl.yp"
2515 { push(@{$_[1]}, $_[3]); $_[1] }
2516         ],
2517         [#Rule 55
2518                  'opt_bitmap_elements', 0, undef
2519         ],
2520         [#Rule 56
2521                  'opt_bitmap_elements', 1, undef
2522         ],
2523         [#Rule 57
2524                  'bitmap_element', 3,
2525 sub
2526 #line 194 "idl.yp"
2527 { "$_[1] ( $_[3] )" }
2528         ],
2529         [#Rule 58
2530                  'struct_body', 3,
2531 sub
2532 #line 197 "idl.yp"
2533 { $_[2] }
2534         ],
2535         [#Rule 59
2536                  'opt_struct_body', 0, undef
2537         ],
2538         [#Rule 60
2539                  'opt_struct_body', 1, undef
2540         ],
2541         [#Rule 61
2542                  'struct', 3,
2543 sub
2544 #line 201 "idl.yp"
2545 {{
2546              "TYPE" => "STRUCT", 
2547                          "NAME" => $_[2],
2548                      "ELEMENTS" => $_[3]
2549         }}
2550         ],
2551         [#Rule 62
2552                  'empty_element', 2,
2553 sub
2554 #line 209 "idl.yp"
2555 {{
2556                  "NAME" => "",
2557                  "TYPE" => "EMPTY",
2558                  "PROPERTIES" => $_[1],
2559                  "POINTERS" => 0,
2560                  "ARRAY_LEN" => [],
2561                  "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2562                  "LINE" => $_[0]->YYData->{LINE},
2563          }}
2564         ],
2565         [#Rule 63
2566                  'base_or_empty', 2, undef
2567         ],
2568         [#Rule 64
2569                  'base_or_empty', 1, undef
2570         ],
2571         [#Rule 65
2572                  'optional_base_element', 2,
2573 sub
2574 #line 223 "idl.yp"
2575 { $_[2]->{PROPERTIES} = FlattenHash([$_[1],$_[2]->{PROPERTIES}]); $_[2] }
2576         ],
2577         [#Rule 66
2578                  'union_elements', 0, undef
2579         ],
2580         [#Rule 67
2581                  'union_elements', 2,
2582 sub
2583 #line 228 "idl.yp"
2584 { push(@{$_[1]}, $_[2]); $_[1] }
2585         ],
2586         [#Rule 68
2587                  'union_body', 3,
2588 sub
2589 #line 231 "idl.yp"
2590 { $_[2] }
2591         ],
2592         [#Rule 69
2593                  'opt_union_body', 0, undef
2594         ],
2595         [#Rule 70
2596                  'opt_union_body', 1, undef
2597         ],
2598         [#Rule 71
2599                  'union', 3,
2600 sub
2601 #line 235 "idl.yp"
2602 {{
2603              "TYPE" => "UNION", 
2604                      "NAME" => $_[2],
2605                      "ELEMENTS" => $_[3]
2606         }}
2607         ],
2608         [#Rule 72
2609                  'base_element', 5,
2610 sub
2611 #line 243 "idl.yp"
2612 {{
2613                            "NAME" => $_[4],
2614                            "TYPE" => $_[2],
2615                            "PROPERTIES" => $_[1],
2616                            "POINTERS" => $_[3],
2617                            "ARRAY_LEN" => $_[5],
2618                        "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2619                        "LINE" => $_[0]->YYData->{LINE},
2620               }}
2621         ],
2622         [#Rule 73
2623                  'pointers', 0,
2624 sub
2625 #line 257 "idl.yp"
2626 { 0 }
2627         ],
2628         [#Rule 74
2629                  'pointers', 2,
2630 sub
2631 #line 258 "idl.yp"
2632 { $_[1]+1 }
2633         ],
2634         [#Rule 75
2635                  'element_list1', 0, undef
2636         ],
2637         [#Rule 76
2638                  'element_list1', 3,
2639 sub
2640 #line 263 "idl.yp"
2641 { push(@{$_[1]}, $_[2]); $_[1] }
2642         ],
2643         [#Rule 77
2644                  'element_list2', 0, undef
2645         ],
2646         [#Rule 78
2647                  'element_list2', 1, undef
2648         ],
2649         [#Rule 79
2650                  'element_list2', 1,
2651 sub
2652 #line 269 "idl.yp"
2653 { [ $_[1] ] }
2654         ],
2655         [#Rule 80
2656                  'element_list2', 3,
2657 sub
2658 #line 270 "idl.yp"
2659 { push(@{$_[1]}, $_[3]); $_[1] }
2660         ],
2661         [#Rule 81
2662                  'array_len', 0, undef
2663         ],
2664         [#Rule 82
2665                  'array_len', 3,
2666 sub
2667 #line 275 "idl.yp"
2668 { push(@{$_[3]}, "*"); $_[3] }
2669         ],
2670         [#Rule 83
2671                  'array_len', 4,
2672 sub
2673 #line 276 "idl.yp"
2674 { push(@{$_[4]}, "$_[2]"); $_[4] }
2675         ],
2676         [#Rule 84
2677                  'property_list', 0, undef
2678         ],
2679         [#Rule 85
2680                  'property_list', 4,
2681 sub
2682 #line 282 "idl.yp"
2683 { FlattenHash([$_[1],$_[3]]); }
2684         ],
2685         [#Rule 86
2686                  'properties', 1,
2687 sub
2688 #line 285 "idl.yp"
2689 { $_[1] }
2690         ],
2691         [#Rule 87
2692                  'properties', 3,
2693 sub
2694 #line 286 "idl.yp"
2695 { FlattenHash([$_[1], $_[3]]); }
2696         ],
2697         [#Rule 88
2698                  'property', 1,
2699 sub
2700 #line 289 "idl.yp"
2701 {{ "$_[1]" => "1"     }}
2702         ],
2703         [#Rule 89
2704                  'property', 4,
2705 sub
2706 #line 290 "idl.yp"
2707 {{ "$_[1]" => "$_[3]" }}
2708         ],
2709         [#Rule 90
2710                  'listtext', 1, undef
2711         ],
2712         [#Rule 91
2713                  'listtext', 3,
2714 sub
2715 #line 295 "idl.yp"
2716 { "$_[1] $_[3]" }
2717         ],
2718         [#Rule 92
2719                  'commalisttext', 1, undef
2720         ],
2721         [#Rule 93
2722                  'commalisttext', 3,
2723 sub
2724 #line 300 "idl.yp"
2725 { "$_[1],$_[3]" }
2726         ],
2727         [#Rule 94
2728                  'anytext', 0,
2729 sub
2730 #line 304 "idl.yp"
2731 { "" }
2732         ],
2733         [#Rule 95
2734                  'anytext', 1, undef
2735         ],
2736         [#Rule 96
2737                  'anytext', 1, undef
2738         ],
2739         [#Rule 97
2740                  'anytext', 1, undef
2741         ],
2742         [#Rule 98
2743                  'anytext', 3,
2744 sub
2745 #line 306 "idl.yp"
2746 { "$_[1]$_[2]$_[3]" }
2747         ],
2748         [#Rule 99
2749                  'anytext', 3,
2750 sub
2751 #line 307 "idl.yp"
2752 { "$_[1]$_[2]$_[3]" }
2753         ],
2754         [#Rule 100
2755                  'anytext', 3,
2756 sub
2757 #line 308 "idl.yp"
2758 { "$_[1]$_[2]$_[3]" }
2759         ],
2760         [#Rule 101
2761                  'anytext', 3,
2762 sub
2763 #line 309 "idl.yp"
2764 { "$_[1]$_[2]$_[3]" }
2765         ],
2766         [#Rule 102
2767                  'anytext', 3,
2768 sub
2769 #line 310 "idl.yp"
2770 { "$_[1]$_[2]$_[3]" }
2771         ],
2772         [#Rule 103
2773                  'anytext', 3,
2774 sub
2775 #line 311 "idl.yp"
2776 { "$_[1]$_[2]$_[3]" }
2777         ],
2778         [#Rule 104
2779                  'anytext', 3,
2780 sub
2781 #line 312 "idl.yp"
2782 { "$_[1]$_[2]$_[3]" }
2783         ],
2784         [#Rule 105
2785                  'anytext', 3,
2786 sub
2787 #line 313 "idl.yp"
2788 { "$_[1]$_[2]$_[3]" }
2789         ],
2790         [#Rule 106
2791                  'anytext', 3,
2792 sub
2793 #line 314 "idl.yp"
2794 { "$_[1]$_[2]$_[3]" }
2795         ],
2796         [#Rule 107
2797                  'anytext', 3,
2798 sub
2799 #line 315 "idl.yp"
2800 { "$_[1]$_[2]$_[3]" }
2801         ],
2802         [#Rule 108
2803                  'anytext', 3,
2804 sub
2805 #line 316 "idl.yp"
2806 { "$_[1]$_[2]$_[3]" }
2807         ],
2808         [#Rule 109
2809                  'anytext', 3,
2810 sub
2811 #line 317 "idl.yp"
2812 { "$_[1]$_[2]$_[3]" }
2813         ],
2814         [#Rule 110
2815                  'anytext', 3,
2816 sub
2817 #line 318 "idl.yp"
2818 { "$_[1]$_[2]$_[3]" }
2819         ],
2820         [#Rule 111
2821                  'anytext', 5,
2822 sub
2823 #line 319 "idl.yp"
2824 { "$_[1]$_[2]$_[3]$_[4]$_[5]" }
2825         ],
2826         [#Rule 112
2827                  'anytext', 5,
2828 sub
2829 #line 320 "idl.yp"
2830 { "$_[1]$_[2]$_[3]$_[4]$_[5]" }
2831         ],
2832         [#Rule 113
2833                  'identifier', 1, undef
2834         ],
2835         [#Rule 114
2836                  'optional_identifier', 1, undef
2837         ],
2838         [#Rule 115
2839                  'optional_identifier', 0, undef
2840         ],
2841         [#Rule 116
2842                  'constant', 1, undef
2843         ],
2844         [#Rule 117
2845                  'text', 1,
2846 sub
2847 #line 334 "idl.yp"
2848 { "\"$_[1]\"" }
2849         ],
2850         [#Rule 118
2851                  'optional_semicolon', 0, undef
2852         ],
2853         [#Rule 119
2854                  'optional_semicolon', 1, undef
2855         ]
2856 ],
2857                                   @_);
2858     bless($self,$class);
2859 }
2860
2861 #line 345 "idl.yp"
2862
2863
2864 #####################################################################
2865 # flatten an array of hashes into a single hash
2866 sub FlattenHash($) 
2867
2868     my $a = shift;
2869     my %b;
2870     for my $d (@{$a}) {
2871         for my $k (keys %{$d}) {
2872             $b{$k} = $d->{$k};
2873         }
2874     }
2875     return \%b;
2876 }
2877
2878
2879
2880 #####################################################################
2881 # traverse a perl data structure removing any empty arrays or
2882 # hashes and any hash elements that map to undef
2883 sub CleanData($)
2884 {
2885     sub CleanData($);
2886     my($v) = shift;
2887         return undef if (not defined($v));
2888     if (ref($v) eq "ARRAY") {
2889         foreach my $i (0 .. $#{$v}) {
2890             CleanData($v->[$i]);
2891             if (ref($v->[$i]) eq "ARRAY" && $#{$v->[$i]}==-1) { 
2892                     $v->[$i] = undef; 
2893                     next; 
2894             }
2895         }
2896         # this removes any undefined elements from the array
2897         @{$v} = grep { defined $_ } @{$v};
2898     } elsif (ref($v) eq "HASH") {
2899         foreach my $x (keys %{$v}) {
2900             CleanData($v->{$x});
2901             if (!defined $v->{$x}) { delete($v->{$x}); next; }
2902             if (ref($v->{$x}) eq "ARRAY" && $#{$v->{$x}}==-1) { delete($v->{$x}); next; }
2903         }
2904     }
2905         return $v;
2906 }
2907
2908 sub _Error {
2909     if (exists $_[0]->YYData->{ERRMSG}) {
2910                 print $_[0]->YYData->{ERRMSG};
2911                 delete $_[0]->YYData->{ERRMSG};
2912                 return;
2913         };
2914         my $line = $_[0]->YYData->{LINE};
2915         my $last_token = $_[0]->YYData->{LAST_TOKEN};
2916         my $file = $_[0]->YYData->{INPUT_FILENAME};
2917         
2918         print "$file:$line: Syntax error near '$last_token'\n";
2919 }
2920
2921 sub _Lexer($)
2922 {
2923         my($parser)=shift;
2924
2925     $parser->YYData->{INPUT} or return('',undef);
2926
2927 again:
2928         $parser->YYData->{INPUT} =~ s/^[ \t]*//;
2929
2930         for ($parser->YYData->{INPUT}) {
2931                 if (/^\#/) {
2932                         if (s/^\# (\d+) \"(.*?)\"( \d+|)//) {
2933                                 $parser->YYData->{LINE} = $1-1;
2934                                 $parser->YYData->{INPUT_FILENAME} = $2;
2935                                 goto again;
2936                         }
2937                         if (s/^\#line (\d+) \"(.*?)\"( \d+|)//) {
2938                                 $parser->YYData->{LINE} = $1-1;
2939                                 $parser->YYData->{INPUT_FILENAME} = $2;
2940                                 goto again;
2941                         }
2942                         if (s/^(\#.*)$//m) {
2943                                 goto again;
2944                         }
2945                 }
2946                 if (s/^(\n)//) {
2947                         $parser->YYData->{LINE}++;
2948                         goto again;
2949                 }
2950                 if (s/^\"(.*?)\"//) {
2951                         $parser->YYData->{LAST_TOKEN} = $1;
2952                         return('TEXT',$1); 
2953                 }
2954                 if (s/^(\d+)(\W|$)/$2/) {
2955                         $parser->YYData->{LAST_TOKEN} = $1;
2956                         return('CONSTANT',$1); 
2957                 }
2958                 if (s/^([\w_]+)//) {
2959                         $parser->YYData->{LAST_TOKEN} = $1;
2960                         if ($1 =~ 
2961                             /^(coclass|interface|const|typedef|declare|union
2962                               |struct|enum|bitmap|void|unsigned|signed)$/x) {
2963                                 return $1;
2964                         }
2965                         return('IDENTIFIER',$1);
2966                 }
2967                 if (s/^(.)//s) {
2968                         $parser->YYData->{LAST_TOKEN} = $1;
2969                         return($1,$1);
2970                 }
2971         }
2972 }
2973
2974 sub parse_string
2975 {
2976         my ($data,$filename) = @_;
2977
2978         my $self = new Parse::Pidl::IDL;
2979
2980     $self->YYData->{INPUT_FILENAME} = $filename;
2981     $self->YYData->{INPUT} = $data;
2982     $self->YYData->{LINE} = 0;
2983     $self->YYData->{LAST_TOKEN} = "NONE";
2984
2985         my $idl = $self->YYParse( yylex => \&_Lexer, yyerror => \&_Error );
2986
2987         return CleanData($idl);
2988 }
2989
2990 sub parse_file($$)
2991 {
2992         my ($filename,$incdirs) = @_;
2993
2994         my $saved_delim = $/;
2995         undef $/;
2996         my $cpp = $ENV{CPP};
2997         if (! defined $cpp) {
2998                 $cpp = "cpp";
2999         }
3000         my $includes = map { " -I$_" } @$incdirs;
3001         my $data = `$cpp -D__PIDL__$includes -xc $filename`;
3002         $/ = $saved_delim;
3003
3004         return parse_string($data, $filename);
3005 }
3006
3007 1;