本文整理匯總了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)