Commit 82f5df08 authored by Botond Baranyi's avatar Botond Baranyi
Browse files

Changed the product number to a new format


Signed-off-by: Botond Baranyi's avatarBotond Baranyi <botond.baranyi@ericsson.com>
Change-Id: I4fd6172e2bbb790356ff90fc960fdd95927c0429
Signed-off-by: Botond Baranyi's avatarBotond Baranyi <botond.baranyi@ericsson.com>
parent 854410e4
......@@ -41,85 +41,89 @@
#endif
/* Product number */
#define PRODNR_EXECUTOR "CRL 113 200"
#define PRODNR_EXECUTOR "CAX 105 7730"
#define LEGACY_PRODNR_EXECUTOR "CRL 113 200"
/* Ericsson revision: /m Rnx
/* Ericsson (legacy) revision: /m Rnx
* m = TTCN3_MAJOR
* n = TTCN3_MINOR
* x = 'A' + TTCN3_PATCHLEVEL
* Example: 1.4.pl3 = R4D */
#define GEN_ERICSSON_SUFFIX2(num) #num
#define GEN_ERICSSON_SUFFIX(num) GEN_ERICSSON_SUFFIX2(num)
#define ERICSSON_SUFFIX GEN_ERICSSON_SUFFIX(TTCN3_MAJOR)
#define GEN_SUFFIX2(num) #num
#define GEN_SUFFIX(num) GEN_SUFFIX2(num)
#define MAJOR_SUFFIX GEN_SUFFIX(TTCN3_MAJOR)
#define GEN_ERICSSON_NUMBER2(num) #num
#define GEN_ERICSSON_NUMBER(num) GEN_ERICSSON_NUMBER2(num)
#define ERICSSON_NUMBER GEN_ERICSSON_NUMBER(TTCN3_MINOR)
#define GEN_NUMBER2(num) #num
#define GEN_NUMBER(num) GEN_NUMBER2(num)
#define MINOR_NUMBER GEN_NUMBER(TTCN3_MINOR)
#if TTCN3_PATCHLEVEL == 0
#define ERICSSON_LETTER "A"
#define PATCH_LETTER "A"
#elif TTCN3_PATCHLEVEL == 1
#define ERICSSON_LETTER "B"
#define PATCH_LETTER "B"
#elif TTCN3_PATCHLEVEL == 2
#define ERICSSON_LETTER "C"
#define PATCH_LETTER "C"
#elif TTCN3_PATCHLEVEL == 3
#define ERICSSON_LETTER "D"
#define PATCH_LETTER "D"
#elif TTCN3_PATCHLEVEL == 4
#define ERICSSON_LETTER "E"
#define PATCH_LETTER "E"
#elif TTCN3_PATCHLEVEL == 5
#define ERICSSON_LETTER "F"
#define PATCH_LETTER "F"
#elif TTCN3_PATCHLEVEL == 6
#define ERICSSON_LETTER "G"
#define PATCH_LETTER "G"
#elif TTCN3_PATCHLEVEL == 7
#define ERICSSON_LETTER "H"
#define PATCH_LETTER "H"
#elif TTCN3_PATCHLEVEL == 8
/* I: forbidden */
#define ERICSSON_LETTER "J"
#define PATCH_LETTER "J"
#elif TTCN3_PATCHLEVEL == 9
#define ERICSSON_LETTER "K"
#define PATCH_LETTER "K"
#elif TTCN3_PATCHLEVEL == 10
#define ERICSSON_LETTER "L"
#define PATCH_LETTER "L"
#elif TTCN3_PATCHLEVEL == 11
#define ERICSSON_LETTER "M"
#define PATCH_LETTER "M"
#elif TTCN3_PATCHLEVEL == 12
#define ERICSSON_LETTER "N"
#define PATCH_LETTER "N"
/* O, P, Q, R: forbidden */
#elif TTCN3_PATCHLEVEL == 13
#define ERICSSON_LETTER "S"
#define PATCH_LETTER "S"
#elif TTCN3_PATCHLEVEL == 14
#define ERICSSON_LETTER "T"
#define PATCH_LETTER "T"
#elif TTCN3_PATCHLEVEL == 15
#define ERICSSON_LETTER "U"
#define PATCH_LETTER "U"
#elif TTCN3_PATCHLEVEL == 16
#define ERICSSON_LETTER "V"
#define PATCH_LETTER "V"
#elif TTCN3_PATCHLEVEL == 17
/* W: forbidden */
#define ERICSSON_LETTER "X"
#define PATCH_LETTER "X"
#elif TTCN3_PATCHLEVEL == 18
#define ERICSSON_LETTER "Y"
#define PATCH_LETTER "Y"
#elif TTCN3_PATCHLEVEL == 19
#define ERICSSON_LETTER "Z"
#define PATCH_LETTER "Z"
#else
#error "Ericsson revision letter is not defined."
#error "Patch-level revision letter is not defined."
#endif
#ifdef TTCN3_BUILDNUMBER
/* The Ericsson version is suffixed with the build number (at least 2 digits)
* in preliminary releases (like this: "R6E01") */
# if TTCN3_BUILDNUMBER < 10
# define ERICSSON_BUILDNUMBER "0" GEN_ERICSSON_NUMBER(TTCN3_BUILDNUMBER)
# define DOUBLEDIGIT_BUILDNUMBER "0" GEN_NUMBER(TTCN3_BUILDNUMBER)
# else
# define ERICSSON_BUILDNUMBER GEN_ERICSSON_NUMBER(TTCN3_BUILDNUMBER)
# define DOUBLEDIGIT_BUILDNUMBER GEN_NUMBER(TTCN3_BUILDNUMBER)
# endif
#else
# define ERICSSON_BUILDNUMBER
# define DOUBLEDIGIT_BUILDNUMBER
#endif
#define ERICSSON_VERSION "/" ERICSSON_SUFFIX " R" ERICSSON_NUMBER ERICSSON_LETTER \
ERICSSON_BUILDNUMBER
#define LEGACY_VERSION "/" MAJOR_SUFFIX " R" MINOR_NUMBER PATCH_LETTER \
DOUBLEDIGIT_BUILDNUMBER
#define PRODUCT_NUMBER PRODNR_EXECUTOR ERICSSON_VERSION
#define LEGACY_PRODUCT_NUMBER LEGACY_PRODNR_EXECUTOR LEGACY_VERSION
#define PRODUCT_NUMBER MAJOR_SUFFIX "/" PRODNR_EXECUTOR " R" MINOR_NUMBER PATCH_LETTER \
DOUBLEDIGIT_BUILDNUMBER
/* Version of the C/C++ compiler */
......
......@@ -1319,7 +1319,7 @@ namespace Common {
control_ns_prefix(p_mt == MOD_ASN ? mcopystr("asn1") : NULL),
// only ASN.1 modules have default control namespace (X.693 amd1, 16.9)
used_namespaces(), type_conv_v(), product_number(NULL),
suffix(0), release(UINT_MAX), patch(UINT_MAX), build(UINT_MAX), extra(NULL)
suffix(0), release(UINT_MAX), patch(UINT_MAX), build(UINT_MAX), extra(NULL), legacy_version(TUNKNOWN)
{
if(!p_modid)
FATAL_ERROR("NULL parameter: Common::Module::Module()");
......@@ -1481,7 +1481,7 @@ namespace Common {
if (release <= 999999 && patch < 30 && build < 100) {
char *product_identifier =
get_product_identifier(product_number, suffix, release, patch, build, extra);
get_product_identifier(product_number, suffix, release, patch, build, extra, legacy_version);
fprintf(stderr, " %s", product_identifier);
Free(product_identifier);
}
......@@ -1491,7 +1491,7 @@ namespace Common {
char* Module::get_product_identifier(const char* product_number,
const unsigned int suffix, unsigned int release, unsigned int patch,
unsigned int build, const char* extra)
unsigned int build, const char* extra, tribool legacy)
{
expstring_t ret_val = memptystr();
if ( product_number == NULL
......@@ -1503,8 +1503,11 @@ namespace Common {
return ret_val;
}
if (product_number != NULL) {
if (legacy != TTRUE && suffix != 0) {
ret_val = mputprintf(ret_val, "%d/", suffix);
}
ret_val = mputstr(ret_val, product_number);
if (suffix != 0) {
if (legacy == TTRUE && suffix != 0) {
ret_val = mputprintf(ret_val, "/%d", suffix);
}
ret_val = mputc(ret_val, ' ');
......
......@@ -253,6 +253,7 @@ namespace Common {
unsigned int patch;
unsigned int build;
char* extra;
tribool legacy_version;
/** @} */
friend class Ttcn::Module;
......@@ -368,7 +369,7 @@ namespace Common {
void write_checksum();
static char* get_product_identifier(const char* product_number,
const unsigned int suffix, unsigned int release, unsigned int patch,
unsigned int build, const char* extra=NULL);
unsigned int build, const char* extra=NULL, tribool legacy = TUNKNOWN);
ModuleVersion getVersion() const;
protected: // *::Module need access
/** Collects the set of visible modules into \a visible_mods. */
......
......@@ -2910,7 +2910,8 @@ namespace Ttcn {
char* act_product_number;
unsigned int act_suffix, act_rel, act_patch, act_build;
char* extra_junk;
(void)ex.get_id(act_product_number, act_suffix, act_rel, act_patch, act_build, extra_junk);
tribool legacy;
(void)ex.get_id(act_product_number, act_suffix, act_rel, act_patch, act_build, extra_junk, legacy);
if (release != UINT_MAX) {
ex.error("Duplicate 'version' attribute");
......@@ -2922,6 +2923,7 @@ namespace Ttcn {
patch = act_patch;
build = act_build;
extra = mcopystr(extra_junk);
legacy_version = legacy;
}
// Avoid propagating the attribute needlessly
multi->delete_element(i--);
......@@ -2933,8 +2935,9 @@ namespace Ttcn {
char* exp_product_number;
unsigned int exp_suffix, exp_rel, exp_patch, exp_build;
char* exp_extra;
tribool legacy;
Common::Identifier *req_id = ex.get_id(exp_product_number,
exp_suffix, exp_rel, exp_patch, exp_build, exp_extra);
exp_suffix, exp_rel, exp_patch, exp_build, exp_extra, legacy);
// We own req_id
if (imp->has_impmod_withId(*req_id)) {
Common::Module* m = modules->get_mod_byId(*req_id);
......@@ -2952,33 +2955,46 @@ namespace Ttcn {
", while it specifies '%s'",
this->modid->get_dispname().c_str(),
req_id->get_dispname().c_str(), m->product_number);
} else if (m->product_number != NULL && exp_product_number != NULL
&& 0 != strcmp(m->product_number, exp_product_number)) {
char *req_product_identifier =
get_product_identifier(exp_product_number,
exp_suffix, exp_rel, exp_patch, exp_build);
char *mod_product_identifier =
get_product_identifier(m->product_number,
m->suffix, m->release, m->patch, m->build);
ex.error("Module '%s' requires version %s of module"
" '%s', but only %s is available",
this->modid->get_dispname().c_str(), req_product_identifier,
req_id->get_dispname().c_str(), mod_product_identifier);
Free(req_product_identifier);
Free(mod_product_identifier);
multi->delete_element(i--);
single = 0;
break;
} else if (m->product_number != NULL && exp_product_number != NULL) {
bool prod_match = false;
if (legacy == m->legacy_version || (legacy != TFALSE && m->legacy_version != TFALSE)) {
prod_match = (0 == strcmp(m->product_number, exp_product_number));
}
else if (legacy == TTRUE && m->legacy_version == TFALSE) {
prod_match = (0 == strcmp(exp_product_number, LEGACY_PRODNR_EXECUTOR) &&
0 == strcmp(m->product_number, PRODNR_EXECUTOR));
}
else if (legacy == TFALSE && m->legacy_version == TTRUE) {
prod_match = (0 == strcmp(exp_product_number, PRODNR_EXECUTOR) &&
0 == strcmp(m->product_number, LEGACY_PRODNR_EXECUTOR));
}
if (!prod_match) {
char *req_product_identifier =
get_product_identifier(exp_product_number,
exp_suffix, exp_rel, exp_patch, exp_build, NULL, legacy);
char *mod_product_identifier =
get_product_identifier(m->product_number,
m->suffix, m->release, m->patch, m->build, NULL, m->legacy_version);
ex.error("Module '%s' requires version %s of module"
" '%s', but only %s is available",
this->modid->get_dispname().c_str(), req_product_identifier,
req_id->get_dispname().c_str(), mod_product_identifier);
Free(req_product_identifier);
Free(mod_product_identifier);
multi->delete_element(i--);
single = 0;
break;
}
}
// different suffixes are always incompatible
// unless the special version number is used
if (m->suffix != exp_suffix && (m->suffix != UINT_MAX)) {
char *req_product_identifier =
get_product_identifier(exp_product_number,exp_suffix, exp_rel, exp_patch, exp_build);
get_product_identifier(exp_product_number,exp_suffix, exp_rel, exp_patch, exp_build, NULL, legacy);
char *mod_product_identifier =
get_product_identifier(m->product_number,
m->suffix, m->release, m->patch, m->build);
m->suffix, m->release, m->patch, m->build, NULL, m->legacy_version);
ex.error("Module '%s' requires version %s of module"
" '%s', but only %s is available",
......@@ -3018,8 +3034,10 @@ namespace Ttcn {
char* exp_product_number;
unsigned int exp_suffix, exp_minor, exp_patch, exp_build;
char* exp_extra;
(void)ex.get_id(exp_product_number, exp_suffix, exp_minor, exp_patch, exp_build, exp_extra);
if (exp_product_number != NULL && strcmp(exp_product_number,"CRL 113 200") != 0) {
tribool legacy;
(void)ex.get_id(exp_product_number, exp_suffix, exp_minor, exp_patch, exp_build, exp_extra, legacy);
if (exp_product_number != NULL && ((legacy != TTRUE && strcmp(exp_product_number, PRODNR_EXECUTOR) != 0) ||
(legacy == TTRUE && strcmp(exp_product_number, LEGACY_PRODNR_EXECUTOR) != 0))) {
ex.error("This module needs to be compiled with TITAN, but "
" product number %s is not TITAN"
, exp_product_number);
......@@ -3032,10 +3050,10 @@ namespace Ttcn {
+ exp_minor * 10000 + exp_patch * 100 + exp_build;
if (expected_version > TTCN3_VERSION_MONOTONE) {
char *exp_product_identifier =
get_product_identifier(exp_product_number, exp_suffix, exp_minor, exp_patch, exp_build);
get_product_identifier(exp_product_number, exp_suffix, exp_minor, exp_patch, exp_build, NULL, legacy);
ex.error("This module needs to be compiled with TITAN version"
" %s or higher; version %s detected"
, exp_product_identifier, PRODUCT_NUMBER);
, exp_product_identifier, legacy == TTRUE ? LEGACY_PRODUCT_NUMBER : PRODUCT_NUMBER);
Free(exp_product_identifier);
}
multi->delete_element(i--);
......
......@@ -2720,11 +2720,12 @@ namespace Ttcn {
}
ExtensionAttribute::ExtensionAttribute(const char* ABCClass, int type_number,
int sequence, int suffix, Identifier *ver)
int sequence, int suffix, Identifier *ver, tribool legacy)
: Location(), type_(VERSION), value_()
{
if (ver == NULL) FATAL_ERROR("ExtensionAttribute::ExtensionAttribute()");
value_.version_.module_ = NULL;
value_.version_.legacy_ = legacy;
check_product_number(ABCClass, type_number, sequence);
parse_version(ver);
......@@ -2737,13 +2738,14 @@ namespace Ttcn {
}
ExtensionAttribute::ExtensionAttribute(Identifier *mod, const char* ABCClass,
int type_number, int sequence, int suffix, Identifier *ver)
int type_number, int sequence, int suffix, Identifier *ver, tribool legacy)
: Location(), type_(REQUIRES), value_()
{
if (mod == NULL || ver == NULL)
FATAL_ERROR("ExtensionAttribute::ExtensionAttribute()");
// store the module identifier
value_.version_.module_ = mod;
value_.version_.legacy_ = legacy;
check_product_number(ABCClass, type_number, sequence);
parse_version(ver);
......@@ -2759,10 +2761,11 @@ namespace Ttcn {
}
ExtensionAttribute::ExtensionAttribute(const char* ABCClass, int type_number,
int sequence, int suffix, Identifier* ver, extension_t et)
int sequence, int suffix, Identifier* ver, extension_t et, tribool legacy)
: Location(), type_(et), value_()
{
if (ver == NULL) FATAL_ERROR("ExtensionAttribute::ExtensionAttribute()");
value_.version_.legacy_ = legacy;
switch (et) {
case REQ_TITAN:
......@@ -2936,7 +2939,7 @@ namespace Ttcn {
//FIXME ot is update -elni kell.
Common::Identifier *ExtensionAttribute::get_id(
char*& product_number, unsigned int& suffix,
unsigned int& rel, unsigned int& patch, unsigned int& bld, char*& extra)
unsigned int& rel, unsigned int& patch, unsigned int& bld, char*& extra, tribool& legacy)
{
if ( type_ != REQUIRES && type_ != REQ_TITAN
&& type_ != VERSION && type_ != VERSION_TEMPLATE) {
......@@ -2948,6 +2951,7 @@ namespace Ttcn {
patch = value_.version_.patch_;
bld = value_.version_.build_;
extra = value_.version_.extra_;
legacy = value_.version_.legacy_;
return value_.version_.module_;
}
......
......@@ -595,7 +595,7 @@ public:
* becomes responsible for \p ver, otherwise the caller has to free it.
*/
ExtensionAttribute(const char* ABCClass, int type_number, int sequence,
int suffix, Identifier *ver);
int suffix, Identifier *ver, tribool legacy);
/** Constructor for the REQUIRES type
*
......@@ -608,7 +608,7 @@ public:
* If unsuccessful, freeing the identifiers remains the caller's duty.
*/
ExtensionAttribute(Identifier *mod, const char* ABCClass, int type_number,
int sequence, int suffix, Identifier *ver);
int sequence, int suffix, Identifier *ver, tribool legacy);
/** Constructor for the REQ_TITAN type or the VERSION_TEMPLATE type
*
......@@ -621,7 +621,7 @@ public:
* becomes responsible for \p ver, otherwise the caller has to free it.
*/
ExtensionAttribute(const char* ABCClass, int type_number, int sequence,
int suffix, Identifier* ver, extension_t et);
int suffix, Identifier* ver, extension_t et, tribool legacy);
~ExtensionAttribute();
......@@ -687,7 +687,7 @@ public:
* @return pointer to the identifier of the module; the caller must not free
*/
Common::Identifier *get_id(char*& product_number, unsigned int& suffix,
unsigned int& rel, unsigned int& patch, unsigned int& bld, char*& extra);
unsigned int& rel, unsigned int& patch, unsigned int& bld, char*& extra, tribool& legacy);
/// @}
private:
/// Attribute type.
......@@ -715,12 +715,13 @@ private:
Types *anytypes_;
struct {
Common::Identifier *module_;
char* productNumber_; ///< "CRL 113 200"
char* productNumber_; ///< "CRL 113 200" for legacy versions, "CAX 105 7730" for current versions
unsigned int suffix_; ///< The "/3"
unsigned int release_;///< release
unsigned int patch_; ///< patch
unsigned int build_; ///< build number
char* extra_; ///< extra junk at the end, for titansim
tribool legacy_; ///< 'true' for legacy versions, 'false' for current versions, or 'unknown'
} version_;
PrintingType *pt_;
} value_;
......
......@@ -305,7 +305,7 @@ ExtensionAttribute:
VersionAttribute:
VersionKeyword IDentifier
{ // version R2D2
$$ = new ExtensionAttribute(NULL, 0, 0, 0, $2); // VERSION
$$ = new ExtensionAttribute(NULL, 0, 0, 0, $2, TUNKNOWN); // VERSION
$$->set_location(coding_attrib_infile, @$);
if ($$->get_type() == ExtensionAttribute::NONE) {
$$->error("Incorrect version data '%s'", $2->get_name().c_str());
......@@ -316,7 +316,7 @@ VersionKeyword IDentifier
}
| VersionKeyword '<' IDentifier '>'
{ // version <RnXnn>
$$ = new ExtensionAttribute(NULL, 0, 0, 0, $3, ExtensionAttribute::VERSION_TEMPLATE);
$$ = new ExtensionAttribute(NULL, 0, 0, 0, $3, ExtensionAttribute::VERSION_TEMPLATE, TTRUE);
$$->set_location(coding_attrib_infile, @$);
if ($$->get_type() == ExtensionAttribute::NONE) {
$$->error("Incorrect version template '<%s>'", $3->get_name().c_str());
......@@ -327,7 +327,7 @@ VersionKeyword IDentifier
}
| VersionKeyword IDentifier Number Number IDentifier
{ // version CNL 113 200 R2D2
$$ = new ExtensionAttribute($2->get_dispname().c_str(), $3, $4, 0, $5); // VERSION
$$ = new ExtensionAttribute($2->get_dispname().c_str(), $3, $4, 0, $5, TUNKNOWN); // VERSION
$$->set_location(coding_attrib_infile, @$);
if ($$->get_type() == ExtensionAttribute::NONE) {
$$->error("Incorrect version data '%s %d %d %s'",
......@@ -340,7 +340,7 @@ VersionKeyword IDentifier
}
| VersionKeyword IDentifier Number Number '<' IDentifier '>'
{ // version CNL 113 200 <RnXnn>
$$ = new ExtensionAttribute($2->get_dispname().c_str(), $3, $4, 0, $6, ExtensionAttribute::VERSION_TEMPLATE); // VERSION
$$ = new ExtensionAttribute($2->get_dispname().c_str(), $3, $4, 0, $6, ExtensionAttribute::VERSION_TEMPLATE, TTRUE); // VERSION
$$->set_location(coding_attrib_infile, @$);
if ($$->get_type() == ExtensionAttribute::NONE) {
$$->error("Incorrect version data '%s %d %d <%s>'",
......@@ -353,7 +353,7 @@ VersionKeyword IDentifier
}
| VersionKeyword IDentifier Number Number '/' Number IDentifier
{ // version CNL 113 200 / 1 R2D2
$$ = new ExtensionAttribute($2->get_dispname().c_str(), $3, $4, $6, $7); // VERSION
$$ = new ExtensionAttribute($2->get_dispname().c_str(), $3, $4, $6, $7, TTRUE); // VERSION
$$->set_location(coding_attrib_infile, @$);
if ($$->get_type() == ExtensionAttribute::NONE) {
$$->error("Incorrect version data '%s %d %d / %d %s'",
......@@ -364,9 +364,22 @@ VersionKeyword IDentifier
}
delete $2;
}
| VersionKeyword Number '/' IDentifier Number Number IDentifier
{ // version 1 / CAX 105 7730 R2D2
$$ = new ExtensionAttribute($4->get_dispname().c_str(), $5, $6, $2, $7, TFALSE); // VERSION
$$->set_location(coding_attrib_infile, @$);
if ($$->get_type() == ExtensionAttribute::NONE) {
$$->error("Incorrect version data '%d / %s %d %d %s'",
$2, $4->get_dispname().c_str(), $5, $6, $7->get_dispname().c_str());
delete $7;
delete $$;
$$ = NULL;
}
delete $4;
}
| VersionKeyword IDentifier Number Number '/' Number '<' IDentifier '>'
{ // version CNL 113 200 / 1 <RnXnn>
$$ = new ExtensionAttribute($2->get_dispname().c_str(), $3, $4, $6, $8, ExtensionAttribute::VERSION_TEMPLATE); // VERSION
$$ = new ExtensionAttribute($2->get_dispname().c_str(), $3, $4, $6, $8, ExtensionAttribute::VERSION_TEMPLATE, TTRUE); // VERSION
$$->set_location(coding_attrib_infile, @$);
if ($$->get_type() == ExtensionAttribute::NONE) {
$$->error("Incorrect version data '%s %d %d / %d <%s>'",
......@@ -382,7 +395,7 @@ VersionKeyword IDentifier
RequiresAttribute:
RequiresKeyword IDentifier IDentifier
{ // module R1B
$$ = new ExtensionAttribute($2, NULL, 0, 0, 0, $3); // REQUIRES
$$ = new ExtensionAttribute($2, NULL, 0, 0, 0, $3, TUNKNOWN); // REQUIRES
$$->set_location(coding_attrib_infile, @$);
if ($$->get_type() == ExtensionAttribute::NONE) {
/* parsing the version has failed */
......@@ -395,7 +408,7 @@ RequiresKeyword IDentifier IDentifier
}
| RequiresKeyword IDentifier IDentifier Number Number IDentifier
{ // module CNL xxx xxx R1A
$$ = new ExtensionAttribute($2, $3->get_dispname().c_str(), $4, $5, 0, $6); // REQUIRES
$$ = new ExtensionAttribute($2, $3->get_dispname().c_str(), $4, $5, 0, $6, TUNKNOWN); // REQUIRES
$$->set_location(coding_attrib_infile, @$);
if ($$->get_type() == ExtensionAttribute::NONE) {
$$->error("Incorrect version data '%s %d %d %s'",
......@@ -409,7 +422,7 @@ RequiresKeyword IDentifier IDentifier
}
| RequiresKeyword IDentifier IDentifier Number Number '/' Number IDentifier
{ // module CNL xxx xxx / 1 R9A
$$ = new ExtensionAttribute($2, $3->get_dispname().c_str(), $4, $5, $7, $8); // REQUIRES
$$ = new ExtensionAttribute($2, $3->get_dispname().c_str(), $4, $5, $7, $8, TTRUE); // REQUIRES
$$->set_location(coding_attrib_infile, @$);
if ($$->get_type() == ExtensionAttribute::NONE) {
$$->error("Incorrect version data '%s %d %d / %d %s'",
......@@ -421,9 +434,23 @@ RequiresKeyword IDentifier IDentifier
}
delete $3;
}
| RequiresKeyword IDentifier Number '/' IDentifier Number Number IDentifier
{ // module 1 / CAX xxx xxx R9A
$$ = new ExtensionAttribute($2, $5->get_dispname().c_str(), $6, $7, $3, $8, TFALSE); // REQUIRES
$$->set_location(coding_attrib_infile, @$);
if ($$->get_type() == ExtensionAttribute::NONE) {
$$->error("Incorrect version data '%d / %s %d %d %s'",
$3, $5->get_dispname().c_str(), $6, $7, $8->get_dispname().c_str());
delete $2;
delete $8;
delete $$;
$$ = NULL;
}
delete $5;
}
| ReqTitanKeyword IDentifier
{ // R1A
$$ = new ExtensionAttribute(NULL, 0, 0, 0, $2, ExtensionAttribute::REQ_TITAN);
$$ = new ExtensionAttribute(NULL, 0, 0, 0, $2, ExtensionAttribute::REQ_TITAN, TUNKNOWN);
$$->set_location(coding_attrib_infile, @$);
if ($$->get_type() == ExtensionAttribute::NONE) {
/* parsing the version has failed */
......@@ -435,7 +462,7 @@ RequiresKeyword IDentifier IDentifier
}
| ReqTitanKeyword IDentifier Number Number IDentifier
{ // CRL 113 200 R1A
$$ = new ExtensionAttribute($2->get_dispname().c_str(), $3, $4, 0, $5, ExtensionAttribute::REQ_TITAN);
$$ = new ExtensionAttribute($2->get_dispname().c_str(), $3, $4, 0, $5, ExtensionAttribute::REQ_TITAN, TUNKNOWN);
$$->set_location(coding_attrib_infile, @$);
if ($$->get_type() == ExtensionAttribute::NONE) {
$$->error("Incorrect version data '%s %d %d %s'",
......@@ -448,7 +475,7 @@ RequiresKeyword IDentifier IDentifier
}
| ReqTitanKeyword IDentifier Number Number '/' Number IDentifier
{ // CRL 113 200 / 2 R1A
$$ = new ExtensionAttribute($2->get_dispname().c_str(), $3, $4, $6, $7, ExtensionAttribute::REQ_TITAN);
$$ = new ExtensionAttribute($2->get_dispname().c_str(), $3, $4, $6, $7, ExtensionAttribute::REQ_TITAN, TTRUE);
$$->set_location(coding_attrib_infile, @$);
if ($$->get_type() == ExtensionAttribute::NONE) {
$$->error("Incorrect version data '%s %d %d / %d %s'",
......@@ -459,6 +486,19 @@ RequiresKeyword IDentifier IDentifier
}
delete $2;
}
| ReqTitanKeyword Number '/' IDentifier Number Number IDentifier
{ // 2 / CAX 105 7730 R1A
$$ = new ExtensionAttribute($4->get_dispname().c_str(), $5, $6, $2, $7, ExtensionAttribute::REQ_TITAN, TFALSE);
$$->set_location(coding_attrib_infile, @$);
if ($$->get_type() == ExtensionAttribute::NONE) {
$$->error("Incorrect version data '%d / %s %d %d %s'",
$2, $4->get_dispname().c_str(), $5, $6, $7->get_dispname().c_str());
delete $7;
delete $$;
$$ = NULL;
}
delete $4;
}
;
TransparentAttribute: TransparentKeyword
......
......@@ -18,6 +18,7 @@ module high_titan_SE { //^In TTCN-3 module `high_titan_SE':$//
}
with {
extension "requiresTITAN R1A01"; /* surely this can be satisfied, but not the next one */
/* legacy versioning: */
extension "requiresTITAN CRL 113 200/65535 R99Z"; //^error: This module needs to be compiled with TITAN version CRL 113 200/\d+ R\d{1,2}[A-HJ-NS-VX-Z](\d{1,2})? or higher; version CRL 113 200(\/\d+ )?R\d{1,2}[A-HJ-NS-VX-Z](\d{1,2})? detected//
// WARNING! Different regexes, where one is a stricter version of the other, are not allowed
// (a limitation of the checker script logic).
......@@ -25,7 +26,6 @@ with {
// check for the more general /R\d[A-HJ-NS-VX-Z](\d{1,2})?/
/* Test needs to be adjusted for every release !!!!!!! */
extension "requiresTITAN CRL 113 200/7 R2A"; /* This one must just pass, the next one must just fail */
// extension "requiresTITAN 7/CAX 105 7730 R2A"; /* This one must just pass, the next one must just fail */
extension "requiresTITAN CRL 113 200/7 R2B01"; //^error: This module needs to be compiled with TITAN version (C[RN]L \d+ \d+\/\d+ )?R\d{1,2}[A-HJ-NS-VX-Z](\d{1,2})? or higher; version (C[RN]L \d+ \d+\/\d+ )?R\d{1,2}[A-HJ-NS-VX-Z](\d{1,2})? detected//
/* The old style RnXnn, without the CRL 113 200 and the suffix, implies major version 1
* Now that Titan is at version 6, the following will always pass:
......@@ -35,6 +35,21 @@ with {
extension "requiresTITAN CRL 113 200/1 R8H";
extension "requiresTITAN CRL 113 200/1 R8HH";
/* current versioning: */
extension "requiresTITAN 65535/CAX 105 7730 R99Z"; //^error: This module needs to be compiled with TITAN version \d+/CAX 105 7730 R\d{1,2}[A-HJ-NS-VX-Z](\d{1,2})? or higher; version (\d+\/)?CAX 105 7730 R\d{1,2}[A-HJ-NS-VX-Z](\d{1,2})? detected//
// WARNING! Different regexes, where one is a stricter version of the other, are not allowed
// (a limitation of the checker script logic).
// So we can't have the above regex check for precisely /R9Z/ and the one below
// check for the more general R\d[A-HJ-NS-VX-Z](\d{1,2})?/
/* Test needs to be adjusted for every release !!!!!!! */
extension "requiresTITAN 7/CAX 105 7730 R2A"; /* This one must just pass, the next one must just fail */
extension "requiresTITAN 7/CAX 105 7730 R2B01"; //^error: This module needs to be compiled with TITAN version (\d+\/CAX \d+ \d+ )?R\d{1,2}[A-HJ-NS-VX-Z](\d{1,2})? or higher; version (\d+\/CAX \d+ \d+ )?R\d{1,2}[A-HJ-NS-VX-Z](\d{1,2})? detected//
/* The old style RnXnn, without the CRL 113 200 and the suffix, implies major version 1
* Now that Titan is at version 6, the following will always pass:
*/
extension "requiresTITAN 1/CAX 105 7730 R8H";
extension "requiresTITAN 1/CAX 105 7730 R8HH";
/* The old keyword requiresTitan has been superseded by requiresTITAN */
extension "requiresTitan R9Z"; //^error: at or before token `requiresTitan': syntax error, unexpected Identifier, expecting \$end//
......
......@@ -19,6 +19,7 @@ import from CRL_111_222_R2D_SE all;
import from CRL_111_222_3_R2D_SE all;
import from unreleased_SE all;
import from noversion_SE all;
import from titan_OK all;
}
with {
......@@ -55,4 +56,8 @@ with {
extension "requires noversion_SE R9Z"; // highest possible version
extension "requires noversion_SE CNL 111 222 R9Z"; //^error: Module 'importer' requires module 'noversion_SE' of product CNL 111 222, but it is not specified//
extension "requires noversion_SE CNL 111 222/2 R9Z"; //^error: Module 'importer' requires module 'noversion_SE' of product CNL 111 222, but it is not specified//
extension "requires titan_OK 7/CAX 105 7730 R2A";