?? RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE SCL Interpreter : "Subject" Application Value Scanner' ??
MODULE clm$help_subject_avs;

{
{ PURPOSE:
{   This module contains an application value scanner for processing the
{   "subject" parameter of commands like HELP and EXPLAIN.  When the
{   "new types" feature is available this processor will no longer be
{   needed.
{

?? TITLE := 'Global Declarations', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc clt$value
*copyc clt$application_value
*copyc ost$name
*copyc ost$status
?? POP ??
*copyc clp$convert_string_to_name
*copyc clp$scan_expression
?? TITLE := 'clp$help_subject_avs', EJECT ??

  PROCEDURE [XDCL, #GATE] clp$help_subject_avs
    (    avs_name: clt$application_value_name;
         avs_keyword_values: ^array [1 .. * ] of ost$name;
         avs_text: string ( * );
     VAR avs_value: clt$value;
     VAR status: ost$status);

    VAR
      name: clt$name,
      string_kind: clt$value_kind_specifier;

{
{ Check whether the text of the application value is simply a name.  If it
{ is, use the string form of that name as the evaluated result.  Otherwise
{ evaluate the application value text as a string expression.
{
{ Examples:     Specifying                Yields
{               ----------                ------
{
{               'some subject'            some subject
{               $value                    $VALUE
{               $value(p)                 "the value of parameter P"
{

    clp$convert_string_to_name (avs_text, name, status);
    IF status.normal THEN
      avs_value.kind := clc$string_value;
      avs_value.str.size := name.size;
      avs_value.str.value := name.value;
    ELSE
      string_kind.keyword_values := NIL;
      string_kind.kind := clc$string_value;
      string_kind.min_string_size := 0;
      string_kind.max_string_size := osc$max_string_size;
      clp$scan_expression (avs_text, string_kind, avs_value, status);
    IFEND;

  PROCEND clp$help_subject_avs;

MODEND clm$help_subject_avs;
