1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423
|
/******************************************************************************
* Copyright (c) 2000-2016 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Balasko, Jeno
* Godar, Marton
* Szabo, Bence Janos
*
******************************************************************************/
/**
* Predefined and standardized TTCN-3 modules
* containing mappings of XSD element from the http://www.w3.org/2001/XMLSchema namespace
*
* Modules are generated always when conversion is called
*
*/
const char * moduleUsefulTtcn3Types = {
"module UsefulTtcn3Types {\n\n\n"
" type integer byte (-128 .. 127) with { variant \"/* 8 bit */\" };\n\n"
" type integer unsignedbyte (0 .. 255) with { variant \"/*unsigned 8 bit*/\" };\n\n"
" type integer short (-32768 .. 32767) with { variant \"/*16 bit*/\" };\n\n"
" type integer unsignedshort (0 .. 65535) with { variant \"/*unsigned 16 bit*/\" };\n\n"
" type integer long (-2147483648 .. 2147483647) with { variant \"/*32 bit*/\" };\n\n"
" type integer unsignedlong (0 .. 4294967295) with { variant \"/*unsigned 32 bit*/\" };\n\n"
" type integer longlong ( -9223372036854775808 .. 9223372036854775807 ) with { variant \"/*64 bit*/\" };\n\n"
" type integer unsignedlonglong ( 0 .. 18446744073709551615 ) with { variant \"/*unsigned 64 bit*/\" };\n\n"
" type float IEEE754float with { variant \"/*IEEE754 float*/\" };\n\n"
" type float IEEE754double with { variant \"/*IEEE754 double*/\" };\n\n"
" type float IEEE754extfloat with { variant \"/*IEEE754 extended float*/\" };\n\n"
" type float IEEE754extdouble with { variant \"/*IEEE754 extended double*/\" };\n\n"
" type universal charstring utf8string with { variant \"/*UTF-8*/\" };\n\n"
" type universal charstring bmpstring ( char ( 0,0,0,0 ) .. char ( 0,0,255,255) ) with { variant \"/*UCS-2*/\" };\n\n"
" type universal charstring utf16string ( char ( 0,0,0,0 ) .. char ( 0,16,255,255) ) with { variant \"/*UTF-16*/\" };\n\n"
" type universal charstring iso8859string ( char ( 0,0,0,0 ) .. char ( 0,0,0,255) ) with { variant \"/*8 bit*/\" };\n\n"
" type record IDLfixed\n"
" {\n"
" unsignedshort digits,\n"
" short scale,\n"
" charstring value_\n"
" }\n"
" with {\n"
" variant \"/*IDL:fixed FORMAL/01-12-01 v.2.6*/\";\n"
" };\n\n"
" /*\n"
" type charstring char length (1);\n\n"
" NOTE 1: The name of this useful type is the same as the TTCN-3 keyword used to denote universal\n"
" charstring values in the quadraple form. In general it is disallowed to use TTCN-3 keywords as\n"
" identifiers. The \"char\" useful type is a solitary exception and allowed only for backward compatibility\n"
" with previous versions of the TTCN-3 standard. (except Titan doesn't)\n\n"
" NOTE 2: The special string \"8 bit\" defined in clause 28.2.3 may be used with this type to specify a given encoding\n"
" for its values. Also, other properties of the base type can be changed by using attribute mechanisms.\n"
" */\n\n"
" type universal charstring uchar length (1);\n\n"
" /*\n"
" NOTE: Special strings defined in clause 28.2.3 except \"8 bit\" may be used with this type to specify a given\n"
" encoding for its values. Also, other properties of the base type can be changed by using attribute\n"
" mechanisms.\n"
" */\n\n"
" type bitstring bit length (1);\n\n"
" type hexstring hex length (1);\n\n"
" type octetstring octet length (1);\n\n"
"}\n"
"with {\n"
"encode \"XML\";\n"
"}\n"
};
const char * moduleXSD = {
"module XSD {\n\n"
"import from UsefulTtcn3Types all;\n\n"
"//These constants are used in the XSD date/time type definitions\n"
"const charstring\n"
" dash := \"-\",\n"
" cln := \":\",\n"
" year := \"[0-9]#4\",\n"
" yearExpansion := \"(-([1-9][0-9]#(0,))#(,1))#(,1)\",\n"
" month := \"(0[1-9]|1[0-2])\",\n"
" dayOfMonth := \"(0[1-9]|[12][0-9]|3[01])\",\n"
" hour := \"([01][0-9]|2[0-3])\",\n"
" minute := \"([0-5][0-9])\",\n"
" second := \"([0-5][0-9])\",\n"
" sFraction := \"(.[0-9]#(1,))#(,1)\",\n"
" endOfDayExt := \"24:00:00(.0#(1,))#(,1)\",\n"
" nums := \"[0-9]#(1,)\",\n"
" ZorTimeZoneExt := \"(Z|[+-]((0[0-9]|1[0-3]):[0-5][0-9]|14:00))#(,1)\",\n"
" durTime := \"(T[0-9]#(1,)\"&\n"
" \"(H([0-9]#(1,)(M([0-9]#(1,)(S|.[0-9]#(1,)S))#(,1)|.[0-9]#(1,)S|S))#(,1)|\"&\n"
" \"M([0-9]#(1,)(S|.[0-9]#(1,)S)|.[0-9]#(1,)M)#(,1)|\"&\n"
" \"S|\"&\n"
" \".[0-9]#(1,)S))\"\n\n"
"//anySimpleType\n\n"
"type XMLCompatibleString AnySimpleType\n"
"with {\n"
"variant \"XSD:anySimpleType\";\n"
"};\n\n"
"//anyType;\n\n"
"type record AnyType\n"
"{\n"
" record of String embed_values optional,\n"
" record of String attr optional,\n"
" record of String elem_list\n"
"}\n"
"with {\n"
"variant \"XSD:anyType\";\n"
"variant \"embedValues\";\n"
"variant (attr) \"anyAttributes\";\n"
"variant (elem_list) \"anyElement\";\n"
"};\n"
"// String types\n\n"
"type XMLCompatibleString String\n"
"with {\n"
"variant \"XSD:string\";\n"
"};\n\n"
"type XMLStringWithNoCRLFHT NormalizedString\n"
"with {\n"
"variant \"XSD:normalizedString\";\n"
"};\n\n"
"type NormalizedString Token\n"
"with {\n"
"variant \"XSD:token\";\n"
"};\n\n"
"type XMLStringWithNoWhitespace Name\n"
"with {\n"
"variant \"XSD:Name\";\n"
"};\n\n"
"type XMLStringWithNoWhitespace NMTOKEN\n"
"with {\n"
"variant \"XSD:NMTOKEN\";\n"
"};\n\n"
"type Name NCName\n"
"with {\n"
"variant \"XSD:NCName\";\n"
"};\n\n"
"type NCName ID\n"
"with {\n"
"variant \"XSD:ID\";\n"
"};\n\n"
"type NCName IDREF\n"
"with {\n"
"variant \"XSD:IDREF\";\n"
"};\n\n"
"type NCName ENTITY\n"
"with {\n"
"variant \"XSD:ENTITY\";\n"
"};\n\n"
"type octetstring HexBinary\n"
"with {\n"
"variant \"XSD:hexBinary\";\n"
"};\n\n"
"type octetstring Base64Binary\n"
"with {\n"
"variant \"XSD:base64Binary\";\n"
"};\n\n"
"type XMLStringWithNoCRLFHT AnyURI\n"
"with {\n"
"variant \"XSD:anyURI\";\n"
"};\n\n"
"type charstring Language (pattern \"[a-zA-Z]#(1,8)(-\\w#(1,8))#(0,)\")\n"
"with {\n"
"variant \"XSD:language\";\n"
"};\n"
"// Integer types\n\n"
"type integer Integer\n"
"with {\n"
"variant \"XSD:integer\";\n"
"};\n\n"
"type integer PositiveInteger (1 .. infinity)\n"
"with {\n"
"variant \"XSD:positiveInteger\";\n"
"};\n\n"
"type integer NonPositiveInteger (-infinity .. 0)\n"
"with {\n"
"variant \"XSD:nonPositiveInteger\";\n"
"};\n\n"
"type integer NegativeInteger (-infinity .. -1)\n"
"with {\n"
"variant \"XSD:negativeInteger\";\n"
"};\n\n"
"type integer NonNegativeInteger (0 .. infinity)\n"
"with {\n"
"variant \"XSD:nonNegativeInteger\";\n"
"};\n\n"
"type longlong Long\n"
"with {\n"
"variant \"XSD:long\";\n"
"};\n\n"
"type unsignedlonglong UnsignedLong\n"
"with {\n"
"variant \"XSD:unsignedLong\";\n"
"};\n\n"
"type long Int\n"
"with {\n"
"variant \"XSD:int\";\n"
"};\n\n"
"type unsignedlong UnsignedInt\n"
"with {\n"
"variant \"XSD:unsignedInt\";\n"
"};\n\n"
"type short Short\n"
"with {\n"
"variant \"XSD:short\";\n"
"};\n\n"
"type unsignedshort UnsignedShort\n"
"with {\n"
"variant \"XSD:unsignedShort\";\n"
"};\n\n"
"type byte Byte\n"
"with {\n"
"variant \"XSD:byte\";\n"
"};\n\n"
"type unsignedbyte UnsignedByte\n"
"with {\n"
"variant \"XSD:unsignedByte\";\n"
"};\n\n"
"// Float types\n\n"
"type float Decimal\n"
"with {\n"
"variant \"XSD:decimal\";\n"
"};\n\n"
"type IEEE754float Float\n"
"with {\n"
"variant \"XSD:float\";\n"
"};\n\n"
"type IEEE754double Double\n"
"with {\n"
"variant \"XSD:double\";\n"
"};\n\n"
"// Time types\n\n"
"type charstring Duration (pattern\n"
" \"{dash}#(,1)P({nums}(Y({nums}(M({nums}D{durTime}#(,1)|{durTime}#(,1))|D{durTime}#(,1))|\" &\n"
" \"{durTime}#(,1))|M({nums}D{durTime}#(,1)|{durTime}#(,1))|D{durTime}#(,1))|{durTime})\")\n"
"with {\n"
"variant \"XSD:duration\";\n"
"};\n\n"
"type charstring DateTime (pattern\n"
" \"{yearExpansion}{year}{dash}{month}{dash}{dayOfMonth}T({hour}{cln}{minute}{cln}{second}\" &\n"
" \"{sFraction}|{endOfDayExt}){ZorTimeZoneExt}\" )\n"
"with {\n"
"variant \"XSD:dateTime\";\n"
"};\n\n"
"type charstring Time (pattern\n"
" \"({hour}{cln}{minute}{cln}{second}{sFraction}|{endOfDayExt}){ZorTimeZoneExt}\" )\n"
"with {\n"
"variant \"XSD:time\";\n"
"};\n\n"
"type charstring Date (pattern\n"
" \"{yearExpansion}{year}{dash}{month}{dash}{dayOfMonth}{ZorTimeZoneExt}\" )\n"
"with {\n"
"variant \"XSD:date\";\n"
"};\n\n"
"type charstring GYearMonth (pattern\n"
" \"{yearExpansion}{year}{dash}{month}{ZorTimeZoneExt}\" )\n"
"with {\n"
"variant \"XSD:gYearMonth\";\n"
"};\n\n"
"type charstring GYear (pattern\n"
" \"{yearExpansion}{year}{ZorTimeZoneExt}\" )\n"
"with {\n"
"variant \"XSD:gYear\";\n"
"};\n\n"
"type charstring GMonthDay (pattern\n"
" \"{dash}{dash}{month}{dash}{dayOfMonth}{ZorTimeZoneExt}\" )\n"
"with {\n"
"variant \"XSD:gMonthDay\";\n"
"};\n\n"
"type charstring GDay (pattern\n"
" \"{dash}{dash}{dash}{dayOfMonth}{ZorTimeZoneExt}\" )\n"
"with {\n"
"variant \"XSD:gDay\";\n"
"};\n\n"
"type charstring GMonth (pattern\n"
" \"{dash}{dash}{month}{ZorTimeZoneExt}\" )\n"
"with {\n"
"variant \"XSD:gMonth\";\n"
"};\n\n"
"// Sequence types\n\n"
"type record of NMTOKEN NMTOKENS\n"
"with {\n"
"variant \"XSD:NMTOKENS\";\n"
"};\n\n"
"type record of IDREF IDREFS\n"
"with {\n"
"variant \"XSD:IDREFS\";\n"
"};\n\n"
"type record of ENTITY ENTITIES\n"
"with {\n"
"variant \"XSD:ENTITIES\";\n"
"};\n\n"
"type record QName\n"
"{\n"
" AnyURI uri optional,\n"
" NCName name\n"
"}\n"
"with {\n"
"variant \"XSD:QName\";\n"
"};\n\n"
"// Boolean type\n\n"
"type boolean Boolean\n"
"with {\n"
"variant \"XSD:boolean\";\n"
"};\n\n"
"//TTCN-3 type definitions supporting the mapping of W3C XML Schema built-in datatypes\n\n"
"type utf8string XMLCompatibleString\n"
"(\n"
" char(0,0,0,9)..char(0,0,0,9),\n"
" char(0,0,0,10)..char(0,0,0,10),\n"
" char(0,0,0,13)..char(0,0,0,13),\n"
" char(0,0,0,32)..char(0,0,215,255),\n"
" char(0,0,224,0)..char(0,0,255,253),\n"
" char(0,1,0,0)..char(0,16,255,253)\n"
")\n\n"
"type utf8string XMLStringWithNoWhitespace\n"
"(\n"
" char(0,0,0,33)..char(0,0,215,255),\n"
" char(0,0,224,0)..char(0,0,255,253),\n"
" char(0,1,0,0)..char(0,16,255,253)\n"
")\n\n"
"type utf8string XMLStringWithNoCRLFHT\n"
"(\n"
" char(0,0,0,32)..char(0,0,215,255),\n"
" char(0,0,224,0)..char(0,0,255,253),\n"
" char(0,1,0,0)..char(0,16,255,253)\n"
")\n\n"
"}\n"
"with{\n"
"encode \"XML\"\n"
"}\n"
};
|