Class: Indis::ARM::InstructionLoader
- Inherits:
-
Object
- Object
- Indis::ARM::InstructionLoader
- Includes:
- Singleton
- Defined in:
- lib/indis-arm/instruction_loader.rb
Overview
InstructionLoader is a DSL parser for arm7.inst.rb DSL. The DSL is evaluated in the context of InstructionLoader singleton, the only top-level command is #instruction
Instance Method Summary collapse
-
#instruction(name, &block) ⇒ Object
Loads a named instruction.
-
#load ⇒ Array
Loads and processes the DSL.
Instance Method Details
#instruction(name, &block) ⇒ Object
Loads a named instruction. The block is evaluated in a context of newly-created EncodingLoader.
49 50 51 52 |
# File 'lib/indis-arm/instruction_loader.rb', line 49 def instruction(name, &block) el = EncodingLoader.new(name, @classes) el.instance_eval(&block) end |
#load ⇒ Array
Loads and processes the DSL
36 37 38 39 40 41 42 43 44 |
# File 'lib/indis-arm/instruction_loader.rb', line 36 def load return @classes if @classes @classes = [] instr_file = File.join(File.dirname(__FILE__), 'arm7.inst.rb') self.instance_eval open(instr_file).read, instr_file, 1 @classes end |