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,25 @@
1
+ === 1.0.3
2
+
3
+ * 1 bugfix
4
+
5
+ * Generating java style getters and setters. :-(
6
+
7
+ === 1.0.2
8
+
9
+ * 2 bugfixes
10
+
11
+ * Generating attribute functions that raise rather than attr_accessors
12
+ * Removed extra "do not modify" comments
13
+
14
+ === 1.0.1
15
+
16
+ * 1 bugfix
17
+
18
+ * Prefix modules must be split
19
+
20
+ === 1.0.0 / 2008-07-22
21
+
22
+ * 1 major enhancement
23
+
24
+ * Birthday!
25
+
@@ -0,0 +1,238 @@
1
+ History.txt
2
+ Manifest.txt
3
+ README.txt
4
+ Rakefile
5
+ bin/omfg
6
+ lib/scanner.rex
7
+ lib/yacc.y
8
+ lib/zomg.rb
9
+ lib/zomg/idl.rb
10
+ lib/zomg/idl/lexer.rb
11
+ lib/zomg/idl/nodes/attribute.rb
12
+ lib/zomg/idl/nodes/binary.rb
13
+ lib/zomg/idl/nodes/constant.rb
14
+ lib/zomg/idl/nodes/interface.rb
15
+ lib/zomg/idl/nodes/interface_header.rb
16
+ lib/zomg/idl/nodes/member.rb
17
+ lib/zomg/idl/nodes/node.rb
18
+ lib/zomg/idl/nodes/operation.rb
19
+ lib/zomg/idl/nodes/parameter.rb
20
+ lib/zomg/idl/nodes/typedef.rb
21
+ lib/zomg/idl/nodes/union.rb
22
+ lib/zomg/idl/parser.rb
23
+ lib/zomg/idl/scanner.rb
24
+ lib/zomg/idl/visitable.rb
25
+ lib/zomg/idl/visitors/duhr.rb
26
+ lib/zomg/idl/visitors/ruby_sexp.rb
27
+ lib/zomg/idl/visitors/sexp.rb
28
+ lib/zomg/version.rb
29
+ test/assets/array/array1.idl
30
+ test/assets/array/array2.idl
31
+ test/assets/array/array3.idl
32
+ test/assets/array/array4.idl
33
+ test/assets/array/array5.idl
34
+ test/assets/attribute/grid_0attribs_2methods.idl
35
+ test/assets/attribute/grid_1ROattribs_1attribs_0methods.idl
36
+ test/assets/attribute/grid_1ROattribs_1attribs_1methods.idl
37
+ test/assets/attribute/grid_1ROattribs_1attribs_2methods.idl
38
+ test/assets/attribute/grid_1ROattribs_1methods.idl
39
+ test/assets/attribute/grid_1ROattribs_2methods.idl
40
+ test/assets/attribute/grid_1attribs_1methods.idl
41
+ test/assets/attribute/grid_1attribs_2methods.idl
42
+ test/assets/attribute/grid_2ROattribs_0methods.idl
43
+ test/assets/attribute/grid_2ROattribs_1methods.idl
44
+ test/assets/attribute/grid_2ROattribs_2methods.idl
45
+ test/assets/attribute/grid_2attribs_0methods.idl
46
+ test/assets/attribute/grid_2attribs_1methods.idl
47
+ test/assets/attribute/grid_2attribs_2methods.idl
48
+ test/assets/comment/c_style_comments.idl
49
+ test/assets/comment/comment1.idl
50
+ test/assets/comment/cpp_style_comments.idl
51
+ test/assets/comment/shortform.idl
52
+ test/assets/complex/TestCodeSets.idl
53
+ test/assets/complex/TestIntfContext.idl
54
+ test/assets/complex/TestIntfLongLong.idl
55
+ test/assets/complex/TestIntfWChar.idl
56
+ test/assets/complex/any1.idl
57
+ test/assets/complex/complex1.idl
58
+ test/assets/complex/complex2.idl
59
+ test/assets/complex/complex3.idl
60
+ test/assets/complex/complex4.idl
61
+ test/assets/complex/interop_wchar.idl
62
+ test/assets/constant/constant1.idl
63
+ test/assets/constant/constant2.idl
64
+ test/assets/constant/constant3.idl
65
+ test/assets/constant/constant4.idl
66
+ test/assets/constant/constant5.idl
67
+ test/assets/constant/constant6.idl
68
+ test/assets/constant/constant7.idl
69
+ test/assets/enum/enum1.idl
70
+ test/assets/exception/TestIntfExceptions.idl
71
+ test/assets/exception/TestIntfExceptionsExt_2_0.idl
72
+ test/assets/exception/TestIntfExceptionsExt_2_3.idl
73
+ test/assets/exception/ex1.idl
74
+ test/assets/exception/ex2.idl
75
+ test/assets/exception/ex3.idl
76
+ test/assets/exception/ex4.idl
77
+ test/assets/exception/sc.idl
78
+ test/assets/exception/simple1.idl
79
+ test/assets/exception/simple2.idl
80
+ test/assets/factory/factory1.idl
81
+ test/assets/factory/objref.idl
82
+ test/assets/forward/forward.idl
83
+ test/assets/forward/forward1.idl
84
+ test/assets/forward/fwd_incl1.idl
85
+ test/assets/forward/fwd_incl2.idl
86
+ test/assets/include/a.idl
87
+ test/assets/include/b.idl
88
+ test/assets/include/employee.idl
89
+ test/assets/include/include1.idl
90
+ test/assets/include/include2.idl
91
+ test/assets/include/manager.idl
92
+ test/assets/include/pragma.idl
93
+ test/assets/include/rookie.idl
94
+ test/assets/include/rookiemanager.idl
95
+ test/assets/include/sample.idl
96
+ test/assets/include/sample_incl.idl
97
+ test/assets/inherit/IDL1.idl
98
+ test/assets/inherit/IDL2.idl
99
+ test/assets/inherit/IDL3.idl
100
+ test/assets/inherit/IDL4.idl
101
+ test/assets/inherit/diamond_inheritance.idl
102
+ test/assets/inherit/inherit.idl
103
+ test/assets/limit/longidentifiers.idl
104
+ test/assets/limit/namelens.idl
105
+ test/assets/limit/tpztest.idl
106
+ test/assets/module/module1.idl
107
+ test/assets/module/module2.idl
108
+ test/assets/module/module3.idl
109
+ test/assets/module/module4.idl
110
+ test/assets/nested/nested1.idl
111
+ test/assets/nested/nested2.idl
112
+ test/assets/operations/Benchmark.idl
113
+ test/assets/operations/CCS.idl
114
+ test/assets/operations/TestIntf.idl
115
+ test/assets/operations/TestIntfBasic.idl
116
+ test/assets/operations/atomic.idl
117
+ test/assets/operations/dif2.idl
118
+ test/assets/operations/interface1.idl
119
+ test/assets/operations/parameters.idl
120
+ test/assets/operations/perf.idl
121
+ test/assets/operations/timer.idl
122
+ test/assets/preprocess/base_for_diamond_inheritance_with_macros.idl
123
+ test/assets/preprocess/basic_macro_marshalling.idl
124
+ test/assets/preprocess/diamond_inheritance_with_macros.idl
125
+ test/assets/preprocess/macro1.idl
126
+ test/assets/preprocess/preprocess1.idl
127
+ test/assets/preprocess/preprocess2.idl
128
+ test/assets/recursion/loop.idl
129
+ test/assets/recursion/recursion1.idl
130
+ test/assets/recursion/recursion2.idl
131
+ test/assets/scenarios/filestat.idl
132
+ test/assets/scenarios/gateway.idl
133
+ test/assets/scenarios/library.idl
134
+ test/assets/scenarios/phone.idl
135
+ test/assets/scenarios/ticketservice.idl
136
+ test/assets/scope/scope01.idl
137
+ test/assets/scope/scope02.idl
138
+ test/assets/scope/scope03.idl
139
+ test/assets/scope/scope04.idl
140
+ test/assets/scope/scope05.idl
141
+ test/assets/scope/scope06.idl
142
+ test/assets/scope/scope07.idl
143
+ test/assets/scope/scope08.idl
144
+ test/assets/scope/scope09.idl
145
+ test/assets/scope/scope10.idl
146
+ test/assets/scope/scope11.idl
147
+ test/assets/scope/scope12.idl
148
+ test/assets/scope/scope13.idl
149
+ test/assets/scope/scope14.idl
150
+ test/assets/scope/scope15.idl
151
+ test/assets/scope/scope16.idl
152
+ test/assets/scope/scope17.idl
153
+ test/assets/scope/scope18.idl
154
+ test/assets/scope/scope19.idl
155
+ test/assets/scope/scope20.idl
156
+ test/assets/scope/scope21.idl
157
+ test/assets/scope/scope22.idl
158
+ test/assets/scope/scope23.idl
159
+ test/assets/scope/scope24.idl
160
+ test/assets/scope/scope25.idl
161
+ test/assets/scope/scope26.idl
162
+ test/assets/scope/scope27.idl
163
+ test/assets/scope/scope28.idl
164
+ test/assets/scope/scope29.idl
165
+ test/assets/scope/scope30.idl
166
+ test/assets/scope/scope31.idl
167
+ test/assets/scope/scope32.idl
168
+ test/assets/scope/scope33.idl
169
+ test/assets/scope/scope34.idl
170
+ test/assets/scope/scope35.idl
171
+ test/assets/scope/scope36.idl
172
+ test/assets/scope/scope37.idl
173
+ test/assets/scope/scope38.idl
174
+ test/assets/scope/scope39.idl
175
+ test/assets/scope/scope40.idl
176
+ test/assets/scope/scope41.idl
177
+ test/assets/scope/scope42.idl
178
+ test/assets/scope/scope43.idl
179
+ test/assets/scope/scope44.idl
180
+ test/assets/sequence/sequence1.idl
181
+ test/assets/sequence/sequence2.idl
182
+ test/assets/simple/basictypes1.idl
183
+ test/assets/simple/basictypes2.idl
184
+ test/assets/simple/basictypes3.idl
185
+ test/assets/simple/basictypes4.idl
186
+ test/assets/simple/basictypes5.idl
187
+ test/assets/simple/basictypes6.idl
188
+ test/assets/simple/simple1.idl
189
+ test/assets/simple/simple2.idl
190
+ test/assets/simple/simple3.idl
191
+ test/assets/string/string1.idl
192
+ test/assets/string/string2.idl
193
+ test/assets/struct/struct1.idl
194
+ test/assets/struct/struct2.idl
195
+ test/assets/struct/struct3.idl
196
+ test/assets/struct/struct4.idl
197
+ test/assets/struct/struct5.idl
198
+ test/assets/typecode/orb.idl
199
+ test/assets/typecode/pseudo.idl
200
+ test/assets/typedef/shorthand_typedef_struct_insideIF.idl
201
+ test/assets/typedef/shorthand_typedef_struct_insideIF_noMO.idl
202
+ test/assets/typedef/shorthand_typedef_struct_insideMO.idl
203
+ test/assets/typedef/shorthand_typedef_struct_outsideMO.idl
204
+ test/assets/typedef/typedef1.idl
205
+ test/assets/typedef/typedef2.idl
206
+ test/assets/typedef/typedef_struct_insideIF.idl
207
+ test/assets/typedef/typedef_struct_insideMO.idl
208
+ test/assets/typedef/typedef_struct_outsideMO.idl
209
+ test/assets/union/union1.idl
210
+ test/assets/union/union2.idl
211
+ test/assets/union/union3.idl
212
+ test/conversions/test_attribute.rb
213
+ test/conversions/test_enum.rb
214
+ test/conversions/test_exception.rb
215
+ test/conversions/test_forward_declaration.rb
216
+ test/conversions/test_interface.rb
217
+ test/conversions/test_module.rb
218
+ test/conversions/test_struct.rb
219
+ test/conversions/test_typedef.rb
220
+ test/conversions/test_union.rb
221
+ test/conversions/test_value_box_dcl.rb
222
+ test/helper.rb
223
+ test/simple/test_basictypes1.rb
224
+ test/simple/test_basictypes2.rb
225
+ test/simple/test_basictypes3.rb
226
+ test/simple/test_basictypes4.rb
227
+ test/simple/test_basictypes5.rb
228
+ test/simple/test_basictypes6.rb
229
+ test/simple/test_simple1.rb
230
+ test/simple/test_simple2.rb
231
+ test/simple/test_simple3.rb
232
+ test/test_array.rb
233
+ test/test_assets.rb
234
+ test/test_complex.rb
235
+ test/test_node.rb
236
+ test/test_parser.rb
237
+ test/test_scanner.rb
238
+ zomg.gemspec
@@ -0,0 +1,59 @@
1
+ = ZOMG
2
+
3
+ * http://zomg.rubyforge.org/
4
+ * http://tenderlovemaking.com/
5
+
6
+ == DESCRIPTION:
7
+
8
+ ZOMG is an OMG IDL parser. ZOMG will generate a Ruby AST from an IDL AST,
9
+ and will even generate ruby (by means of Ruby2Ruby).
10
+
11
+ == FEATURES/PROBLEMS:
12
+
13
+ * Parses IDL, generates Ruby
14
+ * Ships with OMFG the Object Management File Generator
15
+ * Ignores nested structs/unions
16
+ * Treats out/inout parameters are DIY
17
+
18
+ == SYNOPSIS:
19
+
20
+ In code:
21
+
22
+ ZOMG::IDL.parse(File.read(ARGV[0])).to_ruby
23
+
24
+ Command line:
25
+
26
+ $ omfg lol.idl > roflmao.rb
27
+
28
+ == REQUIREMENTS:
29
+
30
+ * ruby2ruby
31
+
32
+ == INSTALL:
33
+
34
+ * sudo gem install zomg
35
+
36
+ == LICENSE:
37
+
38
+ (The MIT License)
39
+
40
+ Copyright (c) 2008 {Aaron Patterson}[http://tenderlovemaking.com/]
41
+
42
+ Permission is hereby granted, free of charge, to any person obtaining
43
+ a copy of this software and associated documentation files (the
44
+ 'Software'), to deal in the Software without restriction, including
45
+ without limitation the rights to use, copy, modify, merge, publish,
46
+ distribute, sublicense, and/or sell copies of the Software, and to
47
+ permit persons to whom the Software is furnished to do so, subject to
48
+ the following conditions:
49
+
50
+ The above copyright notice and this permission notice shall be
51
+ included in all copies or substantial portions of the Software.
52
+
53
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
54
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
55
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
56
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
57
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
58
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
59
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,43 @@
1
+ # -*- ruby -*-
2
+
3
+ require 'rubygems'
4
+ require 'hoe'
5
+
6
+ GENERATED_SCANNER = 'lib/zomg/idl/scanner.rb'
7
+ GENERATED_LEXER = 'lib/zomg/idl/lexer.rb'
8
+
9
+ $LOAD_PATH << File.expand_path(File.join(File.dirname(__FILE__), 'lib'))
10
+ $DEBUG = ENV['DEBUG']
11
+ require 'zomg/version'
12
+
13
+ HOE = Hoe.new('zomg', ZOMG::VERSION) do |p|
14
+ p.developer('Aaron Patterson', 'aaronp@rubyforge.org')
15
+ p.clean_globs = [GENERATED_LEXER, GENERATED_SCANNER]
16
+ p.description = p.paragraphs_of('README.txt', 3..10).join("\n\n")
17
+ p.extra_deps = ['ruby2ruby']
18
+ end
19
+
20
+ file GENERATED_LEXER => 'lib/yacc.y' do |t|
21
+ #sh "racc #{$DEBUG ? '-g' : ''} -o #{t.name} #{t.prerequisites.first}"
22
+ sh "racc -g -o #{t.name} #{t.prerequisites.first}"
23
+ end
24
+
25
+ file GENERATED_SCANNER => 'lib/scanner.rex' do |t|
26
+ sh "frex --independent -o #{t.name} #{t.prerequisites.first}"
27
+ end
28
+
29
+ task :parser => [GENERATED_SCANNER, GENERATED_LEXER]
30
+
31
+ Rake::Task[:test].prerequisites << :parser
32
+ Rake::Task[:check_manifest].prerequisites << :parser
33
+
34
+ namespace :gem do
35
+ task :spec do
36
+ File.open("#{HOE.name}.gemspec", 'w') do |f|
37
+ HOE.spec.version = "#{HOE.version}.#{Time.now.strftime("%Y%m%d%H%M%S")}"
38
+ f.write(HOE.spec.to_ruby)
39
+ end
40
+ end
41
+ end
42
+
43
+ # vim: syntax=Ruby
@@ -0,0 +1,56 @@
1
+ #!/usr/bin/env ruby
2
+ # == Synopsis
3
+ #
4
+ # omfg: generate ruby code given an OMG IDL file
5
+ #
6
+ # == Usage
7
+ #
8
+ # omfg [OPTION] ... FILE
9
+ #
10
+ # -h, --help:
11
+ # show help
12
+ #
13
+ # -o [file]
14
+ # output to file [file]
15
+ #
16
+ # --prefix [module]
17
+ # module prefix the output with [module]
18
+
19
+ require 'getoptlong'
20
+ require 'rdoc/usage'
21
+ require 'rubygems'
22
+ require 'zomg'
23
+
24
+ opts = GetoptLong.new(
25
+ ['--prefix', GetoptLong::OPTIONAL_ARGUMENT],
26
+ ['-o', GetoptLong::OPTIONAL_ARGUMENT],
27
+ ['--help', '-h', GetoptLong::OPTIONAL_ARGUMENT]
28
+ )
29
+
30
+ prefix = nil
31
+ outfile = ARGV[1]
32
+ opts.each do |opt, arg|
33
+ case opt
34
+ when '--prefix'
35
+ prefix = arg
36
+ when '--help'
37
+ RDoc::usage
38
+ when '-o'
39
+ outfile = arg
40
+ end
41
+ end
42
+
43
+ header = <<-eoprefix
44
+ #
45
+ # DO NOT MODIFY!!!!
46
+ # This file is automatically generated by zomg #{ZOMG::VERSION}
47
+ # from IDL file "#{ARGV[0] || 'standard in'}".
48
+ #
49
+ eoprefix
50
+
51
+ tree = ARGV[0] ?
52
+ ZOMG::IDL.parse(File.read(ARGV[0])) : ZOMG::IDL.parse($stdin.read)
53
+
54
+ rubycode = "#{header}\n#{tree.to_ruby(prefix)}"
55
+ outfile ? File.open(outfile, 'wb') { |f| f.write(rubycode) } : puts(rubycode)
56
+
@@ -0,0 +1,169 @@
1
+ module ZOMG
2
+ module IDL
3
+ class Scanner
4
+
5
+ /*
6
+ * MICO --- a free CORBA implementation
7
+ * Copyright (C) 1997-98 Kay Roemer & Arno Puder
8
+ *
9
+ * This program is free software; you can redistribute it and/or modify
10
+ * it under the terms of the GNU General Public License as published by
11
+ * the Free Software Foundation; either version 2 of the License, or
12
+ * (at your option) any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ * GNU General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU General Public License
20
+ * along with this program; if not, write to the Free Software
21
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22
+ *
23
+ * Send comments and/or bug reports to:
24
+ * mico@informatik.uni-frankfurt.de
25
+ *
26
+ * Converstion to RACC Copyright (C) 2008 Aaron Patterson
27
+ */
28
+
29
+ macro
30
+ Digits [0-9]+
31
+ Oct_Digit [0-7]
32
+ Hex_Digit [a-fA-F0-9]
33
+ Int_Literal [1-9][0-9]*
34
+ Oct_Literal 0{Oct_Digit}*
35
+ Hex_Literal 0[xX]{Hex_Digit}*
36
+ Comment \/\*(.|[\r\n])*?\*\/
37
+ Esc_Sequence1 \\\\\\\\\[ntvbrfa\\\\?'\\\\\\\\\"]
38
+ Esc_Sequence2 \\\\\\\\\{Oct_Digit}{1,3}
39
+ Esc_Sequence3 \\\\\\\\\[xX]{Hex_Digit}{1,2}
40
+ Esc_Sequence ({Esc_Sequence1}|{Esc_Sequence2}|{Esc_Sequence3})
41
+ Char ([^\n\t\"\'\\\]|{Esc_Sequence})
42
+ Char_Literal '({Char}|\")'
43
+ String_Literal "({Char}|')*"
44
+ Float_Literal1 {Digits}\.{Digits}[eE][\+-]?{Digits}
45
+ Float_Literal2 {Digits}\.[eE][\+-]?{Digits}
46
+ Float_Literal3 {Digits}[eE][\+-]?{Digits}
47
+ Float_Literal4 {Digits}\.{Digits}
48
+ Float_Literal5 {Digits}\.
49
+ Float_Literal6 \.{Digits}[eE][\+-]?{Digits}
50
+ Float_Literal7 \.{Digits}
51
+ Fixed_Literal1 {Digits}[dD]
52
+ Fixed_Literal2 {Digits}\.[dD]
53
+ Fixed_Literal3 \.{Digits}[dD]
54
+ Fixed_Literal4 {Digits}\.{Digits}[dD]
55
+ CORBA_Identifier [a-zA-Z_][a-zA-Z0-9_]*
56
+ IDENT [a-zA-Z0-9_]
57
+
58
+ rule
59
+
60
+ # [:state] pattern [actions]
61
+ [\s\n\r]
62
+ {Comment} { [:T_COMMENT, text] }
63
+ \/\/[^\n]* { [:T_COMMENT, text] }
64
+ \#pragma[^\n]*\n { [:T_PRAGMA, text] }
65
+ \#[^\n]*\n { [:T_PREPROCESSOR, text] }
66
+ \{ { [:T_LEFT_CURLY_BRACKET, text] }
67
+ \} { [:T_RIGHT_CURLY_BRACKET, text] }
68
+ \[ { [:T_LEFT_SQUARE_BRACKET, text] }
69
+ \] { [:T_RIGHT_SQUARE_BRACKET, text] }
70
+ \( { [:T_LEFT_PARANTHESIS, text] }
71
+ \) { [:T_RIGHT_PARANTHESIS, text] }
72
+ \:\: { [:T_SCOPE, text] }
73
+ : { [:T_COLON, text] }
74
+ , { [:T_COMMA, text] }
75
+ ; { [:T_SEMICOLON, text] }
76
+ = { [:T_EQUAL, text] }
77
+ >> { [:T_SHIFTRIGHT, text] }
78
+ << { [:T_SHIFTLEFT, text] }
79
+ \+ { [:T_PLUS_SIGN, text] }
80
+ - { [:T_MINUS_SIGN,text] }
81
+ \* { [:T_ASTERISK, text] }
82
+ \/ { [:T_SOLIDUS,text] }
83
+ % { [:T_PERCENT_SIGN,text] }
84
+ ~ { [:T_TILDE,text] }
85
+ \| { [:T_VERTICAL_LINE,text] };
86
+ \^ { [:T_CIRCUMFLEX,text] }
87
+ & { [:T_AMPERSAND,text] }
88
+ < { [:T_LESS_THAN_SIGN,text] }
89
+ > { [:T_GREATER_THAN_SIGN, text] }
90
+ const(?!{IDENT}) { [:T_CONST, text] }
91
+ typedef(?!{IDENT}) { [:T_TYPEDEF, text] }
92
+ float(?!{IDENT}) { [:T_FLOAT, text] }
93
+ double(?!{IDENT}) { [:T_DOUBLE, text] }
94
+ char(?!{IDENT}) { [:T_CHAR, text] }
95
+ wchar(?!{IDENT}) { [:T_WCHAR, text] }
96
+ fixed(?!{IDENT}) { [:T_FIXED, text] }
97
+ boolean(?!{IDENT}) { [:T_BOOLEAN, text] }
98
+ string(?!{IDENT}) { [:T_STRING, text] }
99
+ wstring(?!{IDENT}) { [:T_WSTRING, text] }
100
+ void(?!{IDENT}) { [:T_VOID, text] }
101
+ unsigned(?!{IDENT}) { [:T_UNSIGNED, text] }
102
+ long(?!{IDENT}) { [:T_LONG, text] }
103
+ short(?!{IDENT}) { [:T_SHORT, text] }
104
+ FALSE { [:T_FALSE, text] }
105
+ TRUE { [:T_TRUE, text] }
106
+ struct(?!{IDENT}) { [:T_STRUCT, text] }
107
+ union(?!{IDENT}) { [:T_UNION, text] }
108
+ switch(?!{IDENT}) { [:T_SWITCH, text] }
109
+ case(?!{IDENT}) { [:T_CASE, text] }
110
+ default(?!{IDENT}) { [:T_DEFAULT, text] }
111
+ enum(?!{IDENT}) { [:T_ENUM, text] }
112
+ interface(?!{IDENT}) { [:T_INTERFACE, text] }
113
+ inout(?!{IDENT}) { [:T_INOUT, text] }
114
+ in(?!{IDENT}) { [:T_IN, text] }
115
+ out(?!{IDENT}) { [:T_OUT, text] }
116
+ abstract(?!{IDENT}) { [:T_ABSTRACT, text] }
117
+ valuetype(?!{IDENT}) { [:T_VALUETYPE, text] }
118
+ truncatable(?!{IDENT}) { [:T_TRUNCATABLE, text] }
119
+ supports(?!{IDENT}) { [:T_SUPPORTS, text] }
120
+ custom(?!{IDENT}) { [:T_CUSTOM, text] }
121
+ public(?!{IDENT}) { [:T_PUBLIC, text] }
122
+ private(?!{IDENT}) { [:T_PRIVATE, text] }
123
+ factory(?!{IDENT}) { [:T_FACTORY, text] }
124
+ native(?!{IDENT}) { [:T_NATIVE, text] }
125
+ ValueBase { [:T_VALUEBASE, text] }
126
+
127
+ module(?!{IDENT}) { [:T_MODULE, text] }
128
+ octet(?!{IDENT}) { [:T_OCTET, text] }
129
+ any(?!{IDENT}) { [:T_ANY, text] }
130
+ sequence(?!{IDENT}) { [:T_SEQUENCE, text] }
131
+ readonly(?!{IDENT}) { [:T_READONLY, text] }
132
+ attribute(?!{IDENT}) { [:T_ATTRIBUTE, text] }
133
+ exception(?!{IDENT}) { [:T_EXCEPTION, text] }
134
+ oneway(?!{IDENT}) { [:T_ONEWAY, text] }
135
+ raises(?!{IDENT}) { [:T_RAISES, text] }
136
+ context(?!{IDENT}) { [:T_CONTEXT, text] }
137
+
138
+ Object(?!{IDENT}) { [:T_OBJECT, text] }
139
+ Principal { [:T_PRINCIPAL, text] }
140
+
141
+
142
+ L{String_Literal} { [:T_WIDE_STRING_LITERAL, text] }
143
+ L{Char_Literal} { [:T_WIDE_CHARACTER_LITERAL, text] }
144
+ {CORBA_Identifier} { [:T_IDENTIFIER, text] }
145
+ {Float_Literal1} { [:T_FLOATING_PT_LITERAL, text] }
146
+ {Float_Literal2} {
147
+ text = text.split('.').join('.0')
148
+ [:T_FLOATING_PT_LITERAL, text]
149
+ }
150
+ {Float_Literal3} { [:T_FLOATING_PT_LITERAL, text] }
151
+ {Fixed_Literal4} { [:T_FIXED_PT_LITERAL, text.gsub(/[Dd]/,'')] }
152
+ {Float_Literal4} { [:T_FLOATING_PT_LITERAL, text] }
153
+ {Fixed_Literal2} { [:T_FIXED_PT_LITERAL, text.gsub(/[.dD]/,'')] }
154
+ {Float_Literal5} { [:T_FLOATING_PT_LITERAL, "#{text}0"] }
155
+ {Float_Literal6} { [:T_FLOATING_PT_LITERAL, "0#{text}"] }
156
+ {Fixed_Literal3} {
157
+ [:T_FIXED_PT_LITERAL, "0#{text.gsub(/[dD]/, '')}"]
158
+ }
159
+ {Float_Literal7} { [:T_FLOATING_PT_LITERAL, "0#{text}"] }
160
+ {Fixed_Literal1} { [:T_FIXED_PT_LITERAL, text.gsub(/[dD]/,'')] }
161
+ {Hex_Literal} { [:T_INTEGER_LITERAL, text] }
162
+ {Oct_Literal} { [:T_INTEGER_LITERAL, text] }
163
+ {Int_Literal} { [:T_INTEGER_LITERAL, text] }
164
+ {Char_Literal} { [:T_CHARACTER_LITERAL, text] }
165
+ {String_Literal} { [:T_STRING_LITERAL, text] }
166
+ [^\s\n\r] { [:T_UNKNOWN, text] }
167
+ end
168
+ end
169
+ end