Module: Pegarus::Machine::Instructions

Defined in:
lib/pegarus/machine/instructions.rb

Class Method Summary collapse

Class Method Details

.[](opcode) ⇒ Object



4
5
6
# File 'lib/pegarus/machine/instructions.rb', line 4

def self.[](opcode)
  instructions[opcode]
end

.instruction(name, &block) ⇒ Object



12
13
14
# File 'lib/pegarus/machine/instructions.rb', line 12

def self.instruction(name, &block)
  instructions[name] = [block.arity, block]
end

.instructionsObject



8
9
10
# File 'lib/pegarus/machine/instructions.rb', line 8

def self.instructions
  @instructions ||= {}
end