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,274 @@
|
|
1
|
+
module ZOMG
|
2
|
+
module IDL
|
3
|
+
module Visitors
|
4
|
+
class Sexp
|
5
|
+
def visit_Specification(o)
|
6
|
+
[:spec, o.children.map { |c| c.accept(self) }]
|
7
|
+
end
|
8
|
+
|
9
|
+
def visit_Struct(o)
|
10
|
+
[:struct, o.name, o.children.map { |c| c.accept(self) }]
|
11
|
+
end
|
12
|
+
|
13
|
+
def visit_Member(o)
|
14
|
+
[:member, o.type.accept(self), o.children.map { |c| c.accept(self) }]
|
15
|
+
end
|
16
|
+
|
17
|
+
def visit_Enum(o)
|
18
|
+
[:enum, o.name, o.children]
|
19
|
+
end
|
20
|
+
|
21
|
+
def visit_Union(o)
|
22
|
+
[:union, o.name, o.switch_type.accept(self), o.children.map { |c| c.accept(self) }]
|
23
|
+
end
|
24
|
+
|
25
|
+
def visit_Case(o)
|
26
|
+
[:case, o.children.map { |c| c.accept(self) }]
|
27
|
+
end
|
28
|
+
|
29
|
+
def visit_CaseLabel(o)
|
30
|
+
[:label, o.children.accept(self)]
|
31
|
+
end
|
32
|
+
|
33
|
+
def visit_ElementSpec(o)
|
34
|
+
[:element_spec, o.children.map { |c| c.accept(self) }]
|
35
|
+
end
|
36
|
+
|
37
|
+
def visit_Typedef(o)
|
38
|
+
[ :typedef,
|
39
|
+
o.type_spec.accept(self),
|
40
|
+
o.children.map { |c| c.accept(self) }
|
41
|
+
]
|
42
|
+
end
|
43
|
+
|
44
|
+
def visit_ArrayDeclarator(o)
|
45
|
+
[:array_decl, o.name, o.children.map { |c| c.accept(self) }]
|
46
|
+
end
|
47
|
+
|
48
|
+
def visit_Sequence(o)
|
49
|
+
[:sequence, o.children.map { |c| c.accept(self) }]
|
50
|
+
end
|
51
|
+
|
52
|
+
def visit_Constant(o)
|
53
|
+
[ :const,
|
54
|
+
o.type.accept(self),
|
55
|
+
o.name,
|
56
|
+
o.value.accept(self) ]
|
57
|
+
end
|
58
|
+
|
59
|
+
def visit_Interface(o)
|
60
|
+
[ :interface,
|
61
|
+
o.header.accept(self),
|
62
|
+
o.children.map { |c| c.accept(self) }
|
63
|
+
]
|
64
|
+
end
|
65
|
+
|
66
|
+
def visit_Operation(o)
|
67
|
+
[:op,
|
68
|
+
o.attribute && :oneway,
|
69
|
+
o.returns.accept(self),
|
70
|
+
o.name,
|
71
|
+
o.children.map { |c| c.accept(self) },
|
72
|
+
o.raises && o.raises.map { |c| c.accept(self) },
|
73
|
+
o.context && o.context.accept(self)
|
74
|
+
]
|
75
|
+
end
|
76
|
+
|
77
|
+
def visit_Parameter(o)
|
78
|
+
[ :param,
|
79
|
+
o.attribute.accept(self),
|
80
|
+
o.type.accept(self),
|
81
|
+
o.declarator.accept(self),
|
82
|
+
]
|
83
|
+
end
|
84
|
+
|
85
|
+
def visit_ScopedName(o)
|
86
|
+
[ :scoped_name,
|
87
|
+
o.name,
|
88
|
+
o.children.map { |c| c.accept(self) }
|
89
|
+
]
|
90
|
+
end
|
91
|
+
|
92
|
+
def visit_Attribute(o)
|
93
|
+
[ :attribute,
|
94
|
+
o.readonly && :readonly,
|
95
|
+
o.type.accept(self),
|
96
|
+
o.children.map { |c| c.accept(self) }
|
97
|
+
]
|
98
|
+
end
|
99
|
+
|
100
|
+
def visit_Module(o)
|
101
|
+
[:module, o.name, o.children.map { |c| c.accept(self) }]
|
102
|
+
end
|
103
|
+
|
104
|
+
def visit_Exception(o)
|
105
|
+
[:exception, o.name, o.children.map { |c| c.accept(self) }]
|
106
|
+
end
|
107
|
+
|
108
|
+
def visit_Context(o)
|
109
|
+
[:context, o.children.map { |c| c.accept(self) }]
|
110
|
+
end
|
111
|
+
|
112
|
+
def visit_ValueBoxDcl(o)
|
113
|
+
[:valuebox, o.name, o.children.accept(self)]
|
114
|
+
end
|
115
|
+
|
116
|
+
def visit_UnaryMinus(o)
|
117
|
+
[:uminus, o.children.accept(self)]
|
118
|
+
end
|
119
|
+
|
120
|
+
def visit_UnaryPlus(o)
|
121
|
+
[:uplus, o.children.accept(self)]
|
122
|
+
end
|
123
|
+
|
124
|
+
{
|
125
|
+
'MultiplyExpr' => :multiply,
|
126
|
+
'ModulusExpr' => :modulus,
|
127
|
+
'PlusExpr' => :plus,
|
128
|
+
'ShiftLeftExpr' => :lshift,
|
129
|
+
'MinusExpr' => :minus,
|
130
|
+
'DivideExpr' => :divide,
|
131
|
+
'AmpersandExpr' => :ampersand,
|
132
|
+
'OrExpr' => :or,
|
133
|
+
}.each do |type,sym|
|
134
|
+
define_method(:"visit_#{type}") do |o|
|
135
|
+
[sym, o.left.accept(self), o.right.accept(self)]
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
# Terminal nodes
|
140
|
+
def visit_Object(o)
|
141
|
+
:object
|
142
|
+
end
|
143
|
+
|
144
|
+
def visit_WideStringLiteral(o)
|
145
|
+
[:wstring_lit, o.children]
|
146
|
+
end
|
147
|
+
|
148
|
+
def visit_WideCharacterLiteral(o)
|
149
|
+
[:wstring_lit, o.children]
|
150
|
+
end
|
151
|
+
|
152
|
+
def visit_StringLiteral(o)
|
153
|
+
[:string_lit, o.children]
|
154
|
+
end
|
155
|
+
|
156
|
+
def visit_ForwardDeclaration(o)
|
157
|
+
[:forward_decl, o.children]
|
158
|
+
end
|
159
|
+
|
160
|
+
def visit_FloatingPointLiteral(o)
|
161
|
+
[:float, o.children]
|
162
|
+
end
|
163
|
+
|
164
|
+
def visit_BooleanLiteral(o)
|
165
|
+
[:boolean, o.children]
|
166
|
+
end
|
167
|
+
|
168
|
+
def visit_In(o)
|
169
|
+
:in
|
170
|
+
end
|
171
|
+
|
172
|
+
def visit_Out(o)
|
173
|
+
:out
|
174
|
+
end
|
175
|
+
|
176
|
+
def visit_Any(o)
|
177
|
+
:any
|
178
|
+
end
|
179
|
+
|
180
|
+
def visit_InOut(o)
|
181
|
+
:in_out
|
182
|
+
end
|
183
|
+
|
184
|
+
def visit_InterfaceHeader(o)
|
185
|
+
[:header, o.abstract, o.name, o.children.map { |c| c.accept(self) }]
|
186
|
+
end
|
187
|
+
|
188
|
+
def visit_DefaultLabel(o)
|
189
|
+
[:default]
|
190
|
+
end
|
191
|
+
|
192
|
+
def visit_ArraySize(o)
|
193
|
+
[:size, o.children.accept(self)]
|
194
|
+
end
|
195
|
+
|
196
|
+
def visit_Char(o)
|
197
|
+
:char
|
198
|
+
end
|
199
|
+
|
200
|
+
def visit_WChar(o)
|
201
|
+
:wchar
|
202
|
+
end
|
203
|
+
|
204
|
+
def visit_String(o)
|
205
|
+
[:string, o.children.map { |c| c.accept(self)}]
|
206
|
+
end
|
207
|
+
|
208
|
+
def visit_WString(o)
|
209
|
+
[:wstring, o.children.map { |c| c.accept(self)}]
|
210
|
+
end
|
211
|
+
|
212
|
+
def visit_Short(o)
|
213
|
+
:short
|
214
|
+
end
|
215
|
+
|
216
|
+
def visit_Long(o)
|
217
|
+
:long
|
218
|
+
end
|
219
|
+
|
220
|
+
def visit_LongLong(o)
|
221
|
+
:long_long
|
222
|
+
end
|
223
|
+
|
224
|
+
def visit_UnsignedLongLong(o)
|
225
|
+
:ulong_long
|
226
|
+
end
|
227
|
+
|
228
|
+
def visit_Float(o)
|
229
|
+
:float
|
230
|
+
end
|
231
|
+
|
232
|
+
def visit_UnsignedShort(o)
|
233
|
+
:ushort
|
234
|
+
end
|
235
|
+
|
236
|
+
def visit_UnsignedLong(o)
|
237
|
+
:ulong
|
238
|
+
end
|
239
|
+
|
240
|
+
def visit_Double(o)
|
241
|
+
:double
|
242
|
+
end
|
243
|
+
|
244
|
+
def visit_Boolean(o)
|
245
|
+
:boolean
|
246
|
+
end
|
247
|
+
|
248
|
+
def visit_Void(o)
|
249
|
+
:void
|
250
|
+
end
|
251
|
+
|
252
|
+
def visit_Octet(o)
|
253
|
+
:octet
|
254
|
+
end
|
255
|
+
|
256
|
+
def visit_SimpleDeclarator(o)
|
257
|
+
[:decl, o.name]
|
258
|
+
end
|
259
|
+
|
260
|
+
def visit_IntegerLiteral(o)
|
261
|
+
[:int, o.to_i]
|
262
|
+
end
|
263
|
+
|
264
|
+
def visit_CharacterLiteral(o)
|
265
|
+
[:charlit, o.children]
|
266
|
+
end
|
267
|
+
|
268
|
+
def accept(target)
|
269
|
+
target.accept(self)
|
270
|
+
end
|
271
|
+
end
|
272
|
+
end
|
273
|
+
end
|
274
|
+
end
|
data/lib/zomg/version.rb
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
|
2
|
+
/*
|
3
|
+
* Test various combinations of Arrays in IDL
|
4
|
+
*/
|
5
|
+
|
6
|
+
|
7
|
+
typedef char VectorChar[5];
|
8
|
+
typedef octet VectorOctet[5];
|
9
|
+
|
10
|
+
struct S0 {
|
11
|
+
char c[5];
|
12
|
+
octet o[5];
|
13
|
+
};
|
14
|
+
|
15
|
+
typedef short Vector[10];
|
16
|
+
typedef Vector Matrix[10];
|
17
|
+
typedef Vector VB;
|
18
|
+
typedef VB MB[10];
|
19
|
+
|
20
|
+
typedef short arr[1][2];
|
21
|
+
typedef sequence<arr,2> arrseq;
|
22
|
+
|
23
|
+
struct S1 {
|
24
|
+
long x;
|
25
|
+
char b[ 3 ];
|
26
|
+
long c[ 5 ][ 4 ];
|
27
|
+
string s[6];
|
28
|
+
};
|
29
|
+
|
30
|
+
typedef S1 S1_arr[ 3 ][ 4 ];
|
31
|
+
|
32
|
+
// Note: long_arr is an array of fixed length data
|
33
|
+
typedef long long_arr[ 10 ];
|
34
|
+
|
35
|
+
interface foo;
|
36
|
+
typedef foo foo_arr[6];
|
37
|
+
|
38
|
+
// Note: SS is an array of variable data
|
39
|
+
typedef string SS[ 5 ][ 4 ];
|
40
|
+
|
41
|
+
struct S2 {
|
42
|
+
long x;
|
43
|
+
SS ss_obj;
|
44
|
+
};
|
45
|
+
|
46
|
+
|
47
|
+
struct S3 {
|
48
|
+
long a[1];
|
49
|
+
long b[1][2];
|
50
|
+
long c[1][2][3];
|
51
|
+
};
|
52
|
+
|
53
|
+
typedef sequence<S1_arr> S1_seq;
|
54
|
+
|
55
|
+
|
56
|
+
interface foo {
|
57
|
+
SS bar( in SS x, inout SS y, out SS z, out long_arr w );
|
58
|
+
long_arr baz();
|
59
|
+
};
|
60
|
+
|
@@ -0,0 +1,38 @@
|
|
1
|
+
typedef sequence<long,10> vec10;
|
2
|
+
typedef char str22[22][2];
|
3
|
+
typedef boolean boolarray[3][40];
|
4
|
+
|
5
|
+
|
6
|
+
struct A {
|
7
|
+
long a1;
|
8
|
+
char a2[17];
|
9
|
+
char a3[10][2];
|
10
|
+
// vec10 a3;
|
11
|
+
};
|
12
|
+
|
13
|
+
struct B {
|
14
|
+
long b1;
|
15
|
+
A b2;
|
16
|
+
};
|
17
|
+
|
18
|
+
struct C {
|
19
|
+
long c1;
|
20
|
+
long c2;
|
21
|
+
};
|
22
|
+
|
23
|
+
typedef A A_matrix[2][3][4];
|
24
|
+
typedef B B_matrix[2][3][4];
|
25
|
+
typedef C C_matrix[2][3][4];
|
26
|
+
|
27
|
+
typedef A_matrix A_rmatrix[2][3][4][5];
|
28
|
+
|
29
|
+
interface A_i {
|
30
|
+
A op(in A a1, inout A a2, out A a3);
|
31
|
+
str22 op2(in str22 a1, inout str22 a2, out str22 a3);
|
32
|
+
// THIS IS NOT A LEGAL OPERATION!!! You can't have [] on params
|
33
|
+
// str22 op3(in short a1[3][4], inout short a2[3][4], out short a3[4][4]);
|
34
|
+
A_matrix op4(in A a1, inout A a2, out A a3);
|
35
|
+
attribute str22 attribute_array;
|
36
|
+
// void foo(in any x[3], out any y[4], inout any z[3]);
|
37
|
+
};
|
38
|
+
|
@@ -0,0 +1,80 @@
|
|
1
|
+
/* This should test for alignment constraints on arrays */
|
2
|
+
|
3
|
+
// This is a data structure that ends in unconstrained alignment
|
4
|
+
struct end {
|
5
|
+
long elem1;
|
6
|
+
char elem2;
|
7
|
+
};
|
8
|
+
// This is a data structure that begins in unconstrained alignment
|
9
|
+
struct begin {
|
10
|
+
char elem1;
|
11
|
+
long elem2;
|
12
|
+
};
|
13
|
+
|
14
|
+
struct cLd {
|
15
|
+
char first;
|
16
|
+
long data[50];
|
17
|
+
double last;
|
18
|
+
};
|
19
|
+
|
20
|
+
struct dLc {
|
21
|
+
double first;
|
22
|
+
long data[50];
|
23
|
+
char last;
|
24
|
+
};
|
25
|
+
|
26
|
+
struct sLs {
|
27
|
+
short first;
|
28
|
+
long data[50];
|
29
|
+
short last;
|
30
|
+
};
|
31
|
+
|
32
|
+
struct cLCd {
|
33
|
+
char first;
|
34
|
+
end data[50];
|
35
|
+
double last;
|
36
|
+
};
|
37
|
+
|
38
|
+
struct dLCc {
|
39
|
+
double first;
|
40
|
+
end data[50];
|
41
|
+
char last;
|
42
|
+
};
|
43
|
+
|
44
|
+
struct sLCs {
|
45
|
+
short first;
|
46
|
+
end data[50];
|
47
|
+
short last;
|
48
|
+
};
|
49
|
+
|
50
|
+
struct cCLd {
|
51
|
+
char first;
|
52
|
+
begin data[50];
|
53
|
+
double last;
|
54
|
+
};
|
55
|
+
|
56
|
+
struct dCLc {
|
57
|
+
double first;
|
58
|
+
begin data[50];
|
59
|
+
char last;
|
60
|
+
};
|
61
|
+
|
62
|
+
struct sCLs {
|
63
|
+
short first;
|
64
|
+
begin data[50];
|
65
|
+
short last;
|
66
|
+
};
|
67
|
+
|
68
|
+
#define test(t) t test_##t (in t inp, inout t iop, out t outp)
|
69
|
+
|
70
|
+
interface arrays {
|
71
|
+
test(cLd);
|
72
|
+
test(dLc);
|
73
|
+
test(sLs);
|
74
|
+
test(cLCd);
|
75
|
+
test(dLCc);
|
76
|
+
test(sLCs);
|
77
|
+
test(cCLd);
|
78
|
+
test(dCLc);
|
79
|
+
test(sCLs);
|
80
|
+
};
|