crystalizer 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. data/Changelog +27 -0
  2. data/README +79 -0
  3. data/Rakefile +24 -0
  4. data/TODO +14 -0
  5. data/VERSION +1 -0
  6. data/benchmarks/bench.rb +129 -0
  7. data/benchmarks/concretize_test.rb +26 -0
  8. data/benchmarks/extconf.rb +10 -0
  9. data/benchmarks/tak_rb.rb +7 -0
  10. data/benchmarks/tak_so.rb +7 -0
  11. data/benchmarks/tak_source.rb +16 -0
  12. data/bin/rb2cx +162 -0
  13. data/doc/eval2c.txt +246 -0
  14. data/doc/gen_html.rb +26 -0
  15. data/doc/html_template +10 -0
  16. data/doc/index.txt +169 -0
  17. data/doc/limitations.txt +529 -0
  18. data/doc/optimizations.txt +185 -0
  19. data/doc/rb2cx.txt +130 -0
  20. data/doc/style.css +27 -0
  21. data/lib/concretizer.rb +3 -0
  22. data/lib/ruby2cext/c_function.rb +617 -0
  23. data/lib/ruby2cext/common_node_comp.rb +1412 -0
  24. data/lib/ruby2cext/compiler.rb +311 -0
  25. data/lib/ruby2cext/concretize.rb +269 -0
  26. data/lib/ruby2cext/error.rb +15 -0
  27. data/lib/ruby2cext/eval2c.rb +126 -0
  28. data/lib/ruby2cext/parser.rb +36 -0
  29. data/lib/ruby2cext/plugin.rb +24 -0
  30. data/lib/ruby2cext/plugins/builtin_methods.rb +817 -0
  31. data/lib/ruby2cext/plugins/cache_call.rb +293 -0
  32. data/lib/ruby2cext/plugins/case_optimize.rb +102 -0
  33. data/lib/ruby2cext/plugins/const_cache.rb +36 -0
  34. data/lib/ruby2cext/plugins/direct_self_call.rb +70 -0
  35. data/lib/ruby2cext/plugins/inline_builtin.rb +797 -0
  36. data/lib/ruby2cext/plugins/inline_methods.rb +68 -0
  37. data/lib/ruby2cext/plugins/ivar_cache.rb +147 -0
  38. data/lib/ruby2cext/plugins/require_include.rb +69 -0
  39. data/lib/ruby2cext/plugins/util.rb +154 -0
  40. data/lib/ruby2cext/plugins/warnings.rb +121 -0
  41. data/lib/ruby2cext/scopes.rb +225 -0
  42. data/lib/ruby2cext/str_to_c_strlit.rb +12 -0
  43. data/lib/ruby2cext/tools.rb +80 -0
  44. data/lib/ruby2cext/version.rb +22 -0
  45. data/results +68 -0
  46. data/setup.rb +1585 -0
  47. data/stuff/builtin_methods.rb +69 -0
  48. data/stuff/builtin_methods_test.rb +37 -0
  49. data/test/bootstrap.rb +10 -0
  50. data/test/causes_crash_all_opts.rb +1165 -0
  51. data/test/eval2c/test_eval2c.rb +37 -0
  52. data/test/temp_17.rb +16 -0
  53. data/test/temp_18.rb +8 -0
  54. data/test/temp_19.rb +8 -0
  55. data/test/temp_2.rb +7 -0
  56. data/test/temp_20.rb +5 -0
  57. data/test/temp_21.rb +161 -0
  58. data/test/temp_22.rb +7 -0
  59. data/test/temp_23.rb +7 -0
  60. data/test/temp_24.rb +219 -0
  61. data/test/temp_25.rb +7 -0
  62. data/test/temp_26.rb +11 -0
  63. data/test/temp_27.rb +11 -0
  64. data/test/temp_28.rb +9 -0
  65. data/test/temp_29.rb +9 -0
  66. data/test/temp_3.rb +0 -0
  67. data/test/temp_30.rb +0 -0
  68. data/test/temp_31.rb +10 -0
  69. data/test/temp_32.rb +10 -0
  70. data/test/temp_33.rb +15 -0
  71. data/test/temp_34.rb +15 -0
  72. data/test/temp_35.rb +7 -0
  73. data/test/temp_36.rb +7 -0
  74. data/test/temp_37.rb +10 -0
  75. data/test/temp_38.rb +10 -0
  76. data/test/temp_39.rb +0 -0
  77. data/test/temp_4.rb +7 -0
  78. data/test/temp_40.rb +50 -0
  79. data/test/temp_41.rb +50 -0
  80. data/test/temp_42.rb +8 -0
  81. data/test/temp_43.rb +8 -0
  82. data/test/temp_44.rb +0 -0
  83. data/test/temp_48.rb +7 -0
  84. data/test/temp_49.rb +7 -0
  85. data/test/temp_5.rb +7 -0
  86. data/test/temp_59.rb +7 -0
  87. data/test/temp_6.rb +7 -0
  88. data/test/temp_60.rb +7 -0
  89. data/test/temp_68.rb +239 -0
  90. data/test/temp_7.rb +7 -0
  91. data/test/temp_70.rb +7 -0
  92. data/test/temp_71.rb +7 -0
  93. data/test/temp_72.rb +13 -0
  94. data/test/temp_73.rb +7 -0
  95. data/test/temp_74.rb +7 -0
  96. data/test/temp_76.rb +7 -0
  97. data/test/temp_77.rb +13 -0
  98. data/test/temp_79.rb +7 -0
  99. data/test/temp_8.rb +14 -0
  100. data/test/temp_81.rb +14 -0
  101. data/test/temp_83.rb +0 -0
  102. data/test/temp_84.rb +7 -0
  103. data/test/temp_85.rb +7 -0
  104. data/test/temp_86.rb +14 -0
  105. data/test/temp_87.rb +7 -0
  106. data/test/temp_88.rb +7 -0
  107. data/test/temp_89.rb +7 -0
  108. data/test/temp_9.rb +14 -0
  109. data/test/temp_90.rb +0 -0
  110. data/test/temp_91.rb +7 -0
  111. data/test/temp_92.rb +7 -0
  112. data/test/temp_93.rb +7 -0
  113. data/test/temp_94.rb +7 -0
  114. data/test/temp_95.rb +7 -0
  115. data/test/temp_96.rb +0 -0
  116. data/test/temp_97.rb +0 -0
  117. data/test/temp_98.rb +7 -0
  118. data/test/temp_99.rb +7 -0
  119. data/test/test_concretize.rb +132 -0
  120. data/test/test_concretize_all.rb +15 -0
  121. data/test/test_crystalize_block.rb +73 -0
  122. data/test/test_files/test.rb +615 -0
  123. data/test/test_files/vmode_test.rb +73 -0
  124. data/test/test_files/warn_test.rb +35 -0
  125. data/test/test_syntax.rb +25 -0
  126. metadata +268 -0
