r4549: got rid of a lot more uses of plain talloc(), instead using
[Samba/gebeck_regimport.git] / source4 / build / pidl / idl.pm
bloba3e23fcda10b80fed5d41c2ddc11691e2d6788f6
1 ####################################################################
3 # This file was generated using Parse::Yapp version 1.05.
5 # Don't edit this file, use source file instead.
7 # ANY CHANGE MADE HERE WILL BE LOST !
9 ####################################################################
10 package idl;
11 use vars qw ( @ISA );
12 use strict;
14 @ISA= qw ( Parse::Yapp::Driver );
15 #Included Parse/Yapp/Driver.pm file----------------------------------------
18 # Module Parse::Yapp::Driver
20 # This module is part of the Parse::Yapp package available on your
21 # nearest CPAN
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.
26 # This notice should remain unchanged.
28 # (c) Copyright 1998-2001 Francois Desarmenien, all rights reserved.
29 # (see the pod text in Parse::Yapp module for use and distribution rights)
32 package Parse::Yapp::Driver;
34 require 5.004;
36 use strict;
38 use vars qw ( $VERSION $COMPATIBLE $FILENAME );
40 $VERSION = '1.05';
41 $COMPATIBLE = '0.07';
42 $FILENAME=__FILE__;
44 use Carp;
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');
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 };
65 _CheckParams( [], \%params, \@_, $self );
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.";
73 ref($class)
74 and $class=ref($class);
76 bless($self,$class);
79 sub YYParse {
80 my($self)=shift;
81 my($retval);
83 _CheckParams( \@params, \%params, \@_, $self );
85 if($$self{DEBUG}) {
86 _DBLoad();
87 $retval = eval '$self->_DBParse()';#Do not create stab entry on compile
88 $@ and die $@;
90 else {
91 $retval = $self->_Parse();
93 $retval
96 sub YYData {
97 my($self)=shift;
99 exists($$self{USER})
100 or $$self{USER}={};
102 $$self{USER};
106 sub YYErrok {
107 my($self)=shift;
109 ${$$self{ERRST}}=0;
110 undef;
113 sub YYNberr {
114 my($self)=shift;
116 ${$$self{NBERR}};
119 sub YYRecovering {
120 my($self)=shift;
122 ${$$self{ERRST}} != 0;
125 sub YYAbort {
126 my($self)=shift;
128 ${$$self{CHECK}}='ABORT';
129 undef;
132 sub YYAccept {
133 my($self)=shift;
135 ${$$self{CHECK}}='ACCEPT';
136 undef;
139 sub YYError {
140 my($self)=shift;
142 ${$$self{CHECK}}='ERROR';
143 undef;
146 sub YYSemval {
147 my($self)=shift;
148 my($index)= $_[0] - ${$$self{DOTPOS}} - 1;
150 $index < 0
151 and -$index <= @{$$self{STACK}}
152 and return $$self{STACK}[$index][1];
154 undef; #Invalid index
157 sub YYCurtok {
158 my($self)=shift;
161 and ${$$self{TOKEN}}=$_[0];
162 ${$$self{TOKEN}};
165 sub YYCurval {
166 my($self)=shift;
169 and ${$$self{VALUE}}=$_[0];
170 ${$$self{VALUE}};
173 sub YYExpect {
174 my($self)=shift;
176 keys %{$self->{STATES}[$self->{STACK}[-1][0]]{ACTIONS}}
179 sub YYLexer {
180 my($self)=shift;
182 $$self{LEX};
186 #################
187 # Private stuff #
188 #################
191 sub _CheckParams {
192 my($mandatory,$checklist,$inarray,$outhash)=@_;
193 my($prm,$value);
194 my($prmlst)={};
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;
205 for (@$mandatory) {
206 exists($$outhash{$_})
207 or croak("Missing mandatory parameter '".lc($_)."'");
211 sub _Error {
212 print "Parse error.\n";
215 sub _DBLoad {
217 no strict 'refs';
219 exists(${__PACKAGE__.'::'}{_DBParse})#Already loaded ?
220 and return;
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,$_);
232 close(DRV);
234 $drv[0]=~s/_P/_DBP/;
235 eval join('',@drv);
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;
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' };
249 #DBG> my($debug)=$$self{DEBUG};
250 #DBG> my($dbgerror)=0;
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> };
262 $$errstatus=0;
263 $$nberror=0;
264 ($$token,$$value)=(undef,undef);
265 @$stack=( [ 0, undef ] );
266 $$check='';
268 while(1) {
269 my($actions,$act,$stateno);
271 $stateno=$$stack[-1][0];
272 $actions=$$states[$stateno];
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";
283 if (exists($$actions{ACTIONS})) {
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";
292 $act= exists($$actions{ACTIONS}{$$token})
293 ? $$actions{ACTIONS}{$$token}
294 : exists($$actions{DEFAULT})
295 ? $$actions{DEFAULT}
296 : undef;
298 else {
299 $act=$$actions{DEFAULT};
300 #DBG> $debug & 0x01
301 #DBG> and print STDERR "Don't need token.\n";
304 defined($act)
305 and do {
307 $act > 0
308 and do { #shift
310 #DBG> $debug & 0x04
311 #DBG> and print STDERR "Shift and go to state $act.\n";
313 $$errstatus
314 and do {
315 --$$errstatus;
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> };
327 push(@$stack,[ $act, $$value ]);
329 $$token ne '' #Don't eat the eof
330 and $$token=$$value=undef;
331 next;
334 #reduce
335 my($lhs,$len,$code,@sempar,$semval);
336 ($lhs,$len,$code)=@{$$rules[-$act]};
338 #DBG> $debug & 0x04
339 #DBG> and $act
340 #DBG> and print STDERR "Reduce using rule ".-$act." ($lhs,$len): ";
342 $act
343 or $self->YYAccept();
345 $$dotpos=$len;
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;
355 @sempar = $$dotpos
356 ? map { $$_[1] } @$stack[ -$$dotpos .. -1 ]
357 : ();
359 $semval = $code ? &$code( $self, @sempar )
360 : @sempar ? $sempar[0] : undef;
362 splice(@$stack,-$len,$len);
364 $$check eq 'ACCEPT'
365 and do {
367 #DBG> $debug & 0x04
368 #DBG> and print STDERR "Accept.\n";
370 return($semval);
373 $$check eq 'ABORT'
374 and do {
376 #DBG> $debug & 0x04
377 #DBG> and print STDERR "Abort.\n";
379 return(undef);
383 #DBG> $debug & 0x04
384 #DBG> and print STDERR "Back to state $$stack[-1][0], then ";
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";
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> };
400 push(@$stack,
401 [ $$states[$$stack[-1][0]]{GOTOS}{$lhs}, $semval ]);
402 $$check='';
403 next;
406 #DBG> $debug & 0x04
407 #DBG> and print STDERR "Forced Error recovery.\n";
409 $$check='';
413 #Error
414 $$errstatus
415 or do {
417 $$errstatus = 1;
418 &$error($self);
419 $$errstatus # if 0, then YYErrok has been called
420 or next; # so continue parsing
422 #DBG> $debug & 0x10
423 #DBG> and do {
424 #DBG> print STDERR "**Entering Error recovery.\n";
425 #DBG> ++$dbgerror;
426 #DBG> };
428 ++$$nberror;
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);
441 #DBG> $debug & 0x10
442 #DBG> and print STDERR "**Dicard invalid token ".&$ShowCurToken.".\n";
444 $$token=$$value=undef;
447 $$errstatus=3;
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)) {
454 #DBG> $debug & 0x10
455 #DBG> and print STDERR "**Pop state $$stack[-1][0].\n";
457 pop(@$stack);
460 @$stack
461 or do {
463 #DBG> $debug & 0x10
464 #DBG> and print STDERR "**No state left on stack: aborting.\n";
466 return(undef);
469 #shift the error token
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";
476 push(@$stack, [ $$states[$$stack[-1][0]]{ACTIONS}{error}, undef ]);
480 #never reached
481 croak("Error in driver logic. Please, report it as a BUG");
483 }#_Parse
484 #DO NOT remove comment
489 #End of include--------------------------------------------------
494 sub new {
495 my($class)=shift;
496 ref($class)
497 and $class=ref($class);
499 my($self)=$class->SUPER::new( yyversion => '1.05',
500 yystates =>
502 {#State 0
503 DEFAULT => -1,
504 GOTOS => {
505 'idl' => 1
508 {#State 1
509 ACTIONS => {
510 '' => 2
512 DEFAULT => -54,
513 GOTOS => {
514 'interface' => 3,
515 'coclass' => 4,
516 'property_list' => 5
519 {#State 2
520 DEFAULT => 0
522 {#State 3
523 DEFAULT => -2
525 {#State 4
526 DEFAULT => -3
528 {#State 5
529 ACTIONS => {
530 "coclass" => 6,
531 "interface" => 8,
532 "[" => 7
535 {#State 6
536 ACTIONS => {
537 'IDENTIFIER' => 9
539 GOTOS => {
540 'identifier' => 10
543 {#State 7
544 ACTIONS => {
545 'IDENTIFIER' => 9
547 GOTOS => {
548 'identifier' => 11,
549 'properties' => 13,
550 'property' => 12
553 {#State 8
554 ACTIONS => {
555 'IDENTIFIER' => 9
557 GOTOS => {
558 'identifier' => 14
561 {#State 9
562 DEFAULT => -78
564 {#State 10
565 ACTIONS => {
566 "{" => 15
569 {#State 11
570 ACTIONS => {
571 "(" => 16
573 DEFAULT => -58
575 {#State 12
576 DEFAULT => -56
578 {#State 13
579 ACTIONS => {
580 "," => 17,
581 "]" => 18
584 {#State 14
585 ACTIONS => {
586 ":" => 19
588 DEFAULT => -8,
589 GOTOS => {
590 'base_interface' => 20
593 {#State 15
594 DEFAULT => -5,
595 GOTOS => {
596 'interfaces' => 21
599 {#State 16
600 ACTIONS => {
601 'CONSTANT' => 28,
602 'TEXT' => 22,
603 'IDENTIFIER' => 9
605 DEFAULT => -64,
606 GOTOS => {
607 'identifier' => 23,
608 'listtext' => 26,
609 'anytext' => 25,
610 'text' => 24,
611 'constant' => 27
614 {#State 17
615 ACTIONS => {
616 'IDENTIFIER' => 9
618 GOTOS => {
619 'identifier' => 11,
620 'property' => 29
623 {#State 18
624 DEFAULT => -55
626 {#State 19
627 ACTIONS => {
628 'IDENTIFIER' => 9
630 GOTOS => {
631 'identifier' => 30
634 {#State 20
635 ACTIONS => {
636 "{" => 31
639 {#State 21
640 ACTIONS => {
641 "}" => 32
643 DEFAULT => -54,
644 GOTOS => {
645 'interface' => 33,
646 'property_list' => 34
649 {#State 22
650 DEFAULT => -80
652 {#State 23
653 DEFAULT => -65
655 {#State 24
656 DEFAULT => -67
658 {#State 25
659 ACTIONS => {
660 "-" => 35,
661 "+" => 36,
662 "&" => 38,
663 "{" => 37,
664 "/" => 39,
665 "|" => 40,
666 "(" => 41,
667 "*" => 42,
668 "." => 43,
669 ">" => 44
671 DEFAULT => -60
673 {#State 26
674 ACTIONS => {
675 "," => 45,
676 ")" => 46
679 {#State 27
680 DEFAULT => -66
682 {#State 28
683 DEFAULT => -79
685 {#State 29
686 DEFAULT => -57
688 {#State 30
689 DEFAULT => -9
691 {#State 31
692 ACTIONS => {
693 "typedef" => 47,
694 "const" => 53
696 DEFAULT => -54,
697 GOTOS => {
698 'const' => 52,
699 'function' => 48,
700 'typedef' => 54,
701 'definitions' => 49,
702 'definition' => 51,
703 'property_list' => 50
706 {#State 32
707 ACTIONS => {
708 ";" => 56
710 DEFAULT => -81,
711 GOTOS => {
712 'optional_semicolon' => 55
715 {#State 33
716 DEFAULT => -6
718 {#State 34
719 ACTIONS => {
720 "[" => 7,
721 "interface" => 8
724 {#State 35
725 ACTIONS => {
726 'CONSTANT' => 28,
727 'TEXT' => 22,
728 'IDENTIFIER' => 9
730 DEFAULT => -64,
731 GOTOS => {
732 'identifier' => 23,
733 'text' => 24,
734 'anytext' => 57,
735 'constant' => 27
738 {#State 36
739 ACTIONS => {
740 'CONSTANT' => 28,
741 'TEXT' => 22,
742 'IDENTIFIER' => 9
744 DEFAULT => -64,
745 GOTOS => {
746 'identifier' => 23,
747 'text' => 24,
748 'anytext' => 58,
749 'constant' => 27
752 {#State 37
753 ACTIONS => {
754 'CONSTANT' => 28,
755 'TEXT' => 22,
756 'IDENTIFIER' => 9
758 DEFAULT => -64,
759 GOTOS => {
760 'identifier' => 23,
761 'text' => 24,
762 'anytext' => 59,
763 'constant' => 27,
764 'commalisttext' => 60
767 {#State 38
768 ACTIONS => {
769 'CONSTANT' => 28,
770 'TEXT' => 22,
771 'IDENTIFIER' => 9
773 DEFAULT => -64,
774 GOTOS => {
775 'identifier' => 23,
776 'text' => 24,
777 'anytext' => 61,
778 'constant' => 27
781 {#State 39
782 ACTIONS => {
783 'CONSTANT' => 28,
784 'TEXT' => 22,
785 'IDENTIFIER' => 9
787 DEFAULT => -64,
788 GOTOS => {
789 'identifier' => 23,
790 'text' => 24,
791 'anytext' => 62,
792 'constant' => 27
795 {#State 40
796 ACTIONS => {
797 'CONSTANT' => 28,
798 'TEXT' => 22,
799 'IDENTIFIER' => 9
801 DEFAULT => -64,
802 GOTOS => {
803 'identifier' => 23,
804 'text' => 24,
805 'anytext' => 63,
806 'constant' => 27
809 {#State 41
810 ACTIONS => {
811 'CONSTANT' => 28,
812 'TEXT' => 22,
813 'IDENTIFIER' => 9
815 DEFAULT => -64,
816 GOTOS => {
817 'identifier' => 23,
818 'text' => 24,
819 'anytext' => 59,
820 'constant' => 27,
821 'commalisttext' => 64
824 {#State 42
825 ACTIONS => {
826 'CONSTANT' => 28,
827 'TEXT' => 22,
828 'IDENTIFIER' => 9
830 DEFAULT => -64,
831 GOTOS => {
832 'identifier' => 23,
833 'text' => 24,
834 'anytext' => 65,
835 'constant' => 27
838 {#State 43
839 ACTIONS => {
840 'CONSTANT' => 28,
841 'TEXT' => 22,
842 'IDENTIFIER' => 9
844 DEFAULT => -64,
845 GOTOS => {
846 'identifier' => 23,
847 'text' => 24,
848 'anytext' => 66,
849 'constant' => 27
852 {#State 44
853 ACTIONS => {
854 'CONSTANT' => 28,
855 'TEXT' => 22,
856 'IDENTIFIER' => 9
858 DEFAULT => -64,
859 GOTOS => {
860 'identifier' => 23,
861 'text' => 24,
862 'anytext' => 67,
863 'constant' => 27
866 {#State 45
867 ACTIONS => {
868 'CONSTANT' => 28,
869 'TEXT' => 22,
870 'IDENTIFIER' => 9
872 DEFAULT => -64,
873 GOTOS => {
874 'identifier' => 23,
875 'text' => 24,
876 'anytext' => 68,
877 'constant' => 27
880 {#State 46
881 DEFAULT => -59
883 {#State 47
884 DEFAULT => -54,
885 GOTOS => {
886 'property_list' => 69
889 {#State 48
890 DEFAULT => -12
892 {#State 49
893 ACTIONS => {
894 "}" => 70,
895 "typedef" => 47,
896 "const" => 53
898 DEFAULT => -54,
899 GOTOS => {
900 'const' => 52,
901 'function' => 48,
902 'typedef' => 54,
903 'definition' => 71,
904 'property_list' => 50
907 {#State 50
908 ACTIONS => {
909 'IDENTIFIER' => 9,
910 "union" => 72,
911 "enum" => 73,
912 "[" => 7,
913 'void' => 75,
914 "bitmap" => 74,
915 "struct" => 82
917 GOTOS => {
918 'identifier' => 77,
919 'struct' => 78,
920 'enum' => 79,
921 'type' => 80,
922 'union' => 81,
923 'bitmap' => 76
926 {#State 51
927 DEFAULT => -10
929 {#State 52
930 DEFAULT => -13
932 {#State 53
933 ACTIONS => {
934 'IDENTIFIER' => 9
936 GOTOS => {
937 'identifier' => 83
940 {#State 54
941 DEFAULT => -14
943 {#State 55
944 DEFAULT => -4
946 {#State 56
947 DEFAULT => -82
949 {#State 57
950 ACTIONS => {
951 "{" => 37
953 DEFAULT => -68
955 {#State 58
956 ACTIONS => {
957 "{" => 37
959 DEFAULT => -75
961 {#State 59
962 ACTIONS => {
963 "-" => 35,
964 "+" => 36,
965 "&" => 38,
966 "{" => 37,
967 "/" => 39,
968 "(" => 41,
969 "|" => 40,
970 "*" => 42,
971 "." => 43,
972 ">" => 44
974 DEFAULT => -62
976 {#State 60
977 ACTIONS => {
978 "}" => 84,
979 "," => 85
982 {#State 61
983 ACTIONS => {
984 "{" => 37
986 DEFAULT => -73
988 {#State 62
989 ACTIONS => {
990 "{" => 37
992 DEFAULT => -74
994 {#State 63
995 ACTIONS => {
996 "{" => 37
998 DEFAULT => -72
1000 {#State 64
1001 ACTIONS => {
1002 "," => 85,
1003 ")" => 86
1006 {#State 65
1007 ACTIONS => {
1008 "{" => 37
1010 DEFAULT => -70
1012 {#State 66
1013 ACTIONS => {
1014 "{" => 37
1016 DEFAULT => -69
1018 {#State 67
1019 ACTIONS => {
1020 "{" => 37
1022 DEFAULT => -71
1024 {#State 68
1025 ACTIONS => {
1026 "-" => 35,
1027 "+" => 36,
1028 "&" => 38,
1029 "{" => 37,
1030 "/" => 39,
1031 "(" => 41,
1032 "|" => 40,
1033 "*" => 42,
1034 "." => 43,
1035 ">" => 44
1037 DEFAULT => -61
1039 {#State 69
1040 ACTIONS => {
1041 'IDENTIFIER' => 9,
1042 "union" => 72,
1043 "enum" => 73,
1044 "[" => 7,
1045 'void' => 75,
1046 "bitmap" => 74,
1047 "struct" => 82
1049 GOTOS => {
1050 'identifier' => 77,
1051 'struct' => 78,
1052 'enum' => 79,
1053 'type' => 87,
1054 'union' => 81,
1055 'bitmap' => 76
1058 {#State 70
1059 ACTIONS => {
1060 ";" => 56
1062 DEFAULT => -81,
1063 GOTOS => {
1064 'optional_semicolon' => 88
1067 {#State 71
1068 DEFAULT => -11
1070 {#State 72
1071 ACTIONS => {
1072 "{" => 89
1075 {#State 73
1076 ACTIONS => {
1077 "{" => 90
1080 {#State 74
1081 ACTIONS => {
1082 "{" => 91
1085 {#State 75
1086 DEFAULT => -24
1088 {#State 76
1089 DEFAULT => -22
1091 {#State 77
1092 DEFAULT => -23
1094 {#State 78
1095 DEFAULT => -19
1097 {#State 79
1098 DEFAULT => -21
1100 {#State 80
1101 ACTIONS => {
1102 'IDENTIFIER' => 9
1104 GOTOS => {
1105 'identifier' => 92
1108 {#State 81
1109 DEFAULT => -20
1111 {#State 82
1112 ACTIONS => {
1113 "{" => 93
1116 {#State 83
1117 ACTIONS => {
1118 'IDENTIFIER' => 9
1120 GOTOS => {
1121 'identifier' => 94
1124 {#State 84
1125 ACTIONS => {
1126 'CONSTANT' => 28,
1127 'TEXT' => 22,
1128 'IDENTIFIER' => 9
1130 DEFAULT => -64,
1131 GOTOS => {
1132 'identifier' => 23,
1133 'text' => 24,
1134 'anytext' => 95,
1135 'constant' => 27
1138 {#State 85
1139 ACTIONS => {
1140 'CONSTANT' => 28,
1141 'TEXT' => 22,
1142 'IDENTIFIER' => 9
1144 DEFAULT => -64,
1145 GOTOS => {
1146 'identifier' => 23,
1147 'text' => 24,
1148 'anytext' => 96,
1149 'constant' => 27
1152 {#State 86
1153 ACTIONS => {
1154 'CONSTANT' => 28,
1155 'TEXT' => 22,
1156 'IDENTIFIER' => 9
1158 DEFAULT => -64,
1159 GOTOS => {
1160 'identifier' => 23,
1161 'text' => 24,
1162 'anytext' => 97,
1163 'constant' => 27
1166 {#State 87
1167 ACTIONS => {
1168 'IDENTIFIER' => 9
1170 GOTOS => {
1171 'identifier' => 98
1174 {#State 88
1175 DEFAULT => -7
1177 {#State 89
1178 ACTIONS => {
1179 "[" => 101
1181 GOTOS => {
1182 'union_elements' => 99,
1183 'union_element' => 100
1186 {#State 90
1187 ACTIONS => {
1188 'IDENTIFIER' => 9
1190 GOTOS => {
1191 'identifier' => 102,
1192 'enum_element' => 103,
1193 'enum_elements' => 104
1196 {#State 91
1197 ACTIONS => {
1198 'IDENTIFIER' => 9
1200 GOTOS => {
1201 'identifier' => 107,
1202 'bitmap_elements' => 106,
1203 'bitmap_element' => 105
1206 {#State 92
1207 ACTIONS => {
1208 "(" => 108
1211 {#State 93
1212 DEFAULT => -45,
1213 GOTOS => {
1214 'element_list1' => 109
1217 {#State 94
1218 ACTIONS => {
1219 "[" => 112,
1220 "=" => 111
1222 GOTOS => {
1223 'array_len' => 110
1226 {#State 95
1227 ACTIONS => {
1228 "-" => 35,
1229 "+" => 36,
1230 "*" => 42,
1231 "{" => 37,
1232 "&" => 38,
1233 "/" => 39,
1234 "|" => 40,
1235 "(" => 41,
1236 "." => 43,
1237 ">" => 44
1239 DEFAULT => -77
1241 {#State 96
1242 ACTIONS => {
1243 "-" => 35,
1244 "+" => 36,
1245 "&" => 38,
1246 "{" => 37,
1247 "/" => 39,
1248 "(" => 41,
1249 "|" => 40,
1250 "*" => 42,
1251 "." => 43,
1252 ">" => 44
1254 DEFAULT => -63
1256 {#State 97
1257 ACTIONS => {
1258 "{" => 37
1260 DEFAULT => -76
1262 {#State 98
1263 ACTIONS => {
1264 "[" => 112
1266 DEFAULT => -51,
1267 GOTOS => {
1268 'array_len' => 113
1271 {#State 99
1272 ACTIONS => {
1273 "}" => 114,
1274 "[" => 101
1276 GOTOS => {
1277 'union_element' => 115
1280 {#State 100
1281 DEFAULT => -36
1283 {#State 101
1284 ACTIONS => {
1285 "case" => 116,
1286 "default" => 117
1289 {#State 102
1290 ACTIONS => {
1291 "=" => 118
1293 DEFAULT => -28
1295 {#State 103
1296 DEFAULT => -26
1298 {#State 104
1299 ACTIONS => {
1300 "}" => 119,
1301 "," => 120
1304 {#State 105
1305 DEFAULT => -31
1307 {#State 106
1308 ACTIONS => {
1309 "}" => 121,
1310 "," => 122
1313 {#State 107
1314 ACTIONS => {
1315 "=" => 123
1318 {#State 108
1319 ACTIONS => {
1320 "," => -47,
1321 "void" => 126,
1322 ")" => -47
1324 DEFAULT => -54,
1325 GOTOS => {
1326 'base_element' => 124,
1327 'element_list2' => 127,
1328 'property_list' => 125
1331 {#State 109
1332 ACTIONS => {
1333 "}" => 128
1335 DEFAULT => -54,
1336 GOTOS => {
1337 'base_element' => 129,
1338 'property_list' => 125
1341 {#State 110
1342 ACTIONS => {
1343 "=" => 130
1346 {#State 111
1347 ACTIONS => {
1348 'IDENTIFIER' => 9,
1349 'CONSTANT' => 28,
1350 'TEXT' => 22
1352 DEFAULT => -64,
1353 GOTOS => {
1354 'identifier' => 23,
1355 'text' => 24,
1356 'anytext' => 131,
1357 'constant' => 27
1360 {#State 112
1361 ACTIONS => {
1362 'IDENTIFIER' => 9,
1363 'CONSTANT' => 28,
1364 'TEXT' => 22,
1365 "]" => 133
1367 DEFAULT => -64,
1368 GOTOS => {
1369 'identifier' => 23,
1370 'text' => 24,
1371 'anytext' => 132,
1372 'constant' => 27
1375 {#State 113
1376 ACTIONS => {
1377 ";" => 134
1380 {#State 114
1381 DEFAULT => -35
1383 {#State 115
1384 DEFAULT => -37
1386 {#State 116
1387 ACTIONS => {
1388 "(" => 135
1391 {#State 117
1392 ACTIONS => {
1393 "]" => 136
1396 {#State 118
1397 ACTIONS => {
1398 'CONSTANT' => 28,
1399 'TEXT' => 22,
1400 'IDENTIFIER' => 9
1402 DEFAULT => -64,
1403 GOTOS => {
1404 'identifier' => 23,
1405 'text' => 24,
1406 'anytext' => 137,
1407 'constant' => 27
1410 {#State 119
1411 DEFAULT => -25
1413 {#State 120
1414 ACTIONS => {
1415 'IDENTIFIER' => 9
1417 GOTOS => {
1418 'identifier' => 102,
1419 'enum_element' => 138
1422 {#State 121
1423 DEFAULT => -30
1425 {#State 122
1426 ACTIONS => {
1427 'IDENTIFIER' => 9
1429 GOTOS => {
1430 'identifier' => 107,
1431 'bitmap_element' => 139
1434 {#State 123
1435 ACTIONS => {
1436 'CONSTANT' => 28,
1437 'TEXT' => 22,
1438 'IDENTIFIER' => 9
1440 DEFAULT => -64,
1441 GOTOS => {
1442 'identifier' => 23,
1443 'text' => 24,
1444 'anytext' => 140,
1445 'constant' => 27
1448 {#State 124
1449 DEFAULT => -49
1451 {#State 125
1452 ACTIONS => {
1453 'IDENTIFIER' => 9,
1454 "union" => 72,
1455 "enum" => 73,
1456 "[" => 7,
1457 'void' => 75,
1458 "bitmap" => 74,
1459 "struct" => 82
1461 GOTOS => {
1462 'identifier' => 77,
1463 'struct' => 78,
1464 'enum' => 79,
1465 'type' => 141,
1466 'union' => 81,
1467 'bitmap' => 76
1470 {#State 126
1471 DEFAULT => -48
1473 {#State 127
1474 ACTIONS => {
1475 "," => 142,
1476 ")" => 143
1479 {#State 128
1480 DEFAULT => -34
1482 {#State 129
1483 ACTIONS => {
1484 ";" => 144
1487 {#State 130
1488 ACTIONS => {
1489 'IDENTIFIER' => 9,
1490 'CONSTANT' => 28,
1491 'TEXT' => 22
1493 DEFAULT => -64,
1494 GOTOS => {
1495 'identifier' => 23,
1496 'text' => 24,
1497 'anytext' => 145,
1498 'constant' => 27
1501 {#State 131
1502 ACTIONS => {
1503 "-" => 35,
1504 ";" => 146,
1505 "+" => 36,
1506 "&" => 38,
1507 "{" => 37,
1508 "/" => 39,
1509 "(" => 41,
1510 "|" => 40,
1511 "*" => 42,
1512 "." => 43,
1513 ">" => 44
1516 {#State 132
1517 ACTIONS => {
1518 "-" => 35,
1519 "+" => 36,
1520 "&" => 38,
1521 "{" => 37,
1522 "/" => 39,
1523 "(" => 41,
1524 "|" => 40,
1525 "*" => 42,
1526 "." => 43,
1527 "]" => 147,
1528 ">" => 44
1531 {#State 133
1532 DEFAULT => -52
1534 {#State 134
1535 DEFAULT => -18
1537 {#State 135
1538 ACTIONS => {
1539 'IDENTIFIER' => 9,
1540 'CONSTANT' => 28,
1541 'TEXT' => 22
1543 DEFAULT => -64,
1544 GOTOS => {
1545 'identifier' => 23,
1546 'text' => 24,
1547 'anytext' => 148,
1548 'constant' => 27
1551 {#State 136
1552 ACTIONS => {
1553 ";" => 149
1555 DEFAULT => -54,
1556 GOTOS => {
1557 'base_element' => 150,
1558 'property_list' => 125
1561 {#State 137
1562 ACTIONS => {
1563 "-" => 35,
1564 "+" => 36,
1565 "&" => 38,
1566 "{" => 37,
1567 "/" => 39,
1568 "(" => 41,
1569 "|" => 40,
1570 "*" => 42,
1571 "." => 43,
1572 ">" => 44
1574 DEFAULT => -29
1576 {#State 138
1577 DEFAULT => -27
1579 {#State 139
1580 DEFAULT => -32
1582 {#State 140
1583 ACTIONS => {
1584 "-" => 35,
1585 "+" => 36,
1586 "&" => 38,
1587 "{" => 37,
1588 "/" => 39,
1589 "(" => 41,
1590 "|" => 40,
1591 "*" => 42,
1592 "." => 43,
1593 ">" => 44
1595 DEFAULT => -33
1597 {#State 141
1598 DEFAULT => -43,
1599 GOTOS => {
1600 'pointers' => 151
1603 {#State 142
1604 DEFAULT => -54,
1605 GOTOS => {
1606 'base_element' => 152,
1607 'property_list' => 125
1610 {#State 143
1611 ACTIONS => {
1612 ";" => 153
1615 {#State 144
1616 DEFAULT => -46
1618 {#State 145
1619 ACTIONS => {
1620 "-" => 35,
1621 ";" => 154,
1622 "+" => 36,
1623 "&" => 38,
1624 "{" => 37,
1625 "/" => 39,
1626 "(" => 41,
1627 "|" => 40,
1628 "*" => 42,
1629 "." => 43,
1630 ">" => 44
1633 {#State 146
1634 DEFAULT => -15
1636 {#State 147
1637 DEFAULT => -53
1639 {#State 148
1640 ACTIONS => {
1641 "-" => 35,
1642 "+" => 36,
1643 "&" => 38,
1644 "{" => 37,
1645 "/" => 39,
1646 "(" => 41,
1647 "|" => 40,
1648 "*" => 42,
1649 "." => 43,
1650 ")" => 155,
1651 ">" => 44
1654 {#State 149
1655 DEFAULT => -41
1657 {#State 150
1658 ACTIONS => {
1659 ";" => 156
1662 {#State 151
1663 ACTIONS => {
1664 'IDENTIFIER' => 9,
1665 "*" => 158
1667 GOTOS => {
1668 'identifier' => 157
1671 {#State 152
1672 DEFAULT => -50
1674 {#State 153
1675 DEFAULT => -17
1677 {#State 154
1678 DEFAULT => -16
1680 {#State 155
1681 ACTIONS => {
1682 "]" => 159
1685 {#State 156
1686 DEFAULT => -40
1688 {#State 157
1689 ACTIONS => {
1690 "[" => 112
1692 DEFAULT => -51,
1693 GOTOS => {
1694 'array_len' => 160
1697 {#State 158
1698 DEFAULT => -44
1700 {#State 159
1701 ACTIONS => {
1702 ";" => 161
1704 DEFAULT => -54,
1705 GOTOS => {
1706 'base_element' => 162,
1707 'property_list' => 125
1710 {#State 160
1711 DEFAULT => -42
1713 {#State 161
1714 DEFAULT => -39
1716 {#State 162
1717 ACTIONS => {
1718 ";" => 163
1721 {#State 163
1722 DEFAULT => -38
1725 yyrules =>
1727 [#Rule 0
1728 '$start', 2, undef
1730 [#Rule 1
1731 'idl', 0, undef
1733 [#Rule 2
1734 'idl', 2,
1736 #line 19 "build/pidl/idl.yp"
1737 { push(@{$_[1]}, $_[2]); $_[1] }
1739 [#Rule 3
1740 'idl', 2,
1742 #line 20 "build/pidl/idl.yp"
1743 { push(@{$_[1]}, $_[2]); $_[1] }
1745 [#Rule 4
1746 'coclass', 7,
1748 #line 24 "build/pidl/idl.yp"
1749 {$_[3] => {
1750 "TYPE" => "COCLASS",
1751 "PROPERTIES" => $_[1],
1752 "NAME" => $_[3],
1753 "DATA" => $_[5],
1756 [#Rule 5
1757 'interfaces', 0, undef
1759 [#Rule 6
1760 'interfaces', 2,
1762 #line 34 "build/pidl/idl.yp"
1763 { push(@{$_[1]}, $_[2]); $_[1] }
1765 [#Rule 7
1766 'interface', 8,
1768 #line 38 "build/pidl/idl.yp"
1769 {$_[3] => {
1770 "TYPE" => "INTERFACE",
1771 "PROPERTIES" => $_[1],
1772 "NAME" => $_[3],
1773 "BASE" => $_[4],
1774 "DATA" => $_[6],
1777 [#Rule 8
1778 'base_interface', 0, undef
1780 [#Rule 9
1781 'base_interface', 2,
1783 #line 49 "build/pidl/idl.yp"
1784 { $_[2] }
1786 [#Rule 10
1787 'definitions', 1,
1789 #line 53 "build/pidl/idl.yp"
1790 { [ $_[1] ] }
1792 [#Rule 11
1793 'definitions', 2,
1795 #line 54 "build/pidl/idl.yp"
1796 { push(@{$_[1]}, $_[2]); $_[1] }
1798 [#Rule 12
1799 'definition', 1, undef
1801 [#Rule 13
1802 'definition', 1, undef
1804 [#Rule 14
1805 'definition', 1, undef
1807 [#Rule 15
1808 'const', 6,
1810 #line 62 "build/pidl/idl.yp"
1812 "TYPE" => "CONST",
1813 "DTYPE" => $_[2],
1814 "NAME" => $_[3],
1815 "VALUE" => $_[5]
1818 [#Rule 16
1819 'const', 7,
1821 #line 69 "build/pidl/idl.yp"
1823 "TYPE" => "CONST",
1824 "DTYPE" => $_[2],
1825 "NAME" => $_[3],
1826 "ARRAY_LEN" => $_[4],
1827 "VALUE" => $_[6],
1830 [#Rule 17
1831 'function', 7,
1833 #line 80 "build/pidl/idl.yp"
1835 "TYPE" => "FUNCTION",
1836 "NAME" => $_[3],
1837 "RETURN_TYPE" => $_[2],
1838 "PROPERTIES" => $_[1],
1839 "DATA" => $_[5]
1842 [#Rule 18
1843 'typedef', 6,
1845 #line 90 "build/pidl/idl.yp"
1847 "TYPE" => "TYPEDEF",
1848 "PROPERTIES" => $_[2],
1849 "NAME" => $_[4],
1850 "DATA" => $_[3],
1851 "ARRAY_LEN" => $_[5]
1854 [#Rule 19
1855 'type', 1, undef
1857 [#Rule 20
1858 'type', 1, undef
1860 [#Rule 21
1861 'type', 1, undef
1863 [#Rule 22
1864 'type', 1, undef
1866 [#Rule 23
1867 'type', 1, undef
1869 [#Rule 24
1870 'type', 1,
1872 #line 100 "build/pidl/idl.yp"
1873 { "void" }
1875 [#Rule 25
1876 'enum', 4,
1878 #line 105 "build/pidl/idl.yp"
1880 "TYPE" => "ENUM",
1881 "ELEMENTS" => $_[3]
1884 [#Rule 26
1885 'enum_elements', 1,
1887 #line 112 "build/pidl/idl.yp"
1888 { [ $_[1] ] }
1890 [#Rule 27
1891 'enum_elements', 3,
1893 #line 113 "build/pidl/idl.yp"
1894 { push(@{$_[1]}, $_[3]); $_[1] }
1896 [#Rule 28
1897 'enum_element', 1, undef
1899 [#Rule 29
1900 'enum_element', 3,
1902 #line 117 "build/pidl/idl.yp"
1903 { "$_[1]$_[2]$_[3]" }
1905 [#Rule 30
1906 'bitmap', 4,
1908 #line 121 "build/pidl/idl.yp"
1910 "TYPE" => "BITMAP",
1911 "ELEMENTS" => $_[3]
1914 [#Rule 31
1915 'bitmap_elements', 1,
1917 #line 128 "build/pidl/idl.yp"
1918 { [ $_[1] ] }
1920 [#Rule 32
1921 'bitmap_elements', 3,
1923 #line 129 "build/pidl/idl.yp"
1924 { push(@{$_[1]}, $_[3]); $_[1] }
1926 [#Rule 33
1927 'bitmap_element', 3,
1929 #line 132 "build/pidl/idl.yp"
1930 { "$_[1] ( $_[3] )" }
1932 [#Rule 34
1933 'struct', 4,
1935 #line 136 "build/pidl/idl.yp"
1937 "TYPE" => "STRUCT",
1938 "ELEMENTS" => $_[3]
1941 [#Rule 35
1942 'union', 4,
1944 #line 143 "build/pidl/idl.yp"
1946 "TYPE" => "UNION",
1947 "DATA" => $_[3]
1950 [#Rule 36
1951 'union_elements', 1,
1953 #line 150 "build/pidl/idl.yp"
1954 { [ $_[1] ] }
1956 [#Rule 37
1957 'union_elements', 2,
1959 #line 151 "build/pidl/idl.yp"
1960 { push(@{$_[1]}, $_[2]); $_[1] }
1962 [#Rule 38
1963 'union_element', 8,
1965 #line 156 "build/pidl/idl.yp"
1967 "TYPE" => "UNION_ELEMENT",
1968 "CASE" => $_[4],
1969 "DATA" => $_[7]
1972 [#Rule 39
1973 'union_element', 7,
1975 #line 162 "build/pidl/idl.yp"
1977 "TYPE" => "EMPTY",
1978 "CASE" => $_[4],
1981 [#Rule 40
1982 'union_element', 5,
1984 #line 167 "build/pidl/idl.yp"
1986 "TYPE" => "UNION_ELEMENT",
1987 "CASE" => "default",
1988 "DATA" => $_[4]
1991 [#Rule 41
1992 'union_element', 4,
1994 #line 173 "build/pidl/idl.yp"
1996 "TYPE" => "EMPTY",
1997 "CASE" => "default",
2000 [#Rule 42
2001 'base_element', 5,
2003 #line 180 "build/pidl/idl.yp"
2005 "NAME" => $_[4],
2006 "TYPE" => $_[2],
2007 "PROPERTIES" => $_[1],
2008 "POINTERS" => $_[3],
2009 "ARRAY_LEN" => $_[5]
2012 [#Rule 43
2013 'pointers', 0,
2015 #line 192 "build/pidl/idl.yp"
2016 { 0 }
2018 [#Rule 44
2019 'pointers', 2,
2021 #line 193 "build/pidl/idl.yp"
2022 { $_[1]+1 }
2024 [#Rule 45
2025 'element_list1', 0, undef
2027 [#Rule 46
2028 'element_list1', 3,
2030 #line 200 "build/pidl/idl.yp"
2031 { push(@{$_[1]}, $_[2]); $_[1] }
2033 [#Rule 47
2034 'element_list2', 0, undef
2036 [#Rule 48
2037 'element_list2', 1, undef
2039 [#Rule 49
2040 'element_list2', 1,
2042 #line 206 "build/pidl/idl.yp"
2043 { [ $_[1] ] }
2045 [#Rule 50
2046 'element_list2', 3,
2048 #line 207 "build/pidl/idl.yp"
2049 { push(@{$_[1]}, $_[3]); $_[1] }
2051 [#Rule 51
2052 'array_len', 0, undef
2054 [#Rule 52
2055 'array_len', 2,
2057 #line 212 "build/pidl/idl.yp"
2058 { "*" }
2060 [#Rule 53
2061 'array_len', 3,
2063 #line 213 "build/pidl/idl.yp"
2064 { "$_[2]" }
2066 [#Rule 54
2067 'property_list', 0, undef
2069 [#Rule 55
2070 'property_list', 4,
2072 #line 219 "build/pidl/idl.yp"
2073 { util::FlattenHash([$_[1],$_[3]]); }
2075 [#Rule 56
2076 'properties', 1,
2078 #line 222 "build/pidl/idl.yp"
2079 { $_[1] }
2081 [#Rule 57
2082 'properties', 3,
2084 #line 223 "build/pidl/idl.yp"
2085 { util::FlattenHash([$_[1], $_[3]]); }
2087 [#Rule 58
2088 'property', 1,
2090 #line 226 "build/pidl/idl.yp"
2091 {{ "$_[1]" => "1" }}
2093 [#Rule 59
2094 'property', 4,
2096 #line 227 "build/pidl/idl.yp"
2097 {{ "$_[1]" => "$_[3]" }}
2099 [#Rule 60
2100 'listtext', 1, undef
2102 [#Rule 61
2103 'listtext', 3,
2105 #line 232 "build/pidl/idl.yp"
2106 { "$_[1] $_[3]" }
2108 [#Rule 62
2109 'commalisttext', 1, undef
2111 [#Rule 63
2112 'commalisttext', 3,
2114 #line 237 "build/pidl/idl.yp"
2115 { "$_[1],$_[3]" }
2117 [#Rule 64
2118 'anytext', 0,
2120 #line 241 "build/pidl/idl.yp"
2121 { "" }
2123 [#Rule 65
2124 'anytext', 1, undef
2126 [#Rule 66
2127 'anytext', 1, undef
2129 [#Rule 67
2130 'anytext', 1, undef
2132 [#Rule 68
2133 'anytext', 3,
2135 #line 243 "build/pidl/idl.yp"
2136 { "$_[1]$_[2]$_[3]" }
2138 [#Rule 69
2139 'anytext', 3,
2141 #line 244 "build/pidl/idl.yp"
2142 { "$_[1]$_[2]$_[3]" }
2144 [#Rule 70
2145 'anytext', 3,
2147 #line 245 "build/pidl/idl.yp"
2148 { "$_[1]$_[2]$_[3]" }
2150 [#Rule 71
2151 'anytext', 3,
2153 #line 246 "build/pidl/idl.yp"
2154 { "$_[1]$_[2]$_[3]" }
2156 [#Rule 72
2157 'anytext', 3,
2159 #line 247 "build/pidl/idl.yp"
2160 { "$_[1]$_[2]$_[3]" }
2162 [#Rule 73
2163 'anytext', 3,
2165 #line 248 "build/pidl/idl.yp"
2166 { "$_[1]$_[2]$_[3]" }
2168 [#Rule 74
2169 'anytext', 3,
2171 #line 249 "build/pidl/idl.yp"
2172 { "$_[1]$_[2]$_[3]" }
2174 [#Rule 75
2175 'anytext', 3,
2177 #line 250 "build/pidl/idl.yp"
2178 { "$_[1]$_[2]$_[3]" }
2180 [#Rule 76
2181 'anytext', 5,
2183 #line 251 "build/pidl/idl.yp"
2184 { "$_[1]$_[2]$_[3]$_[4]$_[5]" }
2186 [#Rule 77
2187 'anytext', 5,
2189 #line 252 "build/pidl/idl.yp"
2190 { "$_[1]$_[2]$_[3]$_[4]$_[5]" }
2192 [#Rule 78
2193 'identifier', 1, undef
2195 [#Rule 79
2196 'constant', 1, undef
2198 [#Rule 80
2199 'text', 1,
2201 #line 261 "build/pidl/idl.yp"
2202 { "\"$_[1]\"" }
2204 [#Rule 81
2205 'optional_semicolon', 0, undef
2207 [#Rule 82
2208 'optional_semicolon', 1, undef
2211 @_);
2212 bless($self,$class);
2215 #line 272 "build/pidl/idl.yp"
2218 use util;
2220 sub _Error {
2221 if (exists $_[0]->YYData->{ERRMSG}) {
2222 print $_[0]->YYData->{ERRMSG};
2223 delete $_[0]->YYData->{ERRMSG};
2224 return;
2226 my $line = $_[0]->YYData->{LINE};
2227 my $last_token = $_[0]->YYData->{LAST_TOKEN};
2228 my $file = $_[0]->YYData->{INPUT_FILENAME};
2230 print "$file:$line: Syntax error near '$last_token'\n";
2233 sub _Lexer($)
2235 my($parser)=shift;
2237 $parser->YYData->{INPUT}
2238 or return('',undef);
2240 again:
2241 $parser->YYData->{INPUT} =~ s/^[ \t]*//;
2243 for ($parser->YYData->{INPUT}) {
2244 if (/^\#/) {
2245 if (s/^\# (\d+) \"(.*?)\"( \d+|)//) {
2246 $parser->YYData->{LINE} = $1-1;
2247 $parser->YYData->{INPUT_FILENAME} = $2;
2248 goto again;
2250 if (s/^\#line (\d+) \"(.*?)\"( \d+|)//) {
2251 $parser->YYData->{LINE} = $1-1;
2252 $parser->YYData->{INPUT_FILENAME} = $2;
2253 goto again;
2255 if (s/^(\#.*)$//m) {
2256 goto again;
2259 if (s/^(\n)//) {
2260 $parser->YYData->{LINE}++;
2261 goto again;
2263 if (s/^\"(.*?)\"//) {
2264 $parser->YYData->{LAST_TOKEN} = $1;
2265 return('TEXT',$1);
2267 if (s/^(\d+)(\W|$)/$2/) {
2268 $parser->YYData->{LAST_TOKEN} = $1;
2269 return('CONSTANT',$1);
2271 if (s/^([\w_]+)//) {
2272 $parser->YYData->{LAST_TOKEN} = $1;
2273 if ($1 =~
2274 /^(coclass|interface|const|typedef|union
2275 |struct|enum|bitmap|void|case|default)$/x) {
2276 return $1;
2278 return('IDENTIFIER',$1);
2280 if (s/^(.)//s) {
2281 $parser->YYData->{LAST_TOKEN} = $1;
2282 return($1,$1);
2287 sub parse_idl($$)
2289 my $self = shift;
2290 my $filename = shift;
2292 my $saved_delim = $/;
2293 undef $/;
2294 my $cpp = $ENV{CPP};
2295 if (! defined $cpp) {
2296 $cpp = "cpp"
2298 my $data = `$cpp -xc $filename`;
2299 $/ = $saved_delim;
2301 $self->YYData->{INPUT} = $data;
2302 $self->YYData->{LINE} = 0;
2303 $self->YYData->{LAST_TOKEN} = "NONE";
2305 my $idl = $self->YYParse( yylex => \&_Lexer, yyerror => \&_Error );
2307 foreach my $x (@{$idl}) {
2308 # Add [in] ORPCTHIS *this, [out] ORPCTHAT *that
2309 # for 'object' interfaces
2310 if (defined($x->{PROPERTIES}->{object})) {
2311 foreach my $e (@{$x->{DATA}}) {
2312 if($e->{TYPE} eq "FUNCTION") {
2313 $e->{PROPERTIES}->{object} = 1;
2314 unshift(@{$e->{DATA}},
2315 { 'NAME' => 'ORPCthis',
2316 'POINTERS' => 0,
2317 'PROPERTIES' => { 'in' => '1' },
2318 'TYPE' => 'ORPCTHIS'
2320 unshift(@{$e->{DATA}},
2321 { 'NAME' => 'ORPCthat',
2322 'POINTERS' => 0,
2323 'PROPERTIES' => { 'out' => '1' },
2324 'TYPE' => 'ORPCTHAT'
2330 # Do the inheritance
2331 if (defined($x->{BASE}) and $x->{BASE} ne "") {
2332 my $parent = util::get_interface($idl, $x->{BASE});
2334 if(not defined($parent)) {
2335 die("No such parent interface " . $x->{BASE});
2338 @{$x->{INHERITED_DATA}} = (@{$parent->{INHERITED_DATA}}, @{$x->{DATA}});
2339 } else {
2340 $x->{INHERITED_DATA} = $x->{DATA};
2344 return $idl;