zomg 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -0
- data/Manifest.txt +237 -0
- data/README.txt +59 -0
- data/Rakefile +34 -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/lexer.rb +2151 -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 +52 -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/scanner.rb +367 -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 +173 -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 +30 -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 +15 -0
- data/test/test_parser.rb +17 -0
- data/test/test_scanner.rb +234 -0
- metadata +336 -0
data/History.txt
ADDED
data/Manifest.txt
ADDED
@@ -0,0 +1,237 @@
|
|
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
|
data/README.txt
ADDED
@@ -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.
|
data/Rakefile
ADDED
@@ -0,0 +1,34 @@
|
|
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.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
|
+
# vim: syntax=Ruby
|
data/bin/omfg
ADDED
@@ -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
|
+
|
data/lib/scanner.rex
ADDED
@@ -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
|