rubyx/lib/risc.rb
Torsten db5a59f735 Unify instruction namings also dirs
Was getting confused myself, where it was instruction or instructions, when if the base class was inside or out of dir.
Now dirs are plural, and base class is inside.
2020-03-22 14:31:43 +02:00

47 lines
1.0 KiB
Ruby

class String
def camelise
self.split("_").collect{|str| str.capitalize_first }.join
end
def capitalize_first
self[0].capitalize + self[1..-1]
end
end
class Class
def short_name
self.name.split("::").last
end
end
# See risc/Readme
module Risc
# module method to reset, and init
def self.boot!(options = {})
Position.clear_positions
end
end
require_relative "risc/position/position"
require_relative "risc/platform"
require "parfait"
require_relative "risc/parfait_boot"
require_relative "risc/parfait_adapter"
require_relative "risc/linker"
require_relative "risc/callable_compiler"
require_relative "risc/method_compiler"
require_relative "risc/block_compiler"
require_relative "risc/assembler"
require_relative "risc/risc_collection"
class Integer
def fits_u8?
self >= 0 and self <= 255
end
end
require_relative "risc/instructions/instruction"
require_relative "risc/register_value"
require_relative "risc/register_slot"
require_relative "risc/text_writer"
require_relative "risc/builder"