r15260: Don't dereference NULL pointers to obtain array lengths - found by
[samba.git] / source / 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 => -80,
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 => -109
563         },
564         {#State 10
565                 ACTIONS => {
566                         "{" => 15
567                 }
568         },
569         {#State 11
570                 ACTIONS => {
571                         "(" => 16
572                 },
573                 DEFAULT => -84
574         },
575         {#State 12
576                 DEFAULT => -82
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 => -90,
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 => -81
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 => -113
647         },
648         {#State 23
649                 DEFAULT => -91
650         },
651         {#State 24
652                 DEFAULT => -93
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 => -86
673         },
674         {#State 26
675                 ACTIONS => {
676                         "," => 49,
677                         ")" => 50
678                 }
679         },
680         {#State 27
681                 DEFAULT => -92
682         },
683         {#State 28
684                 DEFAULT => -112
685         },
686         {#State 29
687                 DEFAULT => -83
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 => -80,
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 => -114,
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 => -90,
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 => -90,
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 => -90,
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 => -90,
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 => -90,
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 => -90,
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 => -90,
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 => -90,
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 => -90,
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 => -90,
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 => -90,
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 => -90,
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 => -90,
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 => -90,
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 => -90,
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 => -90,
955                 GOTOS => {
956                         'identifier' => 23,
957                         'anytext' => 90,
958                         'text' => 24,
959                         'constant' => 27
960                 }
961         },
962         {#State 50
963                 DEFAULT => -85
964         },
965         {#State 51
966                 DEFAULT => -80,
967                 GOTOS => {
968                         'property_list' => 91
969                 }
970         },
971         {#State 52
972                 ACTIONS => {
973                         'IDENTIFIER' => 92
974                 },
975                 DEFAULT => -111,
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 => -80,
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 => -80,
1044                 GOTOS => {
1045                         'property_list' => 105
1046                 }
1047         },
1048         {#State 59
1049                 DEFAULT => -26
1050         },
1051         {#State 60
1052                 ACTIONS => {
1053                         'IDENTIFIER' => 9
1054                 },
1055                 GOTOS => {
1056                         'identifier' => 106
1057                 }
1058         },
1059         {#State 61
1060                 DEFAULT => -28
1061         },
1062         {#State 62
1063                 DEFAULT => -14
1064         },
1065         {#State 63
1066                 ACTIONS => {
1067                         'IDENTIFIER' => 92
1068                 },
1069                 DEFAULT => -111,
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 => -111,
1082                 GOTOS => {
1083                         'optional_identifier' => 108
1084                 }
1085         },
1086         {#State 66
1087                 ACTIONS => {
1088                         'IDENTIFIER' => 92
1089                 },
1090                 DEFAULT => -111,
1091                 GOTOS => {
1092                         'optional_identifier' => 109
1093                 }
1094         },
1095         {#State 67
1096                 DEFAULT => -29
1097         },
1098         {#State 68
1099                 DEFAULT => -13
1100         },
1101         {#State 69
1102                 DEFAULT => -15
1103         },
1104         {#State 70
1105                 DEFAULT => -27
1106         },
1107         {#State 71
1108                 DEFAULT => -115
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 => -103
1137         },
1138         {#State 75
1139                 ACTIONS => {
1140                         ":" => 34,
1141                         "<" => 37,
1142                         "~" => 38,
1143                         "?" => 36,
1144                         "{" => 40,
1145                         "=" => 43
1146                 },
1147                 DEFAULT => -94
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 => -102
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 => -98
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 => -106
1208         },
1209         {#State 79
1210                 ACTIONS => {
1211                         ":" => 34,
1212                         "<" => 37,
1213                         "~" => 38,
1214                         "?" => 36,
1215                         "{" => 40,
1216                         "=" => 43
1217                 },
1218                 DEFAULT => -105
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 => -88
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 => -100
1256         },
1257         {#State 83
1258                 ACTIONS => {
1259                         ":" => 34,
1260                         "<" => 37,
1261                         "~" => 38,
1262                         "?" => 36,
1263                         "{" => 40,
1264                         "=" => 43
1265                 },
1266                 DEFAULT => -101
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 => -104
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 => -99
1304         },
1305         {#State 87
1306                 ACTIONS => {
1307                         ":" => 34,
1308                         "<" => 37,
1309                         "~" => 38,
1310                         "?" => 36,
1311                         "{" => 40,
1312                         "=" => 43
1313                 },
1314                 DEFAULT => -96
1315         },
1316         {#State 88
1317                 ACTIONS => {
1318                         ":" => 34,
1319                         "<" => 37,
1320                         "~" => 38,
1321                         "?" => 36,
1322                         "{" => 40,
1323                         "=" => 43
1324                 },
1325                 DEFAULT => -95
1326         },
1327         {#State 89
1328                 ACTIONS => {
1329                         ":" => 34,
1330                         "<" => 37,
1331                         "~" => 38,
1332                         "?" => 36,
1333                         "{" => 40,
1334                         "=" => 43
1335                 },
1336                 DEFAULT => -97
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 => -87
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 => -110
1384         },
1385         {#State 93
1386                 ACTIONS => {
1387                         "{" => 116
1388                 },
1389                 DEFAULT => -65,
1390                 GOTOS => {
1391                         'union_body' => 117,
1392                         'opt_union_body' => 115
1393                 }
1394         },
1395         {#State 94
1396                 ACTIONS => {
1397                         ";" => 71
1398                 },
1399                 DEFAULT => -114,
1400                 GOTOS => {
1401                         'optional_semicolon' => 118
1402                 }
1403         },
1404         {#State 95
1405                 DEFAULT => -11
1406         },
1407         {#State 96
1408                 DEFAULT => -30
1409         },
1410         {#State 97
1411                 DEFAULT => -38
1412         },
1413         {#State 98
1414                 DEFAULT => -36
1415         },
1416         {#State 99
1417                 DEFAULT => -35
1418         },
1419         {#State 100
1420                 ACTIONS => {
1421                         'IDENTIFIER' => 9
1422                 },
1423                 GOTOS => {
1424                         'identifier' => 119
1425                 }
1426         },
1427         {#State 101
1428                 DEFAULT => -37
1429         },
1430         {#State 102
1431                 DEFAULT => -31
1432         },
1433         {#State 103
1434                 DEFAULT => -32
1435         },
1436         {#State 104
1437                 ACTIONS => {
1438                         'IDENTIFIER' => 9
1439                 },
1440                 GOTOS => {
1441                         'identifier' => 120
1442                 }
1443         },
1444         {#State 105
1445                 ACTIONS => {
1446                         "enum" => 124,
1447                         "bitmap" => 125,
1448                         "[" => 7
1449                 },
1450                 GOTOS => {
1451                         'decl_enum' => 121,
1452                         'decl_bitmap' => 122,
1453                         'decl_type' => 123
1454                 }
1455         },
1456         {#State 106
1457                 DEFAULT => -69,
1458                 GOTOS => {
1459                         'pointers' => 126
1460                 }
1461         },
1462         {#State 107
1463                 ACTIONS => {
1464                         "{" => 128
1465                 },
1466                 DEFAULT => -55,
1467                 GOTOS => {
1468                         'struct_body' => 127,
1469                         'opt_struct_body' => 129
1470                 }
1471         },
1472         {#State 108
1473                 ACTIONS => {
1474                         "{" => 130
1475                 },
1476                 DEFAULT => -40,
1477                 GOTOS => {
1478                         'opt_enum_body' => 132,
1479                         'enum_body' => 131
1480                 }
1481         },
1482         {#State 109
1483                 ACTIONS => {
1484                         "{" => 134
1485                 },
1486                 DEFAULT => -48,
1487                 GOTOS => {
1488                         'bitmap_body' => 135,
1489                         'opt_bitmap_body' => 133
1490                 }
1491         },
1492         {#State 110
1493                 DEFAULT => -6
1494         },
1495         {#State 111
1496                 ACTIONS => {
1497                         'CONSTANT' => 28,
1498                         'TEXT' => 22,
1499                         'IDENTIFIER' => 9
1500                 },
1501                 DEFAULT => -90,
1502                 GOTOS => {
1503                         'identifier' => 23,
1504                         'anytext' => 136,
1505                         'text' => 24,
1506                         'constant' => 27
1507                 }
1508         },
1509         {#State 112
1510                 ACTIONS => {
1511                         'CONSTANT' => 28,
1512                         'TEXT' => 22,
1513                         'IDENTIFIER' => 9
1514                 },
1515                 DEFAULT => -90,
1516                 GOTOS => {
1517                         'identifier' => 23,
1518                         'anytext' => 137,
1519                         'text' => 24,
1520                         'constant' => 27
1521                 }
1522         },
1523         {#State 113
1524                 ACTIONS => {
1525                         'CONSTANT' => 28,
1526                         'TEXT' => 22,
1527                         'IDENTIFIER' => 9
1528                 },
1529                 DEFAULT => -90,
1530                 GOTOS => {
1531                         'identifier' => 23,
1532                         'anytext' => 138,
1533                         'text' => 24,
1534                         'constant' => 27
1535                 }
1536         },
1537         {#State 114
1538                 ACTIONS => {
1539                         'IDENTIFIER' => 9
1540                 },
1541                 GOTOS => {
1542                         'identifier' => 139
1543                 }
1544         },
1545         {#State 115
1546                 DEFAULT => -67
1547         },
1548         {#State 116
1549                 DEFAULT => -62,
1550                 GOTOS => {
1551                         'union_elements' => 140
1552                 }
1553         },
1554         {#State 117
1555                 DEFAULT => -66
1556         },
1557         {#State 118
1558                 DEFAULT => -7
1559         },
1560         {#State 119
1561                 DEFAULT => -34
1562         },
1563         {#State 120
1564                 ACTIONS => {
1565                         "(" => 141
1566                 }
1567         },
1568         {#State 121
1569                 DEFAULT => -21
1570         },
1571         {#State 122
1572                 DEFAULT => -22
1573         },
1574         {#State 123
1575                 ACTIONS => {
1576                         'IDENTIFIER' => 9
1577                 },
1578                 GOTOS => {
1579                         'identifier' => 142
1580                 }
1581         },
1582         {#State 124
1583                 DEFAULT => -23
1584         },
1585         {#State 125
1586                 DEFAULT => -24
1587         },
1588         {#State 126
1589                 ACTIONS => {
1590                         'IDENTIFIER' => 9,
1591                         "*" => 144
1592                 },
1593                 GOTOS => {
1594                         'identifier' => 143
1595                 }
1596         },
1597         {#State 127
1598                 DEFAULT => -56
1599         },
1600         {#State 128
1601                 DEFAULT => -71,
1602                 GOTOS => {
1603                         'element_list1' => 145
1604                 }
1605         },
1606         {#State 129
1607                 DEFAULT => -57
1608         },
1609         {#State 130
1610                 ACTIONS => {
1611                         'IDENTIFIER' => 9
1612                 },
1613                 GOTOS => {
1614                         'identifier' => 146,
1615                         'enum_element' => 147,
1616                         'enum_elements' => 148
1617                 }
1618         },
1619         {#State 131
1620                 DEFAULT => -41
1621         },
1622         {#State 132
1623                 DEFAULT => -42
1624         },
1625         {#State 133
1626                 DEFAULT => -50
1627         },
1628         {#State 134
1629                 ACTIONS => {
1630                         'IDENTIFIER' => 9
1631                 },
1632                 GOTOS => {
1633                         'identifier' => 151,
1634                         'bitmap_elements' => 150,
1635                         'bitmap_element' => 149
1636                 }
1637         },
1638         {#State 135
1639                 DEFAULT => -49
1640         },
1641         {#State 136
1642                 ACTIONS => {
1643                         "-" => 35,
1644                         ":" => 34,
1645                         "<" => 37,
1646                         "+" => 39,
1647                         "~" => 38,
1648                         "*" => 46,
1649                         "?" => 36,
1650                         "{" => 40,
1651                         "&" => 41,
1652                         "/" => 42,
1653                         "=" => 43,
1654                         "(" => 44,
1655                         "|" => 45,
1656                         "." => 47,
1657                         ">" => 48
1658                 },
1659                 DEFAULT => -108
1660         },
1661         {#State 137
1662                 ACTIONS => {
1663                         "-" => 35,
1664                         ":" => 34,
1665                         "<" => 37,
1666                         "+" => 39,
1667                         "~" => 38,
1668                         "*" => 46,
1669                         "?" => 36,
1670                         "{" => 40,
1671                         "&" => 41,
1672                         "/" => 42,
1673                         "=" => 43,
1674                         "(" => 44,
1675                         "|" => 45,
1676                         "." => 47,
1677                         ">" => 48
1678                 },
1679                 DEFAULT => -89
1680         },
1681         {#State 138
1682                 ACTIONS => {
1683                         ":" => 34,
1684                         "<" => 37,
1685                         "~" => 38,
1686                         "?" => 36,
1687                         "{" => 40,
1688                         "=" => 43
1689                 },
1690                 DEFAULT => -107
1691         },
1692         {#State 139
1693                 ACTIONS => {
1694                         "[" => 152
1695                 },
1696                 DEFAULT => -77,
1697                 GOTOS => {
1698                         'array_len' => 153
1699                 }
1700         },
1701         {#State 140
1702                 ACTIONS => {
1703                         "}" => 154
1704                 },
1705                 DEFAULT => -80,
1706                 GOTOS => {
1707                         'optional_base_element' => 156,
1708                         'property_list' => 155
1709                 }
1710         },
1711         {#State 141
1712                 ACTIONS => {
1713                         "," => -73,
1714                         "void" => 160,
1715                         ")" => -73
1716                 },
1717                 DEFAULT => -80,
1718                 GOTOS => {
1719                         'base_element' => 157,
1720                         'element_list2' => 159,
1721                         'property_list' => 158
1722                 }
1723         },
1724         {#State 142
1725                 ACTIONS => {
1726                         ";" => 161
1727                 }
1728         },
1729         {#State 143
1730                 ACTIONS => {
1731                         "[" => 152,
1732                         "=" => 163
1733                 },
1734                 GOTOS => {
1735                         'array_len' => 162
1736                 }
1737         },
1738         {#State 144
1739                 DEFAULT => -70
1740         },
1741         {#State 145
1742                 ACTIONS => {
1743                         "}" => 164
1744                 },
1745                 DEFAULT => -80,
1746                 GOTOS => {
1747                         'base_element' => 165,
1748                         'property_list' => 158
1749                 }
1750         },
1751         {#State 146
1752                 ACTIONS => {
1753                         "=" => 166
1754                 },
1755                 DEFAULT => -45
1756         },
1757         {#State 147
1758                 DEFAULT => -43
1759         },
1760         {#State 148
1761                 ACTIONS => {
1762                         "}" => 167,
1763                         "," => 168
1764                 }
1765         },
1766         {#State 149
1767                 DEFAULT => -51
1768         },
1769         {#State 150
1770                 ACTIONS => {
1771                         "}" => 169,
1772                         "," => 170
1773                 }
1774         },
1775         {#State 151
1776                 ACTIONS => {
1777                         "=" => 171
1778                 }
1779         },
1780         {#State 152
1781                 ACTIONS => {
1782                         'CONSTANT' => 28,
1783                         'TEXT' => 22,
1784                         "]" => 172,
1785                         'IDENTIFIER' => 9
1786                 },
1787                 DEFAULT => -90,
1788                 GOTOS => {
1789                         'identifier' => 23,
1790                         'anytext' => 173,
1791                         'text' => 24,
1792                         'constant' => 27
1793                 }
1794         },
1795         {#State 153
1796                 ACTIONS => {
1797                         ";" => 174
1798                 }
1799         },
1800         {#State 154
1801                 DEFAULT => -64
1802         },
1803         {#State 155
1804                 ACTIONS => {
1805                         "[" => 7
1806                 },
1807                 DEFAULT => -80,
1808                 GOTOS => {
1809                         'base_or_empty' => 175,
1810                         'base_element' => 176,
1811                         'empty_element' => 177,
1812                         'property_list' => 178
1813                 }
1814         },
1815         {#State 156
1816                 DEFAULT => -63
1817         },
1818         {#State 157
1819                 DEFAULT => -75
1820         },
1821         {#State 158
1822                 ACTIONS => {
1823                         'IDENTIFIER' => 9,
1824                         "signed" => 102,
1825                         "union" => 52,
1826                         "enum" => 65,
1827                         "bitmap" => 66,
1828                         'void' => 97,
1829                         "unsigned" => 103,
1830                         "[" => 7,
1831                         "struct" => 63
1832                 },
1833                 DEFAULT => -33,
1834                 GOTOS => {
1835                         'existingtype' => 101,
1836                         'bitmap' => 67,
1837                         'usertype' => 98,
1838                         'identifier' => 99,
1839                         'struct' => 59,
1840                         'enum' => 61,
1841                         'type' => 179,
1842                         'union' => 70,
1843                         'sign' => 100
1844                 }
1845         },
1846         {#State 159
1847                 ACTIONS => {
1848                         "," => 180,
1849                         ")" => 181
1850                 }
1851         },
1852         {#State 160
1853                 DEFAULT => -74
1854         },
1855         {#State 161
1856                 DEFAULT => -20
1857         },
1858         {#State 162
1859                 ACTIONS => {
1860                         "=" => 182
1861                 }
1862         },
1863         {#State 163
1864                 ACTIONS => {
1865                         'CONSTANT' => 28,
1866                         'TEXT' => 22,
1867                         'IDENTIFIER' => 9
1868                 },
1869                 DEFAULT => -90,
1870                 GOTOS => {
1871                         'identifier' => 23,
1872                         'anytext' => 183,
1873                         'text' => 24,
1874                         'constant' => 27
1875                 }
1876         },
1877         {#State 164
1878                 DEFAULT => -54
1879         },
1880         {#State 165
1881                 ACTIONS => {
1882                         ";" => 184
1883                 }
1884         },
1885         {#State 166
1886                 ACTIONS => {
1887                         'CONSTANT' => 28,
1888                         'TEXT' => 22,
1889                         'IDENTIFIER' => 9
1890                 },
1891                 DEFAULT => -90,
1892                 GOTOS => {
1893                         'identifier' => 23,
1894                         'anytext' => 185,
1895                         'text' => 24,
1896                         'constant' => 27
1897                 }
1898         },
1899         {#State 167
1900                 DEFAULT => -39
1901         },
1902         {#State 168
1903                 ACTIONS => {
1904                         'IDENTIFIER' => 9
1905                 },
1906                 GOTOS => {
1907                         'identifier' => 146,
1908                         'enum_element' => 186
1909                 }
1910         },
1911         {#State 169
1912                 DEFAULT => -47
1913         },
1914         {#State 170
1915                 ACTIONS => {
1916                         'IDENTIFIER' => 9
1917                 },
1918                 GOTOS => {
1919                         'identifier' => 151,
1920                         'bitmap_element' => 187
1921                 }
1922         },
1923         {#State 171
1924                 ACTIONS => {
1925                         'CONSTANT' => 28,
1926                         'TEXT' => 22,
1927                         'IDENTIFIER' => 9
1928                 },
1929                 DEFAULT => -90,
1930                 GOTOS => {
1931                         'identifier' => 23,
1932                         'anytext' => 188,
1933                         'text' => 24,
1934                         'constant' => 27
1935                 }
1936         },
1937         {#State 172
1938                 ACTIONS => {
1939                         "[" => 152
1940                 },
1941                 DEFAULT => -77,
1942                 GOTOS => {
1943                         'array_len' => 189
1944                 }
1945         },
1946         {#State 173
1947                 ACTIONS => {
1948                         "-" => 35,
1949                         ":" => 34,
1950                         "?" => 36,
1951                         "<" => 37,
1952                         "+" => 39,
1953                         "~" => 38,
1954                         "&" => 41,
1955                         "{" => 40,
1956                         "/" => 42,
1957                         "=" => 43,
1958                         "|" => 45,
1959                         "(" => 44,
1960                         "*" => 46,
1961                         "." => 47,
1962                         "]" => 190,
1963                         ">" => 48
1964                 }
1965         },
1966         {#State 174
1967                 DEFAULT => -25
1968         },
1969         {#State 175
1970                 DEFAULT => -61
1971         },
1972         {#State 176
1973                 ACTIONS => {
1974                         ";" => 191
1975                 }
1976         },
1977         {#State 177
1978                 DEFAULT => -60
1979         },
1980         {#State 178
1981                 ACTIONS => {
1982                         'IDENTIFIER' => 9,
1983                         "signed" => 102,
1984                         "union" => 52,
1985                         ";" => 192,
1986                         "enum" => 65,
1987                         "bitmap" => 66,
1988                         'void' => 97,
1989                         "unsigned" => 103,
1990                         "[" => 7,
1991                         "struct" => 63
1992                 },
1993                 DEFAULT => -33,
1994                 GOTOS => {
1995                         'existingtype' => 101,
1996                         'bitmap' => 67,
1997                         'usertype' => 98,
1998                         'identifier' => 99,
1999                         'struct' => 59,
2000                         'enum' => 61,
2001                         'type' => 179,
2002                         'union' => 70,
2003                         'sign' => 100
2004                 }
2005         },
2006         {#State 179
2007                 DEFAULT => -69,
2008                 GOTOS => {
2009                         'pointers' => 193
2010                 }
2011         },
2012         {#State 180
2013                 DEFAULT => -80,
2014                 GOTOS => {
2015                         'base_element' => 194,
2016                         'property_list' => 158
2017                 }
2018         },
2019         {#State 181
2020                 ACTIONS => {
2021                         ";" => 195
2022                 }
2023         },
2024         {#State 182
2025                 ACTIONS => {
2026                         'CONSTANT' => 28,
2027                         'TEXT' => 22,
2028                         'IDENTIFIER' => 9
2029                 },
2030                 DEFAULT => -90,
2031                 GOTOS => {
2032                         'identifier' => 23,
2033                         'anytext' => 196,
2034                         'text' => 24,
2035                         'constant' => 27
2036                 }
2037         },
2038         {#State 183
2039                 ACTIONS => {
2040                         "-" => 35,
2041                         ":" => 34,
2042                         "?" => 36,
2043                         "<" => 37,
2044                         ";" => 197,
2045                         "+" => 39,
2046                         "~" => 38,
2047                         "&" => 41,
2048                         "{" => 40,
2049                         "/" => 42,
2050                         "=" => 43,
2051                         "|" => 45,
2052                         "(" => 44,
2053                         "*" => 46,
2054                         "." => 47,
2055                         ">" => 48
2056                 }
2057         },
2058         {#State 184
2059                 DEFAULT => -72
2060         },
2061         {#State 185
2062                 ACTIONS => {
2063                         "-" => 35,
2064                         ":" => 34,
2065                         "<" => 37,
2066                         "+" => 39,
2067                         "~" => 38,
2068                         "*" => 46,
2069                         "?" => 36,
2070                         "{" => 40,
2071                         "&" => 41,
2072                         "/" => 42,
2073                         "=" => 43,
2074                         "(" => 44,
2075                         "|" => 45,
2076                         "." => 47,
2077                         ">" => 48
2078                 },
2079                 DEFAULT => -46
2080         },
2081         {#State 186
2082                 DEFAULT => -44
2083         },
2084         {#State 187
2085                 DEFAULT => -52
2086         },
2087         {#State 188
2088                 ACTIONS => {
2089                         "-" => 35,
2090                         ":" => 34,
2091                         "<" => 37,
2092                         "+" => 39,
2093                         "~" => 38,
2094                         "*" => 46,
2095                         "?" => 36,
2096                         "{" => 40,
2097                         "&" => 41,
2098                         "/" => 42,
2099                         "=" => 43,
2100                         "(" => 44,
2101                         "|" => 45,
2102                         "." => 47,
2103                         ">" => 48
2104                 },
2105                 DEFAULT => -53
2106         },
2107         {#State 189
2108                 DEFAULT => -78
2109         },
2110         {#State 190
2111                 ACTIONS => {
2112                         "[" => 152
2113                 },
2114                 DEFAULT => -77,
2115                 GOTOS => {
2116                         'array_len' => 198
2117                 }
2118         },
2119         {#State 191
2120                 DEFAULT => -59
2121         },
2122         {#State 192
2123                 DEFAULT => -58
2124         },
2125         {#State 193
2126                 ACTIONS => {
2127                         'IDENTIFIER' => 9,
2128                         "*" => 144
2129                 },
2130                 GOTOS => {
2131                         'identifier' => 199
2132                 }
2133         },
2134         {#State 194
2135                 DEFAULT => -76
2136         },
2137         {#State 195
2138                 DEFAULT => -19
2139         },
2140         {#State 196
2141                 ACTIONS => {
2142                         "-" => 35,
2143                         ":" => 34,
2144                         "?" => 36,
2145                         "<" => 37,
2146                         ";" => 200,
2147                         "+" => 39,
2148                         "~" => 38,
2149                         "&" => 41,
2150                         "{" => 40,
2151                         "/" => 42,
2152                         "=" => 43,
2153                         "|" => 45,
2154                         "(" => 44,
2155                         "*" => 46,
2156                         "." => 47,
2157                         ">" => 48
2158                 }
2159         },
2160         {#State 197
2161                 DEFAULT => -17
2162         },
2163         {#State 198
2164                 DEFAULT => -79
2165         },
2166         {#State 199
2167                 ACTIONS => {
2168                         "[" => 152
2169                 },
2170                 DEFAULT => -77,
2171                 GOTOS => {
2172                         'array_len' => 201
2173                 }
2174         },
2175         {#State 200
2176                 DEFAULT => -18
2177         },
2178         {#State 201
2179                 DEFAULT => -68
2180         }
2181 ],
2182                                   yyrules  =>
2183 [
2184         [#Rule 0
2185                  '$start', 2, undef
2186         ],
2187         [#Rule 1
2188                  'idl', 0, undef
2189         ],
2190         [#Rule 2
2191                  'idl', 2,
2192 sub
2193 #line 19 "idl.yp"
2194 { push(@{$_[1]}, $_[2]); $_[1] }
2195         ],
2196         [#Rule 3
2197                  'idl', 2,
2198 sub
2199 #line 20 "idl.yp"
2200 { push(@{$_[1]}, $_[2]); $_[1] }
2201         ],
2202         [#Rule 4
2203                  'coclass', 7,
2204 sub
2205 #line 24 "idl.yp"
2206 {$_[3] => {
2207                "TYPE" => "COCLASS", 
2208                "PROPERTIES" => $_[1],
2209                "NAME" => $_[3],
2210                "DATA" => $_[5],
2211                    "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2212                    "LINE" => $_[0]->YYData->{LINE},
2213           }}
2214         ],
2215         [#Rule 5
2216                  'interface_names', 0, undef
2217         ],
2218         [#Rule 6
2219                  'interface_names', 4,
2220 sub
2221 #line 36 "idl.yp"
2222 { push(@{$_[1]}, $_[2]); $_[1] }
2223         ],
2224         [#Rule 7
2225                  'interface', 8,
2226 sub
2227 #line 40 "idl.yp"
2228 {$_[3] => {
2229                "TYPE" => "INTERFACE", 
2230                "PROPERTIES" => $_[1],
2231                "NAME" => $_[3],
2232                "BASE" => $_[4],
2233                "DATA" => $_[6],
2234                    "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2235                    "LINE" => $_[0]->YYData->{LINE},
2236           }}
2237         ],
2238         [#Rule 8
2239                  'base_interface', 0, undef
2240         ],
2241         [#Rule 9
2242                  'base_interface', 2,
2243 sub
2244 #line 53 "idl.yp"
2245 { $_[2] }
2246         ],
2247         [#Rule 10
2248                  'definitions', 1,
2249 sub
2250 #line 57 "idl.yp"
2251 { [ $_[1] ] }
2252         ],
2253         [#Rule 11
2254                  'definitions', 2,
2255 sub
2256 #line 58 "idl.yp"
2257 { push(@{$_[1]}, $_[2]); $_[1] }
2258         ],
2259         [#Rule 12
2260                  'definition', 1, undef
2261         ],
2262         [#Rule 13
2263                  'definition', 1, undef
2264         ],
2265         [#Rule 14
2266                  'definition', 1, undef
2267         ],
2268         [#Rule 15
2269                  'definition', 1, undef
2270         ],
2271         [#Rule 16
2272                  'definition', 1, undef
2273         ],
2274         [#Rule 17
2275                  'const', 7,
2276 sub
2277 #line 66 "idl.yp"
2278 {{
2279                      "TYPE"  => "CONST", 
2280                      "DTYPE"  => $_[2],
2281                          "POINTERS" => $_[3],
2282                      "NAME"  => $_[4],
2283                      "VALUE" => $_[6],
2284                      "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2285                      "LINE" => $_[0]->YYData->{LINE},
2286         }}
2287         ],
2288         [#Rule 18
2289                  'const', 8,
2290 sub
2291 #line 76 "idl.yp"
2292 {{
2293                      "TYPE"  => "CONST", 
2294                      "DTYPE"  => $_[2],
2295                          "POINTERS" => $_[3],
2296                      "NAME"  => $_[4],
2297                      "ARRAY_LEN" => $_[5],
2298                      "VALUE" => $_[7],
2299                      "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2300                      "LINE" => $_[0]->YYData->{LINE},
2301         }}
2302         ],
2303         [#Rule 19
2304                  'function', 7,
2305 sub
2306 #line 90 "idl.yp"
2307 {{
2308                 "TYPE" => "FUNCTION",
2309                 "NAME" => $_[3],
2310                 "RETURN_TYPE" => $_[2],
2311                 "PROPERTIES" => $_[1],
2312                 "ELEMENTS" => $_[5],
2313                 "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2314                 "LINE" => $_[0]->YYData->{LINE},
2315           }}
2316         ],
2317         [#Rule 20
2318                  'declare', 5,
2319 sub
2320 #line 102 "idl.yp"
2321 {{
2322                      "TYPE" => "DECLARE", 
2323                      "PROPERTIES" => $_[2],
2324                      "NAME" => $_[4],
2325                      "DATA" => $_[3],
2326                      "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2327                      "LINE" => $_[0]->YYData->{LINE},
2328         }}
2329         ],
2330         [#Rule 21
2331                  'decl_type', 1, undef
2332         ],
2333         [#Rule 22
2334                  'decl_type', 1, undef
2335         ],
2336         [#Rule 23
2337                  'decl_enum', 1,
2338 sub
2339 #line 116 "idl.yp"
2340 {{
2341                      "TYPE" => "ENUM"
2342         }}
2343         ],
2344         [#Rule 24
2345                  'decl_bitmap', 1,
2346 sub
2347 #line 122 "idl.yp"
2348 {{
2349                      "TYPE" => "BITMAP"
2350         }}
2351         ],
2352         [#Rule 25
2353                  'typedef', 6,
2354 sub
2355 #line 128 "idl.yp"
2356 {{
2357                      "TYPE" => "TYPEDEF", 
2358                      "PROPERTIES" => $_[2],
2359                      "NAME" => $_[4],
2360                      "DATA" => $_[3],
2361                      "ARRAY_LEN" => $_[5],
2362                      "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2363                      "LINE" => $_[0]->YYData->{LINE},
2364         }}
2365         ],
2366         [#Rule 26
2367                  'usertype', 1, undef
2368         ],
2369         [#Rule 27
2370                  'usertype', 1, undef
2371         ],
2372         [#Rule 28
2373                  'usertype', 1, undef
2374         ],
2375         [#Rule 29
2376                  'usertype', 1, undef
2377         ],
2378         [#Rule 30
2379                  'typedecl', 2,
2380 sub
2381 #line 141 "idl.yp"
2382 { $_[1] }
2383         ],
2384         [#Rule 31
2385                  'sign', 1, undef
2386         ],
2387         [#Rule 32
2388                  'sign', 1, undef
2389         ],
2390         [#Rule 33
2391                  'existingtype', 0, undef
2392         ],
2393         [#Rule 34
2394                  'existingtype', 2,
2395 sub
2396 #line 146 "idl.yp"
2397 { "$_[1] $_[2]" }
2398         ],
2399         [#Rule 35
2400                  'existingtype', 1, undef
2401         ],
2402         [#Rule 36
2403                  'type', 1, undef
2404         ],
2405         [#Rule 37
2406                  'type', 1, undef
2407         ],
2408         [#Rule 38
2409                  'type', 1,
2410 sub
2411 #line 150 "idl.yp"
2412 { "void" }
2413         ],
2414         [#Rule 39
2415                  'enum_body', 3,
2416 sub
2417 #line 152 "idl.yp"
2418 { $_[2] }
2419         ],
2420         [#Rule 40
2421                  'opt_enum_body', 0, undef
2422         ],
2423         [#Rule 41
2424                  'opt_enum_body', 1, undef
2425         ],
2426         [#Rule 42
2427                  'enum', 3,
2428 sub
2429 #line 155 "idl.yp"
2430 {{
2431              "TYPE" => "ENUM", 
2432                          "NAME" => $_[2],
2433                      "ELEMENTS" => $_[3]
2434         }}
2435         ],
2436         [#Rule 43
2437                  'enum_elements', 1,
2438 sub
2439 #line 163 "idl.yp"
2440 { [ $_[1] ] }
2441         ],
2442         [#Rule 44
2443                  'enum_elements', 3,
2444 sub
2445 #line 164 "idl.yp"
2446 { push(@{$_[1]}, $_[3]); $_[1] }
2447         ],
2448         [#Rule 45
2449                  'enum_element', 1, undef
2450         ],
2451         [#Rule 46
2452                  'enum_element', 3,
2453 sub
2454 #line 168 "idl.yp"
2455 { "$_[1]$_[2]$_[3]" }
2456         ],
2457         [#Rule 47
2458                  'bitmap_body', 3,
2459 sub
2460 #line 171 "idl.yp"
2461 { $_[2] }
2462         ],
2463         [#Rule 48
2464                  'opt_bitmap_body', 0, undef
2465         ],
2466         [#Rule 49
2467                  'opt_bitmap_body', 1, undef
2468         ],
2469         [#Rule 50
2470                  'bitmap', 3,
2471 sub
2472 #line 174 "idl.yp"
2473 {{
2474              "TYPE" => "BITMAP", 
2475                          "NAME" => $_[2],
2476                      "ELEMENTS" => $_[3]
2477         }}
2478         ],
2479         [#Rule 51
2480                  'bitmap_elements', 1,
2481 sub
2482 #line 182 "idl.yp"
2483 { [ $_[1] ] }
2484         ],
2485         [#Rule 52
2486                  'bitmap_elements', 3,
2487 sub
2488 #line 183 "idl.yp"
2489 { push(@{$_[1]}, $_[3]); $_[1] }
2490         ],
2491         [#Rule 53
2492                  'bitmap_element', 3,
2493 sub
2494 #line 186 "idl.yp"
2495 { "$_[1] ( $_[3] )" }
2496         ],
2497         [#Rule 54
2498                  'struct_body', 3,
2499 sub
2500 #line 189 "idl.yp"
2501 { $_[2] }
2502         ],
2503         [#Rule 55
2504                  'opt_struct_body', 0, undef
2505         ],
2506         [#Rule 56
2507                  'opt_struct_body', 1, undef
2508         ],
2509         [#Rule 57
2510                  'struct', 3,
2511 sub
2512 #line 193 "idl.yp"
2513 {{
2514              "TYPE" => "STRUCT", 
2515                          "NAME" => $_[2],
2516                      "ELEMENTS" => $_[3]
2517         }}
2518         ],
2519         [#Rule 58
2520                  'empty_element', 2,
2521 sub
2522 #line 201 "idl.yp"
2523 {{
2524                  "NAME" => "",
2525                  "TYPE" => "EMPTY",
2526                  "PROPERTIES" => $_[1],
2527                  "POINTERS" => 0,
2528                  "ARRAY_LEN" => [],
2529                  "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2530                  "LINE" => $_[0]->YYData->{LINE},
2531          }}
2532         ],
2533         [#Rule 59
2534                  'base_or_empty', 2, undef
2535         ],
2536         [#Rule 60
2537                  'base_or_empty', 1, undef
2538         ],
2539         [#Rule 61
2540                  'optional_base_element', 2,
2541 sub
2542 #line 215 "idl.yp"
2543 { $_[2]->{PROPERTIES} = FlattenHash([$_[1],$_[2]->{PROPERTIES}]); $_[2] }
2544         ],
2545         [#Rule 62
2546                  'union_elements', 0, undef
2547         ],
2548         [#Rule 63
2549                  'union_elements', 2,
2550 sub
2551 #line 220 "idl.yp"
2552 { push(@{$_[1]}, $_[2]); $_[1] }
2553         ],
2554         [#Rule 64
2555                  'union_body', 3,
2556 sub
2557 #line 223 "idl.yp"
2558 { $_[2] }
2559         ],
2560         [#Rule 65
2561                  'opt_union_body', 0, undef
2562         ],
2563         [#Rule 66
2564                  'opt_union_body', 1, undef
2565         ],
2566         [#Rule 67
2567                  'union', 3,
2568 sub
2569 #line 227 "idl.yp"
2570 {{
2571              "TYPE" => "UNION", 
2572                      "NAME" => $_[2],
2573                      "ELEMENTS" => $_[3]
2574         }}
2575         ],
2576         [#Rule 68
2577                  'base_element', 5,
2578 sub
2579 #line 235 "idl.yp"
2580 {{
2581                            "NAME" => $_[4],
2582                            "TYPE" => $_[2],
2583                            "PROPERTIES" => $_[1],
2584                            "POINTERS" => $_[3],
2585                            "ARRAY_LEN" => $_[5],
2586                        "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2587                        "LINE" => $_[0]->YYData->{LINE},
2588               }}
2589         ],
2590         [#Rule 69
2591                  'pointers', 0,
2592 sub
2593 #line 249 "idl.yp"
2594 { 0 }
2595         ],
2596         [#Rule 70
2597                  'pointers', 2,
2598 sub
2599 #line 250 "idl.yp"
2600 { $_[1]+1 }
2601         ],
2602         [#Rule 71
2603                  'element_list1', 0, undef
2604         ],
2605         [#Rule 72
2606                  'element_list1', 3,
2607 sub
2608 #line 255 "idl.yp"
2609 { push(@{$_[1]}, $_[2]); $_[1] }
2610         ],
2611         [#Rule 73
2612                  'element_list2', 0, undef
2613         ],
2614         [#Rule 74
2615                  'element_list2', 1, undef
2616         ],
2617         [#Rule 75
2618                  'element_list2', 1,
2619 sub
2620 #line 261 "idl.yp"
2621 { [ $_[1] ] }
2622         ],
2623         [#Rule 76
2624                  'element_list2', 3,
2625 sub
2626 #line 262 "idl.yp"
2627 { push(@{$_[1]}, $_[3]); $_[1] }
2628         ],
2629         [#Rule 77
2630                  'array_len', 0, undef
2631         ],
2632         [#Rule 78
2633                  'array_len', 3,
2634 sub
2635 #line 267 "idl.yp"
2636 { push(@{$_[3]}, "*"); $_[3] }
2637         ],
2638         [#Rule 79
2639                  'array_len', 4,
2640 sub
2641 #line 268 "idl.yp"
2642 { push(@{$_[4]}, "$_[2]"); $_[4] }
2643         ],
2644         [#Rule 80
2645                  'property_list', 0, undef
2646         ],
2647         [#Rule 81
2648                  'property_list', 4,
2649 sub
2650 #line 274 "idl.yp"
2651 { FlattenHash([$_[1],$_[3]]); }
2652         ],
2653         [#Rule 82
2654                  'properties', 1,
2655 sub
2656 #line 277 "idl.yp"
2657 { $_[1] }
2658         ],
2659         [#Rule 83
2660                  'properties', 3,
2661 sub
2662 #line 278 "idl.yp"
2663 { FlattenHash([$_[1], $_[3]]); }
2664         ],
2665         [#Rule 84
2666                  'property', 1,
2667 sub
2668 #line 281 "idl.yp"
2669 {{ "$_[1]" => "1"     }}
2670         ],
2671         [#Rule 85
2672                  'property', 4,
2673 sub
2674 #line 282 "idl.yp"
2675 {{ "$_[1]" => "$_[3]" }}
2676         ],
2677         [#Rule 86
2678                  'listtext', 1, undef
2679         ],
2680         [#Rule 87
2681                  'listtext', 3,
2682 sub
2683 #line 287 "idl.yp"
2684 { "$_[1] $_[3]" }
2685         ],
2686         [#Rule 88
2687                  'commalisttext', 1, undef
2688         ],
2689         [#Rule 89
2690                  'commalisttext', 3,
2691 sub
2692 #line 292 "idl.yp"
2693 { "$_[1],$_[3]" }
2694         ],
2695         [#Rule 90
2696                  'anytext', 0,
2697 sub
2698 #line 296 "idl.yp"
2699 { "" }
2700         ],
2701         [#Rule 91
2702                  'anytext', 1, undef
2703         ],
2704         [#Rule 92
2705                  'anytext', 1, undef
2706         ],
2707         [#Rule 93
2708                  'anytext', 1, undef
2709         ],
2710         [#Rule 94
2711                  'anytext', 3,
2712 sub
2713 #line 298 "idl.yp"
2714 { "$_[1]$_[2]$_[3]" }
2715         ],
2716         [#Rule 95
2717                  'anytext', 3,
2718 sub
2719 #line 299 "idl.yp"
2720 { "$_[1]$_[2]$_[3]" }
2721         ],
2722         [#Rule 96
2723                  'anytext', 3,
2724 sub
2725 #line 300 "idl.yp"
2726 { "$_[1]$_[2]$_[3]" }
2727         ],
2728         [#Rule 97
2729                  'anytext', 3,
2730 sub
2731 #line 301 "idl.yp"
2732 { "$_[1]$_[2]$_[3]" }
2733         ],
2734         [#Rule 98
2735                  'anytext', 3,
2736 sub
2737 #line 302 "idl.yp"
2738 { "$_[1]$_[2]$_[3]" }
2739         ],
2740         [#Rule 99
2741                  'anytext', 3,
2742 sub
2743 #line 303 "idl.yp"
2744 { "$_[1]$_[2]$_[3]" }
2745         ],
2746         [#Rule 100
2747                  'anytext', 3,
2748 sub
2749 #line 304 "idl.yp"
2750 { "$_[1]$_[2]$_[3]" }
2751         ],
2752         [#Rule 101
2753                  'anytext', 3,
2754 sub
2755 #line 305 "idl.yp"
2756 { "$_[1]$_[2]$_[3]" }
2757         ],
2758         [#Rule 102
2759                  'anytext', 3,
2760 sub
2761 #line 306 "idl.yp"
2762 { "$_[1]$_[2]$_[3]" }
2763         ],
2764         [#Rule 103
2765                  'anytext', 3,
2766 sub
2767 #line 307 "idl.yp"
2768 { "$_[1]$_[2]$_[3]" }
2769         ],
2770         [#Rule 104
2771                  'anytext', 3,
2772 sub
2773 #line 308 "idl.yp"
2774 { "$_[1]$_[2]$_[3]" }
2775         ],
2776         [#Rule 105
2777                  'anytext', 3,
2778 sub
2779 #line 309 "idl.yp"
2780 { "$_[1]$_[2]$_[3]" }
2781         ],
2782         [#Rule 106
2783                  'anytext', 3,
2784 sub
2785 #line 310 "idl.yp"
2786 { "$_[1]$_[2]$_[3]" }
2787         ],
2788         [#Rule 107
2789                  'anytext', 5,
2790 sub
2791 #line 311 "idl.yp"
2792 { "$_[1]$_[2]$_[3]$_[4]$_[5]" }
2793         ],
2794         [#Rule 108
2795                  'anytext', 5,
2796 sub
2797 #line 312 "idl.yp"
2798 { "$_[1]$_[2]$_[3]$_[4]$_[5]" }
2799         ],
2800         [#Rule 109
2801                  'identifier', 1, undef
2802         ],
2803         [#Rule 110
2804                  'optional_identifier', 1, undef
2805         ],
2806         [#Rule 111
2807                  'optional_identifier', 0, undef
2808         ],
2809         [#Rule 112
2810                  'constant', 1, undef
2811         ],
2812         [#Rule 113
2813                  'text', 1,
2814 sub
2815 #line 326 "idl.yp"
2816 { "\"$_[1]\"" }
2817         ],
2818         [#Rule 114
2819                  'optional_semicolon', 0, undef
2820         ],
2821         [#Rule 115
2822                  'optional_semicolon', 1, undef
2823         ]
2824 ],
2825                                   @_);
2826     bless($self,$class);
2827 }
2828
2829 #line 337 "idl.yp"
2830
2831
2832 #####################################################################
2833 # flatten an array of hashes into a single hash
2834 sub FlattenHash($) 
2835
2836     my $a = shift;
2837     my %b;
2838     for my $d (@{$a}) {
2839         for my $k (keys %{$d}) {
2840             $b{$k} = $d->{$k};
2841         }
2842     }
2843     return \%b;
2844 }
2845
2846
2847
2848 #####################################################################
2849 # traverse a perl data structure removing any empty arrays or
2850 # hashes and any hash elements that map to undef
2851 sub CleanData($)
2852 {
2853     sub CleanData($);
2854     my($v) = shift;
2855         return undef if (not defined($v));
2856     if (ref($v) eq "ARRAY") {
2857         foreach my $i (0 .. $#{$v}) {
2858             CleanData($v->[$i]);
2859             if (ref($v->[$i]) eq "ARRAY" && $#{$v->[$i]}==-1) { 
2860                     $v->[$i] = undef; 
2861                     next; 
2862             }
2863         }
2864         # this removes any undefined elements from the array
2865         @{$v} = grep { defined $_ } @{$v};
2866     } elsif (ref($v) eq "HASH") {
2867         foreach my $x (keys %{$v}) {
2868             CleanData($v->{$x});
2869             if (!defined $v->{$x}) { delete($v->{$x}); next; }
2870             if (ref($v->{$x}) eq "ARRAY" && $#{$v->{$x}}==-1) { delete($v->{$x}); next; }
2871         }
2872     }
2873         return $v;
2874 }
2875
2876 sub _Error {
2877     if (exists $_[0]->YYData->{ERRMSG}) {
2878                 print $_[0]->YYData->{ERRMSG};
2879                 delete $_[0]->YYData->{ERRMSG};
2880                 return;
2881         };
2882         my $line = $_[0]->YYData->{LINE};
2883         my $last_token = $_[0]->YYData->{LAST_TOKEN};
2884         my $file = $_[0]->YYData->{INPUT_FILENAME};
2885         
2886         print "$file:$line: Syntax error near '$last_token'\n";
2887 }
2888
2889 sub _Lexer($)
2890 {
2891         my($parser)=shift;
2892
2893     $parser->YYData->{INPUT} or return('',undef);
2894
2895 again:
2896         $parser->YYData->{INPUT} =~ s/^[ \t]*//;
2897
2898         for ($parser->YYData->{INPUT}) {
2899                 if (/^\#/) {
2900                         if (s/^\# (\d+) \"(.*?)\"( \d+|)//) {
2901                                 $parser->YYData->{LINE} = $1-1;
2902                                 $parser->YYData->{INPUT_FILENAME} = $2;
2903                                 goto again;
2904                         }
2905                         if (s/^\#line (\d+) \"(.*?)\"( \d+|)//) {
2906                                 $parser->YYData->{LINE} = $1-1;
2907                                 $parser->YYData->{INPUT_FILENAME} = $2;
2908                                 goto again;
2909                         }
2910                         if (s/^(\#.*)$//m) {
2911                                 goto again;
2912                         }
2913                 }
2914                 if (s/^(\n)//) {
2915                         $parser->YYData->{LINE}++;
2916                         goto again;
2917                 }
2918                 if (s/^\"(.*?)\"//) {
2919                         $parser->YYData->{LAST_TOKEN} = $1;
2920                         return('TEXT',$1); 
2921                 }
2922                 if (s/^(\d+)(\W|$)/$2/) {
2923                         $parser->YYData->{LAST_TOKEN} = $1;
2924                         return('CONSTANT',$1); 
2925                 }
2926                 if (s/^([\w_]+)//) {
2927                         $parser->YYData->{LAST_TOKEN} = $1;
2928                         if ($1 =~ 
2929                             /^(coclass|interface|const|typedef|declare|union
2930                               |struct|enum|bitmap|void|unsigned|signed)$/x) {
2931                                 return $1;
2932                         }
2933                         return('IDENTIFIER',$1);
2934                 }
2935                 if (s/^(.)//s) {
2936                         $parser->YYData->{LAST_TOKEN} = $1;
2937                         return($1,$1);
2938                 }
2939         }
2940 }
2941
2942 sub parse_string
2943 {
2944         my ($data,$filename) = @_;
2945
2946         my $self = new Parse::Pidl::IDL;
2947
2948     $self->YYData->{INPUT_FILENAME} = $filename;
2949     $self->YYData->{INPUT} = $data;
2950     $self->YYData->{LINE} = 0;
2951     $self->YYData->{LAST_TOKEN} = "NONE";
2952
2953         my $idl = $self->YYParse( yylex => \&_Lexer, yyerror => \&_Error );
2954
2955         return CleanData($idl);
2956 }
2957
2958 sub parse_file($)
2959 {
2960         my ($filename) = @_;
2961
2962         my $saved_delim = $/;
2963         undef $/;
2964         my $cpp = $ENV{CPP};
2965         if (! defined $cpp) {
2966                 $cpp = "cpp";
2967         }
2968         my $data = `$cpp -D__PIDL__ -xc $filename`;
2969         $/ = $saved_delim;
2970
2971         return parse_string($data, $filename);
2972 }
2973
2974 1;