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 ///////////////////////////////////////////////////////////////////////////////
9 * Predefined and standardized TTCN-3 modules
10 * containing mappings of XSD element from the http://www.w3.org/2001/XMLSchema namespace
12 * Modules are generated always when conversion is called
15 const char * moduleUsefulTtcn3Types
= {
16 "module UsefulTtcn3Types {\n\n\n"
19 " type integer byte (-128 .. 127) with { variant \"/* 8 bit */\" };\n\n"
21 " type integer unsignedbyte (0 .. 255) with { variant \"/*unsigned 8 bit*/\" };\n\n"
23 " type integer short (-32768 .. 32767) with { variant \"/*16 bit*/\" };\n\n"
25 " type integer unsignedshort (0 .. 65535) with { variant \"/*unsigned 16 bit*/\" };\n\n"
27 " type integer long (-2147483648 .. 2147483647) with { variant \"/*32 bit*/\" };\n\n"
29 " type integer unsignedlong (0 .. 4294967295) with { variant \"/*unsigned 32 bit*/\" };\n\n"
31 " type integer longlong /* ( -9223372036854775808 .. 9223372036854775807 ) */ with { variant \"/*64 bit*/\" };\n\n"
33 " type integer unsignedlonglong /* ( 0 .. 18446744073709551615 ) */ with { variant \"/*unsigned 64 bit*/\" };\n\n"
35 " type float IEEE754float with { variant \"/*IEEE754 float*/\" };\n\n"
37 " type float IEEE754double with { variant \"/*IEEE754 double*/\" };\n\n"
39 " type float IEEE754extfloat with { variant \"/*IEEE754 extended float*/\" };\n\n"
41 " type float IEEE754extdouble with { variant \"/*IEEE754 extended double*/\" };\n\n"
43 " type universal charstring utf8string with { variant \"/*UTF-8*/\" };\n\n"
45 " type universal charstring bmpstring ( char ( 0,0,0,0 ) .. char ( 0,0,255,255) ) with { variant \"/*UCS-2*/\" };\n\n"
47 " type universal charstring utf16string ( char ( 0,0,0,0 ) .. char ( 0,16,255,255) ) with { variant \"/*UTF-16*/\" };\n\n"
49 " type universal charstring iso8859string ( char ( 0,0,0,0 ) .. char ( 0,0,0,255) ) with { variant \"/*8 bit*/\" };\n\n"
51 " type record IDLfixed\n"
53 " unsignedshort digits,\n"
55 " charstring value_\n"
58 " variant \"/*IDL:fixed FORMAL/01-12-01 v.2.6*/\";\n"
62 " type charstring char length (1);\n\n"
64 " NOTE 1: The name of this useful type is the same as the TTCN-3 keyword used to denote universal\n"
65 " charstring values in the quadraple form. In general it is disallowed to use TTCN-3 keywords as\n"
66 " identifiers. The \"char\" useful type is a solitary exception and allowed only for backward compatibility\n"
67 " with previous versions of the TTCN-3 standard. (except Titan doesn't)\n\n"
69 " 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"
70 " for its values. Also, other properties of the base type can be changed by using attribute mechanisms.\n"
73 " type universal charstring uchar length (1);\n\n"
76 " NOTE: Special strings defined in clause 28.2.3 except \"8 bit\" may be used with this type to specify a given\n"
77 " encoding for its values. Also, other properties of the base type can be changed by using attribute\n"
81 " type bitstring bit length (1);\n\n"
83 " type hexstring hex length (1);\n\n"
85 " type octetstring octet length (1);\n\n"
94 const char * moduleXSD
= {
98 "import from UsefulTtcn3Types all;\n\n"
100 "//These constants are used in the XSD date/time type definitions\n"
104 " year := \"[0-9]#4\",\n"
105 " yearExpansion := \"(-([1-9][0-9]#(0,))#(,1))#(,1)\",\n"
106 " month := \"(0[1-9]|1[0-2])\",\n"
107 " dayOfMonth := \"(0[1-9]|[12][0-9]|3[01])\",\n"
108 " hour := \"([01][0-9]|2[0-3])\",\n"
109 " minute := \"([0-5][0-9])\",\n"
110 " second := \"([0-5][0-9])\",\n"
111 " sFraction := \"(.[0-9]#(1,))#(,1)\",\n"
112 " endOfDayExt := \"24:00:00(.0#(1,))#(,1)\",\n"
113 " nums := \"[0-9]#(1,)\",\n"
114 " ZorTimeZoneExt := \"(Z|[+-]((0[0-9]|1[0-3]):[0-5][0-9]|14:00))#(,1)\",\n"
115 " durTime := \"(T[0-9]#(1,)\"&\n"
116 " \"(H([0-9]#(1,)(M([0-9]#(1,)(S|.[0-9]#(1,)S))#(,1)|.[0-9]#(1,)S|S))#(,1)|\"&\n"
117 " \"M([0-9]#(1,)(S|.[0-9]#(1,)S)|.[0-9]#(1,)M)#(,1)|\"&\n"
119 " \".[0-9]#(1,)S))\"\n\n"
121 "//anySimpleType\n\n"
123 "type XMLCompatibleString AnySimpleType\n"
125 "variant \"XSD:anySimpleType\";\n"
130 "type record AnyType\n"
132 " record of String embed_values optional,\n"
133 " record of String attr optional,\n"
134 " record of String elem_list\n"
137 "variant \"XSD:anyType\";\n"
138 "variant \"embedValues\";\n"
139 "variant (attr) \"anyAttributes\";\n"
140 "variant (elem_list) \"anyElement\";\n"
143 "// String types\n\n"
145 "type XMLCompatibleString String\n"
147 "variant \"XSD:string\";\n"
150 "type XMLStringWithNoCRLFHT NormalizedString\n"
152 "variant \"XSD:normalizedString\";\n"
155 "type NormalizedString Token\n"
157 "variant \"XSD:token\";\n"
160 "type XMLStringWithNoWhitespace Name\n"
162 "variant \"XSD:Name\";\n"
165 "type XMLStringWithNoWhitespace NMTOKEN\n"
167 "variant \"XSD:NMTOKEN\";\n"
172 "variant \"XSD:NCName\";\n"
177 "variant \"XSD:ID\";\n"
180 "type NCName IDREF\n"
182 "variant \"XSD:IDREF\";\n"
185 "type NCName ENTITY\n"
187 "variant \"XSD:ENTITY\";\n"
190 "type octetstring HexBinary\n"
192 "variant \"XSD:hexBinary\";\n"
195 "type octetstring Base64Binary\n"
197 "variant \"XSD:base64Binary\";\n"
200 "type XMLStringWithNoCRLFHT AnyURI\n"
202 "variant \"XSD:anyURI\";\n"
205 "type charstring Language (pattern \"[a-zA-Z]#(1,8)(-\\w#(1,8))#(0,)\")\n"
207 "variant \"XSD:language\";\n"
210 "// Integer types\n\n"
212 "type integer Integer\n"
214 "variant \"XSD:integer\";\n"
217 "type integer PositiveInteger (1 .. infinity)\n"
219 "variant \"XSD:positiveInteger\";\n"
222 "type integer NonPositiveInteger (-infinity .. 0)\n"
224 "variant \"XSD:nonPositiveInteger\";\n"
227 "type integer NegativeInteger (-infinity .. -1)\n"
229 "variant \"XSD:negativeInteger\";\n"
232 "type integer NonNegativeInteger (0 .. infinity)\n"
234 "variant \"XSD:nonNegativeInteger\";\n"
237 "type longlong Long\n"
239 "variant \"XSD:long\";\n"
242 "type unsignedlonglong UnsignedLong\n"
244 "variant \"XSD:unsignedLong\";\n"
249 "variant \"XSD:int\";\n"
252 "type unsignedlong UnsignedInt\n"
254 "variant \"XSD:unsignedInt\";\n"
259 "variant \"XSD:short\";\n"
262 "type unsignedshort UnsignedShort\n"
264 "variant \"XSD:unsignedShort\";\n"
269 "variant \"XSD:byte\";\n"
272 "type unsignedbyte UnsignedByte\n"
274 "variant \"XSD:unsignedByte\";\n"
279 "type float Decimal\n"
281 "variant \"XSD:decimal\";\n"
284 "type IEEE754float Float\n"
286 "variant \"XSD:float\";\n"
289 "type IEEE754double Double\n"
291 "variant \"XSD:double\";\n"
297 "type charstring Duration (pattern\n"
298 " \"{dash}#(,1)P({nums}(Y({nums}(M({nums}D{durTime}#(,1)|{durTime}#(,1))|D{durTime}#(,1))|\" &\n"
299 " \"{durTime}#(,1))|M({nums}D{durTime}#(,1)|{durTime}#(,1))|D{durTime}#(,1))|{durTime})\")\n"
301 "variant \"XSD:duration\";\n"
304 "type charstring DateTime (pattern\n"
305 " \"{yearExpansion}{year}{dash}{month}{dash}{dayOfMonth}T({hour}{cln}{minute}{cln}{second}\" &\n"
306 " \"{sFraction}|{endOfDayExt}){ZorTimeZoneExt}\" )\n"
308 "variant \"XSD:dateTime\";\n"
311 "type charstring Time (pattern\n"
312 " \"({hour}{cln}{minute}{cln}{second}{sFraction}|{endOfDayExt}){ZorTimeZoneExt}\" )\n"
314 "variant \"XSD:time\";\n"
317 "type charstring Date (pattern\n"
318 " \"{yearExpansion}{year}{dash}{month}{dash}{dayOfMonth}{ZorTimeZoneExt}\" )\n"
320 "variant \"XSD:date\";\n"
323 "type charstring GYearMonth (pattern\n"
324 " \"{yearExpansion}{year}{dash}{month}{ZorTimeZoneExt}\" )\n"
326 "variant \"XSD:gYearMonth\";\n"
329 "type charstring GYear (pattern\n"
330 " \"{yearExpansion}{year}{ZorTimeZoneExt}\" )\n"
332 "variant \"XSD:gYear\";\n"
335 "type charstring GMonthDay (pattern\n"
336 " \"{dash}{dash}{month}{dash}{dayOfMonth}{ZorTimeZoneExt}\" )\n"
338 "variant \"XSD:gMonthDay\";\n"
341 "type charstring GDay (pattern\n"
342 " \"{dash}{dash}{dash}{dayOfMonth}{ZorTimeZoneExt}\" )\n"
344 "variant \"XSD:gDay\";\n"
347 "type charstring GMonth (pattern\n"
348 " \"{dash}{dash}{month}{ZorTimeZoneExt}\" )\n"
350 "variant \"XSD:gMonth\";\n"
353 "// Sequence types\n\n"
355 "type record of NMTOKEN NMTOKENS\n"
357 "variant \"XSD:NMTOKENS\";\n"
360 "type record of IDREF IDREFS\n"
362 "variant \"XSD:IDREFS\";\n"
365 "type record of ENTITY ENTITIES\n"
367 "variant \"XSD:ENTITIES\";\n"
370 "type record QName\n"
372 " AnyURI uri optional,\n"
376 "variant \"XSD:QName\";\n"
379 "// Boolean type\n\n"
381 "type boolean Boolean\n"
383 "variant \"XSD:boolean\";\n"
386 "//TTCN-3 type definitions supporting the mapping of W3C XML Schema built-in datatypes\n\n"
388 "type utf8string XMLCompatibleString\n"
390 " char(0,0,0,9)..char(0,0,0,9),\n"
391 " char(0,0,0,10)..char(0,0,0,10),\n"
392 " char(0,0,0,12)..char(0,0,0,12),\n"
393 " char(0,0,0,32)..char(0,0,215,255),\n"
394 " char(0,0,224,0)..char(0,0,255,253),\n"
395 " char(0,1,0,0)..char(0,16,255,253)\n"
398 "type utf8string XMLStringWithNoWhitespace\n"
400 " char(0,0,0,33)..char(0,0,215,255),\n"
401 " char(0,0,224,0)..char(0,0,255,253),\n"
402 " char(0,1,0,0)..char(0,16,255,253)\n"
405 "type utf8string XMLStringWithNoCRLFHT\n"
407 " char(0,0,0,32)..char(0,0,215,255),\n"
408 " char(0,0,224,0)..char(0,0,255,253),\n"
409 " char(0,1,0,0)..char(0,16,255,253)\n"
This page took 0.040274 seconds and 5 git commands to generate.