2016-12-09 12:20:48 +01:00
|
|
|
class String
|
2018-04-16 20:24:27 +02:00
|
|
|
def camelise
|
2018-04-06 19:54:27 +02:00
|
|
|
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
|
2018-09-02 12:57:19 +02:00
|
|
|
# module method to reset, and init
|
2019-09-07 15:43:47 +02:00
|
|
|
def self.boot!(options = {})
|
2018-09-02 12:57:19 +02:00
|
|
|
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"
|
2018-05-12 17:32:10 +02:00
|
|
|
require_relative "risc/platform"
|
2019-09-22 18:10:47 +02:00
|
|
|
require "parfait"
|
2018-07-01 12:45:14 +02:00
|
|
|
require_relative "risc/parfait_boot"
|
2018-08-11 18:17:20 +02:00
|
|
|
require_relative "risc/parfait_adapter"
|
2018-07-01 12:45:14 +02:00
|
|
|
require_relative "risc/linker"
|
2018-07-10 21:02:11 +02:00
|
|
|
require_relative "risc/callable_compiler"
|
2018-06-30 22:26:28 +02:00
|
|
|
require_relative "risc/method_compiler"
|
2018-07-09 15:48:23 +02:00
|
|
|
require_relative "risc/block_compiler"
|
2018-07-01 10:53:18 +02:00
|
|
|
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
|
|
|
|
2019-02-07 17:24:35 +01: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"
|
2018-06-29 10:39:07 +02:00
|
|
|
require_relative "risc/register_value"
|
2020-03-01 09:22:24 +01:00
|
|
|
require_relative "risc/register_slot"
|
2018-03-29 17:17:19 +02:00
|
|
|
require_relative "risc/text_writer"
|
2018-04-06 13:21:38 +02:00
|
|
|
require_relative "risc/builder"
|