aaronp-zomg 1.0.2.20080827232412

Sign up to get free protection for your applications and to get access to all the features.
Files changed (236) hide show
  1. data/History.txt +25 -0
  2. data/Manifest.txt +238 -0
  3. data/README.txt +59 -0
  4. data/Rakefile +43 -0
  5. data/bin/omfg +56 -0
  6. data/lib/scanner.rex +169 -0
  7. data/lib/yacc.y +861 -0
  8. data/lib/zomg.rb +22 -0
  9. data/lib/zomg/idl.rb +14 -0
  10. data/lib/zomg/idl/nodes/attribute.rb +15 -0
  11. data/lib/zomg/idl/nodes/binary.rb +19 -0
  12. data/lib/zomg/idl/nodes/constant.rb +15 -0
  13. data/lib/zomg/idl/nodes/interface.rb +13 -0
  14. data/lib/zomg/idl/nodes/interface_header.rb +14 -0
  15. data/lib/zomg/idl/nodes/member.rb +14 -0
  16. data/lib/zomg/idl/nodes/node.rb +54 -0
  17. data/lib/zomg/idl/nodes/operation.rb +17 -0
  18. data/lib/zomg/idl/nodes/parameter.rb +18 -0
  19. data/lib/zomg/idl/nodes/typedef.rb +13 -0
  20. data/lib/zomg/idl/nodes/union.rb +14 -0
  21. data/lib/zomg/idl/parser.rb +54 -0
  22. data/lib/zomg/idl/visitable.rb +15 -0
  23. data/lib/zomg/idl/visitors/duhr.rb +24 -0
  24. data/lib/zomg/idl/visitors/ruby_sexp.rb +204 -0
  25. data/lib/zomg/idl/visitors/sexp.rb +274 -0
  26. data/lib/zomg/version.rb +3 -0
  27. data/test/assets/array/array1.idl +60 -0
  28. data/test/assets/array/array2.idl +38 -0
  29. data/test/assets/array/array3.idl +8 -0
  30. data/test/assets/array/array4.idl +7 -0
  31. data/test/assets/array/array5.idl +80 -0
  32. data/test/assets/attribute/grid_0attribs_2methods.idl +16 -0
  33. data/test/assets/attribute/grid_1ROattribs_1attribs_0methods.idl +19 -0
  34. data/test/assets/attribute/grid_1ROattribs_1attribs_1methods.idl +19 -0
  35. data/test/assets/attribute/grid_1ROattribs_1attribs_2methods.idl +17 -0
  36. data/test/assets/attribute/grid_1ROattribs_1methods.idl +16 -0
  37. data/test/assets/attribute/grid_1ROattribs_2methods.idl +16 -0
  38. data/test/assets/attribute/grid_1attribs_1methods.idl +17 -0
  39. data/test/assets/attribute/grid_1attribs_2methods.idl +17 -0
  40. data/test/assets/attribute/grid_2ROattribs_0methods.idl +16 -0
  41. data/test/assets/attribute/grid_2ROattribs_1methods.idl +16 -0
  42. data/test/assets/attribute/grid_2ROattribs_2methods.idl +16 -0
  43. data/test/assets/attribute/grid_2attribs_0methods.idl +19 -0
  44. data/test/assets/attribute/grid_2attribs_1methods.idl +19 -0
  45. data/test/assets/attribute/grid_2attribs_2methods.idl +19 -0
  46. data/test/assets/comment/c_style_comments.idl +63 -0
  47. data/test/assets/comment/comment1.idl +57 -0
  48. data/test/assets/comment/cpp_style_comments.idl +168 -0
  49. data/test/assets/comment/shortform.idl +0 -0
  50. data/test/assets/complex/TestCodeSets.idl +10 -0
  51. data/test/assets/complex/TestIntfContext.idl +13 -0
  52. data/test/assets/complex/TestIntfLongLong.idl +51 -0
  53. data/test/assets/complex/TestIntfWChar.idl +52 -0
  54. data/test/assets/complex/any1.idl +22 -0
  55. data/test/assets/complex/complex1.idl +495 -0
  56. data/test/assets/complex/complex2.idl +730 -0
  57. data/test/assets/complex/complex3.idl +181 -0
  58. data/test/assets/complex/complex4.idl +181 -0
  59. data/test/assets/complex/interop_wchar.idl +60 -0
  60. data/test/assets/constant/constant1.idl +37 -0
  61. data/test/assets/constant/constant2.idl +29 -0
  62. data/test/assets/constant/constant3.idl +50 -0
  63. data/test/assets/constant/constant4.idl +21 -0
  64. data/test/assets/constant/constant5.idl +65 -0
  65. data/test/assets/constant/constant6.idl +144 -0
  66. data/test/assets/constant/constant7.idl +30 -0
  67. data/test/assets/enum/enum1.idl +13 -0
  68. data/test/assets/exception/TestIntfExceptions.idl +69 -0
  69. data/test/assets/exception/TestIntfExceptionsExt_2_0.idl +34 -0
  70. data/test/assets/exception/TestIntfExceptionsExt_2_3.idl +24 -0
  71. data/test/assets/exception/ex1.idl +6 -0
  72. data/test/assets/exception/ex2.idl +18 -0
  73. data/test/assets/exception/ex3.idl +10 -0
  74. data/test/assets/exception/ex4.idl +20 -0
  75. data/test/assets/exception/sc.idl +0 -0
  76. data/test/assets/exception/simple1.idl +18 -0
  77. data/test/assets/exception/simple2.idl +25 -0
  78. data/test/assets/factory/factory1.idl +77 -0
  79. data/test/assets/factory/objref.idl +25 -0
  80. data/test/assets/forward/forward.idl +15 -0
  81. data/test/assets/forward/forward1.idl +13 -0
  82. data/test/assets/forward/fwd_incl1.idl +6 -0
  83. data/test/assets/forward/fwd_incl2.idl +7 -0
  84. data/test/assets/include/a.idl +23 -0
  85. data/test/assets/include/b.idl +16 -0
  86. data/test/assets/include/employee.idl +12 -0
  87. data/test/assets/include/include1.idl +10 -0
  88. data/test/assets/include/include2.idl +5 -0
  89. data/test/assets/include/manager.idl +10 -0
  90. data/test/assets/include/pragma.idl +41 -0
  91. data/test/assets/include/rookie.idl +13 -0
  92. data/test/assets/include/rookiemanager.idl +15 -0
  93. data/test/assets/include/sample.idl +58 -0
  94. data/test/assets/include/sample_incl.idl +406 -0
  95. data/test/assets/inherit/IDL1.idl +18 -0
  96. data/test/assets/inherit/IDL2.idl +18 -0
  97. data/test/assets/inherit/IDL3.idl +18 -0
  98. data/test/assets/inherit/IDL4.idl +17 -0
  99. data/test/assets/inherit/diamond_inheritance.idl +31 -0
  100. data/test/assets/inherit/inherit.idl +27 -0
  101. data/test/assets/limit/longidentifiers.idl +25 -0
  102. data/test/assets/limit/namelens.idl +26 -0
  103. data/test/assets/limit/tpztest.idl +21 -0
  104. data/test/assets/module/module1.idl +29 -0
  105. data/test/assets/module/module2.idl +34 -0
  106. data/test/assets/module/module3.idl +20 -0
  107. data/test/assets/module/module4.idl +15 -0
  108. data/test/assets/nested/nested1.idl +5 -0
  109. data/test/assets/nested/nested2.idl +11 -0
  110. data/test/assets/operations/Benchmark.idl +331 -0
  111. data/test/assets/operations/CCS.idl +82 -0
  112. data/test/assets/operations/TestIntf.idl +40 -0
  113. data/test/assets/operations/TestIntfBasic.idl +653 -0
  114. data/test/assets/operations/atomic.idl +40 -0
  115. data/test/assets/operations/dif2.idl +48 -0
  116. data/test/assets/operations/interface1.idl +16 -0
  117. data/test/assets/operations/parameters.idl +111 -0
  118. data/test/assets/operations/perf.idl +84 -0
  119. data/test/assets/operations/timer.idl +104 -0
  120. data/test/assets/preprocess/base_for_diamond_inheritance_with_macros.idl +17 -0
  121. data/test/assets/preprocess/basic_macro_marshalling.idl +54 -0
  122. data/test/assets/preprocess/diamond_inheritance_with_macros.idl +74 -0
  123. data/test/assets/preprocess/macro1.idl +52 -0
  124. data/test/assets/preprocess/preprocess1.idl +246 -0
  125. data/test/assets/preprocess/preprocess2.idl +3 -0
  126. data/test/assets/recursion/loop.idl +28 -0
  127. data/test/assets/recursion/recursion1.idl +47 -0
  128. data/test/assets/recursion/recursion2.idl +74 -0
  129. data/test/assets/scenarios/filestat.idl +69 -0
  130. data/test/assets/scenarios/gateway.idl +176 -0
  131. data/test/assets/scenarios/library.idl +20 -0
  132. data/test/assets/scenarios/phone.idl +24 -0
  133. data/test/assets/scenarios/ticketservice.idl +118 -0
  134. data/test/assets/scope/scope01.idl +58 -0
  135. data/test/assets/scope/scope02.idl +25 -0
  136. data/test/assets/scope/scope03.idl +22 -0
  137. data/test/assets/scope/scope04.idl +27 -0
  138. data/test/assets/scope/scope05.idl +30 -0
  139. data/test/assets/scope/scope06.idl +51 -0
  140. data/test/assets/scope/scope07.idl +20 -0
  141. data/test/assets/scope/scope08.idl +88 -0
  142. data/test/assets/scope/scope09.idl +21 -0
  143. data/test/assets/scope/scope10.idl +95 -0
  144. data/test/assets/scope/scope11.idl +62 -0
  145. data/test/assets/scope/scope12.idl +117 -0
  146. data/test/assets/scope/scope13.idl +117 -0
  147. data/test/assets/scope/scope14.idl +117 -0
  148. data/test/assets/scope/scope15.idl +117 -0
  149. data/test/assets/scope/scope16.idl +117 -0
  150. data/test/assets/scope/scope17.idl +117 -0
  151. data/test/assets/scope/scope18.idl +117 -0
  152. data/test/assets/scope/scope19.idl +117 -0
  153. data/test/assets/scope/scope20.idl +215 -0
  154. data/test/assets/scope/scope21.idl +215 -0
  155. data/test/assets/scope/scope22.idl +205 -0
  156. data/test/assets/scope/scope23.idl +261 -0
  157. data/test/assets/scope/scope24.idl +376 -0
  158. data/test/assets/scope/scope25.idl +266 -0
  159. data/test/assets/scope/scope26.idl +180 -0
  160. data/test/assets/scope/scope27.idl +184 -0
  161. data/test/assets/scope/scope28.idl +182 -0
  162. data/test/assets/scope/scope29.idl +182 -0
  163. data/test/assets/scope/scope30.idl +40 -0
  164. data/test/assets/scope/scope31.idl +33 -0
  165. data/test/assets/scope/scope32.idl +37 -0
  166. data/test/assets/scope/scope33.idl +50 -0
  167. data/test/assets/scope/scope34.idl +97 -0
  168. data/test/assets/scope/scope35.idl +72 -0
  169. data/test/assets/scope/scope36.idl +167 -0
  170. data/test/assets/scope/scope37.idl +57 -0
  171. data/test/assets/scope/scope38.idl +38 -0
  172. data/test/assets/scope/scope39.idl +38 -0
  173. data/test/assets/scope/scope40.idl +38 -0
  174. data/test/assets/scope/scope41.idl +24 -0
  175. data/test/assets/scope/scope42.idl +64 -0
  176. data/test/assets/scope/scope43.idl +66 -0
  177. data/test/assets/scope/scope44.idl +52 -0
  178. data/test/assets/sequence/sequence1.idl +24 -0
  179. data/test/assets/sequence/sequence2.idl +9 -0
  180. data/test/assets/simple/basictypes1.idl +80 -0
  181. data/test/assets/simple/basictypes2.idl +197 -0
  182. data/test/assets/simple/basictypes3.idl +23 -0
  183. data/test/assets/simple/basictypes4.idl +73 -0
  184. data/test/assets/simple/basictypes5.idl +29 -0
  185. data/test/assets/simple/basictypes6.idl +63 -0
  186. data/test/assets/simple/simple1.idl +45 -0
  187. data/test/assets/simple/simple2.idl +61 -0
  188. data/test/assets/simple/simple3.idl +36 -0
  189. data/test/assets/string/string1.idl +11 -0
  190. data/test/assets/string/string2.idl +29 -0
  191. data/test/assets/struct/struct1.idl +20 -0
  192. data/test/assets/struct/struct2.idl +21 -0
  193. data/test/assets/struct/struct3.idl +42 -0
  194. data/test/assets/struct/struct4.idl +57 -0
  195. data/test/assets/struct/struct5.idl +71 -0
  196. data/test/assets/typecode/orb.idl +0 -0
  197. data/test/assets/typecode/pseudo.idl +25 -0
  198. data/test/assets/typedef/shorthand_typedef_struct_insideIF.idl +17 -0
  199. data/test/assets/typedef/shorthand_typedef_struct_insideIF_noMO.idl +16 -0
  200. data/test/assets/typedef/shorthand_typedef_struct_insideMO.idl +17 -0
  201. data/test/assets/typedef/shorthand_typedef_struct_outsideMO.idl +17 -0
  202. data/test/assets/typedef/typedef1.idl +8 -0
  203. data/test/assets/typedef/typedef2.idl +22 -0
  204. data/test/assets/typedef/typedef_struct_insideIF.idl +18 -0
  205. data/test/assets/typedef/typedef_struct_insideMO.idl +18 -0
  206. data/test/assets/typedef/typedef_struct_outsideMO.idl +18 -0
  207. data/test/assets/union/union1.idl +31 -0
  208. data/test/assets/union/union2.idl +22 -0
  209. data/test/assets/union/union3.idl +26 -0
  210. data/test/conversions/test_attribute.rb +46 -0
  211. data/test/conversions/test_enum.rb +25 -0
  212. data/test/conversions/test_exception.rb +24 -0
  213. data/test/conversions/test_forward_declaration.rb +22 -0
  214. data/test/conversions/test_interface.rb +30 -0
  215. data/test/conversions/test_module.rb +24 -0
  216. data/test/conversions/test_struct.rb +25 -0
  217. data/test/conversions/test_typedef.rb +22 -0
  218. data/test/conversions/test_union.rb +27 -0
  219. data/test/conversions/test_value_box_dcl.rb +22 -0
  220. data/test/helper.rb +23 -0
  221. data/test/simple/test_basictypes1.rb +87 -0
  222. data/test/simple/test_basictypes2.rb +18 -0
  223. data/test/simple/test_basictypes3.rb +32 -0
  224. data/test/simple/test_basictypes4.rb +25 -0
  225. data/test/simple/test_basictypes5.rb +17 -0
  226. data/test/simple/test_basictypes6.rb +19 -0
  227. data/test/simple/test_simple1.rb +40 -0
  228. data/test/simple/test_simple2.rb +48 -0
  229. data/test/simple/test_simple3.rb +20 -0
  230. data/test/test_array.rb +22 -0
  231. data/test/test_assets.rb +33 -0
  232. data/test/test_complex.rb +17 -0
  233. data/test/test_node.rb +16 -0
  234. data/test/test_parser.rb +17 -0
  235. data/test/test_scanner.rb +234 -0
  236. 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
@@ -0,0 +1,3 @@
1
+ module ZOMG
2
+ VERSION = '1.0.2'
3
+ end
@@ -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,8 @@
1
+ typedef sequence<long,10> vec10;
2
+ typedef char str22[22][2];
3
+ typedef boolean boolarray[3][40];
4
+ typedef sequence<long> vec;
5
+ typedef unsigned short A_matrix[2][3][4];
6
+ typedef A_matrix A_rmatrix[2][3][4][5];
7
+ typedef string<15> a;
8
+
@@ -0,0 +1,7 @@
1
+ interface arrayez {
2
+ typedef long arr8k[2048];
3
+ long test_in8k(in arr8k a);
4
+ long test_out8k(out arr8k a);
5
+ long test_io8k(in arr8k a, out arr8k b);
6
+ };
7
+
@@ -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
+ };