Commit cfb8ff06 authored by Adam Knapp's avatar Adam Knapp
Browse files

Implementing dot separated version format, e.g. 7.2.1



Change-Id: I2a9c4c5d90b7fbe32be74349988a15272c099bce
Signed-off-by: default avatarAdam Knapp <adam.knapp@sigmatechnology.se>
parent 083dc876
......@@ -10,6 +10,7 @@
* Baranyi, Botond
* Beres, Szabolcs
* Delic, Adam
* Knapp, Adam
* Kovacs, Ferenc
* Pandi, Krisztian
* Raduly, Csaba
......@@ -163,4 +164,7 @@ public:
#undef FIELD_NAME
#undef FN
/* Enum to identify version types */
enum version_t { UNKNOWN, LEGACY_CRL, LEGACY_CAX, DOT_SEPARATED /*current*/ };
#endif
......@@ -7,7 +7,9 @@
*
* Contributors:
* Balasko, Jeno
* Baranyi, Botond
* Godar, Marton
* Knapp, Adam
* Kovacs, Ferenc
* Lovassy, Arpad
* Raduly, Csaba
......
......@@ -32,6 +32,7 @@
#include <sstream>
#include "../common/dbgnew.hh"
#include "../common/version.h"
#include "AST.hh"
#include "asn1/AST_asn1.hh"
#include "Identifier.hh"
......@@ -1319,7 +1320,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), legacy_version(TUNKNOWN)
suffix(0), release(UINT_MAX), patch(UINT_MAX), build(UINT_MAX), extra(NULL), version_type(UNKNOWN)
{
if(!p_modid)
FATAL_ERROR("NULL parameter: Common::Module::Module()");
......@@ -1481,7 +1482,7 @@ namespace Common {
if (release <= 999999 && patch < 30 && build < 100) {
char *product_identifier =
get_product_identifier(product_number, suffix, release, patch, build, extra, legacy_version);
get_product_identifier(product_number, suffix, release, patch, build, extra, version_type);
fprintf(stderr, " %s", product_identifier);
Free(product_identifier);
}
......@@ -1491,7 +1492,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, tribool legacy)
unsigned int build, const char* extra, enum version_t version_type)
{
expstring_t ret_val = memptystr();
if ( product_number == NULL
......@@ -1503,11 +1504,15 @@ namespace Common {
return ret_val;
}
if (product_number != NULL) {
if (legacy != TTRUE && suffix != 0) {
if (version_type == DOT_SEPARATED) {
ret_val = mputprintf(ret_val, "%d.%d.%d", suffix, release, patch);
return ret_val;
}
if (version_type == LEGACY_CAX && suffix != 0) {
ret_val = mputprintf(ret_val, "%d/", suffix);
}
ret_val = mputstr(ret_val, product_number);
if (legacy == TTRUE && suffix != 0) {
if (version_type == LEGACY_CRL && suffix != 0) {
ret_val = mputprintf(ret_val, "/%d", suffix);
}
ret_val = mputc(ret_val, ' ');
......
......@@ -13,6 +13,7 @@
* Cserveni, Akos
* Czerman, Oliver
* Delic, Adam
* Knapp, Adam
* Forstner, Matyas
* Gecse, Roland
* Kovacs, Ferenc
......@@ -34,6 +35,7 @@
#include <set>
#include <string>
#include "../common/dbgnew.hh"
#include "../common/version.h"
#include "../common/ModuleVersion.hh"
#include "CompilerError.hh"
......@@ -253,7 +255,7 @@ namespace Common {
unsigned int patch;
unsigned int build;
char* extra;
tribool legacy_version;
enum version_t version_type;
/** @} */
friend class Ttcn::Module;
......@@ -369,7 +371,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, tribool legacy = TUNKNOWN);
unsigned int build, const char* extra=NULL, enum version_t version_type = UNKNOWN);
ModuleVersion getVersion() const;
protected: // *::Module need access
/** Collects the set of visible modules into \a visible_mods. */
......
......@@ -11,6 +11,7 @@
* Baranyi, Botond
* Beres, Szabolcs
* Delic, Adam
* Knapp, Adam
* Kovacs, Ferenc
* Raduly, Csaba
* Szabados, Kristof
......@@ -21,6 +22,7 @@
*
******************************************************************************/
#include "../../common/dbgnew.hh"
#include "../../common/version.h"
#include "AST_ttcn3.hh"
#include "../Identifier.hh"
#include "../CompilerError.hh"
......@@ -2989,8 +2991,8 @@ namespace Ttcn {
char* act_product_number;
unsigned int act_suffix, act_rel, act_patch, act_build;
char* extra_junk;
tribool legacy;
(void)ex.get_id(act_product_number, act_suffix, act_rel, act_patch, act_build, extra_junk, legacy);
enum version_t version_type;
(void)ex.get_id(act_product_number, act_suffix, act_rel, act_patch, act_build, extra_junk, version_type);
if (release != UINT_MAX) {
ex.error("Duplicate 'version' attribute");
......@@ -3002,7 +3004,7 @@ namespace Ttcn {
patch = act_patch;
build = act_build;
extra = mcopystr(extra_junk);
legacy_version = legacy;
this->version_type = version_type;
}
// Avoid propagating the attribute needlessly
multi->delete_element(i--);
......@@ -3014,9 +3016,9 @@ namespace Ttcn {
char* exp_product_number;
unsigned int exp_suffix, exp_rel, exp_patch, exp_build;
char* exp_extra;
tribool legacy;
enum version_t version_type;
Common::Identifier *req_id = ex.get_id(exp_product_number,
exp_suffix, exp_rel, exp_patch, exp_build, exp_extra, legacy);
exp_suffix, exp_rel, exp_patch, exp_build, exp_extra, version_type);
// We own req_id
if (imp->has_impmod_withId(*req_id)) {
Common::Module* m = modules->get_mod_byId(*req_id);
......@@ -3029,31 +3031,47 @@ namespace Ttcn {
single = 0;
break;
} else if (exp_product_number == NULL &&
m->product_number != NULL && strcmp(m->product_number, "") > 0){
m->product_number != NULL && strlen(m->product_number) > 0){
ex.warning("Module '%s' requires module '%s' of any product"
", 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) {
bool prod_match = false;
if (legacy == m->legacy_version || (legacy != TFALSE && m->legacy_version != TFALSE)) {
if (version_type == m->version_type) {
prod_match = (0 == strcmp(m->product_number, exp_product_number));
}
else if (legacy == TTRUE && m->legacy_version == TFALSE) {
else if (version_type == LEGACY_CRL && m->version_type == LEGACY_CAX) {
prod_match = (0 == strcmp(exp_product_number, LEGACY_CRL_PRODNR_EXECUTOR) &&
0 == strcmp(m->product_number, LEGACY_CAX_PRODNR_EXECUTOR));
}
else if (legacy == TFALSE && m->legacy_version == TTRUE) {
else if (version_type == LEGACY_CAX && m->version_type == LEGACY_CRL) {
prod_match = (0 == strcmp(exp_product_number, LEGACY_CAX_PRODNR_EXECUTOR) &&
0 == strcmp(m->product_number, LEGACY_CRL_PRODNR_EXECUTOR));
}
else if (version_type == LEGACY_CRL && m->version_type == DOT_SEPARATED) {
prod_match = (0 == strcmp(exp_product_number, LEGACY_CRL_PRODNR_EXECUTOR) &&
0 == strlen(m->product_number));
}
else if (version_type == DOT_SEPARATED && m->version_type == LEGACY_CRL) {
prod_match = (0 == strlen(exp_product_number) &&
0 == strcmp(m->product_number, LEGACY_CRL_PRODNR_EXECUTOR));
}
else if (version_type == LEGACY_CAX && m->version_type == DOT_SEPARATED) {
prod_match = (0 == strcmp(exp_product_number, LEGACY_CAX_PRODNR_EXECUTOR) &&
0 == strlen(m->product_number));
}
else if (version_type == DOT_SEPARATED && m->version_type == LEGACY_CAX) {
prod_match = (0 == strlen(exp_product_number) &&
0 == strcmp(m->product_number, LEGACY_CAX_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);
exp_suffix, exp_rel, exp_patch, exp_build, NULL, version_type);
char *mod_product_identifier =
get_product_identifier(m->product_number,
m->suffix, m->release, m->patch, m->build, NULL, m->legacy_version);
m->suffix, m->release, m->patch, m->build, NULL, m->version_type);
ex.error("Module '%s' requires version %s of module"
" '%s', but only %s is available",
......@@ -3070,10 +3088,10 @@ namespace Ttcn {
// 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, NULL, legacy);
get_product_identifier(exp_product_number,exp_suffix, exp_rel, exp_patch, exp_build, NULL, version_type);
char *mod_product_identifier =
get_product_identifier(m->product_number,
m->suffix, m->release, m->patch, m->build, NULL, m->legacy_version);
m->suffix, m->release, m->patch, m->build, NULL, m->version_type);
ex.error("Module '%s' requires version %s of module"
" '%s', but only %s is available",
......@@ -3113,10 +3131,11 @@ namespace Ttcn {
char* exp_product_number;
unsigned int exp_suffix, exp_minor, exp_patch, exp_build;
char* exp_extra;
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, LEGACY_CAX_PRODNR_EXECUTOR) != 0) ||
(legacy == TTRUE && strcmp(exp_product_number, LEGACY_CRL_PRODNR_EXECUTOR) != 0))) {
enum version_t version_type;
(void)ex.get_id(exp_product_number, exp_suffix, exp_minor, exp_patch, exp_build, exp_extra, version_type);
if (exp_product_number != NULL && ((version_type == LEGACY_CAX && strcmp(exp_product_number, LEGACY_CAX_PRODNR_EXECUTOR) != 0) ||
(version_type == LEGACY_CRL && strcmp(exp_product_number, LEGACY_CRL_PRODNR_EXECUTOR) != 0) ||
(version_type == DOT_SEPARATED && strlen(exp_product_number) != 0))) {
ex.error("This module needs to be compiled with TITAN, but "
" product number %s is not TITAN"
, exp_product_number);
......@@ -3129,10 +3148,25 @@ 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, NULL, legacy);
get_product_identifier(exp_product_number, exp_suffix, exp_minor, exp_patch, exp_build, NULL, version_type);
char *tmp = "UNKNOWN";
switch(version_type) {
case LEGACY_CRL:
tmp = LEGACY_CRL_PRODUCT_NUMBER;
break;
case LEGACY_CAX:
tmp = LEGACY_CAX_PRODUCT_NUMBER;
break;
case DOT_SEPARATED:
tmp = PRODUCT_NUMBER;
break;
default:
// Do nothing
break;
}
ex.error("This module needs to be compiled with TITAN version"
" %s or higher; version %s detected"
, exp_product_identifier, legacy == TTRUE ? LEGACY_CRL_PRODUCT_NUMBER : LEGACY_CAX_PRODUCT_NUMBER);
, exp_product_identifier, tmp);
Free(exp_product_identifier);
}
multi->delete_element(i--);
......
......@@ -9,6 +9,7 @@
* Balasko, Jeno
* Baranyi, Botond
* Delic, Adam
* Knapp, Adam
* Kovacs, Ferenc
* Raduly, Csaba
* Szabados, Kristof
......@@ -2725,64 +2726,139 @@ namespace Ttcn {
}
ExtensionAttribute::ExtensionAttribute(const char* ABCClass, int type_number,
int sequence, int suffix, Identifier *ver, tribool legacy)
int sequence, int suffix, Identifier *ver, enum version_t version_type)
: Location(), type_(VERSION), value_()
{
if (ver == NULL) FATAL_ERROR("ExtensionAttribute::ExtensionAttribute()");
if (version_type != DOT_SEPARATED && ver == NULL) FATAL_ERROR("ExtensionAttribute::ExtensionAttribute()");
value_.version_.module_ = NULL;
value_.version_.legacy_ = legacy;
check_product_number(ABCClass, type_number, sequence);
parse_version(ver);
if (type_ != NONE) {
value_.version_.productNumber_ =
NULL == ABCClass ? NULL : mprintf("%s %d %d", ABCClass, type_number, sequence);
value_.version_.suffix_ = suffix;
delete ver; // "took care of it"
}
value_.version_.version_type_ = version_type;
switch (version_type) {
case DOT_SEPARATED:
// In this case, 'type_number' and 'sequence' are used to pass the minor and patch part of the version
// major minor/release patch
if (suffix < 0 || type_number < 0 || sequence < 0) {
type_ = NONE;
return;
}
value_.version_.productNumber_ = mputc(value_.version_.productNumber_, '\0');
value_.version_.suffix_ = suffix;
value_.version_.release_ = type_number;
value_.version_.patch_ = sequence;
value_.version_.build_ = 99;
value_.version_.extra_ = NULL;
break;
case UNKNOWN:
case LEGACY_CRL:
case LEGACY_CAX:
check_product_number(ABCClass, type_number, sequence);
parse_version(ver);
if (type_ != NONE) {
value_.version_.productNumber_ =
NULL == ABCClass ? NULL : mprintf("%s %d %d", ABCClass, type_number, sequence);
value_.version_.suffix_ = suffix;
delete ver; // "took care of it"
}
break;
default:
FATAL_ERROR("ExtensionAttribute::ExtensionAttribute()");
break;
}
}
ExtensionAttribute::ExtensionAttribute(Identifier *mod, const char* ABCClass,
int type_number, int sequence, int suffix, Identifier *ver, tribool legacy)
int type_number, int sequence, int suffix, Identifier *ver, enum version_t version_type)
: Location(), type_(REQUIRES), value_()
{
if (mod == NULL || ver == NULL)
if (version_type != DOT_SEPARATED && (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);
if (type_ == NONE) { // parse_version reported an error
value_.version_.module_ = NULL; // disown it; caller will free
value_.version_.suffix_ = suffix;
} else {
value_.version_.productNumber_ =
NULL == ABCClass ? NULL : mprintf("%s %d %d", ABCClass, type_number, sequence);
value_.version_.suffix_ = suffix;
delete ver;
}
value_.version_.version_type_ = version_type;
switch (version_type) {
case DOT_SEPARATED:
// In this case, 'type_number' and 'sequence' are used to pass the minor and patch part of the version
// major minor/release patch
if (suffix < 0 || type_number < 0 || sequence < 0) {
type_ = NONE;
return;
}
value_.version_.productNumber_ = mputc(value_.version_.productNumber_, '\0');
value_.version_.suffix_ = suffix;
value_.version_.release_ = type_number;
value_.version_.patch_ = sequence;
value_.version_.build_ = 99;
value_.version_.extra_ = NULL;
break;
case UNKNOWN:
case LEGACY_CRL:
case LEGACY_CAX:
check_product_number(ABCClass, type_number, sequence);
parse_version(ver);
if (type_ == NONE) { // parse_version reported an error
value_.version_.module_ = NULL; // disown it; caller will free
value_.version_.suffix_ = suffix;
} else {
value_.version_.productNumber_ =
NULL == ABCClass ? NULL : mprintf("%s %d %d", ABCClass, type_number, sequence);
value_.version_.suffix_ = suffix;
delete ver;
}
break;
default:
FATAL_ERROR("ExtensionAttribute::ExtensionAttribute()");
break;
}
}
ExtensionAttribute::ExtensionAttribute(const char* ABCClass, int type_number,
int sequence, int suffix, Identifier* ver, extension_t et, tribool legacy)
int sequence, int suffix, Identifier* ver, extension_t et, enum version_t version_type)
: Location(), type_(et), value_()
{
if (ver == NULL) FATAL_ERROR("ExtensionAttribute::ExtensionAttribute()");
value_.version_.legacy_ = legacy;
if (version_type != DOT_SEPARATED && ver == NULL) FATAL_ERROR("ExtensionAttribute::ExtensionAttribute()");
value_.version_.version_type_ = version_type;
switch (et) {
case REQ_TITAN:
check_product_number(ABCClass, type_number, sequence);
parse_version(ver);
if (type_ != NONE) {
value_.version_.productNumber_ =
NULL == ABCClass ? NULL : mprintf("%s %d %d", ABCClass, type_number, sequence);
value_.version_.suffix_ = suffix;
delete ver; // "took care of it"
} else {
value_.version_.suffix_ = suffix;
switch (version_type) {
case DOT_SEPARATED:
// In this case, 'type_number' and 'sequence' are used to pass the minor and patch part of the version
// major minor/release patch
if (suffix < 0 || type_number < 0 || sequence < 0) {
type_ = NONE;
return;
}
value_.version_.productNumber_ = mputc(value_.version_.productNumber_, '\0');
value_.version_.suffix_ = suffix;
value_.version_.release_ = type_number;
value_.version_.patch_ = sequence;
value_.version_.build_ = 99;
value_.version_.extra_ = NULL;
break;
case UNKNOWN:
case LEGACY_CRL:
case LEGACY_CAX:
check_product_number(ABCClass, type_number, sequence);
parse_version(ver);
if (type_ != NONE) {
value_.version_.productNumber_ =
NULL == ABCClass ? NULL : mprintf("%s %d %d", ABCClass, type_number, sequence);
value_.version_.suffix_ = suffix;
delete ver; // "took care of it"
} else {
value_.version_.suffix_ = suffix;
}
break;
default:
FATAL_ERROR("ExtensionAttribute::ExtensionAttribute()");
break;
}
break;
......@@ -2944,7 +3020,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, tribool& legacy)
unsigned int& rel, unsigned int& patch, unsigned int& bld, char*& extra, enum version_t& version_type)
{
if ( type_ != REQUIRES && type_ != REQ_TITAN
&& type_ != VERSION && type_ != VERSION_TEMPLATE) {
......@@ -2956,7 +3032,7 @@ namespace Ttcn {
patch = value_.version_.patch_;
bld = value_.version_.build_;
extra = value_.version_.extra_;
legacy = value_.version_.legacy_;
version_type = value_.version_.version_type_;
return value_.version_.module_;
}
......
......@@ -9,6 +9,7 @@
* Balasko, Jeno
* Baranyi, Botond
* Delic, Adam
* Knapp, Adam
* Raduly, Csaba
* Szabados, Kristof
* Szabo, Bence Janos
......@@ -18,6 +19,7 @@
#ifndef TTCNSTUFF_H_
#define TTCNSTUFF_H_
#include "../../common/version.h"
#include "../Setting.hh"
#include "../Type.hh" // for Common::Common::Type::MessageEncodingType_t
#include "AST_ttcn3.hh" // For Def_Function_Base::prototype_t
......@@ -595,7 +597,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, tribool legacy);
int suffix, Identifier *ver, enum version_t version_type);
/** Constructor for the REQUIRES type
*
......@@ -608,7 +610,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, tribool legacy);
int sequence, int suffix, Identifier *ver, enum version_t version_type);
/** Constructor for the REQ_TITAN type or the VERSION_TEMPLATE type
*
......@@ -621,7 +623,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, tribool legacy);
int suffix, Identifier* ver, extension_t et, enum version_t version_type);
~ExtensionAttribute();
......@@ -687,7 +689,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, tribool& legacy);
unsigned int& rel, unsigned int& patch, unsigned int& bld, char*& extra, enum version_t& version_type);
/// @}
private:
/// Attribute type.
......@@ -715,13 +717,13 @@ private:
Types *anytypes_;
struct {
Common::Identifier *module_;
char* productNumber_; ///< "CRL 113 200" for legacy versions, "CAX 105 7730" for current versions
char* productNumber_; ///< "CRL 113 200" for CRL versions, "CAX 105 7730" for CAX versions, "" for current version
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'
enum version_t version_type_; ///< possible values: UNKNOWN, LEGACY_CRL, LEGACY_CAX and DOT_SEPARATED for the current version
} version_;
PrintingType *pt_;
} value_;
......
......@@ -12,6 +12,7 @@
* Szabados, Kristof
* Szabo, Janos Zoltan – initial implementation
* Zalanyi, Balazs Andor
* Knapp, Adam
*
******************************************************************************/
/* Parser for "extension" attributes of functions, external functions and
......@@ -20,6 +21,7 @@
%{
#include "../../common/dbgnew.hh"
#include "../../common/version.h"
#include "../string.hh"
#include "../Identifier.hh"
#include "../Setting.hh"
......@@ -305,7 +307,7 @@ ExtensionAttribute:
VersionAttribute:
VersionKeyword IDentifier
{ // version R2D2
$$ = new ExtensionAttribute(NULL, 0, 0, 0, $2, TUNKNOWN); // VERSION
$$ = new ExtensionAttribute(NULL, 0, 0, 0, $2, UNKNOWN); // VERSION
$$->set_location(coding_attrib_infile, @$);
if ($$->get_type() == ExtensionAttribute::NONE) {
$$->error("Incorrect version data '%s'", $2->get_name().c_str());
......@@ -316,7 +318,7 @@ VersionKeyword IDentifier
}
| VersionKeyword '<' IDentifier '>'
{ // version <RnXnn>
$$ = new ExtensionAttribute(NULL, 0, 0, 0, $3, ExtensionAttribute::VERSION_TEMPLATE, TTRUE);
$$ = new ExtensionAttribute(NULL, 0, 0, 0, $3, ExtensionAttribute::VERSION_TEMPLATE, LEGACY_CRL);
$$->set_location(coding_attrib_infile, @$);
if ($$->get_type() == ExtensionAttribute::NONE) {
$$->error("Incorrect version template '<%s>'", $3->get_name().c_str());
......@@ -327,7 +329,7 @@ VersionKeyword IDentifier
}
| VersionKeyword IDentifier Number Number IDentifier
{ // version CNL 113 200 R2D2
$$ = new ExtensionAttribute($2->get_dispname().c_str(), $3, $4, 0, $5, TUNKNOWN); // VERSION
$$ = new ExtensionAttribute($2->get_dispname().c_str(), $3, $4, 0, $5, UNKNOWN); // VERSION
$$->set_location(coding_attrib_infile, @$);
if ($$->get_type() == ExtensionAttribute::NONE) {
$$->error("Incorrect version data '%s %d %d %s'",
......@@ -340,7 +342,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, TTRUE); // VERSION
$$ = new ExtensionAttribute($2->get_dispname().c_str(), $3, $4, 0, $6, ExtensionAttribute::VERSION_TEMPLATE, LEGACY_CRL); // VERSION
$$->set_location(coding_attrib_infile, @$);
if ($$->get_type() == ExtensionAttribute::NONE) {
$$->error("Incorrect version data '%s %d %d <%s>'",
......@@ -353,7 +355,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, TTRUE); // VERSION
$$ = new ExtensionAttribute($2->get_dispname().c_str(), $3, $4, $6, $7, LEGACY_CRL); // VERSION
$$->set_location(coding_attrib_infile, @$);
if ($$->get_type() == ExtensionAttribute::NONE) {
$$->error("Incorrect version data '%s %d %d / %d %s'",
......@@ -366,7 +368,7 @@ VersionKeyword IDentifier
}
| 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
$$ = new ExtensionAttribute($4->get_dispname().c_str(), $5, $6, $2, $7, LEGACY_CAX); // VERSION
$$->set_location(coding_attrib_infile, @$);
if ($$->get_type() == ExtensionAttribute::NONE) {
$$->error("Incorrect version data '%d / %s %d %d %s'",
......@@ -379,7 +381,7 @@ VersionKeyword IDentifier
}
| 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, TTRUE); // VERSION
$$ = new ExtensionAttribute($2->get_dispname().c_str(), $3, $4, $6, $8, ExtensionAttribute::VERSION_TEMPLATE, LEGACY_CRL); // VERSION
$$->set_location(coding_attrib_infile, @$);
if ($$->get_type() == ExtensionAttribute::NONE) {
$$->error("Incorrect version data '%s %d %d / %d <%s>'",
......@@ -390,12 +392,22 @@ VersionKeyword IDentifier
}
delete $2;
}
| VersionKeyword Number '.' Number '.' Number
{ // version 7 . 2 . 1
$$ = new ExtensionAttribute(NULL, $4, $6, $2, NULL, DOT_SEPARATED); // VERSION