rubyx/lib/risc.rb

47 lines
1.0 KiB
Ruby
Raw Normal View History

2016-12-09 12:20:48 +01:00
class String
2018-04-16 20:24:27 +02:00
def camelise
self.split("_").collect{|str| str.capitalize_first }.join
end
def capitalize_first
self[0].capitalize + self[1..-1]
end
end
2018-04-17 19:26:15 +02:00
class Class
def short_name
self.name.split("::").last
end
end
2016-12-09 12:20:48 +01:00
2018-03-26 13:15:48 +02:00
# See risc/Readme
module Risc
# module method to reset, and init
def self.boot!(options = {})
Position.clear_positions
end
2018-03-26 13:15:48 +02:00
end
2018-05-31 18:01:10 +02:00
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"
2019-08-08 11:19:27 +02:00
require_relative "risc/risc_collection"
2015-10-22 17:16:29 +02:00
class Integer
2015-10-22 17:16:29 +02:00
def fits_u8?
self >= 0 and self <= 255
end
end
2016-12-09 12:20:48 +01:00
2018-03-13 12:27:24 +01:00
require_relative "risc/instruction"
require_relative "risc/register_value"
require_relative "risc/register_slot"
require_relative "risc/text_writer"
require_relative "risc/builder"