summaryrefslogtreecommitdiff
path: root/lib/sbin/parameter_parser.pl
diff options
context:
space:
mode:
authorallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-02-01 10:25:23 +0000
committerallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-02-01 10:25:23 +0000
commit1d4ae0ce84926111a6d58fc05392246c54d8fb86 (patch)
tree00cecf93787e2d41939aceee409d59301946424b /lib/sbin/parameter_parser.pl
parent5e8d35961bc7155e3141c4dab56a7627cfb87756 (diff)
Added specification for steerable parameters in param.ccl
Notation REAL paramname "Description" [STEERABLE = never|always|recover] { .... } ",,," Default value is never The constants CCTK_STEERABLE_NEVER CCTK_STEERABLE_ALWAYS CCTK_STEERABLE_RECOVER are now there to use to check the type of steering available for a parameter. git-svn-id: http://svn.cactuscode.org/flesh/trunk@1329 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/parameter_parser.pl')
-rw-r--r--lib/sbin/parameter_parser.pl23
1 files changed, 21 insertions, 2 deletions
diff --git a/lib/sbin/parameter_parser.pl b/lib/sbin/parameter_parser.pl
index 63de8736..4dfce935 100644
--- a/lib/sbin/parameter_parser.pl
+++ b/lib/sbin/parameter_parser.pl
@@ -144,7 +144,7 @@ sub parse_param_ccl
$parameter_db{"\U$thorn $block\E variables"} = "";
}
}
- elsif($line =~ m:(EXTENDS |USES )?\s*(?\:CCTK_)?(INT|REAL|LOGICAL|BOOLEAN|KEYWORD|STRING)\s*([a-zA-Z]+[a-zA-Z0-9_]*) \s*(\"[^\"]*\"):i)
+ elsif($line =~ m:(EXTENDS |USES )?\s*(?\:CCTK_)?(INT|REAL|LOGICAL|BOOLEAN|KEYWORD|STRING)\s*([a-zA-Z]+[a-zA-Z0-9_]*) \s*(\"[^\"]*\")\s*(.*)$:i)
{
# This is a parameter definition.
@@ -152,6 +152,7 @@ sub parse_param_ccl
$variable = $3;
$description = $4;
+ $options = $5;
# Logical is depricated
if ($type =~ /LOGICAL/i)
@@ -189,7 +190,25 @@ sub parse_param_ccl
# Move past {
$line_number++;
$line_number++;
-
+
+ # Parse the options
+ %options = split(/\s*=\s*|\s+/, $options);
+
+ foreach $option (keys %options)
+ {
+ if($option =~ m:STEERABLE:i)
+ {
+ $parameter_db{"\U$thorn $variable\E steerable"} = $options{$option};
+ print "Got STEERABLE <$options{$option}> for $variable in $thorn\n";
+ }
+ else
+ {
+ $message = "Unknown option $option for parameter $variable of thorn $thorn";
+ &CST_error(0,$message,__LINE__,__FILE__);
+ }
+ }
+
+
# Store data about this variable.
$defined_parameters{"\U$variable\E"} = 1;