bootstrap/peg_cbyte.rb
# note: a simpler implementation might create an intermediate parent for each child
a simpler implementation might create an intermediate parent for each child
a simpler implementation might create an intermediate parent for each child
def append_instructions(inst)
                    add_inst(inst, @parse_state, :CHOICE, 0)
                    @data.each do |c|
                        c.append_instructions(inst)
                        add_inst(inst, @child_succ_states[c], :CISUCC, @parent.next_state(self) - 1)
                        add_inst(inst, @child_fail_states[c], :CIFAIL, 0)
                    end
                    add_inst(inst, @failure_state, :CFAIL, @parent.fail_state(self) - 1)
                end
def append_instructions ( inst ) add_inst ( inst , @parse_state , :CHOICE , 0 ) @data . each do | c | c . append_instructions ( inst ) add_inst ( inst , @child_succ_states [ c ] , :CISUCC , @parent . next_state ( self ) - 1 ) add_inst ( inst , @child_fail_states [ c ] , :CIFAIL , 0 ) end add_inst ( inst , @failure_state , :CFAIL , @parent . fail_state ( self ) - 1 ) end
note: a simpler implementation might create an intermediate parent for each child
note : a simpler implementation might create an intermediate parent for each child
inst
<not_specific>