@@ -0,0 +1,69 @@
1
+ unless $".empty?
2
+ raise '$" is not empty'
3
+ end
4
+
5
+ classes = [
6
+ NilClass,
7
+ #Class, Module,
8
+ Float, String, Regexp, Array, Fixnum, Hash, Bignum,
9
+ #Struct, ???
10
+ #File, rb_cIO and rb_cFile conflict
11
+ TrueClass, FalseClass,
12
+ #MatchData,
13
+ Symbol,
14
+ ].sort_by { |c| c.name }
15
+
16
+ def method_info(meth, klass)
17
+ res =
18
+ case meth.inspect
19
+ when /: (\w+)\((\w+)\)#(.+)>/
20
+ [$1.to_sym, $3.to_sym, meth.arity, $2.to_sym]
21
+ when /: (\w+)#(.+)>/
22
+ [$1.to_sym, $2.to_sym, meth.arity]
23
+ else
24
+ p meth
25
+ raise
26
+ end
27
+ if res[0] != klass.name.to_sym
28
+ p res
29
+ raise
30
+ end
31
+ res[1..-1]
32
+ end
33
+
34
+ taboo_methods =
35
+ (Object.instance_methods - [
36
+ "==", "===", "=~", "__id__", "class",
37
+ "clone", # ?
38
+ "dup", "eql?", "equal?",
39
+ "freeze", "frozen?",
40
+ "hash", "inspect",
41
+ "instance_of?",
42
+ "instance_variable_get", "instance_variable_set", "instance_variables",
43
+ "is_a?", "kind_of?",
44
+ "method", "nil?", "object_id",
45
+ "taint", "tainted?", "to_a", "to_s", "untaint"
46
+ ]) +
47
+ (Enumerable.instance_methods - ["entries", "include?", "member?", "to_a"])+
48
+ (Precision.instance_methods)+
49
+ ["each"]
50
+
51
+ first = true
52
+ common = []
53
+ all = classes.map { |klass|
54
+ meths = ((klass.instance_methods - taboo_methods).map { |ms|
55
+ method_info(klass.instance_method(ms), klass)
56
+ }.select { |mi| mi[1] >= -1 }.sort_by { |mi| [mi[2].to_s, mi[1], mi[0].to_s] })
57
+ if first
58
+ common = meths
59
+ first = false
60
+ else
61
+ common &= meths
62
+ end
63
+ [klass, meths]
64
+ }
65
+ all = all.map { |(kl, meth)| [kl, meth - common] }
66
+ puts "Common:"
67
+ puts(common.map { |mi| " #{mi.inspect}," })
68
+ require "pp"
69
+ pp all
@@ -0,0 +1,37 @@
1
+
2
+ $:.unshift("../lib")
3
+ require "ruby2cext/compiler"
4
+ require "ruby2cext/plugins/builtin_methods"
5
+
6
+ include Ruby2CExtension
7
+
8
+ SELF_OP = [:self, {}]
9
+
10
+ calls = []
11
+
12
+ Plugins::BuiltinMethods::METHODS.each { |k, v|
13
+ v.each { |arr|
14
+ args = (arr[1] == 0) ? false : [:array, [SELF_OP] * arr[1]]
15
+ calls << [:call, {:mid=>arr[0], :recv=>SELF_OP, :args=>args}]
16
+ }
17
+ }
18
+
19
+ c = Compiler.new("bm_test", false)
20
+ c.add_plugin(Plugins::BuiltinMethods, Plugins::BuiltinMethods::SUPPORTED_BUILTINS)
21
+ c.add_toplevel(c.compile_toplevel_function([:scope, {
22
+ :tbl=>nil,
23
+ :next=> [:block, calls],
24
+ :rval=>false
25
+ }]))
26
+ c = c.to_c_code
27
+ c=c.split("\n")[0..-3]
28
+ lookups = c.join("\n").scan(/= (builtinopt_method_lookup.rb_.*);/).flatten
29
+ p lookups.size
30
+ lookups.each { |l|
31
+ c << "if (!(#{l})) rb_warn(\"#{l} failed\");"
32
+ }
33
+ c << "}"
34
+ File.open("bm_test.c", "w") { |f|
35
+ f.puts c.join("\n")
36
+ }
37
+ Compiler.compile_c_file_to_dllib("bm_test.c")
@@ -0,0 +1,10 @@
1
+ $: << File.dirname(__FILE__) + '/../lib'
2
+ require 'frubygems'
3
+ require 'rubynode'
4
+ require "../lib/ruby2cext/compiler"
5
+ require "../lib/ruby2cext/version"
6
+ require 'logger'
7
+ require 'assert2'
8
+ require 'benchmark'
9
+ require 'backtracer'
10
+
@@ -0,0 +1,1165 @@
1
+ # temp file: autogenerated: Mon Sep 28 15:30:43 -0600 2009 for class Gem::ConfigFile
2
+ class Gem::ConfigFile
3
+ def backtrace()
4
+ (@backtrace or $DEBUG)
5
+ end
6
+ end
7
+ # temp file: autogenerated: Mon Sep 28 15:30:47 -0600 2009 for class Hash
8
+ class Hash
9
+ def eql?(other)
10
+ (self == [other])
11
+ end
12
+ end
13
+ # temp file: autogenerated: Mon Sep 28 15:30:59 -0600 2009 for class Bignum
14
+ class Bignum
15
+ def rpower(other)
16
+ if (other >= [0]) then
17
+ self.power!([other])
18
+ else
19
+ (Rational.new!([self, 1]) ** [other])
20
+ end
21
+ end
22
+ end
23
+ # temp file: autogenerated: Mon Sep 28 15:30:59 -0600 2009 for class Bignum
24
+ class Bignum
25
+ def quo(other)
26
+ (Rational.new!([self, 1]) / [other])
27
+ end
28
+ end
29
+ # temp file: autogenerated: Mon Sep 28 15:31:00 -0600 2009 for class Fixnum
30
+ class Fixnum
31
+ def rpower(other)
32
+ if (other >= [0]) then
33
+ self.power!([other])
34
+ else
35
+ (Rational.new!([self, 1]) ** [other])
36
+ end
37
+ end
38
+ end
39
+ # temp file: autogenerated: Mon Sep 28 15:31:00 -0600 2009 for class Fixnum
40
+ class Fixnum
41
+ def quo(other)
42
+ (Rational.new!([self, 1]) / [other])
43
+ end
44
+ end
45
+ # temp file: autogenerated: Mon Sep 28 15:31:00 -0600 2009 for class Integer
46
+ class Integer
47
+ def denominator()
48
+ 1
49
+ end
50
+ end
51
+ # temp file: autogenerated: Mon Sep 28 15:31:00 -0600 2009 for class Integer
52
+ class Integer
53
+ def numerator()
54
+ self
55
+ end
56
+ end
57
+ # temp file: autogenerated: Mon Sep 28 15:31:07 -0600 2009 for class Class
58
+ class Class
59
+ def concretize!()
60
+ Concretize.c_ify_class!([self])
61
+ end
62
+ end
63
+ # temp file: autogenerated: Mon Sep 28 15:31:07 -0600 2009 for class Module
64
+ class Module
65
+ def yaml_tag_read_class(name)
66
+ name
67
+ end
68
+ end
69
+ # temp file: autogenerated: Mon Sep 28 15:31:07 -0600 2009 for class Object
70
+ class Object
71
+ def to_yaml_style()
72
+ # do nothing
73
+ end
74
+ end
75
+ # temp file: autogenerated: Mon Sep 28 15:31:07 -0600 2009 for class Object
76
+ class Object
77
+ def in?(collection)
78
+ collection.include?([self])
79
+ end
80
+ end
81
+ # temp file: autogenerated: Mon Sep 28 15:31:07 -0600 2009 for class Object
82
+ class Object
83
+ def deep_clone()
84
+ Marshal.load([Marshal.dump([self])])
85
+ end
86
+ end
87
+ # temp file: autogenerated: Mon Sep 28 15:31:07 -0600 2009 for class Object
88
+ class Object
89
+ def singleton_class()
90
+ class << self
91
+ self
92
+ end
93
+ end
94
+ end
95
+ # temp file: autogenerated: Mon Sep 28 15:31:07 -0600 2009 for class Gem::Builder
96
+ class Gem::Builder
97
+ def success()
98
+ " Successfully built RubyGem\n Name: "
99
+ end
100
+ end
101
+ # temp file: autogenerated: Mon Sep 28 15:31:07 -0600 2009 for class Gem::SourceIndex
102
+ class Gem::SourceIndex
103
+ def specification(full_name)
104
+ @gems[[full_name]]
105
+ end
106
+ end
107
+ # temp file: autogenerated: Mon Sep 28 15:31:08 -0600 2009 for class Gem::SourceIndex
108
+ class Gem::SourceIndex
109
+ def dump()
110
+ Marshal.dump([self])
111
+ end
112
+ end
113
+ # temp file: autogenerated: Mon Sep 28 15:31:08 -0600 2009 for class Gem::SourceIndex
114
+ class Gem::SourceIndex
115
+ def remove_spec(full_name)
116
+ @gems.delete([full_name])
117
+ end
118
+ end
119
+ # temp file: autogenerated: Mon Sep 28 15:31:08 -0600 2009 for class Gem::SourceIndex
120
+ class Gem::SourceIndex
121
+ def all_gems()
122
+ @gems
123
+ end
124
+ end
125
+ # temp file: autogenerated: Mon Sep 28 15:31:08 -0600 2009 for class Gem::Specification
126
+ class Gem::Specification
127
+ def sort_obj()
128
+ [@name, @version, (@new_platform == [Gem::Platform::RUBY]) ? (-1) : (1)]
129
+ end
130
+ end
131
+ # temp file: autogenerated: Mon Sep 28 15:31:08 -0600 2009 for class Gem::Specification
132
+ class Gem::Specification
133
+ def mark_version()
134
+ @rubygems_version = Gem::RubyGemsVersion
135
+ end
136
+ end
137
+ # temp file: autogenerated: Mon Sep 28 15:31:08 -0600 2009 for class Gem::Specification
138
+ class Gem::Specification
139
+ def to_s()
140
+ "#<Gem::Specification name="
141
+ end
142
+ end
143
+ # temp file: autogenerated: Mon Sep 28 15:31:09 -0600 2009 for class Gem::Platform
144
+ class Gem::Platform
145
+ def to_a()
146
+ [@cpu, @os, @version]
147
+ end
148
+ end
149
+ # temp file: autogenerated: Mon Sep 28 15:31:09 -0600 2009 for class Gem::Platform
150
+ class Gem::Platform
151
+ def =~(other)
152
+ case other
153
+ when Gem::Platform then
154
+ # do nothing
155
+ when String then
156
+ other = case other
157
+ when /^i686-darwin(\d)/ then
158
+ ["x86", "darwin", $1]
159
+ when /^i\d86-linux/ then
160
+ ["x86", "linux", nil]
161
+ when "java", "jruby" then
162
+ [nil, "java", nil]
163
+ when /mswin32(\_(\d+))?/ then
164
+ ["x86", "mswin32", $2]
165
+ when "powerpc-darwin" then
166
+ ["powerpc", "darwin", nil]
167
+ when /powerpc-darwin(\d)/ then
168
+ ["powerpc", "darwin", $1]
169
+ when /sparc-solaris2.8/ then
170
+ ["sparc", "solaris", "2.8"]
171
+ when /universal-darwin(\d)/ then
172
+ ["universal", "darwin", $1]
173
+ else
174
+ other
175
+ end
176
+ other = Gem::Platform.new([other])
177
+ else
178
+ return nil
179
+ end
180
+ self.===([other])
181
+ end
182
+ end
183
+ # temp file: autogenerated: Mon Sep 28 15:31:09 -0600 2009 for class Date
184
+ class Date
185
+ def step(limit, step = 1)
186
+ da = self
187
+ op = ["-", "<=", ">="][[(step <=> [0])]]
188
+ while da.__send__([op, limit]) do
189
+ yield(da)
190
+ da = (da + [step])
191
+ end
192
+ self
193
+ end
194
+ end
195
+ # temp file: autogenerated: Mon Sep 28 15:31:09 -0600 2009 for class Date
196
+ class Date
197
+ def _dump(limit)
198
+ Marshal.dump([[@ajd, @of, @sg], -1])
199
+ end
200
+ end
201
+ # temp file: autogenerated: Mon Sep 28 15:31:09 -0600 2009 for class Date
202
+ class Date
203
+ def start()
204
+ @sg
205
+ end
206
+ end
207
+ # temp file: autogenerated: Mon Sep 28 15:31:09 -0600 2009 for class Date
208
+ class Date
209
+ def eql?(other)
210
+ (Date.===([other]) and (self == [other]))
211
+ end
212
+ end
213
+ # temp file: autogenerated: Mon Sep 28 15:31:09 -0600 2009 for class Date
214
+ class Date
215
+ def ajd()
216
+ @ajd
217
+ end
218
+ end
219
+ # temp file: autogenerated: Mon Sep 28 15:31:09 -0600 2009 for class Date
220
+ class Date
221
+ def <<(n)
222
+ (self >> [-n])
223
+ end
224
+ end
225
+ # temp file: autogenerated: Mon Sep 28 15:31:09 -0600 2009 for class Gem::StreamUI::VerboseProgressReporter
226
+ class Gem::StreamUI::VerboseProgressReporter
227
+ def updated(message)
228
+ @count = (@count + [1])
229
+ @out.puts([""])
230
+ end
231
+ end
232
+ # temp file: autogenerated: Mon Sep 28 15:31:10 -0600 2009 for class Gem::StreamUI::VerboseProgressReporter
233
+ class Gem::StreamUI::VerboseProgressReporter
234
+ def done()
235
+ @out.puts([@terminal_message])
236
+ end
237
+ end
238
+ # temp file: autogenerated: Mon Sep 28 15:31:10 -0600 2009 for class Gem::StreamUI::SimpleProgressReporter
239
+ class Gem::StreamUI::SimpleProgressReporter
240
+ def done()
241
+ @out.puts(["\n"])
242
+ end
243
+ end
244
+ # temp file: autogenerated: Mon Sep 28 15:31:10 -0600 2009 for class Gem::StreamUI::SilentProgressReporter
245
+ class Gem::StreamUI::SilentProgressReporter
246
+ def updated(message)
247
+ # do nothing
248
+ end
249
+ end
250
+ # temp file: autogenerated: Mon Sep 28 15:31:10 -0600 2009 for class Gem::StreamUI::SilentProgressReporter
251
+ class Gem::StreamUI::SilentProgressReporter
252
+ def done()
253
+ # do nothing
254
+ end
255
+ end
256
+ # temp file: autogenerated: Mon Sep 28 15:31:10 -0600 2009 for class Gem::StreamUI
257
+ class Gem::StreamUI
258
+ def say(statement = "")
259
+ @outs.puts([statement])
260
+ end
261
+ end
262
+ # temp file: autogenerated: Mon Sep 28 15:31:10 -0600 2009 for class Gem::StreamUI
263
+ class Gem::StreamUI
264
+ def debug(statement)
265
+ @errs.puts([statement])
266
+ end
267
+ end
268
+ # temp file: autogenerated: Mon Sep 28 15:31:10 -0600 2009 for class YAML::Stream
269
+ class YAML::Stream
270
+ def edit(doc_num, doc)
271
+ @documents[[doc_num]] = doc
272
+ end
273
+ end
274
+ # temp file: autogenerated: Mon Sep 28 15:31:10 -0600 2009 for class YAML::Stream
275
+ class YAML::Stream
276
+ def add(doc)
277
+ (@documents << [doc])
278
+ end
279
+ end
280
+ # temp file: autogenerated: Mon Sep 28 15:31:11 -0600 2009 for class YAML::Stream
281
+ class YAML::Stream
282
+ def [](i)
283
+ @documents[[i]]
284
+ end
285
+ end
286
+ # temp file: autogenerated: Mon Sep 28 15:31:11 -0600 2009 for class Gem::GemPathSearcher
287
+ class Gem::GemPathSearcher
288
+ def lib_dirs_for(spec)
289
+ ""
290
+ end
291
+ end
292
+ # temp file: autogenerated: Mon Sep 28 15:31:11 -0600 2009 for class Gem::Dependency
293
+ class Gem::Dependency
294
+ def to_s()
295
+ ""
296
+ end
297
+ end
298
+ # temp file: autogenerated: Mon Sep 28 15:31:11 -0600 2009 for class Gem::Dependency
299
+ class Gem::Dependency
300
+ def normalize()
301
+ ver = @version_requirement.instance_variable_get([:@version])
302
+ @version_requirements = Gem::Requirement.new([[ver]])
303
+ @version_requirement = nil
304
+ end
305
+ end
306
+ # temp file: autogenerated: Mon Sep 28 15:31:11 -0600 2009 for class Gem::Requirement
307
+ class Gem::Requirement
308
+ def marshal_dump()
309
+ [@requirements]
310
+ end
311
+ end
312
+ # temp file: autogenerated: Mon Sep 28 15:31:11 -0600 2009 for class Gem::Requirement
313
+ class Gem::Requirement
314
+ def marshal_load(array)
315
+ @requirements = array[[0]]
316
+ @version = nil
317
+ end
318
+ end
319
+ # temp file: autogenerated: Mon Sep 28 15:31:12 -0600 2009 for class Gem::Requirement
320
+ class Gem::Requirement
321
+ def satisfy?(op, version, required_version)
322
+ OPS[[op]].call([version, required_version])
323
+ end
324
+ end
325
+ # temp file: autogenerated: Mon Sep 28 15:31:12 -0600 2009 for class Gem::Version::Part
326
+ class Gem::Version::Part
327
+ def inspect()
328
+ @value
329
+ end
330
+ end
331
+ # temp file: autogenerated: Mon Sep 28 15:31:12 -0600 2009 for class Gem::Version
332
+ class Gem::Version
333
+ def inspect()
334
+ "#<"
335
+ end
336
+ end
337
+ # temp file: autogenerated: Mon Sep 28 15:31:12 -0600 2009 for class Gem::Version
338
+ class Gem::Version
339
+ def marshal_dump()
340
+ [@version]
341
+ end
342
+ end
343
+ # temp file: autogenerated: Mon Sep 28 15:31:12 -0600 2009 for class Gem::Version
344
+ class Gem::Version
345
+ def marshal_load(array)
346
+ self.version = [array[[0]]]
347
+ end
348
+ end
349
+ # temp file: autogenerated: Mon Sep 28 15:31:12 -0600 2009 for class Gem::Version
350
+ class Gem::Version
351
+ def pretty_print(q)
352
+ q.text(["Gem::Version.new("])
353
+ end
354
+ end
355
+ # temp file: autogenerated: Mon Sep 28 15:31:12 -0600 2009 for class Gem::Version
356
+ class Gem::Version
357
+ def to_yaml_properties()
358
+ ["@version"]
359
+ end
360
+ end
361
+ # temp file: autogenerated: Mon Sep 28 15:31:12 -0600 2009 for class Gem::Version
362
+ class Gem::Version
363
+ def yaml_initialize(tag, values)
364
+ self.version = [values[["version"]]]
365
+ end
366
+ end
367
+ # temp file: autogenerated: Mon Sep 28 15:31:12 -0600 2009 for class Gem::Version
368
+ class Gem::Version
369
+ def to_s()
370
+ @version
371
+ end
372
+ end
373
+ # temp file: autogenerated: Mon Sep 28 15:31:16 -0600 2009 for class YAML::DomainType
374
+ class YAML::DomainType
375
+ def to_yaml(opts = { })
376
+ @value.to_yaml([opts])
377
+ end
378
+ end
379
+ # temp file: autogenerated: Mon Sep 28 15:31:17 -0600 2009 for class YAML::PrivateType
380
+ class YAML::PrivateType
381
+ def to_yaml(opts = { })
382
+ @value.to_yaml([opts])
383
+ end
384
+ end
385
+ # temp file: autogenerated: Mon Sep 28 15:31:18 -0600 2009 for class FileUtils::Entry_
386
+ class FileUtils::Entry_
387
+ def inspect()
388
+ "#<"
389
+ end
390
+ end
391
+ # temp file: autogenerated: Mon Sep 28 15:31:18 -0600 2009 for class FileUtils::Entry_
392
+ class FileUtils::Entry_
393
+ def rel()
394
+ @rel
395
+ end
396
+ end
397
+ # temp file: autogenerated: Mon Sep 28 15:31:18 -0600 2009 for class FileUtils::Entry_
398
+ class FileUtils::Entry_
399
+ def dereference?()
400
+ @deref
401
+ end
402
+ end
403
+ # temp file: autogenerated: Mon Sep 28 15:31:19 -0600 2009 for class FileUtils::Entry_
404
+ class FileUtils::Entry_
405
+ def prefix()
406
+ (@prefix or @path)
407
+ end
408
+ end
409
+ # temp file: autogenerated: Mon Sep 28 15:31:19 -0600 2009 for class YAML::Pairs
410
+ class YAML::Pairs
411
+ def []=(k, val)
412
+ (self << [[k, val]])
413
+ val
414
+ end
415
+ end
416
+ # temp file: autogenerated: Mon Sep 28 15:31:19 -0600 2009 for class YAML::Pairs
417
+ class YAML::Pairs
418
+ def is_complex_yaml?()
419
+ true
420
+ end
421
+ end
422
+ # temp file: autogenerated: Mon Sep 28 15:31:19 -0600 2009 for class YAML::Pairs
423
+ class YAML::Pairs
424
+ def has_key?(k)
425
+ self.assoc([k]) ? (true) : (false)
426
+ end
427
+ end
428
+ # temp file: autogenerated: Mon Sep 28 15:31:20 -0600 2009 for class YAML::Omap
429
+ class YAML::Omap
430
+ def is_complex_yaml?()
431
+ true
432
+ end
433
+ end
434
+ # temp file: autogenerated: Mon Sep 28 15:31:20 -0600 2009 for class YAML::Omap
435
+ class YAML::Omap
436
+ def has_key?(k)
437
+ self.assoc([k]) ? (true) : (false)
438
+ end
439
+ end
440
+ # temp file: autogenerated: Mon Sep 28 15:31:20 -0600 2009 for class Date::Infinity
441
+ class Date::Infinity
442
+ def zero?()
443
+ false
444
+ end
445
+ end
446
+ # temp file: autogenerated: Mon Sep 28 15:31:20 -0600 2009 for class Date::Infinity
447
+ class Date::Infinity
448
+ def finite?()
449
+ false
450
+ end
451
+ end
452
+ # temp file: autogenerated: Mon Sep 28 15:31:20 -0600 2009 for class Date::Infinity
453
+ class Date::Infinity
454
+ def d()
455
+ @d
456
+ end
457
+ end
458
+ # temp file: autogenerated: Mon Sep 28 15:31:21 -0600 2009 for class DateTime
459
+ class DateTime
460
+ def strftime(fmt = "%FT%T%:z")
461
+ super([fmt])
462
+ end
463
+ end
464
+ # temp file: autogenerated: Mon Sep 28 15:31:21 -0600 2009 for class Rational
465
+ class Rational
466
+ def to_r()
467
+ self
468
+ end
469
+ end
470
+ # temp file: autogenerated: Mon Sep 28 15:31:22 -0600 2009 for class Rational
471
+ class Rational
472
+ def abs()
473
+ if (@numerator > [0]) then
474
+ Rational.new!([@numerator, @denominator])
475
+ else
476
+ Rational.new!([-@numerator, @denominator])
477
+ end
478
+ end
479
+ end
480
+ # temp file: autogenerated: Mon Sep 28 15:31:22 -0600 2009 for class Ruby2CExtension::Plugins::CacheCall
481
+ class Ruby2CExtension::Plugins::CacheCall
482
+ def init_c_code()
483
+ "\n init_method_cache();\n "
484
+ end
485
+ end
486
+ # temp file: autogenerated: Mon Sep 28 15:31:22 -0600 2009 for class Logger::Application
487
+ class Logger::Application
488
+ def level=(level)
489
+ @level = level
490
+ @log.level = [@level]
491
+ end
492
+ end
493
+ # temp file: autogenerated: Mon Sep 28 15:31:22 -0600 2009 for class Logger::Application
494
+ class Logger::Application
495
+ def set_log(logdev, shift_age = 0, shift_size = 1024000)
496
+ @log = Logger.new([logdev, shift_age, shift_size])
497
+ @log.progname = [@appname]
498
+ @log.level = [@level]
499
+ end
500
+ end
501
+ # temp file: autogenerated: Mon Sep 28 15:31:24 -0600 2009 for class Logger
502
+ class Logger
503
+ def debug?()
504
+ (@level <= [DEBUG])
505
+ end
506
+ end
507
+ # temp file: autogenerated: Mon Sep 28 15:31:24 -0600 2009 for class Logger
508
+ class Logger
509
+ def datetime_format=(datetime_format)
510
+ @default_formatter.datetime_format = [datetime_format]
511
+ end
512
+ end
513
+ # temp file: autogenerated: Mon Sep 28 15:31:24 -0600 2009 for class Logger
514
+ class Logger
515
+ def info?()
516
+ (@level <= [INFO])
517
+ end
518
+ end
519
+ # temp file: autogenerated: Mon Sep 28 15:31:24 -0600 2009 for class Logger
520
+ class Logger
521
+ def warn?()
522
+ (@level <= [WARN])
523
+ end
524
+ end
525
+ # temp file: autogenerated: Mon Sep 28 15:31:24 -0600 2009 for class Logger
526
+ class Logger
527
+ def error?()
528
+ (@level <= [ERROR])
529
+ end
530
+ end
531
+ # temp file: autogenerated: Mon Sep 28 15:31:24 -0600 2009 for class Logger
532
+ class Logger
533
+ def fatal?()
534
+ (@level <= [FATAL])
535
+ end
536
+ end
537
+ # temp file: autogenerated: Mon Sep 28 15:31:24 -0600 2009 for class RubyNode
538
+ class RubyNode
539
+ def inspect()
540
+ "#<"
541
+ end
542
+ end
543
+ # temp file: autogenerated: Mon Sep 28 15:31:24 -0600 2009 for class RubyNode
544
+ class RubyNode
545
+ def to_s()
546
+ ""
547
+ end
548
+ end
549
+ # temp file: autogenerated: Mon Sep 28 15:31:26 -0600 2009 for class SexpAny
550
+ class SexpAny
551
+ def ==(o)
552
+ Sexp.===([o])
553
+ end
554
+ end
555
+ # temp file: autogenerated: Mon Sep 28 15:31:26 -0600 2009 for class SexpAny
556
+ class SexpAny
557
+ def ===(o)
558
+ return Sexp.===([o])
559
+ end
560
+ end
561
+ # temp file: autogenerated: Mon Sep 28 15:31:26 -0600 2009 for class SexpAny
562
+ class SexpAny
563
+ def inspect()
564
+ "ANY"
565
+ end
566
+ end
567
+ # temp file: autogenerated: Mon Sep 28 15:31:26 -0600 2009 for class Sexp
568
+ class Sexp
569
+ def line(n = nil)
570
+ if n then
571
+ @line = n
572
+ self
573
+ else
574
+ @line ||= nil
575
+ end
576
+ end
577
+ end
578
+ # temp file: autogenerated: Mon Sep 28 15:31:27 -0600 2009 for class Sexp
579
+ class Sexp
580
+ def =~(pattern)
581
+ return pattern.===([self])
582
+ end
583
+ end
584
+ # temp file: autogenerated: Mon Sep 28 15:31:27 -0600 2009 for class Benchmark::Tms
585
+ class Benchmark::Tms
586
+ def to_a()
587
+ [@label, @utime, @stime, @cutime, @cstime, @real]
588
+ end
589
+ end
590
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
591
+ class Ruby2Ruby
592
+ def process_defined(exp)
593
+ "defined? "
594
+ end
595
+ end
596
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
597
+ class Ruby2Ruby
598
+ def process_flip2(exp)
599
+ ""
600
+ end
601
+ end
602
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
603
+ class Ruby2Ruby
604
+ def process_class(exp)
605
+ "class "
606
+ end
607
+ end
608
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
609
+ class Ruby2Ruby
610
+ def process_alias(exp)
611
+ "alias "
612
+ end
613
+ end
614
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
615
+ class Ruby2Ruby
616
+ def process_module(exp)
617
+ "module "
618
+ end
619
+ end
620
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
621
+ class Ruby2Ruby
622
+ def process_retry(exp)
623
+ "retry"
624
+ end
625
+ end
626
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
627
+ class Ruby2Ruby
628
+ def process_xstr(exp)
629
+ "`"
630
+ end
631
+ end
632
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
633
+ class Ruby2Ruby
634
+ def process_or(exp)
635
+ "("
636
+ end
637
+ end
638
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
639
+ class Ruby2Ruby
640
+ def process_flip3(exp)
641
+ ""
642
+ end
643
+ end
644
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
645
+ class Ruby2Ruby
646
+ def process_and(exp)
647
+ "("
648
+ end
649
+ end
650
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
651
+ class Ruby2Ruby
652
+ def process_dstr(exp)
653
+ "\""
654
+ end
655
+ end
656
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
657
+ class Ruby2Ruby
658
+ def process_postexe(exp)
659
+ "END"
660
+ end
661
+ end
662
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
663
+ class Ruby2Ruby
664
+ def process_back_ref(exp)
665
+ "$"
666
+ end
667
+ end
668
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
669
+ class Ruby2Ruby
670
+ def process_colon2(exp)
671
+ ""
672
+ end
673
+ end
674
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
675
+ class Ruby2Ruby
676
+ def process_true(exp)
677
+ "true"
678
+ end
679
+ end
680
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
681
+ class Ruby2Ruby
682
+ def process_nil(exp)
683
+ "nil"
684
+ end
685
+ end
686
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
687
+ class Ruby2Ruby
688
+ def process_dsym(exp)
689
+ ":"
690
+ end
691
+ end
692
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
693
+ class Ruby2Ruby
694
+ def process_sclass(exp)
695
+ "class << "
696
+ end
697
+ end
698
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
699
+ class Ruby2Ruby
700
+ def process_zsuper(exp)
701
+ "super"
702
+ end
703
+ end
704
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
705
+ class Ruby2Ruby
706
+ def process_redo(exp)
707
+ "redo"
708
+ end
709
+ end
710
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
711
+ class Ruby2Ruby
712
+ def process_colon3(exp)
713
+ "::"
714
+ end
715
+ end
716
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
717
+ class Ruby2Ruby
718
+ def process_undef(exp)
719
+ "undef "
720
+ end
721
+ end
722
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
723
+ class Ruby2Ruby
724
+ def process_not(exp)
725
+ "(not "
726
+ end
727
+ end
728
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
729
+ class Ruby2Ruby
730
+ def process_dxstr(exp)
731
+ "`"
732
+ end
733
+ end
734
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
735
+ class Ruby2Ruby
736
+ def process_nth_ref(exp)
737
+ "$"
738
+ end
739
+ end
740
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
741
+ class Ruby2Ruby
742
+ def process_self(exp)
743
+ "self"
744
+ end
745
+ end
746
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
747
+ class Ruby2Ruby
748
+ def process_dot2(exp)
749
+ "("
750
+ end
751
+ end
752
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
753
+ class Ruby2Ruby
754
+ def process_cvar(exp)
755
+ ""
756
+ end
757
+ end
758
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
759
+ class Ruby2Ruby
760
+ def process_array(exp)
761
+ "["
762
+ end
763
+ end
764
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
765
+ class Ruby2Ruby
766
+ def process_match(exp)
767
+ ""
768
+ end
769
+ end
770
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
771
+ class Ruby2Ruby
772
+ def process_dot3(exp)
773
+ "("
774
+ end
775
+ end
776
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
777
+ class Ruby2Ruby
778
+ def process_cvasgn(exp)
779
+ ""
780
+ end
781
+ end
782
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
783
+ class Ruby2Ruby
784
+ def process_valias(exp)
785
+ "alias "
786
+ end
787
+ end
788
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
789
+ class Ruby2Ruby
790
+ def splat(sym)
791
+ :"*"
792
+ end
793
+ end
794
+ # temp file: autogenerated: Mon Sep 28 15:31:28 -0600 2009 for class Ruby2Ruby
795
+ class Ruby2Ruby
796
+ def process_cvdecl(exp)
797
+ ""
798
+ end
799
+ end
800
+ # temp file: autogenerated: Mon Sep 28 15:31:29 -0600 2009 for class Ruby2Ruby
801
+ class Ruby2Ruby
802
+ def process_false(exp)
803
+ "false"
804
+ end
805
+ end
806
+ # temp file: autogenerated: Mon Sep 28 15:31:29 -0600 2009 for class Ruby2CExtension::Plugin
807
+ class Ruby2CExtension::Plugin
808
+ def global_c_code()
809
+ # do nothing
810
+ end
811
+ end
812
+ # temp file: autogenerated: Mon Sep 28 15:31:29 -0600 2009 for class Ruby2CExtension::Plugin
813
+ class Ruby2CExtension::Plugin
814
+ def init_c_code()
815
+ # do nothing
816
+ end
817
+ end
818
+ # temp file: autogenerated: Mon Sep 28 15:31:30 -0600 2009 for class Ruby2CExtension::CFunction::Base
819
+ class Ruby2CExtension::CFunction::Base
820
+ def return_allowed?()
821
+ false
822
+ end
823
+ end
824
+ # temp file: autogenerated: Mon Sep 28 15:31:30 -0600 2009 for class Ruby2CExtension::CFunction::Base
825
+ class Ruby2CExtension::CFunction::Base
826
+ def l(line)
827
+ unless (line =~ /\A\s*\z/ or (line =~ /\A(\w*);?\z/ and (not ["break", "continue"].include?([$1])))) then
828
+ (@lines << [line])
829
+ end
830
+ end
831
+ end
832
+ # temp file: autogenerated: Mon Sep 28 15:31:30 -0600 2009 for class Ruby2CExtension::CFunction::Base
833
+ class Ruby2CExtension::CFunction::Base
834
+ def need_closure_ptr()
835
+ false
836
+ end
837
+ end
838
+ # temp file: autogenerated: Mon Sep 28 15:31:30 -0600 2009 for class Ruby2CExtension::CFunction::Base
839
+ class Ruby2CExtension::CFunction::Base
840
+ def get_cbase()
841
+ "("
842
+ end
843
+ end
844
+ # temp file: autogenerated: Mon Sep 28 15:31:30 -0600 2009 for class Ruby2CExtension::CFunction::Base
845
+ class Ruby2CExtension::CFunction::Base
846
+ def get_wrap_ptr()
847
+ "(&the_wrap)"
848
+ end
849
+ end
850
+ # temp file: autogenerated: Mon Sep 28 15:31:30 -0600 2009 for class Ruby2CExtension::CFunction::Base
851
+ class Ruby2CExtension::CFunction::Base
852
+ def get_class()
853
+ self.need_class = [true]
854
+ "s_class"
855
+ end
856
+ end
857
+ # temp file: autogenerated: Mon Sep 28 15:31:30 -0600 2009 for class Ruby2CExtension::CFunction::Base
858
+ class Ruby2CExtension::CFunction::Base
859
+ def get_closure_ary_var()
860
+ "my_closure_ary"
861
+ end
862
+ end
863
+ # temp file: autogenerated: Mon Sep 28 15:31:30 -0600 2009 for class Ruby2CExtension::CFunction::Base
864
+ class Ruby2CExtension::CFunction::Base
865
+ def get_self()
866
+ self.need_self = [true]
867
+ "self"
868
+ end
869
+ end
870
+ # temp file: autogenerated: Mon Sep 28 15:31:30 -0600 2009 for class Ruby2CExtension::CFunction::Base
871
+ class Ruby2CExtension::CFunction::Base
872
+ def push_while(redo_lbl, next_lbl, break_lbl)
873
+ (@while_stack << [[redo_lbl, next_lbl, break_lbl]])
874
+ end
875
+ end
876
+ # temp file: autogenerated: Mon Sep 28 15:31:32 -0600 2009 for class Inline::C
877
+ class Inline::C
878
+ def add_link_flags(*flags)
879
+ @libs.push(*flags)
880
+ end
881
+ end
882
+ # temp file: autogenerated: Mon Sep 28 15:31:32 -0600 2009 for class Inline::C
883
+ class Inline::C
884
+ def c(src, options = { })
885
+ options = { :expand_types => (true) }.merge([options])
886
+ self.generate([src, options])
887
+ end
888
+ end
889
+ # temp file: autogenerated: Mon Sep 28 15:31:32 -0600 2009 for class Inline::C
890
+ class Inline::C
891
+ def add_compile_flags(*flags)
892
+ @flags.push(*flags)
893
+ end
894
+ end
895
+ # temp file: autogenerated: Mon Sep 28 15:31:32 -0600 2009 for class Inline::C
896
+ class Inline::C
897
+ def include_ruby_last()
898
+ @include_ruby_first = false
899
+ end
900
+ end
901
+ # temp file: autogenerated: Mon Sep 28 15:31:32 -0600 2009 for class Inline::C
902
+ class Inline::C
903
+ def strip_comments(src)
904
+ src = src.gsub([/\s*\/\*.*?\*\//m, ""])
905
+ src = src.gsub([/^\s*\/\/.*?\n/, ""])
906
+ src = src.gsub([/[ \t]*\/\/[^\n]*/, ""])
907
+ src
908
+ end
909
+ end
910
+ # temp file: autogenerated: Mon Sep 28 15:31:32 -0600 2009 for class Inline::C
911
+ class Inline::C
912
+ def c_raw(src, options = { })
913
+ self.generate([src, options])
914
+ end
915
+ end
916
+ # temp file: autogenerated: Mon Sep 28 15:31:32 -0600 2009 for class Inline::C
917
+ class Inline::C
918
+ def c_singleton(src, options = { })
919
+ options = { :expand_types => (true), :singleton => (true) }.merge([options])
920
+ self.generate([src, options])
921
+ end
922
+ end
923
+ # temp file: autogenerated: Mon Sep 28 15:31:32 -0600 2009 for class Inline::C
924
+ class Inline::C
925
+ def crap_for_windoze()
926
+ case RUBY_PLATFORM
927
+ when /mswin32/ then
928
+ " -link /LIBPATH:\""
929
+ when /mingw32/ then
930
+ " -Wl,--enable-auto-import -L"
931
+ when /i386-cygwin/ then
932
+ " -L/usr/local/lib -lruby.dll"
933
+ else
934
+ ""
935
+ end
936
+ end
937
+ end
938
+ # temp file: autogenerated: Mon Sep 28 15:31:32 -0600 2009 for class Inline::C
939
+ class Inline::C
940
+ def so_name()
941
+ @so_name = "" unless defined? @so_name
942
+ @so_name
943
+ end
944
+ end
945
+ # temp file: autogenerated: Mon Sep 28 15:31:32 -0600 2009 for class Inline::C
946
+ class Inline::C
947
+ def add_to_init(*src)
948
+ @init_extra.push(*src)
949
+ end
950
+ end
951
+ # temp file: autogenerated: Mon Sep 28 15:31:32 -0600 2009 for class Inline::C
952
+ class Inline::C
953
+ def c_raw_singleton(src, options = { })
954
+ options = { :singleton => (true) }.merge([options])
955
+ self.generate([src, options])
956
+ end
957
+ end
958
+ # temp file: autogenerated: Mon Sep 28 15:31:32 -0600 2009 for class Inline::C
959
+ class Inline::C
960
+ def prefix(code)
961
+ (@src << [code])
962
+ end
963
+ end
964
+ # temp file: autogenerated: Mon Sep 28 15:31:32 -0600 2009 for class Inline::C
965
+ class Inline::C
966
+ def include(header)
967
+ (@inc << ["#include "])
968
+ end
969
+ end
970
+ # temp file: autogenerated: Mon Sep 28 15:31:32 -0600 2009 for class Inline::C
971
+ class Inline::C
972
+ def remove_type_converter(type)
973
+ @type_map.delete([type])
974
+ end
975
+ end
976
+ # temp file: autogenerated: Mon Sep 28 15:31:33 -0600 2009 for class A
977
+ class A
978
+ def go()
979
+ # do nothing
980
+ end
981
+ end
982
+ # temp file: autogenerated: Mon Sep 28 15:31:33 -0600 2009 for class Ruby2CExtension::Compiler
983
+ class Ruby2CExtension::Compiler
984
+ def global_var(str)
985
+ @global_man.get([str, false, true])
986
+ end
987
+ end
988
+ # temp file: autogenerated: Mon Sep 28 15:31:33 -0600 2009 for class Ruby2CExtension::Compiler
989
+ class Ruby2CExtension::Compiler
990
+ def preprocessors_for(node_type)
991
+ @preprocessors[[node_type]]
992
+ end
993
+ end
994
+ # temp file: autogenerated: Mon Sep 28 15:31:33 -0600 2009 for class Ruby2CExtension::Compiler
995
+ class Ruby2CExtension::Compiler
996
+ def sym(sym)
997
+ @sym_man.get([sym])
998
+ end
999
+ end
1000
+ # temp file: autogenerated: Mon Sep 28 15:31:33 -0600 2009 for class Ruby2CExtension::Compiler
1001
+ class Ruby2CExtension::Compiler
1002
+ def add_toplevel(function_name)
1003
+ (@toplevel_funs << [function_name])
1004
+ end
1005
+ end
1006
+ # temp file: autogenerated: Mon Sep 28 15:31:33 -0600 2009 for class Ruby2CExtension::Compiler
1007
+ class Ruby2CExtension::Compiler
1008
+ def un(str)
1009
+ @uniq_names.get([str])
1010
+ end
1011
+ end
1012
+ # temp file: autogenerated: Mon Sep 28 15:31:33 -0600 2009 for class Ruby2CExtension::Compiler
1013
+ class Ruby2CExtension::Compiler
1014
+ def add_helper(str)
1015
+ @helpers[[str]] ||= true
1016
+ end
1017
+ end
1018
+ # temp file: autogenerated: Mon Sep 28 15:31:33 -0600 2009 for class Ruby2CExtension::Compiler
1019
+ class Ruby2CExtension::Compiler
1020
+ def compile_toplevel_function(node_tree, private_vmode = true)
1021
+ CFunction::ToplevelScope.compile([self, node_tree, private_vmode])
1022
+ end
1023
+ end
1024
+ # temp file: autogenerated: Mon Sep 28 15:31:34 -0600 2009 for class Ruby2CExtension::Compiler
1025
+ class Ruby2CExtension::Compiler
1026
+ def global_const(str, register_gc = true)
1027
+ @global_man.get([str, true, register_gc])
1028
+ end
1029
+ end
1030
+ # temp file: autogenerated: Mon Sep 28 15:31:34 -0600 2009 for class Ruby2CExtension::CFunction::Wrap
1031
+ class Ruby2CExtension::CFunction::Wrap
1032
+ def get_cref_impl()
1033
+ "(wrap_ptr->cref)"
1034
+ end
1035
+ end
1036
+ # temp file: autogenerated: Mon Sep 28 15:31:34 -0600 2009 for class Ruby2CExtension::CFunction::Wrap
1037
+ class Ruby2CExtension::CFunction::Wrap
1038
+ def get_wrap_ptr()
1039
+ "wrap_ptr"
1040
+ end
1041
+ end
1042
+ # temp file: autogenerated: Mon Sep 28 15:31:34 -0600 2009 for class Ruby2CExtension::CFunction::Wrap
1043
+ class Ruby2CExtension::CFunction::Wrap
1044
+ def get_class()
1045
+ self.need_class = [true]
1046
+ "(wrap_ptr->s_class)"
1047
+ end
1048
+ end
1049
+ # temp file: autogenerated: Mon Sep 28 15:31:34 -0600 2009 for class Ruby2CExtension::CFunction::Wrap
1050
+ class Ruby2CExtension::CFunction::Wrap
1051
+ def get_closure_ary_var()
1052
+ "(wrap_ptr->my_closure_ary)"
1053
+ end
1054
+ end
1055
+ # temp file: autogenerated: Mon Sep 28 15:31:34 -0600 2009 for class Ruby2CExtension::CFunction::Wrap
1056
+ class Ruby2CExtension::CFunction::Wrap
1057
+ def get_self()
1058
+ self.need_self = [true]
1059
+ "(wrap_ptr->self)"
1060
+ end
1061
+ end
1062
+ # temp file: autogenerated: Mon Sep 28 15:31:34 -0600 2009 for class Ruby2CExtension::CFunction::Block
1063
+ class Ruby2CExtension::CFunction::Block
1064
+ def get_cref_impl()
1065
+ "cref"
1066
+ end
1067
+ end
1068
+ # temp file: autogenerated: Mon Sep 28 15:31:34 -0600 2009 for class Ruby2CExtension::CFunction::Block
1069
+ class Ruby2CExtension::CFunction::Block
1070
+ def break_allowed?(with_value)
1071
+ (super or (not with_value))
1072
+ end
1073
+ end
1074
+ # temp file: autogenerated: Mon Sep 28 15:31:35 -0600 2009 for class Ruby2CExtension::CFunction::Block
1075
+ class Ruby2CExtension::CFunction::Block
1076
+ def next_allowed?()
1077
+ true
1078
+ end
1079
+ end
1080
+ # temp file: autogenerated: Mon Sep 28 15:31:35 -0600 2009 for class Ruby2CExtension::CFunction::Block
1081
+ class Ruby2CExtension::CFunction::Block
1082
+ def redo_allowed?()
1083
+ true
1084
+ end
1085
+ end
1086
+ # temp file: autogenerated: Mon Sep 28 15:31:35 -0600 2009 for class Ruby2CExtension::CFunction::Method
1087
+ class Ruby2CExtension::CFunction::Method
1088
+ def return_allowed?()
1089
+ true
1090
+ end
1091
+ end
1092
+ # temp file: autogenerated: Mon Sep 28 15:31:36 -0600 2009 for class Ruby2CExtension::CFunction::ClassModuleScope
1093
+ class Ruby2CExtension::CFunction::ClassModuleScope
1094
+ def get_cref_impl()
1095
+ "cref"
1096
+ end
1097
+ end
1098
+ # temp file: autogenerated: Mon Sep 28 15:31:36 -0600 2009 for class Ruby2CExtension::Tools::UniqueNames
1099
+ class Ruby2CExtension::Tools::UniqueNames
1100
+ def get(prefix)
1101
+ ""
1102
+ end
1103
+ end
1104
+ # temp file: autogenerated: Mon Sep 28 15:31:37 -0600 2009 for class Ruby2CExtension::Tools::GlobalManager
1105
+ class Ruby2CExtension::Tools::GlobalManager
1106
+ def get(str, allow_reuse, register_gc)
1107
+ return name if (allow_reuse and name = @reusable[[str]])
1108
+ name = "global["
1109
+ @cnt = (@cnt + [1])
1110
+ (@src << [""])
1111
+ (@src << ["rb_global_variable(&("]) if register_gc
1112
+ @reusable[[str]] = name if allow_reuse
1113
+ name
1114
+ end
1115
+ end
1116
+ # temp file: autogenerated: Mon Sep 28 15:31:37 -0600 2009 for class Ruby2CExtension::Scopes::DynaScope
1117
+ class Ruby2CExtension::Scopes::DynaScope
1118
+ def vmode_method?(method_id)
1119
+ false
1120
+ end
1121
+ end
1122
+ # temp file: autogenerated: Mon Sep 28 15:31:37 -0600 2009 for class Ruby2CExtension::Scopes::DynaScope
1123
+ class Ruby2CExtension::Scopes::DynaScope
1124
+ def get_closure_var(clos_idx, var_idx)
1125
+ "RARRAY("
1126
+ end
1127
+ end
1128
+ # temp file: autogenerated: Mon Sep 28 15:31:37 -0600 2009 for class Ruby2CExtension::Scopes::DynaScope
1129
+ class Ruby2CExtension::Scopes::DynaScope
1130
+ def vmode_def_fun()
1131
+ "rb_define_method"
1132
+ end
1133
+ end
1134
+ # temp file: autogenerated: Mon Sep 28 15:31:37 -0600 2009 for class Ruby2CExtension::Scopes::DynaScope
1135
+ class Ruby2CExtension::Scopes::DynaScope
1136
+ def vmode()
1137
+ :public
1138
+ end
1139
+ end
1140
+ # temp file: autogenerated: Mon Sep 28 15:31:37 -0600 2009 for class Ruby2CExtension::Scopes::Scope
1141
+ class Ruby2CExtension::Scopes::Scope
1142
+ def get_lvar_ary()
1143
+ self.need_heap = [true]
1144
+ "lvar_ary"
1145
+ end
1146
+ end
1147
+ # temp file: autogenerated: Mon Sep 28 15:31:37 -0600 2009 for class Ruby2CExtension::Scopes::Scope
1148
+ class Ruby2CExtension::Scopes::Scope
1149
+ def new_dyna_scope()
1150
+ DynaScope.new([self, nil, 1])
1151
+ end
1152
+ end
1153
+ # temp file: autogenerated: Mon Sep 28 15:31:38 -0600 2009 for class Ruby2CExtension::Plugins::IVarCache
1154
+ class Ruby2CExtension::Plugins::IVarCache
1155
+ def global_c_code()
1156
+ code = "\n typedef struct {\n unsigned num_bins;\n unsigned bin_pos;\n } ivar_cache_entry;\n static ivar_cache_entry ivar_cache["
1157
+ code
1158
+ end
1159
+ end
1160
+ # temp file: autogenerated: Mon Sep 28 15:31:38 -0600 2009 for class Ruby2CExtension::Plugins::IVarCache
1161
+ class Ruby2CExtension::Plugins::IVarCache
1162
+ def init_c_code()
1163
+ "\n init_ivar_cache();\n "
1164
+ end
1165
+ end