summaryrefslogtreecommitdiff
path: root/lib/sbin/interface_parser.pl
diff options
context:
space:
mode:
authorrideout <rideout@17b73243-c579-4c4c-a9d2-2d5706c11dac>2002-12-10 20:20:34 +0000
committerrideout <rideout@17b73243-c579-4c4c-a9d2-2d5706c11dac>2002-12-10 20:20:34 +0000
commitb51856568e6a0b576778fd8756303ffb31c80fc1 (patch)
tree307c152b0b8a57f5e81e91a18ceb6768443eff9d /lib/sbin/interface_parser.pl
parentd858a94c870da57da425809e7483509ab3f28319 (diff)
Variable group description is now added to database, e.g. for use in
ThornGuide. Variable group descriptions are now allowed on same line as group declaration when no variable block is present. Partly fixes CactusEinstein/1003, in a sense. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3037 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/interface_parser.pl')
-rw-r--r--lib/sbin/interface_parser.pl25
1 files changed, 22 insertions, 3 deletions
diff --git a/lib/sbin/interface_parser.pl b/lib/sbin/interface_parser.pl
index 7a47c3d5..6fc6317f 100644
--- a/lib/sbin/interface_parser.pl
+++ b/lib/sbin/interface_parser.pl
@@ -732,7 +732,7 @@ sub parse_interface_ccl
&CST_error(0,$message,$hint,__LINE__,__FILE__);
}
}
- # implementation names can be sepeated by ,\s, where , are stripped out below
+ # implementation names can be separated by ,\s, where , are stripped out below
elsif ($line =~ m/^\s*(INHERITS|FRIEND)\s*:(([,\s]*[a-zA-Z]+[a-zA-Z_0-9]*)*[,\s]*)$/i)
{
$interface_db{"\U$thorn $1\E"} .= $2;
@@ -806,12 +806,10 @@ sub parse_interface_ccl
}
elsif ($line =~ m/^\s*(CCTK_)?(CHAR|BYTE|INT|INT2|INT4|INT8|REAL|REAL4|REAL8|REAL16|COMPLEX|COMPLEX8|COMPLEX16|COMPLEX32)\s*(([a-zA-Z]+[a-zA-Z_0-9]*)(\[([^]]+)\])?)\s*(.*)\s*$/i)
{
-
# for($i = 1; $i < 10; $i++)
# {
# print "$i is ${$i}\n";
# }
-
my $vtype = $2;
my $current_group = "$4";
my $isgrouparray = $5;
@@ -841,6 +839,23 @@ sub parse_interface_ccl
$interface_db{"\U$thorn $block GROUPS\E"} .= " $current_group";
$interface_db{"\U$thorn GROUP $current_group\E VTYPE"} = "\U$vtype\E";
+ # Grab optional group description from end of $options_list
+ if ($options_list =~ /(=?)\s*"([^"]*)"\s*$/) #"
+ {
+ if (!$1)
+ {
+ if ($data[$line_number+1] =~ m/^\s*\{\s*$/)
+ {
+ $message = "Group description for $current_group in thorn $thorn must be placed at end of variable block when variable block present";
+ &CST_error(1,$message,"",__LINE__,__FILE__);
+ } else
+ {
+ $description = $2;
+ $options_list =~ s/\s*"$description"//;
+ }
+ }
+ }
+
# split(/\s*=\s*|\s+/, $options_list);
%options = SplitWithStrings($options_list);
@@ -1027,6 +1042,9 @@ sub parse_interface_ccl
}
$line_number++;
}
+ # Grab optional group description
+ $data[$line_number] =~ m:\}\s*"([^"]*)":;
+ $description = $1;
}
else
{
@@ -1047,6 +1065,7 @@ sub parse_interface_ccl
# Decrement the line number, since the line is the first line of the next CCL statement.
$line_number--;
}
+ $interface_db{"\U$thorn GROUP $current_group\E DESCRIPTION"} = $description;
}
}
elsif ($line =~ m/^\s*(USES\s*INCLUDE)S?\s*(SOURCE)S?\s*:\s*(.*)\s*$/i)