aaronp-zomg 1.0.2.20080827232412
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +25 -0
- data/Manifest.txt +238 -0
- data/README.txt +59 -0
- data/Rakefile +43 -0
- data/bin/omfg +56 -0
- data/lib/scanner.rex +169 -0
- data/lib/yacc.y +861 -0
- data/lib/zomg.rb +22 -0
- data/lib/zomg/idl.rb +14 -0
- data/lib/zomg/idl/nodes/attribute.rb +15 -0
- data/lib/zomg/idl/nodes/binary.rb +19 -0
- data/lib/zomg/idl/nodes/constant.rb +15 -0
- data/lib/zomg/idl/nodes/interface.rb +13 -0
- data/lib/zomg/idl/nodes/interface_header.rb +14 -0
- data/lib/zomg/idl/nodes/member.rb +14 -0
- data/lib/zomg/idl/nodes/node.rb +54 -0
- data/lib/zomg/idl/nodes/operation.rb +17 -0
- data/lib/zomg/idl/nodes/parameter.rb +18 -0
- data/lib/zomg/idl/nodes/typedef.rb +13 -0
- data/lib/zomg/idl/nodes/union.rb +14 -0
- data/lib/zomg/idl/parser.rb +54 -0
- data/lib/zomg/idl/visitable.rb +15 -0
- data/lib/zomg/idl/visitors/duhr.rb +24 -0
- data/lib/zomg/idl/visitors/ruby_sexp.rb +204 -0
- data/lib/zomg/idl/visitors/sexp.rb +274 -0
- data/lib/zomg/version.rb +3 -0
- data/test/assets/array/array1.idl +60 -0
- data/test/assets/array/array2.idl +38 -0
- data/test/assets/array/array3.idl +8 -0
- data/test/assets/array/array4.idl +7 -0
- data/test/assets/array/array5.idl +80 -0
- data/test/assets/attribute/grid_0attribs_2methods.idl +16 -0
- data/test/assets/attribute/grid_1ROattribs_1attribs_0methods.idl +19 -0
- data/test/assets/attribute/grid_1ROattribs_1attribs_1methods.idl +19 -0
- data/test/assets/attribute/grid_1ROattribs_1attribs_2methods.idl +17 -0
- data/test/assets/attribute/grid_1ROattribs_1methods.idl +16 -0
- data/test/assets/attribute/grid_1ROattribs_2methods.idl +16 -0
- data/test/assets/attribute/grid_1attribs_1methods.idl +17 -0
- data/test/assets/attribute/grid_1attribs_2methods.idl +17 -0
- data/test/assets/attribute/grid_2ROattribs_0methods.idl +16 -0
- data/test/assets/attribute/grid_2ROattribs_1methods.idl +16 -0
- data/test/assets/attribute/grid_2ROattribs_2methods.idl +16 -0
- data/test/assets/attribute/grid_2attribs_0methods.idl +19 -0
- data/test/assets/attribute/grid_2attribs_1methods.idl +19 -0
- data/test/assets/attribute/grid_2attribs_2methods.idl +19 -0
- data/test/assets/comment/c_style_comments.idl +63 -0
- data/test/assets/comment/comment1.idl +57 -0
- data/test/assets/comment/cpp_style_comments.idl +168 -0
- data/test/assets/comment/shortform.idl +0 -0
- data/test/assets/complex/TestCodeSets.idl +10 -0
- data/test/assets/complex/TestIntfContext.idl +13 -0
- data/test/assets/complex/TestIntfLongLong.idl +51 -0
- data/test/assets/complex/TestIntfWChar.idl +52 -0
- data/test/assets/complex/any1.idl +22 -0
- data/test/assets/complex/complex1.idl +495 -0
- data/test/assets/complex/complex2.idl +730 -0
- data/test/assets/complex/complex3.idl +181 -0
- data/test/assets/complex/complex4.idl +181 -0
- data/test/assets/complex/interop_wchar.idl +60 -0
- data/test/assets/constant/constant1.idl +37 -0
- data/test/assets/constant/constant2.idl +29 -0
- data/test/assets/constant/constant3.idl +50 -0
- data/test/assets/constant/constant4.idl +21 -0
- data/test/assets/constant/constant5.idl +65 -0
- data/test/assets/constant/constant6.idl +144 -0
- data/test/assets/constant/constant7.idl +30 -0
- data/test/assets/enum/enum1.idl +13 -0
- data/test/assets/exception/TestIntfExceptions.idl +69 -0
- data/test/assets/exception/TestIntfExceptionsExt_2_0.idl +34 -0
- data/test/assets/exception/TestIntfExceptionsExt_2_3.idl +24 -0
- data/test/assets/exception/ex1.idl +6 -0
- data/test/assets/exception/ex2.idl +18 -0
- data/test/assets/exception/ex3.idl +10 -0
- data/test/assets/exception/ex4.idl +20 -0
- data/test/assets/exception/sc.idl +0 -0
- data/test/assets/exception/simple1.idl +18 -0
- data/test/assets/exception/simple2.idl +25 -0
- data/test/assets/factory/factory1.idl +77 -0
- data/test/assets/factory/objref.idl +25 -0
- data/test/assets/forward/forward.idl +15 -0
- data/test/assets/forward/forward1.idl +13 -0
- data/test/assets/forward/fwd_incl1.idl +6 -0
- data/test/assets/forward/fwd_incl2.idl +7 -0
- data/test/assets/include/a.idl +23 -0
- data/test/assets/include/b.idl +16 -0
- data/test/assets/include/employee.idl +12 -0
- data/test/assets/include/include1.idl +10 -0
- data/test/assets/include/include2.idl +5 -0
- data/test/assets/include/manager.idl +10 -0
- data/test/assets/include/pragma.idl +41 -0
- data/test/assets/include/rookie.idl +13 -0
- data/test/assets/include/rookiemanager.idl +15 -0
- data/test/assets/include/sample.idl +58 -0
- data/test/assets/include/sample_incl.idl +406 -0
- data/test/assets/inherit/IDL1.idl +18 -0
- data/test/assets/inherit/IDL2.idl +18 -0
- data/test/assets/inherit/IDL3.idl +18 -0
- data/test/assets/inherit/IDL4.idl +17 -0
- data/test/assets/inherit/diamond_inheritance.idl +31 -0
- data/test/assets/inherit/inherit.idl +27 -0
- data/test/assets/limit/longidentifiers.idl +25 -0
- data/test/assets/limit/namelens.idl +26 -0
- data/test/assets/limit/tpztest.idl +21 -0
- data/test/assets/module/module1.idl +29 -0
- data/test/assets/module/module2.idl +34 -0
- data/test/assets/module/module3.idl +20 -0
- data/test/assets/module/module4.idl +15 -0
- data/test/assets/nested/nested1.idl +5 -0
- data/test/assets/nested/nested2.idl +11 -0
- data/test/assets/operations/Benchmark.idl +331 -0
- data/test/assets/operations/CCS.idl +82 -0
- data/test/assets/operations/TestIntf.idl +40 -0
- data/test/assets/operations/TestIntfBasic.idl +653 -0
- data/test/assets/operations/atomic.idl +40 -0
- data/test/assets/operations/dif2.idl +48 -0
- data/test/assets/operations/interface1.idl +16 -0
- data/test/assets/operations/parameters.idl +111 -0
- data/test/assets/operations/perf.idl +84 -0
- data/test/assets/operations/timer.idl +104 -0
- data/test/assets/preprocess/base_for_diamond_inheritance_with_macros.idl +17 -0
- data/test/assets/preprocess/basic_macro_marshalling.idl +54 -0
- data/test/assets/preprocess/diamond_inheritance_with_macros.idl +74 -0
- data/test/assets/preprocess/macro1.idl +52 -0
- data/test/assets/preprocess/preprocess1.idl +246 -0
- data/test/assets/preprocess/preprocess2.idl +3 -0
- data/test/assets/recursion/loop.idl +28 -0
- data/test/assets/recursion/recursion1.idl +47 -0
- data/test/assets/recursion/recursion2.idl +74 -0
- data/test/assets/scenarios/filestat.idl +69 -0
- data/test/assets/scenarios/gateway.idl +176 -0
- data/test/assets/scenarios/library.idl +20 -0
- data/test/assets/scenarios/phone.idl +24 -0
- data/test/assets/scenarios/ticketservice.idl +118 -0
- data/test/assets/scope/scope01.idl +58 -0
- data/test/assets/scope/scope02.idl +25 -0
- data/test/assets/scope/scope03.idl +22 -0
- data/test/assets/scope/scope04.idl +27 -0
- data/test/assets/scope/scope05.idl +30 -0
- data/test/assets/scope/scope06.idl +51 -0
- data/test/assets/scope/scope07.idl +20 -0
- data/test/assets/scope/scope08.idl +88 -0
- data/test/assets/scope/scope09.idl +21 -0
- data/test/assets/scope/scope10.idl +95 -0
- data/test/assets/scope/scope11.idl +62 -0
- data/test/assets/scope/scope12.idl +117 -0
- data/test/assets/scope/scope13.idl +117 -0
- data/test/assets/scope/scope14.idl +117 -0
- data/test/assets/scope/scope15.idl +117 -0
- data/test/assets/scope/scope16.idl +117 -0
- data/test/assets/scope/scope17.idl +117 -0
- data/test/assets/scope/scope18.idl +117 -0
- data/test/assets/scope/scope19.idl +117 -0
- data/test/assets/scope/scope20.idl +215 -0
- data/test/assets/scope/scope21.idl +215 -0
- data/test/assets/scope/scope22.idl +205 -0
- data/test/assets/scope/scope23.idl +261 -0
- data/test/assets/scope/scope24.idl +376 -0
- data/test/assets/scope/scope25.idl +266 -0
- data/test/assets/scope/scope26.idl +180 -0
- data/test/assets/scope/scope27.idl +184 -0
- data/test/assets/scope/scope28.idl +182 -0
- data/test/assets/scope/scope29.idl +182 -0
- data/test/assets/scope/scope30.idl +40 -0
- data/test/assets/scope/scope31.idl +33 -0
- data/test/assets/scope/scope32.idl +37 -0
- data/test/assets/scope/scope33.idl +50 -0
- data/test/assets/scope/scope34.idl +97 -0
- data/test/assets/scope/scope35.idl +72 -0
- data/test/assets/scope/scope36.idl +167 -0
- data/test/assets/scope/scope37.idl +57 -0
- data/test/assets/scope/scope38.idl +38 -0
- data/test/assets/scope/scope39.idl +38 -0
- data/test/assets/scope/scope40.idl +38 -0
- data/test/assets/scope/scope41.idl +24 -0
- data/test/assets/scope/scope42.idl +64 -0
- data/test/assets/scope/scope43.idl +66 -0
- data/test/assets/scope/scope44.idl +52 -0
- data/test/assets/sequence/sequence1.idl +24 -0
- data/test/assets/sequence/sequence2.idl +9 -0
- data/test/assets/simple/basictypes1.idl +80 -0
- data/test/assets/simple/basictypes2.idl +197 -0
- data/test/assets/simple/basictypes3.idl +23 -0
- data/test/assets/simple/basictypes4.idl +73 -0
- data/test/assets/simple/basictypes5.idl +29 -0
- data/test/assets/simple/basictypes6.idl +63 -0
- data/test/assets/simple/simple1.idl +45 -0
- data/test/assets/simple/simple2.idl +61 -0
- data/test/assets/simple/simple3.idl +36 -0
- data/test/assets/string/string1.idl +11 -0
- data/test/assets/string/string2.idl +29 -0
- data/test/assets/struct/struct1.idl +20 -0
- data/test/assets/struct/struct2.idl +21 -0
- data/test/assets/struct/struct3.idl +42 -0
- data/test/assets/struct/struct4.idl +57 -0
- data/test/assets/struct/struct5.idl +71 -0
- data/test/assets/typecode/orb.idl +0 -0
- data/test/assets/typecode/pseudo.idl +25 -0
- data/test/assets/typedef/shorthand_typedef_struct_insideIF.idl +17 -0
- data/test/assets/typedef/shorthand_typedef_struct_insideIF_noMO.idl +16 -0
- data/test/assets/typedef/shorthand_typedef_struct_insideMO.idl +17 -0
- data/test/assets/typedef/shorthand_typedef_struct_outsideMO.idl +17 -0
- data/test/assets/typedef/typedef1.idl +8 -0
- data/test/assets/typedef/typedef2.idl +22 -0
- data/test/assets/typedef/typedef_struct_insideIF.idl +18 -0
- data/test/assets/typedef/typedef_struct_insideMO.idl +18 -0
- data/test/assets/typedef/typedef_struct_outsideMO.idl +18 -0
- data/test/assets/union/union1.idl +31 -0
- data/test/assets/union/union2.idl +22 -0
- data/test/assets/union/union3.idl +26 -0
- data/test/conversions/test_attribute.rb +46 -0
- data/test/conversions/test_enum.rb +25 -0
- data/test/conversions/test_exception.rb +24 -0
- data/test/conversions/test_forward_declaration.rb +22 -0
- data/test/conversions/test_interface.rb +30 -0
- data/test/conversions/test_module.rb +24 -0
- data/test/conversions/test_struct.rb +25 -0
- data/test/conversions/test_typedef.rb +22 -0
- data/test/conversions/test_union.rb +27 -0
- data/test/conversions/test_value_box_dcl.rb +22 -0
- data/test/helper.rb +23 -0
- data/test/simple/test_basictypes1.rb +87 -0
- data/test/simple/test_basictypes2.rb +18 -0
- data/test/simple/test_basictypes3.rb +32 -0
- data/test/simple/test_basictypes4.rb +25 -0
- data/test/simple/test_basictypes5.rb +17 -0
- data/test/simple/test_basictypes6.rb +19 -0
- data/test/simple/test_simple1.rb +40 -0
- data/test/simple/test_simple2.rb +48 -0
- data/test/simple/test_simple3.rb +20 -0
- data/test/test_array.rb +22 -0
- data/test/test_assets.rb +33 -0
- data/test/test_complex.rb +17 -0
- data/test/test_node.rb +16 -0
- data/test/test_parser.rb +17 -0
- data/test/test_scanner.rb +234 -0
- metadata +334 -0
@@ -0,0 +1,74 @@
|
|
1
|
+
// TEST: #ifndef
|
2
|
+
//
|
3
|
+
#ifndef IDL2REPO_BUGS_IDL
|
4
|
+
|
5
|
+
// TEST: #define
|
6
|
+
//
|
7
|
+
#define IDL2REPO_BUGS_IDL
|
8
|
+
|
9
|
+
// TEST: #include
|
10
|
+
//
|
11
|
+
#include "base_for_diamond_inheritance_with_macros.idl"
|
12
|
+
|
13
|
+
// TEST: C-style comments
|
14
|
+
//
|
15
|
+
|
16
|
+
// TEST: #if
|
17
|
+
//
|
18
|
+
|
19
|
+
#if !defined(MACRO1)
|
20
|
+
#define MACRO1 interface
|
21
|
+
#endif
|
22
|
+
|
23
|
+
#if defined(MACRO1)
|
24
|
+
#define MACRO2 MainGrid
|
25
|
+
#endif
|
26
|
+
|
27
|
+
MACRO1 MACRO2
|
28
|
+
{
|
29
|
+
void getofMainGrid(in short n);
|
30
|
+
long setofMainGrid(inout short n);
|
31
|
+
|
32
|
+
readonly attribute short length; // length of the gridmain
|
33
|
+
attribute short breadth; // breadth of the gridmain
|
34
|
+
|
35
|
+
exception exMG { string reason; };
|
36
|
+
};
|
37
|
+
|
38
|
+
|
39
|
+
interface BaseGrid : MainGrid {
|
40
|
+
void getofBaseGrid(in short n);
|
41
|
+
long setofBaseGrid(in short n);
|
42
|
+
|
43
|
+
readonly attribute short roAtrBG ; // length of the gridmain
|
44
|
+
attribute short atrBG; // breadth of the gridmain
|
45
|
+
|
46
|
+
exception exBG { string reason; };
|
47
|
+
};
|
48
|
+
|
49
|
+
|
50
|
+
interface GridBase : MainGrid {
|
51
|
+
|
52
|
+
void getofGridBase(in short n);
|
53
|
+
long setofGridBase(in short n);
|
54
|
+
|
55
|
+
readonly attribute short roAtrGB ; // length of the gridmain
|
56
|
+
attribute short atrGB; // breadth of the gridmain
|
57
|
+
|
58
|
+
exception exGB { string reason; };
|
59
|
+
};
|
60
|
+
|
61
|
+
interface Grid : BaseGrid, GridBase {
|
62
|
+
readonly attribute short height; // height of the grid
|
63
|
+
readonly attribute short width; // width of the grid
|
64
|
+
|
65
|
+
// IDL operations
|
66
|
+
|
67
|
+
// set the element [n,m] of the grid, to value:
|
68
|
+
void set(in short n, in short m, in long value);
|
69
|
+
|
70
|
+
// return element [n,m] of the grid:
|
71
|
+
long get(in short n, in short m);
|
72
|
+
};
|
73
|
+
|
74
|
+
#endif
|
@@ -0,0 +1,52 @@
|
|
1
|
+
|
2
|
+
typedef float Apple;
|
3
|
+
typedef double Carrots;
|
4
|
+
typedef long BlackCherry;
|
5
|
+
typedef short Rhubarb;
|
6
|
+
|
7
|
+
|
8
|
+
#if !defined(MACRO1)
|
9
|
+
#define MACRO1 ABC D EF S A
|
10
|
+
#endif
|
11
|
+
|
12
|
+
#if defined(MACRO1)
|
13
|
+
#undef MACRO1
|
14
|
+
#define MACRO1 Apple
|
15
|
+
#endif
|
16
|
+
|
17
|
+
#ifndef MACRO1
|
18
|
+
#error MACRO1 not defined
|
19
|
+
#else
|
20
|
+
#define MACRO2 interface \
|
21
|
+
idlServer
|
22
|
+
#endif
|
23
|
+
|
24
|
+
|
25
|
+
#ifdef MACRO2
|
26
|
+
#define MACRO3 in
|
27
|
+
#endif
|
28
|
+
|
29
|
+
#if 0
|
30
|
+
This code will not be compiled
|
31
|
+
#elif 1
|
32
|
+
|
33
|
+
|
34
|
+
MACRO2 {
|
35
|
+
|
36
|
+
typedef unsigned long Pumpkin;
|
37
|
+
typedef unsigned short WaterMelon;
|
38
|
+
typedef char Dates;
|
39
|
+
typedef boolean Lychees;
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
MACRO1 GardenPeas(
|
45
|
+
MACRO3 ::Apple p1,
|
46
|
+
out ::BlackCherry p2,
|
47
|
+
|
48
|
+
#endif
|
49
|
+
|
50
|
+
inout ::idlServer::Dates p3
|
51
|
+
);
|
52
|
+
};
|
@@ -0,0 +1,246 @@
|
|
1
|
+
/*
|
2
|
+
******************************************************************************
|
3
|
+
*
|
4
|
+
* Tests all possible preprocessor types
|
5
|
+
*
|
6
|
+
******************************************************************************
|
7
|
+
* file name: umachine.idl
|
8
|
+
* encoding: US-ASCII
|
9
|
+
* tab size: 8 (not used)
|
10
|
+
* indentation:4
|
11
|
+
*
|
12
|
+
* This file defines basic types and constants for utf.idl to be
|
13
|
+
* platform-independent. umachine.idl and utf.idl are included into
|
14
|
+
* utypes.idl to provide all the general definitions for ICU.
|
15
|
+
* All of these definitions used to be in utypes.idl before
|
16
|
+
* the UTF-handling macros made this unmaintainable.
|
17
|
+
*/
|
18
|
+
|
19
|
+
#ifndef __PREPROCESS1_IDL__
|
20
|
+
#define __PREPROCESS1_IDL__
|
21
|
+
|
22
|
+
|
23
|
+
/*==========================================================================*/
|
24
|
+
/* Include platform-dependent definitions */
|
25
|
+
/* which are contained in the platform-specific file platform.idl */
|
26
|
+
/*==========================================================================*/
|
27
|
+
|
28
|
+
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
|
29
|
+
# include "preprocess2.idl"
|
30
|
+
#elif defined(__OS400__)
|
31
|
+
# include "preprocess2.idl"
|
32
|
+
#elif defined(__MWERKS__)
|
33
|
+
# include "preprocess2.idl"
|
34
|
+
#else
|
35
|
+
# include "preprocess2.idl"
|
36
|
+
#endif
|
37
|
+
|
38
|
+
/*==========================================================================*/
|
39
|
+
/* XP_CPLUSPLUS is a cross-platform symbol which should be defined when */
|
40
|
+
/* using C++. It should not be defined when compiling under C. */
|
41
|
+
/*==========================================================================*/
|
42
|
+
|
43
|
+
#ifdef __cplusplus
|
44
|
+
# ifndef XP_CPLUSPLUS
|
45
|
+
# define XP_CPLUSPLUS
|
46
|
+
# endif
|
47
|
+
#else
|
48
|
+
# undef XP_CPLUSPLUS
|
49
|
+
#endif
|
50
|
+
|
51
|
+
/*==========================================================================*/
|
52
|
+
/* For C wrappers, we use the symbol U_STABLE. */
|
53
|
+
/* This works properly if the includer is C or C++. */
|
54
|
+
/* Functions are declared U_STABLE return-type U_EXPORT2 function-name()... */
|
55
|
+
/*==========================================================================*/
|
56
|
+
|
57
|
+
#ifdef XP_CPLUSPLUS
|
58
|
+
# define U_CFUNC extern "C"
|
59
|
+
# define U_CDECL_BEGIN extern "C" {
|
60
|
+
# define U_CDECL_END }
|
61
|
+
#else
|
62
|
+
# define U_CFUNC extern
|
63
|
+
# define U_CDECL_BEGIN
|
64
|
+
# define U_CDECL_END
|
65
|
+
#endif
|
66
|
+
|
67
|
+
/* Define namespace symbols if the compiler supports it. */
|
68
|
+
#if U_HAVE_NAMESPACE
|
69
|
+
# define U_NAMESPACE_BEGIN namespace U_ICU_NAMESPACE {
|
70
|
+
# define U_NAMESPACE_END }
|
71
|
+
# define U_NAMESPACE_USE using namespace U_ICU_NAMESPACE;
|
72
|
+
# define U_NAMESPACE_QUALIFIER U_ICU_NAMESPACE::
|
73
|
+
#else
|
74
|
+
# define U_NAMESPACE_BEGIN
|
75
|
+
# define U_NAMESPACE_END
|
76
|
+
# define U_NAMESPACE_USE
|
77
|
+
# define U_NAMESPACE_QUALIFIER
|
78
|
+
#endif
|
79
|
+
|
80
|
+
#define U_CAPI U_CFUNC U_EXPORT
|
81
|
+
#define U_STABLE U_CAPI
|
82
|
+
#define U_DRAFT U_CAPI
|
83
|
+
#define U_DEPRECATED U_CAPI
|
84
|
+
#define U_OBSOLETE U_CAPI
|
85
|
+
#define U_INTERNAL U_CAPI
|
86
|
+
|
87
|
+
/*==========================================================================*/
|
88
|
+
/* limits for int32_t etc., like in POSIX inttypes.idl */
|
89
|
+
/*==========================================================================*/
|
90
|
+
|
91
|
+
#ifndef INT8_MIN
|
92
|
+
|
93
|
+
# define INT8_MIN ((int8_t)(-128))
|
94
|
+
#endif
|
95
|
+
#ifndef INT16_MIN
|
96
|
+
|
97
|
+
# define INT16_MIN ((int16_t)(-32767-1))
|
98
|
+
#endif
|
99
|
+
#ifndef INT32_MIN
|
100
|
+
|
101
|
+
# define INT32_MIN ((int32_t)(-2147483647-1))
|
102
|
+
#endif
|
103
|
+
|
104
|
+
#ifndef INT8_MAX
|
105
|
+
|
106
|
+
# define INT8_MAX ((int8_t)(127))
|
107
|
+
#endif
|
108
|
+
#ifndef INT16_MAX
|
109
|
+
|
110
|
+
# define INT16_MAX ((int16_t)(32767))
|
111
|
+
#endif
|
112
|
+
#ifndef INT32_MAX
|
113
|
+
|
114
|
+
# define INT32_MAX ((int32_t)(2147483647))
|
115
|
+
#endif
|
116
|
+
|
117
|
+
#ifndef UINT8_MAX
|
118
|
+
|
119
|
+
# define UINT8_MAX ((uint8_t)(255U))
|
120
|
+
#endif
|
121
|
+
#ifndef UINT16_MAX
|
122
|
+
|
123
|
+
# define UINT16_MAX ((uint16_t)(65535U))
|
124
|
+
#endif
|
125
|
+
#ifndef UINT32_MAX
|
126
|
+
|
127
|
+
# define UINT32_MAX ((uint32_t)(4294967295U))
|
128
|
+
#endif
|
129
|
+
|
130
|
+
#if defined(U_INT64_T_UNAVAILABLE)
|
131
|
+
# error int64_t is required for decimal format and rule-based number format.
|
132
|
+
#else
|
133
|
+
# ifndef INT64_C
|
134
|
+
|
135
|
+
# define INT64_C(c) c ## LL
|
136
|
+
# endif
|
137
|
+
# ifndef UINT64_C
|
138
|
+
|
139
|
+
# define UINT64_C(c) c ## ULL
|
140
|
+
# endif
|
141
|
+
# ifndef U_INT64_MIN
|
142
|
+
|
143
|
+
# define U_INT64_MIN ((int64_t)(INT64_C(-9223372036854775807)-1))
|
144
|
+
# endif
|
145
|
+
# ifndef U_INT64_MAX
|
146
|
+
|
147
|
+
# define U_INT64_MAX ((int64_t)(INT64_C(9223372036854775807)))
|
148
|
+
# endif
|
149
|
+
# ifndef U_UINT64_MAX
|
150
|
+
|
151
|
+
# define U_UINT64_MAX ((uint64_t)(UINT64_C(18446744073709551615)))
|
152
|
+
# endif
|
153
|
+
#endif
|
154
|
+
|
155
|
+
/*==========================================================================*/
|
156
|
+
/* Boolean data type */
|
157
|
+
/*==========================================================================*/
|
158
|
+
|
159
|
+
typedef int8_t UBool;
|
160
|
+
|
161
|
+
#ifndef TRUE
|
162
|
+
|
163
|
+
# define TRUE 1
|
164
|
+
#endif
|
165
|
+
#ifndef FALSE
|
166
|
+
|
167
|
+
# define FALSE 0
|
168
|
+
#endif
|
169
|
+
|
170
|
+
|
171
|
+
/*==========================================================================*/
|
172
|
+
/* Unicode data types */
|
173
|
+
/*==========================================================================*/
|
174
|
+
|
175
|
+
/* wchar_t-related definitions -------------------------------------------- */
|
176
|
+
|
177
|
+
#ifndef U_HAVE_WCHAR_H
|
178
|
+
# define U_HAVE_WCHAR_H 1
|
179
|
+
#endif
|
180
|
+
|
181
|
+
#if U_SIZEOF_WCHAR_T==0
|
182
|
+
# undef U_SIZEOF_WCHAR_T
|
183
|
+
# define U_SIZEOF_WCHAR_T 4
|
184
|
+
#endif
|
185
|
+
|
186
|
+
/*
|
187
|
+
* \def U_WCHAR_IS_UTF16
|
188
|
+
* Defined if wchar_t uses UTF-16.
|
189
|
+
*
|
190
|
+
* @stable ICU 2.0
|
191
|
+
*/
|
192
|
+
/*
|
193
|
+
* \def U_WCHAR_IS_UTF32
|
194
|
+
* Defined if wchar_t uses UTF-32.
|
195
|
+
*
|
196
|
+
* @stable ICU 2.0
|
197
|
+
*/
|
198
|
+
#if !defined(U_WCHAR_IS_UTF16) && !defined(U_WCHAR_IS_UTF32)
|
199
|
+
# ifdef __STDC_ISO_10646__
|
200
|
+
# if (U_SIZEOF_WCHAR_T==2)
|
201
|
+
# define U_WCHAR_IS_UTF16
|
202
|
+
# elif (U_SIZEOF_WCHAR_T==4)
|
203
|
+
# define U_WCHAR_IS_UTF32
|
204
|
+
# endif
|
205
|
+
# elif defined __UCS2__
|
206
|
+
# if (__OS390__ || __OS400__) && (U_SIZEOF_WCHAR_T==2)
|
207
|
+
# define U_WCHAR_IS_UTF16
|
208
|
+
# endif
|
209
|
+
# elif defined __UCS4__
|
210
|
+
# if (U_SIZEOF_WCHAR_T==4)
|
211
|
+
# define U_WCHAR_IS_UTF32
|
212
|
+
# endif
|
213
|
+
# elif defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
|
214
|
+
# define U_WCHAR_IS_UTF16
|
215
|
+
# endif
|
216
|
+
#endif
|
217
|
+
|
218
|
+
/* UChar and UChar32 definitions -------------------------------------------- */
|
219
|
+
|
220
|
+
#define U_SIZEOF_UCHAR 2
|
221
|
+
|
222
|
+
/* Define UChar to be compatible with wchar_t if possible. */
|
223
|
+
#if U_SIZEOF_WCHAR_T==2
|
224
|
+
typedef wchar_t UChar;
|
225
|
+
#else
|
226
|
+
typedef uint16_t UChar;
|
227
|
+
#endif
|
228
|
+
|
229
|
+
typedef int32_t UChar32;
|
230
|
+
|
231
|
+
/*==========================================================================*/
|
232
|
+
/* U_INLINE and U_ALIGN_CODE Set default values if these are not already */
|
233
|
+
/* defined. Definitions normally are in */
|
234
|
+
/* platform.idl or the corresponding file for */
|
235
|
+
/* the OS in use. */
|
236
|
+
/*==========================================================================*/
|
237
|
+
|
238
|
+
#ifndef U_ALIGN_CODE
|
239
|
+
# define U_ALIGN_CODE(n)
|
240
|
+
#endif
|
241
|
+
|
242
|
+
#ifndef U_INLINE
|
243
|
+
# define U_INLINE
|
244
|
+
#endif
|
245
|
+
|
246
|
+
#endif
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module foo {
|
2
|
+
struct a {
|
3
|
+
long b;
|
4
|
+
};
|
5
|
+
module bar {
|
6
|
+
struct a {
|
7
|
+
long b;
|
8
|
+
};
|
9
|
+
};
|
10
|
+
};
|
11
|
+
|
12
|
+
module bar {
|
13
|
+
struct a {
|
14
|
+
long b;
|
15
|
+
};
|
16
|
+
};
|
17
|
+
|
18
|
+
module foo {
|
19
|
+
struct b {
|
20
|
+
a c; // This refs foo::a
|
21
|
+
};
|
22
|
+
module bar {
|
23
|
+
struct b {
|
24
|
+
a q; // This refs foo::bar::a
|
25
|
+
};
|
26
|
+
};
|
27
|
+
};
|
28
|
+
|
@@ -0,0 +1,47 @@
|
|
1
|
+
/**
|
2
|
+
* Nested recursive struct and union
|
3
|
+
*/
|
4
|
+
|
5
|
+
/* Recursive struct */
|
6
|
+
struct S {
|
7
|
+
string name;
|
8
|
+
sequence<S,1> S1Seq_left;
|
9
|
+
sequence<S,1> S1Seq_right;
|
10
|
+
};
|
11
|
+
|
12
|
+
/* Nested recursive struct */
|
13
|
+
struct S2 {
|
14
|
+
struct S3 {
|
15
|
+
sequence<S2> c;
|
16
|
+
} s;
|
17
|
+
};
|
18
|
+
|
19
|
+
/* Nested recursive union */
|
20
|
+
union UA switch (boolean) {
|
21
|
+
case TRUE:
|
22
|
+
struct t_st {
|
23
|
+
sequence<UA> a;
|
24
|
+
} st;
|
25
|
+
case FALSE:
|
26
|
+
short b;
|
27
|
+
};
|
28
|
+
|
29
|
+
union UB switch (boolean) {
|
30
|
+
case TRUE:
|
31
|
+
sequence<UB> mub;
|
32
|
+
};
|
33
|
+
|
34
|
+
struct S4 {
|
35
|
+
struct S5 {
|
36
|
+
struct S6 {
|
37
|
+
sequence<S4> s4_obj;
|
38
|
+
sequence<S5> s5_obj;
|
39
|
+
sequence<S6> ms6;
|
40
|
+
} ts6;
|
41
|
+
} ts5;
|
42
|
+
};
|
43
|
+
|
44
|
+
interface foo {
|
45
|
+
void bar( in S s_obj );
|
46
|
+
};
|
47
|
+
|