summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2003-07-25 16:39:17 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2003-07-25 16:39:17 +0000
commit249019ac5183f4fd2dee246f1971df115f617445 (patch)
tree3e1e68ebfb534f9fd44cf7f918e07b0d746ea4a1
parentfbe1f63e49f02ac8cb916942f5d63f0707f07e9b (diff)
downloadMPC-249019ac5183f4fd2dee246f1971df115f617445.tar.gz
ChangeLogTag: Fri Jul 25 11:37:09 2003 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r--modules/ProjectCreator.pm63
-rw-r--r--modules/TemplateParser.pm2
2 files changed, 64 insertions, 1 deletions
diff --git a/modules/ProjectCreator.pm b/modules/ProjectCreator.pm
index 3a7287a3..1cbb0619 100644
--- a/modules/ProjectCreator.pm
+++ b/modules/ProjectCreator.pm
@@ -123,6 +123,8 @@ my(%genext) = ('idl_files' => {'automatic' => 1,
},
);
+my($grouped_key) = 'grouped_';
+
# ************************************************************
# Subroutine Section
# ************************************************************
@@ -535,6 +537,7 @@ sub parse_components {
my($set) = 0;
my(%flags) = ();
my($custom) = defined $self->{'generated_exts'}->{$tag};
+ my($grtag) = $grouped_key . $tag;
if ($custom) {
## For the custom scoped assignments, we want to put a copy of
@@ -585,6 +588,7 @@ sub parse_components {
$set = 1;
if (!defined $$comps{$current}) {
$$comps{$current} = [];
+ $self->process_assignment_add($grtag, $current);
}
}
else {
@@ -1817,6 +1821,65 @@ sub check_custom_output {
}
+sub get_special_value {
+ my($self) = shift;
+ my($type) = shift;
+ my($cmd) = shift;
+ my($based) = shift;
+
+ if ($type =~ /^custom_type/) {
+ return $self->get_custom_value($cmd, $based);
+ }
+ elsif ($type =~ /^grouped_/) {
+ return $self->get_grouped_value($type, $cmd, $based);
+ }
+
+ return undef;
+}
+
+
+sub get_grouped_value {
+ my($self) = shift;
+ my($type) = shift;
+ my($cmd) = shift;
+ my($based) = shift;
+ my($value) = undef;
+
+ ## Remove the grouped_ part
+ $type =~ s/^$grouped_key//;
+
+ ## Add the s if it isn't there
+ if ($type !~ /s$/i) {
+ $type .= 's';
+ }
+
+ ## Make it all lowercase
+ $type = lc($type);
+
+ my($names) = $self->{$type};
+ if ($cmd eq 'files') {
+ foreach my $name (keys %$names) {
+ my($comps) = $$names{$name};
+ foreach my $comp (keys %$comps) {
+ if ($comp eq $based) {
+ $value = $$comps{$comp};
+ last;
+ }
+ }
+ }
+ }
+ elsif ($cmd eq 'component_name') {
+ ## If there is more than one name, then we will need
+ ## to deal with that at a later time.
+ foreach my $name (keys %$names) {
+ $value = $name;
+ }
+ }
+
+ return $value;
+}
+
+
sub get_custom_value {
my($self) = shift;
my($cmd) = shift;
diff --git a/modules/TemplateParser.pm b/modules/TemplateParser.pm
index 118db647..94141157 100644
--- a/modules/TemplateParser.pm
+++ b/modules/TemplateParser.pm
@@ -224,7 +224,7 @@ sub get_nested_value {
my($post) = $2;
my($base) = $self->get_value($pre);
if (defined $base) {
- $value = $self->{'prjc'}->get_custom_value($post, $base);
+ $value = $self->{'prjc'}->get_special_value($pre, $post, $base);
}
}