author | MattD <mattd@symbian.org> |
Tue, 06 Oct 2009 17:52:59 +0100 | |
changeset 608 | 7e37b08f44ce |
parent 457 | 991d89a55c87 |
child 1284 | 0b4a09013baf |
permissions | -rw-r--r-- |
457
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
1 |
#!perl -w |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
2 |
|
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
3 |
use strict; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
4 |
|
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
5 |
use XML::Parser; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
6 |
|
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
7 |
my $sysModel = shift or die "First arg must be system model xml file"; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
8 |
my @filters = @ARGV or die "Subsequent arg(s) must be filter(s) to apply"; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
9 |
|
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
10 |
# Sort out the positive and negative filters specified |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
11 |
my @negativeFilters; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
12 |
my @positiveFilters; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
13 |
foreach my $filter (@filters) |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
14 |
{ |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
15 |
if ($filter =~ m{^!(.*)}) |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
16 |
{ |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
17 |
push @negativeFilters, $1; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
18 |
} |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
19 |
else |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
20 |
{ |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
21 |
push @positiveFilters, $filter; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
22 |
} |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
23 |
} |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
24 |
|
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
25 |
# Read input tree |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
26 |
my $parser = new XML::Parser(Style => "Objects") or die; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
27 |
my $sysTree = eval { $parser->parsefile($sysModel) } or die "Failed to parse $sysModel : $@"; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
28 |
|
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
29 |
# Apply filter |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
30 |
filterTree($sysTree->[0], \@negativeFilters, \@positiveFilters); |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
31 |
|
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
32 |
# Output total tree |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
33 |
print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
34 |
printTree($sysTree->[0]); |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
35 |
print "\n"; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
36 |
|
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
37 |
exit; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
38 |
|
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
39 |
sub filterTree |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
40 |
{ |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
41 |
my $tree = shift; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
42 |
my $negativeFilters = shift; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
43 |
my $positiveFilters = shift; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
44 |
|
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
45 |
if (exists $tree->{filter}) |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
46 |
{ |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
47 |
# Work out how this item in the tree is tagged for filtering |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
48 |
my $itemTags = [split ",", $tree->{filter}]; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
49 |
my @negativeTags; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
50 |
my @positiveTags; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
51 |
foreach my $tag (@$itemTags) |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
52 |
{ |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
53 |
if ($tag =~ m{^!(.*)}) |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
54 |
{ |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
55 |
push @negativeTags, $1; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
56 |
} |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
57 |
else |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
58 |
{ |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
59 |
push @positiveTags, $tag; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
60 |
} |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
61 |
} |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
62 |
|
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
63 |
# Test whether this item should be removed |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
64 |
if (intersect(\@positiveTags, $negativeFilters) || |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
65 |
intersect(\@negativeTags, $positiveFilters) ) |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
66 |
{ |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
67 |
# It should! |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
68 |
# Return false, and the removal will be executed by the |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
69 |
# calling instance |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
70 |
# (No need to examine children) |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
71 |
return 0; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
72 |
} |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
73 |
|
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
74 |
# Tidy up the filter attribute |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
75 |
# Remove tags from this item that have been "used up" |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
76 |
# Remove the filter attribute entirely if they have all been |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
77 |
# used up |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
78 |
my %filterLookup = map { $_ => 1 } (@$negativeFilters, @$positiveFilters); |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
79 |
@$itemTags = grep { !exists $filterLookup{$_} } @$itemTags; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
80 |
if (scalar @$itemTags) |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
81 |
{ |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
82 |
$tree->{filter} = join ",", @$itemTags; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
83 |
} |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
84 |
else |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
85 |
{ |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
86 |
delete $tree->{filter}; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
87 |
} |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
88 |
} |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
89 |
|
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
90 |
# Now iterate through the children of this item and remove any that |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
91 |
# should be filtered out |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
92 |
@{$tree->{Kids}} = grep { |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
93 |
filterTree($_, $negativeFilters, $positiveFilters) |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
94 |
} @{$tree->{Kids}}; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
95 |
|
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
96 |
# Return true so that the calling instance will preserve this item in |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
97 |
# the output tree |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
98 |
return 1; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
99 |
} |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
100 |
|
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
101 |
# Test whether two sets (arrays) intersect |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
102 |
sub intersect |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
103 |
{ |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
104 |
my $set1 = shift; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
105 |
my $set2 = shift; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
106 |
|
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
107 |
my %set1 = map { $_ => 1 } @$set1; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
108 |
foreach (@$set2) |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
109 |
{ |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
110 |
return 1 if exists $set1{$_}; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
111 |
} |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
112 |
return 0; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
113 |
} |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
114 |
|
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
115 |
sub printTree |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
116 |
{ |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
117 |
my $tree = shift or die; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
118 |
die unless ref $tree; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
119 |
|
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
120 |
my $tagName = ref $tree; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
121 |
$tagName =~ s{^main::}{}; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
122 |
if ($tagName eq "Characters") |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
123 |
{ |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
124 |
print $tree->{Text}; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
125 |
return; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
126 |
} |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
127 |
|
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
128 |
print "<$tagName"; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
129 |
|
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
130 |
foreach my $attr ( |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
131 |
sort { |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
132 |
my $order = "unofficial name long-name tech_domain level span schema levels filter introduced deprecated purpose class plugin origin-model bldFile mrp version priority"; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
133 |
my $ixA = 1 + index $order, $a or die $a; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
134 |
my $ixB = 1 + index $order, $b or die $b; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
135 |
$ixA - $ixB; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
136 |
} |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
137 |
grep { |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
138 |
! ref $tree->{$_} |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
139 |
} |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
140 |
keys %$tree) |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
141 |
{ |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
142 |
print " $attr=\"$tree->{$attr}\""; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
143 |
} |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
144 |
|
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
145 |
my $children = $tree->{Kids}; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
146 |
if (scalar @$children) |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
147 |
{ |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
148 |
print ">"; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
149 |
foreach my $child (@$children) |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
150 |
{ |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
151 |
printTree($child); |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
152 |
} |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
153 |
print "</$tagName"; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
154 |
} |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
155 |
else |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
156 |
{ |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
157 |
print "/" |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
158 |
} |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
159 |
|
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
160 |
print ">"; |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
161 |
} |
991d89a55c87
Tool for filtering a system model definition.
Simon Howkins <simonh@symbian.org>
parents:
diff
changeset
|
162 |