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
|
|
|
# The RiscMachine, is an abstract machine with registers. Think of it as an arm machine with
|
|
|
|
# normal instruction names. It is not however an abstraction of existing hardware, but only
|
|
|
|
# of that subset that we need.
|
|
|
|
# See risc/Readme
|
|
|
|
module Risc
|
|
|
|
end
|
|
|
|
|
2018-03-13 16:57:24 +05:30
|
|
|
require_relative "risc/padding"
|
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"
|
2017-01-18 20:09:43 +02:00
|
|
|
require "parfait"
|
2018-05-28 14:46:26 +03:00
|
|
|
require_relative "risc/parfait_adapter"
|
2018-03-13 16:57:24 +05:30
|
|
|
require_relative "risc/machine"
|
|
|
|
require_relative "risc/method_compiler"
|
2015-10-22 18:16:29 +03:00
|
|
|
|
|
|
|
class Fixnum
|
|
|
|
def fits_u8?
|
|
|
|
self >= 0 and self <= 255
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-12-09 13:20:48 +02:00
|
|
|
|
2018-03-13 16:57:24 +05:30
|
|
|
require_relative "risc/instruction"
|
2018-04-06 14:21:38 +03:00
|
|
|
require_relative "risc/risc_value"
|
2018-03-29 18:17:19 +03:00
|
|
|
require_relative "risc/text_writer"
|
2018-03-13 16:57:24 +05:30
|
|
|
require_relative "risc/builtin/space"
|
2018-04-06 14:21:38 +03:00
|
|
|
require_relative "risc/builder"
|