當前位置: 首頁>>代碼示例>>Python>>正文


Python StateMachine.from_interval_sequences方法代碼示例

本文整理匯總了Python中quex.engine.state_machine.core.StateMachine.from_interval_sequences方法的典型用法代碼示例。如果您正苦於以下問題:Python StateMachine.from_interval_sequences方法的具體用法?Python StateMachine.from_interval_sequences怎麽用?Python StateMachine.from_interval_sequences使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在quex.engine.state_machine.core.StateMachine的用法示例。


在下文中一共展示了StateMachine.from_interval_sequences方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _plug_interval_sequences

# 需要導入模塊: from quex.engine.state_machine.core import StateMachine [as 別名]
# 或者: from quex.engine.state_machine.core.StateMachine import from_interval_sequences [as 別名]
    def _plug_interval_sequences(self, sm, BeginIndex, EndIndex, IntervalSequenceList, beautifier):
        sub_sm = StateMachine.from_interval_sequences(IntervalSequenceList)
        if Setup.bad_lexatom_detection_f: 
            self._plug_encoding_error_detectors(sub_sm)
        sub_sm = beautifier.do(sub_sm)

        # The 'End State' is the state where there are no further transitions.
        new_end_si = None
        for state_index, state in sub_sm.states.iteritems():
            if state.target_map.is_empty() and not state.accepts_incidence(): 
                new_end_si = state_index
        assert new_end_si is not None

        # Mount the states inside the state machine
        sm.mount_absorbed_states_between(BeginIndex, EndIndex, 
                                         sub_sm.states, sub_sm.init_state_index, new_end_si)
開發者ID:xxyzzzq,項目名稱:quex,代碼行數:18,代碼來源:state_split.py


注:本文中的quex.engine.state_machine.core.StateMachine.from_interval_sequences方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。