From de5f7da321d8e808c4d0e2646488de5f0d443837 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Sat, 24 Nov 2001 23:39:12 +0000 Subject: Renamed functions from Dump* to Parse* (This used to be commit 952b47dc23ee648daf065d08d35fab839e4afd04) --- source4/build/pidl/parser.pm | 64 ++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'source4/build/pidl') diff --git a/source4/build/pidl/parser.pm b/source4/build/pidl/parser.pm index cad4d10d42..03bc5f3aff 100644 --- a/source4/build/pidl/parser.pm +++ b/source4/build/pidl/parser.pm @@ -10,8 +10,8 @@ use Data::Dumper; my($res); ##################################################################### -# dump a properties list -sub DumpProperties($) +# parse a properties list +sub ParseProperties($) { my($props) = shift; foreach my $d (@{$props}) { @@ -26,12 +26,12 @@ sub DumpProperties($) } ##################################################################### -# dump a structure element -sub DumpElement($) +# parse a structure element +sub ParseElement($) { my($element) = shift; - (defined $element->{PROPERTIES}) && DumpProperties($element->{PROPERTIES}); - DumpType($element->{TYPE}); + (defined $element->{PROPERTIES}) && ParseProperties($element->{PROPERTIES}); + ParseType($element->{TYPE}); $res .= " "; if ($element->{POINTERS}) { for (my($i)=0; $i < $element->{POINTERS}; $i++) { @@ -43,14 +43,14 @@ sub DumpElement($) } ##################################################################### -# dump a struct -sub DumpStruct($) +# parse a struct +sub ParseStruct($) { my($struct) = shift; $res .= "struct {\n"; if (defined $struct->{ELEMENTS}) { foreach my $e (@{$struct->{ELEMENTS}}) { - DumpElement($e); + ParseElement($e); $res .= ";\n"; } } @@ -59,85 +59,85 @@ sub DumpStruct($) ##################################################################### -# dump a union element -sub DumpUnionElement($) +# parse a union element +sub ParseUnionElement($) { my($element) = shift; $res .= "[case($element->{CASE})] "; - DumpElement($element->{DATA}); + ParseElement($element->{DATA}); $res .= ";\n"; } ##################################################################### -# dump a union -sub DumpUnion($) +# parse a union +sub ParseUnion($) { my($union) = shift; - (defined $union->{PROPERTIES}) && DumpProperties($union->{PROPERTIES}); + (defined $union->{PROPERTIES}) && ParseProperties($union->{PROPERTIES}); $res .= "union {\n"; foreach my $e (@{$union->{DATA}}) { - DumpUnionElement($e); + ParseUnionElement($e); } $res .= "}"; } ##################################################################### -# dump a type -sub DumpType($) +# parse a type +sub ParseType($) { my($data) = shift; if (ref($data) eq "HASH") { ($data->{TYPE} eq "STRUCT") && - DumpStruct($data); + ParseStruct($data); ($data->{TYPE} eq "UNION") && - DumpUnion($data); + ParseUnion($data); } else { $res .= "$data"; } } ##################################################################### -# dump a typedef -sub DumpTypedef($) +# parse a typedef +sub ParseTypedef($) { my($typedef) = shift; $res .= "typedef "; - DumpType($typedef->{DATA}); + ParseType($typedef->{DATA}); $res .= " $typedef->{NAME};\n\n"; } ##################################################################### -# dump a function -sub DumpFunction($) +# parse a function +sub ParseFunction($) { my($function) = shift; $res .= "/* ignoring function $function->{NAME} */\n"; } ##################################################################### -# dump the interface definitions -sub DumpInterface($) +# parse the interface definitions +sub ParseInterface($) { my($interface) = shift; my($data) = $interface->{DATA}; foreach my $d (@{$data}) { ($d->{TYPE} eq "TYPEDEF") && - DumpTypedef($d); + ParseTypedef($d); ($d->{TYPE} eq "FUNCTION") && - DumpFunction($d); + ParseFunction($d); } } ##################################################################### -# dump a parsed IDL structure back into an IDL file -sub Dump($) +# parse a parsed IDL structure back into an IDL file +sub Parse($) { my($idl) = shift; $res = "/* parser auto-generated by pidl */\n\n"; foreach my $x (@{$idl}) { ($x->{TYPE} eq "INTERFACE") && - DumpInterface($x); + ParseInterface($x); } return $res; } -- cgit