⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 psdl_scope_visitor.cpp

📁 这是广泛使用的通信开源项目,对于大容量,高并发的通讯要求完全能够胜任,他广泛可用于网络游戏医学图像网关的高qos要求.更详细的内容可阅读相应的材料
💻 CPP
📖 第 1 页 / 共 2 页
字号:
// PSDL_Scope_Visitor.cpp,v 1.2 2003/02/05 08:49:57 jwillemsen Exp

#include "PSDL_Scope_Visitor.h"
#include "PSDL_y.h"

TAO_PSDL_Scope_Visitor::TAO_PSDL_Scope_Visitor (TAO_PSDL_Node *psdl_node)
  : psdl_node_ (psdl_node)
{
}

TAO_PSDL_Scope_Visitor::~TAO_PSDL_Scope_Visitor ()
{
}

ACE_CString
TAO_PSDL_Scope_Visitor::get_scoped_type (void)
{
  return this->scoped_type_;
}

int
TAO_PSDL_Scope_Visitor::visit_module (TAO_PSDL_Module *module)
{
  //  this->psdl_node_->set_identifier ("module");

  if (module->specification ()->accept (this) == -1)
    return -1;

  return 0;
}

int
TAO_PSDL_Scope_Visitor::visit_identifier (TAO_PSDL_Identifier *identifier)
{
  this->psdl_node_->set_identifier (identifier->value ());

  return 0;
}

