1 ///////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2000-2015 Ericsson Telecom AB
3 // All rights reserved. This program and the accompanying materials
4 // are made available under the terms of the Eclipse Public License v1.0
5 // which accompanies this distribution, and is available at
6 // http://www.eclipse.org/legal/epl-v10.html
7 ///////////////////////////////////////////////////////////////////////////////
8 #include "GeneralFunctions.hh"
9 #include "SimpleType.hh"
10 #include "TTCN3Module.hh"
11 #include "ImportStatement.hh"
13 #include <cctype> // for using "toupper" function
19 #include "../common/version_internal.h"
23 #if defined(WIN32) && !defined(MINGW)
24 #include <cygwin/version.h>
25 #include <sys/cygwin.h>
29 extern bool w_flag_used
;
30 extern bool t_flag_used
;
32 // XSDName2TTCN3Name function:
34 // in - input string - XSD name
35 // used_names - set of previously defined types, used field names etc.
36 // type_of_the_name - mode of the function behaviour
37 // res - generated result
38 // variant - generated variant string for TTCN-3
41 void XSDName2TTCN3Name(const Mstring
& in
, QualifiedNames
& used_names
, modeType type_of_the_name
,
42 Mstring
& res
, Mstring
& variant
, bool no_replace
) {
43 static const char* TTCN3_reserved_words
[] = {
44 "action", "activate", "address", "alive", "all", "alt", "altstep", "and", "and4b", "any", "anytype", "apply",
45 "bitstring", "boolean", "break",
46 "call", "case", "catch", "char", "charstring", "check", "clear", "complement", "component", "connect",
47 "const", "continue", "control", "create",
48 "deactivate", "default", "derefers", "disconnect", "display", "do", "done",
49 "else", "encode", "enumerated", "error", "except", "exception", "execute", "extends", "extension",
51 "fail", "false", "float", "for", "friend", "from", "function",
52 "getverdict", "getcall", "getreply", "goto", "group",
54 "if", "if present", "import", "in", "inconc", "infinity", "inout", "integer", "interleave",
56 "label", "language", "length", "log",
57 "map", "match", "message", "mixed", "mod", "modifies", "module", "modulepar", "mtc",
58 "noblock", "none", "not", "not4b", "nowait", "null",
59 "objid", "octetstring", "of", "omit", "on", "optional", "or", "or4b", "out", "override",
60 "param", "pass", "pattern", "permutation", "port", "present", "private", "procedure", "public",
61 "raise", "read", "receive", "record", "recursive", "refers", "rem", "repeat", "reply", "return", "running", "runs",
62 "select", "self", "send", "sender", "set", "setverdict", "signature", "start", "stop", "subset",
64 "template", "testcase", "timeout", "timer", "to", "trigger", "true", "type",
65 "union", "universal", "unmap",
66 "value", "valueof", "var", "variant", "verdicttype",
71 static const char* TTCN3_predefined_functions
[] = {
72 "bit2int", "bit2hex", "bit2oct", "bit2str",
73 "char2int", "char2oct",
75 "encvalue", "enum2int",
76 "float2int", "float2str",
77 "hex2bit", "hex2int", "hex2oct", "hex2str",
78 "int2bit", "int2char", "int2enum", "int2float", "int2hex", "int2oct", "int2str", "int2unichar",
79 "isvalue", "ischosen", "ispresent",
80 "lengthof", "log2str",
81 "oct2bit", "oct2char", "oct2hex", "oct2int", "oct2str", "oct2unichar"
82 "regexp", "replace", "rnd", "remove_bom", "get_stringencoding",
83 "sizeof", "str2bit", "str2float", "str2hex", "str2int", "str2oct", "substr",
85 "unichar2int", "unichar2char", "unichar2oct",
88 static const char* ASN1_reserved_words
[] = {
89 "ABSENT", "ABSTRACT-SYNTAX", "ALL", "APPLICATION", "AUTOMATIC",
90 "BEGIN", "BIT", "BMPString", "BOOLEAN", "BY",
91 "CHARACTER", "CHOICE", "CLASS", "COMPONENT", "COMPONENTS", "CONSTRAINED", "CONTAINING",
92 "DEFAULT", "DEFINITIONS",
93 "EMBEDDED", "ENCODED", "END", "ENUMERATED", "EXCEPT", "EXPLICIT", "EXPORTS", "EXTENSIBILITY",
96 "GeneralizedTime", "GeneralString", "GraphicString",
97 "IA5String", "IDENTIFIER", "IMPLICIT", "IMPLIED", "IMPORTS", "INCLUDES", "INSTANCE", "INTEGER",
98 "INTERSECTION", "ISO646String",
99 "MAX", "MIN", "MINUS-INFINITY",
100 "NULL", "NumericString",
101 "OBJECT", "ObjectDescriptor", "OCTET", "OF", "OPTIONAL",
102 "PATTERN", "PDV", "PLUS-INFINITY", "PRESENT", "PrintableString", "PRIVATE",
103 "REAL", "RELATIVE-OID",
104 "SEQUENCE", "SET", "SIZE", "STRING", "SYNTAX",
105 "T61String", "TAGS", "TeletexString", "TRUE", "TYPE-IDENTIFIER",
106 "UNION", "UNIQUE", "UNIVERSAL", "UniversalString", "UTCTime", "UTF8String",
107 "VideotexString", "VisibleString",
112 Mstring
ns_uri(variant
);
118 if (res
.size() > 0) {
119 /********************************************************
120 * STEP 0 - recognizing XSD built-in types
122 * ******************************************************/
123 // If the type or field reference name is an XSD built-in type then it will be capitalized and get a prefix "XSD."
124 // if (type_of_the_name == type_reference_name || type_of_the_name == field_reference_name) {
126 if (type_of_the_name
== type_reference_name
) {
127 if (isBuiltInType(res
)) {
128 res
[0] = toupper(res
[0]);
132 if (res
== "record" ||
139 if (type_of_the_name
== enum_id_name
) {
141 for (QualifiedNames::iterator used
= used_names
.begin(); used
; used
= used
->Next
) {
142 QualifiedName
tmp(empty_string
, res
);
143 if (tmp
.nsuri
== used
->Data
.nsuri
&& tmp
.orig_name
== used
->Data
.orig_name
) {
150 /********************************************************
151 * STEP 1 - character changes
154 * clause 5.2.2.1 - Generic name transformation rules
155 * ******************************************************/
156 // the characters ' '(SPACE), '.'(FULL STOP) and '-'(HYPEN-MINUS)shall all be replaced by a "_" (LOW LINE)
157 for (size_t i
= 0; i
!= res
.size(); ++i
) {
158 if ((res
[i
] == ' ') ||
159 (res
[i
] == '.' && !no_replace
) ||
164 // any character except "A" to "Z", "a" to "z" or "0" to "9" and "_" shall be removed
165 for (size_t i
= 0; i
!= res
.size(); ++i
) {
166 if (!isalpha((const unsigned char) res
[i
]) && !isdigit((const unsigned char) res
[i
]) && (res
[i
] != '_')) {
167 if (!no_replace
&& res
[i
] != '.') {
173 // a sequence of two of more "_" (LOW LINE) shall be replaced with a single "_" (LOW LINE)
174 for (size_t i
= 1; i
< res
.size(); ++i
) {
175 if (res
[i
] == '_' && res
[i
- 1] == '_') {
180 // "_" (LOW LINE) characters occurring at the end of the name shall be removed
181 if (!res
.empty() && res
[res
.size() - 1] == '_') {
182 res
.eraseChar(res
.size() - 1);
184 // "_" (LOW LINE) characters occurring at the beginning of the name shall be removed
185 if (!res
.empty() && res
[0] == '_') {
190 switch (type_of_the_name
) {
191 case type_reference_name
:
196 if (islower((const unsigned char) res
[0])) {
197 res
.setCapitalized();
198 } else if (isdigit((const unsigned char) res
[0])) {
199 res
.insertChar(0, 'X');
208 if (isupper((const unsigned char) res
[0])) res
.setUncapitalized();
209 else if (isdigit((const unsigned char) res
[0])) res
.insertChar(0, 'x');
213 /********************************************************
214 * STEP 2 - process if the generated name is
218 * and after any change is made
220 * clause 5.2.2.2 - Succeeding rules
221 * ******************************************************/
222 /********************************************************
223 * according to paragraph a)
224 * ******************************************************/
225 bool postfixing
= false;
226 QualifiedName
qual_name(ns_uri
, res
, in
);
229 switch (type_of_the_name
) {
230 // Do not use "res" in this switch; only qual_name
233 for (int k
= 0; ASN1_reserved_words
[k
]; k
++) {
234 if (qual_name
.name
== ASN1_reserved_words
[k
]) {
240 for (QualifiedNames::iterator used
= used_names
.begin(); used
; used
= used
->Next
) {
241 if (qual_name
== used
->Data
) {
250 expstring_t tmpname
= NULL
;
254 tmpname
= mprintf("%s_%d", qual_name
.name
.c_str(), counter
);
255 for (QualifiedNames::iterator used
= used_names
.begin(); used
; used
= used
->Next
) {
256 if (QualifiedName(/* empty_string ? */ ns_uri
, Mstring(tmpname
)) == used
->Data
) {
263 qual_name
.name
= tmpname
; // NULL will result in an empty string
271 for (int k
= 0; TTCN3_reserved_words
[k
]; k
++) {
272 if (qual_name
.name
== TTCN3_reserved_words
[k
]) postfixing
= true;
274 for (int k
= 0; TTCN3_predefined_functions
[k
]; k
++) {
275 if (qual_name
.name
== TTCN3_predefined_functions
[k
]) postfixing
= true;
278 qual_name
.name
+= "_";
282 for (QualifiedNames::iterator used
= used_names
.begin(); used
; used
= used
->Next
) {
283 if (qual_name
== used
->Data
) postfixing
= true;
289 if (qual_name
.name
[qual_name
.name
.size() - 1] == '_')
290 qual_name
.name
.eraseChar(qual_name
.name
.size() - 1);
291 expstring_t tmpname
= mprintf("%s_%d", qual_name
.name
.c_str(), counter
);
296 tmpname
= mprintf("%s_%d", qual_name
.name
.c_str(), counter
);
298 for (QualifiedNames::iterator used
= used_names
.begin(); used
; used
= used
->Next
) {
299 if (QualifiedName(/* empty_string ? */ns_uri
, Mstring(tmpname
)) == used
->Data
) {
306 qual_name
.name
= tmpname
;
315 res
= qual_name
.name
;
317 /********************************************************
318 * STEP 3 - the defined name is put into the set of "not_av_names"
319 * ******************************************************/
320 // Finally recently defined name will be put into the set of "set<string> not_av_names"
321 if (type_of_the_name
!= type_reference_name
) {
323 for (QualifiedNames::iterator used
= used_names
.begin(); used
; used
= used
->Next
) {
324 if (qual_name
== used
->Data
) {
331 used_names
.push_back(qual_name
);
334 /********************************************************
337 * ******************************************************/
338 if (in
== "sequence" ||
340 in
== "sequence_list" ||
341 in
== "choice_list") {
344 /********************************************************
345 * STEP 5 - if "input name - in" and "generated name - res"
347 * then a "variant string" has to be generated
348 * ******************************************************/
349 // If the final generated type name, field name or enumeration identifier (res) is different from the original one (in) then ...
353 tmp1
.setUncapitalized();
354 tmp2
.setUncapitalized();
355 switch (type_of_the_name
) {
357 if (tmp1
== tmp2
) { // If the only difference is the case of the first letter
358 if (isupper(in
[0])) {
359 variant
+= "\"name as capitalized\"";
361 variant
+= "\"name as uncapitalized\"";
363 } else { // Otherwise if other letters have changed too
364 variant
+= "\"name as '" + in
+ "'\"";
368 // Creating a variant string from a field of a complex type needs to write out the path of the fieldname
369 if (tmp1
== tmp2
) { // If the only difference is the case of the first letter
370 if (isupper(in
[0])) {
371 variant
+= "\"name as capitalized\"";
373 variant
+= "\"name as uncapitalized\"";
375 } else { // Otherwise if other letters have changed too
376 variant
+= "\"name as '" + in
+ "'\"";
380 if (tmp1
== tmp2
) { // If the only difference is the case of the first letter
381 if (isupper(in
[0])) {
382 variant
+= "\"text \'" + res
+ "\' as capitalized\"";
384 variant
+= "\"text \'" + res
+ "\' as uncapitalized\"";
386 } else { // Otherwise if other letters have changed too
387 variant
+= "\"text \'" + res
+ "\' as '" + in
+ "'\"";
396 bool isBuiltInType(const Mstring
& in
) {
397 static const char* XSD_built_in_types
[] = {
398 "string", "normalizedString", "token", "Name", "NMTOKEN", "NCName", "ID", "IDREF", "ENTITY",
399 "hexBinary", "base64Binary", "anyURI", "language", "integer", "positiveInteger", "nonPositiveInteger",
400 "negativeInteger", "nonNegativeInteger", "long", "unsignedLong", "int", "unsignedInt", "short",
401 "unsignedShort", "byte", "unsignedByte", "decimal", "float", "double", "duration", "dateTime", "time",
402 "date", "gYearMonth", "gYear", "gMonthDay", "gDay", "gMonth", "NMTOKENS", "IDREFS", "ENTITIES",
403 "QName", "boolean", "anyType", "anySimpleType", NULL
405 const Mstring
& name
= in
.getValueWithoutPrefix(':');
406 for (int i
= 0; XSD_built_in_types
[i
]; ++i
) {
407 if (name
== XSD_built_in_types
[i
]) {
414 bool isStringType(const Mstring
& in
) {
415 static const char* string_types
[] = {
416 "string", "normalizedString", "token", "Name", "NMTOKEN", "NCName", "ID", "IDREF", "ENTITY",
417 "hexBinary", "base64Binary", "anyURI", "language", NULL
419 const Mstring
& name
= in
.getValueWithoutPrefix(':');
420 for (int i
= 0; string_types
[i
]; ++i
) {
421 if (name
== string_types
[i
]) {
428 bool isIntegerType(const Mstring
& in
) {
429 static const char* integer_types
[] = {
430 "integer", "positiveInteger", "nonPositiveInteger", "negativeInteger", "nonNegativeInteger", "long",
431 "unsignedLong", "int", "unsignedInt", "short", "unsignedShort", "byte", "unsignedByte", NULL
433 const Mstring
& name
= in
.getValueWithoutPrefix(':');
434 for (int i
= 0; integer_types
[i
]; ++i
) {
435 if (name
== integer_types
[i
]) {
442 bool isFloatType(const Mstring
& in
) {
443 static const char* float_types
[] = {
444 "decimal", "float", "double", NULL
446 const Mstring
& name
= in
.getValueWithoutPrefix(':');
447 for (int i
= 0; float_types
[i
]; ++i
) {
448 if (name
== float_types
[i
]) {
455 bool isTimeType(const Mstring
& in
) {
456 static const char* time_types
[] = {
457 "duration", "dateTime", "time", "date", "gYearMonth", "gYear", "gMonthDay", "gDay", "gMonth", NULL
459 const Mstring
& name
= in
.getValueWithoutPrefix(':');
460 for (int i
= 0; time_types
[i
]; ++i
) {
461 if (name
== time_types
[i
]) {
468 bool isSequenceType(const Mstring
& in
) {
469 static const char* sequence_types
[] = {
470 "NMTOKENS", "IDREFS", "ENTITIES", "QName", NULL
472 const Mstring
& name
= in
.getValueWithoutPrefix(':');
473 for (int i
= 0; sequence_types
[i
]; ++i
) {
474 if (name
== sequence_types
[i
]) {
481 bool isBooleanType(const Mstring
& in
) {
482 static const Mstring
booltype("boolean");
483 return booltype
== in
.getValueWithoutPrefix(':');
486 bool isQNameType(const Mstring
& in
) {
487 static const Mstring
qntype("QName");
488 return qntype
== in
.getValueWithoutPrefix(':');
491 bool isAnyType(const Mstring
& in
) {
492 static const char* any_types
[] = {
493 "anyType", "anySimpleType", NULL
495 const Mstring
& name
= in
.getValueWithoutPrefix(':');
496 for (int i
= 0; any_types
[i
]; ++i
) {
497 if (name
== any_types
[i
]) return true;
502 bool matchDates(const char * string
, const char * type
) {
503 const Mstring
day("(0[1-9]|[12][0-9]|3[01])");
504 const Mstring
month("(0[1-9]|1[0-2])");
505 const Mstring
year("([0-9][0-9][0-9][0-9])");
506 const Mstring
hour("([01][0-9]|2[0-3])");
507 const Mstring
minute("([0-5][0-9])");
508 const Mstring
second("([0-5][0-9])");
509 const Mstring
endofdayext("24:00:00(.0?)?");
510 const Mstring
yearext("((-)([1-9][0-9]*)?)?");
511 const Mstring
timezone("(Z|[+-]((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?");
512 const Mstring
fraction("(.[0-9]+)?");
513 const Mstring
nums("[0-9]+");
514 const Mstring
durtime("(T[0-9]+"
515 "(H([0-9]+(M([0-9]+(S|.[0-9]+S))?|.[0-9]+S|S))?|"
516 "M([0-9]+(S|.[0-9]+S)|.[0-9]+M)?|S|.[0-9]+S))");
519 if (strcmp(type
, "gDay") == 0) {
520 pattern
= Mstring("(---)") + day
+ timezone
;
521 } else if (strcmp(type
, "gMonth") == 0) {
522 pattern
= Mstring("(--)") + month
+ timezone
;
523 } else if (strcmp(type
, "gYear") == 0) {
524 pattern
= yearext
+ year
+ timezone
;
525 } else if (strcmp(type
, "gYearMonth") == 0) {
526 pattern
= yearext
+ year
+ Mstring("(-)") + month
+ timezone
;
527 } else if (strcmp(type
, "gMonthDay") == 0) {
528 pattern
= Mstring("(--)") + month
+ Mstring("(-)") + day
+ timezone
;
529 } else if (strcmp(type
, "date") == 0) {
530 pattern
= yearext
+ year
+ Mstring("(-)") + month
+ Mstring("(-)") + day
+ timezone
;
531 } else if (strcmp(type
, "time") == 0) {
532 pattern
= Mstring("(") + hour
+ Mstring(":") + minute
+ Mstring(":") + second
+
533 fraction
+ Mstring("|") + endofdayext
+ Mstring(")") + timezone
;
534 } else if (strcmp(type
, "dateTime") == 0) {
535 pattern
= yearext
+ year
+ Mstring("(-)") + month
+ Mstring("(-)") + day
+
536 Mstring("T(") + hour
+ Mstring(":") + minute
+ Mstring(":") + second
+
537 fraction
+ Mstring("|") + endofdayext
+ Mstring(")") + timezone
;
538 } else if (strcmp(type
, "duration") == 0) {
539 pattern
= Mstring("(-)?P(") + nums
+ Mstring("(Y(") + nums
+ Mstring("(M(") +
540 nums
+ Mstring("D") + durtime
+ Mstring("?|") + durtime
+ Mstring("?|D") +
541 durtime
+ Mstring("?)|") + durtime
+ Mstring("?)|M") + nums
+ Mstring("D") +
542 durtime
+ Mstring("?|") + durtime
+ Mstring("?)|D") + durtime
+
543 Mstring("?)|") + durtime
+ Mstring(")");
548 pattern
= Mstring("^") + pattern
+ Mstring("$");
549 return matchRegexp(string
, pattern
.c_str());
552 bool matchRegexp(const char * string
, const char * pattern
) {
555 if (regcomp(&re
, pattern
, REG_EXTENDED
| REG_NOSUB
) != 0) {
556 return (false); /* report error */
558 status
= regexec(&re
, string
, (size_t) 0, NULL
, 0);
561 return (false); /* report error */
566 void printError(const Mstring
& filename
, int lineNumber
, const Mstring
& text
) {
576 void printError(const Mstring
& filename
, const Mstring
& typeName
, const Mstring
& text
) {
586 void printWarning(const Mstring
& filename
, int lineNumber
, const Mstring
& text
) {
587 if (w_flag_used
) return;
597 void printWarning(const Mstring
& filename
, const Mstring
& typeName
, const Mstring
& text
) {
598 if (w_flag_used
) return;
608 void indent(FILE* file
, const int x
) {
609 for (int l
= 0; l
< x
; ++l
) {
614 long double stringToLongDouble(const char *input
) {
615 long double result
= 0.0;
616 // `strtold()' is not available on older platforms.
617 sscanf(input
, "%Lf", &result
);
621 const Mstring
& getNameSpaceByPrefix(const RootType
* root
, const Mstring
& prefix
){
622 for(List
<NamespaceType
>::iterator mod
= root
->getModule()->getDeclaredNamespaces().begin(); mod
; mod
= mod
->Next
){
623 if(mod
->Data
.prefix
== prefix
){
624 return mod
->Data
.uri
;
630 const Mstring
& getPrefixByNameSpace(const RootType
* root
, const Mstring
& namespace_
){
631 for(List
<NamespaceType
>::iterator mod
= root
->getModule()->getDeclaredNamespaces().begin(); mod
; mod
= mod
->Next
){
632 if(mod
->Data
.uri
== namespace_
){
633 return mod
->Data
.prefix
;
639 const Mstring
findBuiltInType(const RootType
* ref
, Mstring type
){
640 RootType
* root
= TTCN3ModuleInventory::getInstance().lookup(ref
, type
, want_BOTH
);
641 if(root
!= NULL
&& isBuiltInType(root
->getType().originalValueWoPrefix
)){
642 return root
->getType().originalValueWoPrefix
;
643 }else if(root
!= NULL
){
644 return findBuiltInType(root
, root
->getType().originalValueWoPrefix
);
650 RootType
* lookup(const List
<TTCN3Module
*> mods
, const SimpleType
* reference
, wanted w
) {
651 const Mstring
& uri
= reference
->getReference().get_uri();
652 const Mstring
& name
= reference
->getReference().get_val();
654 return lookup(mods
, name
, uri
, reference
, w
);
657 RootType
* lookup(const List
<TTCN3Module
*> mods
,
658 const Mstring
& name
, const Mstring
& nsuri
, const RootType
*reference
, wanted w
) {
659 RootType
*ret
= NULL
;
660 for (List
<TTCN3Module
*>::iterator module
= mods
.begin(); module
; module
= module
->Next
) {
661 ret
= lookup1(module
->Data
, name
, nsuri
, reference
, w
);
662 if (ret
!= NULL
) break;
668 RootType
*lookup1(const TTCN3Module
*module
,
669 const Mstring
& name
, const Mstring
& nsuri
, const RootType
*reference
, wanted w
) {
670 if (nsuri
!= module
->getTargetNamespace()) return NULL
;
672 for (List
<RootType
*>::iterator type
= module
->getDefinedTypes().begin(); type
; type
= type
->Next
) {
673 switch (type
->Data
->getConstruct()) {
677 if (w
== want_ST
|| w
== want_BOTH
) {
678 if ((const RootType
*) reference
!= type
->Data
679 && name
== type
->Data
->getName().originalValueWoPrefix
) {
687 case c_attributeGroup
:
688 if (w
== want_CT
|| w
== want_BOTH
) {
689 if ((const RootType
*) reference
!= type
->Data
690 && name
== type
->Data
->getName().originalValueWoPrefix
) {
701 //Check for an include with NoTargetNamespace to look for the type
702 //XSD to TTCN ETSI standard 5.1.2
703 for(List
<RootType
*>::iterator it
= module
->getDefinedTypes().begin(); it
; it
= it
->Next
) {
704 if (it
->Data
!= NULL
&& it
->Data
->getConstruct() == c_include
&&
705 ((ImportStatement
*)(it
->Data
))->getSourceModule() != NULL
&&
706 ((ImportStatement
*)(it
->Data
))->getSourceModule()->getTargetNamespace() == Mstring("NoTargetNamespace")) {
707 return lookup1(((ImportStatement
*)(it
->Data
))->getSourceModule(), name
, Mstring("NoTargetNamespace"), reference
, w
);
713 int multi(const TTCN3Module
*module
, ReferenceData
const& outside_reference
,
714 const RootType
*obj
) {
715 int multiplicity
= 0;
717 RootType
* st
= ::lookup1(module
, outside_reference
.get_val(), outside_reference
.get_uri(), obj
, want_ST
);
718 RootType
* ct
= ::lookup1(module
, outside_reference
.get_val(), outside_reference
.get_uri(), obj
, want_CT
);
720 multiplicity
= 1; // locally defined, no qualif needed
721 } else for (List
<const TTCN3Module
*>::iterator it
= module
->getImportedModules().begin(); it
; it
= it
->Next
) {
723 st
= ::lookup1(it
->Data
, outside_reference
.get_val(), it
->Data
->getTargetNamespace(), obj
, want_ST
);
724 ct
= ::lookup1(it
->Data
, outside_reference
.get_val(), it
->Data
->getTargetNamespace(), obj
, want_CT
);
732 void generate_TTCN3_header(FILE * file
, const char * modulename
, const bool timestamp
/* = true */) {
733 time_t time_current
= time(NULL
);
735 "/*******************************************************************************\n"
739 "* Copyright Ericsson Telecom AB\n"
741 "* XSD to TTCN-3 Translator\n"
746 "* Copyright (c) 2000-%-4d Ericsson Telecom AB\n"
748 "* XSD to TTCN-3 Translator version: %-40s\n"
750 1900 + (localtime(&time_current
))->tm_year
,
755 "* All rights reserved. This program and the accompanying materials\n"
756 "* are made available under the terms of the Eclipse Public License v1.0\n"
757 "* which accompanies this distribution, and is available at\n"
758 "* http://www.eclipse.org/legal/epl-v10.html\n"
759 "*******************************************************************************/\n"
768 if (t_flag_used
|| !timestamp
) {
779 "// Contact: http://ttcn.ericsson.se\n"
781 "////////////////////////////////////////////////////////////////////////////////\n"