Method: CEML::BasicInstruction#bytecode

Defined in:
lib/ceml/lang/basic_instruction.rb

#bytecodeObject



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/ceml/lang/basic_instruction.rb', line 31

def bytecode
    code = []
    code.concat case cmd
    when :record;  [[roles, :answered_q,      {:key  => key}]]
    when :set;     [[roles, :set,             {:key  => key, :value => text_block}]]
    when :pick;    [[roles, :pick,            {:key  => key, :value => text_block}]]
    when :ask;     [[roles, :ask_q,           {:text => text_block, :q => key}],
                    [roles, :answered_q,      {:key  => key}]]
    when :tell;    [[roles, :send_msg,        {:text => text_block}]]
    when :assign;  [[roles, :assign,          {:text => text_block}],
                    [roles, :complete_assign, {:text => text_block}]]
    when :release; [[roles, :release,         {:cond => cond}]]
    when :sync;    [[roles, :sync,            {:role => role}]]
    end
    code
end