int
TAO_PSDL_Scope_Visitor::visit_specification (TAO_PSDL_Specification *specification)
{
  if (specification->definition ()->accept (this) == -1)
    return -1;

  if (specification->specification () != 0)
    {
      if (specification->specification ()->accept (this) == -1)
        return -1;
    }
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_definition (TAO_PSDL_Definition *definition)
{
  if (definition->definition_type ()->accept (this) == -1)
    return -1;
  return 0;
}

int
TAO_PSDL_Scope_Visitor::visit_abstract_storagetype (TAO_PSDL_Abstract_Storagetype *)
{
  return 0;
}

int
TAO_PSDL_Scope_Visitor::visit_abstract_storagetype_dcl (TAO_PSDL_Abstract_Storagetype_Dcl *)
{
  //  NOT YET SUPPORTED
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_abstract_storagetype_fwd_dcl (TAO_PSDL_Abstract_Storagetype_Fwd_Dcl *)
{
  //  NOT YET SUPPORTED
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_abstract_storagetype_header (TAO_PSDL_Abstract_Storagetype_Header *)
{
 //  NOT YET SUPPORTED
 return 0;
}

int TAO_PSDL_Scope_Visitor::visit_abstract_storagetype_body (TAO_PSDL_Abstract_Storagetype_Body *)
{
  //  NOT YET SUPPORTED
  return 0;
}

int
TAO_PSDL_Scope_Visitor::visit_abstract_storagetype_member (TAO_PSDL_Abstract_Storagetype_Member *)
{
  //  NOT YET SUPPORTED
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_abstract_storagetype_inh_spec (TAO_PSDL_Abstract_Storagetype_Inh_Spec *)
{
  //  NOT YET SUPPORTED
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_abstract_storagetype_name (TAO_PSDL_Abstract_Storagetype_Name *)
{
  //  NOT YET SUPPORTED
  return 0; }

int TAO_PSDL_Scope_Visitor::visit_psdl_state_dcl (TAO_PSDL_Psdl_State_Dcl *)
{
  //  NOT YET SUPPORTED
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_psdl_state_type_spec (TAO_PSDL_Psdl_State_Type_Spec *)
{
  //  NOT YET SUPPORTED
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_abstract_storagetype_ref_type (TAO_PSDL_Abstract_Storagetype_Ref_Type)
{
  //  NOT YET SUPPORTED
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_abstract_storagehome (TAO_PSDL_Abstract_Storagehome *)
{
  //  NOT YET SUPPORTED
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_abstract_storagehome_fwd_dcl (TAO_PSDL_Abstract_Storagehome_Fwd_Dcl *)
{ //  NOT YET SUPPORTED


 return 0; }

int TAO_PSDL_Scope_Visitor::visit_abstract_storagehome_dcl (TAO_PSDL_Abstract_Storagehome_Dcl *)
{
  //  NOT YET SUPPORTED
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_abstract_storagehome_header (TAO_PSDL_Abstract_Storagehome_Header *)
{
  //  NOT YET SUPPORTED
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_abstract_storagehome_body (TAO_PSDL_Abstract_Storagehome_Body  *)
{
  //  NOT YET SUPPORTED
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_abstract_storagehome_member (TAO_PSDL_Abstract_Storagehome_Member *)
{
  //  NOT YET SUPPORTED
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_abstract_storagehome_inh_spec (TAO_PSDL_Abstract_Storagehome_Inh_Spec *)
{
  //  NOT YET SUPPORTED
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_abstract_storagehome_name (TAO_PSDL_Abstract_Storagehome_Name *)
{ //  NOT YET SUPPORTED
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_local_op_dcl (TAO_PSDL_Local_Op_Dcl *local_op_dcl)
{
  if (local_op_dcl->op_type_spec ()->accept (this) == -1)
    return -1;

  if (local_op_dcl->identifier ()->accept (this) == -1)
    return -1;

  if (local_op_dcl->parameter_dcls ()->accept (this) == -1)
    return -1;

  if (local_op_dcl->raises_expr () != 0)
    {
      if (local_op_dcl->raises_expr ()->accept (this) == -1)
        return -1;
    }
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_key_dcl (TAO_PSDL_Key_Dcl *key_dcl)
{
  if (key_dcl->identifier ()->accept (this) == -1)
    return -1;

  if (key_dcl->simple_declarator () != 0)
    if (key_dcl->simple_declarator ()->accept (this) == -1)
      return -1;
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_catalog (TAO_PSDL_Catalog *)
{
  //  NOT YET SUPPORTED
  return 0; }

int TAO_PSDL_Scope_Visitor::visit_catalog_inh_spec (TAO_PSDL_Catalog_Inh_Spec *)
{
  //  NOT YET SUPPORTED
  return 0; }

int TAO_PSDL_Scope_Visitor::visit_catalog_name (TAO_PSDL_Catalog_Name *)
{ //  NOT YET SUPPORTED
  return 0; }

int TAO_PSDL_Scope_Visitor::visit_catalog_body (TAO_PSDL_Catalog_Body *)
{
  //  NOT YET SUPPORTED
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_catalog_member (TAO_PSDL_Catalog_Member *)
{
  //  NOT YET SUPPORTED
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_storagetype_member (TAO_PSDL_Storagetype_Member *)
{
  //  NOT YET SUPPORTED
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_storagetype_inh_spec (TAO_PSDL_Storagetype_Inh_Spec *)
{
  //  NOT YET SUPPORTED
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_storagetype_name (TAO_PSDL_Storagetype_Name *storagetype_name)
{
  if (storagetype_name->scoped_name ()->accept (this) == -1)
    return -1;

  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_storagetype_impl_spec (TAO_PSDL_Storagetype_Impl_Spec *)
{
  //  NOT YET SUPPORTED
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_storagetype_ref_type (TAO_PSDL_Storagetype_Ref_Type *)
{
  //  NOT YET SUPPORTED
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_store_directive (TAO_PSDL_Store_Directive *)
{
  //  NOT YET SUPPORTED
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_psdl_concrete_state_type (TAO_PSDL_Psdl_Concrete_State_Type *)
{
  //  NOT YET SUPPORTED
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_ref_rep_directive (TAO_PSDL_Ref_Rep_Directive *)
{
  //  NOT YET SUPPORTED
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_storagehome (TAO_PSDL_Storagehome *storagehome)
{
  if (storagehome->storagehome_header ()->accept (this) == -1)
    return -1;

  if (storagehome->storagehome_body () != 0)
    if (storagehome->storagehome_body ()->accept (this) == -1)
      return -1;
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_storagehome_header (TAO_PSDL_Storagehome_Header *sh_header)
{
  if (sh_header->identifier ()->accept (this) == -1)
    return -1;

  if (sh_header->storagetype_name ()->accept (this) == -1)
    return -1;


  if (sh_header->storagehome_inh_spec () != 0)
    if (sh_header->storagehome_inh_spec ()->accept (this) == -1)
      return -1;

  if (sh_header->storagehome_impl_spec () != 0)
    if (sh_header->storagehome_impl_spec ()->accept (this) == -1)
      return -1;

  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_storagehome_body  (TAO_PSDL_Storagehome_Body *sh_body)
{
  if (sh_body->storagehome_member ()->accept (this) == -1)
    return -1;

  if (sh_body->storagehome_body () != 0)
    if (sh_body->storagehome_body ()->accept (this) == -1)
      return -1;
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_storagehome_member  (TAO_PSDL_Storagehome_Member *sh_member)
{
  if (sh_member->key_dcl ()->accept (this) == -1)
    return -1;
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_storagehome_inh_spec  (TAO_PSDL_Storagehome_Inh_Spec *sh_inh_spec)
{
  if (sh_inh_spec->storagehome_name ()->accept (this) == -1)
    return -1;
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_storagehome_name  (TAO_PSDL_Storagehome_Name *sh_name)
{
  if (sh_name->scoped_name ()->accept (this) == -1)
    return -1;
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_storagehome_impl_spec (TAO_PSDL_Storagehome_Impl_Spec *sh_impl_spec)
{
  if (sh_impl_spec->abstract_storagehome_name ()->accept (this) == -1)
    return -1;
  return 0;
}

int
TAO_PSDL_Scope_Visitor::visit_primary_key_dcl (TAO_PSDL_Primary_Key_Dcl *primary_key_dcl)
{
  if (primary_key_dcl->identifier ()->accept (this) == -1)
    return -1;
  return 0;
}

int
TAO_PSDL_Scope_Visitor::visit_type_dcl (TAO_PSDL_Type_Dcl *type_dcl)
{
  if (type_dcl->key_word () == TAO_PSDL_NATIVE)
    {
      this->psdl_node_->set_identifier (TAO_PSDL_Scope::instance ()->convert_str (type_dcl->key_word ()));

      this->psdl_node_->set_predefined_type ();
    }

  if (type_dcl->type_of_type_dcl ()->accept (this) == -1)
    return -1;

  return 0;
}

int
TAO_PSDL_Scope_Visitor::visit_type_declarator (TAO_PSDL_Type_Declarator *type_declarator)
{
  if (type_declarator->type_spec ()->accept (this) == -1)
    return -1;

  if (type_declarator->declarators ()->accept (this) == -1)
    return -1;

  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_type_spec (TAO_PSDL_Type_Spec *type_spec)
{
  if (type_spec->type_of_type_spec ()->accept (this) == -1)
    return -1;

  return 0;
}

int
TAO_PSDL_Scope_Visitor::visit_simple_type_spec  (TAO_PSDL_Simple_Type_Spec *simple_type_spec)
{
  if (simple_type_spec->type_of_simple_type_spec ()->accept (this) == -1)
    return -1;

  // @@ why this
  this->scoped_type_ = TAO_PSDL_Scope::instance ()->get_identifier ();
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_base_type_spec  (TAO_PSDL_Base_Type_Spec *base_type_spec)
{
  if (base_type_spec->type_of_base_type_spec ()->accept (this) == -1)
    return -1;
  return 0; }

int TAO_PSDL_Scope_Visitor::visit_template_type_spec  (TAO_PSDL_Template_Type_Spec *template_type_spec)
{
  if (template_type_spec->type_of_template_type_spec ()->accept (this) == -1)
    return -1;
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_constr_type_spec  (TAO_PSDL_Constr_Type_Spec *)
{
  //  NOT YET SUPPORTED
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_declarators  (TAO_PSDL_Declarators *declarators)
{

  if (declarators->declarator ()->accept (this) == -1)
    return -1;

  if (declarators->set_of_declarators () != 0)
    {
      if (declarators->set_of_declarators ()->accept (this) == -1)
        return -1;
    }
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_declarator  (TAO_PSDL_Declarator *declarator)
{
  if (declarator->type_of_declarator ()->accept (this) == -1)
    return -1;
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_simple_declarator  (TAO_PSDL_Simple_Declarator *simple_declarator)
{

  if (simple_declarator->identifier ()->accept (this) == -1)
    return -1;

  if (simple_declarator->simple_declarator () != 0)
    {

      if (simple_declarator->simple_declarator ()->accept (this) == -1)
        return -1;
    }
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_simple_declarator_list  (TAO_PSDL_Simple_Declarator_List *simple_decl_list)
{

  if (simple_decl_list-> simple_declarator ()->accept (this) == -1)
    return -1;

  if (simple_decl_list->simple_declarator_list () != 0)
    {

      if (simple_decl_list->simple_declarator_list ()->accept (this) == -1)
        return -1;
    }
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_complex_declarator  (TAO_PSDL_Complex_Declarator *complex_declarator)
{
  if (complex_declarator->array_declarator ()->accept (this) == -1)
    return -1;
  return 0;
}

int
TAO_PSDL_Scope_Visitor::visit_predefined_type (TAO_PSDL_Predefined_Type *predefined_type)
{
  if ((predefined_type->type_one () != 0) && (predefined_type->type_one () != TAO_PSDL_SEQUENCE))
    {
      // This will happen in the case of typedefs like
      // typedef sequence<Istring> Name. We neednot save the sequence
      // @@ May be this is a wrong solution ... but atleast a
      // temporary one :)
      this->psdl_node_->set_identifier (TAO_PSDL_Scope::instance ()->convert_str (predefined_type->type_one ()));

      this->psdl_node_->set_predefined_type ();
    }
  if (predefined_type->type_two () != 0) {}

  if (predefined_type->type_three () != 0)
    {}

  if (predefined_type->type_of_variable_one () != 0)
    {
      if (predefined_type->type_of_variable_one ()->accept (this) == -1)
        return -1;
    }

  if (predefined_type->type_of_variable_two () != 0)
    {
      if (predefined_type->type_of_variable_two ()->accept (this) == -1)
        return -1;

      // @@ I am not sure now if I need this here. So, commenting it
      // out nad will get it back if need arises in future.
      // this->psdl_node_->set_identifier (TAO_PSDL_Scope::instance ()->get_identifier ());
    }

  if (predefined_type->type_of_variable_three () != 0)
    {
      if (predefined_type->type_of_variable_three ()->accept (this) == -1)
        return -1;
    }
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_member_list (TAO_PSDL_Member_List *member_list)
{
  if (member_list->member ()->accept (this) == -1)
    return -1;

  if (member_list->member_list () != 0)
    {
      if (member_list->member_list ()->accept (this) == -1)
        return -1;
    }
  return 0;
}

int
TAO_PSDL_Scope_Visitor::visit_member (TAO_PSDL_Member *member)
{
  if (member->type_spec ()->accept (this) == -1)
    return -1;

  if (member->declarators ()->accept (this) == -1)
    return -1;

  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_union_type (TAO_PSDL_Union_Type *)
{ //  NOT YET SUPPORTED
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_switch_type_spec (TAO_PSDL_Switch_Type_Spec *)
{
  //  NOT YET SUPPORTED
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_switch_body (TAO_PSDL_Switch_Body *)
{
  //  NOT YET SUPPORTED
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_case_case (TAO_PSDL_Case *)
{
  //  NOT YET SUPPORTED
  return 0;
}

int TAO_PSDL_Scope_Visitor::visit_case_label (TAO_PSDL_Case_Label *)
{
  //  NOT YET SUPPORTED
  return 0;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -