diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-06-28 14:06:19 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-06-28 14:06:19 +0000 |
commit | 99d9c281e82fe95901101d22e245c841dff0d1af (patch) | |
tree | 73fbf9eb773a0ec7203e02de3a1626f855457027 | |
parent | f06ce22c817e44c18481582660cdeb3f984d412f (diff) | |
download | ATCD-99d9c281e82fe95901101d22e245c841dff0d1af.tar.gz |
ChangeLogTag: Fri Jun 28 09:03:22 2002 Jeff Parsons <parsons@cs.wustl.edu>
60 files changed, 1510 insertions, 1135 deletions
diff --git a/TAO/TAO_IDL/ast/ast_component.cpp b/TAO/TAO_IDL/ast/ast_component.cpp index 7662613f9cd..d975ee28df3 100644 --- a/TAO/TAO_IDL/ast/ast_component.cpp +++ b/TAO/TAO_IDL/ast/ast_component.cpp @@ -165,6 +165,17 @@ AST_Component::ast_accept (ast_visitor *visitor) return visitor->visit_component (this); } +idl_bool +AST_Component::redef_clash (void) +{ + if (this->AST_Interface::redef_clash ()) + { + return 1; + } + + return 0; +} + // Narrowing methods. IMPL_NARROW_METHODS1(AST_Component, AST_Interface) IMPL_NARROW_FROM_DECL(AST_Component) diff --git a/TAO/TAO_IDL/ast/ast_decl.cpp b/TAO/TAO_IDL/ast/ast_decl.cpp index 8ab302549a5..37c3e495615 100644 --- a/TAO/TAO_IDL/ast/ast_decl.cpp +++ b/TAO/TAO_IDL/ast/ast_decl.cpp @@ -128,20 +128,8 @@ AST_Decl::AST_Decl (void) version_ (0), anonymous_ (I_FALSE), typeid_set_ (I_FALSE), - cli_hdr_gen_ (I_FALSE), - cli_stub_gen_ (I_FALSE), - cli_inline_gen_ (I_FALSE), - srv_hdr_gen_ (I_FALSE), - impl_hdr_gen_ (I_FALSE), - srv_skel_gen_ (I_FALSE), - impl_skel_gen_ (I_FALSE), - srv_inline_gen_ (I_FALSE), - cli_hdr_any_op_gen_ (I_FALSE), - cli_stub_any_op_gen_ (I_FALSE), - cli_hdr_cdr_op_gen_ (I_FALSE), - cli_stub_cdr_op_gen_ (I_FALSE), - cli_inline_cdr_op_gen_ (I_FALSE), - flat_name_ (0) + flat_name_ (0), + last_referenced_as_ (0) { } @@ -166,20 +154,8 @@ AST_Decl::AST_Decl (NodeType nt, version_ (0), anonymous_ (anonymous), typeid_set_ (I_FALSE), - cli_hdr_gen_ (I_FALSE), - cli_stub_gen_ (I_FALSE), - cli_inline_gen_ (I_FALSE), - srv_hdr_gen_ (I_FALSE), - impl_hdr_gen_ (I_FALSE), - srv_skel_gen_ (I_FALSE), - impl_skel_gen_ (I_FALSE), - srv_inline_gen_ (I_FALSE), - cli_hdr_any_op_gen_ (I_FALSE), - cli_stub_any_op_gen_ (I_FALSE), - cli_hdr_cdr_op_gen_ (I_FALSE), - cli_stub_cdr_op_gen_ (I_FALSE), - cli_inline_cdr_op_gen_ (I_FALSE), - flat_name_ (0) + flat_name_ (0), + last_referenced_as_ (0) { this->compute_full_name (n); @@ -1218,169 +1194,16 @@ AST_Decl::original_local_name (void) return this->pd_original_local_name; } -// Boolean methods to test if code was already generated. -idl_bool -AST_Decl::cli_hdr_gen (void) -{ - return this->cli_hdr_gen_; -} - -idl_bool -AST_Decl::cli_stub_gen (void) -{ - return this->cli_stub_gen_; -} - -idl_bool -AST_Decl::cli_hdr_any_op_gen (void) -{ - return this->cli_hdr_any_op_gen_; -} - -idl_bool -AST_Decl::cli_stub_any_op_gen (void) -{ - return this->cli_stub_any_op_gen_; -} - -idl_bool -AST_Decl::cli_hdr_cdr_op_gen (void) -{ - return this->cli_hdr_cdr_op_gen_; -} - -idl_bool -AST_Decl::cli_stub_cdr_op_gen (void) -{ - return this->cli_stub_cdr_op_gen_; -} - -idl_bool -AST_Decl::cli_inline_cdr_op_gen (void) -{ - return this->cli_inline_cdr_op_gen_; -} - -idl_bool -AST_Decl::cli_inline_cdr_decl_gen (void) -{ - return this->cli_inline_cdr_decl_gen_; -} - -idl_bool -AST_Decl::cli_inline_gen (void) -{ - return this->cli_inline_gen_; -} - -idl_bool -AST_Decl::srv_hdr_gen (void) -{ - return this->srv_hdr_gen_; -} - -idl_bool -AST_Decl::impl_hdr_gen (void) -{ - return this->impl_hdr_gen_; -} - -idl_bool -AST_Decl::srv_skel_gen (void) -{ - return this->srv_skel_gen_; -} - -idl_bool -AST_Decl::impl_skel_gen (void) -{ - return this->impl_skel_gen_; -} - -idl_bool -AST_Decl::srv_inline_gen (void) -{ - return this->srv_inline_gen_; -} - -// Set the flag indicating that code generation is done. -void -AST_Decl::cli_hdr_gen (idl_bool val) -{ - this->cli_hdr_gen_ = val; -} - -void -AST_Decl::cli_stub_gen (idl_bool val) -{ - this->cli_stub_gen_ = val; -} - -void -AST_Decl::cli_hdr_any_op_gen (idl_bool val) -{ - this->cli_hdr_any_op_gen_ = val; -} - -void -AST_Decl::cli_stub_any_op_gen (idl_bool val) -{ - this->cli_stub_any_op_gen_ = val; -} - -void -AST_Decl::cli_hdr_cdr_op_gen (idl_bool val) -{ - this->cli_hdr_cdr_op_gen_ = val; -} - -void -AST_Decl::cli_stub_cdr_op_gen (idl_bool val) -{ - this->cli_stub_cdr_op_gen_ = val; -} - -void -AST_Decl::cli_inline_cdr_op_gen (idl_bool val) -{ - this->cli_inline_cdr_op_gen_ = val; -} - -void -AST_Decl::cli_inline_cdr_decl_gen (idl_bool val) -{ - this->cli_inline_cdr_decl_gen_ = val; -} - -void -AST_Decl::cli_inline_gen (idl_bool val) -{ - this->cli_inline_gen_ = val; -} - -void -AST_Decl::srv_hdr_gen (idl_bool val) -{ - this->srv_hdr_gen_ = val; -} - -void -AST_Decl::impl_hdr_gen (idl_bool val) -{ - this->impl_hdr_gen_ = val; -} - - -void -AST_Decl::srv_skel_gen (idl_bool val) +UTL_ScopedName * +AST_Decl::last_referenced_as (void) const { - this->srv_skel_gen_ = val; + return this->last_referenced_as_; } void -AST_Decl::srv_inline_gen (idl_bool val) +AST_Decl::last_referenced_as (UTL_ScopedName *n) { - this->srv_inline_gen_ = val; + this->last_referenced_as_ = n; } //Narrowing methods for AST_Decl. diff --git a/TAO/TAO_IDL/ast/ast_exception.cpp b/TAO/TAO_IDL/ast/ast_exception.cpp index 2380a5d840c..1feeb77c371 100644 --- a/TAO/TAO_IDL/ast/ast_exception.cpp +++ b/TAO/TAO_IDL/ast/ast_exception.cpp @@ -199,6 +199,16 @@ AST_Exception::fe_add_field (AST_Field *t) I_FALSE, t->local_name ()); + AST_Type *ft = t->field_type (); + UTL_ScopedName *mru = ft->last_referenced_as (); + + if (mru != 0) + { + this->add_to_referenced (ft, + I_FALSE, + mru->first_component ()); + } + this->fields_.enqueue_tail (t); return t; diff --git a/TAO/TAO_IDL/ast/ast_expression.cpp b/TAO/TAO_IDL/ast/ast_expression.cpp index dcdee836f6d..eaa196cdf9b 100644 --- a/TAO/TAO_IDL/ast/ast_expression.cpp +++ b/TAO/TAO_IDL/ast/ast_expression.cpp @@ -73,6 +73,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "utl_err.h" #include "utl_scope.h" #include "utl_string.h" +#include "nr_extern.h" ACE_RCSID (ast, ast_expression, @@ -1550,6 +1551,62 @@ coerce_value (AST_Expression::AST_ExprValue *ev, return 0; } +// Integer literals may not be assigned to floating point constants, +// and vice versa. +static idl_bool +incompatible_types (AST_Expression::ExprType t1, + AST_Expression::ExprType t2) +{ + switch (t1) + { + case AST_Expression::EV_short: + case AST_Expression::EV_ushort: + case AST_Expression::EV_long: + case AST_Expression::EV_ulong: + case AST_Expression::EV_longlong: + case AST_Expression::EV_ulonglong: + case AST_Expression::EV_octet: + case AST_Expression::EV_bool: + switch (t2) + { + case AST_Expression::EV_short: + case AST_Expression::EV_ushort: + case AST_Expression::EV_long: + case AST_Expression::EV_ulong: + case AST_Expression::EV_longlong: + case AST_Expression::EV_ulonglong: + case AST_Expression::EV_octet: + case AST_Expression::EV_bool: + return 0; + default: + return 1; + } + case AST_Expression::EV_float: + case AST_Expression::EV_double: + case AST_Expression::EV_longdouble: + switch (t2) + { + case AST_Expression::EV_float: + case AST_Expression::EV_double: + case AST_Expression::EV_longdouble: + return 0; + default: + return 1; + } + case AST_Expression::EV_char: + case AST_Expression::EV_wchar: + case AST_Expression::EV_string: + case AST_Expression::EV_wstring: + case AST_Expression::EV_enum: + case AST_Expression::EV_any: + case AST_Expression::EV_object: + case AST_Expression::EV_void: + case AST_Expression::EV_none: + default: + return 0; + } +} + // Evaluate the expression wrt the evaluation kind requested. Supported // evaluation kinds are // - EK_const: The expression must evaluate to a constant @@ -1602,29 +1659,30 @@ AST_Expression::eval_bin_op (AST_Expression::EvalKind ek) { return 0; } - +// @@@ (JP) See comment below. +/* this->pd_v1->set_ev (this->pd_v1->eval_internal (ek)); if (this->pd_v1->ev () == 0) { return 0; } - +*/ this->pd_v1->set_ev (this->pd_v1->coerce (EV_double)); if (this->pd_v1->ev () == 0) { return 0; } - +/* this->pd_v2->set_ev (this->pd_v2->eval_internal (ek)); if (this->pd_v2->ev () == 0) { return 0; } - - this->pd_v2->set_ev (this->pd_v2->coerce(EV_double)); +*/ + this->pd_v2->set_ev (this->pd_v2->coerce (EV_double)); if (pd_v2->ev () == 0) { @@ -1667,12 +1725,21 @@ AST_Expression::eval_bin_op (AST_Expression::EvalKind ek) } retval->u.dval = - this->pd_v1->ev ()->u.dval / this->pd_v2->ev ()->u.dval; + this->pd_v1->ev ()->u.dval / this->pd_v2->ev ()->u.dval; break; default: return 0; } + // @@@ (JP) CORBA 2.6 and earlier say that in a constant expression, + // each subexpression must fall within the range of the assigned type. + // However, this may be hard for the compiler in some cases (must + // evaluate all grouping possibilities). So there is an outstanding + // issue, #1139, and the best guess is that it will ultimately be + // decided that only the final value must fall within the range of + // the assigned type. So I've commented out the checks above, and + // added this final evaluation below. (02-06-25). +// return eval_kind (retval, ek); return retval; } @@ -1941,6 +2008,64 @@ AST_Expression::eval_symbol (AST_Expression::EvalKind ek) return c->constant_value ()->eval_internal (ek); } +idl_bool +AST_Expression::type_mismatch (AST_Expression::ExprType t) +{ + if (this->pd_ev != 0) + { + return incompatible_types (this->pd_ev->et, t); + } + + idl_bool v1_mismatch = 0; + idl_bool v2_mismatch = 0; + + if (this->pd_v1 != 0) + { + v1_mismatch = this->pd_v1->type_mismatch (t); + } + + if (this->pd_v2 != 0) + { + v2_mismatch = this->pd_v2->type_mismatch (t); + } + + return v1_mismatch | v2_mismatch; +} + +// Coerce "this" to the ExprType required. Returns a copy of the +// original ExprValue with the coercion applied, if successful, or +// 0 if failed. +AST_Expression::AST_ExprValue * +AST_Expression::check_and_coerce (AST_Expression::ExprType t, + AST_Decl *d) +{ + if (d != 0) + { + AST_Decl *enum_val = + idl_global->scopes ().top_non_null ()->lookup_by_name (this->pd_n, + 1); + + if (enum_val != 0) + { + AST_Decl *enum_decl = ScopeAsDecl (enum_val->defined_in ()); + + if (d != enum_decl) + { + idl_global->err ()->incompatible_type_error (this); + return 0; + } + } + } + + if (this->type_mismatch (t)) + { + idl_global->err ()->incompatible_type_error (this); + return 0; + } + + return this->coerce (t); +} + // Coerce "this" to the ExprType required. Returns a copy of the // original ExprValue with the coercion applied, if successful, or // 0 if failed. diff --git a/TAO/TAO_IDL/ast/ast_interface.cpp b/TAO/TAO_IDL/ast/ast_interface.cpp index d0fb961db53..257097fedbe 100644 --- a/TAO/TAO_IDL/ast/ast_interface.cpp +++ b/TAO/TAO_IDL/ast/ast_interface.cpp @@ -73,6 +73,8 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "ast_interface.h" #include "ast_interface_fwd.h" +#include "ast_valuetype.h" +#include "ast_component.h" #include "ast_constant.h" #include "ast_exception.h" #include "ast_attribute.h" @@ -906,6 +908,18 @@ AST_Interface::fe_add_typedef (AST_Typedef *t) I_FALSE, t->local_name ()); + AST_Type *bt = t->base_type (); + UTL_ScopedName *mru = bt->last_referenced_as (); + + if (mru != 0) + { + this->add_to_referenced ( + bt, + I_FALSE, + mru->first_component () + ); + } + return t; } @@ -1102,6 +1116,106 @@ AST_Interface::fwd_redefinition_helper (AST_Interface *&i, } } +void +AST_Interface::redef_clash_populate_r (AST_Interface *t) +{ + if (this->insert_non_dup (t) == 0) + { + return; + } + + AST_Interface **parents = t->inherits (); + long n_parents = t->n_inherits (); + long i; + + for (i = 0; i < n_parents; ++i) + { + this->redef_clash_populate_r (parents[i]); + } + + AST_Decl::NodeType nt = t->node_type (); + + if (nt == AST_Decl::NT_valuetype) + { + AST_ValueType *v = AST_ValueType::narrow_from_decl (t); + AST_Interface **supports = v->supports (); + long n_supports = v->n_supports (); + + for (i = 0; i < n_supports; ++i) + { + this->redef_clash_populate_r (supports[i]); + } + } + else if (nt == AST_Decl::NT_component) + { + AST_Component *c = AST_Component::narrow_from_decl (t); + AST_Interface **supports = c->supports (); + long n_supports = c->n_supports (); + + for (i = 0; i < n_supports; ++i) + { + this->redef_clash_populate_r (supports[i]); + } + } +} + +int +AST_Interface::insert_non_dup (AST_Interface *t) +{ + const char *full_name = t->full_name (); + + // Initialize an iterator to search the queue for duplicates. + for (ACE_Unbounded_Queue_Iterator<AST_Interface *> q_iter ( + this->insert_queue + ); + !q_iter.done (); + (void) q_iter.advance ()) + { + // Queue element. + AST_Interface **temp; + + (void) q_iter.next (temp); + + if (!ACE_OS::strcmp (full_name, + (*temp)->full_name ())) + { + // We exist in this queue and cannot be inserted. + return 0; + } + } + + // Initialize an iterator to search the del_queue for duplicates. + for (ACE_Unbounded_Queue_Iterator<AST_Interface *> del_q_iter ( + this->del_queue + ); + !del_q_iter.done (); + (void) del_q_iter.advance ()) + { + // Queue element. + AST_Interface **temp; + + (void) del_q_iter.next (temp); + + if (!ACE_OS::strcmp (full_name, + (*temp)->full_name ())) + { + // We exist in this del_queue and cannot be inserted. + return 0; + } + } + + // Insert the parent in the queue. + if (this->insert_queue.enqueue_tail (t) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_interface::insert_non_dup - " + "enqueue failed\n"), + 0); + } + + return 1; +} + // This serves only for interfaces. AST_ValueType has its // own redefine() function which calls this one. void @@ -1155,150 +1269,133 @@ AST_Interface::n_inherits_flat (void) const return pd_n_inherits_flat; } -void -AST_Interface::inherited_name_clash (void) -{ - AST_Decl *my_member = 0; - AST_Decl *parent1_member = 0; - AST_Decl *parent2_member = 0; - - // Compare our members with those of each parent. - - for (UTL_ScopeActiveIterator my_members (DeclAsScope (this), IK_decls); - !my_members.is_done (); - my_members.next ()) +idl_bool +AST_Interface::redef_clash (void) +{ + this->insert_queue.reset (); + this->redef_clash_populate_r (this); + + AST_Interface **group1_member = 0; + AST_Interface **group2_member = 0; + AST_Decl *group1_member_item = 0; + AST_Decl *group2_member_item = 0; + + int i = 1; + + // Now compare all pairs. + for (ACE_Unbounded_Queue_Iterator<AST_Interface *> group1_iter ( + this->insert_queue + ); + !group1_iter.done (); + (void) group1_iter.advance (), ++i) { - my_member = my_members.item (); - Identifier *id = my_member->local_name (); + // Queue element. + (void) group1_iter.next (group1_member); - for (int i = 0; i < this->pd_n_inherits_flat; ++i) + for (UTL_ScopeActiveIterator group1_member_items ( + DeclAsScope (*group1_member), + UTL_Scope::IK_decls + ); + !group1_member_items.is_done (); + group1_member_items.next ()) { - for (UTL_ScopeActiveIterator parent_members ( - DeclAsScope (this->pd_inherits_flat[i]), - UTL_Scope::IK_decls + group1_member_item = group1_member_items.item (); + AST_Decl::NodeType nt1 = group1_member_item->node_type (); + + // Only these member types may cause a clash because + // they can't be redefined. + if (nt1 != AST_Decl::NT_op && nt1 != AST_Decl::NT_attr) + { + continue; + } + + Identifier *pid1 = group1_member_item->local_name (); + int j = 0; + + for (ACE_Unbounded_Queue_Iterator<AST_Interface *> group2_iter ( + this->insert_queue ); - !parent_members.is_done (); - parent_members.next ()) + !group2_iter.done (); + (void) group2_iter.advance ()) { - parent1_member = parent_members.item (); - AST_Decl::NodeType nt = parent1_member->node_type (); + // Since group1 and group2 are the same list, we can start this + // iterator from where the outer one is. + while (j++ < i) + { + group2_iter.advance (); + } - // All other member types but these may be redefined in - // the child. - if (nt == AST_Decl::NT_op || nt == AST_Decl::NT_attr) + if (group2_iter.done ()) { - Identifier *pid = parent1_member->local_name (); + break; + } - if (id->compare (pid) == I_TRUE) + // Queue element. + (void) group2_iter.next (group2_member); + + for (UTL_ScopeActiveIterator group2_member_items ( + DeclAsScope (*group2_member), + UTL_Scope::IK_decls + ); + !group2_member_items.is_done (); + group2_member_items.next ()) + { + group2_member_item = group2_member_items.item (); + AST_Decl::NodeType nt2 = group2_member_item->node_type (); + + // Only these member types may cause a clash + // with other parents' member of the same type. + if (nt2 != AST_Decl::NT_op && nt2 != AST_Decl::NT_attr) + { + continue; + } + + Identifier *pid2 = group2_member_item->local_name (); + + if (pid1->compare (pid2) == I_TRUE) { - idl_global->err ()->error2 (UTL_Error::EIDL_REDEF, - my_member, - parent1_member); + idl_global->err ()->error3 ( + UTL_Error::EIDL_REDEF, + *group1_member, + *group2_member, + group2_member_item + ); + return 1; } - else if (id->case_compare_quiet (pid) == I_TRUE) + else if (pid1->case_compare_quiet (pid2) == I_TRUE) { if (idl_global->case_diff_error ()) { - idl_global->err ()->error2 ( + idl_global->err ()->error3 ( UTL_Error::EIDL_NAME_CASE_ERROR, - my_member, - parent1_member + *group1_member, + group1_member_item, + group2_member_item ); } else { - idl_global->err ()->warning2 ( + idl_global->err ()->warning3 ( UTL_Error::EIDL_NAME_CASE_WARNING, - my_member, - parent1_member + *group1_member, + group1_member_item, + group2_member_item ); } - } - } // end of IF (nt == AST_Decl::NT_op ....) - } // end of FOR (parent_members ...) - } // end of FOR (i ...) - } // end of FOR (my_members ...) - // Now compare members of each parent with each other. - - for (int i = 0; i < this->pd_n_inherits_flat - 1; i++) - { - for (UTL_ScopeActiveIterator parent1_members ( - DeclAsScope (this->pd_inherits_flat[i]), - UTL_Scope::IK_decls - ); - !parent1_members.is_done (); - parent1_members.next ()) - { - parent1_member = parent1_members.item (); - AST_Decl::NodeType nt1 = parent1_member->node_type (); - - // Only these member types may cause a clash with other - // parents' member of the same type. - if (nt1 == AST_Decl::NT_op || nt1 == AST_Decl::NT_attr) - { - Identifier *pid1 = parent1_member->local_name (); - - for (int j = i + 1; j < this->pd_n_inherits_flat; j++) - { - for (UTL_ScopeActiveIterator parent2_members ( - DeclAsScope (this->pd_inherits_flat[j]), - UTL_Scope::IK_decls - ); - !parent2_members.is_done (); - parent2_members.next ()) - { - parent2_member = parent2_members.item (); - AST_Decl::NodeType nt2 = - parent2_member->node_type (); + return 1; + } + } // end of FOR (group2_member_items) + } // end of FOR (group2_iter) + } // end of FOR (group1_member_items) + } // end of FOR (group1_iter) - // Only these member types may cause a clash - // with other parents' member of the same type. - if (nt2 == AST_Decl::NT_op || nt2 == AST_Decl::NT_attr) - { - Identifier *pid2 = parent2_member->local_name (); - - if (pid1->compare (pid2) == I_TRUE) - { - idl_global->err ()->error3 ( - UTL_Error::EIDL_REDEF, - this, - parent1_member, - parent2_member - ); - } - else if (pid1->case_compare_quiet (pid2) == I_TRUE) - { - if (idl_global->case_diff_error ()) - { - idl_global->err ()->error3 ( - UTL_Error::EIDL_NAME_CASE_ERROR, - this, - parent1_member, - parent2_member - ); - } - else - { - idl_global->err ()->warning3 ( - UTL_Error::EIDL_NAME_CASE_WARNING, - this, - parent1_member, - parent2_member - ); - } - } - } // end of IF (nt2 == AST_Decl::NT_op ...) - } // end of FOR (parent2_members ...) - } // end of FOR (j ...) - } // end of IF (nt1 == AST_Decl::NT_op ..) - } // end of FOR (parent1_members ...) - } // end of FOR (i ...) + return 0; } AST_Decl * AST_Interface::lookup_for_add (AST_Decl *d, - idl_bool trea_as_ref) + idl_bool /* treat_as_ref */) { if (d == 0) { diff --git a/TAO/TAO_IDL/ast/ast_module.cpp b/TAO/TAO_IDL/ast/ast_module.cpp index 0965bfd1456..8deda7f4d69 100644 --- a/TAO/TAO_IDL/ast/ast_module.cpp +++ b/TAO/TAO_IDL/ast/ast_module.cpp @@ -240,6 +240,11 @@ AST_Module::fe_add_module (AST_Module *t) AST_Interface * AST_Module::fe_add_interface (AST_Interface *t) { + if (t->redef_clash ()) + { + return 0; + } + AST_Decl *predef = 0; AST_Interface *fwd = 0; @@ -322,6 +327,11 @@ AST_Module::fe_add_interface (AST_Interface *t) AST_ValueType * AST_Module::fe_add_valuetype (AST_ValueType *t) { + if (t->redef_clash ()) + { + return 0; + } + AST_Decl *predef = 0; AST_ValueType *fwd = 0; @@ -404,6 +414,11 @@ AST_Module::fe_add_valuetype (AST_ValueType *t) AST_Component * AST_Module::fe_add_component (AST_Component *t) { + if (t->redef_clash ()) + { + return 0; + } + AST_Decl *predef = 0; AST_Component *fwd = 0; @@ -1308,6 +1323,16 @@ AST_Module::fe_add_typedef (AST_Typedef *t) I_FALSE, t->local_name ()); + AST_Type *bt = t->base_type (); + UTL_ScopedName *mru = bt->last_referenced_as (); + + if (mru != 0) + { + this->add_to_referenced (bt, + I_FALSE, + mru->first_component ()); + } + return t; } diff --git a/TAO/TAO_IDL/ast/ast_sequence.cpp b/TAO/TAO_IDL/ast/ast_sequence.cpp index 02fd9508c6a..99f5fbdf6d9 100644 --- a/TAO/TAO_IDL/ast/ast_sequence.cpp +++ b/TAO/TAO_IDL/ast/ast_sequence.cpp @@ -83,6 +83,8 @@ AST_Sequence::AST_Sequence (void) : pd_max_size (0), pd_base_type (0) { + // A sequence data type is always VARIABLE. + this->size_type (AST_Type::VARIABLE); } AST_Sequence::AST_Sequence (AST_Expression *ms, @@ -108,6 +110,9 @@ AST_Sequence::AST_Sequence (AST_Expression *ms, { this->unbounded_ = I_FALSE; } + + // A sequence data type is always VARIABLE. + this->size_type (AST_Type::VARIABLE); } AST_Sequence::~AST_Sequence (void) diff --git a/TAO/TAO_IDL/ast/ast_structure.cpp b/TAO/TAO_IDL/ast/ast_structure.cpp index 91528cf3576..7d802ac1e98 100644 --- a/TAO/TAO_IDL/ast/ast_structure.cpp +++ b/TAO/TAO_IDL/ast/ast_structure.cpp @@ -271,6 +271,16 @@ AST_Structure::fe_add_field (AST_Field *t) I_FALSE, t->local_name ()); + AST_Type *ft = t->field_type (); + UTL_ScopedName *mru = ft->last_referenced_as (); + + if (mru != 0) + { + this->add_to_referenced (ft, + I_FALSE, + mru->first_component ()); + } + this->fields_.enqueue_tail (t); return t; diff --git a/TAO/TAO_IDL/ast/ast_union.cpp b/TAO/TAO_IDL/ast/ast_union.cpp index c74a05e4ee6..d9a6e4aaa1e 100644 --- a/TAO/TAO_IDL/ast/ast_union.cpp +++ b/TAO/TAO_IDL/ast/ast_union.cpp @@ -837,6 +837,13 @@ AST_Union::compute_default_index (void) // Get the next AST decl node. d = si.item (); + // If an enum is declared in our scope, its members are + // added to our scope as well, to detect clashes. + if (d->node_type () == AST_Decl::NT_enum_val) + { + continue; + } + if (!d->imported ()) { ub = AST_UnionBranch::narrow_from_decl (d); @@ -924,6 +931,16 @@ AST_Union::fe_add_union_branch (AST_UnionBranch *t) I_FALSE, t->local_name ()); + AST_Type *ft = t->field_type (); + UTL_ScopedName *mru = ft->last_referenced_as (); + + if (mru != 0) + { + this->add_to_referenced (ft, + I_FALSE, + mru->first_component ()); + } + this->fields_.enqueue_tail (t); return t; @@ -1140,6 +1157,12 @@ AST_Union::compute_size_type (void) { // Get the next AST decl node. AST_Decl *d = si.item (); + + if (d->node_type () == AST_Decl::NT_enum_val) + { + continue; + } + AST_Field *f = AST_Field::narrow_from_decl (d); if (f != 0) diff --git a/TAO/TAO_IDL/be/be_decl.cpp b/TAO/TAO_IDL/be/be_decl.cpp index 4dbeb42a225..93c29cf2de7 100644 --- a/TAO/TAO_IDL/be/be_decl.cpp +++ b/TAO/TAO_IDL/be/be_decl.cpp @@ -41,6 +41,19 @@ ACE_RCSID (be, // Default Constructor be_decl::be_decl (void) + : cli_hdr_gen_ (I_FALSE), + cli_stub_gen_ (I_FALSE), + cli_inline_gen_ (I_FALSE), + srv_hdr_gen_ (I_FALSE), + impl_hdr_gen_ (I_FALSE), + srv_skel_gen_ (I_FALSE), + impl_skel_gen_ (I_FALSE), + srv_inline_gen_ (I_FALSE), + cli_hdr_any_op_gen_ (I_FALSE), + cli_stub_any_op_gen_ (I_FALSE), + cli_hdr_cdr_op_gen_ (I_FALSE), + cli_stub_cdr_op_gen_ (I_FALSE), + cli_inline_cdr_op_gen_ (I_FALSE) { } @@ -48,7 +61,20 @@ be_decl::be_decl (void) be_decl::be_decl (AST_Decl::NodeType type, UTL_ScopedName *n) : AST_Decl (type, - n) + n), + cli_hdr_gen_ (I_FALSE), + cli_stub_gen_ (I_FALSE), + cli_inline_gen_ (I_FALSE), + srv_hdr_gen_ (I_FALSE), + impl_hdr_gen_ (I_FALSE), + srv_skel_gen_ (I_FALSE), + impl_skel_gen_ (I_FALSE), + srv_inline_gen_ (I_FALSE), + cli_hdr_any_op_gen_ (I_FALSE), + cli_stub_any_op_gen_ (I_FALSE), + cli_hdr_cdr_op_gen_ (I_FALSE), + cli_stub_cdr_op_gen_ (I_FALSE), + cli_inline_cdr_op_gen_ (I_FALSE) { } @@ -225,6 +251,171 @@ be_decl::scope (void) } } +// Boolean methods to test if code was already generated. +idl_bool +be_decl::cli_hdr_gen (void) +{ + return this->cli_hdr_gen_; +} + +idl_bool +be_decl::cli_stub_gen (void) +{ + return this->cli_stub_gen_; +} + +idl_bool +be_decl::cli_hdr_any_op_gen (void) +{ + return this->cli_hdr_any_op_gen_; +} + +idl_bool +be_decl::cli_stub_any_op_gen (void) +{ + return this->cli_stub_any_op_gen_; +} + +idl_bool +be_decl::cli_hdr_cdr_op_gen (void) +{ + return this->cli_hdr_cdr_op_gen_; +} + +idl_bool +be_decl::cli_stub_cdr_op_gen (void) +{ + return this->cli_stub_cdr_op_gen_; +} + +idl_bool +be_decl::cli_inline_cdr_op_gen (void) +{ + return this->cli_inline_cdr_op_gen_; +} + +idl_bool +be_decl::cli_inline_cdr_decl_gen (void) +{ + return this->cli_inline_cdr_decl_gen_; +} + +idl_bool +be_decl::cli_inline_gen (void) +{ + return this->cli_inline_gen_; +} + +idl_bool +be_decl::srv_hdr_gen (void) +{ + return this->srv_hdr_gen_; +} + +idl_bool +be_decl::impl_hdr_gen (void) +{ + return this->impl_hdr_gen_; +} + +idl_bool +be_decl::srv_skel_gen (void) +{ + return this->srv_skel_gen_; +} + +idl_bool +be_decl::impl_skel_gen (void) +{ + return this->impl_skel_gen_; +} + +idl_bool +be_decl::srv_inline_gen (void) +{ + return this->srv_inline_gen_; +} + +// Set the flag indicating that code generation is done. +void +be_decl::cli_hdr_gen (idl_bool val) +{ + this->cli_hdr_gen_ = val; +} + +void +be_decl::cli_stub_gen (idl_bool val) +{ + this->cli_stub_gen_ = val; +} + +void +be_decl::cli_hdr_any_op_gen (idl_bool val) +{ + this->cli_hdr_any_op_gen_ = val; +} + +void +be_decl::cli_stub_any_op_gen (idl_bool val) +{ + this->cli_stub_any_op_gen_ = val; +} + +void +be_decl::cli_hdr_cdr_op_gen (idl_bool val) +{ + this->cli_hdr_cdr_op_gen_ = val; +} + +void +be_decl::cli_stub_cdr_op_gen (idl_bool val) +{ + this->cli_stub_cdr_op_gen_ = val; +} + +void +be_decl::cli_inline_cdr_op_gen (idl_bool val) +{ + this->cli_inline_cdr_op_gen_ = val; +} + +void +be_decl::cli_inline_cdr_decl_gen (idl_bool val) +{ + this->cli_inline_cdr_decl_gen_ = val; +} + +void +be_decl::cli_inline_gen (idl_bool val) +{ + this->cli_inline_gen_ = val; +} + +void +be_decl::srv_hdr_gen (idl_bool val) +{ + this->srv_hdr_gen_ = val; +} + +void +be_decl::impl_hdr_gen (idl_bool val) +{ + this->impl_hdr_gen_ = val; +} + + +void +be_decl::srv_skel_gen (idl_bool val) +{ + this->srv_skel_gen_ = val; +} + +void +be_decl::srv_inline_gen (idl_bool val) +{ + this->srv_inline_gen_ = val; +} + int be_decl::accept (be_visitor *visitor) { diff --git a/TAO/TAO_IDL/be/be_global.cpp b/TAO/TAO_IDL/be/be_global.cpp index 524ea6868cd..4e3730d6030 100644 --- a/TAO/TAO_IDL/be/be_global.cpp +++ b/TAO/TAO_IDL/be/be_global.cpp @@ -331,7 +331,6 @@ BE_GlobalData::be_get_implementation_skel_fname (int base_name_only) base_name_only); } - const char * BE_GlobalData::be_get_server_template_hdr_fname (int base_name_only) { @@ -345,21 +344,12 @@ BE_GlobalData::be_get_server_skeleton_fname () return be_get_server_skeleton (idl_global->stripped_filename ()); } -/* -const char * -BE_GlobalData::be_get_implementation_hdr_fname () -{ - return be_get_implementation_hdr (idl_global->stripped_filename ()); -} -*/ - const char * BE_GlobalData::be_get_implementation_skeleton_fname () { return be_get_implementation_skel (idl_global->stripped_filename ()); } - const char * BE_GlobalData::be_get_server_template_skeleton_fname (int base_name_only) { @@ -538,7 +528,6 @@ BE_GlobalData::implementation_skel_ending (const char* s) this->implementation_skel_ending_ = ACE::strnew (s); } - void BE_GlobalData::impl_class_prefix (const char* s) { @@ -565,7 +554,6 @@ BE_GlobalData::implementation_hdr_ending (void) const return this->implementation_hdr_ending_; } - const char* BE_GlobalData::impl_class_suffix (void) const { @@ -578,8 +566,6 @@ BE_GlobalData::implementation_skel_ending (void) const return this->implementation_skel_ending_; } - - void BE_GlobalData::server_template_hdr_ending (const char* s) { diff --git a/TAO/TAO_IDL/be/be_interface.cpp b/TAO/TAO_IDL/be/be_interface.cpp index 15834f9d83a..2b63c65e975 100644 --- a/TAO/TAO_IDL/be/be_interface.cpp +++ b/TAO/TAO_IDL/be/be_interface.cpp @@ -21,6 +21,7 @@ // ============================================================================ #include "be_interface.h" +#include "be_valuetype.h" #include "be_interface_strategy.h" #include "be_attribute.h" #include "be_operation.h" @@ -842,7 +843,8 @@ be_interface::gen_var_impl (char *interface_local_name, *cs << "return val;" << be_uidt_nl; *cs << "}" << be_nl << be_nl; - // Hooks for the global static functions used by non-defined interfaces. + // Hooks for the flat name global functions used by references to + // non-defined interfaces. *cs << "::" << interface_full_name << "_ptr" << be_nl << fname << "::tao_duplicate (" @@ -1145,7 +1147,8 @@ TAO_IDL_Gen_OpTable_Worker::emit (be_interface * /* derived_interface */, { // Generate entries for the derived class using the properties of its // ancestors. - return base_interface->gen_optable_entries (this->skeleton_name_, os); + be_interface *bi = be_interface::narrow_from_decl (base_interface); + return bi->gen_optable_entries (this->skeleton_name_, os); } int @@ -1608,7 +1611,7 @@ be_interface::traverse_inheritance_graph ( // Do until queue is empty. while (!this->insert_queue.is_empty ()) { - be_interface *bi; // element inside the queue + AST_Interface *intf; // element inside the queue // Use breadth-first strategy i.e., first generate entries for ourselves, // followed by nodes that we immediately inherit from, and so on. In the @@ -1617,7 +1620,7 @@ be_interface::traverse_inheritance_graph ( // a diamond-like inheritance graph. // Dequeue the element at the head of the queue. - if (this->insert_queue.dequeue_head (bi)) + if (this->insert_queue.dequeue_head (intf)) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_interface::traverse_graph - " @@ -1626,7 +1629,7 @@ be_interface::traverse_inheritance_graph ( } // Insert the dequeued element in the del_queue. - if (this->del_queue.enqueue_tail (bi) == -1) + if (this->del_queue.enqueue_tail (intf) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_interface::traverse_graph - " @@ -1634,6 +1637,8 @@ be_interface::traverse_inheritance_graph ( -1); } + be_interface *bi = be_interface::narrow_from_decl (intf); + // Use the helper method to generate code for ourself using the // properties of the element dequeued. For the first iteration, the // element dequeued and "this" will be the same i.e., ourselves. @@ -1645,18 +1650,19 @@ be_interface::traverse_inheritance_graph ( -1); } + long i; + // Now check if the dequeued element has any ancestors. If yes, insert // them inside the queue making sure that there are no duplicates. - for (long i = 0; i < bi->n_inherits (); i++) + for (i = 0; i < bi->n_inherits (); ++i) { // Retrieve the next parent from which the dequeued element inherits. - be_interface *parent = - be_interface::narrow_from_decl (bi->inherits ()[i]); + AST_Interface *parent = bi->inherits ()[i]; if (parent == 0) { ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_interface::gen_server_skeletons -" + "(%N:%l) be_interface::traverse_graph -" " bad inherited interface\n"), -1); } @@ -1666,71 +1672,7 @@ be_interface::traverse_inheritance_graph ( continue; } - // Now insert this node at the tail of the queue, but make sure that - // it doesn't already exist in the queue. - int found = 0; - - // Initialize an iterator to search the queue for duplicates. - for (ACE_Unbounded_Queue_Iterator<be_interface*> q_iter ( - this->insert_queue - ); - !q_iter.done (); - (void) q_iter.advance ()) - { - // Queue element. - be_interface **temp; - - (void) q_iter.next (temp); - - if (!ACE_OS::strcmp (parent->full_name (), - (*temp)->full_name ())) - { - // We exist in this queue and cannot be inserted. - found = 1; - } - - if (found) - { - break; - } - } - - // Initialize an iterator to search the del_queue for duplicates. - for (ACE_Unbounded_Queue_Iterator<be_interface*> del_q_iter ( - this->del_queue - ); - !found && !del_q_iter.done (); - (void) del_q_iter.advance ()) - { - // Queue element. - be_interface **temp; - - (void) del_q_iter.next (temp); - - if (!ACE_OS::strcmp (parent->full_name (), - (*temp)->full_name ())) - { - // We exist in this del_queue and cannot be inserted. - found = 1; - } - - if (found) - { - break; - } - } - - if (!found) - { - // Insert the parent in the queue. - if (this->insert_queue.enqueue_tail (parent) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_interface::gen_server_skeletons - " - "enqueue op failed\n"), - -1); - } - } + (void) this->insert_non_dup (parent); } // end of for loop } // end of while queue not empty @@ -2107,7 +2049,6 @@ be_interface::gen_linear_search_instance (const char *flat_name) << ";\n" << be_nl; } - int be_interface::is_a_helper (be_interface * /*derived*/, be_interface *bi, diff --git a/TAO/TAO_IDL/be/be_sequence.cpp b/TAO/TAO_IDL/be/be_sequence.cpp index 426537092d3..89b440663da 100644 --- a/TAO/TAO_IDL/be/be_sequence.cpp +++ b/TAO/TAO_IDL/be/be_sequence.cpp @@ -37,7 +37,6 @@ be_sequence::be_sequence (void) : mt_ (be_sequence::MNG_UNKNOWN) { // Always the case. - this->size_type (AST_Type::VARIABLE); this->has_constructor (I_TRUE); } @@ -68,9 +67,6 @@ be_sequence::be_sequence (AST_Expression *v, abstract), mt_ (be_sequence::MNG_UNKNOWN) { - // A sequence data type is always VARIABLE. - this->size_type (AST_Type::VARIABLE); - // Always the case. this->has_constructor (I_TRUE); } diff --git a/TAO/TAO_IDL/be/be_valuetype.cpp b/TAO/TAO_IDL/be/be_valuetype.cpp index 8b47df4c2a7..112b060e3e6 100644 --- a/TAO/TAO_IDL/be/be_valuetype.cpp +++ b/TAO/TAO_IDL/be/be_valuetype.cpp @@ -232,9 +232,15 @@ be_valuetype::gen_var_defn (char *local_name) // Generate an additional member function that returns // the underlying pointer. - *ch << local_name << "* ptr (void) const;"; + *ch << local_name << "* ptr (void) const;" << be_nl << be_nl; - *ch << be_uidt_nl << be_nl; + // Hooks for non-defined forward declared interfaces. + *ch << "// Hooks used by template sequence and valuetype manager classes" + << be_nl + << "// for non-defined forward declared valuetypes." << be_nl + << "static void tao_add_ref (" << local_name << " *);" << be_nl + << "static void tao_remove_ref (" << local_name << " *);" + << be_uidt_nl << be_nl; // Private. *ch << "private:" << be_idt_nl; @@ -439,9 +445,27 @@ be_valuetype::gen_var_impl (char *local_name, *cs << local_name << "* tmp = this->ptr_;" << be_nl; *cs << "this->ptr_ = 0;" << be_nl; *cs << "return tmp;" << be_uidt_nl; - *cs << "}" << be_nl << be_nl; + // Hooks for the flat name global functions used by references to + // non-defined valuetypes. + *cs << "void" << be_nl + << fname << "::tao_add_ref (" << be_idt << be_idt_nl + << local_name << " *p" << be_uidt_nl + << ")" << be_uidt_nl + << "{" << be_idt_nl + << "CORBA::add_ref (p);" + << be_uidt_nl + << "}" << be_nl << be_nl; + + *cs << "void" << be_nl + << fname << "::tao_remove_ref (" << be_idt << be_idt_nl + << local_name << " *p" << be_uidt_nl + << ")" << be_uidt_nl + << "{" << be_idt_nl + << "CORBA::remove_ref (p);" << be_uidt_nl + << "}" << be_nl << be_nl; + return 0; } @@ -666,16 +690,7 @@ be_valuetype::gen_helper_header (char*, << this->full_name () << " *);" << be_nl << "TAO_NAMESPACE_STORAGE_CLASS void remove_ref (" << this->full_name () << " *);"; -/* - if (this->supports_abstract ()) - { - *os << be_nl - << "TAO_NAMESPACE_STORAGE_CLASS void add_ref (" - << "OBV_" << this->full_name () << " *);" << be_nl - << "TAO_NAMESPACE_STORAGE_CLASS void remove_ref (" - << "OBV_" << this->full_name () << " *);"; - } -*/ + *os << be_uidt_nl << "}" << be_nl << "TAO_NAMESPACE_CLOSE" << be_nl << be_nl; diff --git a/TAO/TAO_IDL/be/be_visitor_constant/constant_ch.cpp b/TAO/TAO_IDL/be/be_visitor_constant/constant_ch.cpp index 46f0663604b..a0a8c24240e 100644 --- a/TAO/TAO_IDL/be/be_visitor_constant/constant_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_constant/constant_ch.cpp @@ -41,69 +41,73 @@ be_visitor_constant_ch::~be_visitor_constant_ch (void) int be_visitor_constant_ch::visit_constant (be_constant *node) { + if (node->cli_hdr_gen () || node->imported ()) + { + return 0; + } + TAO_OutStream *os = this->ctx_->stream (); - if (!node->cli_hdr_gen () && !node->imported ()) + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + + // If we are defined in the outermost scope, then the value is assigned + // to us here itself, else it will be in the *.cpp file. + + if (be_global->gen_inline_constants ()) { - // If we are defined in the outermost scope, then the value is assigned - // to us here itself, else it will be in the *.cpp file. + if (node->et () == AST_Expression::EV_enum) + { + *os << node->enum_full_name (); + } + else + { + *os << node->exprtype_to_string (); + } - if (be_global->gen_inline_constants ()) + *os << " const " + << node->local_name () << " = " + << node->constant_value (); + } + // Is our enclosing scope a module? We need this check because for + // platforms that support namespaces, the constant must be declared + // extern. + else + { + AST_Decl::NodeType nt = node->defined_in ()->scope_node_type (); + + if (node->is_nested () && nt == AST_Decl::NT_module) + { + *os << "TAO_NAMESPACE_STORAGE_CLASS "; + } + else + { + *os << "static "; + } + + *os << "const "; + + if (node->et () == AST_Expression::EV_enum) { - if (node->et () == AST_Expression::EV_enum) - { - *os << node->enum_full_name (); - } - else - { - *os << node->exprtype_to_string (); - } - - *os << " const " - << node->local_name () << " = " - << node->constant_value (); + *os << node->enum_full_name (); } - // Is our enclosing scope a module? We need this check because for - // platforms that support namespaces, the constant must be declared - // extern. - else + else { - AST_Decl::NodeType nt = node->defined_in ()->scope_node_type (); - - if (node->is_nested () && nt == AST_Decl::NT_module) - { - *os << "TAO_NAMESPACE_STORAGE_CLASS "; - } - else - { - *os << "static "; - } - - *os << "const "; - - if (node->et () == AST_Expression::EV_enum) - { - *os << node->enum_full_name (); - } - else - { - *os << node->exprtype_to_string (); - } - - *os << " " << node->local_name (); - - if (!node->is_nested ()) - { - // We were defined at the outermost scope. So we put the value - // in the header itself. - *os << " = " << node->constant_value (); - } + *os << node->exprtype_to_string (); } - *os << ";" << be_nl << be_nl; + *os << " " << node->local_name (); - node->cli_hdr_gen (I_TRUE); + if (!node->is_nested ()) + { + // We were defined at the outermost scope. So we put the value + // in the header itself. + *os << " = " << node->constant_value (); + } } + *os << ";" << be_nl << be_nl; + + node->cli_hdr_gen (I_TRUE); return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_enum/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_enum/any_op_ch.cpp index dc29bb742c3..d24f74dabe2 100644 --- a/TAO/TAO_IDL/be/be_visitor_enum/any_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_enum/any_op_ch.cpp @@ -46,14 +46,16 @@ be_visitor_enum_any_op_ch::visit_enum (be_enum *node) TAO_OutStream *os = this->ctx_->stream (); + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // Generate the Any <<= and >>= operators. - os->indent (); *os << be_global->stub_export_macro () << " void" << " operator<<= (CORBA::Any &, " << node->name () << ");" << be_nl; *os << be_global->stub_export_macro () << " CORBA::Boolean" << " operator>>= (const CORBA::Any &, " - << node->name () << " &);\n"; + << node->name () << " &);" << be_nl << be_nl; node->cli_hdr_any_op_gen (1); return 0; diff --git a/TAO/TAO_IDL/be/be_visitor_enum/enum_ch.cpp b/TAO/TAO_IDL/be/be_visitor_enum/enum_ch.cpp index 3d850057bbd..61cae521526 100644 --- a/TAO/TAO_IDL/be/be_visitor_enum/enum_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_enum/enum_ch.cpp @@ -43,56 +43,60 @@ be_visitor_enum_ch::~be_visitor_enum_ch (void) int be_visitor_enum_ch::visit_enum (be_enum *node) { + if (node->cli_hdr_gen () || node->imported ()) + { + return 0; + } + TAO_OutStream *os = this->ctx_->stream (); // Comma to be generated by the scope visitor. this->ctx_->comma (1); - if (!node->cli_hdr_gen () && !node->imported ()) + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + + *os << "enum " << node->local_name () << be_nl; + *os << "{" << be_idt_nl; + + if (this->visit_scope (node) == 1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_enum_ch::" + "visit_enum - " + "scope generation failed\n" + ), + -1); + } + + *os << be_uidt_nl; + *os << "};" << be_nl << be_nl; + + // As per the ORBOS spec, we need the following typedef + *os << "typedef " << node->local_name () << " &" << node->local_name () + << "_out;" << be_nl << be_nl; + + if (!node->is_local ()) { - *os << "enum " << node->local_name () << be_nl; - *os << "{" << be_idt_nl; - - if (this->visit_scope (node) == 1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_enum_ch::" - "visit_enum - " - "scope generation failed\n" - ), - -1); - } - - *os << be_uidt_nl; - *os << "};" << be_nl << be_nl; - - // As per the ORBOS spec, we need the following typedef - *os << "typedef " << node->local_name () << " &" << node->local_name () - << "_out;" << be_nl; - - if (!node->is_local ()) + // By using a visitor to declare and define the TypeCode, we have + // the added advantage to conditionally not generate any code. This + // will be based on the command line options. This is still TO-DO. + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_TYPECODE_DECL); + be_visitor_typecode_decl visitor (&ctx); + + if (node->accept (&visitor) == -1) { - // By using a visitor to declare and define the TypeCode, we have - // the added advantage to conditionally not generate any code. This - // will be based on the command line options. This is still TO-DO. - be_visitor_context ctx (*this->ctx_); - ctx.state (TAO_CodeGen::TAO_TYPECODE_DECL); - be_visitor_typecode_decl visitor (&ctx); - - if (node->accept (&visitor) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_enum_ch::" - "visit_enum - " - "TypeCode declaration failed\n" - ), - -1); - } + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_enum_ch::" + "visit_enum - " + "TypeCode declaration failed\n" + ), + -1); } - - node->cli_hdr_gen (I_TRUE); } + node->cli_hdr_gen (I_TRUE); return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ih.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ih.cpp index 1727937833f..f47b5821a39 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ih.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ih.cpp @@ -149,7 +149,8 @@ be_visitor_interface_ih::method_helper (be_interface *derived, { ACE_ERROR_RETURN ((LM_ERROR, "be_visitor_interface_is::" - "method_helper\n"), -1); + "method_helper\n"), + -1); } } diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp index a00bdf831db..1dbd41d5731 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp @@ -130,7 +130,7 @@ be_visitor_interface_is::visit_interface (be_interface *node) if (status == -1) { ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_interface_tie_sh_ss::" + "be_visitor_interface_is::" "visit_interface - " "traversal of inhertance graph failed\n"), -1); @@ -146,7 +146,6 @@ be_visitor_interface_is::method_helper (be_interface *derived, be_interface *node, TAO_OutStream *os) { - if (ACE_OS::strcmp (derived->flat_name (), node->flat_name ()) != 0) { be_visitor_context ctx; diff --git a/TAO/TAO_IDL/be/be_visitor_module/module_ih.cpp b/TAO/TAO_IDL/be/be_visitor_module/module_ih.cpp index 5d4c6755852..92eacef28aa 100644 --- a/TAO/TAO_IDL/be/be_visitor_module/module_ih.cpp +++ b/TAO/TAO_IDL/be/be_visitor_module/module_ih.cpp @@ -41,7 +41,7 @@ be_visitor_module_ih::visit_module (be_module *node) if (this->visit_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_module_sh::" + "(%N:%l) be_visitor_module_ih::" "visit_module - " "codegen for scope failed\n"), -1); diff --git a/TAO/TAO_IDL/be/be_visitor_operation.cpp b/TAO/TAO_IDL/be/be_visitor_operation.cpp index 501711b8731..637a30c707a 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation.cpp @@ -39,6 +39,7 @@ #include "be_helper.h" #include "utl_identifier.h" #include "utl_exceptlist.h" +#include "nr_extern.h" #include "be_visitor_operation.h" #include "be_visitor_argument.h" diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_is.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_is.cpp index b4e04fbacd4..928cddddcc5 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_is.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_is.cpp @@ -74,18 +74,10 @@ be_visitor_operation_is::visit_operation (be_operation *node) { // If derived class/ classname = intf->flat_name (); - } else { - ACE_CString str(node->flat_name ()); - - int lnmlength = ACE_OS::strlen (node->local_name ()->get_string ()); - - int fnmlength = ACE_OS::strlen (node->flat_name ()); - fnmlength--; - - classname = str.substr (0, (fnmlength-lnmlength)).rep (); + classname = ScopeAsDecl (node->defined_in ())->flat_name (); } // STEP 2: generate the operation name @@ -107,8 +99,8 @@ be_visitor_operation_is::visit_operation (be_operation *node) -1); } - *os <<be_idt_nl << "{"<<be_idt_nl; - *os << "//Add your implementation here"<<be_uidt_nl; + *os << be_idt_nl << "{" << be_idt_nl; + *os << "// Add your implementation here" << be_uidt_nl; *os << "}" << be_nl << be_uidt_nl; return 0; diff --git a/TAO/TAO_IDL/be/be_visitor_root/cdr_op.cpp b/TAO/TAO_IDL/be/be_visitor_root/cdr_op.cpp index b9101b6c527..ce1b5ad5c47 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/cdr_op.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/cdr_op.cpp @@ -44,8 +44,7 @@ be_visitor_root_cdr_op::visit_root (be_root *node) if (this->ctx_->state () == TAO_CodeGen::TAO_ROOT_CDR_OP_CH) { - *os << be_nl - << "#ifndef __ACE_INLINE__\n\n"; + *os << "#ifndef __ACE_INLINE__" << be_nl << be_nl; } if (this->visit_scope (node) == -1) diff --git a/TAO/TAO_IDL/be/be_visitor_root/root.cpp b/TAO/TAO_IDL/be/be_visitor_root/root.cpp index b8538e12eec..68ee260a2ec 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/root.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/root.cpp @@ -97,49 +97,73 @@ int be_visitor_root::visit_root (be_root *node) if (size > 0) { - *os << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; } for (index = 0; index < size; ++index) { be_global->non_defined_interfaces.dequeue_head (ifwd); - *os << "// External declarations for undefined interface" << be_nl - << "// " << ifwd->full_name () << be_nl; - - *os << be_global->stub_export_macro () << be_nl - << ifwd->full_name () << "_ptr" << be_nl - << "tao_" << ifwd->flat_name () - << "_duplicate (" - << be_idt << be_idt_nl - << ifwd->full_name () << "_ptr" << be_uidt_nl - << ");" << be_uidt_nl - << be_global->stub_export_macro () << be_nl - << "void" << be_nl - << "tao_" << ifwd->flat_name () - << "_release (" << be_idt << be_idt_nl - << ifwd->full_name () << "_ptr" << be_uidt_nl - << ");" << be_uidt_nl - << be_global->stub_export_macro () << be_nl - << ifwd->full_name () << "_ptr" << be_nl - << "tao_" << ifwd->flat_name () - << "_nil (" << be_idt << be_idt_nl - << "void" << be_uidt_nl - << ");" << be_uidt_nl - << be_global->stub_export_macro () << be_nl - << ifwd->full_name () << "_ptr" << be_nl - << "tao_" << ifwd->flat_name () - << "_narrow (" << be_idt << be_idt_nl - << "CORBA::Object *" << be_nl - << "ACE_ENV_ARG_DECL_NOT_USED" << be_uidt_nl - << ");" << be_uidt_nl - << be_global->stub_export_macro () << be_nl - << "CORBA::Object *" << be_nl - << "tao_" << ifwd->flat_name () - << "_upcast (" << be_idt << be_idt_nl - << "void *" << be_uidt_nl - << ");" << be_uidt_nl << be_nl; + if (ifwd->is_valuetype ()) + { + *os << "// External declarations for undefined valuetype" + << be_nl + << "// " << ifwd->full_name () << be_nl; + + *os << be_global->stub_export_macro () << be_nl + << "void" << be_nl + << "tao_" << ifwd->flat_name () + << "_add_ref (" + << be_idt << be_idt_nl + << ifwd->full_name () << " *" << be_uidt_nl + << ");" << be_uidt_nl + << be_global->stub_export_macro () << be_nl + << "void" << be_nl + << "tao_" << ifwd->flat_name () + << "_remove_ref (" << be_idt << be_idt_nl + << ifwd->full_name () << " *" << be_uidt_nl + << ");" << be_uidt_nl << be_nl; + } + else + { + *os << "// External declarations for undefined interface" + << be_nl + << "// " << ifwd->full_name () << be_nl; + + *os << be_global->stub_export_macro () << be_nl + << ifwd->full_name () << "_ptr" << be_nl + << "tao_" << ifwd->flat_name () + << "_duplicate (" + << be_idt << be_idt_nl + << ifwd->full_name () << "_ptr" << be_uidt_nl + << ");" << be_uidt_nl + << be_global->stub_export_macro () << be_nl + << "void" << be_nl + << "tao_" << ifwd->flat_name () + << "_release (" << be_idt << be_idt_nl + << ifwd->full_name () << "_ptr" << be_uidt_nl + << ");" << be_uidt_nl + << be_global->stub_export_macro () << be_nl + << ifwd->full_name () << "_ptr" << be_nl + << "tao_" << ifwd->flat_name () + << "_nil (" << be_idt << be_idt_nl + << "void" << be_uidt_nl + << ");" << be_uidt_nl + << be_global->stub_export_macro () << be_nl + << ifwd->full_name () << "_ptr" << be_nl + << "tao_" << ifwd->flat_name () + << "_narrow (" << be_idt << be_idt_nl + << "CORBA::Object *" << be_nl + << "ACE_ENV_ARG_DECL_NOT_USED" << be_uidt_nl + << ");" << be_uidt_nl + << be_global->stub_export_macro () << be_nl + << "CORBA::Object *" << be_nl + << "tao_" << ifwd->flat_name () + << "_upcast (" << be_idt << be_idt_nl + << "void *" << be_uidt_nl + << ");" << be_uidt_nl << be_nl; + } } size = be_global->mixed_parentage_interfaces.size (); diff --git a/TAO/TAO_IDL/be/be_visitor_root/root_is.cpp b/TAO/TAO_IDL/be/be_visitor_root/root_is.cpp index 6f79c610fcf..82f3fe275c2 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/root_is.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/root_is.cpp @@ -1,3 +1,6 @@ +// +// $Id$ +// // ============================================================================ // // = LIBRARY diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_cs.cpp index e76a92ccafc..14e7c6a4703 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_cs.cpp @@ -176,8 +176,7 @@ be_visitor_sequence_cs::gen_bounded_obj_sequence (be_sequence *node) if (pt->node_type () == AST_Decl::NT_valuetype) { - *os << "if (tmp[i] != 0)" << be_idt_nl - << "tmp[i]->_remove_ref ();" << be_uidt_nl + *os << "tao_" << pt->flat_name () << "_remove_ref (tmp[i]);" << be_nl << "tmp[i] = 0;"; } else if (bt_is_defined) diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ch.cpp index e39a02df0a4..a1018f6013c 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ch.cpp @@ -58,8 +58,8 @@ be_visitor_sequence_ch::gen_unbounded_obj_sequence (be_sequence *node) ctx.state (TAO_CodeGen::TAO_SEQUENCE_BASE_CH); be_visitor_sequence_base visitor (&ctx); - *os << be_nl << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl; os->gen_ifdef_AHETI(); os->gen_ifdef_macro (class_name); @@ -176,21 +176,22 @@ be_visitor_sequence_ch::gen_unbounded_obj_sequence (be_sequence *node) *os << "virtual void _shrink_buffer (" << be_idt << be_idt_nl << "CORBA::ULong nl," << be_nl << "CORBA::ULong ol" << be_uidt_nl - << ");" << be_uidt_nl << be_nl; + << ");"; if (! (is_pseudo_object || nt == AST_Decl::NT_valuetype)) { // Pseudo objects do not require these methods. - *os << "virtual void _downcast (" << be_idt << be_idt_nl - << "void* target," << be_nl - << "CORBA_Object *src" << be_nl - << "ACE_ENV_ARG_DECL_WITH_DEFAULTS" << be_uidt_nl - << ");" << be_uidt_nl; + *os << be_uidt_nl << be_nl + << "virtual void _downcast (" << be_idt << be_idt_nl + << "void* target," << be_nl + << "CORBA_Object *src" << be_nl + << "ACE_ENV_ARG_DECL_WITH_DEFAULTS" << be_uidt_nl + << ");" << be_uidt_nl; *os << "virtual CORBA_Object* _upcast (void *src) const;"; } - *os << be_uidt_nl << "};" << be_nl; + *os << be_uidt << be_uidt_nl << "};" << be_nl; os->gen_endif (); // endif macro diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_cs.cpp index 431a23c2280..f0c57e1a88a 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_cs.cpp @@ -99,8 +99,8 @@ be_visitor_sequence_cs::gen_unbounded_obj_sequence (be_sequence *node) ctx.state (TAO_CodeGen::TAO_SEQUENCE_BASE_CS); be_visitor_sequence_base visitor (&ctx); - *os << be_nl << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl; os->gen_ifdef_AHETI(); os->gen_ifdef_macro (class_name); @@ -136,8 +136,7 @@ be_visitor_sequence_cs::gen_unbounded_obj_sequence (be_sequence *node) if (pt->node_type () == AST_Decl::NT_valuetype) { - *os << "if (old[i] != 0)" << be_idt_nl - << "old[i]->_add_ref ();" << be_uidt_nl + *os << "tao_" << pt->flat_name () << "_add_ref (old[i]);" << be_nl << "tmp[i] = old[i];"; } else @@ -165,7 +164,7 @@ be_visitor_sequence_cs::gen_unbounded_obj_sequence (be_sequence *node) << "}" << be_uidt_nl << be_nl << "if (this->release_)" << be_idt_nl << "{" << be_idt_nl - << "delete[] old;" << be_uidt_nl + << "delete [] old;" << be_uidt_nl << "}" << be_uidt << be_uidt_nl << "}" << be_nl << "this->buffer_ = tmp;" << be_uidt_nl @@ -191,8 +190,7 @@ be_visitor_sequence_cs::gen_unbounded_obj_sequence (be_sequence *node) if (pt->node_type () == AST_Decl::NT_valuetype) { - *os << "if (tmp[i] != 0)" << be_idt_nl - << "tmp[i]->_remove_ref ();" << be_uidt_nl + *os << "tao_" << pt->flat_name () << "_remove_ref (tmp[i]);" << be_nl << "tmp[i] = 0;"; } else if (bt_is_defined) @@ -243,8 +241,7 @@ be_visitor_sequence_cs::gen_unbounded_obj_sequence (be_sequence *node) if (pt->node_type () == AST_Decl::NT_valuetype) { - *os << "if (tmp[i] != 0)" << be_idt_nl - << "tmp[i]->_remove_ref ();" << be_uidt_nl + *os << "tao_" << pt->flat_name () << "_remove_ref (tmp[i]);" << be_nl << "tmp[i] = 0;"; } else if (bt_is_defined) diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp index 5273361760e..5677be4cf09 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp @@ -50,8 +50,8 @@ be_visitor_sequence_cs::gen_base_sequence_class (be_sequence *node) -1); } - *os << be_nl << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; os->gen_ifdef_AHETI(); @@ -249,8 +249,8 @@ int be_visitor_sequence_cs::visit_sequence (be_sequence *node) "Bad element type\n"), -1); } - *os << be_nl << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "// *************************************************************" << be_nl diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp index cc4ec464ae7..5b371afd375 100644 --- a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp @@ -60,7 +60,7 @@ be_visitor_typecode_decl::visit_type (be_type *node) *os << "::CORBA::TypeCode_ptr " << node->tc_name ()->last_component () - << ";" << be_nl; + << ";" << be_nl << be_nl; } else { @@ -68,7 +68,7 @@ be_visitor_typecode_decl::visit_type (be_type *node) *os << "extern " << be_global->stub_export_macro () << " ::CORBA::TypeCode_ptr " << " " << node->tc_name ()->last_component () - << ";" << be_nl; + << ";" << be_nl << be_nl; } return 0; diff --git a/TAO/TAO_IDL/be/be_visitor_union/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_union/cdr_op_ci.cpp index c93848c4f4a..cf17212389f 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/cdr_op_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/cdr_op_ci.cpp @@ -219,6 +219,14 @@ be_visitor_union_cdr_op_ci::pre_process (be_decl *bd) return 0; } + // Enum val nodes are added just to help check reference + // clashes, since an enum declared in our scope is not itself + // a scope. + if (bd->node_type () == AST_Decl::NT_enum_val) + { + return 0; + } + TAO_OutStream *os = this->ctx_->stream (); be_union_branch* b = @@ -253,13 +261,18 @@ be_visitor_union_cdr_op_ci::pre_process (be_decl *bd) } int -be_visitor_union_cdr_op_ci::post_process (be_decl *) +be_visitor_union_cdr_op_ci::post_process (be_decl *bd) { if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_SCOPE) { return 0; } + if (bd->node_type () == AST_Decl::NT_enum_val) + { + return 0; + } + TAO_OutStream *os = this->ctx_->stream (); *os << be_uidt_nl << "}" << be_nl diff --git a/TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp index 94b888811e7..278d3a46086 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp @@ -109,11 +109,18 @@ int be_visitor_union_cs::visit_union (be_union *node) // so that, if the uninitialized union is inserted into an Any, // the Any destructor's call to deep_free() will work properly. UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls); + be_union_branch *ub = 0; - // Just get the union's first member. - AST_Decl *d = si.item (); + // In case we have some bogus enum values from an enum declared + // in our scope. + while (ub == 0) + { + // Just get the union's first member. + AST_Decl *d = si.item (); - be_union_branch *ub = be_union_branch::narrow_from_decl (d); + ub = be_union_branch::narrow_from_decl (d); + si.next (); + } // Get the first label in its list. AST_UnionLabel *ul = ub->label (0); diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_ch.cpp index 0f7a3aeb599..2b8790ce4fc 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_ch.cpp @@ -44,8 +44,6 @@ be_visitor_valuetype_cdr_op_ch::visit_valuetype (be_valuetype *node) } TAO_OutStream *os = this->ctx_->stream (); - os->indent (); //start with whatever indentation level we are at now - if (!node->cli_hdr_cdr_op_gen ()) { // Generate helper functions declaration. @@ -58,7 +56,8 @@ be_visitor_valuetype_cdr_op_ch::visit_valuetype (be_valuetype *node) -1); } - os->indent (); //start with whatever indentation level we are at now + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << be_global->stub_export_macro () << " " << "CORBA::Boolean operator<< (TAO_OutputCDR &, const " diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp index cea7425e0e3..529fd388412 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp @@ -63,7 +63,28 @@ be_visitor_valuetype_cs::visit_valuetype (be_valuetype *node) TAO_OutStream *os = this->ctx_->stream (); - os->indent (); + *os << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + + // Global functions to allow non-defined forward declared interfaces + // access to some methods in the full definition. + *os << "void" << be_nl + << "tao_" << node->flat_name () + << "_add_ref (" << be_idt << be_idt_nl + << node->full_name () << " *p" << be_uidt_nl + << ")" << be_uidt_nl + << "{" << be_idt_nl + << "CORBA::add_ref (p);" << be_uidt_nl + << "}" << be_nl << be_nl; + + *os << "void" << be_nl + << "tao_" << node->flat_name () + << "_remove_ref (" << be_idt << be_idt_nl + << node->full_name () << " *p" << be_uidt_nl + << ")" << be_uidt_nl + << "{" << be_idt_nl + << "CORBA::remove_ref (p);" << be_uidt_nl + << "}" << be_nl << be_nl; // Generate methods for _var class. if (node->gen_var_impl () == -1) diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/cdr_op_ch.cpp index 7211d05830b..778efd94f32 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/cdr_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/cdr_op_ch.cpp @@ -59,20 +59,12 @@ be_visitor_valuetype_fwd_cdr_op_ch::visit_valuetype_fwd ( return 0; } - // Generate helper functions declaration. - if (bfd->gen_helper_header () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_valuetype_cdr_op_ch::" - "visit_valuetype - " - "codegen for helper functions failed\n"), -1); - } - TAO_OutStream *os = this->ctx_->stream (); // generate the CDR << and >> operator declarations (prototypes) - //@@ Boris: Can I move this to be_valuetype? (as with _var, _out, etc?) + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << be_global->stub_export_macro () << " CORBA::Boolean operator<< (TAO_OutputCDR &, const " @@ -83,6 +75,7 @@ be_visitor_valuetype_fwd_cdr_op_ch::visit_valuetype_fwd ( << node->full_name () << " *&);" << be_nl; node->cli_hdr_cdr_op_gen (I_TRUE); + bfd->cli_hdr_cdr_op_gen (I_TRUE); return 0; } diff --git a/TAO/TAO_IDL/be_include/be_decl.h b/TAO/TAO_IDL/be_include/be_decl.h index 7b37598a8ce..217226d0147 100644 --- a/TAO/TAO_IDL/be_include/be_decl.h +++ b/TAO/TAO_IDL/be_include/be_decl.h @@ -70,9 +70,60 @@ public: virtual void destroy (void); // Cleanup function. + // Boolean methods to test if code was already generated. + idl_bool cli_hdr_gen (void); + idl_bool cli_stub_gen (void); + idl_bool cli_inline_gen (void); + idl_bool srv_hdr_gen (void); + idl_bool impl_hdr_gen (void); + idl_bool srv_skel_gen (void); + idl_bool impl_skel_gen (void); + idl_bool srv_inline_gen (void); + idl_bool cli_hdr_any_op_gen (void); + idl_bool cli_stub_any_op_gen (void); + idl_bool cli_hdr_cdr_op_gen (void); + idl_bool cli_stub_cdr_op_gen (void); + idl_bool cli_inline_cdr_op_gen (void); + idl_bool cli_inline_cdr_decl_gen (void); + + // Set the flag indicating that code generation is done. + void cli_hdr_gen (idl_bool); + void cli_stub_gen (idl_bool); + void cli_inline_gen (idl_bool); + void srv_hdr_gen (idl_bool); + void impl_hdr_gen (idl_bool); + void srv_skel_gen (idl_bool); + void impl_skel_gen (idl_bool); + void srv_inline_gen (idl_bool); + void cli_hdr_any_op_gen (idl_bool); + void cli_stub_any_op_gen (idl_bool); + void cli_hdr_cdr_op_gen (idl_bool); + void cli_stub_cdr_op_gen (idl_bool); + void cli_inline_cdr_op_gen (idl_bool); + void cli_inline_cdr_decl_gen (idl_bool); + // Narrowing DEF_NARROW_METHODS1 (be_decl, AST_Decl); DEF_NARROW_FROM_DECL (be_decl); + +private: + // Variables that indicate if the code generation for that node is already + // been done. This way we avoid regenerating same code. + idl_bool cli_hdr_gen_; + idl_bool cli_stub_gen_; + idl_bool cli_inline_gen_; + idl_bool srv_hdr_gen_; + idl_bool impl_hdr_gen_; + idl_bool srv_skel_gen_; + idl_bool impl_skel_gen_; + idl_bool srv_inline_gen_; + idl_bool cli_hdr_any_op_gen_; + idl_bool cli_stub_any_op_gen_; + idl_bool cli_hdr_cdr_op_gen_; + idl_bool cli_stub_cdr_op_gen_; + idl_bool cli_inline_cdr_op_gen_; + idl_bool cli_inline_cdr_decl_gen_; + }; #endif // if !defined diff --git a/TAO/TAO_IDL/be_include/be_global.h b/TAO/TAO_IDL/be_include/be_global.h index 917a120947c..fe4ff9a7219 100644 --- a/TAO/TAO_IDL/be_include/be_global.h +++ b/TAO/TAO_IDL/be_include/be_global.h @@ -421,7 +421,7 @@ private: // Implementation's hdr file name ending. Default is "I.h". char* implementation_hdr_ending_; - // Implementation's skeleton file name ending. Default is "I.cpp". + // Implementation's skeleton file name ending. Default is "I.cpp". char* implementation_skel_ending_; //Implementaion class prefix diff --git a/TAO/TAO_IDL/be_include/be_interface.h b/TAO/TAO_IDL/be_include/be_interface.h index 4324ece4040..c74d2c29742 100644 --- a/TAO/TAO_IDL/be_include/be_interface.h +++ b/TAO/TAO_IDL/be_include/be_interface.h @@ -28,7 +28,6 @@ #include "be_type.h" #include "be_codegen.h" #include "ast_interface.h" -#include "ace/Unbounded_Queue.h" class TAO_OutStream; class TAO_IDL_Inheritance_Hierarchy_Worker; @@ -351,22 +350,6 @@ public: idl_bool has_mixed_parentage (void) const; // Do we have both abstract and concrete parents? -protected: - // Queue data structure needed for breadth-first traversal of - // inheritance tree. - ACE_Unbounded_Queue<be_interface *> insert_queue; - - // For a special case of a deeply nested inheritance graph and one specific - // way of inheritance in which a node that was already visited, - // but is not present in - // the queue, gets inserted at the tail. This situation arises when a node - // multiply inherits from two or more interfaces in which the first parent is - // higher up in the tree than the second parent. In addition, if the second - // parent turns out to be a child of the first . - - // Queue of dequeued nodes to be searched for the above case. - ACE_Unbounded_Queue<be_interface *> del_queue; - private: void gen_gperf_input_header (TAO_OutStream *ss); // Output the header (type declaration and %%) to the gperf's input @@ -402,6 +385,7 @@ private: void gen_linear_search_instance (const char *flat_name); // Create an instance of the linear search optable. +private: int skel_count_; // Number of static skeletons in the operation table. diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/interface_ih.h b/TAO/TAO_IDL/be_include/be_visitor_interface/interface_ih.h index f553c5581c1..1c540eb905f 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface/interface_ih.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/interface_ih.h @@ -1,6 +1,4 @@ - /* -*- c++ -*- */ - // $Id$ // ============================================================================ @@ -46,8 +44,6 @@ public: static int method_helper (be_interface *derived, be_interface *node, TAO_OutStream *os); - - }; #endif /* _BE_INTERFACE_INTERFACE_IH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/interface_is.h b/TAO/TAO_IDL/be_include/be_visitor_interface/interface_is.h index 20279502967..7c59bf5d0ee 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface/interface_is.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/interface_is.h @@ -44,7 +44,6 @@ public: static int method_helper (be_interface *derived, be_interface *node, TAO_OutStream *os); - }; #endif /* _BE_INTERFACE_INTERFACE_IS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_module/module_ih.h b/TAO/TAO_IDL/be_include/be_visitor_module/module_ih.h index f0039005391..40e1b9f351a 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_module/module_ih.h +++ b/TAO/TAO_IDL/be_include/be_visitor_module/module_ih.h @@ -41,7 +41,6 @@ public: virtual int visit_module (be_module *node); // visit module. We provide code for this method in the derived class - }; #endif /* _BE_VISITOR_MODULE_MODULE_SH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/operation_ih.h b/TAO/TAO_IDL/be_include/be_visitor_operation/operation_ih.h index 01b80ead8d6..55a3c1fd955 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/operation_ih.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/operation_ih.h @@ -42,7 +42,6 @@ public: virtual int visit_operation (be_operation *node); // visit operation. We provide code for this method in the derived class - }; #endif /* _BE_VISITOR_OPERATION_OPERATION_IH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/operation_is.h b/TAO/TAO_IDL/be_include/be_visitor_operation/operation_is.h index 31743cdbba4..aa5da748f19 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/operation_is.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/operation_is.h @@ -42,7 +42,6 @@ public: virtual int visit_operation (be_operation *node); // visit operation. We provide code for this method in the derived class - }; #endif /* _BE_VISITOR_OPERATION_OPERATION_IS_CPP_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_root/root_ih.h b/TAO/TAO_IDL/be_include/be_visitor_root/root_ih.h index fca8a7f32ab..004bc0f73d5 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_root/root_ih.h +++ b/TAO/TAO_IDL/be_include/be_visitor_root/root_ih.h @@ -21,8 +21,6 @@ #ifndef _BE_VISITOR_ROOT_ROOT_IH_H_ #define _BE_VISITOR_ROOT_ROOT_IH_H_ - - class be_visitor_root_ih : public be_visitor_root { // diff --git a/TAO/TAO_IDL/driver/drv_preproc.cpp b/TAO/TAO_IDL/driver/drv_preproc.cpp index 9e9601b1cfb..acf1031a0cb 100644 --- a/TAO/TAO_IDL/driver/drv_preproc.cpp +++ b/TAO/TAO_IDL/driver/drv_preproc.cpp @@ -200,7 +200,6 @@ DRV_cpp_init (void) if (cpp_path != 0) { ACE_ERROR ((LM_ERROR, - "%s%s%s%s", "Warning: The environment variable " "CPP_LOCATION has been deprecated.\n" " Please use TAO_IDL_PREPROCESSOR " @@ -247,11 +246,10 @@ DRV_cpp_init (void) if (args2 != 0) { ACE_ERROR ((LM_ERROR, - "%s%s%s%s%s", - "Warning: The environment variable ", - "TAO_IDL_DEFAULT_CPP_FLAGS has been ", - "deprecated.\n", - " Please use ", + "Warning: The environment variable " + "TAO_IDL_DEFAULT_CPP_FLAGS has been " + "deprecated.\n" + " Please use " "TAO_IDL_PREPROCESSOR_ARGS instead.\n")); cpp_args = args2; @@ -300,10 +298,9 @@ DRV_cpp_init (void) { ACE_ERROR (( LM_ERROR, - "%s%s%s%s", - "Note: The environment variables ", - "TAO_ROOT and ACE_ROOT are not defined.\n", - " TAO_IDL may not be able to ", + "Note: The environment variables " + "TAO_ROOT and ACE_ROOT are not defined.\n" + " TAO_IDL may not be able to " "locate orb.idl\n" )); @@ -454,7 +451,6 @@ DRV_check_for_include (const char* buf) // we don't want to generate header includes for that. if (ACE_OS::strcmp (file_name, "orb.idl")) { - cout << file_name << endl; idl_global->add_to_included_idl_files (file_name); } } diff --git a/TAO/TAO_IDL/fe/fe_tmplinst.cpp b/TAO/TAO_IDL/fe/fe_tmplinst.cpp index 65a2c7f82b1..9192f7eda55 100644 --- a/TAO/TAO_IDL/fe/fe_tmplinst.cpp +++ b/TAO/TAO_IDL/fe/fe_tmplinst.cpp @@ -49,6 +49,10 @@ template class ACE_Node<AST_Field *>; template class ACE_Unbounded_Queue<AST_Field *>; template class ACE_Unbounded_Queue_Iterator<AST_Field *>; +template class ACE_Node<AST_Interface *>; +template class ACE_Unbounded_Queue<AST_Interface *>; +template class ACE_Unbounded_Queue_Iterator<AST_Interface *>; + template class ACE_Node<AST_Component::uses_description>; template class ACE_Unbounded_Queue<AST_Component::uses_description>; template class ACE_Unbounded_Queue_Iterator<AST_Component::uses_description>; diff --git a/TAO/TAO_IDL/fe/idl.ll b/TAO/TAO_IDL/fe/idl.ll index 7c5cab91e63..4b256ac6f65 100644 --- a/TAO/TAO_IDL/fe/idl.ll +++ b/TAO/TAO_IDL/fe/idl.ll @@ -277,7 +277,7 @@ oneway return IDL_ONEWAY; return IDL_UINTEGER_LITERAL; } -\"([^\\\"]*|\\[ntvbrfax\\\?\'\"])*\" { +(\"([^\\\"]*|\\[ntvbrfax\\\?\'\"])*\"[ \t]*)+ { /* Skip the quotes */ char *tmp = ace_yytext; tmp[strlen(tmp)-1] = '\0'; diff --git a/TAO/TAO_IDL/fe/idl.yy b/TAO/TAO_IDL/fe/idl.yy index a233004c0ee..41f68cb326c 100644 --- a/TAO/TAO_IDL/fe/idl.yy +++ b/TAO/TAO_IDL/fe/idl.yy @@ -117,6 +117,7 @@ int yylex (void); extern "C" int yywrap (void); extern char yytext[]; extern int yyleng; +AST_Decl *tao_enum_constant_decl = 0; #define YYDEBUG_LEXER_TEXT (yytext[yyleng] = '\0', yytext) // Force the pretty debugging code to compile. #define YYDEBUG 1 @@ -734,9 +735,6 @@ value_concrete_decl : /* * Done with this value type - pop it off the scopes stack */ - UTL_Scope* s = idl_global->scopes ().top (); - AST_Interface* m = AST_Interface::narrow_from_scope (s); - m->inherited_name_clash (); idl_global->scopes ().pop (); } ; @@ -797,11 +795,8 @@ value_abs_decl : idl_global->set_parse_state (IDL_GlobalData::PS_ValueTypeQsSeen); /* - * Done with this interface - pop it off the scopes stack. + * Done with this valuetype - pop it off the scopes stack. */ - UTL_Scope* s = idl_global->scopes ().top (); - AST_Interface* m = AST_Interface::narrow_from_scope (s); - m->inherited_name_clash (); idl_global->scopes ().pop (); } ; @@ -1281,7 +1276,9 @@ const_dcl : if ($9 != 0 && s != 0) { AST_Expression::AST_ExprValue *result = - $9->coerce ($3); + $9->check_and_coerce ($3, + tao_enum_constant_decl); + tao_enum_constant_decl = 0; if (result == 0) { @@ -1348,6 +1345,8 @@ const_type if (s != 0 && d != 0) { + tao_enum_constant_decl = d; + /* * Look through typedefs. */ @@ -1809,7 +1808,7 @@ type_declarator : if (d == 0) { - continue; + continue; } AST_Type * tp = d->compose ($1); @@ -1866,6 +1865,11 @@ simple_type_spec { idl_global->err ()->lookup_error ($1); } + else + { + d->last_referenced_as ($1); + } + $$ = d; } @@ -4045,9 +4049,6 @@ component_decl : /* * Done with this component - pop it off the scopes stack. */ - UTL_Scope* s = idl_global->scopes ().top (); - AST_Interface* m = AST_Interface::narrow_from_scope (s); - m->inherited_name_clash (); idl_global->scopes ().pop (); } ; diff --git a/TAO/TAO_IDL/fe/lex.yy.cpp b/TAO/TAO_IDL/fe/lex.yy.cpp index d7fcb04e074..d39a551a05a 100644 --- a/TAO/TAO_IDL/fe/lex.yy.cpp +++ b/TAO/TAO_IDL/fe/lex.yy.cpp @@ -283,7 +283,7 @@ static void tao_yy_fatal_error TAO_YY_PROTO(( tao_yyconst char msg[] )); #define TAO_YY_NUM_RULES 104 #define TAO_YY_END_OF_BUFFER 105 -static tao_yyconst short int tao_yy_accept[544] = +static tao_yyconst short int tao_yy_accept[546] = { 0, 101, 101, 105, 103, 101, 102, 102, 103, 103, 103, 103, 103, 76, 72, 103, 103, 103, 68, 68, 68, @@ -298,53 +298,53 @@ static tao_yyconst short int tao_yy_accept[544] = 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 0, 95, 0, - 0, 0, 0, 0, 0, 0, 0, 79, 0, 79, - 0, 0, 75, 0, 71, 0, 69, 0, 99, 99, - 69, 0, 70, 74, 68, 0, 78, 0, 0, 0, - 68, 68, 68, 1, 68, 68, 68, 68, 68, 68, + 0, 0, 0, 0, 0, 0, 77, 0, 0, 79, + 0, 79, 0, 0, 75, 0, 71, 0, 69, 0, + 99, 99, 69, 0, 70, 74, 68, 0, 78, 0, + 0, 0, 68, 68, 68, 1, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, - 68, 68, 68, 68, 63, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 63, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, - 68, 68, 68, 68, 68, 0, 0, 0, 0, 0, - 0, 0, 82, 80, 0, 0, 73, 0, 69, 70, - 68, 0, 83, 0, 68, 59, 68, 68, 68, 20, - 27, 68, 68, 68, 68, 68, 68, 68, 13, 68, - 68, 68, 68, 68, 68, 68, 48, 68, 68, 68, - 68, 24, 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 0, 0, 0, + 0, 0, 0, 0, 82, 80, 0, 0, 73, 0, + 69, 70, 68, 0, 83, 0, 68, 59, 68, 68, + 68, 20, 27, 68, 68, 68, 68, 68, 68, 68, + 13, 68, 68, 68, 68, 68, 68, 68, 48, 68, + 68, 68, 68, 24, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, - 68, 68, 68, 68, 68, 57, 68, 31, 68, 68, - 0, 0, 0, 0, 0, 0, 0, 96, 0, 0, - 0, 0, 0, 0, 80, 0, 81, 0, 60, 0, - - 0, 68, 68, 68, 68, 68, 10, 68, 68, 68, - 68, 68, 44, 68, 68, 68, 68, 18, 22, 68, - 68, 61, 68, 33, 68, 68, 68, 68, 30, 68, - 68, 68, 68, 68, 68, 68, 68, 68, 25, 68, - 68, 68, 68, 68, 68, 68, 68, 17, 68, 68, - 28, 68, 91, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 84, 0, 2, 68, 68, - 68, 68, 68, 68, 35, 68, 23, 68, 68, 68, - 46, 68, 49, 68, 68, 3, 68, 32, 64, 68, - 68, 68, 38, 68, 4, 68, 68, 68, 14, 12, - - 68, 19, 68, 68, 55, 68, 68, 68, 68, 0, - 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 68, 68, 29, 68, 68, - 8, 21, 68, 68, 36, 68, 68, 58, 68, 68, - 37, 68, 68, 68, 68, 68, 68, 68, 11, 68, - 68, 68, 15, 0, 0, 87, 87, 0, 0, 93, - 0, 0, 92, 0, 0, 0, 0, 0, 0, 0, - 34, 68, 68, 43, 68, 68, 68, 68, 50, 68, - 52, 68, 5, 16, 68, 39, 68, 68, 26, 68, - 0, 97, 97, 0, 0, 0, 0, 90, 0, 0, - - 0, 0, 0, 0, 0, 6, 42, 45, 7, 47, - 9, 68, 53, 54, 68, 68, 41, 0, 85, 85, - 0, 0, 88, 88, 0, 0, 0, 0, 51, 68, - 56, 0, 98, 98, 0, 0, 0, 40, 94, 0, - 86, 86, 0 + 68, 68, 68, 68, 68, 68, 68, 57, 68, 31, + 68, 68, 0, 0, 0, 0, 0, 0, 0, 96, + 0, 0, 0, 0, 0, 0, 80, 0, 81, 0, + + 60, 0, 0, 68, 68, 68, 68, 68, 10, 68, + 68, 68, 68, 68, 44, 68, 68, 68, 68, 18, + 22, 68, 68, 61, 68, 33, 68, 68, 68, 68, + 30, 68, 68, 68, 68, 68, 68, 68, 68, 68, + 25, 68, 68, 68, 68, 68, 68, 68, 68, 17, + 68, 68, 28, 68, 91, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 84, 0, 2, + 68, 68, 68, 68, 68, 68, 35, 68, 23, 68, + 68, 68, 46, 68, 49, 68, 68, 3, 68, 32, + 64, 68, 68, 68, 38, 68, 4, 68, 68, 68, + + 14, 12, 68, 19, 68, 68, 55, 68, 68, 68, + 68, 0, 89, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 68, 68, 29, + 68, 68, 8, 21, 68, 68, 36, 68, 68, 58, + 68, 68, 37, 68, 68, 68, 68, 68, 68, 68, + 11, 68, 68, 68, 15, 0, 0, 87, 87, 0, + 0, 93, 0, 0, 92, 0, 0, 0, 0, 0, + 0, 0, 34, 68, 68, 43, 68, 68, 68, 68, + 50, 68, 52, 68, 5, 16, 68, 39, 68, 68, + 26, 68, 0, 97, 97, 0, 0, 0, 0, 90, + + 0, 0, 0, 0, 0, 0, 0, 6, 42, 45, + 7, 47, 9, 68, 53, 54, 68, 68, 41, 0, + 85, 85, 0, 0, 88, 88, 0, 0, 0, 0, + 51, 68, 56, 0, 98, 98, 0, 0, 0, 40, + 94, 0, 86, 86, 0 } ; static tao_yyconst int tao_yy_ec[256] = @@ -389,139 +389,141 @@ static tao_yyconst int tao_yy_meta[60] = 6, 8, 6, 8, 6, 8, 6, 8, 6 } ; -static tao_yyconst short int tao_yy_base[571] = +static tao_yyconst short int tao_yy_base[573] = { 0, - 0, 53, 1021, 1022, 59, 1022, 1022, 56, 986, 51, - 54, 62, 64, 69, 1002, 1000, 997, 0, 994, 81, - 979, 985, 46, 964, 56, 47, 54, 71, 973, 962, - 25, 961, 60, 974, 70, 61, 84, 82, 40, 78, - 85, 90, 142, 987, 127, 127, 1022, 0, 999, 140, - 126, 150, 155, 195, 1022, 147, 161, 188, 201, 222, - 0, 230, 1022, 1022, 1022, 0, 979, 146, 971, 960, - 971, 949, 942, 946, 950, 945, 962, 112, 943, 955, - 939, 950, 937, 952, 953, 952, 80, 939, 933, 939, - 935, 81, 147, 936, 945, 936, 927, 926, 940, 924, - - 129, 941, 933, 940, 136, 925, 921, 922, 928, 915, - 919, 138, 929, 921, 923, 923, 910, 917, 1022, 147, - 244, 919, 923, 917, 907, 939, 180, 1022, 949, 948, - 191, 947, 252, 0, 258, 241, 1022, 258, 1022, 274, - 0, 214, 269, 0, 924, 190, 1022, 898, 944, 231, - 912, 926, 895, 0, 896, 901, 907, 893, 894, 227, - 889, 907, 905, 886, 892, 890, 898, 882, 897, 895, - 898, 880, 892, 881, 874, 889, 892, 885, 890, 869, - 869, 879, 882, 863, 0, 242, 863, 872, 864, 878, - 860, 862, 861, 188, 862, 857, 862, 870, 859, 864, - - 853, 850, 866, 868, 850, 895, 894, 853, 859, 849, - 861, 314, 1022, 1022, 285, 887, 0, 287, 296, 1022, - 870, 0, 1022, 0, 856, 0, 840, 848, 851, 0, - 0, 840, 233, 849, 838, 831, 839, 831, 0, 829, - 832, 832, 841, 841, 824, 842, 0, 824, 821, 822, - 827, 0, 831, 825, 827, 813, 814, 832, 831, 830, - 821, 820, 823, 812, 821, 824, 804, 809, 819, 806, - 817, 816, 270, 804, 810, 0, 811, 0, 797, 805, - 841, 301, 807, 797, 805, 802, 796, 1022, 217, 329, - 798, 802, 796, 786, 1022, 829, 1022, 828, 0, 359, - - 827, 780, 798, 796, 796, 782, 0, 782, 770, 780, - 780, 786, 0, 770, 769, 770, 769, 0, 0, 777, - 765, 0, 778, 0, 778, 777, 765, 775, 0, 754, - 760, 757, 772, 287, 756, 760, 759, 763, 0, 764, - 750, 751, 760, 766, 761, 761, 746, 0, 749, 742, - 0, 747, 1022, 364, 216, 740, 347, 746, 786, 785, - 744, 750, 740, 752, 386, 1022, 778, 0, 748, 729, - 735, 743, 742, 726, 0, 725, 0, 719, 677, 649, - 0, 643, 0, 657, 636, 0, 640, 0, 0, 615, - 632, 623, 0, 609, 0, 589, 594, 577, 0, 0, - - 563, 0, 552, 564, 0, 564, 562, 541, 558, 413, - 1022, 428, 334, 248, 436, 451, 563, 591, 367, 557, - 547, 555, 552, 459, 583, 528, 526, 0, 530, 523, - 0, 0, 507, 505, 0, 505, 499, 0, 496, 484, - 0, 465, 466, 426, 439, 429, 395, 405, 0, 399, - 397, 364, 0, 455, 355, 1022, 383, 386, 458, 1022, - 407, 346, 1022, 486, 351, 358, 501, 345, 371, 383, - 0, 308, 292, 0, 302, 291, 278, 288, 0, 287, - 0, 272, 0, 0, 261, 0, 271, 249, 0, 251, - 416, 1022, 483, 269, 489, 505, 509, 1022, 517, 524, - - 401, 532, 537, 431, 236, 0, 0, 0, 0, 0, - 0, 167, 0, 0, 161, 143, 0, 537, 1022, 546, - 556, 552, 1022, 558, 560, 191, 143, 475, 0, 65, - 0, 562, 1022, 565, 71, 571, 581, 0, 1022, 584, - 1022, 586, 1022, 607, 615, 619, 625, 633, 641, 645, - 652, 660, 665, 668, 675, 680, 683, 686, 690, 697, - 702, 709, 714, 721, 729, 737, 745, 753, 761, 769 + 0, 53, 1029, 1030, 59, 1030, 1030, 56, 994, 51, + 54, 62, 64, 69, 1010, 1008, 1005, 0, 1002, 81, + 987, 993, 46, 972, 56, 47, 54, 71, 981, 970, + 25, 969, 60, 982, 70, 61, 84, 82, 40, 78, + 85, 90, 142, 995, 127, 127, 136, 0, 1007, 140, + 135, 150, 155, 195, 1030, 156, 181, 188, 201, 222, + 0, 230, 1030, 1030, 1030, 0, 987, 134, 979, 968, + 979, 957, 950, 954, 958, 953, 970, 105, 951, 963, + 947, 958, 945, 960, 961, 960, 128, 947, 941, 947, + 943, 81, 143, 944, 953, 944, 935, 934, 948, 932, + + 129, 949, 941, 948, 130, 933, 929, 930, 936, 923, + 927, 171, 937, 929, 931, 931, 918, 925, 1030, 184, + 244, 927, 931, 925, 915, 947, 250, 187, 195, 1030, + 957, 956, 191, 955, 252, 0, 258, 269, 1030, 274, + 1030, 283, 0, 247, 274, 0, 932, 217, 1030, 906, + 952, 120, 920, 934, 903, 0, 904, 909, 915, 901, + 902, 239, 897, 915, 913, 894, 900, 898, 906, 890, + 905, 903, 906, 888, 900, 889, 882, 897, 900, 893, + 898, 877, 877, 887, 890, 871, 0, 247, 871, 880, + 872, 886, 868, 870, 869, 188, 870, 865, 870, 878, + + 867, 872, 861, 858, 874, 876, 858, 903, 902, 861, + 867, 857, 869, 319, 1030, 1030, 292, 895, 0, 294, + 301, 1030, 878, 0, 1030, 0, 864, 0, 848, 856, + 859, 0, 0, 848, 257, 857, 846, 839, 847, 839, + 0, 837, 840, 840, 849, 849, 832, 850, 0, 832, + 829, 830, 835, 0, 839, 833, 835, 821, 822, 840, + 839, 838, 829, 828, 831, 820, 829, 832, 812, 817, + 827, 814, 825, 824, 275, 812, 818, 0, 819, 0, + 805, 813, 849, 327, 815, 805, 813, 810, 804, 1030, + 290, 339, 806, 810, 804, 794, 1030, 837, 1030, 836, + + 0, 364, 835, 788, 806, 804, 804, 790, 0, 790, + 778, 788, 788, 794, 0, 778, 777, 778, 777, 0, + 0, 785, 773, 0, 786, 0, 786, 785, 773, 783, + 0, 762, 768, 765, 780, 292, 764, 768, 767, 771, + 0, 772, 758, 759, 768, 774, 769, 769, 754, 0, + 757, 750, 0, 755, 1030, 369, 248, 748, 361, 754, + 794, 793, 752, 758, 748, 760, 391, 1030, 786, 0, + 756, 737, 743, 751, 750, 734, 0, 733, 0, 670, + 674, 646, 0, 648, 0, 663, 642, 0, 637, 0, + 0, 621, 632, 621, 0, 602, 0, 594, 602, 573, + + 0, 0, 561, 0, 560, 572, 0, 571, 570, 549, + 566, 418, 1030, 433, 335, 300, 441, 456, 570, 598, + 346, 564, 554, 562, 559, 464, 583, 532, 530, 0, + 534, 506, 0, 0, 505, 500, 0, 506, 506, 0, + 499, 474, 0, 465, 471, 431, 444, 434, 399, 416, + 0, 405, 402, 362, 0, 460, 388, 1030, 390, 421, + 463, 1030, 404, 356, 1030, 491, 439, 343, 506, 348, + 362, 374, 0, 342, 310, 0, 318, 304, 293, 298, + 0, 288, 0, 266, 0, 0, 245, 0, 245, 232, + 0, 232, 488, 1030, 494, 251, 510, 513, 521, 1030, + + 525, 529, 448, 542, 546, 403, 204, 0, 0, 0, + 0, 0, 0, 169, 0, 0, 180, 160, 0, 550, + 1030, 560, 562, 564, 1030, 566, 569, 201, 181, 480, + 0, 65, 0, 571, 1030, 576, 71, 585, 590, 0, + 1030, 592, 1030, 595, 1030, 616, 624, 628, 634, 642, + 650, 654, 661, 669, 674, 677, 684, 689, 692, 695, + 699, 706, 711, 718, 723, 730, 738, 746, 754, 762, + 770, 778 } ; -static tao_yyconst short int tao_yy_def[571] = +static tao_yyconst short int tao_yy_def[573] = { 0, - 543, 1, 543, 543, 543, 543, 543, 544, 545, 543, - 543, 543, 543, 543, 543, 543, 543, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 543, 543, 543, 544, 543, 547, 543, 548, - 543, 543, 543, 543, 543, 549, 54, 543, 543, 543, - 550, 543, 543, 543, 543, 546, 546, 551, 552, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 43, 543, 43, - 543, 543, 543, 543, 543, 543, 544, 543, 543, 543, - 543, 553, 543, 554, 543, 543, 543, 549, 543, 549, - 57, 543, 543, 550, 546, 551, 543, 543, 543, 543, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - - 546, 546, 546, 546, 546, 555, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 556, 554, 543, 543, 543, - 546, 557, 543, 558, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 555, 543, 543, 543, 543, 543, 212, 543, 212, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 546, 551, - - 559, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 543, 543, 543, 543, 543, 543, 560, 543, - 543, 543, 543, 543, 300, 543, 561, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - - 546, 546, 546, 546, 546, 546, 546, 546, 546, 543, - 543, 543, 562, 543, 543, 543, 543, 560, 543, 543, - 543, 543, 543, 300, 563, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 543, 562, 543, 562, 564, 543, 543, - 565, 543, 543, 543, 543, 543, 543, 543, 551, 543, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 546, 546, 546, - 564, 543, 564, 565, 543, 566, 543, 543, 543, 567, - - 543, 543, 543, 543, 543, 546, 546, 546, 546, 546, - 546, 546, 546, 546, 546, 546, 546, 566, 543, 566, - 543, 567, 543, 567, 568, 569, 543, 543, 546, 546, - 546, 568, 543, 568, 569, 543, 570, 546, 543, 570, - 543, 570, 0, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543 + 545, 1, 545, 545, 545, 545, 545, 546, 547, 545, + 545, 545, 545, 545, 545, 545, 545, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 545, 545, 545, 546, 545, 549, 545, 550, + 545, 545, 545, 545, 545, 551, 54, 545, 545, 545, + 552, 545, 545, 545, 545, 548, 548, 553, 554, 548, + 548, 548, 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, 548, 548, + + 548, 548, 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 43, 545, 43, + 545, 545, 545, 545, 545, 545, 545, 546, 546, 545, + 545, 545, 545, 555, 545, 556, 545, 545, 545, 551, + 545, 551, 57, 545, 545, 552, 548, 553, 545, 545, + 545, 545, 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, 548, 548, + + 548, 548, 548, 548, 548, 548, 548, 557, 545, 545, + 545, 545, 545, 545, 545, 545, 545, 558, 556, 545, + 545, 545, 548, 559, 545, 560, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 557, 545, 545, 545, 545, 545, 214, 545, + 214, 545, 545, 545, 545, 545, 545, 545, 545, 545, + + 548, 553, 561, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 545, 545, 545, 545, 545, 545, + 562, 545, 545, 545, 545, 545, 302, 545, 563, 548, + 548, 548, 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, 548, 548, + + 548, 548, 548, 548, 548, 548, 548, 548, 548, 548, + 548, 545, 545, 545, 564, 545, 545, 545, 545, 562, + 545, 545, 545, 545, 545, 302, 565, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 545, 564, 545, 564, 566, + 545, 545, 567, 545, 545, 545, 545, 545, 545, 545, + 553, 545, 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 566, 545, 566, 567, 545, 568, 545, 545, + + 545, 569, 545, 545, 545, 545, 545, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, 548, 568, + 545, 568, 545, 569, 545, 569, 570, 571, 545, 545, + 548, 548, 548, 570, 545, 570, 571, 545, 572, 548, + 545, 572, 545, 572, 0, 545, 545, 545, 545, 545, + 545, 545, 545, 545, 545, 545, 545, 545, 545, 545, + 545, 545, 545, 545, 545, 545, 545, 545, 545, 545, + 545, 545 } ; -static tao_yyconst short int tao_yy_nxt[1082] = +static tao_yyconst short int tao_yy_nxt[1090] = { 0, 4, 5, 6, 7, 5, 8, 4, 9, 4, 4, 10, 11, 12, 13, 14, 14, 15, 16, 4, 17, @@ -530,121 +532,121 @@ static tao_yyconst short int tao_yy_nxt[1082] = 29, 30, 31, 18, 18, 32, 33, 34, 35, 36, 18, 37, 38, 39, 40, 41, 42, 18, 18, 43, 45, 47, 51, 45, 52, 53, 53, 54, 54, 54, - 55, 91, 92, 44, 56, 57, 536, 58, 58, 59, + 55, 91, 92, 44, 56, 57, 538, 58, 58, 59, 57, 72, 62, 62, 62, 80, 68, 60, 69, 48, 76, 110, 60, 73, 94, 81, 61, 77, 111, 74, - 82, 83, 60, 538, 78, 86, 98, 60, 95, 84, + 82, 83, 60, 540, 78, 86, 98, 60, 95, 84, 79, 85, 101, 87, 96, 102, 88, 99, 103, 114, - 105, 61, 104, 106, 100, 112, 116, 169, 45, 175, - 113, 45, 47, 115, 176, 107, 108, 170, 109, 54, - 54, 54, 117, 118, 119, 119, 120, 130, 526, 139, - 140, 147, 206, 131, 131, 121, 121, 121, 159, 160, - 48, 57, 119, 133, 133, 59, 57, 140, 135, 135, - 135, 186, 132, 60, 141, 141, 141, 187, 60, 148, - 199, 122, 134, 177, 123, 47, 191, 124, 60, 192, - 200, 125, 543, 60, 178, 147, 536, 132, 214, 57, - - 531, 58, 58, 59, 215, 215, 530, 134, 54, 54, - 54, 60, 57, 48, 59, 59, 59, 413, 136, 137, - 413, 137, 359, 148, 60, 529, 60, 143, 143, 143, - 268, 142, 142, 136, 137, 143, 143, 143, 223, 60, - 137, 57, 269, 62, 62, 62, 119, 119, 207, 458, - 218, 218, 458, 60, 219, 219, 219, 121, 121, 121, - 139, 140, 543, 57, 119, 133, 133, 59, 60, 57, - 528, 135, 135, 135, 495, 60, 139, 140, 140, 233, - 234, 60, 143, 143, 143, 224, 307, 308, 259, 517, - 60, 516, 295, 220, 140, 220, 60, 260, 296, 296, - - 219, 219, 219, 353, 353, 354, 515, 345, 220, 219, - 219, 219, 346, 514, 220, 287, 288, 288, 289, 347, - 137, 353, 137, 393, 513, 512, 511, 290, 290, 290, - 510, 288, 288, 360, 288, 137, 456, 457, 509, 394, - 508, 137, 290, 290, 290, 507, 506, 496, 415, 288, - 496, 415, 500, 291, 457, 500, 292, 456, 457, 293, - 416, 416, 416, 294, 147, 410, 411, 411, 410, 463, - 463, 464, 365, 365, 365, 457, 147, 412, 412, 412, - 365, 365, 365, 365, 411, 456, 457, 463, 492, 493, - 366, 505, 148, 365, 365, 365, 365, 365, 365, 424, - - 424, 424, 525, 457, 148, 525, 493, 424, 424, 424, - 424, 501, 495, 490, 410, 411, 411, 410, 492, 493, - 424, 424, 424, 424, 424, 424, 454, 454, 454, 410, - 411, 411, 410, 411, 489, 527, 493, 415, 488, 487, - 415, 412, 412, 412, 504, 504, 504, 486, 411, 416, - 416, 416, 459, 460, 460, 459, 461, 411, 411, 459, - 460, 460, 459, 461, 416, 416, 416, 485, 454, 454, - 454, 460, 469, 469, 469, 411, 537, 484, 460, 537, - 469, 469, 469, 469, 483, 492, 493, 497, 498, 498, - 497, 460, 460, 469, 469, 469, 469, 469, 469, 499, - - 499, 499, 502, 493, 482, 503, 498, 519, 520, 460, - 497, 498, 498, 497, 504, 504, 504, 481, 497, 498, - 498, 497, 521, 521, 521, 520, 523, 524, 480, 498, - 499, 499, 499, 502, 479, 478, 503, 498, 502, 519, - 520, 503, 526, 477, 524, 504, 504, 504, 519, 520, - 504, 504, 504, 476, 523, 524, 475, 520, 498, 498, - 523, 524, 533, 534, 533, 534, 520, 533, 534, 521, - 521, 521, 524, 539, 539, 474, 498, 473, 524, 472, - 534, 471, 534, 541, 542, 534, 541, 542, 541, 542, - 366, 539, 468, 467, 466, 465, 419, 462, 453, 452, - - 451, 542, 450, 449, 542, 448, 542, 46, 46, 46, - 46, 46, 46, 46, 46, 49, 447, 49, 49, 49, - 49, 49, 49, 66, 66, 66, 66, 127, 127, 446, - 445, 127, 127, 129, 444, 129, 129, 129, 129, 129, - 129, 138, 138, 138, 138, 138, 138, 138, 138, 144, - 443, 144, 146, 146, 146, 146, 146, 146, 146, 146, - 149, 442, 149, 149, 149, 149, 149, 149, 216, 216, - 441, 216, 217, 440, 217, 281, 281, 281, 281, 281, - 281, 281, 281, 298, 298, 439, 298, 300, 438, 300, - 301, 437, 301, 367, 367, 436, 367, 418, 418, 418, - - 418, 418, 418, 418, 418, 425, 425, 435, 425, 455, - 455, 455, 455, 455, 455, 455, 455, 470, 470, 434, - 470, 491, 491, 491, 491, 491, 491, 491, 491, 494, - 494, 494, 494, 494, 494, 494, 494, 518, 518, 518, - 518, 518, 518, 518, 518, 522, 522, 522, 522, 522, - 522, 522, 522, 532, 532, 532, 532, 532, 532, 532, - 532, 535, 535, 535, 535, 535, 535, 535, 535, 540, - 540, 540, 540, 540, 540, 540, 540, 433, 432, 431, - 430, 429, 428, 427, 426, 366, 423, 422, 421, 420, - 359, 419, 417, 414, 409, 408, 407, 406, 405, 404, - - 403, 402, 401, 400, 399, 398, 397, 396, 395, 392, + 105, 61, 104, 106, 100, 112, 116, 225, 45, 177, + 113, 45, 47, 115, 178, 107, 108, 127, 109, 149, + 127, 128, 117, 118, 119, 119, 120, 132, 54, 54, + 54, 161, 162, 133, 133, 121, 121, 121, 141, 142, + 48, 57, 119, 135, 135, 59, 57, 150, 137, 137, + 137, 188, 134, 60, 226, 171, 142, 189, 60, 179, + 193, 122, 136, 194, 123, 172, 528, 124, 60, 208, + 180, 125, 47, 60, 143, 143, 143, 134, 216, 57, + + 47, 58, 58, 59, 217, 217, 538, 136, 54, 54, + 54, 60, 57, 201, 59, 59, 59, 533, 138, 139, + 48, 139, 149, 202, 60, 532, 60, 531, 48, 545, + 270, 144, 144, 138, 139, 145, 145, 145, 530, 60, + 139, 57, 271, 62, 62, 62, 119, 119, 209, 415, + 150, 127, 415, 60, 127, 128, 497, 121, 121, 121, + 145, 145, 145, 57, 119, 135, 135, 59, 60, 57, + 519, 137, 137, 137, 518, 60, 141, 142, 220, 220, + 517, 60, 221, 221, 221, 141, 142, 145, 145, 145, + 60, 235, 236, 261, 142, 361, 60, 516, 222, 297, + + 222, 460, 262, 142, 460, 298, 298, 221, 221, 221, + 309, 310, 347, 222, 221, 221, 221, 348, 515, 222, + 289, 290, 290, 291, 349, 139, 514, 139, 395, 355, + 355, 356, 292, 292, 292, 545, 513, 458, 459, 290, + 139, 290, 290, 362, 396, 512, 139, 355, 465, 465, + 466, 511, 292, 292, 292, 459, 510, 498, 293, 290, + 498, 294, 417, 509, 295, 417, 465, 149, 296, 149, + 412, 413, 413, 412, 418, 418, 418, 367, 367, 367, + 508, 368, 414, 414, 414, 367, 367, 367, 367, 413, + 458, 459, 458, 459, 507, 150, 503, 150, 367, 367, + + 367, 367, 367, 367, 426, 426, 426, 529, 459, 497, + 459, 492, 426, 426, 426, 426, 506, 506, 506, 412, + 413, 413, 412, 494, 495, 426, 426, 426, 426, 426, + 426, 456, 456, 456, 412, 413, 413, 412, 413, 491, + 502, 495, 417, 502, 490, 417, 414, 414, 414, 527, + 489, 488, 527, 413, 418, 418, 418, 461, 462, 462, + 461, 463, 413, 413, 461, 462, 462, 461, 463, 418, + 418, 418, 487, 456, 456, 456, 462, 471, 471, 471, + 413, 539, 486, 462, 539, 471, 471, 471, 471, 485, + 494, 495, 499, 500, 500, 499, 494, 495, 471, 471, + + 471, 471, 471, 471, 501, 501, 501, 504, 495, 484, + 505, 500, 462, 462, 495, 521, 522, 483, 482, 506, + 506, 506, 499, 500, 500, 499, 499, 500, 500, 499, + 462, 525, 526, 522, 523, 523, 523, 481, 501, 501, + 501, 500, 480, 504, 479, 500, 505, 504, 478, 526, + 505, 528, 521, 522, 477, 506, 506, 506, 476, 506, + 506, 506, 521, 522, 500, 500, 525, 526, 525, 526, + 522, 535, 536, 535, 536, 523, 523, 523, 535, 536, + 522, 475, 500, 474, 526, 473, 526, 541, 541, 536, + 368, 536, 543, 544, 543, 544, 536, 543, 544, 470, + + 469, 468, 467, 421, 464, 541, 455, 454, 453, 452, + 544, 451, 544, 450, 449, 544, 46, 46, 46, 46, + 46, 46, 46, 46, 49, 448, 49, 49, 49, 49, + 49, 49, 66, 66, 66, 66, 129, 129, 447, 446, + 129, 129, 131, 445, 131, 131, 131, 131, 131, 131, + 140, 140, 140, 140, 140, 140, 140, 140, 146, 444, + 146, 148, 148, 148, 148, 148, 148, 148, 148, 151, + 443, 151, 151, 151, 151, 151, 151, 218, 218, 442, + 218, 219, 441, 219, 283, 283, 283, 283, 283, 283, + 283, 283, 300, 300, 440, 300, 302, 439, 302, 303, + + 438, 303, 369, 369, 437, 369, 420, 420, 420, 420, + 420, 420, 420, 420, 427, 427, 436, 427, 457, 457, + 457, 457, 457, 457, 457, 457, 472, 472, 435, 472, + 493, 493, 493, 493, 493, 493, 493, 493, 496, 496, + 496, 496, 496, 496, 496, 496, 520, 520, 520, 520, + 520, 520, 520, 520, 524, 524, 524, 524, 524, 524, + 524, 524, 534, 534, 534, 534, 534, 534, 534, 534, + 537, 537, 537, 537, 537, 537, 537, 537, 542, 542, + 542, 542, 542, 542, 542, 542, 434, 433, 432, 431, + 430, 429, 428, 368, 425, 424, 423, 422, 361, 421, + + 419, 416, 411, 410, 409, 408, 407, 406, 405, 404, + 403, 402, 401, 400, 399, 398, 397, 394, 393, 392, 391, 390, 389, 388, 387, 386, 385, 384, 383, 382, 381, 380, 379, 378, 377, 376, 375, 374, 373, 372, - 371, 370, 369, 368, 366, 297, 295, 364, 363, 362, - 361, 543, 358, 357, 356, 355, 282, 352, 351, 350, - 349, 348, 344, 343, 342, 341, 340, 339, 338, 337, + 371, 370, 368, 299, 297, 366, 365, 364, 363, 545, + 360, 359, 358, 357, 284, 354, 353, 352, 351, 350, + 346, 345, 344, 343, 342, 341, 340, 339, 338, 337, 336, 335, 334, 333, 332, 331, 330, 329, 328, 327, 326, 325, 324, 323, 322, 321, 320, 319, 318, 317, - 316, 315, 314, 313, 312, 311, 310, 309, 306, 305, - 304, 303, 302, 299, 297, 286, 285, 284, 283, 206, + 316, 315, 314, 313, 312, 311, 308, 307, 306, 305, - 282, 280, 279, 278, 277, 276, 275, 274, 273, 272, - 271, 270, 267, 266, 265, 264, 263, 262, 261, 258, + 304, 301, 299, 288, 287, 286, 285, 208, 284, 282, + 281, 280, 279, 278, 277, 276, 275, 274, 273, 272, + 269, 268, 267, 266, 265, 264, 263, 260, 259, 258, 257, 256, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, - 237, 236, 235, 232, 231, 230, 229, 228, 227, 226, - 225, 223, 222, 221, 213, 213, 213, 212, 211, 210, - 209, 208, 543, 205, 204, 203, 202, 201, 198, 197, - 196, 195, 194, 193, 190, 189, 188, 185, 184, 183, - 182, 181, 180, 179, 174, 173, 172, 171, 168, 167, - 166, 165, 164, 163, 162, 161, 158, 157, 156, 155, - - 154, 153, 152, 151, 150, 145, 128, 126, 97, 93, - 90, 89, 75, 71, 70, 67, 65, 64, 63, 50, - 543, 3, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543 + 237, 234, 233, 232, 231, 230, 229, 228, 227, 225, + 224, 223, 215, 215, 215, 214, 213, 212, 211, 210, + 545, 207, 206, 205, 204, 203, 200, 199, 198, 197, + 196, 195, 192, 191, 190, 187, 186, 185, 184, 183, + 182, 181, 176, 175, 174, 173, 170, 169, 168, 167, + + 166, 165, 164, 163, 160, 159, 158, 157, 156, 155, + 154, 153, 152, 147, 130, 126, 97, 93, 90, 89, + 75, 71, 70, 67, 65, 64, 63, 50, 545, 3, + 545, 545, 545, 545, 545, 545, 545, 545, 545, 545, + 545, 545, 545, 545, 545, 545, 545, 545, 545, 545, + 545, 545, 545, 545, 545, 545, 545, 545, 545, 545, + 545, 545, 545, 545, 545, 545, 545, 545, 545, 545, + 545, 545, 545, 545, 545, 545, 545, 545, 545, 545, + 545, 545, 545, 545, 545, 545, 545, 545, 545 } ; -static tao_yyconst short int tao_yy_chk[1082] = +static tao_yyconst short int tao_yy_chk[1090] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -653,118 +655,118 @@ static tao_yyconst short int tao_yy_chk[1082] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 5, 8, 10, 5, 10, 10, 10, 11, 11, 11, - 12, 31, 31, 2, 12, 13, 535, 13, 13, 13, + 12, 31, 31, 2, 12, 13, 537, 13, 13, 13, 14, 23, 14, 14, 14, 26, 20, 13, 20, 8, 25, 39, 14, 23, 33, 26, 13, 25, 39, 23, - 27, 27, 13, 530, 25, 28, 35, 14, 33, 27, + 27, 27, 13, 532, 25, 28, 35, 14, 33, 27, 25, 27, 36, 28, 33, 36, 28, 35, 37, 41, - 38, 13, 37, 38, 35, 40, 42, 87, 45, 92, - 40, 45, 46, 41, 92, 38, 38, 87, 38, 51, - 51, 51, 42, 43, 43, 43, 43, 50, 527, 56, - 56, 68, 120, 50, 50, 43, 43, 43, 78, 78, - 46, 52, 43, 52, 52, 52, 53, 56, 53, 53, - 53, 101, 50, 52, 57, 57, 57, 101, 53, 68, - 112, 43, 52, 93, 43, 127, 105, 43, 52, 105, - 112, 43, 120, 53, 93, 146, 526, 50, 131, 58, - - 516, 58, 58, 58, 131, 131, 515, 52, 54, 54, - 54, 58, 59, 127, 59, 59, 59, 355, 54, 54, - 355, 54, 289, 146, 59, 512, 58, 142, 142, 142, - 194, 60, 60, 54, 54, 60, 60, 60, 150, 59, - 54, 62, 194, 62, 62, 62, 121, 121, 121, 414, - 136, 136, 414, 62, 136, 136, 136, 121, 121, 121, - 138, 138, 289, 133, 121, 133, 133, 133, 62, 135, - 505, 135, 135, 135, 494, 133, 140, 140, 138, 160, - 160, 135, 143, 143, 143, 150, 233, 233, 186, 490, - 133, 488, 215, 143, 140, 143, 135, 186, 215, 215, - - 218, 218, 218, 282, 282, 282, 487, 273, 143, 219, - 219, 219, 273, 485, 143, 212, 212, 212, 212, 273, - 219, 282, 219, 334, 482, 480, 478, 212, 212, 212, - 477, 290, 290, 290, 212, 219, 413, 413, 476, 334, - 475, 219, 290, 290, 290, 473, 472, 462, 357, 290, - 462, 357, 465, 212, 413, 465, 212, 455, 455, 212, - 357, 357, 357, 212, 300, 354, 354, 354, 354, 419, - 419, 419, 300, 300, 300, 455, 469, 354, 354, 354, - 300, 300, 300, 300, 354, 457, 457, 419, 458, 458, - 470, 468, 300, 300, 300, 300, 300, 300, 300, 365, - - 365, 365, 501, 457, 469, 501, 458, 365, 365, 365, - 365, 466, 461, 452, 410, 410, 410, 410, 491, 491, - 365, 365, 365, 365, 365, 365, 410, 410, 410, 412, - 412, 412, 412, 410, 451, 504, 491, 415, 450, 448, - 415, 412, 412, 412, 504, 504, 504, 447, 412, 415, - 415, 415, 416, 416, 416, 416, 416, 454, 454, 459, - 459, 459, 459, 459, 416, 416, 416, 446, 454, 454, - 454, 416, 424, 424, 424, 454, 528, 445, 459, 528, - 424, 424, 424, 424, 444, 493, 493, 464, 464, 464, - 464, 495, 495, 424, 424, 424, 424, 424, 424, 464, - - 464, 464, 467, 493, 443, 467, 464, 496, 496, 495, - 497, 497, 497, 497, 467, 467, 467, 442, 499, 499, - 499, 499, 497, 497, 497, 496, 500, 500, 440, 497, - 499, 499, 499, 502, 439, 437, 502, 499, 503, 518, - 518, 503, 503, 436, 500, 502, 502, 502, 520, 520, - 503, 503, 503, 434, 522, 522, 433, 518, 521, 521, - 524, 524, 525, 525, 532, 532, 520, 534, 534, 521, - 521, 521, 522, 536, 536, 430, 521, 429, 524, 427, - 525, 426, 532, 537, 537, 534, 540, 540, 542, 542, - 425, 536, 423, 422, 421, 420, 418, 417, 409, 408, - - 407, 537, 406, 404, 540, 403, 542, 544, 544, 544, - 544, 544, 544, 544, 544, 545, 401, 545, 545, 545, - 545, 545, 545, 546, 546, 546, 546, 547, 547, 398, - 397, 547, 547, 548, 396, 548, 548, 548, 548, 548, - 548, 549, 549, 549, 549, 549, 549, 549, 549, 550, - 394, 550, 551, 551, 551, 551, 551, 551, 551, 551, - 552, 392, 552, 552, 552, 552, 552, 552, 553, 553, - 391, 553, 554, 390, 554, 555, 555, 555, 555, 555, - 555, 555, 555, 556, 556, 387, 556, 557, 385, 557, - 558, 384, 558, 559, 559, 382, 559, 560, 560, 560, - - 560, 560, 560, 560, 560, 561, 561, 380, 561, 562, - 562, 562, 562, 562, 562, 562, 562, 563, 563, 379, - 563, 564, 564, 564, 564, 564, 564, 564, 564, 565, - 565, 565, 565, 565, 565, 565, 565, 566, 566, 566, - 566, 566, 566, 566, 566, 567, 567, 567, 567, 567, - 567, 567, 567, 568, 568, 568, 568, 568, 568, 568, - 568, 569, 569, 569, 569, 569, 569, 569, 569, 570, - 570, 570, 570, 570, 570, 570, 570, 378, 376, 374, - 373, 372, 371, 370, 369, 367, 364, 363, 362, 361, - 360, 359, 358, 356, 352, 350, 349, 347, 346, 345, - - 344, 343, 342, 341, 340, 338, 337, 336, 335, 333, - 332, 331, 330, 328, 327, 326, 325, 323, 321, 320, - 317, 316, 315, 314, 312, 311, 310, 309, 308, 306, - 305, 304, 303, 302, 301, 298, 296, 294, 293, 292, - 291, 287, 286, 285, 284, 283, 281, 280, 279, 277, - 275, 274, 272, 271, 270, 269, 268, 267, 266, 265, + 38, 13, 37, 38, 35, 40, 42, 152, 45, 92, + 40, 45, 46, 41, 92, 38, 38, 47, 38, 68, + 47, 47, 42, 43, 43, 43, 43, 50, 51, 51, + 51, 78, 78, 50, 50, 43, 43, 43, 56, 56, + 46, 52, 43, 52, 52, 52, 53, 68, 53, 53, + 53, 101, 50, 52, 152, 87, 56, 101, 53, 93, + 105, 43, 52, 105, 43, 87, 529, 43, 52, 120, + 93, 43, 128, 53, 57, 57, 57, 50, 133, 58, + + 129, 58, 58, 58, 133, 133, 528, 52, 54, 54, + 54, 58, 59, 112, 59, 59, 59, 518, 54, 54, + 128, 54, 148, 112, 59, 517, 58, 514, 129, 120, + 196, 60, 60, 54, 54, 60, 60, 60, 507, 59, + 54, 62, 196, 62, 62, 62, 121, 121, 121, 357, + 148, 127, 357, 62, 127, 127, 496, 121, 121, 121, + 144, 144, 144, 135, 121, 135, 135, 135, 62, 137, + 492, 137, 137, 137, 490, 135, 140, 140, 138, 138, + 489, 137, 138, 138, 138, 142, 142, 145, 145, 145, + 135, 162, 162, 188, 140, 291, 137, 487, 145, 217, + + 145, 416, 188, 142, 416, 217, 217, 220, 220, 220, + 235, 235, 275, 145, 221, 221, 221, 275, 484, 145, + 214, 214, 214, 214, 275, 221, 482, 221, 336, 284, + 284, 284, 214, 214, 214, 291, 480, 415, 415, 214, + 221, 292, 292, 292, 336, 479, 221, 284, 421, 421, + 421, 478, 292, 292, 292, 415, 477, 464, 214, 292, + 464, 214, 359, 475, 214, 359, 421, 471, 214, 302, + 356, 356, 356, 356, 359, 359, 359, 302, 302, 302, + 474, 472, 356, 356, 356, 302, 302, 302, 302, 356, + 457, 457, 459, 459, 470, 471, 468, 302, 302, 302, + + 302, 302, 302, 302, 367, 367, 367, 506, 457, 463, + 459, 454, 367, 367, 367, 367, 506, 506, 506, 412, + 412, 412, 412, 460, 460, 367, 367, 367, 367, 367, + 367, 412, 412, 412, 414, 414, 414, 414, 412, 453, + 467, 460, 417, 467, 452, 417, 414, 414, 414, 503, + 450, 449, 503, 414, 417, 417, 417, 418, 418, 418, + 418, 418, 456, 456, 461, 461, 461, 461, 461, 418, + 418, 418, 448, 456, 456, 456, 418, 426, 426, 426, + 456, 530, 447, 461, 530, 426, 426, 426, 426, 446, + 493, 493, 466, 466, 466, 466, 495, 495, 426, 426, + + 426, 426, 426, 426, 466, 466, 466, 469, 493, 445, + 469, 466, 497, 497, 495, 498, 498, 444, 442, 469, + 469, 469, 499, 499, 499, 499, 501, 501, 501, 501, + 497, 502, 502, 498, 499, 499, 499, 441, 501, 501, + 501, 499, 439, 504, 438, 501, 504, 505, 436, 502, + 505, 505, 520, 520, 435, 504, 504, 504, 432, 505, + 505, 505, 522, 522, 523, 523, 524, 524, 526, 526, + 520, 527, 527, 534, 534, 523, 523, 523, 536, 536, + 522, 431, 523, 429, 524, 428, 526, 538, 538, 527, + 427, 534, 539, 539, 542, 542, 536, 544, 544, 425, + + 424, 423, 422, 420, 419, 538, 411, 410, 409, 408, + 539, 406, 542, 405, 403, 544, 546, 546, 546, 546, + 546, 546, 546, 546, 547, 400, 547, 547, 547, 547, + 547, 547, 548, 548, 548, 548, 549, 549, 399, 398, + 549, 549, 550, 396, 550, 550, 550, 550, 550, 550, + 551, 551, 551, 551, 551, 551, 551, 551, 552, 394, + 552, 553, 553, 553, 553, 553, 553, 553, 553, 554, + 393, 554, 554, 554, 554, 554, 554, 555, 555, 392, + 555, 556, 389, 556, 557, 557, 557, 557, 557, 557, + 557, 557, 558, 558, 387, 558, 559, 386, 559, 560, + + 384, 560, 561, 561, 382, 561, 562, 562, 562, 562, + 562, 562, 562, 562, 563, 563, 381, 563, 564, 564, + 564, 564, 564, 564, 564, 564, 565, 565, 380, 565, + 566, 566, 566, 566, 566, 566, 566, 566, 567, 567, + 567, 567, 567, 567, 567, 567, 568, 568, 568, 568, + 568, 568, 568, 568, 569, 569, 569, 569, 569, 569, + 569, 569, 570, 570, 570, 570, 570, 570, 570, 570, + 571, 571, 571, 571, 571, 571, 571, 571, 572, 572, + 572, 572, 572, 572, 572, 572, 378, 376, 375, 374, + 373, 372, 371, 369, 366, 365, 364, 363, 362, 361, + + 360, 358, 354, 352, 351, 349, 348, 347, 346, 345, + 344, 343, 342, 340, 339, 338, 337, 335, 334, 333, + 332, 330, 329, 328, 327, 325, 323, 322, 319, 318, + 317, 316, 314, 313, 312, 311, 310, 308, 307, 306, + 305, 304, 303, 300, 298, 296, 295, 294, 293, 289, + 288, 287, 286, 285, 283, 282, 281, 279, 277, 276, + 274, 273, 272, 271, 270, 269, 268, 267, 266, 265, 264, 263, 262, 261, 260, 259, 258, 257, 256, 255, - 254, 253, 251, 250, 249, 248, 246, 245, 244, 243, - 242, 241, 240, 238, 237, 236, 235, 234, 232, 229, - 228, 227, 225, 221, 216, 211, 210, 209, 208, 207, + 253, 252, 251, 250, 248, 247, 246, 245, 244, 243, + 242, 240, 239, 238, 237, 236, 234, 231, 230, 229, + 227, 223, 218, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, - 196, 195, 193, 192, 191, 190, 189, 188, 187, 184, + 195, 194, 193, 192, 191, 190, 189, 186, 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, 165, 164, - 163, 162, 161, 159, 158, 157, 156, 155, 153, 152, - 151, 149, 148, 145, 132, 130, 129, 126, 125, 124, - 123, 122, 118, 117, 116, 115, 114, 113, 111, 110, - 109, 108, 107, 106, 104, 103, 102, 100, 99, 98, - 97, 96, 95, 94, 91, 90, 89, 88, 86, 85, - 84, 83, 82, 81, 80, 79, 77, 76, 75, 74, - - 73, 72, 71, 70, 69, 67, 49, 44, 34, 32, - 30, 29, 24, 22, 21, 19, 17, 16, 15, 9, - 3, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543 + 163, 161, 160, 159, 158, 157, 155, 154, 153, 151, + 150, 147, 134, 132, 131, 126, 125, 124, 123, 122, + 118, 117, 116, 115, 114, 113, 111, 110, 109, 108, + 107, 106, 104, 103, 102, 100, 99, 98, 97, 96, + 95, 94, 91, 90, 89, 88, 86, 85, 84, 83, + + 82, 81, 80, 79, 77, 76, 75, 74, 73, 72, + 71, 70, 69, 67, 49, 44, 34, 32, 30, 29, + 24, 22, 21, 19, 17, 16, 15, 9, 3, 545, + 545, 545, 545, 545, 545, 545, 545, 545, 545, 545, + 545, 545, 545, 545, 545, 545, 545, 545, 545, 545, + 545, 545, 545, 545, 545, 545, 545, 545, 545, 545, + 545, 545, 545, 545, 545, 545, 545, 545, 545, 545, + 545, 545, 545, 545, 545, 545, 545, 545, 545, 545, + 545, 545, 545, 545, 545, 545, 545, 545, 545 } ; static tao_yy_state_type tao_yy_last_accepting_state; @@ -784,7 +786,7 @@ static char *tao_yy_last_accepting_cpos; char tao_yytext[TAO_YYLMAX]; char *tao_yytext_ptr; #define INITIAL 0 -/* $Id: idl.ll,v 1.60.4.2 2002/03/15 22:08:28 parsons Exp $ +/* $Id: idl.ll,v 1.60.4.4 2002/05/24 14:08:53 parsons Exp $ COPYRIGHT @@ -1133,13 +1135,13 @@ tao_yy_match: while ( tao_yy_chk[tao_yy_base[tao_yy_current_state] + tao_yy_c] != tao_yy_current_state ) { tao_yy_current_state = (int) tao_yy_def[tao_yy_current_state]; - if ( tao_yy_current_state >= 544 ) + if ( tao_yy_current_state >= 546 ) tao_yy_c = tao_yy_meta[(unsigned int) tao_yy_c]; } tao_yy_current_state = tao_yy_nxt[tao_yy_base[tao_yy_current_state] + (unsigned int) tao_yy_c]; ++tao_yy_cp; } - while ( tao_yy_base[tao_yy_current_state] != 1022 ); + while ( tao_yy_base[tao_yy_current_state] != 1030 ); tao_yy_find_action: tao_yy_act = tao_yy_accept[tao_yy_current_state]; @@ -1963,7 +1965,7 @@ static tao_yy_state_type tao_yy_get_previous_state() while ( tao_yy_chk[tao_yy_base[tao_yy_current_state] + tao_yy_c] != tao_yy_current_state ) { tao_yy_current_state = (int) tao_yy_def[tao_yy_current_state]; - if ( tao_yy_current_state >= 544 ) + if ( tao_yy_current_state >= 546 ) tao_yy_c = tao_yy_meta[(unsigned int) tao_yy_c]; } tao_yy_current_state = tao_yy_nxt[tao_yy_base[tao_yy_current_state] + (unsigned int) tao_yy_c]; @@ -1998,11 +2000,11 @@ tao_yy_state_type tao_yy_current_state; while ( tao_yy_chk[tao_yy_base[tao_yy_current_state] + tao_yy_c] != tao_yy_current_state ) { tao_yy_current_state = (int) tao_yy_def[tao_yy_current_state]; - if ( tao_yy_current_state >= 544 ) + if ( tao_yy_current_state >= 546 ) tao_yy_c = tao_yy_meta[(unsigned int) tao_yy_c]; } tao_yy_current_state = tao_yy_nxt[tao_yy_base[tao_yy_current_state] + (unsigned int) tao_yy_c]; - tao_yy_is_jam = (tao_yy_current_state == 543); + tao_yy_is_jam = (tao_yy_current_state == 545); return tao_yy_is_jam ? 0 : tao_yy_current_state; } diff --git a/TAO/TAO_IDL/fe/y.tab.cpp b/TAO/TAO_IDL/fe/y.tab.cpp index f953c3e2ccf..3e60bbade2e 100644 --- a/TAO/TAO_IDL/fe/y.tab.cpp +++ b/TAO/TAO_IDL/fe/y.tab.cpp @@ -49,6 +49,7 @@ int tao_yylex (void); extern "C" int tao_yywrap (void); extern char tao_yytext[]; extern int tao_yyleng; +AST_Decl *tao_enum_constant_decl = 0; #define TAO_YYDEBUG_LEXER_TEXT (tao_yytext[tao_yyleng] = '\0', tao_yytext) /* Force the pretty debugging code to compile.*/ #define TAO_YYDEBUG 1 @@ -2034,11 +2035,8 @@ case 56: idl_global->set_parse_state (IDL_GlobalData::PS_ValueTypeQsSeen); /* - * Done with this value type - pop it off the scopes stack + * Done with this valuetype - pop it off the scopes stack */ - UTL_Scope* s = idl_global->scopes ().top (); - AST_Interface* m = AST_Interface::narrow_from_scope (s); - m->inherited_name_clash (); idl_global->scopes ().pop (); } break; @@ -2099,11 +2097,8 @@ case 60: idl_global->set_parse_state (IDL_GlobalData::PS_ValueTypeQsSeen); /* - * Done with this interface - pop it off the scopes stack. + * Done with this valuetype - pop it off the scopes stack. */ - UTL_Scope* s = idl_global->scopes ().top (); - AST_Interface* m = AST_Interface::narrow_from_scope (s); - m->inherited_name_clash (); idl_global->scopes ().pop (); } break; @@ -2561,7 +2556,9 @@ case 116: if (tao_yyvsp[0].exval != 0 && s != 0) { AST_Expression::AST_ExprValue *result = - tao_yyvsp[0].exval->coerce (tao_yyvsp[-6].etval); + tao_yyvsp[0].exval->check_and_coerce (tao_yyvsp[-6].etval, + tao_enum_constant_decl); + tao_enum_constant_decl = 0; if (result == 0) { @@ -2622,6 +2619,8 @@ case 125: if (s != 0 && d != 0) { + tao_enum_constant_decl = d; + /* * Look through typedefs. */ @@ -3120,6 +3119,10 @@ case 174: { idl_global->err ()->lookup_error (tao_yyvsp[0].idlist); } + else + { + d->last_referenced_as (tao_yyvsp[0].idlist); + } tao_yyval.dcval = d; } @@ -5176,9 +5179,6 @@ case 379: /* * Done with this component - pop it off the scopes stack. */ - UTL_Scope* s = idl_global->scopes ().top (); - AST_Interface* m = AST_Interface::narrow_from_scope (s); - m->inherited_name_clash (); idl_global->scopes ().pop (); } break; diff --git a/TAO/TAO_IDL/include/ast_component.h b/TAO/TAO_IDL/include/ast_component.h index 5e5c801a675..1a39702d51f 100644 --- a/TAO/TAO_IDL/include/ast_component.h +++ b/TAO/TAO_IDL/include/ast_component.h @@ -71,6 +71,10 @@ public: // Visiting. virtual int ast_accept (ast_visitor *visitor); + // Check if we have redefined any of our parents' operations or attributes, + // and check if there is such a clash among the parents + virtual idl_bool redef_clash (void); + private: AST_Component *pd_base_component; ACE_Unbounded_Queue<port_description> pd_provides; diff --git a/TAO/TAO_IDL/include/ast_decl.h b/TAO/TAO_IDL/include/ast_decl.h index 5173758aa3c..2ef5ca02676 100644 --- a/TAO/TAO_IDL/include/ast_decl.h +++ b/TAO/TAO_IDL/include/ast_decl.h @@ -275,37 +275,8 @@ public: idl_bool is_nested (void); // Determines if we are inside of a nested scope or not. - // Boolean methods to test if code was already generated. - idl_bool cli_hdr_gen (void); - idl_bool cli_stub_gen (void); - idl_bool cli_inline_gen (void); - idl_bool srv_hdr_gen (void); - idl_bool impl_hdr_gen (void); - idl_bool srv_skel_gen (void); - idl_bool impl_skel_gen (void); - idl_bool srv_inline_gen (void); - idl_bool cli_hdr_any_op_gen (void); - idl_bool cli_stub_any_op_gen (void); - idl_bool cli_hdr_cdr_op_gen (void); - idl_bool cli_stub_cdr_op_gen (void); - idl_bool cli_inline_cdr_op_gen (void); - idl_bool cli_inline_cdr_decl_gen (void); - - // Set the flag indicating that code generation is done. - void cli_hdr_gen (idl_bool); - void cli_stub_gen (idl_bool); - void cli_inline_gen (idl_bool); - void srv_hdr_gen (idl_bool); - void impl_hdr_gen (idl_bool); - void srv_skel_gen (idl_bool); - void impl_skel_gen (idl_bool); - void srv_inline_gen (idl_bool); - void cli_hdr_any_op_gen (idl_bool); - void cli_stub_any_op_gen (idl_bool); - void cli_hdr_cdr_op_gen (idl_bool); - void cli_stub_cdr_op_gen (idl_bool); - void cli_inline_cdr_op_gen (idl_bool); - void cli_inline_cdr_decl_gen (idl_bool); + UTL_ScopedName *last_referenced_as (void) const; + void last_referenced_as (UTL_ScopedName *n); protected: // These are not private because they're used by @@ -370,27 +341,14 @@ private: idl_bool typeid_set_; // Has our repo id been set by a typeId declaration? - // Variables that indicate if the code generation for that node is already - // been done. This way we avoid regenerating same code. - idl_bool cli_hdr_gen_; - idl_bool cli_stub_gen_; - idl_bool cli_inline_gen_; - idl_bool srv_hdr_gen_; - idl_bool impl_hdr_gen_; - idl_bool srv_skel_gen_; - idl_bool impl_skel_gen_; - idl_bool srv_inline_gen_; - idl_bool cli_hdr_any_op_gen_; - idl_bool cli_stub_any_op_gen_; - idl_bool cli_hdr_cdr_op_gen_; - idl_bool cli_stub_cdr_op_gen_; - idl_bool cli_inline_cdr_op_gen_; - idl_bool cli_inline_cdr_decl_gen_; - char *flat_name_; // Flattened fully scoped name. - // Operations + UTL_ScopedName *last_referenced_as_; + // Temporary holder of the most recent way we were reference. + // The top level component of this is added to pd_name_referenced. + +private: void compute_full_name (UTL_ScopedName *n); // Compute the full name of an AST node. diff --git a/TAO/TAO_IDL/include/ast_expression.h b/TAO/TAO_IDL/include/ast_expression.h index e208c13237a..50863ab8427 100644 --- a/TAO/TAO_IDL/include/ast_expression.h +++ b/TAO/TAO_IDL/include/ast_expression.h @@ -73,6 +73,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc. class UTL_String; class UTL_Scope; class ast_visitor; +class AST_Decl; // Representation of expression values. @@ -116,6 +117,7 @@ public: , EK_longlong , EK_ulonglong , EK_octet + , EK_floating_point }; // Enum to define expression type. @@ -257,28 +259,34 @@ public: // Evaluation and value coercion. - virtual AST_ExprValue *eval (EvalKind ek); + AST_ExprValue *eval (EvalKind ek); - virtual AST_ExprValue *coerce (ExprType t); + AST_ExprValue *coerce (ExprType t); + + // Top-level method, called only from yy_parse. + AST_ExprValue *check_and_coerce (ExprType t, + AST_Decl *d); // Evaluate then store value inside this AST_Expression. - virtual void evaluate (EvalKind ek); + void evaluate (EvalKind ek); - // Compare to AST_Expressions. + // Compare two AST_Expressions. - virtual long operator== (AST_Expression *vc); + long operator== (AST_Expression *vc); - virtual long compare (AST_Expression *vc); + long compare (AST_Expression *vc); protected: // Evaluate different sets of operators. - virtual AST_ExprValue *eval_bin_op (EvalKind ek); + AST_ExprValue *eval_bin_op (EvalKind ek); + + AST_ExprValue *eval_bit_op (EvalKind ek); - virtual AST_ExprValue *eval_bit_op (EvalKind ek); + AST_ExprValue *eval_un_op (EvalKind ek); - virtual AST_ExprValue *eval_un_op (EvalKind ek); + AST_ExprValue *eval_symbol (EvalKind ek); - virtual AST_ExprValue *eval_symbol (EvalKind ek); + idl_bool type_mismatch (ExprType et); private: // Data. diff --git a/TAO/TAO_IDL/include/ast_interface.h b/TAO/TAO_IDL/include/ast_interface.h index 9985f38b5cf..c1617345af1 100644 --- a/TAO/TAO_IDL/include/ast_interface.h +++ b/TAO/TAO_IDL/include/ast_interface.h @@ -73,6 +73,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "ast_type.h" #include "utl_scope.h" +#include "ace/Unbounded_Queue.h" class TAO_IDL_FE_Export AST_Interface : public virtual AST_Type, public virtual UTL_Scope @@ -119,10 +120,9 @@ public: return (pd_n_inherits < 0) ? I_FALSE : I_TRUE; } - // Check if any member's name clashes with a parent's - // member's name, or if any parents' members' names - // clash with each other. - void inherited_name_clash (void); + // Check if we have redefined any of our parents' operations or attributes, + // and check if there is such a clash among the parents + virtual idl_bool redef_clash (void); // Cleanup function. virtual void destroy (void); @@ -149,6 +149,22 @@ protected: AST_Interface **pd_inherits_flat; long pd_n_inherits_flat; + // Queue data structure needed for breadth-first traversal of + // inheritance tree. + ACE_Unbounded_Queue<AST_Interface *> insert_queue; + + // For a special case of a deeply nested inheritance graph and one specific + // way of inheritance in which a node that was already visited, + // but is not present in + // the queue, gets inserted at the tail. This situation arises when a node + // multiply inherits from two or more interfaces in which the first parent is + // higher up in the tree than the second parent. In addition, if the second + // parent turns out to be a child of the first . + + // Queue of dequeued nodes to be searched for the above case. + ACE_Unbounded_Queue<AST_Interface *> del_queue; + +protected: // Scope Management Protocol. friend int tao_yyparse (void); @@ -182,6 +198,15 @@ protected: // This version checks for redefinitions of attributes or operations. AST_Decl *lookup_for_add (AST_Decl *d, idl_bool treat_as_ref); + + void redef_clash_populate_r (AST_Interface *t); + // Populate the insert queue with our parents, and, if we are a + // valuetype, with our supported interface and our parents' + // supported interfaces. + + int insert_non_dup (AST_Interface *t); + // Do non-duplicating insert of bi, by searching both the + // insert queue and the delete queue. }; #endif // _AST_INTERFACE_AST_INTERFACE_HH diff --git a/TAO/TAO_IDL/include/utl_err.h b/TAO/TAO_IDL/include/utl_err.h index 8b05c806b2f..5ee7811832a 100644 --- a/TAO/TAO_IDL/include/utl_err.h +++ b/TAO/TAO_IDL/include/utl_err.h @@ -121,6 +121,7 @@ public: EIDL_ENUM_VAL_EXPECTED, // Expected an enumerator EIDL_ENUM_VAL_NOT_FOUND, // Didnt find an enumerator with that name EIDL_EVAL_ERROR, // Error in evaluating expression + EIDL_INCOMPATIBLE_TYPE, // Assign floating pt. to integer or vice versa EIDL_AMBIGUOUS, // Ambiguous name definition EIDL_DECL_NOT_DEFINED, // Forward declared but never defined EIDL_FWD_DECL_LOOKUP, // Tried to lookup in fwd declared intf @@ -232,6 +233,9 @@ public: // Report an error while evaluating an expression (division by zero, etc.) void eval_error (AST_Expression *d); + // Report incompatible types in constant assignment + void incompatible_type_error (AST_Expression *d); + // Report a situation where a constant was expected but we got // something else instead. This most likely is a case where a union // label did not evaluate to a constant diff --git a/TAO/TAO_IDL/include/utl_idlist.h b/TAO/TAO_IDL/include/utl_idlist.h index 8825aec2132..92a38e297cc 100644 --- a/TAO/TAO_IDL/include/utl_idlist.h +++ b/TAO/TAO_IDL/include/utl_idlist.h @@ -111,6 +111,9 @@ public: Identifier *last_component (void); // Get last element in this list. + Identifier *first_component (void); + // Get first element in this list holding a non-empty string. + int compare (UTL_IdList *other); // Compares each component for equality. private: diff --git a/TAO/TAO_IDL/util/utl_err.cpp b/TAO/TAO_IDL/util/utl_err.cpp index e4d64e0c165..d27dd86cef4 100644 --- a/TAO/TAO_IDL/util/utl_err.cpp +++ b/TAO/TAO_IDL/util/utl_err.cpp @@ -158,6 +158,8 @@ error_string (UTL_Error::ErrorCode c) return "abstract type expected: "; case UTL_Error::EIDL_EVAL_ERROR: return "expression evaluation error: "; + case UTL_Error::EIDL_INCOMPATIBLE_TYPE: + return "incompatible types in constant assignment: "; case UTL_Error::EIDL_NAME_CASE_ERROR: return "identifier spellings differ only in case: "; case UTL_Error::EIDL_NAME_CASE_WARNING: @@ -912,6 +914,19 @@ UTL_Error::eval_error (AST_Expression *v) idl_global->set_err_count (idl_global->err_count () + 1); } +// Report an error while evaluating an expression. +void +UTL_Error::incompatible_type_error (AST_Expression *v) +{ + idl_error_header (EIDL_INCOMPATIBLE_TYPE, + idl_global->lineno (), + idl_global->filename ()); + v->dump (*ACE_DEFAULT_LOG_STREAM); + ACE_ERROR ((LM_ERROR, + "\n")); + idl_global->set_err_count (idl_global->err_count () + 1); +} + // Report a situation where a constant was expected but we // got something else. This may occur in a union when a label // evaluates to a non-constant. diff --git a/TAO/TAO_IDL/util/utl_global.cpp b/TAO/TAO_IDL/util/utl_global.cpp index 2f8e26abad4..ad48c587ca1 100644 --- a/TAO/TAO_IDL/util/utl_global.cpp +++ b/TAO/TAO_IDL/util/utl_global.cpp @@ -557,7 +557,6 @@ IDL_GlobalData::add_to_included_idl_files (char* file_name) else { // Adding more storage. - char** old_included_idl_files = this->included_idl_files_; size_t n_old_allocated_idl_files = @@ -565,8 +564,12 @@ IDL_GlobalData::add_to_included_idl_files (char* file_name) this->n_allocated_idl_files_ += INCREMENT; ACE_NEW (this->included_idl_files_, char *[this->n_allocated_idl_files_]); - for (size_t i = 0; i < n_old_allocated_idl_files; i++) - this->included_idl_files_ [i] = old_included_idl_files [i]; + + for (size_t i = 0; i < n_old_allocated_idl_files; ++i) + { + this->included_idl_files_ [i] = old_included_idl_files [i]; + } + delete [] old_included_idl_files; } } diff --git a/TAO/TAO_IDL/util/utl_idlist.cpp b/TAO/TAO_IDL/util/utl_idlist.cpp index 00ab206611c..54f4b88522c 100644 --- a/TAO/TAO_IDL/util/utl_idlist.cpp +++ b/TAO/TAO_IDL/util/utl_idlist.cpp @@ -132,6 +132,18 @@ UTL_IdList::last_component (void) return ((UTL_IdList *) this->tail ())->last_component (); } +// Get first item of this list holding a non-empty string. +Identifier * +UTL_IdList::first_component (void) +{ + if (ACE_OS::strlen (this->pd_car_data->get_string ()) > 0) + { + return this->pd_car_data; + } + + return ((UTL_IdList *) this->tail ())->first_component (); +} + int UTL_IdList::compare (UTL_IdList *other) { diff --git a/TAO/TAO_IDL/util/utl_scope.cpp b/TAO/TAO_IDL/util/utl_scope.cpp index 5efb08ef8cb..695bfa7a4f6 100644 --- a/TAO/TAO_IDL/util/utl_scope.cpp +++ b/TAO/TAO_IDL/util/utl_scope.cpp @@ -1595,16 +1595,6 @@ UTL_Scope::lookup_by_name (UTL_ScopedName *e, id = e->head (); } - // If we have stripped e to the last component, then - // add it - the last component of a scoped name is - // the only one that counts as a reference in a scope. - if (id == e->last_component ()) - { - add_to_referenced (d, - I_FALSE, - id); - } - AST_Type *t = AST_Type::narrow_from_decl (d); // Are we a type, rather than an identifier? @@ -1618,15 +1608,23 @@ UTL_Scope::lookup_by_name (UTL_ScopedName *e, if (s != 0) { AST_Decl *parent = ScopeAsDecl (s); - - // If the scope we are defined in is itself inside - // an interface or valuetype, then we should also - // be exported to the interface (or valuetype) scope. - if (parent->node_type () == AST_Decl::NT_interface) + AST_Decl::NodeType nt = parent->node_type (); + + // If the scope we are defined in is itself + // inside a module, then we should also + // be exported to the enclosing scope, + // recursive until we get to the enclosing + // module (or root) scope. (CORBA 2.6 3.15.3). + while (nt != AST_Decl::NT_module + && nt != AST_Decl::NT_root) { s->add_to_referenced (d, I_FALSE, d->local_name ()); + + s = parent->defined_in (); + parent = ScopeAsDecl (s); + nt = parent->node_type (); } } } @@ -1705,7 +1703,7 @@ UTL_Scope::add_to_referenced (AST_Decl *e, // Special case for forward declared interfaces in the // scope in which they're defined. Cannot add before full // definition is seen. - if (e->node_type() == AST_Decl::NT_interface) + if (e->node_type () == AST_Decl::NT_interface) { itf = AST_Interface::narrow_from_decl(e); |