?? RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE SCL Interpreter : Get / Set Natural Language Interfaces' ??
MODULE osm$natural_language_manager;

{
{  PURPOSE:
{    This module contains the ring 3 code to process the natural language.
{

?? NEWTITLE := 'Global Declarations', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc clt$environment_object_contents
*copyc clt$environment_object_size
*copyc clt$env_object_pop_reason
*copyc ose$message_gen_exceptions
*copyc ost$natural_language
*copyc ost$status
?? POP ??
*copyc clp$clear_message_cache
*copyc clp$validate_name
*copyc osp$find_natural_language
*copyc osp$set_status_abnormal
?? TITLE := 'osp$eo_size_natural_language', EJECT ??

  FUNCTION [XDCL] osp$eo_size_natural_language: clt$environment_object_size;


    osp$eo_size_natural_language := #SIZE (ost$natural_language);

  FUNCEND osp$eo_size_natural_language;
?? TITLE := 'osp$eo_init_natural_language', EJECT ??

  PROCEDURE [XDCL] osp$eo_init_natural_language
    (    object: ^clt$environment_object_contents);

    VAR
      natural_language: ^ost$natural_language;


    natural_language := object;

    natural_language^ := osc$default_natural_language;

  PROCEND osp$eo_init_natural_language;
?? TITLE := 'osp$eo_pop_natural_language', EJECT ??

  PROCEDURE [XDCL] osp$eo_pop_natural_language
    (    pop_reason: clt$env_object_pop_reason;
         object: ^clt$environment_object_contents;
         object_in_current_task: boolean;
         pushed_object_in_current_task: boolean;
         pushed_object: ^clt$environment_object_contents;
     VAR status: ost$status);


    status.normal := TRUE;

    clp$clear_message_cache;

  PROCEND osp$eo_pop_natural_language;
?? TITLE := 'osp$set_natural_language', EJECT ??

  PROCEDURE [XDCL, #GATE] osp$set_natural_language
    (    natural_language: ost$natural_language;
     VAR status: ost$status);

    VAR
      name_is_valid: boolean,
      natural_language_ptr: ^ost$natural_language,
      validated_name: ost$name;


    status.normal := TRUE;

    clp$validate_name (natural_language, validated_name, name_is_valid);
    IF NOT name_is_valid THEN
      osp$set_status_abnormal ('OS', ose$bad_natural_language, natural_language, status);
      RETURN;
    IFEND;

    osp$find_natural_language (natural_language_ptr);

    IF validated_name = natural_language_ptr^ THEN
      RETURN;
    IFEND;

    clp$clear_message_cache;

    natural_language_ptr^ := validated_name;

  PROCEND osp$set_natural_language;
?? TITLE := 'osp$get_natural_language', EJECT ??

  PROCEDURE [XDCL, #GATE] osp$get_natural_language
    (VAR natural_language: ost$natural_language;
     VAR status: ost$status);

    VAR
      natural_language_ptr: ^ost$natural_language;


    status.normal := TRUE;

    osp$find_natural_language (natural_language_ptr);

    natural_language := natural_language_ptr^;

  PROCEND osp$get_natural_language;

MODEND osm$natural_language_manager;
