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