?? dump_visitor.cpp
字號(hào):
// Dump_Visitor.cpp,v 1.2 2003/07/23 18:21:59 dhinton Exp
#include "Dump_Visitor.h"
#include "ace/streams.h"
Dump_Visitor::Dump_Visitor (int depth)
: depth_ (depth)
{
}
Dump_Visitor::~Dump_Visitor ()
{
}
int
Dump_Visitor::visit_module (TAO_PSDL_Module *module)
{
print_depth (this->depth_ + 10);
cout << "MODULE {" << endl;
if (module->identifier ()->accept (this) == -1)
return -1;
Dump_Visitor body_visitor (this->depth_ + 1);
if (module->specification ()->accept (&body_visitor) == -1)
return -1;
return 0;
}
int
Dump_Visitor::visit_identifier (TAO_PSDL_Identifier *identifier)
{
print_depth (this->depth_ + 40);
cout << "IDENTIFIER {" << identifier->value () << "}\n" << endl;
return 0;
}
int
Dump_Visitor::visit_specification (TAO_PSDL_Specification *specification)
{
cout << "SPECIFICATION {" << endl;
if (specification->definition ()->accept (this) == -1)
return -1;
if (specification->specification () != 0)
{
Dump_Visitor body_visitor (this->depth_ + 1);
if (specification->specification ()->accept (&body_visitor) == -1)
return -1;
}
return 0;
}
int
Dump_Visitor::visit_definition (TAO_PSDL_Definition *definition)
{
print_depth (this->depth_ + 5);
cout << "DEFINITION {" << endl;
if (definition->definition_type ()->accept (this) == -1)
return -1;
return 0;
}
int
Dump_Visitor::visit_abstract_storagetype (TAO_PSDL_Abstract_Storagetype *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_abstract_storagetype_dcl (TAO_PSDL_Abstract_Storagetype_Dcl *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_abstract_storagetype_fwd_dcl (TAO_PSDL_Abstract_Storagetype_Fwd_Dcl *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_abstract_storagetype_header (TAO_PSDL_Abstract_Storagetype_Header *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_abstract_storagetype_body (TAO_PSDL_Abstract_Storagetype_Body *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_abstract_storagetype_member (TAO_PSDL_Abstract_Storagetype_Member *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_abstract_storagetype_inh_spec (TAO_PSDL_Abstract_Storagetype_Inh_Spec *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_abstract_storagetype_name (TAO_PSDL_Abstract_Storagetype_Name *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_psdl_state_dcl (TAO_PSDL_Psdl_State_Dcl *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_psdl_state_type_spec (TAO_PSDL_Psdl_State_Type_Spec *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_abstract_storagetype_ref_type (TAO_PSDL_Abstract_Storagetype_Ref_Type)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_abstract_storagehome (TAO_PSDL_Abstract_Storagehome *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_abstract_storagehome_fwd_dcl (TAO_PSDL_Abstract_Storagehome_Fwd_Dcl *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_abstract_storagehome_dcl (TAO_PSDL_Abstract_Storagehome_Dcl *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_abstract_storagehome_header (TAO_PSDL_Abstract_Storagehome_Header *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_abstract_storagehome_body (TAO_PSDL_Abstract_Storagehome_Body *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_abstract_storagehome_member (TAO_PSDL_Abstract_Storagehome_Member *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_abstract_storagehome_inh_spec (TAO_PSDL_Abstract_Storagehome_Inh_Spec *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_abstract_storagehome_name (TAO_PSDL_Abstract_Storagehome_Name *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_local_op_dcl (TAO_PSDL_Local_Op_Dcl *local_op_dcl)
{
print_depth (this->depth_);
cout << "LOCAL_OP_DCL {" << endl;
if (local_op_dcl->op_type_spec ()->accept (this) == -1)
return -1;
if (local_op_dcl->identifier ()->accept (this) == -1)
return -1;
Dump_Visitor body_visitor (this->depth_ + 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 (&body_visitor) == -1)
return -1;
}
return 0;
}
int
Dump_Visitor::visit_key_dcl (TAO_PSDL_Key_Dcl *key_dcl)
{
print_depth (this->depth_);
cout << "KEY_DCL {" << endl;
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
Dump_Visitor::visit_catalog (TAO_PSDL_Catalog *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_catalog_inh_spec (TAO_PSDL_Catalog_Inh_Spec *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_catalog_name (TAO_PSDL_Catalog_Name *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_catalog_body (TAO_PSDL_Catalog_Body *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_catalog_member (TAO_PSDL_Catalog_Member *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_storagetype_member (TAO_PSDL_Storagetype_Member *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_storagetype_inh_spec (TAO_PSDL_Storagetype_Inh_Spec *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_storagetype_name (TAO_PSDL_Storagetype_Name *storagetype_name)
{
print_depth (this->depth_ + 10);
cout << "STORAGETYPE_NAME {" << endl;
if (storagetype_name->scoped_name ()->accept (this) == -1)
return -1;
return 0;
}
int
Dump_Visitor::visit_storagetype_impl_spec (TAO_PSDL_Storagetype_Impl_Spec *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_storagetype_ref_type (TAO_PSDL_Storagetype_Ref_Type *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_store_directive (TAO_PSDL_Store_Directive *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_psdl_concrete_state_type (TAO_PSDL_Psdl_Concrete_State_Type *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_ref_rep_directive (TAO_PSDL_Ref_Rep_Directive *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_storagehome (TAO_PSDL_Storagehome *storagehome)
{
print_depth (this->depth_ + 10);
cout << "STORAGEHOME {" << endl;
if (storagehome->storagehome_header ()->accept (this) == -1)
return -1;
Dump_Visitor body_visitor (this->depth_ + 1);
if (storagehome->storagehome_body () != 0)
if (storagehome->storagehome_body ()->accept (&body_visitor) == -1)
return -1;
return 0;
}
int
Dump_Visitor::visit_storagehome_header (TAO_PSDL_Storagehome_Header *sh_header)
{
print_depth (this->depth_ + 10);
cout << "STORAGEHOME_HEADER {" << endl;
if (sh_header->identifier ()->accept (this) == -1)
return -1;
if (sh_header->storagetype_name ()->accept (this) == -1)
return -1;
Dump_Visitor body_visitor (this->depth_ + 1);
if (sh_header->storagehome_inh_spec () != 0)
if (sh_header->storagehome_inh_spec ()->accept (&body_visitor) == -1)
return -1;
if (sh_header->storagehome_impl_spec () != 0)
if (sh_header->storagehome_impl_spec ()->accept (&body_visitor) == -1)
return -1;
return 0;
}
int
Dump_Visitor::visit_storagehome_body (TAO_PSDL_Storagehome_Body *sh_body)
{
print_depth (this->depth_ + 10);
cout << "STORAGEHOME_BODY {" << endl;
if (sh_body->storagehome_member ()->accept (this) == -1)
return -1;
Dump_Visitor body_visitor (this->depth_ + 1);
if (sh_body->storagehome_body () != 0)
if (sh_body->storagehome_body ()->accept (&body_visitor) == -1)
return -1;
return 0;
}
int
Dump_Visitor::visit_storagehome_member (TAO_PSDL_Storagehome_Member *sh_member)
{
print_depth (this->depth_ + 10);
cout << "STORAGEHOME_MEMBER {" << endl;
if (sh_member->key_dcl ()->accept (this) == -1)
return -1;
return 0;
}
int
Dump_Visitor::visit_storagehome_inh_spec (TAO_PSDL_Storagehome_Inh_Spec *sh_inh_spec)
{
print_depth (this->depth_ + 10);
cout << "STORAGEHOME_INH_SPEC {" << endl;
if (sh_inh_spec->storagehome_name ()->accept (this) == -1)
return -1;
return 0;
}
int
Dump_Visitor::visit_storagehome_name (TAO_PSDL_Storagehome_Name *sh_name)
{
print_depth (this->depth_ + 10);
cout << "STORAGEHOME_NAME {" << endl;
if (sh_name->scoped_name ()->accept (this) == -1)
return -1;
return 0;
}
int
Dump_Visitor::visit_storagehome_impl_spec (TAO_PSDL_Storagehome_Impl_Spec *sh_impl_spec)
{
print_depth (this->depth_ + 10);
cout << "STORAGEHOME_IMPL_SPEC {" << endl;
if (sh_impl_spec->abstract_storagehome_name ()->accept (this) == -1)
return -1;
return 0;
}
int
Dump_Visitor::visit_primary_key_dcl (TAO_PSDL_Primary_Key_Dcl *primary_key_dcl)
{
print_depth (this->depth_ + 10);
cout << "PRIMARY_KEY_DCL {" << endl;
if (primary_key_dcl->identifier ()->accept (this) == -1)
return -1;
return 0;
}
int
Dump_Visitor::visit_type_dcl (TAO_PSDL_Type_Dcl *type_dcl)
{
print_depth (this->depth_ + 10);
cout << "TYPE_DCL {" << endl;
print_depth (this->depth_ + 15);
if (type_dcl->key_word () != 0)
{
cout << "KEY_WORD------------------------ {";
cout << type_dcl->key_word () << "}" << endl;
}
if (type_dcl->type_of_type_dcl ()->accept (this) == -1)
return -1;
return 0;
}
int
Dump_Visitor::visit_type_declarator (TAO_PSDL_Type_Declarator *type_declarator)
{
print_depth (this->depth_ + 15);
cout << "TYPE_DECLARATOR {" << endl;
if (type_declarator->type_spec ()->accept (this) == -1)
return -1;
Dump_Visitor body_visitor (this->depth_);
if (type_declarator->declarators ()->accept (&body_visitor) == -1)
return -1;
return 0;
}
int
Dump_Visitor::visit_type_spec (TAO_PSDL_Type_Spec *type_spec)
{
print_depth (this->depth_ + 20);
cout << "TYPE_SPEC {" << endl;
if (type_spec->type_of_type_spec ()->accept (this) == -1)
return -1;
return 0;
}
int
Dump_Visitor::visit_simple_type_spec (TAO_PSDL_Simple_Type_Spec *simple_type_spec)
{
print_depth (this->depth_ + 25);
cout << "SIMPLE TYPE_SPEC {" << endl;
if (simple_type_spec->type_of_simple_type_spec ()->accept (this) == -1)
return -1;
return 0;
}
int
Dump_Visitor::visit_base_type_spec (TAO_PSDL_Base_Type_Spec *base_type_spec)
{
print_depth (this->depth_ + 25);
cout << "BASE TYPE_SPEC " << endl;
if (base_type_spec->type_of_base_type_spec ()->accept (this) == -1)
return -1;
return 0;
}
int
Dump_Visitor::visit_template_type_spec (TAO_PSDL_Template_Type_Spec *template_type_spec)
{
print_depth (this->depth_ + 30);
cout << "TEMPLATE_TYPE_SPEC {" << endl;
if (template_type_spec->type_of_template_type_spec ()->accept (this) == -1)
return -1;
return 0;
}
int
Dump_Visitor::visit_constr_type_spec (TAO_PSDL_Constr_Type_Spec *)
{
// @@ NOT YET SUPPORTED
return 0;
}
int
Dump_Visitor::visit_declarators (TAO_PSDL_Declarators *declarators)
{
print_depth (this->depth_ + 15);
cout << "DECLARATORS {" << endl;
if (declarators->declarator ()->accept (this) == -1)
return -1;
if (declarators->set_of_declarators () != 0)
{
Dump_Visitor body_visitor (this->depth_ + 1);
if (declarators->set_of_declarators ()->accept (&body_visitor) == -1)
return -1;
}
return 0;
}
int
Dump_Visitor::visit_declarator (TAO_PSDL_Declarator *declarator)
{
print_depth (this->depth_ + 20);
cout << "DECLARATOR {" << endl;
if (declarator->type_of_declarator ()->accept (this) == -1)
return -1;
return 0;
}
int
Dump_Visitor::visit_simple_declarator (TAO_PSDL_Simple_Declarator *simple_declarator)
{
print_depth (this->depth_ + 25);
cout << "SIMPLE_DECLARATOR {" << endl;
if (simple_declarator->identifier ()->accept (this) == -1)
return -1;
if (simple_declarator->simple_declarator () != 0)
{
Dump_Visitor body_visitor (this->depth_ + 1);
if (simple_declarator->simple_declarator ()->accept (&body_visitor) == -1)
return -1;
}
return 0;
}
int
Dump_Visitor::visit_simple_declarator_list (TAO_PSDL_Simple_Declarator_List *simple_decl_list)
{
print_depth (this->depth_ + 25);
cout << "SIMPLE_DECLARATOR_LIST {" << endl;
if (simple_decl_list-> simple_declarator ()->accept (this) == -1)
return -1;
if (simple_decl_list->simple_declarator_list () != 0)
{
Dump_Visitor body_visitor (this->depth_ + 1);
if (simple_decl_list->simple_declarator_list ()->accept (&body_visitor) == -1)
return -1;
}
return 0;
}
int
Dump_Visitor::visit_complex_declarator (TAO_PSDL_Complex_Declarator *complex_declarator)
{
print_depth (this->depth_ + 25);
cout << "COMPLEX_DECLARATOR {" << endl;
if (complex_declarator->array_declarator ()->accept (this) == -1)
return -1;
return 0;
}
int
Dump_Visitor::visit_predefined_type (TAO_PSDL_Predefined_Type *predefined_type)
{
print_depth (this->depth_ + 40);
cout << "PREDEFINED_TYPE " ;
if (predefined_type->type_one () != 0)
cout << "{" << predefined_type->type_one () << "}" << endl;
if (predefined_type->type_two () != 0)
cout << "{" << predefined_type->type_two () << "}" << endl;
if (predefined_type->type_three () != 0)
cout << "{" << predefined_type->type_three () << "}" << endl;
Dump_Visitor body_visitor (this->depth_ + 1);
if (predefined_type->type_of_variable_one () != 0)
{
cout << endl;
if (predefined_type->type_of_variable_one ()->accept (&body_visitor) == -1)
return -1;
}
if (predefined_type->type_of_variable_two () != 0)
{
cout << endl;
if (predefined_type->type_of_variable_two ()->accept (&body_visitor) == -1)
return -1;
}
if (predefined_type->type_of_variable_three () != 0)
{
cout << endl;
if (predefined_type->type_of_variable_three ()->accept (&body_visitor) == -1)
return -1;
}
return 0;
}
int
Dump_Visitor::visit_member_list (TAO_PSDL_Member_List *member_list)
{
print_depth (this->depth_ + 15);
cout << "MEMBER_LIST {" << endl;
if (member_list->member ()->accept (this) == -1)
return -1;
if (member_list->member_list () != 0)
{
Dump_Visitor body_visitor (this->depth_ + 1);
if (member_list->member_list ()->accept (&body_visitor) == -1)
return -1;
}
return 0;
}
int
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -