Commit e5c1c9e3 authored by Kristof Szabados's avatar Kristof Szabados
Browse files
parent 99a65f03
......@@ -10,8 +10,6 @@ package org.eclipse.titan.runtime.core;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
 
import org.eclipse.titan.runtime.core.Base_Type.TTCN_Typedescriptor;
import org.eclipse.titan.runtime.core.Param_Types.Module_Param_Name;
......@@ -1285,85 +1283,6 @@ public final class PreGenRecordOf extends TTCN_Module {
return constGet_at(index_value.getInt());
}
 
protected int get_length_for_concat(final AtomicBoolean is_any_value) {
switch (template_selection) {
case SPECIFIC_VALUE:
return value_elements.size();
case ANY_VALUE:
case ANY_OR_OMIT:
switch (length_restriction_type) {
case NO_LENGTH_RESTRICTION:
if (template_selection == template_sel.ANY_VALUE) {
// ? => { * }
is_any_value.set( true );
return 1;
}
throw new TtcnError("Operand of record of template concatenation is an AnyValueOrNone (*) matching mechanism with no length restriction");
case RANGE_LENGTH_RESTRICTION:
if (range_length_max_length == 0 || range_length_max_length != range_length_min_length) {
throw new TtcnError( MessageFormat.format( "Operand of record of template concatenation is an {0} matching mechanism with non-fixed length restriction", template_selection == template_sel.ANY_VALUE ? "AnyValue (?)" : "AnyValueOrNone (*)" ) );
}
// else fall through (range length restriction is allowed if the minimum
// and maximum value are the same)
case SINGLE_LENGTH_RESTRICTION:
// ? length(N) or * length(N) => { ?, ?, ... ? } N times
return length_restriction_type == length_restriction_type_t.SINGLE_LENGTH_RESTRICTION ? single_length : range_length_min_length;
}
default:
throw new TtcnError("Operand of record of template concatenation is an uninitialized or unsupported template.");
}
}
protected int get_length_for_concat(final PREGEN__RECORD__OF__INTEGER__OPTIMIZED operand) {
operand.must_bound("Operand of record of template concatenation is an unbound value.");
return operand.valueElements.size();
}
protected int get_length_for_concat(final template_sel operand) {
if (operand == template_sel.ANY_VALUE) {
// ? => { * }
return 1;
}
throw new TtcnError("Operand of record of template concatenation is an uninitialized or unsupported template.");
}
//TODO: simplify, just use value_elements.add()
public void concat(final AtomicInteger pos, final PREGEN__RECORD__OF__INTEGER__OPTIMIZED_template operand) {
// all errors should have already been caught by the operand's
// get_length_for_concat() call;
// the result template (this) should already be set to SPECIFIC_VALUE and
// single_value.value_elements should already be allocated
switch (operand.template_selection) {
case SPECIFIC_VALUE:
for (int i = 0; i < operand.value_elements.size(); ++i) {
value_elements.set( pos.get() + i, new TitanInteger_template(operand.value_elements.get(i)) );
}
pos.addAndGet( operand.value_elements.size() );
break;
case ANY_VALUE:
case ANY_OR_OMIT:
switch (operand.length_restriction_type) {
case NO_LENGTH_RESTRICTION:
// ? => { * }
value_elements.set( pos.get(), new TitanInteger_template( template_sel.ANY_OR_OMIT ) );
pos.incrementAndGet();
break;
case RANGE_LENGTH_RESTRICTION:
case SINGLE_LENGTH_RESTRICTION: {
// ? length(N) or * length(N) => { ?, ?, ... ? } N times
final int N = operand.length_restriction_type == length_restriction_type_t.SINGLE_LENGTH_RESTRICTION ? operand.single_length : operand.range_length_min_length;
for (int i = 0; i < N; ++i) {
value_elements.set( pos.get() + i, new TitanInteger_template( template_sel.ANY_VALUE ) );
}
pos.addAndGet( N );
break; }
}
default:
break;
}
}
public void set_size(final int new_size) {
if (new_size < 0) {
throw new TtcnError("Internal error: Setting a negative size for a template of type @PreGenRecordOf.PREGEN_RECORD_OF_INTEGER_OPTIMIZED.");
......@@ -1495,35 +1414,6 @@ public final class PreGenRecordOf extends TTCN_Module {
throw new TtcnError("Performing n_elem() operation on an uninitialized/unsupported template of type PREGEN__RECORD__OF__INTEGER__OPTIMIZED.");
}
 
public boolean matchv(final PREGEN__RECORD__OF__INTEGER__OPTIMIZED other_value, final boolean legacy) {
if (!other_value.is_bound()) {
return false;
}
final int value_length = other_value.size_of().getInt();
if (!match_length(value_length)) {
return false;
}
switch (template_selection) {
case SPECIFIC_VALUE:
return RecordOf_Match.match_record_of(other_value, value_length, this, value_elements.size(), match_function_specific, legacy);
case OMIT_VALUE:
return false;
case ANY_VALUE:
case ANY_OR_OMIT:
return true;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (int list_count = 0; list_count < list_value.size(); list_count++) {
if (list_value.get(list_count).matchv(other_value, legacy)) {
return template_selection == template_sel.VALUE_LIST;
}
}
return template_selection == template_sel.COMPLEMENTED_LIST;
default:
throw new TtcnError("Matching with an uninitialized/unsupported template of type PREGEN__RECORD__OF__INTEGER__OPTIMIZED.");
}
}
@Override
public boolean is_value() {
if (template_selection != template_sel.SPECIFIC_VALUE || is_ifPresent) {
......@@ -3139,85 +3029,6 @@ public final class PreGenRecordOf extends TTCN_Module {
return set_items.get(set_index);
}
 
protected int get_length_for_concat(final AtomicBoolean is_any_value) {
switch (template_selection) {
case SPECIFIC_VALUE:
return value_elements.size();
case ANY_VALUE:
case ANY_OR_OMIT:
switch (length_restriction_type) {
case NO_LENGTH_RESTRICTION:
if (template_selection == template_sel.ANY_VALUE) {
// ? => { * }
is_any_value.set( true );
return 1;
}
throw new TtcnError("Operand of record of template concatenation is an AnyValueOrNone (*) matching mechanism with no length restriction");
case RANGE_LENGTH_RESTRICTION:
if (range_length_max_length == 0 || range_length_max_length != range_length_min_length) {
throw new TtcnError( MessageFormat.format( "Operand of record of template concatenation is an {0} matching mechanism with non-fixed length restriction", template_selection == template_sel.ANY_VALUE ? "AnyValue (?)" : "AnyValueOrNone (*)" ) );
}
// else fall through (range length restriction is allowed if the minimum
// and maximum value are the same)
case SINGLE_LENGTH_RESTRICTION:
// ? length(N) or * length(N) => { ?, ?, ... ? } N times
return length_restriction_type == length_restriction_type_t.SINGLE_LENGTH_RESTRICTION ? single_length : range_length_min_length;
}
default:
throw new TtcnError("Operand of record of template concatenation is an uninitialized or unsupported template.");
}
}
protected int get_length_for_concat(final PREGEN__SET__OF__UNIVERSAL__CHARSTRING operand) {
operand.must_bound("Operand of record of template concatenation is an unbound value.");
return operand.valueElements.size();
}
protected int get_length_for_concat(final template_sel operand) {
if (operand == template_sel.ANY_VALUE) {
// ? => { * }
return 1;
}
throw new TtcnError("Operand of record of template concatenation is an uninitialized or unsupported template.");
}
//TODO: simplify, just use value_elements.add()
public void concat(final AtomicInteger pos, final PREGEN__SET__OF__UNIVERSAL__CHARSTRING_template operand) {
// all errors should have already been caught by the operand's
// get_length_for_concat() call;
// the result template (this) should already be set to SPECIFIC_VALUE and
// single_value.value_elements should already be allocated
switch (operand.template_selection) {
case SPECIFIC_VALUE:
for (int i = 0; i < operand.value_elements.size(); ++i) {
value_elements.set( pos.get() + i, new TitanUniversalCharString_template(operand.value_elements.get(i)) );
}
pos.addAndGet( operand.value_elements.size() );
break;
case ANY_VALUE:
case ANY_OR_OMIT:
switch (operand.length_restriction_type) {
case NO_LENGTH_RESTRICTION:
// ? => { * }
value_elements.set( pos.get(), new TitanUniversalCharString_template( template_sel.ANY_OR_OMIT ) );
pos.incrementAndGet();
break;
case RANGE_LENGTH_RESTRICTION:
case SINGLE_LENGTH_RESTRICTION: {
// ? length(N) or * length(N) => { ?, ?, ... ? } N times
final int N = operand.length_restriction_type == length_restriction_type_t.SINGLE_LENGTH_RESTRICTION ? operand.single_length : operand.range_length_min_length;
for (int i = 0; i < N; ++i) {
value_elements.set( pos.get() + i, new TitanUniversalCharString_template( template_sel.ANY_VALUE ) );
}
pos.addAndGet( N );
break; }
}
default:
break;
}
}
public void set_size(final int new_size) {
if (new_size < 0) {
throw new TtcnError("Internal error: Setting a negative size for a template of type @PreGenRecordOf.PREGEN_SET_OF_UNIVERSAL_CHARSTRING.");
......@@ -3402,35 +3213,6 @@ public final class PreGenRecordOf extends TTCN_Module {
throw new TtcnError("Performing n_elem() operation on an uninitialized/unsupported template of type PREGEN__SET__OF__UNIVERSAL__CHARSTRING.");
}
 
public boolean matchv(final PREGEN__SET__OF__UNIVERSAL__CHARSTRING other_value, final boolean legacy) {
if (!other_value.is_bound()) {
return false;
}
final int value_length = other_value.size_of().getInt();
if (!match_length(value_length)) {
return false;
}
switch (template_selection) {
case SPECIFIC_VALUE:
return RecordOf_Match.match_record_of(other_value, value_length, this, value_elements.size(), match_function_specific, legacy);
case OMIT_VALUE:
return false;
case ANY_VALUE:
case ANY_OR_OMIT:
return true;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (int list_count = 0; list_count < list_value.size(); list_count++) {
if (list_value.get(list_count).matchv(other_value, legacy)) {
return template_selection == template_sel.VALUE_LIST;
}
}
return template_selection == template_sel.COMPLEMENTED_LIST;
default:
throw new TtcnError("Matching with an uninitialized/unsupported template of type PREGEN__SET__OF__UNIVERSAL__CHARSTRING.");
}
}
@Override
public boolean is_value() {
if (template_selection != template_sel.SPECIFIC_VALUE || is_ifPresent) {
......@@ -4984,85 +4766,6 @@ public final class PreGenRecordOf extends TTCN_Module {
return constGet_at(index_value.getInt());
}
 
protected int get_length_for_concat(final AtomicBoolean is_any_value) {
switch (template_selection) {
case SPECIFIC_VALUE:
return value_elements.size();
case ANY_VALUE:
case ANY_OR_OMIT:
switch (length_restriction_type) {
case NO_LENGTH_RESTRICTION:
if (template_selection == template_sel.ANY_VALUE) {
// ? => { * }
is_any_value.set( true );
return 1;
}
throw new TtcnError("Operand of record of template concatenation is an AnyValueOrNone (*) matching mechanism with no length restriction");
case RANGE_LENGTH_RESTRICTION:
if (range_length_max_length == 0 || range_length_max_length != range_length_min_length) {
throw new TtcnError( MessageFormat.format( "Operand of record of template concatenation is an {0} matching mechanism with non-fixed length restriction", template_selection == template_sel.ANY_VALUE ? "AnyValue (?)" : "AnyValueOrNone (*)" ) );
}
// else fall through (range length restriction is allowed if the minimum
// and maximum value are the same)
case SINGLE_LENGTH_RESTRICTION:
// ? length(N) or * length(N) => { ?, ?, ... ? } N times
return length_restriction_type == length_restriction_type_t.SINGLE_LENGTH_RESTRICTION ? single_length : range_length_min_length;
}
default:
throw new TtcnError("Operand of record of template concatenation is an uninitialized or unsupported template.");
}
}
protected int get_length_for_concat(final PREGEN__RECORD__OF__OCTETSTRING__OPTIMIZED operand) {
operand.must_bound("Operand of record of template concatenation is an unbound value.");
return operand.valueElements.size();
}
protected int get_length_for_concat(final template_sel operand) {
if (operand == template_sel.ANY_VALUE) {
// ? => { * }
return 1;
}
throw new TtcnError("Operand of record of template concatenation is an uninitialized or unsupported template.");
}
//TODO: simplify, just use value_elements.add()
public void concat(final AtomicInteger pos, final PREGEN__RECORD__OF__OCTETSTRING__OPTIMIZED_template operand) {
// all errors should have already been caught by the operand's
// get_length_for_concat() call;
// the result template (this) should already be set to SPECIFIC_VALUE and
// single_value.value_elements should already be allocated
switch (operand.template_selection) {
case SPECIFIC_VALUE:
for (int i = 0; i < operand.value_elements.size(); ++i) {
value_elements.set( pos.get() + i, new TitanOctetString_template(operand.value_elements.get(i)) );
}
pos.addAndGet( operand.value_elements.size() );
break;
case ANY_VALUE:
case ANY_OR_OMIT:
switch (operand.length_restriction_type) {
case NO_LENGTH_RESTRICTION:
// ? => { * }
value_elements.set( pos.get(), new TitanOctetString_template( template_sel.ANY_OR_OMIT ) );
pos.incrementAndGet();
break;
case RANGE_LENGTH_RESTRICTION:
case SINGLE_LENGTH_RESTRICTION: {
// ? length(N) or * length(N) => { ?, ?, ... ? } N times
final int N = operand.length_restriction_type == length_restriction_type_t.SINGLE_LENGTH_RESTRICTION ? operand.single_length : operand.range_length_min_length;
for (int i = 0; i < N; ++i) {
value_elements.set( pos.get() + i, new TitanOctetString_template( template_sel.ANY_VALUE ) );
}
pos.addAndGet( N );
break; }
}
default:
break;
}
}
public void set_size(final int new_size) {
if (new_size < 0) {
throw new TtcnError("Internal error: Setting a negative size for a template of type @PreGenRecordOf.PREGEN_RECORD_OF_OCTETSTRING_OPTIMIZED.");
......@@ -5194,35 +4897,6 @@ public final class PreGenRecordOf extends TTCN_Module {
throw new TtcnError("Performing n_elem() operation on an uninitialized/unsupported template of type PREGEN__RECORD__OF__OCTETSTRING__OPTIMIZED.");
}
 
public boolean matchv(final PREGEN__RECORD__OF__OCTETSTRING__OPTIMIZED other_value, final boolean legacy) {
if (!other_value.is_bound()) {
return false;
}
final int value_length = other_value.size_of().getInt();
if (!match_length(value_length)) {
return false;
}
switch (template_selection) {
case SPECIFIC_VALUE:
return RecordOf_Match.match_record_of(other_value, value_length, this, value_elements.size(), match_function_specific, legacy);
case OMIT_VALUE:
return false;
case ANY_VALUE:
case ANY_OR_OMIT:
return true;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (int list_count = 0; list_count < list_value.size(); list_count++) {
if (list_value.get(list_count).matchv(other_value, legacy)) {
return template_selection == template_sel.VALUE_LIST;
}
}
return template_selection == template_sel.COMPLEMENTED_LIST;
default:
throw new TtcnError("Matching with an uninitialized/unsupported template of type PREGEN__RECORD__OF__OCTETSTRING__OPTIMIZED.");
}
}
@Override
public boolean is_value() {
if (template_selection != template_sel.SPECIFIC_VALUE || is_ifPresent) {
......@@ -6786,85 +6460,6 @@ public final class PreGenRecordOf extends TTCN_Module {
return constGet_at(index_value.getInt());
}
 
protected int get_length_for_concat(final AtomicBoolean is_any_value) {
switch (template_selection) {
case SPECIFIC_VALUE:
return value_elements.size();
case ANY_VALUE:
case ANY_OR_OMIT:
switch (length_restriction_type) {
case NO_LENGTH_RESTRICTION:
if (template_selection == template_sel.ANY_VALUE) {
// ? => { * }
is_any_value.set( true );
return 1;
}
throw new TtcnError("Operand of record of template concatenation is an AnyValueOrNone (*) matching mechanism with no length restriction");
case RANGE_LENGTH_RESTRICTION:
if (range_length_max_length == 0 || range_length_max_length != range_length_min_length) {
throw new TtcnError( MessageFormat.format( "Operand of record of template concatenation is an {0} matching mechanism with non-fixed length restriction", template_selection == template_sel.ANY_VALUE ? "AnyValue (?)" : "AnyValueOrNone (*)" ) );
}
// else fall through (range length restriction is allowed if the minimum
// and maximum value are the same)
case SINGLE_LENGTH_RESTRICTION:
// ? length(N) or * length(N) => { ?, ?, ... ? } N times
return length_restriction_type == length_restriction_type_t.SINGLE_LENGTH_RESTRICTION ? single_length : range_length_min_length;
}
default:
throw new TtcnError("Operand of record of template concatenation is an uninitialized or unsupported template.");
}
}
protected int get_length_for_concat(final PREGEN__RECORD__OF__FLOAT operand) {
operand.must_bound("Operand of record of template concatenation is an unbound value.");
return operand.valueElements.size();
}
protected int get_length_for_concat(final template_sel operand) {
if (operand == template_sel.ANY_VALUE) {
// ? => { * }
return 1;
}
throw new TtcnError("Operand of record of template concatenation is an uninitialized or unsupported template.");
}
//TODO: simplify, just use value_elements.add()
public void concat(final AtomicInteger pos, final PREGEN__RECORD__OF__FLOAT_template operand) {
// all errors should have already been caught by the operand's
// get_length_for_concat() call;
// the result template (this) should already be set to SPECIFIC_VALUE and
// single_value.value_elements should already be allocated
switch (operand.template_selection) {
case SPECIFIC_VALUE:
for (int i = 0; i < operand.value_elements.size(); ++i) {
value_elements.set( pos.get() + i, new TitanFloat_template(operand.value_elements.get(i)) );
}
pos.addAndGet( operand.value_elements.size() );
break;
case ANY_VALUE:
case ANY_OR_OMIT:
switch (operand.length_restriction_type) {
case NO_LENGTH_RESTRICTION:
// ? => { * }
value_elements.set( pos.get(), new TitanFloat_template( template_sel.ANY_OR_OMIT ) );
pos.incrementAndGet();
break;
case RANGE_LENGTH_RESTRICTION:
case SINGLE_LENGTH_RESTRICTION: {
// ? length(N) or * length(N) => { ?, ?, ... ? } N times
final int N = operand.length_restriction_type == length_restriction_type_t.SINGLE_LENGTH_RESTRICTION ? operand.single_length : operand.range_length_min_length;
for (int i = 0; i < N; ++i) {
value_elements.set( pos.get() + i, new TitanFloat_template( template_sel.ANY_VALUE ) );
}
pos.addAndGet( N );
break; }
}
default:
break;
}
}
public void set_size(final int new_size) {
if (new_size < 0) {
throw new TtcnError("Internal error: Setting a negative size for a template of type @PreGenRecordOf.PREGEN_RECORD_OF_FLOAT.");
......@@ -6996,35 +6591,6 @@ public final class PreGenRecordOf extends TTCN_Module {
throw new TtcnError("Performing n_elem() operation on an uninitialized/unsupported template of type PREGEN__RECORD__OF__FLOAT.");
}
 
public boolean matchv(final PREGEN__RECORD__OF__FLOAT other_value, final boolean legacy) {
if (!other_value.is_bound()) {
return false;
}
final int value_length = other_value.size_of().getInt();
if (!match_length(value_length)) {
return false;
}
switch (template_selection) {
case SPECIFIC_VALUE:
return RecordOf_Match.match_record_of(other_value, value_length, this, value_elements.size(), match_function_specific, legacy);
case OMIT_VALUE:
return false;
case ANY_VALUE:
case ANY_OR_OMIT:
return true;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (int list_count = 0; list_count < list_value.size(); list_count++) {
if (list_value.get(list_count).matchv(other_value, legacy)) {
return template_selection == template_sel.VALUE_LIST;
}
}
return template_selection == template_sel.COMPLEMENTED_LIST;
default:
throw new TtcnError("Matching with an uninitialized/unsupported template of type PREGEN__RECORD__OF__FLOAT.");
}
}
@Override
public boolean is_value() {
if (template_selection != template_sel.SPECIFIC_VALUE || is_ifPresent) {
......@@ -8588,85 +8154,6 @@ public final class PreGenRecordOf extends TTCN_Module {
return constGet_at(index_value.getInt());
}
 
protected int get_length_for_concat(final AtomicBoolean is_any_value) {
switch (template_selection) {
case SPECIFIC_VALUE:
return value_elements.size();
case ANY_VALUE:
case ANY_OR_OMIT:
switch (length_restriction_type) {
case NO_LENGTH_RESTRICTION:
if (template_selection == template_sel.ANY_VALUE) {
// ? => { * }
is_any_value.set( true );
return 1;
}
throw new TtcnError("Operand of record of template concatenation is an AnyValueOrNone (*) matching mechanism with no length restriction");
case RANGE_LENGTH_RESTRICTION:
if (range_length_max_length == 0 || range_length_max_length != range_length_min_length) {
throw new TtcnError( MessageFormat.format( "Operand of record of template concatenation is an {0} matching mechanism with non-fixed length restriction", template_selection == template_sel.ANY_VALUE ? "AnyValue (?)" : "AnyValueOrNone (*)" ) );
}
// else fall through (range length restriction is allowed if the minimum
// and maximum value are the same)
case SINGLE_LENGTH_RESTRICTION:
// ? length(N) or * length(N) => { ?, ?, ... ? } N times
return length_restriction_type == length_restriction_type_t.SINGLE_LENGTH_RESTRICTION ? single_length : range_length_min_length;
}
default:
throw new TtcnError("Operand of record of template concatenation is an uninitialized or unsupported template.");
}
}
protected int get_length_for_concat(final PREGEN__RECORD__OF__UNIVERSAL__CHARSTRING operand) {
operand.must_bound("Operand of record of template concatenation is an unbound value.");
return operand.valueElements.size();
}
protected int get_length_for_concat(final template_sel operand) {
if (operand == template_sel.ANY_VALUE) {
// ? => { * }
return 1;
}
throw new TtcnError("Operand of record of template concatenation is an uninitialized or unsupported template.");
}
//TODO: simplify, just use value_elements.add()
public void concat(final AtomicInteger pos, final PREGEN__RECORD__OF__UNIVERSAL__CHARSTRING_template operand) {
// all errors should have already been caught by the operand's
// get_length_for_concat() call;
// the result template (this) should already be set to SPECIFIC_VALUE and
// single_value.value_elements should already be allocated
switch (operand.template_selection) {
case SPECIFIC_VALUE:
for (int i = 0; i < operand.value_elements.size(); ++i) {
value_elements.set( pos.get() + i, new TitanUniversalCharString_template(operand.value_elements.get(i)) );
}
pos.addAndGet( operand.value_elements.size() );
break;
case ANY_VALUE:
case ANY_OR_OMIT:
switch (operand.length_restriction_type) {
case NO_LENGTH_RESTRICTION:
// ? => { * }
value_elements.set( pos.get(), new TitanUniversalCharString_template( template_sel.ANY_OR_OMIT ) );
pos.incrementAndGet();
break;
case RANGE_LENGTH_RESTRICTION:
case SINGLE_LENGTH_RESTRICTION: {
// ? length(N) or * length(N) => { ?, ?, ... ? } N times
final int N = operand.length_restriction_type == length_restriction_type_t.SINGLE_LENGTH_RESTRICTION ? operand.single_length : operand.range_length_min_length;
for (int i = 0; i < N; ++i) {
value_elements.set( pos.get() + i, new TitanUniversalCharString_template( template_sel.ANY_VALUE ) );
}
pos.addAndGet( N );
break; }
}
default:
break;
}
}
public void set_size(final int new_size) {
if (new_size < 0) {
throw new TtcnError("Internal error: Setting a negative size for a template of type @PreGenRecordOf.PREGEN_RECORD_OF_UNIVERSAL_CHARSTRING.");
......@@ -8798,35 +8285,6 @@ public final class PreGenRecordOf extends TTCN_Module {
throw new TtcnError("Performing n_elem() operation on an uninitialized/unsupported template of type PREGEN__RECORD__OF__UNIVERSAL__CHARSTRING.");
}
 
public boolean matchv(final PREGEN__RECORD__OF__UNIVERSAL__CHARSTRING other_value, final boolean legacy) {
if (!other_value.is_bound()) {
return false;
}
final int value_length = other_value.size_of().getInt();
if (!match_length(value_length)) {
return false;
}
switch (template_selection) {
case SPECIFIC_VALUE:
return RecordOf_Match.match_record_of(other_value, value_length, this, value_elements.size(), match_function_specific, legacy);
case OMIT_VALUE:
return false;
case ANY_VALUE:
case ANY_OR_OMIT:
return true;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (int list_count = 0; list_count < list_value.size(); list_count++) {
if (list_value.get(list_count).matchv(other_value, legacy)) {
return template_selection == template_sel.VALUE_LIST;
}
}
return template_selection == template_sel.COMPLEMENTED_LIST;
default:
throw new TtcnError("Matching with an uninitialized/unsupported template of type PREGEN__RECORD__OF__UNIVERSAL__CHARSTRING.");