r10015: Change the NT4 registry backend to use the IDL-generate parse functions.
[jelmer/samba4-debian.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 => -63,
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 => -92
563         },
564         {#State 10
565                 ACTIONS => {
566                         "{" => 15
567                 }
568         },
569         {#State 11
570                 ACTIONS => {
571                         "(" => 16
572                 },
573                 DEFAULT => -67
574         },
575         {#State 12
576                 DEFAULT => -65
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 => -73,
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 => -64
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 => -96
647         },
648         {#State 23
649                 DEFAULT => -74
650         },
651         {#State 24
652                 DEFAULT => -76
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 => -69
673         },
674         {#State 26
675                 ACTIONS => {
676                         "," => 49,
677                         ")" => 50
678                 }
679         },
680         {#State 27
681                 DEFAULT => -75
682         },
683         {#State 28
684                 DEFAULT => -95
685         },
686         {#State 29
687                 DEFAULT => -66
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 => -63,
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 => -97,
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 => -73,
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 => -73,
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 => -73,
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 => -73,
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 => -73,
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 => -73,
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 => -73,
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 => -73,
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 => -73,
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 => -73,
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 => -73,
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 => -73,
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 => -73,
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 => -73,
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 => -73,
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 => -73,
955                 GOTOS => {
956                         'identifier' => 23,
957                         'anytext' => 90,
958                         'text' => 24,
959                         'constant' => 27
960                 }
961         },
962         {#State 50
963                 DEFAULT => -68
964         },
965         {#State 51
966                 DEFAULT => -63,
967                 GOTOS => {
968                         'property_list' => 91
969                 }
970         },
971         {#State 52
972                 ACTIONS => {
973                         'IDENTIFIER' => 92
974                 },
975                 DEFAULT => -94,
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 => -63,
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                         "union" => 52,
1019                         "enum" => 65,
1020                         "bitmap" => 66,
1021                         "[" => 7,
1022                         'void' => 97,
1023                         "struct" => 63
1024                 },
1025                 GOTOS => {
1026                         'identifier' => 99,
1027                         'struct' => 59,
1028                         'enum' => 61,
1029                         'type' => 100,
1030                         'union' => 70,
1031                         'bitmap' => 67,
1032                         'usertype' => 98
1033                 }
1034         },
1035         {#State 57
1036                 DEFAULT => -10
1037         },
1038         {#State 58
1039                 DEFAULT => -63,
1040                 GOTOS => {
1041                         'property_list' => 101
1042                 }
1043         },
1044         {#State 59
1045                 DEFAULT => -26
1046         },
1047         {#State 60
1048                 ACTIONS => {
1049                         'IDENTIFIER' => 9
1050                 },
1051                 GOTOS => {
1052                         'identifier' => 102
1053                 }
1054         },
1055         {#State 61
1056                 DEFAULT => -28
1057         },
1058         {#State 62
1059                 DEFAULT => -14
1060         },
1061         {#State 63
1062                 ACTIONS => {
1063                         'IDENTIFIER' => 92
1064                 },
1065                 DEFAULT => -94,
1066                 GOTOS => {
1067                         'optional_identifier' => 103
1068                 }
1069         },
1070         {#State 64
1071                 DEFAULT => -16
1072         },
1073         {#State 65
1074                 ACTIONS => {
1075                         'IDENTIFIER' => 92
1076                 },
1077                 DEFAULT => -94,
1078                 GOTOS => {
1079                         'optional_identifier' => 104
1080                 }
1081         },
1082         {#State 66
1083                 ACTIONS => {
1084                         'IDENTIFIER' => 92
1085                 },
1086                 DEFAULT => -94,
1087                 GOTOS => {
1088                         'optional_identifier' => 105
1089                 }
1090         },
1091         {#State 67
1092                 DEFAULT => -29
1093         },
1094         {#State 68
1095                 DEFAULT => -13
1096         },
1097         {#State 69
1098                 DEFAULT => -15
1099         },
1100         {#State 70
1101                 DEFAULT => -27
1102         },
1103         {#State 71
1104                 DEFAULT => -98
1105         },
1106         {#State 72
1107                 DEFAULT => -4
1108         },
1109         {#State 73
1110                 ACTIONS => {
1111                         ";" => 106
1112                 }
1113         },
1114         {#State 74
1115                 ACTIONS => {
1116                         "-" => 35,
1117                         ":" => 34,
1118                         "<" => 37,
1119                         "+" => 39,
1120                         "~" => 38,
1121                         "*" => 46,
1122                         "?" => 36,
1123                         "{" => 40,
1124                         "&" => 41,
1125                         "/" => 42,
1126                         "=" => 43,
1127                         "(" => 44,
1128                         "|" => 45,
1129                         "." => 47,
1130                         ">" => 48
1131                 },
1132                 DEFAULT => -86
1133         },
1134         {#State 75
1135                 ACTIONS => {
1136                         ":" => 34,
1137                         "<" => 37,
1138                         "~" => 38,
1139                         "?" => 36,
1140                         "{" => 40,
1141                         "=" => 43
1142                 },
1143                 DEFAULT => -77
1144         },
1145         {#State 76
1146                 ACTIONS => {
1147                         "-" => 35,
1148                         ":" => 34,
1149                         "<" => 37,
1150                         "+" => 39,
1151                         "~" => 38,
1152                         "*" => 46,
1153                         "?" => 36,
1154                         "{" => 40,
1155                         "&" => 41,
1156                         "/" => 42,
1157                         "=" => 43,
1158                         "(" => 44,
1159                         "|" => 45,
1160                         "." => 47,
1161                         ">" => 48
1162                 },
1163                 DEFAULT => -85
1164         },
1165         {#State 77
1166                 ACTIONS => {
1167                         "-" => 35,
1168                         ":" => 34,
1169                         "<" => 37,
1170                         "+" => 39,
1171                         "~" => 38,
1172                         "*" => 46,
1173                         "?" => 36,
1174                         "{" => 40,
1175                         "&" => 41,
1176                         "/" => 42,
1177                         "=" => 43,
1178                         "(" => 44,
1179                         "|" => 45,
1180                         "." => 47,
1181                         ">" => 48
1182                 },
1183                 DEFAULT => -81
1184         },
1185         {#State 78
1186                 ACTIONS => {
1187                         "-" => 35,
1188                         ":" => 34,
1189                         "<" => 37,
1190                         "+" => 39,
1191                         "~" => 38,
1192                         "*" => 46,
1193                         "?" => 36,
1194                         "{" => 40,
1195                         "&" => 41,
1196                         "/" => 42,
1197                         "=" => 43,
1198                         "(" => 44,
1199                         "|" => 45,
1200                         "." => 47,
1201                         ">" => 48
1202                 },
1203                 DEFAULT => -89
1204         },
1205         {#State 79
1206                 ACTIONS => {
1207                         ":" => 34,
1208                         "<" => 37,
1209                         "~" => 38,
1210                         "?" => 36,
1211                         "{" => 40,
1212                         "=" => 43
1213                 },
1214                 DEFAULT => -88
1215         },
1216         {#State 80
1217                 ACTIONS => {
1218                         "-" => 35,
1219                         ":" => 34,
1220                         "<" => 37,
1221                         "+" => 39,
1222                         "~" => 38,
1223                         "*" => 46,
1224                         "?" => 36,
1225                         "{" => 40,
1226                         "&" => 41,
1227                         "/" => 42,
1228                         "=" => 43,
1229                         "(" => 44,
1230                         "|" => 45,
1231                         "." => 47,
1232                         ">" => 48
1233                 },
1234                 DEFAULT => -71
1235         },
1236         {#State 81
1237                 ACTIONS => {
1238                         "}" => 107,
1239                         "," => 108
1240                 }
1241         },
1242         {#State 82
1243                 ACTIONS => {
1244                         ":" => 34,
1245                         "<" => 37,
1246                         "~" => 38,
1247                         "?" => 36,
1248                         "{" => 40,
1249                         "=" => 43
1250                 },
1251                 DEFAULT => -83
1252         },
1253         {#State 83
1254                 ACTIONS => {
1255                         ":" => 34,
1256                         "<" => 37,
1257                         "~" => 38,
1258                         "?" => 36,
1259                         "{" => 40,
1260                         "=" => 43
1261                 },
1262                 DEFAULT => -84
1263         },
1264         {#State 84
1265                 ACTIONS => {
1266                         "-" => 35,
1267                         ":" => 34,
1268                         "<" => 37,
1269                         "+" => 39,
1270                         "~" => 38,
1271                         "*" => 46,
1272                         "?" => 36,
1273                         "{" => 40,
1274                         "&" => 41,
1275                         "/" => 42,
1276                         "=" => 43,
1277                         "(" => 44,
1278                         "|" => 45,
1279                         "." => 47,
1280                         ">" => 48
1281                 },
1282                 DEFAULT => -87
1283         },
1284         {#State 85
1285                 ACTIONS => {
1286                         "," => 108,
1287                         ")" => 109
1288                 }
1289         },
1290         {#State 86
1291                 ACTIONS => {
1292                         ":" => 34,
1293                         "<" => 37,
1294                         "~" => 38,
1295                         "?" => 36,
1296                         "{" => 40,
1297                         "=" => 43
1298                 },
1299                 DEFAULT => -82
1300         },
1301         {#State 87
1302                 ACTIONS => {
1303                         ":" => 34,
1304                         "<" => 37,
1305                         "~" => 38,
1306                         "?" => 36,
1307                         "{" => 40,
1308                         "=" => 43
1309                 },
1310                 DEFAULT => -79
1311         },
1312         {#State 88
1313                 ACTIONS => {
1314                         ":" => 34,
1315                         "<" => 37,
1316                         "~" => 38,
1317                         "?" => 36,
1318                         "{" => 40,
1319                         "=" => 43
1320                 },
1321                 DEFAULT => -78
1322         },
1323         {#State 89
1324                 ACTIONS => {
1325                         ":" => 34,
1326                         "<" => 37,
1327                         "~" => 38,
1328                         "?" => 36,
1329                         "{" => 40,
1330                         "=" => 43
1331                 },
1332                 DEFAULT => -80
1333         },
1334         {#State 90
1335                 ACTIONS => {
1336                         "-" => 35,
1337                         ":" => 34,
1338                         "<" => 37,
1339                         "+" => 39,
1340                         "~" => 38,
1341                         "*" => 46,
1342                         "?" => 36,
1343                         "{" => 40,
1344                         "&" => 41,
1345                         "/" => 42,
1346                         "=" => 43,
1347                         "(" => 44,
1348                         "|" => 45,
1349                         "." => 47,
1350                         ">" => 48
1351                 },
1352                 DEFAULT => -70
1353         },
1354         {#State 91
1355                 ACTIONS => {
1356                         'IDENTIFIER' => 9,
1357                         "union" => 52,
1358                         "enum" => 65,
1359                         "bitmap" => 66,
1360                         "[" => 7,
1361                         'void' => 97,
1362                         "struct" => 63
1363                 },
1364                 GOTOS => {
1365                         'identifier' => 99,
1366                         'struct' => 59,
1367                         'enum' => 61,
1368                         'type' => 110,
1369                         'union' => 70,
1370                         'bitmap' => 67,
1371                         'usertype' => 98
1372                 }
1373         },
1374         {#State 92
1375                 DEFAULT => -93
1376         },
1377         {#State 93
1378                 ACTIONS => {
1379                         "{" => 111
1380                 }
1381         },
1382         {#State 94
1383                 ACTIONS => {
1384                         ";" => 71
1385                 },
1386                 DEFAULT => -97,
1387                 GOTOS => {
1388                         'optional_semicolon' => 112
1389                 }
1390         },
1391         {#State 95
1392                 DEFAULT => -11
1393         },
1394         {#State 96
1395                 DEFAULT => -30
1396         },
1397         {#State 97
1398                 DEFAULT => -33
1399         },
1400         {#State 98
1401                 DEFAULT => -31
1402         },
1403         {#State 99
1404                 DEFAULT => -32
1405         },
1406         {#State 100
1407                 ACTIONS => {
1408                         'IDENTIFIER' => 9
1409                 },
1410                 GOTOS => {
1411                         'identifier' => 113
1412                 }
1413         },
1414         {#State 101
1415                 ACTIONS => {
1416                         "enum" => 117,
1417                         "bitmap" => 118,
1418                         "[" => 7
1419                 },
1420                 GOTOS => {
1421                         'decl_enum' => 114,
1422                         'decl_bitmap' => 115,
1423                         'decl_type' => 116
1424                 }
1425         },
1426         {#State 102
1427                 ACTIONS => {
1428                         'IDENTIFIER' => 9
1429                 },
1430                 GOTOS => {
1431                         'identifier' => 119
1432                 }
1433         },
1434         {#State 103
1435                 ACTIONS => {
1436                         "{" => 120
1437                 }
1438         },
1439         {#State 104
1440                 ACTIONS => {
1441                         "{" => 121
1442                 }
1443         },
1444         {#State 105
1445                 ACTIONS => {
1446                         "{" => 122
1447                 }
1448         },
1449         {#State 106
1450                 DEFAULT => -6
1451         },
1452         {#State 107
1453                 ACTIONS => {
1454                         'CONSTANT' => 28,
1455                         'TEXT' => 22,
1456                         'IDENTIFIER' => 9
1457                 },
1458                 DEFAULT => -73,
1459                 GOTOS => {
1460                         'identifier' => 23,
1461                         'anytext' => 123,
1462                         'text' => 24,
1463                         'constant' => 27
1464                 }
1465         },
1466         {#State 108
1467                 ACTIONS => {
1468                         'CONSTANT' => 28,
1469                         'TEXT' => 22,
1470                         'IDENTIFIER' => 9
1471                 },
1472                 DEFAULT => -73,
1473                 GOTOS => {
1474                         'identifier' => 23,
1475                         'anytext' => 124,
1476                         'text' => 24,
1477                         'constant' => 27
1478                 }
1479         },
1480         {#State 109
1481                 ACTIONS => {
1482                         'CONSTANT' => 28,
1483                         'TEXT' => 22,
1484                         'IDENTIFIER' => 9
1485                 },
1486                 DEFAULT => -73,
1487                 GOTOS => {
1488                         'identifier' => 23,
1489                         'anytext' => 125,
1490                         'text' => 24,
1491                         'constant' => 27
1492                 }
1493         },
1494         {#State 110
1495                 ACTIONS => {
1496                         'IDENTIFIER' => 9
1497                 },
1498                 GOTOS => {
1499                         'identifier' => 126
1500                 }
1501         },
1502         {#State 111
1503                 DEFAULT => -48,
1504                 GOTOS => {
1505                         'union_elements' => 127
1506                 }
1507         },
1508         {#State 112
1509                 DEFAULT => -7
1510         },
1511         {#State 113
1512                 ACTIONS => {
1513                         "(" => 128
1514                 }
1515         },
1516         {#State 114
1517                 DEFAULT => -21
1518         },
1519         {#State 115
1520                 DEFAULT => -22
1521         },
1522         {#State 116
1523                 ACTIONS => {
1524                         'IDENTIFIER' => 9
1525                 },
1526                 GOTOS => {
1527                         'identifier' => 129
1528                 }
1529         },
1530         {#State 117
1531                 DEFAULT => -23
1532         },
1533         {#State 118
1534                 DEFAULT => -24
1535         },
1536         {#State 119
1537                 ACTIONS => {
1538                         "[" => 130,
1539                         "=" => 132
1540                 },
1541                 GOTOS => {
1542                         'array_len' => 131
1543                 }
1544         },
1545         {#State 120
1546                 DEFAULT => -54,
1547                 GOTOS => {
1548                         'element_list1' => 133
1549                 }
1550         },
1551         {#State 121
1552                 ACTIONS => {
1553                         'IDENTIFIER' => 9
1554                 },
1555                 GOTOS => {
1556                         'identifier' => 134,
1557                         'enum_element' => 135,
1558                         'enum_elements' => 136
1559                 }
1560         },
1561         {#State 122
1562                 ACTIONS => {
1563                         'IDENTIFIER' => 9
1564                 },
1565                 GOTOS => {
1566                         'identifier' => 139,
1567                         'bitmap_elements' => 138,
1568                         'bitmap_element' => 137
1569                 }
1570         },
1571         {#State 123
1572                 ACTIONS => {
1573                         "-" => 35,
1574                         ":" => 34,
1575                         "<" => 37,
1576                         "+" => 39,
1577                         "~" => 38,
1578                         "*" => 46,
1579                         "?" => 36,
1580                         "{" => 40,
1581                         "&" => 41,
1582                         "/" => 42,
1583                         "=" => 43,
1584                         "(" => 44,
1585                         "|" => 45,
1586                         "." => 47,
1587                         ">" => 48
1588                 },
1589                 DEFAULT => -91
1590         },
1591         {#State 124
1592                 ACTIONS => {
1593                         "-" => 35,
1594                         ":" => 34,
1595                         "<" => 37,
1596                         "+" => 39,
1597                         "~" => 38,
1598                         "*" => 46,
1599                         "?" => 36,
1600                         "{" => 40,
1601                         "&" => 41,
1602                         "/" => 42,
1603                         "=" => 43,
1604                         "(" => 44,
1605                         "|" => 45,
1606                         "." => 47,
1607                         ">" => 48
1608                 },
1609                 DEFAULT => -72
1610         },
1611         {#State 125
1612                 ACTIONS => {
1613                         ":" => 34,
1614                         "<" => 37,
1615                         "~" => 38,
1616                         "?" => 36,
1617                         "{" => 40,
1618                         "=" => 43
1619                 },
1620                 DEFAULT => -90
1621         },
1622         {#State 126
1623                 ACTIONS => {
1624                         "[" => 130
1625                 },
1626                 DEFAULT => -60,
1627                 GOTOS => {
1628                         'array_len' => 140
1629                 }
1630         },
1631         {#State 127
1632                 ACTIONS => {
1633                         "}" => 141
1634                 },
1635                 DEFAULT => -63,
1636                 GOTOS => {
1637                         'optional_base_element' => 143,
1638                         'property_list' => 142
1639                 }
1640         },
1641         {#State 128
1642                 ACTIONS => {
1643                         "," => -56,
1644                         "void" => 147,
1645                         ")" => -56
1646                 },
1647                 DEFAULT => -63,
1648                 GOTOS => {
1649                         'base_element' => 144,
1650                         'element_list2' => 146,
1651                         'property_list' => 145
1652                 }
1653         },
1654         {#State 129
1655                 ACTIONS => {
1656                         ";" => 148
1657                 }
1658         },
1659         {#State 130
1660                 ACTIONS => {
1661                         'CONSTANT' => 28,
1662                         'TEXT' => 22,
1663                         "]" => 149,
1664                         'IDENTIFIER' => 9
1665                 },
1666                 DEFAULT => -73,
1667                 GOTOS => {
1668                         'identifier' => 23,
1669                         'anytext' => 150,
1670                         'text' => 24,
1671                         'constant' => 27
1672                 }
1673         },
1674         {#State 131
1675                 ACTIONS => {
1676                         "=" => 151
1677                 }
1678         },
1679         {#State 132
1680                 ACTIONS => {
1681                         'CONSTANT' => 28,
1682                         'TEXT' => 22,
1683                         'IDENTIFIER' => 9
1684                 },
1685                 DEFAULT => -73,
1686                 GOTOS => {
1687                         'identifier' => 23,
1688                         'anytext' => 152,
1689                         'text' => 24,
1690                         'constant' => 27
1691                 }
1692         },
1693         {#State 133
1694                 ACTIONS => {
1695                         "}" => 153
1696                 },
1697                 DEFAULT => -63,
1698                 GOTOS => {
1699                         'base_element' => 154,
1700                         'property_list' => 145
1701                 }
1702         },
1703         {#State 134
1704                 ACTIONS => {
1705                         "=" => 155
1706                 },
1707                 DEFAULT => -37
1708         },
1709         {#State 135
1710                 DEFAULT => -35
1711         },
1712         {#State 136
1713                 ACTIONS => {
1714                         "}" => 156,
1715                         "," => 157
1716                 }
1717         },
1718         {#State 137
1719                 DEFAULT => -40
1720         },
1721         {#State 138
1722                 ACTIONS => {
1723                         "}" => 158,
1724                         "," => 159
1725                 }
1726         },
1727         {#State 139
1728                 ACTIONS => {
1729                         "=" => 160
1730                 }
1731         },
1732         {#State 140
1733                 ACTIONS => {
1734                         ";" => 161
1735                 }
1736         },
1737         {#State 141
1738                 DEFAULT => -50
1739         },
1740         {#State 142
1741                 ACTIONS => {
1742                         "[" => 7
1743                 },
1744                 DEFAULT => -63,
1745                 GOTOS => {
1746                         'base_or_empty' => 162,
1747                         'base_element' => 163,
1748                         'empty_element' => 164,
1749                         'property_list' => 165
1750                 }
1751         },
1752         {#State 143
1753                 DEFAULT => -49
1754         },
1755         {#State 144
1756                 DEFAULT => -58
1757         },
1758         {#State 145
1759                 ACTIONS => {
1760                         'IDENTIFIER' => 9,
1761                         "union" => 52,
1762                         "enum" => 65,
1763                         "bitmap" => 66,
1764                         "[" => 7,
1765                         'void' => 97,
1766                         "struct" => 63
1767                 },
1768                 GOTOS => {
1769                         'identifier' => 99,
1770                         'struct' => 59,
1771                         'enum' => 61,
1772                         'type' => 166,
1773                         'union' => 70,
1774                         'bitmap' => 67,
1775                         'usertype' => 98
1776                 }
1777         },
1778         {#State 146
1779                 ACTIONS => {
1780                         "," => 167,
1781                         ")" => 168
1782                 }
1783         },
1784         {#State 147
1785                 DEFAULT => -57
1786         },
1787         {#State 148
1788                 DEFAULT => -20
1789         },
1790         {#State 149
1791                 ACTIONS => {
1792                         "[" => 130
1793                 },
1794                 DEFAULT => -60,
1795                 GOTOS => {
1796                         'array_len' => 169
1797                 }
1798         },
1799         {#State 150
1800                 ACTIONS => {
1801                         "-" => 35,
1802                         ":" => 34,
1803                         "?" => 36,
1804                         "<" => 37,
1805                         "+" => 39,
1806                         "~" => 38,
1807                         "&" => 41,
1808                         "{" => 40,
1809                         "/" => 42,
1810                         "=" => 43,
1811                         "|" => 45,
1812                         "(" => 44,
1813                         "*" => 46,
1814                         "." => 47,
1815                         "]" => 170,
1816                         ">" => 48
1817                 }
1818         },
1819         {#State 151
1820                 ACTIONS => {
1821                         'CONSTANT' => 28,
1822                         'TEXT' => 22,
1823                         'IDENTIFIER' => 9
1824                 },
1825                 DEFAULT => -73,
1826                 GOTOS => {
1827                         'identifier' => 23,
1828                         'anytext' => 171,
1829                         'text' => 24,
1830                         'constant' => 27
1831                 }
1832         },
1833         {#State 152
1834                 ACTIONS => {
1835                         "-" => 35,
1836                         ":" => 34,
1837                         "?" => 36,
1838                         "<" => 37,
1839                         ";" => 172,
1840                         "+" => 39,
1841                         "~" => 38,
1842                         "&" => 41,
1843                         "{" => 40,
1844                         "/" => 42,
1845                         "=" => 43,
1846                         "|" => 45,
1847                         "(" => 44,
1848                         "*" => 46,
1849                         "." => 47,
1850                         ">" => 48
1851                 }
1852         },
1853         {#State 153
1854                 DEFAULT => -43
1855         },
1856         {#State 154
1857                 ACTIONS => {
1858                         ";" => 173
1859                 }
1860         },
1861         {#State 155
1862                 ACTIONS => {
1863                         'CONSTANT' => 28,
1864                         'TEXT' => 22,
1865                         'IDENTIFIER' => 9
1866                 },
1867                 DEFAULT => -73,
1868                 GOTOS => {
1869                         'identifier' => 23,
1870                         'anytext' => 174,
1871                         'text' => 24,
1872                         'constant' => 27
1873                 }
1874         },
1875         {#State 156
1876                 DEFAULT => -34
1877         },
1878         {#State 157
1879                 ACTIONS => {
1880                         'IDENTIFIER' => 9
1881                 },
1882                 GOTOS => {
1883                         'identifier' => 134,
1884                         'enum_element' => 175
1885                 }
1886         },
1887         {#State 158
1888                 DEFAULT => -39
1889         },
1890         {#State 159
1891                 ACTIONS => {
1892                         'IDENTIFIER' => 9
1893                 },
1894                 GOTOS => {
1895                         'identifier' => 139,
1896                         'bitmap_element' => 176
1897                 }
1898         },
1899         {#State 160
1900                 ACTIONS => {
1901                         'CONSTANT' => 28,
1902                         'TEXT' => 22,
1903                         'IDENTIFIER' => 9
1904                 },
1905                 DEFAULT => -73,
1906                 GOTOS => {
1907                         'identifier' => 23,
1908                         'anytext' => 177,
1909                         'text' => 24,
1910                         'constant' => 27
1911                 }
1912         },
1913         {#State 161
1914                 DEFAULT => -25
1915         },
1916         {#State 162
1917                 DEFAULT => -47
1918         },
1919         {#State 163
1920                 ACTIONS => {
1921                         ";" => 178
1922                 }
1923         },
1924         {#State 164
1925                 DEFAULT => -46
1926         },
1927         {#State 165
1928                 ACTIONS => {
1929                         'IDENTIFIER' => 9,
1930                         "union" => 52,
1931                         ";" => 179,
1932                         "enum" => 65,
1933                         "bitmap" => 66,
1934                         'void' => 97,
1935                         "[" => 7,
1936                         "struct" => 63
1937                 },
1938                 GOTOS => {
1939                         'identifier' => 99,
1940                         'struct' => 59,
1941                         'enum' => 61,
1942                         'type' => 166,
1943                         'union' => 70,
1944                         'bitmap' => 67,
1945                         'usertype' => 98
1946                 }
1947         },
1948         {#State 166
1949                 DEFAULT => -52,
1950                 GOTOS => {
1951                         'pointers' => 180
1952                 }
1953         },
1954         {#State 167
1955                 DEFAULT => -63,
1956                 GOTOS => {
1957                         'base_element' => 181,
1958                         'property_list' => 145
1959                 }
1960         },
1961         {#State 168
1962                 ACTIONS => {
1963                         ";" => 182
1964                 }
1965         },
1966         {#State 169
1967                 DEFAULT => -61
1968         },
1969         {#State 170
1970                 ACTIONS => {
1971                         "[" => 130
1972                 },
1973                 DEFAULT => -60,
1974                 GOTOS => {
1975                         'array_len' => 183
1976                 }
1977         },
1978         {#State 171
1979                 ACTIONS => {
1980                         "-" => 35,
1981                         ":" => 34,
1982                         "?" => 36,
1983                         "<" => 37,
1984                         ";" => 184,
1985                         "+" => 39,
1986                         "~" => 38,
1987                         "&" => 41,
1988                         "{" => 40,
1989                         "/" => 42,
1990                         "=" => 43,
1991                         "|" => 45,
1992                         "(" => 44,
1993                         "*" => 46,
1994                         "." => 47,
1995                         ">" => 48
1996                 }
1997         },
1998         {#State 172
1999                 DEFAULT => -17
2000         },
2001         {#State 173
2002                 DEFAULT => -55
2003         },
2004         {#State 174
2005                 ACTIONS => {
2006                         "-" => 35,
2007                         ":" => 34,
2008                         "<" => 37,
2009                         "+" => 39,
2010                         "~" => 38,
2011                         "*" => 46,
2012                         "?" => 36,
2013                         "{" => 40,
2014                         "&" => 41,
2015                         "/" => 42,
2016                         "=" => 43,
2017                         "(" => 44,
2018                         "|" => 45,
2019                         "." => 47,
2020                         ">" => 48
2021                 },
2022                 DEFAULT => -38
2023         },
2024         {#State 175
2025                 DEFAULT => -36
2026         },
2027         {#State 176
2028                 DEFAULT => -41
2029         },
2030         {#State 177
2031                 ACTIONS => {
2032                         "-" => 35,
2033                         ":" => 34,
2034                         "<" => 37,
2035                         "+" => 39,
2036                         "~" => 38,
2037                         "*" => 46,
2038                         "?" => 36,
2039                         "{" => 40,
2040                         "&" => 41,
2041                         "/" => 42,
2042                         "=" => 43,
2043                         "(" => 44,
2044                         "|" => 45,
2045                         "." => 47,
2046                         ">" => 48
2047                 },
2048                 DEFAULT => -42
2049         },
2050         {#State 178
2051                 DEFAULT => -45
2052         },
2053         {#State 179
2054                 DEFAULT => -44
2055         },
2056         {#State 180
2057                 ACTIONS => {
2058                         'IDENTIFIER' => 9,
2059                         "*" => 186
2060                 },
2061                 GOTOS => {
2062                         'identifier' => 185
2063                 }
2064         },
2065         {#State 181
2066                 DEFAULT => -59
2067         },
2068         {#State 182
2069                 DEFAULT => -19
2070         },
2071         {#State 183
2072                 DEFAULT => -62
2073         },
2074         {#State 184
2075                 DEFAULT => -18
2076         },
2077         {#State 185
2078                 ACTIONS => {
2079                         "[" => 130
2080                 },
2081                 DEFAULT => -60,
2082                 GOTOS => {
2083                         'array_len' => 187
2084                 }
2085         },
2086         {#State 186
2087                 DEFAULT => -53
2088         },
2089         {#State 187
2090                 DEFAULT => -51
2091         }
2092 ],
2093                                   yyrules  =>
2094 [
2095         [#Rule 0
2096                  '$start', 2, undef
2097         ],
2098         [#Rule 1
2099                  'idl', 0, undef
2100         ],
2101         [#Rule 2
2102                  'idl', 2,
2103 sub
2104 #line 19 "pidl/idl.yp"
2105 { push(@{$_[1]}, $_[2]); $_[1] }
2106         ],
2107         [#Rule 3
2108                  'idl', 2,
2109 sub
2110 #line 20 "pidl/idl.yp"
2111 { push(@{$_[1]}, $_[2]); $_[1] }
2112         ],
2113         [#Rule 4
2114                  'coclass', 7,
2115 sub
2116 #line 24 "pidl/idl.yp"
2117 {$_[3] => {
2118                "TYPE" => "COCLASS", 
2119                "PROPERTIES" => $_[1],
2120                "NAME" => $_[3],
2121                "DATA" => $_[5],
2122                    "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2123                    "LINE" => $_[0]->YYData->{LINE},
2124           }}
2125         ],
2126         [#Rule 5
2127                  'interface_names', 0, undef
2128         ],
2129         [#Rule 6
2130                  'interface_names', 4,
2131 sub
2132 #line 36 "pidl/idl.yp"
2133 { push(@{$_[1]}, $_[2]); $_[1] }
2134         ],
2135         [#Rule 7
2136                  'interface', 8,
2137 sub
2138 #line 40 "pidl/idl.yp"
2139 {$_[3] => {
2140                "TYPE" => "INTERFACE", 
2141                "PROPERTIES" => $_[1],
2142                "NAME" => $_[3],
2143                "BASE" => $_[4],
2144                "DATA" => $_[6],
2145                    "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2146                    "LINE" => $_[0]->YYData->{LINE},
2147           }}
2148         ],
2149         [#Rule 8
2150                  'base_interface', 0, undef
2151         ],
2152         [#Rule 9
2153                  'base_interface', 2,
2154 sub
2155 #line 53 "pidl/idl.yp"
2156 { $_[2] }
2157         ],
2158         [#Rule 10
2159                  'definitions', 1,
2160 sub
2161 #line 57 "pidl/idl.yp"
2162 { [ $_[1] ] }
2163         ],
2164         [#Rule 11
2165                  'definitions', 2,
2166 sub
2167 #line 58 "pidl/idl.yp"
2168 { push(@{$_[1]}, $_[2]); $_[1] }
2169         ],
2170         [#Rule 12
2171                  'definition', 1, undef
2172         ],
2173         [#Rule 13
2174                  'definition', 1, undef
2175         ],
2176         [#Rule 14
2177                  'definition', 1, undef
2178         ],
2179         [#Rule 15
2180                  'definition', 1, undef
2181         ],
2182         [#Rule 16
2183                  'definition', 1, undef
2184         ],
2185         [#Rule 17
2186                  'const', 6,
2187 sub
2188 #line 66 "pidl/idl.yp"
2189 {{
2190                      "TYPE"  => "CONST", 
2191                      "DTYPE"  => $_[2],
2192                      "NAME"  => $_[3],
2193                      "VALUE" => $_[5],
2194                      "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2195                      "LINE" => $_[0]->YYData->{LINE},
2196         }}
2197         ],
2198         [#Rule 18
2199                  'const', 7,
2200 sub
2201 #line 75 "pidl/idl.yp"
2202 {{
2203                      "TYPE"  => "CONST", 
2204                      "DTYPE"  => $_[2],
2205                      "NAME"  => $_[3],
2206                      "ARRAY_LEN" => $_[4],
2207                      "VALUE" => $_[6],
2208                      "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2209                      "LINE" => $_[0]->YYData->{LINE},
2210         }}
2211         ],
2212         [#Rule 19
2213                  'function', 7,
2214 sub
2215 #line 88 "pidl/idl.yp"
2216 {{
2217                 "TYPE" => "FUNCTION",
2218                 "NAME" => $_[3],
2219                 "RETURN_TYPE" => $_[2],
2220                 "PROPERTIES" => $_[1],
2221                 "ELEMENTS" => $_[5],
2222                 "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2223                 "LINE" => $_[0]->YYData->{LINE},
2224           }}
2225         ],
2226         [#Rule 20
2227                  'declare', 5,
2228 sub
2229 #line 100 "pidl/idl.yp"
2230 {{
2231                      "TYPE" => "DECLARE", 
2232                      "PROPERTIES" => $_[2],
2233                      "NAME" => $_[4],
2234                      "DATA" => $_[3],
2235                      "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2236                      "LINE" => $_[0]->YYData->{LINE},
2237         }}
2238         ],
2239         [#Rule 21
2240                  'decl_type', 1, undef
2241         ],
2242         [#Rule 22
2243                  'decl_type', 1, undef
2244         ],
2245         [#Rule 23
2246                  'decl_enum', 1,
2247 sub
2248 #line 114 "pidl/idl.yp"
2249 {{
2250                      "TYPE" => "ENUM"
2251         }}
2252         ],
2253         [#Rule 24
2254                  'decl_bitmap', 1,
2255 sub
2256 #line 120 "pidl/idl.yp"
2257 {{
2258                      "TYPE" => "BITMAP"
2259         }}
2260         ],
2261         [#Rule 25
2262                  'typedef', 6,
2263 sub
2264 #line 126 "pidl/idl.yp"
2265 {{
2266                      "TYPE" => "TYPEDEF", 
2267                      "PROPERTIES" => $_[2],
2268                      "NAME" => $_[4],
2269                      "DATA" => $_[3],
2270                      "ARRAY_LEN" => $_[5],
2271                      "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2272                      "LINE" => $_[0]->YYData->{LINE},
2273         }}
2274         ],
2275         [#Rule 26
2276                  'usertype', 1, undef
2277         ],
2278         [#Rule 27
2279                  'usertype', 1, undef
2280         ],
2281         [#Rule 28
2282                  'usertype', 1, undef
2283         ],
2284         [#Rule 29
2285                  'usertype', 1, undef
2286         ],
2287         [#Rule 30
2288                  'typedecl', 2,
2289 sub
2290 #line 139 "pidl/idl.yp"
2291 { $_[1] }
2292         ],
2293         [#Rule 31
2294                  'type', 1, undef
2295         ],
2296         [#Rule 32
2297                  'type', 1, undef
2298         ],
2299         [#Rule 33
2300                  'type', 1,
2301 sub
2302 #line 142 "pidl/idl.yp"
2303 { "void" }
2304         ],
2305         [#Rule 34
2306                  'enum', 5,
2307 sub
2308 #line 146 "pidl/idl.yp"
2309 {{
2310              "TYPE" => "ENUM", 
2311                          "NAME" => $_[2],
2312                      "ELEMENTS" => $_[4]
2313         }}
2314         ],
2315         [#Rule 35
2316                  'enum_elements', 1,
2317 sub
2318 #line 154 "pidl/idl.yp"
2319 { [ $_[1] ] }
2320         ],
2321         [#Rule 36
2322                  'enum_elements', 3,
2323 sub
2324 #line 155 "pidl/idl.yp"
2325 { push(@{$_[1]}, $_[3]); $_[1] }
2326         ],
2327         [#Rule 37
2328                  'enum_element', 1, undef
2329         ],
2330         [#Rule 38
2331                  'enum_element', 3,
2332 sub
2333 #line 159 "pidl/idl.yp"
2334 { "$_[1]$_[2]$_[3]" }
2335         ],
2336         [#Rule 39
2337                  'bitmap', 5,
2338 sub
2339 #line 163 "pidl/idl.yp"
2340 {{
2341              "TYPE" => "BITMAP", 
2342                          "NAME" => $_[2],
2343                      "ELEMENTS" => $_[4]
2344         }}
2345         ],
2346         [#Rule 40
2347                  'bitmap_elements', 1,
2348 sub
2349 #line 171 "pidl/idl.yp"
2350 { [ $_[1] ] }
2351         ],
2352         [#Rule 41
2353                  'bitmap_elements', 3,
2354 sub
2355 #line 172 "pidl/idl.yp"
2356 { push(@{$_[1]}, $_[3]); $_[1] }
2357         ],
2358         [#Rule 42
2359                  'bitmap_element', 3,
2360 sub
2361 #line 175 "pidl/idl.yp"
2362 { "$_[1] ( $_[3] )" }
2363         ],
2364         [#Rule 43
2365                  'struct', 5,
2366 sub
2367 #line 179 "pidl/idl.yp"
2368 {{
2369              "TYPE" => "STRUCT", 
2370                          "NAME" => $_[2],
2371                      "ELEMENTS" => $_[4]
2372         }}
2373         ],
2374         [#Rule 44
2375                  'empty_element', 2,
2376 sub
2377 #line 187 "pidl/idl.yp"
2378 {{
2379                  "NAME" => "",
2380                  "TYPE" => "EMPTY",
2381                  "PROPERTIES" => $_[1],
2382                  "POINTERS" => 0,
2383                  "ARRAY_LEN" => [],
2384                  "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2385                  "LINE" => $_[0]->YYData->{LINE},
2386          }}
2387         ],
2388         [#Rule 45
2389                  'base_or_empty', 2, undef
2390         ],
2391         [#Rule 46
2392                  'base_or_empty', 1, undef
2393         ],
2394         [#Rule 47
2395                  'optional_base_element', 2,
2396 sub
2397 #line 201 "pidl/idl.yp"
2398 { $_[2]->{PROPERTIES} = Parse::Pidl::Util::FlattenHash([$_[1],$_[2]->{PROPERTIES}]); $_[2] }
2399         ],
2400         [#Rule 48
2401                  'union_elements', 0, undef
2402         ],
2403         [#Rule 49
2404                  'union_elements', 2,
2405 sub
2406 #line 206 "pidl/idl.yp"
2407 { push(@{$_[1]}, $_[2]); $_[1] }
2408         ],
2409         [#Rule 50
2410                  'union', 5,
2411 sub
2412 #line 210 "pidl/idl.yp"
2413 {{
2414              "TYPE" => "UNION", 
2415                      "NAME" => $_[2],
2416                      "ELEMENTS" => $_[4]
2417         }}
2418         ],
2419         [#Rule 51
2420                  'base_element', 5,
2421 sub
2422 #line 218 "pidl/idl.yp"
2423 {{
2424                            "NAME" => $_[4],
2425                            "TYPE" => $_[2],
2426                            "PROPERTIES" => $_[1],
2427                            "POINTERS" => $_[3],
2428                            "ARRAY_LEN" => $_[5],
2429                        "FILE" => $_[0]->YYData->{INPUT_FILENAME},
2430                        "LINE" => $_[0]->YYData->{LINE},
2431               }}
2432         ],
2433         [#Rule 52
2434                  'pointers', 0,
2435 sub
2436 #line 232 "pidl/idl.yp"
2437 { 0 }
2438         ],
2439         [#Rule 53
2440                  'pointers', 2,
2441 sub
2442 #line 233 "pidl/idl.yp"
2443 { $_[1]+1 }
2444         ],
2445         [#Rule 54
2446                  'element_list1', 0, undef
2447         ],
2448         [#Rule 55
2449                  'element_list1', 3,
2450 sub
2451 #line 238 "pidl/idl.yp"
2452 { push(@{$_[1]}, $_[2]); $_[1] }
2453         ],
2454         [#Rule 56
2455                  'element_list2', 0, undef
2456         ],
2457         [#Rule 57
2458                  'element_list2', 1, undef
2459         ],
2460         [#Rule 58
2461                  'element_list2', 1,
2462 sub
2463 #line 244 "pidl/idl.yp"
2464 { [ $_[1] ] }
2465         ],
2466         [#Rule 59
2467                  'element_list2', 3,
2468 sub
2469 #line 245 "pidl/idl.yp"
2470 { push(@{$_[1]}, $_[3]); $_[1] }
2471         ],
2472         [#Rule 60
2473                  'array_len', 0, undef
2474         ],
2475         [#Rule 61
2476                  'array_len', 3,
2477 sub
2478 #line 250 "pidl/idl.yp"
2479 { push(@{$_[3]}, "*"); $_[3] }
2480         ],
2481         [#Rule 62
2482                  'array_len', 4,
2483 sub
2484 #line 251 "pidl/idl.yp"
2485 { push(@{$_[4]}, "$_[2]"); $_[4] }
2486         ],
2487         [#Rule 63
2488                  'property_list', 0, undef
2489         ],
2490         [#Rule 64
2491                  'property_list', 4,
2492 sub
2493 #line 257 "pidl/idl.yp"
2494 { Parse::Pidl::Util::FlattenHash([$_[1],$_[3]]); }
2495         ],
2496         [#Rule 65
2497                  'properties', 1,
2498 sub
2499 #line 260 "pidl/idl.yp"
2500 { $_[1] }
2501         ],
2502         [#Rule 66
2503                  'properties', 3,
2504 sub
2505 #line 261 "pidl/idl.yp"
2506 { Parse::Pidl::Util::FlattenHash([$_[1], $_[3]]); }
2507         ],
2508         [#Rule 67
2509                  'property', 1,
2510 sub
2511 #line 264 "pidl/idl.yp"
2512 {{ "$_[1]" => "1"     }}
2513         ],
2514         [#Rule 68
2515                  'property', 4,
2516 sub
2517 #line 265 "pidl/idl.yp"
2518 {{ "$_[1]" => "$_[3]" }}
2519         ],
2520         [#Rule 69
2521                  'listtext', 1, undef
2522         ],
2523         [#Rule 70
2524                  'listtext', 3,
2525 sub
2526 #line 270 "pidl/idl.yp"
2527 { "$_[1] $_[3]" }
2528         ],
2529         [#Rule 71
2530                  'commalisttext', 1, undef
2531         ],
2532         [#Rule 72
2533                  'commalisttext', 3,
2534 sub
2535 #line 275 "pidl/idl.yp"
2536 { "$_[1],$_[3]" }
2537         ],
2538         [#Rule 73
2539                  'anytext', 0,
2540 sub
2541 #line 279 "pidl/idl.yp"
2542 { "" }
2543         ],
2544         [#Rule 74
2545                  'anytext', 1, undef
2546         ],
2547         [#Rule 75
2548                  'anytext', 1, undef
2549         ],
2550         [#Rule 76
2551                  'anytext', 1, undef
2552         ],
2553         [#Rule 77
2554                  'anytext', 3,
2555 sub
2556 #line 281 "pidl/idl.yp"
2557 { "$_[1]$_[2]$_[3]" }
2558         ],
2559         [#Rule 78
2560                  'anytext', 3,
2561 sub
2562 #line 282 "pidl/idl.yp"
2563 { "$_[1]$_[2]$_[3]" }
2564         ],
2565         [#Rule 79
2566                  'anytext', 3,
2567 sub
2568 #line 283 "pidl/idl.yp"
2569 { "$_[1]$_[2]$_[3]" }
2570         ],
2571         [#Rule 80
2572                  'anytext', 3,
2573 sub
2574 #line 284 "pidl/idl.yp"
2575 { "$_[1]$_[2]$_[3]" }
2576         ],
2577         [#Rule 81
2578                  'anytext', 3,
2579 sub
2580 #line 285 "pidl/idl.yp"
2581 { "$_[1]$_[2]$_[3]" }
2582         ],
2583         [#Rule 82
2584                  'anytext', 3,
2585 sub
2586 #line 286 "pidl/idl.yp"
2587 { "$_[1]$_[2]$_[3]" }
2588         ],
2589         [#Rule 83
2590                  'anytext', 3,
2591 sub
2592 #line 287 "pidl/idl.yp"
2593 { "$_[1]$_[2]$_[3]" }
2594         ],
2595         [#Rule 84
2596                  'anytext', 3,
2597 sub
2598 #line 288 "pidl/idl.yp"
2599 { "$_[1]$_[2]$_[3]" }
2600         ],
2601         [#Rule 85
2602                  'anytext', 3,
2603 sub
2604 #line 289 "pidl/idl.yp"
2605 { "$_[1]$_[2]$_[3]" }
2606         ],
2607         [#Rule 86
2608                  'anytext', 3,
2609 sub
2610 #line 290 "pidl/idl.yp"
2611 { "$_[1]$_[2]$_[3]" }
2612         ],
2613         [#Rule 87
2614                  'anytext', 3,
2615 sub
2616 #line 291 "pidl/idl.yp"
2617 { "$_[1]$_[2]$_[3]" }
2618         ],
2619         [#Rule 88
2620                  'anytext', 3,
2621 sub
2622 #line 292 "pidl/idl.yp"
2623 { "$_[1]$_[2]$_[3]" }
2624         ],
2625         [#Rule 89
2626                  'anytext', 3,
2627 sub
2628 #line 293 "pidl/idl.yp"
2629 { "$_[1]$_[2]$_[3]" }
2630         ],
2631         [#Rule 90
2632                  'anytext', 5,
2633 sub
2634 #line 294 "pidl/idl.yp"
2635 { "$_[1]$_[2]$_[3]$_[4]$_[5]" }
2636         ],
2637         [#Rule 91
2638                  'anytext', 5,
2639 sub
2640 #line 295 "pidl/idl.yp"
2641 { "$_[1]$_[2]$_[3]$_[4]$_[5]" }
2642         ],
2643         [#Rule 92
2644                  'identifier', 1, undef
2645         ],
2646         [#Rule 93
2647                  'optional_identifier', 1, undef
2648         ],
2649         [#Rule 94
2650                  'optional_identifier', 0, undef
2651         ],
2652         [#Rule 95
2653                  'constant', 1, undef
2654         ],
2655         [#Rule 96
2656                  'text', 1,
2657 sub
2658 #line 309 "pidl/idl.yp"
2659 { "\"$_[1]\"" }
2660         ],
2661         [#Rule 97
2662                  'optional_semicolon', 0, undef
2663         ],
2664         [#Rule 98
2665                  'optional_semicolon', 1, undef
2666         ]
2667 ],
2668                                   @_);
2669     bless($self,$class);
2670 }
2671
2672 #line 320 "pidl/idl.yp"
2673
2674
2675 use Parse::Pidl::Util;
2676
2677 #####################################################################
2678 # traverse a perl data structure removing any empty arrays or
2679 # hashes and any hash elements that map to undef
2680 sub CleanData($)
2681 {
2682     sub CleanData($);
2683     my($v) = shift;
2684     if (ref($v) eq "ARRAY") {
2685         foreach my $i (0 .. $#{$v}) {
2686             CleanData($v->[$i]);
2687             if (ref($v->[$i]) eq "ARRAY" && $#{$v->[$i]}==-1) { 
2688                     $v->[$i] = undef; 
2689                     next; 
2690             }
2691         }
2692         # this removes any undefined elements from the array
2693         @{$v} = grep { defined $_ } @{$v};
2694     } elsif (ref($v) eq "HASH") {
2695         foreach my $x (keys %{$v}) {
2696             CleanData($v->{$x});
2697             if (!defined $v->{$x}) { delete($v->{$x}); next; }
2698             if (ref($v->{$x}) eq "ARRAY" && $#{$v->{$x}}==-1) { delete($v->{$x}); next; }
2699         }
2700     }
2701         return $v;
2702 }
2703
2704 sub _Error {
2705     if (exists $_[0]->YYData->{ERRMSG}) {
2706                 print $_[0]->YYData->{ERRMSG};
2707                 delete $_[0]->YYData->{ERRMSG};
2708                 return;
2709         };
2710         my $line = $_[0]->YYData->{LINE};
2711         my $last_token = $_[0]->YYData->{LAST_TOKEN};
2712         my $file = $_[0]->YYData->{INPUT_FILENAME};
2713         
2714         print "$file:$line: Syntax error near '$last_token'\n";
2715 }
2716
2717 sub _Lexer($)
2718 {
2719         my($parser)=shift;
2720
2721     $parser->YYData->{INPUT} or return('',undef);
2722
2723 again:
2724         $parser->YYData->{INPUT} =~ s/^[ \t]*//;
2725
2726         for ($parser->YYData->{INPUT}) {
2727                 if (/^\#/) {
2728                         if (s/^\# (\d+) \"(.*?)\"( \d+|)//) {
2729                                 $parser->YYData->{LINE} = $1-1;
2730                                 $parser->YYData->{INPUT_FILENAME} = $2;
2731                                 goto again;
2732                         }
2733                         if (s/^\#line (\d+) \"(.*?)\"( \d+|)//) {
2734                                 $parser->YYData->{LINE} = $1-1;
2735                                 $parser->YYData->{INPUT_FILENAME} = $2;
2736                                 goto again;
2737                         }
2738                         if (s/^(\#.*)$//m) {
2739                                 goto again;
2740                         }
2741                 }
2742                 if (s/^(\n)//) {
2743                         $parser->YYData->{LINE}++;
2744                         goto again;
2745                 }
2746                 if (s/^\"(.*?)\"//) {
2747                         $parser->YYData->{LAST_TOKEN} = $1;
2748                         return('TEXT',$1); 
2749                 }
2750                 if (s/^(\d+)(\W|$)/$2/) {
2751                         $parser->YYData->{LAST_TOKEN} = $1;
2752                         return('CONSTANT',$1); 
2753                 }
2754                 if (s/^([\w_]+)//) {
2755                         $parser->YYData->{LAST_TOKEN} = $1;
2756                         if ($1 =~ 
2757                             /^(coclass|interface|const|typedef|declare|union
2758                               |struct|enum|bitmap|void)$/x) {
2759                                 return $1;
2760                         }
2761                         return('IDENTIFIER',$1);
2762                 }
2763                 if (s/^(.)//s) {
2764                         $parser->YYData->{LAST_TOKEN} = $1;
2765                         return($1,$1);
2766                 }
2767         }
2768 }
2769
2770 sub parse_idl($$)
2771 {
2772         my ($self,$filename) = @_;
2773
2774         my $saved_delim = $/;
2775         undef $/;
2776         my $cpp = $ENV{CPP};
2777         if (! defined $cpp) {
2778                 $cpp = "cpp"
2779         }
2780         my $data = `$cpp -D__PIDL__ -xc $filename`;
2781         $/ = $saved_delim;
2782
2783     $self->YYData->{INPUT} = $data;
2784     $self->YYData->{LINE} = 0;
2785     $self->YYData->{LAST_TOKEN} = "NONE";
2786
2787         my $idl = $self->YYParse( yylex => \&_Lexer, yyerror => \&_Error );
2788
2789         return CleanData($idl);
2790 }
2791
2792 1;