// file: $isip/class/pr/ProductionRule/prdrl_01.cc
// version: $Id: prdrl_01.cc 10430 2006-02-14 22:37:46Z wholland $

// ISIP include files
//
#include "ProductionRule.h"

// method: debug
//
// arguments:
//   const unichar* msg: (input) a message to display with the
//     member data information
//
// return: a boolean indicating status
//
boolean ProductionRule::debug(const unichar* msg_a) const {

  rule_name_d.debug(L"rule_name_d");
  rule_d.debug(L"rule_d");
  
  // exit gracefully
  //
  return true;
}

// method: clear
//
// arguments:
//  Integral::CMODE ctype: (input) clear mode
//
// return: a boolean value indicating status
//
// this method resets the data members to the default values
//
boolean ProductionRule::clear(Integral::CMODE ctype_a) {
  
  if(ctype_a != Integral::RETAIN) {
    rule_name_d.clear(ctype_a);
    rule_d.clear(ctype_a);
    rule_type_d=NORMAL;
  }
  
  // indicate success
  //
  return true;
}

// method: operator=
//
// arguments:
//  const ProductionRule& arg: (input) input object to copy
//
// return: a boolean value indicating status
//
// this method copies the argument over this object
//
boolean ProductionRule::operator=(const ProductionRule& prdrl_a) {
  return assign(prdrl_a);
}

// method: assign
//
// arguments:
//  const ProductionRule& arg: (input) object to copy
//
// return: a boolean value indicating status
//
// this method assigns the input object to current object
//
boolean ProductionRule::assign(const ProductionRule& prdrl_a) {
  
  rule_type_d = prdrl_a.rule_type_d;

  return (rule_name_d.assign(prdrl_a.rule_name_d) &&
	  rule_d.assign(prdrl_a.rule_d));
}

// method: operator==
//
// arguments:
//  const ProductionRule& arg: (input) input object to compare
//
// return: a boolean value indicating status
//
// this method checks whether the current object is identical to the
// input object
//
boolean ProductionRule::operator==(const ProductionRule& prdrl_a) const {
  return eq(prdrl_a);
}

// method: eq
//
// arguments:
//  const ProductionRule& lmxml: (input) input object to compare
//
// return: a boolean value indicating equality
//
// this method checks whether the current object is identical to the
// input object
//
boolean ProductionRule::eq(const ProductionRule& prdrl_a) const {

  if (rule_type_d == prdrl_a.rule_type_d &&
      rule_name_d.eq(prdrl_a.rule_name_d) &&
      rule_d.eq(prdrl_a.rule_d)) {
    return true;
  }
  else {
    return false;
  }
}

