vm/codegen/instructions_gen.rb
# Generate header information for instruction functions and other
# info.
#
Generate header information for instruction functions and other
info.
Generate header information for instruction functions and other info .
def generate_names_header(methods)
    str = "static const char *get_instruction_name(int op);\n"
    str << "typedef enum {\n"
    methods.each do |impl|
      ins = impl.name
      str << "insn_#{ins.opcode.to_s} = #{ins.bytecode},\n"
    end
    str << "} instruction_names;\n"
    str << "const static unsigned int cTotal = #{methods.size};\n"
    str
  end
def generate_names_header ( methods ) str = "static const char *get_instruction_name(int op);\n" str << "typedef enum {\n" methods . each do | impl | ins = impl . name str << "insn_#{ins.opcode.to_s} = #{ins.bytecode},\n" end str << "} instruction_names;\n" str << "const static unsigned int cTotal = #{methods.size};\n" str end
Generate header information for instruction functions and other
info.
Generate header information for instruction functions and other info .
methods
<not_specific>