Methods
- B
- C
- D
- G
- N
- O
- U
- V
Constants
| EMPTY_STRING | = | ''.freeze |
| Files | = | { # codes 'vm.inc' => VmBodyGenerator, 'vmtc.inc' => VmTCIncGenerator, 'insns.inc' => InsnsIncGenerator, 'insns_info.inc' => InsnsInfoIncGenerator, # 'minsns.inc' => MInsnsIncGenerator, 'optinsn.inc' => OptInsnIncGenerator, 'optunifs.inc' => OptUnifsIncGenerator, 'opt_sc.inc' => OptSCIncGenerator, 'yasmdata.rb' => YASMDataRbGenerator, } |
Attributes
| [R] | insns |
Class Public methods
build(opts, vpath = ['./'])
Link
Source: show
# File tool/instruction.rb, line 1336 def self.build opts, vpath = ['./'] opts[:VPATH] ||= VPath.new(*vpath) self.new InstructionsLoader.new(opts) end
def_options(opt)
Link
Source: show
# File tool/instruction.rb, line 1282 def self.def_options(opt) opts = { :"insns.def" => 'insns.def', :"opope.def" => 'defs/opt_operand.def', :"unif.def" => 'defs/opt_insn_unif.def', } opt.on("-Dname", /\AOPT_(\w+)\z/, "enable VM option") {|s, v| opts[v] = true } opt.on("--enable=name[,name...]", Array, "enable VM options (without OPT_ prefix)") {|*a| a.each {|v| opts[v] = true} } opt.on("-Uname", /\AOPT_(\w+)\z/, "disable VM option") {|s, v| opts[v] = false } opt.on("--disable=name[,name...]", Array, "disable VM options (without OPT_ prefix)") {|*a| a.each {|v| opts[v] = false} } opt.on("-i", "--insnsdef=FILE", "--instructions-def", "instructions definition file") {|n| opts[:insns_def] = n } opt.on("-o", "--opt-operanddef=FILE", "--opt-operand-def", "vm option: operand definition file") {|n| opts[:opope_def] = n } opt.on("-u", "--opt-insnunifdef=FILE", "--opt-insn-unif-def", "vm option: instruction unification file") {|n| opts[:unif_def] = n } opt.on("-C", "--[no-]use-const", "use consts for default operands instead of macros") {|v| opts[:use_const] = v } opt.on("-d", "--destdir", "--output-directory=DIR", "make output file underneath DIR") {|v| opts[:destdir] = v } opt.on("-V", "--[no-]verbose") {|v| opts[:verbose] = v } vpath = VPath.new vpath.def_options(opt) proc { opts[:VPATH] = vpath build opts } end
new(insns)
Link
Source: show
# File tool/instruction.rb, line 620 def initialize insns @insns = insns end
Instance Public methods
build_string()
Link
Source: show
# File tool/instruction.rb, line 642 def build_string @lines = [] yield @lines.join("\n") end
comment(str)
Link
Source: show
# File tool/instruction.rb, line 654 def comment str @lines << str if verbose? end
commit(str = EMPTY_STRING)
Link
Source: show
# File tool/instruction.rb, line 650 def commit str = EMPTY_STRING @lines << str end
generate()
Link
Source: show
# File tool/instruction.rb, line 626 def generate raise "should not reach here" end
output_path(fn)
Link
Source: show
# File tool/instruction.rb, line 658 def output_path(fn) d = @insns.destdir fn = File.join(d, fn) if d fn end