Commit 98be021c authored by Botond Baranyi's avatar Botond Baranyi
Browse files

implemented the 'any from' clause and the '@index' modifier (bug 498591, artf724072)



Change-Id: Iaae070cac3635602a3d0113289e75a250ddc871f
Signed-off-by: Botond Baranyi's avatarBotond Baranyi <botond.baranyi@ericsson.com>
parent 4fab3b6e
......@@ -605,6 +605,7 @@ namespace Common {
owner = 0;
chk_finished = false;
pard_type_instance = false;
needs_any_from_done = false;
asn_encoding = CT_UNDEF;
asn_decoding = CT_UNDEF;
}
......
......@@ -409,6 +409,11 @@ namespace Common {
* It will not have its own segment and reference generated in the JSON schema,
* its schema segment will be generated as an embedded type's would. */
bool pard_type_instance;
/** Indicates that the component array version (used with the help of the
* 'any from' clause) of the 'done' function needs to be generated for
* this type. */
bool needs_any_from_done;
/** Copy constructor, for the use of Type::clone() only. */
Type(const Type& p);
......@@ -1188,9 +1193,11 @@ namespace Common {
bool is_untagged() const;
inline boolean is_pard_type_instance() { return pard_type_instance; }
inline bool is_pard_type_instance() { return pard_type_instance; }
inline void set_pard_type_instance() { pard_type_instance = true; }
inline void set_needs_any_from_done() { needs_any_from_done = true; }
/** Calculates the type's display name from the genname (replaces double
* underscore characters with single ones) */
string get_dispname() const;
......
......@@ -1359,7 +1359,7 @@ void Type::generate_code_Choice(output_struct *target)
sdef.control_ns_prefix = prefix;
sdef.xerUseUnion = xerattrib->useUnion_;
sdef.xerUseTypeAttr = xerattrib->useType_ || xerattrib->useUnion_;
}
}
defUnionClass(&sdef, target);
defUnionTemplate(&sdef, target);
......@@ -2272,27 +2272,17 @@ void Type::generate_code_done(output_struct *target)
const char *genname_str = t_genname.c_str();
const string& dispname = get_typename();
const char *dispname_str = dispname.c_str();
// value redirect base class (interface)
if (use_runtime_2) {
target->header.class_decls = mputprintf(target->header.class_decls,
"class %s_Redirect_Interface;\n", genname_str);
target->header.class_defs = mputprintf(target->header.class_defs,
"class %s_Redirect_Interface {\n"
"public:\n"
"virtual void set_values(const %s&) = 0;\n"
"virtual ~%s_Redirect_Interface() { }\n"
"};\n\n", genname_str, genname_str, genname_str);
}
// the done function
target->header.function_prototypes = mputprintf
(target->header.function_prototypes,
"extern alt_status done(const COMPONENT& component_reference, "
"const %s_template& value_template, %s%s *value_redirect);\n",
genname_str, genname_str, use_runtime_2 ? "_Redirect_Interface" : "");
"const %s_template& value_template, %s *value_redirect, Index_Redirect*);\n",
genname_str, use_runtime_2 ? "Value_Redirect_Interface" : genname_str);
target->source.function_bodies = mputprintf
(target->source.function_bodies,
"alt_status done(const COMPONENT& component_reference, "
"const %s_template& value_template, %s%s *value_redirect)\n"
"const %s_template& value_template, %s *value_redirect, Index_Redirect*)\n"
"{\n"
"if (!component_reference.is_bound()) "
"TTCN_error(\"Performing a done operation on an unbound component "
......@@ -2306,11 +2296,11 @@ void Type::generate_code_done(output_struct *target)
"%s return_value;\n"
"return_value.decode_text(*text_buf);\n"
"if (value_template.match(return_value)) {\n"
"if (value_redirect != NULL) {\n", genname_str, genname_str,
use_runtime_2 ? "_Redirect_Interface" : "", dispname_str, genname_str);
"if (value_redirect != NULL) {\n", genname_str,
use_runtime_2 ? "Value_Redirect_Interface" : genname_str, dispname_str, genname_str);
if (use_runtime_2) {
target->source.function_bodies = mputstr(target->source.function_bodies,
"value_redirect->set_values(return_value);\n"
"value_redirect->set_values(&return_value);\n"
"delete value_redirect;\n");
}
else {
......@@ -2342,6 +2332,41 @@ void Type::generate_code_done(output_struct *target)
"} else return ret_val;\n"
"}\n\n",
dispname_str, dispname_str, omit_in_value_list ? ", TRUE" : "");
if (needs_any_from_done) {
// 'done' function for component arrays
// this needs to be generated in the header, because it has template parameters
target->header.function_prototypes = mputprintf(
target->header.function_prototypes,
"\ntemplate <typename T_type, unsigned int array_size, int index_offset>\n"
"alt_status done(const VALUE_ARRAY<T_type, array_size, index_offset>& "
"component_array, const %s_template& value_template, "
"%s* value_redirect, Index_Redirect* index_redirect)\n"
"{\n"
"if (index_redirect != NULL) {\n"
"index_redirect->incr_pos();\n"
"}\n"
"alt_status result = ALT_NO;\n"
"for (unsigned int i = 0; i < array_size; ++i) {\n"
"alt_status ret_val = done(component_array[i], value_template, value_redirect, "
"index_redirect);\n"
"if (ret_val == ALT_YES) {\n"
"if (index_redirect != NULL) {\n"
"index_redirect->add_index((int)i + index_offset);\n"
"}\n"
"result = ret_val;\n"
"break;\n"
"}\n"
"else if (ret_val == ALT_REPEAT || (ret_val == ALT_MAYBE && result == ALT_NO)) {\n"
"result = ret_val;\n"
"}\n"
"}\n"
"if (index_redirect != NULL) {\n"
"index_redirect->decr_pos();\n"
"}\n"
"return result;\n"
"}\n\n",
genname_str, use_runtime_2 ? "Value_Redirect_Interface" : genname_str);
}
}
bool Type::ispresent_anyvalue_embedded_field(Type* t,
......
This diff is collapsed.
......@@ -237,20 +237,20 @@ namespace Common {
OPTYPE_DECODE_BASE64, //v1
/** cannot distinguish during parsing; can be COMP or TMR */
OPTYPE_UNDEF_RUNNING, // r1 78
OPTYPE_UNDEF_RUNNING, // r1 [r2] b4 78
OPTYPE_COMP_NULL, // - (from V_TTCN3_NULL)
OPTYPE_COMP_MTC, // -
OPTYPE_COMP_SYSTEM, // -
OPTYPE_COMP_SELF, // -
OPTYPE_COMP_CREATE, // r1 [v2] [v3] b4
OPTYPE_COMP_RUNNING, // v1
OPTYPE_COMP_RUNNING, // v1 [r2] b4
OPTYPE_COMP_RUNNING_ANY, // -
OPTYPE_COMP_RUNNING_ALL, // -
OPTYPE_COMP_ALIVE, // v1
OPTYPE_COMP_ALIVE_ANY, // -
OPTYPE_COMP_ALIVE_ALL, // -
OPTYPE_TMR_READ, // r1 90
OPTYPE_TMR_RUNNING, // r1
OPTYPE_TMR_RUNNING, // r1 [r2] b4
OPTYPE_TMR_RUNNING_ANY, // -
OPTYPE_GETVERDICT, // -
OPTYPE_ACTIVATE, // r1
......@@ -404,11 +404,15 @@ namespace Common {
Value(operationtype_t p_optype);
/** Constructor used by V_EXPR "v1" or [v1] */
Value(operationtype_t p_optype, Value *p_v1);
/** Constructor used bt V_EXPR "v1 [r2] b4": COMP_RUNNING, COMP_ALIVE */
Value(operationtype_t p_optype, Value* p_v1, Ttcn::Ref_base* p_r2, bool p_b4);
/** Constructor used by V_EXPR "ti1": LENGTHOF, SIZEOF, VALUEOF, TTCN2STRING */
Value(operationtype_t p_optype, TemplateInstance *p_ti1);
/** Constructor used by V_EXPR "r1": COMP_RUNNING, COMP_ALIVE,
* TMR_READ, TMR_RUNNING, ACTIVATE */
/** Constructor used by V_EXPR "r1": TMR_READ, ACTIVATE */
Value(operationtype_t p_optype, Ttcn::Ref_base *p_r1);
/** Constructor used by V_EXPR "r1 [r2] b4": UNDEF_RUNNING */
Value(operationtype_t p_optype, Ttcn::Ref_base* p_r1, Ttcn::Ref_base* p_r2,
bool p_b4);
/** ACTIVATE_REFD, OPTYPE_INVOKE, OPTYPE_COMP_ALIVE_REFD */
Value(operationtype_t p_optype, Value *p_v1,
Ttcn::ParsedActualParameters *p_ap_list);
......@@ -575,17 +579,19 @@ namespace Common {
const char *opnum1 = "left",
const char *opnum2 = "right");
void chk_expr_operand_undef_running(Type::expected_value_t exp_val,
Ttcn::Ref_base *ref,
Ttcn::Ref_base *ref, bool any_from,
Ttcn::Ref_base* index_ref,
const char *opnum, const char *opname);
/** Returns the referred component type if it is correct. */
Type *chk_expr_operand_comptyperef_create();
/** Checks whether the special component references mtc, system and self
* have the correct component types (compatible with \a my_governor). */
void chk_expr_comptype_compat();
void chk_expr_operand_compref(Value *val, const char *opnum,
const char *opname);
Type* chk_expr_operand_compref(Value *val, const char *opnum,
const char *opname, bool any_from = false);
void chk_expr_operand_tmrref(Ttcn::Ref_base *ref,
const char *opnum, const char *opname);
const char *opnum, const char *opname,
bool any_from = false);
void chk_expr_operand_activate(Ttcn::Ref_base *ref,
const char *opnum, const char *opname);
void chk_expr_operand_activate_refd(Value *val,
......
......@@ -3042,6 +3042,17 @@ bool SubType::zero_length_allowed() const
return length_restriction->is_element(size_limit_t(0));
}
bool SubType::length_allowed(size_t len) const
{
if (checked != STC_YES) {
FATAL_ERROR("SubType::length_allowed()");
}
if (length_restriction == NULL) {
return true;
}
return length_restriction->is_element(size_limit_t(len));
}
string SubType::to_string() const
{
if (root) {
......
......@@ -319,6 +319,8 @@ public:
Int get_length_restriction() const;
/// true unless a length restriction prohibits zero elements
bool zero_length_allowed() const;
/// true if the length restriction allows the specified length
bool length_allowed(size_t len) const;
bool add_parent_subtype(SubType* st);
private:
......
......@@ -7,6 +7,7 @@
*
* Contributors:
* Balasko, Jeno
* Baranyi, Botond
* Beres, Szabolcs
* Kovacs, Ferenc
* Raduly, Csaba
......@@ -323,11 +324,11 @@ namespace Ttcn {
}
void ArrayDimensions::chk_indices(Common::Reference *ref, const char *def_name,
bool allow_slicing, Type::expected_value_t exp_val)
bool allow_slicing, Type::expected_value_t exp_val, bool any_from)
{
FieldOrArrayRefs *subrefs = ref->get_subrefs();
if (!subrefs) {
if (!allow_slicing)
if (!allow_slicing && !any_from)
ref->error("Reference to a %s array without array index", def_name);
return;
}
......@@ -344,16 +345,23 @@ namespace Ttcn {
dims[i]->chk_index(subref->get_val(), exp_val);
}
if (nof_refs < nof_dims) {
if (!allow_slicing) ref->error("Too few indices in a reference to a %s "
"array: the array has %lu dimensions, but the reference has only %lu "
"array %s", def_name, (unsigned long)nof_dims, (unsigned long)nof_refs,
nof_refs > 1 ? "indices" : "index");
if (!allow_slicing && !any_from) {
ref->error("Too few indices in a reference to a %s array without the "
"'any from' clause: the array has %lu dimensions, but the reference "
"has only %lu array %s", def_name, (unsigned long)nof_dims,
(unsigned long)nof_refs, nof_refs > 1 ? "indices" : "index");
}
} else if (nof_refs > nof_dims) {
ref->error("Too many indices in a reference to a %s array: the reference "
"has %lu array indices, but the array has only %lu dimension%s",
def_name, (unsigned long) nof_refs, (unsigned long) nof_dims,
nof_dims > 1 ? "s" : "");
}
else if (any_from) { // nof_refs == nof_dims
ref->error("Too many indices in a reference to a %s array with the "
"'any from' clause : the reference has as many array indices as the "
"array has dimensions (%lu)", def_name, (unsigned long) nof_refs);
}
}
size_t ArrayDimensions::get_array_size()
......
......@@ -7,6 +7,7 @@
*
* Contributors:
* Balasko, Jeno
* Baranyi, Botond
* Beres, Szabolcs
* Raduly, Csaba
*
......@@ -101,11 +102,13 @@ namespace Ttcn {
* dimensions. If parameter \a allow_slicing is false slicing of timer or
* port arrays are not allowed thus the number of array indices in \a ref
* must be the same as the number of array dimensions. Otherwise (i.e. if
* \a allow_slicing is true \a ref may have fewer indices.
* \a allow_slicing is true) \a ref may have fewer indices.
* If parameter \a any_from is true, then the reference must point to a
* timer or port array instead of a single timer or port.
* Parameter \a def_name is needed for error messages, it shall be either
* "timer" or "port". */
void chk_indices(Common::Reference *ref, const char *def_type, bool allow_slicing,
Type::expected_value_t exp_val);
Type::expected_value_t exp_val, bool any_from = false);
/** Returns the total number of elements in the array. */
size_t get_array_size();
/** Generates a C++ code fragment, which is a comma separated list of string
......
This diff is collapsed.
......@@ -277,6 +277,7 @@ namespace Ttcn {
LogArguments *logargs; ///< used by S_ACTION, S_LOG, S_STOP_TESTCASE
struct {
Reference *portref; /**< NULL means any/all */
bool anyfrom;
union {
struct {
TemplateInstance *sendpar;
......@@ -301,6 +302,7 @@ namespace Ttcn {
ValueRedirect *value;
ParamRedirect *param;
Reference *sender;
Reference* index;
} redirect;
union {
TemplateInstance *getreply_valuematch;
......@@ -322,6 +324,8 @@ namespace Ttcn {
struct {
Reference *timerref; /**< 0 means any/all */
Value *value;
bool any_from;
Reference* index_redirect;
} timer_op; ///< used by S_START_TIMER, S_STOP_TIMER, S_TIMEOUT
struct {
......@@ -334,6 +338,9 @@ namespace Ttcn {
struct {
Value *compref; /**< if S_STOP_COMP, S_KILL then compref==0
means ALL */
bool any_from;
Reference* index_redirect;
union {
component_t any_or_all;
/**< used if S_DONE, S_KILLED and compref==0 */
......@@ -502,8 +509,11 @@ namespace Ttcn {
Statement(statementtype_t p_st, AltGuards *p_ags);
/** Constructor used by S_RETURN */
Statement(statementtype_t p_st, Template *p_temp);
/** Constructor used by S_DEACTIVATE, S_STOP_COMP, S_KILL, S_KILLED */
/** Constructor used by S_DEACTIVATE, S_STOP_COMP, S_KILL */
Statement(statementtype_t p_st, Value *p_val);
/** Constructor used by S_KILLED */
Statement(statementtype_t p_st, Value *p_val, bool p_any_from,
Reference* p_index_redirect);
/** Constructor used by S_SETVERDICT */
Statement(statementtype_t p_st, Value *p_val, LogArguments *p_logargs);
/** Constructor used by S_SEND */
......@@ -523,34 +533,40 @@ namespace Ttcn {
Value *p_toclause);
/** Constructor used by S_RECEIVE, S_CHECK_RECEIVE and
* S_TRIGGER. p_ref==0 means any port. */
Statement(statementtype_t p_st, Reference *p_ref,
Statement(statementtype_t p_st, Reference *p_ref, bool p_anyfrom,
TemplateInstance *p_templinst, TemplateInstance *p_fromclause,
ValueRedirect *p_redirectval, Reference *p_redirectsender);
ValueRedirect *p_redirectval, Reference *p_redirectsender,
Reference* p_redirectindex);
/** Constructor used by S_GETCALL and S_CHECK_GETCALL. p_ref==0
* means any port. */
Statement(statementtype_t p_st, Reference *p_ref,
Statement(statementtype_t p_st, Reference *p_ref, bool p_anyfrom,
TemplateInstance *p_templinst, TemplateInstance *p_fromclause,
ParamRedirect *p_redirectparam, Reference *p_redirectsender);
ParamRedirect *p_redirectparam, Reference *p_redirectsender,
Reference* p_redirectindex);
/** Constructor used by S_GETREPLY and S_CHECK_GETREPLY. p_ref==0
* means any port. */
Statement(statementtype_t p_st, Reference *p_ref,
Statement(statementtype_t p_st, Reference *p_ref, bool p_anyfrom,
TemplateInstance *p_templinst, TemplateInstance *p_valuematch,
TemplateInstance *p_fromclause,
ValueRedirect *p_redirectval, ParamRedirect *p_redirectparam,
Reference *p_redirectsender);
Reference *p_redirectsender, Reference* p_redirectindex);
/** Constructor used by S_CATCH and S_CHECK_CATCH. p_ref==0 means
* any port. */
Statement(statementtype_t p_st, Reference *p_ref,
Statement(statementtype_t p_st, Reference *p_ref, bool p_anyfrom,
Reference *p_sig, TemplateInstance *p_templinst,
bool p_timeout, TemplateInstance *p_fromclause,
ValueRedirect *p_redirectval, Reference *p_redirectsender);
ValueRedirect *p_redirectval, Reference *p_redirectsender,
Reference* p_redirectindex);
/** Constructor used by S_CHECK. p_ref==0 means any port. */
Statement(statementtype_t p_st, Reference *p_ref,
TemplateInstance *p_fromclause, Reference *p_redirectsender);
Statement(statementtype_t p_st, Reference *p_ref, bool p_anyfrom,
TemplateInstance *p_fromclause, Reference *p_redirectsender,
Reference* p_redirectindex);
/** Constructor used by S_CLEAR, S_START_PORT and S_STOP_PORT.
* p_ref==0 means all port. S_STOP_TIMER (p_ref==0: all timer),
* S_TIMEOUT (p_ref==0: any timer). */
* p_ref==0 means all port. S_STOP_TIMER (p_ref==0: all timer). */
Statement(statementtype_t p_st, Reference *p_ref);
/** Constructor used by S_TIMEOUT (p_ref==0: any timer)*/
Statement(statementtype_t p_st, Reference *p_ref, bool p_any_from,
Reference* p_redirectindex);
/** Constructor used by S_START_COMP */
Statement(statementtype_t p_st, Value *p_compref, Ref_pard *p_funcinst);
/** Constructor used by S_START_COMP_REFD */
......@@ -558,7 +574,8 @@ namespace Ttcn {
ParsedActualParameters *p_ap_list);
/** Constructor used by S_DONE */
Statement(statementtype_t p_st, Value *p_compref,
TemplateInstance *p_donematch, ValueRedirect *p_redirect);
TemplateInstance *p_donematch, ValueRedirect *p_redirect,
Reference* p_index_redirect, bool p_any_from);
/** Constructor used by S_DONE, S_KILLED */
Statement(statementtype_t p_st, component_t p_anyall);
/** Constructor used by S_CONNECT, S_DISCONNECT, S_MAP, S_UNMAP */
......@@ -621,6 +638,19 @@ namespace Ttcn {
/** checks whether the statement (including all embedded statements) are
* allowed in an interleaved construct */
void chk_allowed_interleave();
/** Checks the index redirect in a port, timer or component array operation.
*
* @param p_index_ref reference to variable or parameter for storing the index
* @param p_array_dims dimensions of the port, timer or component array
* @param p_any_from presence of the 'any from' clause before the array
* @param p_array_type string containing "port", "timer" or "component"
* (used in error messages)
*
* @note This function is also called by expressions containing timer or
* component operations in the Value class. */
static void chk_index_redirect(Reference* p_index_ref,
ArrayDimensions* p_array_dims, bool p_any_from, const char* p_array_type);
private:
void chk_start_undef();
void chk_stop_undef();
......@@ -680,11 +710,12 @@ namespace Ttcn {
void chk_execute();
void chk_execute_refd();
/** Checks whether \a p_ref points to a port or port parameter.
/** Checks whether \a p_ref points to a port, port parameter or port array.
* If \a p_ref refers to a port array the array indices within \a
* p_ref are also checked. Returns a pointer to the port type if
* available or NULL otherwise. */
Type *chk_port_ref(Reference *p_ref);
* p_ref are also checked. If \a p_any_from is true, then the reference
* must point to a port array, otherwise it must point to a port.
* Returns a pointer to the port type if available or NULL otherwise. */
Type *chk_port_ref(Reference *p_ref, bool p_any_from = false);
/** Checks the `to' clause of a port operation. Field
* port_op.s.toclause shall be a component reference (or an
* address) depending on the extension attributes of \a
......@@ -713,16 +744,20 @@ namespace Ttcn {
* describing the respective signature is returned or NULL in
* case of error. */
static Type *chk_signature_ref(Reference *p_ref);
/** Checks whether \a p_ref points to a timer or timer parameter.
/** Checks whether \a p_ref points to a timer, timer parameter or timer array.
* If \a p_ref refers to a timer array the array indices within
* \a p_ref are also checked. */
static void chk_timer_ref(Reference *p_ref);
/** Checks whether \a p_val is a component reference (i.e. its
* type is a component type). Returns a pointer to the component
* type if available or NULL otherwise. Flags \a allow_mtc and \a
* allow_system indicate whether the mtc or system component
* reference is acceptable in this context. */
Type *chk_comp_ref(Value *p_val, bool allow_mtc, bool allow_system);
* \a p_ref are also checked. If \a p_any_from is true, then the reference
* must point to a port array, otherwise it must point to a port.*/
static void chk_timer_ref(Reference *p_ref, bool p_any_from = false);
/** Checks whether \a p_val is a component or component array reference
* (i.e. its type is a component or component array type).
* Returns a pointer to the component or component array type if available
* or NULL otherwise. Flags \a allow_mtc and \a allow_system indicate whether
* the mtc or system component reference is acceptable in this context.
* Flag p_any_from indicates whether the 'any from' clause was used on \a p_val
* (in which case it must be a component array) or not (in which case it
* must be a component). */
Type *chk_comp_ref(Value *p_val, bool allow_mtc, bool allow_system, bool p_any_from = false);
/** Checks an endpoint for a port connection or mapping. Parameter
* \a p_compref is a component reference, \a p_portref refers to
* a port within the corresponding component type. A pointer to
......@@ -739,6 +774,14 @@ namespace Ttcn {
char* generate_code(char *str);
void generate_code_expr(expression_struct *expr);
void ilt_generate_code(ILT *ilt);
/** Generates code for an index redirect. (A new class is generated for each
* redirect, inheriting the Index_Redirect class.)
*
* @note This function is also called by expressions containing timer or
* component operations in the Value class. */
static void generate_code_index_redirect(expression_struct* expr,
Reference* p_ref, Scope* p_scope);
/** Needed by implicit omit. Pushes attrib path down to definitions
*/
......@@ -1129,11 +1172,8 @@ namespace Ttcn {
* structure. A new class is generated for every value redirect, which
* handles the redirecting.
* @param matched_ti the template instance used for matching the redirected
* value (if NULL, then the template instance is an 'any value' template)
* @param base_class_prefix the namespace and/or class prefix of the
* base value redirect class of the appropriate type */
void generate_code(expression_struct* expr, TemplateInstance* matched_ti,
string base_class_prefix);
* value (if NULL, then the template instance is an 'any value' template) */
void generate_code(expression_struct* expr, TemplateInstance* matched_ti);
/** returns true if at least one of the value redirects has the
* '@decoded' modifier*/
bool has_decoded_modifier() const;
......
This diff is collapsed.
......@@ -417,10 +417,10 @@ static void generate_generic_receive(char **def_ptr, char **src_ptr,
}
def = mputprintf(def, "alt_status %s(const %s_template& "
"sender_template, %s *sender_ptr);\n", function_name, sender_type,
sender_type);
"sender_template, %s *sender_ptr, Index_Redirect*);\n", function_name,
sender_type, sender_type);
src = mputprintf(src, "alt_status %s::%s(const %s_template& "
"sender_template, %s *sender_ptr)\n"
"sender_template, %s *sender_ptr, Index_Redirect*)\n"
"{\n"
"msg_queue_item *my_head = (msg_queue_item*)msg_queue_head;\n"
"if (msg_queue_head == NULL) {\n"
......@@ -565,14 +565,14 @@ static void generate_receive(char **def_ptr, char **src_ptr,
}
def = mputprintf(def, "alt_status %s(const %s_template& value_template, "
"%s%s *value_redirect, const %s_template& sender_template, %s "
"*sender_ptr);\n", function_name, message_type->name,
use_runtime_2 ? message_type->name_w_no_prefix : message_type->name,
use_runtime_2 ? "_Redirect_Interface" : "", sender_type, sender_type);
"%s *value_redirect, const %s_template& sender_template, %s "
"*sender_ptr, Index_Redirect*);\n", function_name, message_type->name,
use_runtime_2 ? "Value_Redirect_Interface" : message_type->name,
sender_type, sender_type);
src = mputprintf(src, "alt_status %s::%s(const %s_template& "
"value_template, %s%s *value_redirect, const %s_template& "
"sender_template, %s *sender_ptr)\n"
"value_template, %s *value_redirect, const %s_template& "
"sender_template, %s *sender_ptr, Index_Redirect*)\n"
"{\n"
"if (value_template.get_selection() == ANY_OR_OMIT) "
"TTCN_error(\"%s operation using '*' as matching template\");\n"
......@@ -586,9 +586,8 @@ static void generate_receive(char **def_ptr, char **src_ptr,
"return ALT_NO;\n"
"}\n"
"} else ", class_name, function_name, message_type->name,
use_runtime_2 ? message_type->name_w_no_prefix : message_type->name,
use_runtime_2 ? "_Redirect_Interface" : "", sender_type, sender_type,
operation_name);
use_runtime_2 ? "Value_Redirect_Interface" : message_type->name,
sender_type, sender_type, operation_name);
if (is_address) {
src = mputprintf(src, "if (my_head->sender_component != "
"SYSTEM_COMPREF) {\n"
......@@ -666,7 +665,7 @@ static void generate_receive(char **def_ptr, char **src_ptr,
"if (value_redirect != NULL) {\n", failed_status);
if (use_runtime_2) {
src = mputprintf(src,
"value_redirect->set_values(*my_head->message_%lu);\n"
"value_redirect->set_values(my_head->message_%lu);\n"
"delete value_redirect;\n", (unsigned long) message_index);
}
else {
......@@ -783,10 +782,10 @@ static void generate_generic_getop(getop_t getop,
}
def = mputprintf(def, "alt_status %s(const %s_template& "
"sender_template, %s *sender_ptr);\n", function_name, sender_type,
"sender_template, %s *sender_ptr, Index_Redirect*);\n", function_name, sender_type,
sender_type);
src = mputprintf(src, "alt_status %s::%s(const %s_template& "
"sender_template, %s *sender_ptr)\n"
"sender_template, %s *sender_ptr, Index_Redirect*)\n"
"{\n"
"if (proc_queue_head == NULL) {\n"
"if (is_started) return ALT_MAYBE;\n"
......@@ -981,13 +980,13 @@ static void generate_getcall(char **def_ptr, char **src_ptr,
def = mputprintf(def, "alt_status %s(const %s_template& "
"getcall_template, const %s_template& sender_template, "
"const %s_call_redirect& param_ref, %s *sender_ptr);\n",
"const %s_call_redirect& param_ref, %s *sender_ptr, Index_Redirect*);\n",
function_name, signature->name, sender_type, signature->name,
sender_type);
src = mputprintf(src, "alt_status %s::%s(const %s_template& "
"getcall_template, const %s_template& sender_template, "
"const %s_call_redirect& param_ref, %s *sender_ptr)\n"
"const %s_call_redirect& param_ref, %s *sender_ptr, Index_Redirect*)\n"
"{\n"
"if (proc_queue_head == NULL) {\n"
"if (is_started) return ALT_MAYBE;\n"
......@@ -1104,13 +1103,13 @@ static void generate_getreply(char **def_ptr, char **src_ptr,
def = mputprintf(def, "alt_status %s(const %s_template& "
"getreply_template, const %s_template& sender_template, "
"const %s_reply_redirect& param_ref, %s *sender_ptr);\n",
"const %s_reply_redirect& param_ref, %s *sender_ptr, Index_Redirect*);\n",
function_name, signature->name, sender_type, signature->name,
sender_type);
src = mputprintf(src, "alt_status %s::%s(const %s_template& "
"getreply_template, const %s_template& sender_template, "
"const %s_reply_redirect& param_ref, %s *sender_ptr)\n"
"const %s_reply_redirect& param_ref, %s *sender_ptr, Index_Redirect*)\n"
"{\n", class_name, function_name, signature->name, sender_type,
signature->name, sender_type);
if (signature->has_return_value) {
......@@ -1233,12 +1232,12 @@ static void generate_catch(char **def_ptr, char **src_ptr,
def = mputprintf(def, "alt_status %s(const %s_exception_template& "
"catch_template, const %s_template& sender_template, "
"%s *sender_ptr);\n",
"%s *sender_ptr, Index_Redirect*);\n",