1 require 'compiler/compiler'
17 attr_reader :text, :ip, :file, :line
18 attr_accessor :redo, :retry, :break, :next
20 def advanced_since?(old)
29 def initialize(gen, idx)
37 @gen.set_label(@index)
46 Label.new(self, @label += 1)
62 def set_line(line, file)
63 @file, @line = file, line
64 @text << "#line #{line}\n"
68 return if @other_methods.empty?
69 @other_methods.each_pair do |i,m|
70 @text << "\n:==== Method #{i} ====\n"
71 @text << m.generator.text
76 def method_missing(op, *args)
81 @text << "#{op} #{args.join(' ', :inspect)}\n"
91 @text << "push #{what}\n"
95 def send(meth, count, priv=false)
96 @text << "send #{meth} #{count}"
98 @text << " true ; allow private\n"
110 method_missing :equal
113 def push_literal(lit)
114 if lit.kind_of? MethodDescription
115 @text << "push_literal #<Method #{@@method_id}>\n"
117 @other_methods[@@method_id] = lit
121 method_missing :push_literal, lit
125 def as_primitive(name)
126 @text << "#primitive #{name}\n"
138 @gen.add_text "; exc#{@idx} start"
142 @gen.add_text "; exc#{@idx} end"