From 4d656cb5a52bb48fb29b8c546bd33f7a446b0fbf Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 24 Jan 2008 14:57:30 +0100 Subject: pidl/Samba4::Header: we don't need to check if (defined($enum->{ELEMENTS})) twice metze (This used to be commit c1ac13ee12d6d7e41b3700f207c9a8811bb05cd4) --- source4/pidl/lib/Parse/Pidl/Samba4/Header.pm | 38 +++++++++++++--------------- 1 file changed, 18 insertions(+), 20 deletions(-) (limited to 'source4/pidl/lib/Parse/Pidl') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm index 2b3a9df80f..b2d5126d1d 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm @@ -131,27 +131,25 @@ sub HeaderEnum($$) my $count = 0; my $with_val = 0; my $without_val = 0; - if (defined($enum->{ELEMENTS})) { - pidl " { __donnot_use_enum_$name=0x7FFFFFFF}\n"; - foreach my $e (@{$enum->{ELEMENTS}}) { - my $t = "$e"; - my $name; - my $value; - if ($t =~ /(.*)=(.*)/) { - $name = $1; - $value = $2; - $with_val = 1; - fatal($e->{ORIGINAL}, "you can't mix enum member with values and without values!") - unless ($without_val == 0); - } else { - $name = $t; - $value = $count++; - $without_val = 1; - fatal($e->{ORIGINAL}, "you can't mix enum member with values and without values!") - unless ($with_val == 0); - } - pidl "#define $name ( $value )\n"; + pidl " { __donnot_use_enum_$name=0x7FFFFFFF}\n"; + foreach my $e (@{$enum->{ELEMENTS}}) { + my $t = "$e"; + my $name; + my $value; + if ($t =~ /(.*)=(.*)/) { + $name = $1; + $value = $2; + $with_val = 1; + fatal($e->{ORIGINAL}, "you can't mix enum member with values and without values!") + unless ($without_val == 0); + } else { + $name = $t; + $value = $count++; + $without_val = 1; + fatal($e->{ORIGINAL}, "you can't mix enum member with values and without values!") + unless ($with_val == 0); } + pidl "#define $name ( $value )\n"; } pidl "#endif\n"; } -- cgit From 43040be5b9c959c2f9c305eec9d66c103edc14af Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 24 Jan 2008 15:04:58 +0100 Subject: pidl: get rid of stupid ';' char to terminate bitmap defines metze (This used to be commit dd77fc45eee2dde7bdd31a2e39387e94cec158aa) --- source4/pidl/lib/Parse/Pidl/Samba4/Header.pm | 45 ++++++++++++++-------------- 1 file changed, 22 insertions(+), 23 deletions(-) (limited to 'source4/pidl/lib/Parse/Pidl') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm index b2d5126d1d..14f472340c 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm @@ -82,9 +82,9 @@ sub HeaderElement($) ##################################################################### # parse a struct -sub HeaderStruct($$) +sub HeaderStruct($$;$) { - my($struct,$name) = @_; + my($struct,$name,$tail) = @_; pidl "struct $name"; return if (not defined($struct->{ELEMENTS})); pidl " {\n"; @@ -103,13 +103,14 @@ sub HeaderStruct($$) if (defined $struct->{PROPERTIES}) { HeaderProperties($struct->{PROPERTIES}, []); } + pidl $tail if defined($tail); } ##################################################################### # parse a enum -sub HeaderEnum($$) +sub HeaderEnum($$;$) { - my($enum,$name) = @_; + my($enum,$name,$tail) = @_; my $first = 1; pidl "enum $name"; @@ -153,6 +154,7 @@ sub HeaderEnum($$) } pidl "#endif\n"; } + pidl $tail if defined($tail); } ##################################################################### @@ -170,9 +172,9 @@ sub HeaderBitmap($$) ##################################################################### # parse a union -sub HeaderUnion($$) +sub HeaderUnion($$;$) { - my($union,$name) = @_; + my($union,$name,$tail) = @_; my %done = (); pidl "union $name"; @@ -193,18 +195,19 @@ sub HeaderUnion($$) if (defined $union->{PROPERTIES}) { HeaderProperties($union->{PROPERTIES}, []); } + pidl $tail if defined($tail); } ##################################################################### # parse a type -sub HeaderType($$$) +sub HeaderType($$$;$) { - my($e,$data,$name) = @_; + my($e,$data,$name,$tail) = @_; if (ref($data) eq "HASH") { - ($data->{TYPE} eq "ENUM") && HeaderEnum($data, $name); + ($data->{TYPE} eq "ENUM") && HeaderEnum($data, $name, $tail); ($data->{TYPE} eq "BITMAP") && HeaderBitmap($data, $name); - ($data->{TYPE} eq "STRUCT") && HeaderStruct($data, $name); - ($data->{TYPE} eq "UNION") && HeaderUnion($data, $name); + ($data->{TYPE} eq "STRUCT") && HeaderStruct($data, $name, $tail); + ($data->{TYPE} eq "UNION") && HeaderUnion($data, $name, $tail); return; } @@ -213,14 +216,15 @@ sub HeaderType($$$) } else { pidl mapTypeName($e->{TYPE}); } + pidl $tail if defined($tail); } ##################################################################### # parse a typedef -sub HeaderTypedef($) +sub HeaderTypedef($;$) { - my($typedef) = shift; - HeaderType($typedef, $typedef->{DATA}, $typedef->{NAME}) if defined ($typedef->{DATA}); + my($typedef,$tail) = @_; + HeaderType($typedef, $typedef->{DATA}, $typedef->{NAME}, $tail) if defined ($typedef->{DATA}); } ##################################################################### @@ -357,16 +361,11 @@ sub HeaderInterface($) } foreach my $t (@{$interface->{TYPES}}) { - HeaderTypedef($t) if ($t->{TYPE} eq "TYPEDEF"); - HeaderStruct($t, $t->{NAME}) if ($t->{TYPE} eq "STRUCT"); - HeaderUnion($t, $t->{NAME}) if ($t->{TYPE} eq "UNION"); - HeaderEnum($t, $t->{NAME}) if ($t->{TYPE} eq "ENUM"); + HeaderTypedef($t, ";\n\n") if ($t->{TYPE} eq "TYPEDEF"); + HeaderStruct($t, $t->{NAME}, ";\n\n") if ($t->{TYPE} eq "STRUCT"); + HeaderUnion($t, $t->{NAME}, ";\n\n") if ($t->{TYPE} eq "UNION"); + HeaderEnum($t, $t->{NAME}, ";\n\n") if ($t->{TYPE} eq "ENUM"); HeaderBitmap($t, $t->{NAME}) if ($t->{TYPE} eq "BITMAP"); - pidl ";\n\n" if ($t->{TYPE} eq "BITMAP" or - $t->{TYPE} eq "STRUCT" or - $t->{TYPE} eq "TYPEDEF" or - $t->{TYPE} eq "UNION" or - $t->{TYPE} eq "ENUM"); } foreach my $fn (@{$interface->{FUNCTIONS}}) { -- cgit From 5d55aa99e6488244208d7d84b188f92306c083f6 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 25 Jan 2008 10:07:43 +0100 Subject: pidl/Samba4::Header: fix typedefs of unions and structs without elements metze (This used to be commit 3131847cb67dadd8ee6fcbca5055927b8ba8a219) --- source4/pidl/lib/Parse/Pidl/Samba4/Header.pm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/pidl/lib/Parse/Pidl') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm index 14f472340c..2e77ff01b8 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm @@ -86,6 +86,7 @@ sub HeaderStruct($$;$) { my($struct,$name,$tail) = @_; pidl "struct $name"; + pidl $tail if defined($tail) and not defined($struct->{ELEMENTS}); return if (not defined($struct->{ELEMENTS})); pidl " {\n"; $tab_depth++; @@ -178,6 +179,7 @@ sub HeaderUnion($$;$) my %done = (); pidl "union $name"; + pidl $tail if defined($tail) and not defined($union->{ELEMENTS}); return if (not defined($union->{ELEMENTS})); pidl " {\n"; $tab_depth++; -- cgit From e6362c4d8c287af7a884d6b7f66b86106d6b5ee7 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 31 Jan 2008 14:48:15 +0100 Subject: pidl/Samba4::NDR::Parser: pass down the correct $var_name to AllocateArrayLevel() metze (This used to be commit c630bece38eed3278466c2934763fcd8dcfb0610) --- source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'source4/pidl/lib/Parse/Pidl') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index 02d3a80992..9350a1087d 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -375,7 +375,7 @@ sub ParseArrayPullHeader($$$$$$) } if (not $l->{IS_FIXED} and not is_charset_array($e, $l)) { - $self->AllocateArrayLevel($e,$l,$ndr,$env,$size); + $self->AllocateArrayLevel($e,$l,$ndr,$var_name,$size); } return $length; @@ -2058,9 +2058,7 @@ sub ParseFunctionPush($$) sub AllocateArrayLevel($$$$$$) { - my ($self,$e,$l,$ndr,$env,$size) = @_; - - my $var = ParseExpr($e->{NAME}, $env, $e->{ORIGINAL}); + my ($self,$e,$l,$ndr,$var,$size) = @_; my $pl = GetPrevLevel($e, $l); if (defined($pl) and -- cgit From 95c5de1828aaf8692647544768afc8bfae1fab96 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 1 Feb 2008 07:00:50 +0100 Subject: pidl/Samba4::NDR::Parse: move the calculation of NDR_PULL_SET_MEM_CTX() flags into one function metze (This used to be commit 74bf021aa7016ace02a0238e71573f18016e3722) --- source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 70 +++++++++--------------- 1 file changed, 27 insertions(+), 43 deletions(-) (limited to 'source4/pidl/lib/Parse/Pidl') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index 9350a1087d..2415b516c8 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -890,15 +890,17 @@ sub CalcNdrFlags($$$) return undef; } -sub ParseMemCtxPullStart($$$$) +sub ParseMemCtxPullFlags($$$$) { - my ($self, $e, $l, $ptr_name) = @_; + my ($self, $e, $l) = @_; - my $mem_r_ctx = "_mem_save_$e->{NAME}_$l->{LEVEL_INDEX}"; - my $mem_c_ctx = $ptr_name; - my $mem_c_flags = "0"; + return undef unless ($l->{TYPE} eq "POINTER" or $l->{TYPE} eq "ARRAY"); - return if ($l->{TYPE} eq "ARRAY" and $l->{IS_FIXED}); + return undef if ($l->{TYPE} eq "ARRAY" and $l->{IS_FIXED}); + return undef if has_fast_array($e, $l); + return undef if is_charset_array($e, $l); + + my $mem_flags = "0"; if (($l->{TYPE} eq "POINTER") and ($l->{POINTER_TYPE} eq "ref")) { my $nl = GetNextLevel($e, $l); @@ -906,12 +908,25 @@ sub ParseMemCtxPullStart($$$$) my $next_is_string = (($nl->{TYPE} eq "DATA") and ($nl->{DATA_TYPE} eq "string")); if ($next_is_array or $next_is_string) { - return; + return undef; } else { - $mem_c_flags = "LIBNDR_FLAG_REF_ALLOC"; + $mem_flags = "LIBNDR_FLAG_REF_ALLOC"; } } + return $mem_flags; +} + +sub ParseMemCtxPullStart($$$$) +{ + my ($self, $e, $l, $ptr_name) = @_; + + my $mem_r_ctx = "_mem_save_$e->{NAME}_$l->{LEVEL_INDEX}"; + my $mem_c_ctx = $ptr_name; + my $mem_c_flags = $self->ParseMemCtxPullFlags($e, $l); + + return unless defined($mem_c_flags); + $self->pidl("$mem_r_ctx = NDR_PULL_GET_MEM_CTX(ndr);"); $self->pidl("NDR_PULL_SET_MEM_CTX(ndr, $mem_c_ctx, $mem_c_flags);"); } @@ -921,21 +936,9 @@ sub ParseMemCtxPullEnd($$$) my ($self, $e, $l) = @_; my $mem_r_ctx = "_mem_save_$e->{NAME}_$l->{LEVEL_INDEX}"; - my $mem_r_flags = "0"; + my $mem_r_flags = $self->ParseMemCtxPullFlags($e, $l); - return if ($l->{TYPE} eq "ARRAY" and $l->{IS_FIXED}); - - if (($l->{TYPE} eq "POINTER") and ($l->{POINTER_TYPE} eq "ref")) { - my $nl = GetNextLevel($e, $l); - my $next_is_array = ($nl->{TYPE} eq "ARRAY"); - my $next_is_string = (($nl->{TYPE} eq "DATA") and - ($nl->{DATA_TYPE} eq "string")); - if ($next_is_array or $next_is_string) { - return; - } else { - $mem_r_flags = "LIBNDR_FLAG_REF_ALLOC"; - } - } + return unless defined($mem_r_flags); $self->pidl("NDR_PULL_SET_MEM_CTX(ndr, $mem_r_ctx, $mem_r_flags);"); } @@ -1441,31 +1444,12 @@ sub DeclareArrayVariables($$) } } -sub need_decl_mem_ctx($$) -{ - my ($e,$l) = @_; - - return 0 if has_fast_array($e,$l); - return 0 if is_charset_array($e,$l); - return 1 if (($l->{TYPE} eq "ARRAY") and not $l->{IS_FIXED}); - - if (($l->{TYPE} eq "POINTER") and ($l->{POINTER_TYPE} eq "ref")) { - my $nl = GetNextLevel($e, $l); - my $next_is_array = ($nl->{TYPE} eq "ARRAY"); - my $next_is_string = (($nl->{TYPE} eq "DATA") and - ($nl->{DATA_TYPE} eq "string")); - return 0 if ($next_is_array or $next_is_string); - } - return 1 if ($l->{TYPE} eq "POINTER"); - - return 0; -} - sub DeclareMemCtxVariables($$) { my ($self,$e) = @_; foreach my $l (@{$e->{LEVELS}}) { - if (need_decl_mem_ctx($e, $l)) { + my $mem_flags = $self->ParseMemCtxPullFlags($e, $l); + if (defined($mem_flags)) { $self->pidl("TALLOC_CTX *_mem_save_$e->{NAME}_$l->{LEVEL_INDEX};"); } } -- cgit From 0f9c453e12ffb03fc8359f726b1e93f3c7d17671 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 31 Jan 2008 15:30:50 +0100 Subject: pidl/IDL: don't strip ',' from the properties content metze (This used to be commit fdf9bcb163516f7d96675ae0dce2917afb8f86d3) --- source4/pidl/lib/Parse/Pidl/IDL.pm | 845 +++++++++++------------ source4/pidl/lib/Parse/Pidl/NDR.pm | 2 +- source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 12 +- 3 files changed, 398 insertions(+), 461 deletions(-) (limited to 'source4/pidl/lib/Parse/Pidl') diff --git a/source4/pidl/lib/Parse/Pidl/IDL.pm b/source4/pidl/lib/Parse/Pidl/IDL.pm index 35e1d7bcd7..aeee69e306 100644 --- a/source4/pidl/lib/Parse/Pidl/IDL.pm +++ b/source4/pidl/lib/Parse/Pidl/IDL.pm @@ -124,7 +124,7 @@ sub new { } }, {#State 16 - DEFAULT => -116 + DEFAULT => -114 }, {#State 17 DEFAULT => -11 @@ -184,7 +184,7 @@ sub new { } }, {#State 26 - DEFAULT => -112 + DEFAULT => -110 }, {#State 27 ACTIONS => { @@ -263,17 +263,17 @@ sub new { }, {#State 40 ACTIONS => { - 'CONSTANT' => 59, + 'CONSTANT' => 58, 'TEXT' => 16, 'IDENTIFIER' => 26 }, - DEFAULT => -93, + DEFAULT => -91, GOTOS => { 'identifier' => 60, 'text' => 61, - 'listtext' => 57, 'anytext' => 56, - 'constant' => 58 + 'constant' => 57, + 'commalisttext' => 59 } }, {#State 41 @@ -392,28 +392,28 @@ sub new { DEFAULT => -89 }, {#State 57 - ACTIONS => { - "," => 97, - ")" => 98 - } + DEFAULT => -93 }, {#State 58 - DEFAULT => -95 + DEFAULT => -113 }, {#State 59 - DEFAULT => -115 + ACTIONS => { + "," => 97, + ")" => 98 + } }, {#State 60 - DEFAULT => -94 + DEFAULT => -92 }, {#State 61 - DEFAULT => -96 + DEFAULT => -94 }, {#State 62 ACTIONS => { ";" => 99 }, - DEFAULT => -117, + DEFAULT => -115, GOTOS => { 'optional_semicolon' => 100 } @@ -430,7 +430,7 @@ sub new { ACTIONS => { ";" => 99 }, - DEFAULT => -117, + DEFAULT => -115, GOTOS => { 'optional_semicolon' => 102 } @@ -466,7 +466,7 @@ sub new { ACTIONS => { 'IDENTIFIER' => 104 }, - DEFAULT => -114, + DEFAULT => -112, GOTOS => { 'optional_identifier' => 105 } @@ -501,7 +501,7 @@ sub new { ACTIONS => { 'IDENTIFIER' => 104 }, - DEFAULT => -114, + DEFAULT => -112, GOTOS => { 'optional_identifier' => 107 } @@ -516,7 +516,7 @@ sub new { ACTIONS => { 'IDENTIFIER' => 104 }, - DEFAULT => -114, + DEFAULT => -112, GOTOS => { 'optional_identifier' => 108 } @@ -525,7 +525,7 @@ sub new { ACTIONS => { 'IDENTIFIER' => 104 }, - DEFAULT => -114, + DEFAULT => -112, GOTOS => { 'optional_identifier' => 109 } @@ -549,242 +549,242 @@ sub new { }, {#State 82 ACTIONS => { - 'CONSTANT' => 59, + 'CONSTANT' => 58, 'TEXT' => 16, 'IDENTIFIER' => 26 }, - DEFAULT => -93, + DEFAULT => -91, GOTOS => { 'identifier' => 60, 'anytext' => 112, 'text' => 61, - 'constant' => 58 + 'constant' => 57 } }, {#State 83 ACTIONS => { - 'CONSTANT' => 59, + 'CONSTANT' => 58, 'TEXT' => 16, 'IDENTIFIER' => 26 }, - DEFAULT => -93, + DEFAULT => -91, GOTOS => { 'identifier' => 60, 'anytext' => 113, 'text' => 61, - 'constant' => 58 + 'constant' => 57 } }, {#State 84 ACTIONS => { - 'CONSTANT' => 59, + 'CONSTANT' => 58, 'TEXT' => 16, 'IDENTIFIER' => 26 }, - DEFAULT => -93, + DEFAULT => -91, GOTOS => { 'identifier' => 60, 'anytext' => 114, 'text' => 61, - 'constant' => 58 + 'constant' => 57 } }, {#State 85 ACTIONS => { - 'CONSTANT' => 59, + 'CONSTANT' => 58, 'TEXT' => 16, 'IDENTIFIER' => 26 }, - DEFAULT => -93, + DEFAULT => -91, GOTOS => { 'identifier' => 60, 'anytext' => 115, 'text' => 61, - 'constant' => 58 + 'constant' => 57 } }, {#State 86 ACTIONS => { - 'CONSTANT' => 59, + 'CONSTANT' => 58, 'TEXT' => 16, 'IDENTIFIER' => 26 }, - DEFAULT => -93, + DEFAULT => -91, GOTOS => { 'identifier' => 60, 'anytext' => 116, 'text' => 61, - 'constant' => 58 + 'constant' => 57 } }, {#State 87 ACTIONS => { - 'CONSTANT' => 59, + 'CONSTANT' => 58, 'TEXT' => 16, 'IDENTIFIER' => 26 }, - DEFAULT => -93, + DEFAULT => -91, GOTOS => { 'identifier' => 60, 'anytext' => 117, 'text' => 61, - 'constant' => 58 + 'constant' => 57 } }, {#State 88 ACTIONS => { - 'CONSTANT' => 59, + 'CONSTANT' => 58, 'TEXT' => 16, 'IDENTIFIER' => 26 }, - DEFAULT => -93, + DEFAULT => -91, GOTOS => { 'identifier' => 60, 'anytext' => 118, 'text' => 61, - 'constant' => 58 + 'constant' => 57 } }, {#State 89 ACTIONS => { - 'CONSTANT' => 59, + 'CONSTANT' => 58, 'TEXT' => 16, 'IDENTIFIER' => 26 }, - DEFAULT => -93, + DEFAULT => -91, GOTOS => { 'identifier' => 60, - 'anytext' => 119, + 'anytext' => 56, 'text' => 61, - 'constant' => 58, - 'commalisttext' => 120 + 'constant' => 57, + 'commalisttext' => 119 } }, {#State 90 ACTIONS => { - 'CONSTANT' => 59, + 'CONSTANT' => 58, 'TEXT' => 16, 'IDENTIFIER' => 26 }, - DEFAULT => -93, + DEFAULT => -91, GOTOS => { 'identifier' => 60, - 'anytext' => 121, + 'anytext' => 120, 'text' => 61, - 'constant' => 58 + 'constant' => 57 } }, {#State 91 ACTIONS => { - 'CONSTANT' => 59, + 'CONSTANT' => 58, 'TEXT' => 16, 'IDENTIFIER' => 26 }, - DEFAULT => -93, + DEFAULT => -91, GOTOS => { 'identifier' => 60, - 'anytext' => 122, + 'anytext' => 121, 'text' => 61, - 'constant' => 58 + 'constant' => 57 } }, {#State 92 ACTIONS => { - 'CONSTANT' => 59, + 'CONSTANT' => 58, 'TEXT' => 16, 'IDENTIFIER' => 26 }, - DEFAULT => -93, + DEFAULT => -91, GOTOS => { 'identifier' => 60, - 'anytext' => 123, + 'anytext' => 122, 'text' => 61, - 'constant' => 58 + 'constant' => 57 } }, {#State 93 ACTIONS => { - 'CONSTANT' => 59, + 'CONSTANT' => 58, 'TEXT' => 16, 'IDENTIFIER' => 26 }, - DEFAULT => -93, + DEFAULT => -91, GOTOS => { 'identifier' => 60, - 'anytext' => 119, + 'anytext' => 56, 'text' => 61, - 'constant' => 58, - 'commalisttext' => 124 + 'constant' => 57, + 'commalisttext' => 123 } }, {#State 94 ACTIONS => { - 'CONSTANT' => 59, + 'CONSTANT' => 58, 'TEXT' => 16, 'IDENTIFIER' => 26 }, - DEFAULT => -93, + DEFAULT => -91, GOTOS => { 'identifier' => 60, - 'anytext' => 125, + 'anytext' => 124, 'text' => 61, - 'constant' => 58 + 'constant' => 57 } }, {#State 95 ACTIONS => { - 'CONSTANT' => 59, + 'CONSTANT' => 58, 'TEXT' => 16, 'IDENTIFIER' => 26 }, - DEFAULT => -93, + DEFAULT => -91, GOTOS => { 'identifier' => 60, - 'anytext' => 126, + 'anytext' => 125, 'text' => 61, - 'constant' => 58 + 'constant' => 57 } }, {#State 96 ACTIONS => { - 'CONSTANT' => 59, + 'CONSTANT' => 58, 'TEXT' => 16, 'IDENTIFIER' => 26 }, - DEFAULT => -93, + DEFAULT => -91, GOTOS => { 'identifier' => 60, - 'anytext' => 127, + 'anytext' => 126, 'text' => 61, - 'constant' => 58 + 'constant' => 57 } }, {#State 97 ACTIONS => { - 'CONSTANT' => 59, + 'CONSTANT' => 58, 'TEXT' => 16, 'IDENTIFIER' => 26 }, - DEFAULT => -93, + DEFAULT => -91, GOTOS => { 'identifier' => 60, - 'anytext' => 128, + 'anytext' => 127, 'text' => 61, - 'constant' => 58 + 'constant' => 57 } }, {#State 98 DEFAULT => -88 }, {#State 99 - DEFAULT => -118 + DEFAULT => -116 }, {#State 100 DEFAULT => -13 }, {#State 101 ACTIONS => { - ";" => 129 + ";" => 128 } }, {#State 102 @@ -795,20 +795,20 @@ sub new { 'IDENTIFIER' => 26 }, GOTOS => { - 'identifier' => 130 + 'identifier' => 129 } }, {#State 104 - DEFAULT => -113 + DEFAULT => -111 }, {#State 105 ACTIONS => { - "{" => 132 + "{" => 131 }, DEFAULT => -68, GOTOS => { - 'union_body' => 133, - 'opt_union_body' => 131 + 'union_body' => 132, + 'opt_union_body' => 130 } }, {#State 106 @@ -816,46 +816,46 @@ sub new { }, {#State 107 ACTIONS => { - "{" => 135 + "{" => 134 }, DEFAULT => -58, GOTOS => { - 'struct_body' => 134, - 'opt_struct_body' => 136 + 'struct_body' => 133, + 'opt_struct_body' => 135 } }, {#State 108 ACTIONS => { - "{" => 137 + "{" => 136 }, DEFAULT => -41, GOTOS => { - 'opt_enum_body' => 139, - 'enum_body' => 138 + 'opt_enum_body' => 138, + 'enum_body' => 137 } }, {#State 109 ACTIONS => { - "{" => 141 + "{" => 140 }, DEFAULT => -49, GOTOS => { - 'bitmap_body' => 142, - 'opt_bitmap_body' => 140 + 'bitmap_body' => 141, + 'opt_bitmap_body' => 139 } }, {#State 110 ACTIONS => { - "(" => 143 + "(" => 142 } }, {#State 111 ACTIONS => { 'IDENTIFIER' => 26, - "*" => 145 + "*" => 144 }, GOTOS => { - 'identifier' => 144 + 'identifier' => 143 } }, {#State 112 @@ -876,7 +876,7 @@ sub new { "." => 95, ">" => 96 }, - DEFAULT => -106 + DEFAULT => -104 }, {#State 113 ACTIONS => { @@ -887,7 +887,7 @@ sub new { "{" => 89, "=" => 92 }, - DEFAULT => -97 + DEFAULT => -95 }, {#State 114 ACTIONS => { @@ -907,7 +907,7 @@ sub new { "." => 95, ">" => 96 }, - DEFAULT => -101 + DEFAULT => -99 }, {#State 115 ACTIONS => { @@ -927,7 +927,7 @@ sub new { "." => 95, ">" => 96 }, - DEFAULT => -109 + DEFAULT => -107 }, {#State 116 ACTIONS => { @@ -938,7 +938,7 @@ sub new { "{" => 89, "=" => 92 }, - DEFAULT => -108 + DEFAULT => -106 }, {#State 117 ACTIONS => { @@ -949,7 +949,7 @@ sub new { "{" => 89, "=" => 92 }, - DEFAULT => -99 + DEFAULT => -97 }, {#State 118 ACTIONS => { @@ -969,35 +969,15 @@ sub new { "." => 95, ">" => 96 }, - DEFAULT => -105 + DEFAULT => -103 }, {#State 119 ACTIONS => { - "-" => 83, - ":" => 82, - "<" => 84, - "+" => 86, - "~" => 85, - "*" => 87, - "?" => 88, - "{" => 89, - "&" => 90, - "/" => 91, - "=" => 92, - "(" => 93, - "|" => 94, - "." => 95, - ">" => 96 - }, - DEFAULT => -91 - }, - {#State 120 - ACTIONS => { - "}" => 146, - "," => 147 + "}" => 145, + "," => 97 } }, - {#State 121 + {#State 120 ACTIONS => { ":" => 82, "<" => 84, @@ -1006,9 +986,9 @@ sub new { "{" => 89, "=" => 92 }, - DEFAULT => -103 + DEFAULT => -101 }, - {#State 122 + {#State 121 ACTIONS => { ":" => 82, "<" => 84, @@ -1017,9 +997,9 @@ sub new { "{" => 89, "=" => 92 }, - DEFAULT => -104 + DEFAULT => -102 }, - {#State 123 + {#State 122 ACTIONS => { "-" => 83, ":" => 82, @@ -1037,15 +1017,15 @@ sub new { "." => 95, ">" => 96 }, - DEFAULT => -107 + DEFAULT => -105 }, - {#State 124 + {#State 123 ACTIONS => { - "," => 147, - ")" => 148 + "," => 97, + ")" => 146 } }, - {#State 125 + {#State 124 ACTIONS => { ":" => 82, "<" => 84, @@ -1054,9 +1034,9 @@ sub new { "{" => 89, "=" => 92 }, - DEFAULT => -102 + DEFAULT => -100 }, - {#State 126 + {#State 125 ACTIONS => { ":" => 82, "<" => 84, @@ -1065,9 +1045,9 @@ sub new { "{" => 89, "=" => 92 }, - DEFAULT => -98 + DEFAULT => -96 }, - {#State 127 + {#State 126 ACTIONS => { ":" => 82, "<" => 84, @@ -1076,9 +1056,9 @@ sub new { "{" => 89, "=" => 92 }, - DEFAULT => -100 + DEFAULT => -98 }, - {#State 128 + {#State 127 ACTIONS => { "-" => 83, ":" => 82, @@ -1098,221 +1078,207 @@ sub new { }, DEFAULT => -90 }, - {#State 129 + {#State 128 DEFAULT => -15 }, - {#State 130 + {#State 129 ACTIONS => { - "[" => 149 + "[" => 147 }, DEFAULT => -80, GOTOS => { - 'array_len' => 150 + 'array_len' => 148 } }, - {#State 131 + {#State 130 DEFAULT => -70 }, - {#State 132 + {#State 131 DEFAULT => -65, GOTOS => { - 'union_elements' => 151 + 'union_elements' => 149 } }, - {#State 133 + {#State 132 DEFAULT => -69 }, - {#State 134 + {#State 133 DEFAULT => -59 }, - {#State 135 + {#State 134 DEFAULT => -74, GOTOS => { - 'element_list1' => 152 + 'element_list1' => 150 } }, - {#State 136 + {#State 135 DEFAULT => -60 }, - {#State 137 + {#State 136 ACTIONS => { 'IDENTIFIER' => 26 }, GOTOS => { - 'identifier' => 153, - 'enum_element' => 154, - 'enum_elements' => 155 + 'identifier' => 151, + 'enum_element' => 152, + 'enum_elements' => 153 } }, - {#State 138 + {#State 137 DEFAULT => -42 }, - {#State 139 + {#State 138 DEFAULT => -43 }, - {#State 140 + {#State 139 DEFAULT => -51 }, - {#State 141 + {#State 140 ACTIONS => { 'IDENTIFIER' => 26 }, DEFAULT => -54, GOTOS => { - 'identifier' => 158, - 'bitmap_element' => 157, - 'bitmap_elements' => 156, - 'opt_bitmap_elements' => 159 + 'identifier' => 156, + 'bitmap_element' => 155, + 'bitmap_elements' => 154, + 'opt_bitmap_elements' => 157 } }, - {#State 142 + {#State 141 DEFAULT => -50 }, - {#State 143 + {#State 142 ACTIONS => { "," => -76, - "void" => 163, + "void" => 161, ")" => -76 }, DEFAULT => -83, GOTOS => { - 'base_element' => 160, - 'element_list2' => 162, - 'property_list' => 161 + 'base_element' => 158, + 'element_list2' => 160, + 'property_list' => 159 } }, - {#State 144 + {#State 143 ACTIONS => { - "[" => 149, - "=" => 165 + "[" => 147, + "=" => 163 }, GOTOS => { - 'array_len' => 164 + 'array_len' => 162 } }, - {#State 145 + {#State 144 DEFAULT => -73 }, - {#State 146 - ACTIONS => { - 'CONSTANT' => 59, - 'TEXT' => 16, - 'IDENTIFIER' => 26 - }, - DEFAULT => -93, - GOTOS => { - 'identifier' => 60, - 'anytext' => 166, - 'text' => 61, - 'constant' => 58 - } - }, - {#State 147 + {#State 145 ACTIONS => { - 'CONSTANT' => 59, + 'CONSTANT' => 58, 'TEXT' => 16, 'IDENTIFIER' => 26 }, - DEFAULT => -93, + DEFAULT => -91, GOTOS => { 'identifier' => 60, - 'anytext' => 167, + 'anytext' => 164, 'text' => 61, - 'constant' => 58 + 'constant' => 57 } }, - {#State 148 + {#State 146 ACTIONS => { - 'CONSTANT' => 59, + 'CONSTANT' => 58, 'TEXT' => 16, 'IDENTIFIER' => 26 }, - DEFAULT => -93, + DEFAULT => -91, GOTOS => { 'identifier' => 60, - 'anytext' => 168, + 'anytext' => 165, 'text' => 61, - 'constant' => 58 + 'constant' => 57 } }, - {#State 149 + {#State 147 ACTIONS => { - 'CONSTANT' => 59, + 'CONSTANT' => 58, 'TEXT' => 16, - "]" => 169, + "]" => 166, 'IDENTIFIER' => 26 }, - DEFAULT => -93, + DEFAULT => -91, GOTOS => { 'identifier' => 60, - 'anytext' => 170, + 'anytext' => 167, 'text' => 61, - 'constant' => 58 + 'constant' => 57 } }, - {#State 150 + {#State 148 ACTIONS => { - ";" => 171 + ";" => 168 } }, - {#State 151 + {#State 149 ACTIONS => { - "}" => 172 + "}" => 169 }, DEFAULT => -83, GOTOS => { - 'optional_base_element' => 174, - 'property_list' => 173 + 'optional_base_element' => 171, + 'property_list' => 170 } }, - {#State 152 + {#State 150 ACTIONS => { - "}" => 175 + "}" => 172 }, DEFAULT => -83, GOTOS => { - 'base_element' => 176, - 'property_list' => 161 + 'base_element' => 173, + 'property_list' => 159 } }, - {#State 153 + {#State 151 ACTIONS => { - "=" => 177 + "=" => 174 }, DEFAULT => -46 }, - {#State 154 + {#State 152 DEFAULT => -44 }, - {#State 155 + {#State 153 ACTIONS => { - "}" => 178, - "," => 179 + "}" => 175, + "," => 176 } }, - {#State 156 + {#State 154 ACTIONS => { - "," => 180 + "," => 177 }, DEFAULT => -55 }, - {#State 157 + {#State 155 DEFAULT => -52 }, - {#State 158 + {#State 156 ACTIONS => { - "=" => 181 + "=" => 178 } }, - {#State 159 + {#State 157 ACTIONS => { - "}" => 182 + "}" => 179 } }, - {#State 160 + {#State 158 DEFAULT => -78 }, - {#State 161 + {#State 159 ACTIONS => { 'IDENTIFIER' => 26, "signed" => 75, @@ -1329,60 +1295,40 @@ sub new { 'identifier' => 72, 'struct' => 49, 'enum' => 52, - 'type' => 183, + 'type' => 180, 'union' => 54, 'sign' => 73 } }, - {#State 162 + {#State 160 ACTIONS => { - "," => 184, - ")" => 185 + "," => 181, + ")" => 182 } }, - {#State 163 + {#State 161 DEFAULT => -77 }, - {#State 164 + {#State 162 ACTIONS => { - "=" => 186 + "=" => 183 } }, - {#State 165 + {#State 163 ACTIONS => { - 'CONSTANT' => 59, + 'CONSTANT' => 58, 'TEXT' => 16, 'IDENTIFIER' => 26 }, - DEFAULT => -93, + DEFAULT => -91, GOTOS => { 'identifier' => 60, - 'anytext' => 187, + 'anytext' => 184, 'text' => 61, - 'constant' => 58 + 'constant' => 57 } }, - {#State 166 - ACTIONS => { - "-" => 83, - ":" => 82, - "<" => 84, - "+" => 86, - "~" => 85, - "*" => 87, - "?" => 88, - "{" => 89, - "&" => 90, - "/" => 91, - "=" => 92, - "(" => 93, - "|" => 94, - "." => 95, - ">" => 96 - }, - DEFAULT => -111 - }, - {#State 167 + {#State 164 ACTIONS => { "-" => 83, ":" => 82, @@ -1400,9 +1346,9 @@ sub new { "." => 95, ">" => 96 }, - DEFAULT => -92 + DEFAULT => -109 }, - {#State 168 + {#State 165 ACTIONS => { ":" => 82, "<" => 84, @@ -1411,18 +1357,18 @@ sub new { "{" => 89, "=" => 92 }, - DEFAULT => -110 + DEFAULT => -108 }, - {#State 169 + {#State 166 ACTIONS => { - "[" => 149 + "[" => 147 }, DEFAULT => -80, GOTOS => { - 'array_len' => 188 + 'array_len' => 185 } }, - {#State 170 + {#State 167 ACTIONS => { "-" => 83, ":" => 82, @@ -1438,130 +1384,130 @@ sub new { "(" => 93, "*" => 87, "." => 95, - "]" => 189, + "]" => 186, ">" => 96 } }, - {#State 171 + {#State 168 DEFAULT => -27 }, - {#State 172 + {#State 169 DEFAULT => -67 }, - {#State 173 + {#State 170 ACTIONS => { "[" => 20 }, DEFAULT => -83, GOTOS => { - 'base_or_empty' => 190, - 'base_element' => 191, - 'empty_element' => 192, - 'property_list' => 193 + 'base_or_empty' => 187, + 'base_element' => 188, + 'empty_element' => 189, + 'property_list' => 190 } }, - {#State 174 + {#State 171 DEFAULT => -66 }, - {#State 175 + {#State 172 DEFAULT => -57 }, - {#State 176 + {#State 173 ACTIONS => { - ";" => 194 + ";" => 191 } }, - {#State 177 + {#State 174 ACTIONS => { - 'CONSTANT' => 59, + 'CONSTANT' => 58, 'TEXT' => 16, 'IDENTIFIER' => 26 }, - DEFAULT => -93, + DEFAULT => -91, GOTOS => { 'identifier' => 60, - 'anytext' => 195, + 'anytext' => 192, 'text' => 61, - 'constant' => 58 + 'constant' => 57 } }, - {#State 178 + {#State 175 DEFAULT => -40 }, - {#State 179 + {#State 176 ACTIONS => { 'IDENTIFIER' => 26 }, GOTOS => { - 'identifier' => 153, - 'enum_element' => 196 + 'identifier' => 151, + 'enum_element' => 193 } }, - {#State 180 + {#State 177 ACTIONS => { 'IDENTIFIER' => 26 }, GOTOS => { - 'identifier' => 158, - 'bitmap_element' => 197 + 'identifier' => 156, + 'bitmap_element' => 194 } }, - {#State 181 + {#State 178 ACTIONS => { - 'CONSTANT' => 59, + 'CONSTANT' => 58, 'TEXT' => 16, 'IDENTIFIER' => 26 }, - DEFAULT => -93, + DEFAULT => -91, GOTOS => { 'identifier' => 60, - 'anytext' => 198, + 'anytext' => 195, 'text' => 61, - 'constant' => 58 + 'constant' => 57 } }, - {#State 182 + {#State 179 DEFAULT => -48 }, - {#State 183 + {#State 180 DEFAULT => -72, GOTOS => { - 'pointers' => 199 + 'pointers' => 196 } }, - {#State 184 + {#State 181 DEFAULT => -83, GOTOS => { - 'base_element' => 200, - 'property_list' => 161 + 'base_element' => 197, + 'property_list' => 159 } }, - {#State 185 + {#State 182 ACTIONS => { - ";" => 201 + ";" => 198 } }, - {#State 186 + {#State 183 ACTIONS => { - 'CONSTANT' => 59, + 'CONSTANT' => 58, 'TEXT' => 16, 'IDENTIFIER' => 26 }, - DEFAULT => -93, + DEFAULT => -91, GOTOS => { 'identifier' => 60, - 'anytext' => 202, + 'anytext' => 199, 'text' => 61, - 'constant' => 58 + 'constant' => 57 } }, - {#State 187 + {#State 184 ACTIONS => { "-" => 83, ":" => 82, "?" => 88, "<" => 84, - ";" => 203, + ";" => 200, "+" => 86, "~" => 85, "&" => 90, @@ -1575,34 +1521,34 @@ sub new { ">" => 96 } }, - {#State 188 + {#State 185 DEFAULT => -81 }, - {#State 189 + {#State 186 ACTIONS => { - "[" => 149 + "[" => 147 }, DEFAULT => -80, GOTOS => { - 'array_len' => 204 + 'array_len' => 201 } }, - {#State 190 + {#State 187 DEFAULT => -64 }, - {#State 191 + {#State 188 ACTIONS => { - ";" => 205 + ";" => 202 } }, - {#State 192 + {#State 189 DEFAULT => -63 }, - {#State 193 + {#State 190 ACTIONS => { 'IDENTIFIER' => 26, "signed" => 75, - ";" => 206, + ";" => 203, 'void' => 69, "unsigned" => 79, "[" => 20 @@ -1616,15 +1562,15 @@ sub new { 'identifier' => 72, 'struct' => 49, 'enum' => 52, - 'type' => 183, + 'type' => 180, 'union' => 54, 'sign' => 73 } }, - {#State 194 + {#State 191 DEFAULT => -75 }, - {#State 195 + {#State 192 ACTIONS => { "-" => 83, ":" => 82, @@ -1644,13 +1590,13 @@ sub new { }, DEFAULT => -47 }, - {#State 196 + {#State 193 DEFAULT => -45 }, - {#State 197 + {#State 194 DEFAULT => -53 }, - {#State 198 + {#State 195 ACTIONS => { "-" => 83, ":" => 82, @@ -1670,28 +1616,28 @@ sub new { }, DEFAULT => -56 }, - {#State 199 + {#State 196 ACTIONS => { 'IDENTIFIER' => 26, - "*" => 145 + "*" => 144 }, GOTOS => { - 'identifier' => 207 + 'identifier' => 204 } }, - {#State 200 + {#State 197 DEFAULT => -79 }, - {#State 201 + {#State 198 DEFAULT => -26 }, - {#State 202 + {#State 199 ACTIONS => { "-" => 83, ":" => 82, "?" => 88, "<" => 84, - ";" => 208, + ";" => 205, "+" => 86, "~" => 85, "&" => 90, @@ -1705,31 +1651,31 @@ sub new { ">" => 96 } }, - {#State 203 + {#State 200 DEFAULT => -24 }, - {#State 204 + {#State 201 DEFAULT => -82 }, - {#State 205 + {#State 202 DEFAULT => -62 }, - {#State 206 + {#State 203 DEFAULT => -61 }, - {#State 207 + {#State 204 ACTIONS => { - "[" => 149 + "[" => 147 }, DEFAULT => -80, GOTOS => { - 'array_len' => 209 + 'array_len' => 206 } }, - {#State 208 + {#State 205 DEFAULT => -25 }, - {#State 209 + {#State 206 DEFAULT => -71 } ], @@ -1744,43 +1690,43 @@ sub new { [#Rule 2 'idl', 2, sub -#line 19 "idl.yp" +#line 19 "pidl/idl.yp" { push(@{$_[1]}, $_[2]); $_[1] } ], [#Rule 3 'idl', 2, sub -#line 20 "idl.yp" +#line 20 "pidl/idl.yp" { push(@{$_[1]}, $_[2]); $_[1] } ], [#Rule 4 'idl', 2, sub -#line 21 "idl.yp" +#line 21 "pidl/idl.yp" { push(@{$_[1]}, $_[2]); $_[1] } ], [#Rule 5 'idl', 2, sub -#line 22 "idl.yp" +#line 22 "pidl/idl.yp" { push(@{$_[1]}, $_[2]); $_[1] } ], [#Rule 6 'idl', 2, sub -#line 23 "idl.yp" +#line 23 "pidl/idl.yp" { push(@{$_[1]}, $_[2]); $_[1] } ], [#Rule 7 'idl', 2, sub -#line 24 "idl.yp" +#line 24 "pidl/idl.yp" { push(@{$_[1]}, $_[2]); $_[1] } ], [#Rule 8 'import', 3, sub -#line 27 "idl.yp" +#line 27 "pidl/idl.yp" {{ "TYPE" => "IMPORT", "PATHS" => $_[2], @@ -1791,7 +1737,7 @@ sub [#Rule 9 'include', 3, sub -#line 34 "idl.yp" +#line 34 "pidl/idl.yp" {{ "TYPE" => "INCLUDE", "PATHS" => $_[2], @@ -1802,7 +1748,7 @@ sub [#Rule 10 'importlib', 3, sub -#line 41 "idl.yp" +#line 41 "pidl/idl.yp" {{ "TYPE" => "IMPORTLIB", "PATHS" => $_[2], @@ -1813,19 +1759,19 @@ sub [#Rule 11 'commalist', 1, sub -#line 50 "idl.yp" +#line 50 "pidl/idl.yp" { [ $_[1] ] } ], [#Rule 12 'commalist', 3, sub -#line 51 "idl.yp" +#line 51 "pidl/idl.yp" { push(@{$_[1]}, $_[3]); $_[1] } ], [#Rule 13 'coclass', 7, sub -#line 55 "idl.yp" +#line 55 "pidl/idl.yp" {{ "TYPE" => "COCLASS", "PROPERTIES" => $_[1], @@ -1841,13 +1787,13 @@ sub [#Rule 15 'interface_names', 4, sub -#line 67 "idl.yp" +#line 67 "pidl/idl.yp" { push(@{$_[1]}, $_[2]); $_[1] } ], [#Rule 16 'interface', 7, sub -#line 71 "idl.yp" +#line 71 "pidl/idl.yp" {{ "TYPE" => "INTERFACE", "PROPERTIES" => $_[1], @@ -1860,7 +1806,7 @@ sub [#Rule 17 'cpp_quote', 4, sub -#line 82 "idl.yp" +#line 82 "pidl/idl.yp" {{ "TYPE" => "CPP_QUOTE", "FILE" => $_[0]->YYData->{FILE}, @@ -1871,13 +1817,13 @@ sub [#Rule 18 'definitions', 1, sub -#line 91 "idl.yp" +#line 91 "pidl/idl.yp" { [ $_[1] ] } ], [#Rule 19 'definitions', 2, sub -#line 92 "idl.yp" +#line 92 "pidl/idl.yp" { push(@{$_[1]}, $_[2]); $_[1] } ], [#Rule 20 @@ -1895,7 +1841,7 @@ sub [#Rule 24 'const', 7, sub -#line 100 "idl.yp" +#line 100 "pidl/idl.yp" {{ "TYPE" => "CONST", "DTYPE" => $_[2], @@ -1909,7 +1855,7 @@ sub [#Rule 25 'const', 8, sub -#line 110 "idl.yp" +#line 110 "pidl/idl.yp" {{ "TYPE" => "CONST", "DTYPE" => $_[2], @@ -1924,7 +1870,7 @@ sub [#Rule 26 'function', 7, sub -#line 124 "idl.yp" +#line 124 "pidl/idl.yp" {{ "TYPE" => "FUNCTION", "NAME" => $_[3], @@ -1938,7 +1884,7 @@ sub [#Rule 27 'typedef', 6, sub -#line 136 "idl.yp" +#line 136 "pidl/idl.yp" {{ "TYPE" => "TYPEDEF", "PROPERTIES" => $_[1], @@ -1964,7 +1910,7 @@ sub [#Rule 32 'typedecl', 2, sub -#line 149 "idl.yp" +#line 149 "pidl/idl.yp" { $_[1] } ], [#Rule 33 @@ -1976,7 +1922,7 @@ sub [#Rule 35 'existingtype', 2, sub -#line 154 "idl.yp" +#line 154 "pidl/idl.yp" { ($_[1]?$_[1]:"signed") ." $_[2]" } ], [#Rule 36 @@ -1991,13 +1937,13 @@ sub [#Rule 39 'type', 1, sub -#line 158 "idl.yp" +#line 158 "pidl/idl.yp" { "void" } ], [#Rule 40 'enum_body', 3, sub -#line 160 "idl.yp" +#line 160 "pidl/idl.yp" { $_[2] } ], [#Rule 41 @@ -2009,7 +1955,7 @@ sub [#Rule 43 'enum', 4, sub -#line 163 "idl.yp" +#line 163 "pidl/idl.yp" {{ "TYPE" => "ENUM", "PROPERTIES" => $_[1], @@ -2020,13 +1966,13 @@ sub [#Rule 44 'enum_elements', 1, sub -#line 172 "idl.yp" +#line 172 "pidl/idl.yp" { [ $_[1] ] } ], [#Rule 45 'enum_elements', 3, sub -#line 173 "idl.yp" +#line 173 "pidl/idl.yp" { push(@{$_[1]}, $_[3]); $_[1] } ], [#Rule 46 @@ -2035,13 +1981,13 @@ sub [#Rule 47 'enum_element', 3, sub -#line 177 "idl.yp" +#line 177 "pidl/idl.yp" { "$_[1]$_[2]$_[3]" } ], [#Rule 48 'bitmap_body', 3, sub -#line 180 "idl.yp" +#line 180 "pidl/idl.yp" { $_[2] } ], [#Rule 49 @@ -2053,7 +1999,7 @@ sub [#Rule 51 'bitmap', 4, sub -#line 183 "idl.yp" +#line 183 "pidl/idl.yp" {{ "TYPE" => "BITMAP", "PROPERTIES" => $_[1], @@ -2064,13 +2010,13 @@ sub [#Rule 52 'bitmap_elements', 1, sub -#line 192 "idl.yp" +#line 192 "pidl/idl.yp" { [ $_[1] ] } ], [#Rule 53 'bitmap_elements', 3, sub -#line 193 "idl.yp" +#line 193 "pidl/idl.yp" { push(@{$_[1]}, $_[3]); $_[1] } ], [#Rule 54 @@ -2082,13 +2028,13 @@ sub [#Rule 56 'bitmap_element', 3, sub -#line 198 "idl.yp" +#line 198 "pidl/idl.yp" { "$_[1] ( $_[3] )" } ], [#Rule 57 'struct_body', 3, sub -#line 201 "idl.yp" +#line 201 "pidl/idl.yp" { $_[2] } ], [#Rule 58 @@ -2100,7 +2046,7 @@ sub [#Rule 60 'struct', 4, sub -#line 205 "idl.yp" +#line 205 "pidl/idl.yp" {{ "TYPE" => "STRUCT", "PROPERTIES" => $_[1], @@ -2111,7 +2057,7 @@ sub [#Rule 61 'empty_element', 2, sub -#line 214 "idl.yp" +#line 214 "pidl/idl.yp" {{ "NAME" => "", "TYPE" => "EMPTY", @@ -2131,7 +2077,7 @@ sub [#Rule 64 'optional_base_element', 2, sub -#line 228 "idl.yp" +#line 228 "pidl/idl.yp" { $_[2]->{PROPERTIES} = FlattenHash([$_[1],$_[2]->{PROPERTIES}]); $_[2] } ], [#Rule 65 @@ -2140,13 +2086,13 @@ sub [#Rule 66 'union_elements', 2, sub -#line 233 "idl.yp" +#line 233 "pidl/idl.yp" { push(@{$_[1]}, $_[2]); $_[1] } ], [#Rule 67 'union_body', 3, sub -#line 236 "idl.yp" +#line 236 "pidl/idl.yp" { $_[2] } ], [#Rule 68 @@ -2158,7 +2104,7 @@ sub [#Rule 70 'union', 4, sub -#line 240 "idl.yp" +#line 240 "pidl/idl.yp" {{ "TYPE" => "UNION", "PROPERTIES" => $_[1], @@ -2169,7 +2115,7 @@ sub [#Rule 71 'base_element', 5, sub -#line 249 "idl.yp" +#line 249 "pidl/idl.yp" {{ "NAME" => $_[4], "TYPE" => $_[2], @@ -2183,25 +2129,25 @@ sub [#Rule 72 'pointers', 0, sub -#line 263 "idl.yp" +#line 263 "pidl/idl.yp" { 0 } ], [#Rule 73 'pointers', 2, sub -#line 264 "idl.yp" +#line 264 "pidl/idl.yp" { $_[1]+1 } ], [#Rule 74 'element_list1', 0, sub -#line 268 "idl.yp" +#line 268 "pidl/idl.yp" { [] } ], [#Rule 75 'element_list1', 3, sub -#line 269 "idl.yp" +#line 269 "pidl/idl.yp" { push(@{$_[1]}, $_[2]); $_[1] } ], [#Rule 76 @@ -2213,13 +2159,13 @@ sub [#Rule 78 'element_list2', 1, sub -#line 275 "idl.yp" +#line 275 "pidl/idl.yp" { [ $_[1] ] } ], [#Rule 79 'element_list2', 3, sub -#line 276 "idl.yp" +#line 276 "pidl/idl.yp" { push(@{$_[1]}, $_[3]); $_[1] } ], [#Rule 80 @@ -2228,13 +2174,13 @@ sub [#Rule 81 'array_len', 3, sub -#line 281 "idl.yp" +#line 281 "pidl/idl.yp" { push(@{$_[3]}, "*"); $_[3] } ], [#Rule 82 'array_len', 4, sub -#line 282 "idl.yp" +#line 282 "pidl/idl.yp" { push(@{$_[4]}, "$_[2]"); $_[4] } ], [#Rule 83 @@ -2243,178 +2189,169 @@ sub [#Rule 84 'property_list', 4, sub -#line 288 "idl.yp" +#line 288 "pidl/idl.yp" { FlattenHash([$_[1],$_[3]]); } ], [#Rule 85 'properties', 1, sub -#line 291 "idl.yp" +#line 291 "pidl/idl.yp" { $_[1] } ], [#Rule 86 'properties', 3, sub -#line 292 "idl.yp" +#line 292 "pidl/idl.yp" { FlattenHash([$_[1], $_[3]]); } ], [#Rule 87 'property', 1, sub -#line 295 "idl.yp" +#line 295 "pidl/idl.yp" {{ "$_[1]" => "1" }} ], [#Rule 88 'property', 4, sub -#line 296 "idl.yp" +#line 296 "pidl/idl.yp" {{ "$_[1]" => "$_[3]" }} ], [#Rule 89 - 'listtext', 1, undef - ], - [#Rule 90 - 'listtext', 3, -sub -#line 301 "idl.yp" -{ "$_[1] $_[3]" } - ], - [#Rule 91 'commalisttext', 1, undef ], - [#Rule 92 + [#Rule 90 'commalisttext', 3, sub -#line 306 "idl.yp" +#line 301 "pidl/idl.yp" { "$_[1],$_[3]" } ], - [#Rule 93 + [#Rule 91 'anytext', 0, sub -#line 310 "idl.yp" +#line 305 "pidl/idl.yp" { "" } ], + [#Rule 92 + 'anytext', 1, undef + ], + [#Rule 93 + 'anytext', 1, undef + ], [#Rule 94 'anytext', 1, undef ], [#Rule 95 - 'anytext', 1, undef + 'anytext', 3, +sub +#line 307 "pidl/idl.yp" +{ "$_[1]$_[2]$_[3]" } ], [#Rule 96 - 'anytext', 1, undef + 'anytext', 3, +sub +#line 308 "pidl/idl.yp" +{ "$_[1]$_[2]$_[3]" } ], [#Rule 97 'anytext', 3, sub -#line 312 "idl.yp" +#line 309 "pidl/idl.yp" { "$_[1]$_[2]$_[3]" } ], [#Rule 98 'anytext', 3, sub -#line 313 "idl.yp" +#line 310 "pidl/idl.yp" { "$_[1]$_[2]$_[3]" } ], [#Rule 99 'anytext', 3, sub -#line 314 "idl.yp" +#line 311 "pidl/idl.yp" { "$_[1]$_[2]$_[3]" } ], [#Rule 100 'anytext', 3, sub -#line 315 "idl.yp" +#line 312 "pidl/idl.yp" { "$_[1]$_[2]$_[3]" } ], [#Rule 101 'anytext', 3, sub -#line 316 "idl.yp" +#line 313 "pidl/idl.yp" { "$_[1]$_[2]$_[3]" } ], [#Rule 102 'anytext', 3, sub -#line 317 "idl.yp" +#line 314 "pidl/idl.yp" { "$_[1]$_[2]$_[3]" } ], [#Rule 103 'anytext', 3, sub -#line 318 "idl.yp" +#line 315 "pidl/idl.yp" { "$_[1]$_[2]$_[3]" } ], [#Rule 104 'anytext', 3, sub -#line 319 "idl.yp" +#line 316 "pidl/idl.yp" { "$_[1]$_[2]$_[3]" } ], [#Rule 105 'anytext', 3, sub -#line 320 "idl.yp" +#line 317 "pidl/idl.yp" { "$_[1]$_[2]$_[3]" } ], [#Rule 106 'anytext', 3, sub -#line 321 "idl.yp" +#line 318 "pidl/idl.yp" { "$_[1]$_[2]$_[3]" } ], [#Rule 107 'anytext', 3, sub -#line 322 "idl.yp" +#line 319 "pidl/idl.yp" { "$_[1]$_[2]$_[3]" } ], [#Rule 108 - 'anytext', 3, -sub -#line 323 "idl.yp" -{ "$_[1]$_[2]$_[3]" } - ], - [#Rule 109 - 'anytext', 3, -sub -#line 324 "idl.yp" -{ "$_[1]$_[2]$_[3]" } - ], - [#Rule 110 'anytext', 5, sub -#line 325 "idl.yp" +#line 320 "pidl/idl.yp" { "$_[1]$_[2]$_[3]$_[4]$_[5]" } ], - [#Rule 111 + [#Rule 109 'anytext', 5, sub -#line 326 "idl.yp" +#line 321 "pidl/idl.yp" { "$_[1]$_[2]$_[3]$_[4]$_[5]" } ], - [#Rule 112 + [#Rule 110 'identifier', 1, undef ], - [#Rule 113 + [#Rule 111 'optional_identifier', 1, undef ], - [#Rule 114 + [#Rule 112 'optional_identifier', 0, undef ], - [#Rule 115 + [#Rule 113 'constant', 1, undef ], - [#Rule 116 + [#Rule 114 'text', 1, sub -#line 340 "idl.yp" +#line 335 "pidl/idl.yp" { "\"$_[1]\"" } ], - [#Rule 117 + [#Rule 115 'optional_semicolon', 0, undef ], - [#Rule 118 + [#Rule 116 'optional_semicolon', 1, undef ] ], @@ -2422,7 +2359,7 @@ sub bless($self,$class); } -#line 351 "idl.yp" +#line 346 "pidl/idl.yp" use Parse::Pidl qw(error); diff --git a/source4/pidl/lib/Parse/Pidl/NDR.pm b/source4/pidl/lib/Parse/Pidl/NDR.pm index fc6bfe4c96..5a34c5f94f 100644 --- a/source4/pidl/lib/Parse/Pidl/NDR.pm +++ b/source4/pidl/lib/Parse/Pidl/NDR.pm @@ -688,7 +688,7 @@ sub ParseInterface($) if (!defined $idl->{PROPERTIES}->{endpoint}) { push @endpoints, "\"ncacn_np:[\\\\pipe\\\\" . $idl->{NAME} . "]\""; } else { - @endpoints = split / /, $idl->{PROPERTIES}->{endpoint}; + @endpoints = split /,/, $idl->{PROPERTIES}->{endpoint}; } return { diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index 2415b516c8..8326ce5fb6 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -384,7 +384,7 @@ sub ParseArrayPullHeader($$$$$$) sub compression_alg($$) { my ($e, $l) = @_; - my ($alg, $clen, $dlen) = split(/ /, $l->{COMPRESSION}); + my ($alg, $clen, $dlen) = split(/,/, $l->{COMPRESSION}); return $alg; } @@ -392,7 +392,7 @@ sub compression_alg($$) sub compression_clen($$$) { my ($e, $l, $env) = @_; - my ($alg, $clen, $dlen) = split(/ /, $l->{COMPRESSION}); + my ($alg, $clen, $dlen) = split(/,/, $l->{COMPRESSION}); return ParseExpr($clen, $env, $e->{ORIGINAL}); } @@ -400,7 +400,7 @@ sub compression_clen($$$) sub compression_dlen($$$) { my ($e,$l,$env) = @_; - my ($alg, $clen, $dlen) = split(/ /, $l->{COMPRESSION}); + my ($alg, $clen, $dlen) = split(/,/, $l->{COMPRESSION}); return ParseExpr($dlen, $env, $e->{ORIGINAL}); } @@ -830,7 +830,7 @@ sub ParseDataPull($$$$$$$) if (my $range = has_property($e, "range")) { $var_name = get_value_of($var_name); - my ($low, $high) = split(/ /, $range, 2); + my ($low, $high) = split(/,/, $range, 2); $self->pidl("if ($var_name < $low || $var_name > $high) {"); $self->pidl("\treturn ndr_pull_error($ndr, NDR_ERR_RANGE, \"value out of range\");"); $self->pidl("}"); @@ -2218,7 +2218,7 @@ sub FunctionTable($$) $interface->{PROPERTIES}->{authservice} = "\"host\""; } - my @a = split / /, $interface->{PROPERTIES}->{authservice}; + my @a = split /,/, $interface->{PROPERTIES}->{authservice}; my $authservice_count = $#a + 1; $self->pidl("static const char * const $interface->{NAME}\_authservice_strings[] = {"); @@ -2293,7 +2293,7 @@ sub HeaderInterface($$$) } if (defined $interface->{PROPERTIES}->{helper}) { - $self->HeaderInclude(split / /, $interface->{PROPERTIES}->{helper}); + $self->HeaderInclude(split /,/, $interface->{PROPERTIES}->{helper}); } if (defined $interface->{PROPERTIES}->{uuid}) { -- cgit From a4571e661f662eabf4ab15d5302b576333fd6371 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 1 Feb 2008 18:20:32 +0100 Subject: pidl: cosmetic fix to use the same value everywhere metze (This used to be commit 3c191981436ab3f7dd166a87875ffbac127fbdf5) --- source4/pidl/lib/Parse/Pidl/NDR.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/pidl/lib/Parse/Pidl') diff --git a/source4/pidl/lib/Parse/Pidl/NDR.pm b/source4/pidl/lib/Parse/Pidl/NDR.pm index 5a34c5f94f..98e8f183a2 100644 --- a/source4/pidl/lib/Parse/Pidl/NDR.pm +++ b/source4/pidl/lib/Parse/Pidl/NDR.pm @@ -623,7 +623,7 @@ sub CheckPointerTypes($$) foreach my $e (@{$s->{ELEMENTS}}) { if ($e->{POINTERS} and not defined(pointer_type($e))) { - $e->{PROPERTIES}->{$default} = 1; + $e->{PROPERTIES}->{$default} = '1'; } } } -- cgit From c94ee074998a623dd9e47ca35b73ba2a83fbfeca Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 1 Feb 2008 09:49:54 +0100 Subject: CHECKED... pidl/Samba4::NDR::Parser: move logic for extra get_pointer_of() into a function metze (This used to be commit 3369015f5d8c425e1a9f9d861471028f03f163bb) --- source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 59 ++++++++++++++---------- 1 file changed, 34 insertions(+), 25 deletions(-) (limited to 'source4/pidl/lib/Parse/Pidl') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index 8326ce5fb6..81e8a21625 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -669,23 +669,39 @@ sub ParsePtrPush($$$$) } } +sub need_pointer_to($$$) +{ + my ($e, $l, $scalar_only) = @_; + + my $t; + if (ref($l->{DATA_TYPE})) { + $t = "$l->{DATA_TYPE}->{TYPE}_$l->{DATA_TYPE}->{NAME}"; + } else { + $t = $l->{DATA_TYPE}; + } + + if (not Parse::Pidl::Typelist::is_scalar($t)) { + return 1 if $scalar_only; + } + + if (Parse::Pidl::Typelist::scalar_is_reference($t)) { + return 1; + } + + return 0; +} + sub ParseDataPrint($$$$) { my ($self, $e, $l, $var_name) = @_; - if (not ref($l->{DATA_TYPE}) or - defined($l->{DATA_TYPE}->{NAME})) { - my $t; - if (ref($l->{DATA_TYPE})) { - $t = "$l->{DATA_TYPE}->{TYPE}_$l->{DATA_TYPE}->{NAME}"; - } else { - $t = $l->{DATA_TYPE}; - } - if (not Parse::Pidl::Typelist::is_scalar($t) or - Parse::Pidl::Typelist::scalar_is_reference($t)) { + if (not ref($l->{DATA_TYPE}) or defined($l->{DATA_TYPE}->{NAME})) { + + if (need_pointer_to($e, $l, 1)) { $var_name = get_pointer_to($var_name); } - $self->pidl("ndr_print_$t(ndr, \"$e->{NAME}\", $var_name);"); + + $self->pidl(TypeFunctionName("ndr_print", $l->{DATA_TYPE})."(ndr, \"$e->{NAME}\", $var_name);"); } else { $self->ParseTypePrint($l->{DATA_TYPE}, $var_name); } @@ -815,12 +831,11 @@ sub ParseDataPull($$$$$$$) { my ($self,$e,$l,$ndr,$var_name,$primitives,$deferred) = @_; - if (not ref($l->{DATA_TYPE}) or - defined($l->{DATA_TYPE}->{NAME})) { + if (not ref($l->{DATA_TYPE}) or defined($l->{DATA_TYPE}->{NAME})) { my $ndr_flags = CalcNdrFlags($l, $primitives, $deferred); - if (Parse::Pidl::Typelist::scalar_is_reference($l->{DATA_TYPE})) { + if (need_pointer_to($e, $l, 0)) { $var_name = get_pointer_to($var_name); } @@ -845,21 +860,15 @@ sub ParseDataPush($$$$$$$) my ($self,$e,$l,$ndr,$var_name,$primitives,$deferred) = @_; if (not ref($l->{DATA_TYPE}) or defined($l->{DATA_TYPE}->{NAME})) { - my $t; - if (ref($l->{DATA_TYPE}) eq "HASH") { - $t = "$l->{DATA_TYPE}->{TYPE}_$l->{DATA_TYPE}->{NAME}"; - } else { - $t = $l->{DATA_TYPE}; - } - + + my $ndr_flags = CalcNdrFlags($l, $primitives, $deferred); + # strings are passed by value rather than reference - if (not Parse::Pidl::Typelist::is_scalar($t) or - Parse::Pidl::Typelist::scalar_is_reference($t)) { + if (need_pointer_to($e, $l, 1)) { $var_name = get_pointer_to($var_name); } - my $ndr_flags = CalcNdrFlags($l, $primitives, $deferred); - $self->pidl("NDR_CHECK(ndr_push_$t($ndr, $ndr_flags, $var_name));"); + $self->pidl("NDR_CHECK(".TypeFunctionName("ndr_push", $l->{DATA_TYPE})."($ndr, $ndr_flags, $var_name));"); } else { $self->ParseTypePush($l->{DATA_TYPE}, $var_name, $primitives, $deferred); } -- cgit From a0c83e990f6dfda809600a0160e383f89bfe2f6c Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 1 Feb 2008 09:54:25 +0100 Subject: CHECKED... TODO:MSG pidl/Samba4::NDR::Parser: fix ... metze (This used to be commit 29c104944bcad30c6a2a3fa70d527bf0ee8969de) --- source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'source4/pidl/lib/Parse/Pidl') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index 81e8a21625..281018d4cc 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -42,19 +42,21 @@ sub append_prefix($$) { my ($e, $var_name) = @_; my $pointers = 0; + my $arrays = 0; foreach my $l (@{$e->{LEVELS}}) { if ($l->{TYPE} eq "POINTER") { $pointers++; } elsif ($l->{TYPE} eq "ARRAY") { + $arrays++; if (($pointers == 0) and (not $l->{IS_FIXED}) and (not $l->{IS_INLINE})) { - return get_value_of($var_name); + return get_value_of($var_name); } } elsif ($l->{TYPE} eq "DATA") { if (Parse::Pidl::Typelist::scalar_is_reference($l->{DATA_TYPE})) { - return get_value_of($var_name) unless ($pointers); + return get_value_of($var_name) unless ($pointers or $arrays); } } } @@ -684,8 +686,17 @@ sub need_pointer_to($$$) return 1 if $scalar_only; } + my $arrays = 0; + + foreach my $tl (@{$e->{LEVELS}}) { + last if $l == $tl; + if ($tl->{TYPE} eq "ARRAY") { + $arrays++; + } + } + if (Parse::Pidl::Typelist::scalar_is_reference($t)) { - return 1; + return 1 unless $arrays; } return 0; -- cgit From 9e999a67a7d3ff6172a7bb5db28c2f528d74f87f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 31 Jan 2008 14:57:35 +0100 Subject: CHECKED... pidl/Samba4::NDR::Parser: correctly get the name of an array element When we have "*r->out.ous" (char ***ous, a pointer to a pointer to an array). we need to use "(*r->out.ous)[3]" to access the 3rd element of the array "*r->out.ous[3]" was generated before, but that's the same as "*(r->out.ous[3])". metze (This used to be commit 13afc89a87716063180723f0e9cb4f76daca837e) --- source4/pidl/lib/Parse/Pidl/CUtil.pm | 15 ++++++++++++++- source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 8 ++++---- 2 files changed, 18 insertions(+), 5 deletions(-) (limited to 'source4/pidl/lib/Parse/Pidl') diff --git a/source4/pidl/lib/Parse/Pidl/CUtil.pm b/source4/pidl/lib/Parse/Pidl/CUtil.pm index bd7b16812c..9deb6ee177 100644 --- a/source4/pidl/lib/Parse/Pidl/CUtil.pm +++ b/source4/pidl/lib/Parse/Pidl/CUtil.pm @@ -6,7 +6,7 @@ package Parse::Pidl::CUtil; require Exporter; @ISA = qw(Exporter); -@EXPORT = qw(get_pointer_to get_value_of); +@EXPORT = qw(get_pointer_to get_value_of get_array_element); use vars qw($VERSION); $VERSION = '0.01'; @@ -36,4 +36,17 @@ sub get_value_of($) } } +sub get_array_element($$) +{ + my ($var_name, $idx) = @_; + + if ($var_name =~ /^\*.*$/) { + $var_name = "($var_name)"; + } elsif ($var_name =~ /^\&.*$/) { + $var_name = "($var_name)"; + } + + return "$var_name"."[$idx]"; +} + 1; diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index 281018d4cc..81a8bf88cd 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -14,7 +14,7 @@ require Exporter; use strict; use Parse::Pidl::Typelist qw(hasType getType mapTypeName typeHasBody); use Parse::Pidl::Util qw(has_property ParseExpr ParseExprExt print_uuid); -use Parse::Pidl::CUtil qw(get_pointer_to get_value_of); +use Parse::Pidl::CUtil qw(get_pointer_to get_value_of get_array_element); use Parse::Pidl::NDR qw(GetPrevLevel GetNextLevel ContainsDeferred is_charset_array); use Parse::Pidl::Samba4 qw(is_intree choose_header); use Parse::Pidl::Samba4::Header qw(GenerateFunctionInEnv GenerateFunctionOutEnv EnvSubstituteValue GenerateStructEnv); @@ -584,7 +584,7 @@ sub ParseElementPushLevel my $length = ParseExpr($l->{LENGTH_IS}, $env, $e->{ORIGINAL}); my $counter = "cntr_$e->{NAME}_$l->{LEVEL_INDEX}"; - $var_name = $var_name . "[$counter]"; + $var_name = get_array_element($var_name, $counter); if (($primitives and not $l->{IS_DEFERRED}) or ($deferred and $l->{IS_DEFERRED})) { $self->pidl("for ($counter = 0; $counter < $length; $counter++) {"); @@ -779,7 +779,7 @@ sub ParseElementPrint($$$$) $self->pidl("if (idx_$l->{LEVEL_INDEX}) {"); $self->indent; - $var_name = $var_name . "[$counter]"; + $var_name = get_array_element($var_name, $counter); } } elsif ($l->{TYPE} eq "DATA") { $self->ParseDataPrint($e, $l, $var_name); @@ -1048,7 +1048,7 @@ sub ParseElementPullLevel my $counter = "cntr_$e->{NAME}_$l->{LEVEL_INDEX}"; my $array_name = $var_name; - $var_name = $var_name . "[$counter]"; + $var_name = get_array_element($var_name, $counter); $self->ParseMemCtxPullStart($e, $l, $array_name); -- cgit From 19898379bd23e4df1249aa78f50a2947ab63c7cf Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 1 Feb 2008 10:30:47 +0100 Subject: LOOKS OK... pidl: get the pointer types correct when an element has multiple pointers Only the first level gets the pointer type from the pointer property, the others get them from the pointer_default() interface property see http://msdn2.microsoft.com/en-us/library/aa378984(VS.85).aspx (Here they talk about the rightmost pointer, but testing shows they mean the leftmost pointer.) metze (This used to be commit 0569139ca2960ec5478829c3e66f7ff69bdb55cd) --- source4/pidl/lib/Parse/Pidl/NDR.pm | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) (limited to 'source4/pidl/lib/Parse/Pidl') diff --git a/source4/pidl/lib/Parse/Pidl/NDR.pm b/source4/pidl/lib/Parse/Pidl/NDR.pm index 98e8f183a2..7d8907c6b5 100644 --- a/source4/pidl/lib/Parse/Pidl/NDR.pm +++ b/source4/pidl/lib/Parse/Pidl/NDR.pm @@ -72,9 +72,9 @@ my $scalar_alignment = { 'ipv4address' => 4 }; -sub GetElementLevelTable($) +sub GetElementLevelTable($$) { - my $e = shift; + my ($e, $pointer_default) = @_; my $order = []; my $is_deferred = 0; @@ -157,25 +157,38 @@ sub GetElementLevelTable($) # Next, all the pointers foreach my $i (1..$e->{POINTERS}) { - my $pt = pointer_type($e); - my $level = "EMBEDDED"; # Top level "ref" pointers do not have a referrent identifier - $level = "TOP" if ( defined($pt) - and $i == 1 - and $e->{PARENT}->{TYPE} eq "FUNCTION"); + $level = "TOP" if ($i == 1 and $e->{PARENT}->{TYPE} eq "FUNCTION"); + + my $pt; + # + # Only the first level gets the pointer type from the + # pointer property, the others get them from + # the pointer_default() interface property + # + # see http://msdn2.microsoft.com/en-us/library/aa378984(VS.85).aspx + # (Here they talk about the rightmost pointer, but testing shows + # they mean the leftmost pointer.) + # + # --metze + # + if ($i == 1) { + $pt = pointer_type($e); + } else { + $pt = $pointer_default; + } push (@$order, { TYPE => "POINTER", - # for now, there can only be one pointer type per element - POINTER_TYPE => pointer_type($e), + POINTER_TYPE => $pt, POINTER_INDEX => $pointer_idx, IS_DEFERRED => "$is_deferred", LEVEL => $level }); warning($e, "top-level \[out\] pointer `$e->{NAME}' is not a \[ref\] pointer") - if ($i == 1 and pointer_type($e) ne "ref" and + if ($i == 1 and $pt ne "ref" and $e->{PARENT}->{TYPE} eq "FUNCTION" and not has_property($e, "in")); @@ -391,7 +404,7 @@ sub ParseElement($$) NAME => $e->{NAME}, TYPE => $e->{TYPE}, PROPERTIES => $e->{PROPERTIES}, - LEVELS => GetElementLevelTable($e), + LEVELS => GetElementLevelTable($e, $pointer_default), REPRESENTATION_TYPE => ($e->{PROPERTIES}->{represent_as} or $e->{TYPE}), ALIGN => align_type($e->{TYPE}), ORIGINAL => $e -- cgit From 2670c954466683bc3769fae4505baa78ec43a253 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 1 Feb 2008 23:09:37 +0100 Subject: WORKS!!!...pidl/NDR: fix handling of multilevel pointers in function elements The 2nd or higher level of wire pointers needs to be marked as deferred. metze (This used to be commit 6fcf2456d0e81898b5779ef1650f38b4c5363a80) --- source4/pidl/lib/Parse/Pidl/NDR.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source4/pidl/lib/Parse/Pidl') diff --git a/source4/pidl/lib/Parse/Pidl/NDR.pm b/source4/pidl/lib/Parse/Pidl/NDR.pm index 7d8907c6b5..003eaf0ba7 100644 --- a/source4/pidl/lib/Parse/Pidl/NDR.pm +++ b/source4/pidl/lib/Parse/Pidl/NDR.pm @@ -173,9 +173,9 @@ sub GetElementLevelTable($$) # # --metze # - if ($i == 1) { - $pt = pointer_type($e); - } else { + $pt = pointer_type($e); + if ($i > 1) { + $is_deferred = 1 if ($pt ne "ref" and $e->{PARENT}->{TYPE} eq "FUNCTION"); $pt = $pointer_default; } @@ -195,7 +195,7 @@ sub GetElementLevelTable($$) $pointer_idx++; # everything that follows will be deferred - $is_deferred = 1 if ($e->{PARENT}->{TYPE} ne "FUNCTION"); + $is_deferred = 1 if ($level ne "TOP"); my $array_size = shift @size_is; my $array_length; -- cgit From 4117839d7725a814c76c3869a23b6bd65cedf079 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 31 Jan 2008 15:04:22 +0100 Subject: Works!!!...pidl/Samba4::NDR::Parser: fix support for embedded "ref" pointers The memory allocation of embedded "ref" pointers needs to be the same as for all other embedded pointers. metze (This used to be commit 8ebf16c0741085fa769fcc2929f275ab49b1ea5d) --- source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source4/pidl/lib/Parse/Pidl') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index 81a8bf88cd..6e6d227681 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -929,7 +929,7 @@ sub ParseMemCtxPullFlags($$$$) ($nl->{DATA_TYPE} eq "string")); if ($next_is_array or $next_is_string) { return undef; - } else { + } elsif ($l->{LEVEL} eq "TOP") { $mem_flags = "LIBNDR_FLAG_REF_ALLOC"; } } @@ -1129,10 +1129,7 @@ sub ParsePtrPull($$$$$) my $next_is_string = (($nl->{TYPE} eq "DATA") and ($nl->{DATA_TYPE} eq "string")); - if ($l->{POINTER_TYPE} eq "ref") { - if ($l->{LEVEL} eq "EMBEDDED") { - $self->pidl("NDR_CHECK(ndr_pull_ref_ptr($ndr, &_ptr_$e->{NAME}));"); - } + if ($l->{POINTER_TYPE} eq "ref" and $l->{LEVEL} eq "TOP") { if (!$next_is_array and !$next_is_string) { $self->pidl("if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {"); @@ -1141,16 +1138,19 @@ sub ParsePtrPull($$$$$) } return; + } elsif ($l->{POINTER_TYPE} eq "ref" and $l->{LEVEL} eq "EMBEDDED") { + $self->pidl("NDR_CHECK(ndr_pull_ref_ptr($ndr, &_ptr_$e->{NAME}));"); } elsif (($l->{POINTER_TYPE} eq "unique") or ($l->{POINTER_TYPE} eq "relative") or ($l->{POINTER_TYPE} eq "full")) { $self->pidl("NDR_CHECK(ndr_pull_generic_ptr($ndr, &_ptr_$e->{NAME}));"); - $self->pidl("if (_ptr_$e->{NAME}) {"); - $self->indent; } else { die("Unhandled pointer type $l->{POINTER_TYPE}"); } + $self->pidl("if (_ptr_$e->{NAME}) {"); + $self->indent; + # Don't do this for arrays, they're allocated at the actual level # of the array unless ($next_is_array or $next_is_string) { -- cgit From e22c627ea1e700c30568399cf94df5b88b05f216 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 2 Feb 2008 11:13:03 +0100 Subject: pidl: revert changes it didn't want to push...sorry! 8ebf16c0741085fa769fcc2929f275ab49b1ea5d Works!!!...pidl/Samba4::NDR::Parser: fix support for embedded "ref" pointers 6fcf2456d0e81898b5779ef1650f38b4c5363a80 WORKS!!!...pidl/NDR: fix handling of multilevel pointers in function elements 0569139ca2960ec5478829c3e66f7ff69bdb55cd LOOKS OK... pidl: get the pointer types correct when an element has multiple pointe rs 13afc89a87716063180723f0e9cb4f76daca837e CHECKED... pidl/Samba4::NDR::Parser: correctly get the name of an array element 29c104944bcad30c6a2a3fa70d527bf0ee8969de CHECKED... TODO:MSG pidl/Samba4::NDR::Parser: fix ... 3369015f5d8c425e1a9f9d861471028f03f163bb CHECKED... pidl/Samba4::NDR::Parser: move logic for extra get_pointer_of() into a f unction metze (This used to be commit 0bcc8e53d1470ba9dfe93e5d6925b8f4c20c7c66) --- source4/pidl/lib/Parse/Pidl/CUtil.pm | 15 +--- source4/pidl/lib/Parse/Pidl/NDR.pm | 37 +++------ source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 96 ++++++++++-------------- 3 files changed, 51 insertions(+), 97 deletions(-) (limited to 'source4/pidl/lib/Parse/Pidl') diff --git a/source4/pidl/lib/Parse/Pidl/CUtil.pm b/source4/pidl/lib/Parse/Pidl/CUtil.pm index 9deb6ee177..bd7b16812c 100644 --- a/source4/pidl/lib/Parse/Pidl/CUtil.pm +++ b/source4/pidl/lib/Parse/Pidl/CUtil.pm @@ -6,7 +6,7 @@ package Parse::Pidl::CUtil; require Exporter; @ISA = qw(Exporter); -@EXPORT = qw(get_pointer_to get_value_of get_array_element); +@EXPORT = qw(get_pointer_to get_value_of); use vars qw($VERSION); $VERSION = '0.01'; @@ -36,17 +36,4 @@ sub get_value_of($) } } -sub get_array_element($$) -{ - my ($var_name, $idx) = @_; - - if ($var_name =~ /^\*.*$/) { - $var_name = "($var_name)"; - } elsif ($var_name =~ /^\&.*$/) { - $var_name = "($var_name)"; - } - - return "$var_name"."[$idx]"; -} - 1; diff --git a/source4/pidl/lib/Parse/Pidl/NDR.pm b/source4/pidl/lib/Parse/Pidl/NDR.pm index 003eaf0ba7..98e8f183a2 100644 --- a/source4/pidl/lib/Parse/Pidl/NDR.pm +++ b/source4/pidl/lib/Parse/Pidl/NDR.pm @@ -72,9 +72,9 @@ my $scalar_alignment = { 'ipv4address' => 4 }; -sub GetElementLevelTable($$) +sub GetElementLevelTable($) { - my ($e, $pointer_default) = @_; + my $e = shift; my $order = []; my $is_deferred = 0; @@ -157,45 +157,32 @@ sub GetElementLevelTable($$) # Next, all the pointers foreach my $i (1..$e->{POINTERS}) { + my $pt = pointer_type($e); + my $level = "EMBEDDED"; # Top level "ref" pointers do not have a referrent identifier - $level = "TOP" if ($i == 1 and $e->{PARENT}->{TYPE} eq "FUNCTION"); - - my $pt; - # - # Only the first level gets the pointer type from the - # pointer property, the others get them from - # the pointer_default() interface property - # - # see http://msdn2.microsoft.com/en-us/library/aa378984(VS.85).aspx - # (Here they talk about the rightmost pointer, but testing shows - # they mean the leftmost pointer.) - # - # --metze - # - $pt = pointer_type($e); - if ($i > 1) { - $is_deferred = 1 if ($pt ne "ref" and $e->{PARENT}->{TYPE} eq "FUNCTION"); - $pt = $pointer_default; - } + $level = "TOP" if ( defined($pt) + and $i == 1 + and $e->{PARENT}->{TYPE} eq "FUNCTION"); push (@$order, { TYPE => "POINTER", - POINTER_TYPE => $pt, + # for now, there can only be one pointer type per element + POINTER_TYPE => pointer_type($e), POINTER_INDEX => $pointer_idx, IS_DEFERRED => "$is_deferred", LEVEL => $level }); warning($e, "top-level \[out\] pointer `$e->{NAME}' is not a \[ref\] pointer") - if ($i == 1 and $pt ne "ref" and + if ($i == 1 and pointer_type($e) ne "ref" and $e->{PARENT}->{TYPE} eq "FUNCTION" and not has_property($e, "in")); $pointer_idx++; # everything that follows will be deferred - $is_deferred = 1 if ($level ne "TOP"); + $is_deferred = 1 if ($e->{PARENT}->{TYPE} ne "FUNCTION"); my $array_size = shift @size_is; my $array_length; @@ -404,7 +391,7 @@ sub ParseElement($$) NAME => $e->{NAME}, TYPE => $e->{TYPE}, PROPERTIES => $e->{PROPERTIES}, - LEVELS => GetElementLevelTable($e, $pointer_default), + LEVELS => GetElementLevelTable($e), REPRESENTATION_TYPE => ($e->{PROPERTIES}->{represent_as} or $e->{TYPE}), ALIGN => align_type($e->{TYPE}), ORIGINAL => $e diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index 6e6d227681..8326ce5fb6 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -14,7 +14,7 @@ require Exporter; use strict; use Parse::Pidl::Typelist qw(hasType getType mapTypeName typeHasBody); use Parse::Pidl::Util qw(has_property ParseExpr ParseExprExt print_uuid); -use Parse::Pidl::CUtil qw(get_pointer_to get_value_of get_array_element); +use Parse::Pidl::CUtil qw(get_pointer_to get_value_of); use Parse::Pidl::NDR qw(GetPrevLevel GetNextLevel ContainsDeferred is_charset_array); use Parse::Pidl::Samba4 qw(is_intree choose_header); use Parse::Pidl::Samba4::Header qw(GenerateFunctionInEnv GenerateFunctionOutEnv EnvSubstituteValue GenerateStructEnv); @@ -42,21 +42,19 @@ sub append_prefix($$) { my ($e, $var_name) = @_; my $pointers = 0; - my $arrays = 0; foreach my $l (@{$e->{LEVELS}}) { if ($l->{TYPE} eq "POINTER") { $pointers++; } elsif ($l->{TYPE} eq "ARRAY") { - $arrays++; if (($pointers == 0) and (not $l->{IS_FIXED}) and (not $l->{IS_INLINE})) { - return get_value_of($var_name); + return get_value_of($var_name); } } elsif ($l->{TYPE} eq "DATA") { if (Parse::Pidl::Typelist::scalar_is_reference($l->{DATA_TYPE})) { - return get_value_of($var_name) unless ($pointers or $arrays); + return get_value_of($var_name) unless ($pointers); } } } @@ -584,7 +582,7 @@ sub ParseElementPushLevel my $length = ParseExpr($l->{LENGTH_IS}, $env, $e->{ORIGINAL}); my $counter = "cntr_$e->{NAME}_$l->{LEVEL_INDEX}"; - $var_name = get_array_element($var_name, $counter); + $var_name = $var_name . "[$counter]"; if (($primitives and not $l->{IS_DEFERRED}) or ($deferred and $l->{IS_DEFERRED})) { $self->pidl("for ($counter = 0; $counter < $length; $counter++) {"); @@ -671,48 +669,23 @@ sub ParsePtrPush($$$$) } } -sub need_pointer_to($$$) -{ - my ($e, $l, $scalar_only) = @_; - - my $t; - if (ref($l->{DATA_TYPE})) { - $t = "$l->{DATA_TYPE}->{TYPE}_$l->{DATA_TYPE}->{NAME}"; - } else { - $t = $l->{DATA_TYPE}; - } - - if (not Parse::Pidl::Typelist::is_scalar($t)) { - return 1 if $scalar_only; - } - - my $arrays = 0; - - foreach my $tl (@{$e->{LEVELS}}) { - last if $l == $tl; - if ($tl->{TYPE} eq "ARRAY") { - $arrays++; - } - } - - if (Parse::Pidl::Typelist::scalar_is_reference($t)) { - return 1 unless $arrays; - } - - return 0; -} - sub ParseDataPrint($$$$) { my ($self, $e, $l, $var_name) = @_; - if (not ref($l->{DATA_TYPE}) or defined($l->{DATA_TYPE}->{NAME})) { - - if (need_pointer_to($e, $l, 1)) { + if (not ref($l->{DATA_TYPE}) or + defined($l->{DATA_TYPE}->{NAME})) { + my $t; + if (ref($l->{DATA_TYPE})) { + $t = "$l->{DATA_TYPE}->{TYPE}_$l->{DATA_TYPE}->{NAME}"; + } else { + $t = $l->{DATA_TYPE}; + } + if (not Parse::Pidl::Typelist::is_scalar($t) or + Parse::Pidl::Typelist::scalar_is_reference($t)) { $var_name = get_pointer_to($var_name); } - - $self->pidl(TypeFunctionName("ndr_print", $l->{DATA_TYPE})."(ndr, \"$e->{NAME}\", $var_name);"); + $self->pidl("ndr_print_$t(ndr, \"$e->{NAME}\", $var_name);"); } else { $self->ParseTypePrint($l->{DATA_TYPE}, $var_name); } @@ -779,7 +752,7 @@ sub ParseElementPrint($$$$) $self->pidl("if (idx_$l->{LEVEL_INDEX}) {"); $self->indent; - $var_name = get_array_element($var_name, $counter); + $var_name = $var_name . "[$counter]"; } } elsif ($l->{TYPE} eq "DATA") { $self->ParseDataPrint($e, $l, $var_name); @@ -842,11 +815,12 @@ sub ParseDataPull($$$$$$$) { my ($self,$e,$l,$ndr,$var_name,$primitives,$deferred) = @_; - if (not ref($l->{DATA_TYPE}) or defined($l->{DATA_TYPE}->{NAME})) { + if (not ref($l->{DATA_TYPE}) or + defined($l->{DATA_TYPE}->{NAME})) { my $ndr_flags = CalcNdrFlags($l, $primitives, $deferred); - if (need_pointer_to($e, $l, 0)) { + if (Parse::Pidl::Typelist::scalar_is_reference($l->{DATA_TYPE})) { $var_name = get_pointer_to($var_name); } @@ -871,15 +845,21 @@ sub ParseDataPush($$$$$$$) my ($self,$e,$l,$ndr,$var_name,$primitives,$deferred) = @_; if (not ref($l->{DATA_TYPE}) or defined($l->{DATA_TYPE}->{NAME})) { - - my $ndr_flags = CalcNdrFlags($l, $primitives, $deferred); - + my $t; + if (ref($l->{DATA_TYPE}) eq "HASH") { + $t = "$l->{DATA_TYPE}->{TYPE}_$l->{DATA_TYPE}->{NAME}"; + } else { + $t = $l->{DATA_TYPE}; + } + # strings are passed by value rather than reference - if (need_pointer_to($e, $l, 1)) { + if (not Parse::Pidl::Typelist::is_scalar($t) or + Parse::Pidl::Typelist::scalar_is_reference($t)) { $var_name = get_pointer_to($var_name); } - $self->pidl("NDR_CHECK(".TypeFunctionName("ndr_push", $l->{DATA_TYPE})."($ndr, $ndr_flags, $var_name));"); + my $ndr_flags = CalcNdrFlags($l, $primitives, $deferred); + $self->pidl("NDR_CHECK(ndr_push_$t($ndr, $ndr_flags, $var_name));"); } else { $self->ParseTypePush($l->{DATA_TYPE}, $var_name, $primitives, $deferred); } @@ -929,7 +909,7 @@ sub ParseMemCtxPullFlags($$$$) ($nl->{DATA_TYPE} eq "string")); if ($next_is_array or $next_is_string) { return undef; - } elsif ($l->{LEVEL} eq "TOP") { + } else { $mem_flags = "LIBNDR_FLAG_REF_ALLOC"; } } @@ -1048,7 +1028,7 @@ sub ParseElementPullLevel my $counter = "cntr_$e->{NAME}_$l->{LEVEL_INDEX}"; my $array_name = $var_name; - $var_name = get_array_element($var_name, $counter); + $var_name = $var_name . "[$counter]"; $self->ParseMemCtxPullStart($e, $l, $array_name); @@ -1129,7 +1109,10 @@ sub ParsePtrPull($$$$$) my $next_is_string = (($nl->{TYPE} eq "DATA") and ($nl->{DATA_TYPE} eq "string")); - if ($l->{POINTER_TYPE} eq "ref" and $l->{LEVEL} eq "TOP") { + if ($l->{POINTER_TYPE} eq "ref") { + if ($l->{LEVEL} eq "EMBEDDED") { + $self->pidl("NDR_CHECK(ndr_pull_ref_ptr($ndr, &_ptr_$e->{NAME}));"); + } if (!$next_is_array and !$next_is_string) { $self->pidl("if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {"); @@ -1138,19 +1121,16 @@ sub ParsePtrPull($$$$$) } return; - } elsif ($l->{POINTER_TYPE} eq "ref" and $l->{LEVEL} eq "EMBEDDED") { - $self->pidl("NDR_CHECK(ndr_pull_ref_ptr($ndr, &_ptr_$e->{NAME}));"); } elsif (($l->{POINTER_TYPE} eq "unique") or ($l->{POINTER_TYPE} eq "relative") or ($l->{POINTER_TYPE} eq "full")) { $self->pidl("NDR_CHECK(ndr_pull_generic_ptr($ndr, &_ptr_$e->{NAME}));"); + $self->pidl("if (_ptr_$e->{NAME}) {"); + $self->indent; } else { die("Unhandled pointer type $l->{POINTER_TYPE}"); } - $self->pidl("if (_ptr_$e->{NAME}) {"); - $self->indent; - # Don't do this for arrays, they're allocated at the actual level # of the array unless ($next_is_array or $next_is_string) { -- cgit From 9475a76afc41675a9c6a9b42d618a49821a8a5b4 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 1 Feb 2008 09:49:54 +0100 Subject: pidl/Samba4::NDR::Parser: move logic for extra get_pointer_of() into a function metze (This used to be commit 26d7f5bf96cd7e950ceb532402afd6b8a58871ea) --- source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 59 ++++++++++++++---------- 1 file changed, 34 insertions(+), 25 deletions(-) (limited to 'source4/pidl/lib/Parse/Pidl') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index 8326ce5fb6..81e8a21625 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -669,23 +669,39 @@ sub ParsePtrPush($$$$) } } +sub need_pointer_to($$$) +{ + my ($e, $l, $scalar_only) = @_; + + my $t; + if (ref($l->{DATA_TYPE})) { + $t = "$l->{DATA_TYPE}->{TYPE}_$l->{DATA_TYPE}->{NAME}"; + } else { + $t = $l->{DATA_TYPE}; + } + + if (not Parse::Pidl::Typelist::is_scalar($t)) { + return 1 if $scalar_only; + } + + if (Parse::Pidl::Typelist::scalar_is_reference($t)) { + return 1; + } + + return 0; +} + sub ParseDataPrint($$$$) { my ($self, $e, $l, $var_name) = @_; - if (not ref($l->{DATA_TYPE}) or - defined($l->{DATA_TYPE}->{NAME})) { - my $t; - if (ref($l->{DATA_TYPE})) { - $t = "$l->{DATA_TYPE}->{TYPE}_$l->{DATA_TYPE}->{NAME}"; - } else { - $t = $l->{DATA_TYPE}; - } - if (not Parse::Pidl::Typelist::is_scalar($t) or - Parse::Pidl::Typelist::scalar_is_reference($t)) { + if (not ref($l->{DATA_TYPE}) or defined($l->{DATA_TYPE}->{NAME})) { + + if (need_pointer_to($e, $l, 1)) { $var_name = get_pointer_to($var_name); } - $self->pidl("ndr_print_$t(ndr, \"$e->{NAME}\", $var_name);"); + + $self->pidl(TypeFunctionName("ndr_print", $l->{DATA_TYPE})."(ndr, \"$e->{NAME}\", $var_name);"); } else { $self->ParseTypePrint($l->{DATA_TYPE}, $var_name); } @@ -815,12 +831,11 @@ sub ParseDataPull($$$$$$$) { my ($self,$e,$l,$ndr,$var_name,$primitives,$deferred) = @_; - if (not ref($l->{DATA_TYPE}) or - defined($l->{DATA_TYPE}->{NAME})) { + if (not ref($l->{DATA_TYPE}) or defined($l->{DATA_TYPE}->{NAME})) { my $ndr_flags = CalcNdrFlags($l, $primitives, $deferred); - if (Parse::Pidl::Typelist::scalar_is_reference($l->{DATA_TYPE})) { + if (need_pointer_to($e, $l, 0)) { $var_name = get_pointer_to($var_name); } @@ -845,21 +860,15 @@ sub ParseDataPush($$$$$$$) my ($self,$e,$l,$ndr,$var_name,$primitives,$deferred) = @_; if (not ref($l->{DATA_TYPE}) or defined($l->{DATA_TYPE}->{NAME})) { - my $t; - if (ref($l->{DATA_TYPE}) eq "HASH") { - $t = "$l->{DATA_TYPE}->{TYPE}_$l->{DATA_TYPE}->{NAME}"; - } else { - $t = $l->{DATA_TYPE}; - } - + + my $ndr_flags = CalcNdrFlags($l, $primitives, $deferred); + # strings are passed by value rather than reference - if (not Parse::Pidl::Typelist::is_scalar($t) or - Parse::Pidl::Typelist::scalar_is_reference($t)) { + if (need_pointer_to($e, $l, 1)) { $var_name = get_pointer_to($var_name); } - my $ndr_flags = CalcNdrFlags($l, $primitives, $deferred); - $self->pidl("NDR_CHECK(ndr_push_$t($ndr, $ndr_flags, $var_name));"); + $self->pidl("NDR_CHECK(".TypeFunctionName("ndr_push", $l->{DATA_TYPE})."($ndr, $ndr_flags, $var_name));"); } else { $self->ParseTypePush($l->{DATA_TYPE}, $var_name, $primitives, $deferred); } -- cgit From b3d4f22b30b98d16d9a779e26cd9555fe18a67e4 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 1 Feb 2008 09:54:25 +0100 Subject: pidl/Samba4::NDR::Parser: fix $var_name for arrays of scalar reference types uint32 num; nstring strings[num]; this should use 'r->strings' instead of '*r->strings' as the pointer to the array. metze (This used to be commit 7c7acae817cd00ab5c915742338b019af79e9193) --- source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'source4/pidl/lib/Parse/Pidl') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index 81e8a21625..281018d4cc 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -42,19 +42,21 @@ sub append_prefix($$) { my ($e, $var_name) = @_; my $pointers = 0; + my $arrays = 0; foreach my $l (@{$e->{LEVELS}}) { if ($l->{TYPE} eq "POINTER") { $pointers++; } elsif ($l->{TYPE} eq "ARRAY") { + $arrays++; if (($pointers == 0) and (not $l->{IS_FIXED}) and (not $l->{IS_INLINE})) { - return get_value_of($var_name); + return get_value_of($var_name); } } elsif ($l->{TYPE} eq "DATA") { if (Parse::Pidl::Typelist::scalar_is_reference($l->{DATA_TYPE})) { - return get_value_of($var_name) unless ($pointers); + return get_value_of($var_name) unless ($pointers or $arrays); } } } @@ -684,8 +686,17 @@ sub need_pointer_to($$$) return 1 if $scalar_only; } + my $arrays = 0; + + foreach my $tl (@{$e->{LEVELS}}) { + last if $l == $tl; + if ($tl->{TYPE} eq "ARRAY") { + $arrays++; + } + } + if (Parse::Pidl::Typelist::scalar_is_reference($t)) { - return 1; + return 1 unless $arrays; } return 0; -- cgit From c3008e086b1a87c5f4add2a7d1474c2f9a34bfd2 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 31 Jan 2008 14:57:35 +0100 Subject: pidl/Samba4::NDR::Parser: correctly get the name of an array element When we have "*r->out.ous" (char ***ous, a pointer to a pointer to an array of pointers). we need to use "(*r->out.ous)[3]" to access the 3rd element of the array "*r->out.ous[3]" was generated before, but that's the same as "*(r->out.ous[3])" which would mean the array would apply to a different level. This patch prepares support for: [out,ref,size_is(,num)] [string,charset(UTF16)] uint16 ***names; It means a [ref] pointer to a [unique] pointer to an array of [unique] pointers which point to an UTF16 string. metze (This used to be commit ec0ee2aa5f4bef32f09a426d91c28c985f843038) --- source4/pidl/lib/Parse/Pidl/CUtil.pm | 15 ++++++++++++++- source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 8 ++++---- 2 files changed, 18 insertions(+), 5 deletions(-) (limited to 'source4/pidl/lib/Parse/Pidl') diff --git a/source4/pidl/lib/Parse/Pidl/CUtil.pm b/source4/pidl/lib/Parse/Pidl/CUtil.pm index bd7b16812c..9deb6ee177 100644 --- a/source4/pidl/lib/Parse/Pidl/CUtil.pm +++ b/source4/pidl/lib/Parse/Pidl/CUtil.pm @@ -6,7 +6,7 @@ package Parse::Pidl::CUtil; require Exporter; @ISA = qw(Exporter); -@EXPORT = qw(get_pointer_to get_value_of); +@EXPORT = qw(get_pointer_to get_value_of get_array_element); use vars qw($VERSION); $VERSION = '0.01'; @@ -36,4 +36,17 @@ sub get_value_of($) } } +sub get_array_element($$) +{ + my ($var_name, $idx) = @_; + + if ($var_name =~ /^\*.*$/) { + $var_name = "($var_name)"; + } elsif ($var_name =~ /^\&.*$/) { + $var_name = "($var_name)"; + } + + return "$var_name"."[$idx]"; +} + 1; diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index 281018d4cc..81a8bf88cd 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -14,7 +14,7 @@ require Exporter; use strict; use Parse::Pidl::Typelist qw(hasType getType mapTypeName typeHasBody); use Parse::Pidl::Util qw(has_property ParseExpr ParseExprExt print_uuid); -use Parse::Pidl::CUtil qw(get_pointer_to get_value_of); +use Parse::Pidl::CUtil qw(get_pointer_to get_value_of get_array_element); use Parse::Pidl::NDR qw(GetPrevLevel GetNextLevel ContainsDeferred is_charset_array); use Parse::Pidl::Samba4 qw(is_intree choose_header); use Parse::Pidl::Samba4::Header qw(GenerateFunctionInEnv GenerateFunctionOutEnv EnvSubstituteValue GenerateStructEnv); @@ -584,7 +584,7 @@ sub ParseElementPushLevel my $length = ParseExpr($l->{LENGTH_IS}, $env, $e->{ORIGINAL}); my $counter = "cntr_$e->{NAME}_$l->{LEVEL_INDEX}"; - $var_name = $var_name . "[$counter]"; + $var_name = get_array_element($var_name, $counter); if (($primitives and not $l->{IS_DEFERRED}) or ($deferred and $l->{IS_DEFERRED})) { $self->pidl("for ($counter = 0; $counter < $length; $counter++) {"); @@ -779,7 +779,7 @@ sub ParseElementPrint($$$$) $self->pidl("if (idx_$l->{LEVEL_INDEX}) {"); $self->indent; - $var_name = $var_name . "[$counter]"; + $var_name = get_array_element($var_name, $counter); } } elsif ($l->{TYPE} eq "DATA") { $self->ParseDataPrint($e, $l, $var_name); @@ -1048,7 +1048,7 @@ sub ParseElementPullLevel my $counter = "cntr_$e->{NAME}_$l->{LEVEL_INDEX}"; my $array_name = $var_name; - $var_name = $var_name . "[$counter]"; + $var_name = get_array_element($var_name, $counter); $self->ParseMemCtxPullStart($e, $l, $array_name); -- cgit From 31fac9d66b0cba7a00b0887715cf7b7104108180 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 2 Feb 2008 10:18:33 +0100 Subject: pidl: remove 'pointer_default_top()' support metze (This used to be commit 145d6c8ea0eafc69cdeca45fbf296148b890133d) --- source4/pidl/lib/Parse/Pidl/Compat.pm | 4 ---- source4/pidl/lib/Parse/Pidl/NDR.pm | 9 +-------- 2 files changed, 1 insertion(+), 12 deletions(-) (limited to 'source4/pidl/lib/Parse/Pidl') diff --git a/source4/pidl/lib/Parse/Pidl/Compat.pm b/source4/pidl/lib/Parse/Pidl/Compat.pm index 7939bb2df2..7519021144 100644 --- a/source4/pidl/lib/Parse/Pidl/Compat.pm +++ b/source4/pidl/lib/Parse/Pidl/Compat.pm @@ -148,10 +148,6 @@ sub CheckInterface($) { my $if = shift; - if (has_property($if, "pointer_default_top") and - $if->{PROPERTIES}->{pointer_default_top} ne "ref") { - warning($if, "pointer_default_top() is pidl-specific"); - } } sub Check($) diff --git a/source4/pidl/lib/Parse/Pidl/NDR.pm b/source4/pidl/lib/Parse/Pidl/NDR.pm index 98e8f183a2..fb1e65854c 100644 --- a/source4/pidl/lib/Parse/Pidl/NDR.pm +++ b/source4/pidl/lib/Parse/Pidl/NDR.pm @@ -581,7 +581,7 @@ sub ParseFunction($$$) my $rettype = undef; my $thisopnum = undef; - CheckPointerTypes($d, $ndr->{PROPERTIES}->{pointer_default_top}); + CheckPointerTypes($d, "ref"); if (not defined($d->{PROPERTIES}{noopnum})) { $thisopnum = ${$opnum}; @@ -661,12 +661,6 @@ sub ParseInterface($) $idl->{PROPERTIES}->{pointer_default} = "unique"; } - if (not has_property($idl, "pointer_default_top")) { - $idl->{PROPERTIES}->{pointer_default_top} = "ref"; - } else { - warning($idl, "pointer_default_top() is a pidl extension and should not be used"); - } - foreach my $d (@{$idl->{DATA}}) { if ($d->{TYPE} eq "FUNCTION") { push (@functions, ParseFunction($idl, $d, \$opnum)); @@ -824,7 +818,6 @@ my %property_list = ( "uuid" => ["INTERFACE"], "endpoint" => ["INTERFACE"], "pointer_default" => ["INTERFACE"], - "pointer_default_top" => ["INTERFACE"], "helper" => ["INTERFACE"], "authservice" => ["INTERFACE"], -- cgit From 1ea5b06307b6057297700ce2b65b2055994869e2 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 1 Feb 2008 10:30:47 +0100 Subject: pidl: get the pointer types correct when an element has multiple pointers Only the first level gets the pointer type from the pointer property, the others get them from the pointer_default() interface property see http://msdn2.microsoft.com/en-us/library/aa378984(VS.85).aspx (Here they talk about the rightmost pointer, but testing shows they mean the leftmost pointer.) metze (This used to be commit aa8518521b2a6a7110c84c4981c53acce7389ee9) --- source4/pidl/lib/Parse/Pidl/NDR.pm | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) (limited to 'source4/pidl/lib/Parse/Pidl') diff --git a/source4/pidl/lib/Parse/Pidl/NDR.pm b/source4/pidl/lib/Parse/Pidl/NDR.pm index fb1e65854c..1106247355 100644 --- a/source4/pidl/lib/Parse/Pidl/NDR.pm +++ b/source4/pidl/lib/Parse/Pidl/NDR.pm @@ -72,9 +72,9 @@ my $scalar_alignment = { 'ipv4address' => 4 }; -sub GetElementLevelTable($) +sub GetElementLevelTable($$) { - my $e = shift; + my ($e, $pointer_default) = @_; my $order = []; my $is_deferred = 0; @@ -157,25 +157,38 @@ sub GetElementLevelTable($) # Next, all the pointers foreach my $i (1..$e->{POINTERS}) { - my $pt = pointer_type($e); - my $level = "EMBEDDED"; # Top level "ref" pointers do not have a referrent identifier - $level = "TOP" if ( defined($pt) - and $i == 1 - and $e->{PARENT}->{TYPE} eq "FUNCTION"); + $level = "TOP" if ($i == 1 and $e->{PARENT}->{TYPE} eq "FUNCTION"); + + my $pt; + # + # Only the first level gets the pointer type from the + # pointer property, the others get them from + # the pointer_default() interface property + # + # see http://msdn2.microsoft.com/en-us/library/aa378984(VS.85).aspx + # (Here they talk about the rightmost pointer, but testing shows + # they mean the leftmost pointer.) + # + # --metze + # + if ($i == 1) { + $pt = pointer_type($e); + } else { + $pt = $pointer_default; + } push (@$order, { TYPE => "POINTER", - # for now, there can only be one pointer type per element - POINTER_TYPE => pointer_type($e), + POINTER_TYPE => $pt, POINTER_INDEX => $pointer_idx, IS_DEFERRED => "$is_deferred", LEVEL => $level }); warning($e, "top-level \[out\] pointer `$e->{NAME}' is not a \[ref\] pointer") - if ($i == 1 and pointer_type($e) ne "ref" and + if ($i == 1 and $pt ne "ref" and $e->{PARENT}->{TYPE} eq "FUNCTION" and not has_property($e, "in")); @@ -391,7 +404,7 @@ sub ParseElement($$) NAME => $e->{NAME}, TYPE => $e->{TYPE}, PROPERTIES => $e->{PROPERTIES}, - LEVELS => GetElementLevelTable($e), + LEVELS => GetElementLevelTable($e, $pointer_default), REPRESENTATION_TYPE => ($e->{PROPERTIES}->{represent_as} or $e->{TYPE}), ALIGN => align_type($e->{TYPE}), ORIGINAL => $e -- cgit From c713b58a00b7cb5ef34b101ba5b74c8d9ec505ba Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 1 Feb 2008 23:09:37 +0100 Subject: pidl/NDR: fix handling of multilevel pointers in function elements The 2nd or higher level of wire pointers needs to be marked as deferred. metze (This used to be commit d7970d70329e0d4f9de30ccfcedd03e583817fa2) --- source4/pidl/lib/Parse/Pidl/NDR.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source4/pidl/lib/Parse/Pidl') diff --git a/source4/pidl/lib/Parse/Pidl/NDR.pm b/source4/pidl/lib/Parse/Pidl/NDR.pm index 1106247355..86ed1a8d10 100644 --- a/source4/pidl/lib/Parse/Pidl/NDR.pm +++ b/source4/pidl/lib/Parse/Pidl/NDR.pm @@ -173,9 +173,9 @@ sub GetElementLevelTable($$) # # --metze # - if ($i == 1) { - $pt = pointer_type($e); - } else { + $pt = pointer_type($e); + if ($i > 1) { + $is_deferred = 1 if ($pt ne "ref" and $e->{PARENT}->{TYPE} eq "FUNCTION"); $pt = $pointer_default; } @@ -195,7 +195,7 @@ sub GetElementLevelTable($$) $pointer_idx++; # everything that follows will be deferred - $is_deferred = 1 if ($e->{PARENT}->{TYPE} ne "FUNCTION"); + $is_deferred = 1 if ($level ne "TOP"); my $array_size = shift @size_is; my $array_length; -- cgit From e7c178629fcf13fc5e008ebb98ca55583aa65ffe Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 31 Jan 2008 15:04:22 +0100 Subject: pidl/Samba4::NDR::Parser: fix support for embedded "ref" pointers The memory allocation of embedded "ref" pointers needs to be the same as for all other embedded pointers. metze (This used to be commit 6b3817c2250b94307ffcbd9f8eeb9a593eb7a82d) --- source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source4/pidl/lib/Parse/Pidl') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index 81a8bf88cd..6e6d227681 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -929,7 +929,7 @@ sub ParseMemCtxPullFlags($$$$) ($nl->{DATA_TYPE} eq "string")); if ($next_is_array or $next_is_string) { return undef; - } else { + } elsif ($l->{LEVEL} eq "TOP") { $mem_flags = "LIBNDR_FLAG_REF_ALLOC"; } } @@ -1129,10 +1129,7 @@ sub ParsePtrPull($$$$$) my $next_is_string = (($nl->{TYPE} eq "DATA") and ($nl->{DATA_TYPE} eq "string")); - if ($l->{POINTER_TYPE} eq "ref") { - if ($l->{LEVEL} eq "EMBEDDED") { - $self->pidl("NDR_CHECK(ndr_pull_ref_ptr($ndr, &_ptr_$e->{NAME}));"); - } + if ($l->{POINTER_TYPE} eq "ref" and $l->{LEVEL} eq "TOP") { if (!$next_is_array and !$next_is_string) { $self->pidl("if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {"); @@ -1141,16 +1138,19 @@ sub ParsePtrPull($$$$$) } return; + } elsif ($l->{POINTER_TYPE} eq "ref" and $l->{LEVEL} eq "EMBEDDED") { + $self->pidl("NDR_CHECK(ndr_pull_ref_ptr($ndr, &_ptr_$e->{NAME}));"); } elsif (($l->{POINTER_TYPE} eq "unique") or ($l->{POINTER_TYPE} eq "relative") or ($l->{POINTER_TYPE} eq "full")) { $self->pidl("NDR_CHECK(ndr_pull_generic_ptr($ndr, &_ptr_$e->{NAME}));"); - $self->pidl("if (_ptr_$e->{NAME}) {"); - $self->indent; } else { die("Unhandled pointer type $l->{POINTER_TYPE}"); } + $self->pidl("if (_ptr_$e->{NAME}) {"); + $self->indent; + # Don't do this for arrays, they're allocated at the actual level # of the array unless ($next_is_array or $next_is_string) { -- cgit From c60d0a10ea9086dc58aa70386860ead0522c1c68 Mon Sep 17 00:00:00 2001 From: Julien Kerihuel Date: Sat, 9 Feb 2008 16:26:16 +0100 Subject: pidl: Allow fixed size arrays inside unions. (This used to be commit c9c115647893478e21134f8c703e0f52e2478882) --- source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/pidl/lib/Parse/Pidl') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index 6e6d227681..60d5bf8781 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -1611,7 +1611,7 @@ sub ParseUnionPushPrimitives($$$) if ($el->{CASE} eq "default") { $have_default = 1; } - $self->pidl("$el->{CASE}:"); + $self->pidl("$el->{CASE}: {"); if ($el->{TYPE} ne "EMPTY") { $self->indent; @@ -1625,7 +1625,7 @@ sub ParseUnionPushPrimitives($$$) $self->ParseElementPush($el, "ndr", {$el->{NAME} => "$varname->$el->{NAME}"}, 1, 0); $self->deindent; } - $self->pidl("break;"); + $self->pidl("break; }"); $self->pidl(""); } if (! $have_default) { -- cgit