2016-12-09 13:20:48 +02:00
|
|
|
class String
|
2018-04-16 21:24:27 +03:00
|
|
|
def camelise
|
2018-04-06 20:54:27 +03:00
|
|
|
self.split("_").collect{|str| str.capitalize_first }.join
|
|
|
|
end
|
|
|
|
def capitalize_first
|
|
|
|
self[0].capitalize + self[1..-1]
|
|
|
|
end
|
|
|
|
end
|
2018-04-17 20:26:15 +03:00
|
|
|
class Class
|
|
|
|
def short_name
|
|
|
|
self.name.split("::").last
|
|
|
|
end
|
|
|
|
end
|
2016-12-09 13:20:48 +02:00
|
|
|
|
2018-03-26 14:15:48 +03:00
|
|
|
# See risc/Readme
|
|
|
|
module Risc
|
2018-09-02 13:57:19 +03:00
|
|
|
# module method to reset, and init
|
2019-09-07 16:43:47 +03:00
|
|
|
def self.boot!(options = {})
|
2018-09-02 13:57:19 +03:00
|
|
|
Position.clear_positions
|
|
|
|
end
|
2018-03-26 14:15:48 +03:00
|
|
|
end
|
|
|
|
|
2018-05-31 19:01:10 +03:00
|
|
|
require_relative "risc/position/position"
|
2018-05-12 18:32:10 +03:00
|
|
|
require_relative "risc/platform"
|
2019-09-22 19:10:47 +03:00
|
|
|
require "parfait"
|
2018-07-01 13:45:14 +03:00
|
|
|
require_relative "risc/parfait_boot"
|
2018-08-11 19:17:20 +03:00
|
|
|
require_relative "risc/parfait_adapter"
|
2018-07-01 13:45:14 +03:00
|
|
|
require_relative "risc/linker"
|
2018-07-10 22:02:11 +03:00
|
|
|
require_relative "risc/callable_compiler"
|
2018-06-30 23:26:28 +03:00
|
|
|
require_relative "risc/method_compiler"
|
2018-07-09 16:48:23 +03:00
|
|
|
require_relative "risc/block_compiler"
|
2020-03-18 13:10:09 +02:00
|
|
|
require_relative "risc/standard_allocator"
|
2018-07-01 11:53:18 +03:00
|
|
|
require_relative "risc/assembler"
|
2019-08-08 12:19:27 +03:00
|
|
|
require_relative "risc/risc_collection"
|
2015-10-22 18:16:29 +03:00
|
|
|
|
2019-02-07 18:24:35 +02:00
|
|
|
class Integer
|
2015-10-22 18:16:29 +03:00
|
|
|
def fits_u8?
|
|
|
|
self >= 0 and self <= 255
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-12-09 13:20:48 +02:00
|
|
|
|
2020-03-02 17:58:13 +02:00
|
|
|
require_relative "risc/instructions/instruction"
|
2018-06-29 11:39:07 +03:00
|
|
|
require_relative "risc/register_value"
|
2020-03-01 10:22:24 +02:00
|
|
|
require_relative "risc/register_slot"
|
2018-03-29 18:17:19 +03:00
|
|
|
require_relative "risc/text_writer"
|
2018-04-06 14:21:38 +03:00
|
|
|
require_relative "risc/builder"
|