Mercurial > pub > ImplabNet
comparison Implab/Parsing/DFAutomaton.cs @ 156:97fbbf816844 v2
Promises: SignalXXX methods merged into SignalHandler method.
Components: RunnableComponent In progress
author | cin |
---|---|
date | Mon, 15 Feb 2016 04:22:15 +0300 |
parents | 62b440d46313 |
children | 130781364799 |
comparison
equal
deleted
inserted
replaced
155:037df317f126 | 156:97fbbf816844 |
---|---|
35 | 35 |
36 protected void Switch(DFAStateDescriptior[] states, int current, T info) { | 36 protected void Switch(DFAStateDescriptior[] states, int current, T info) { |
37 Debug.Assert(states != null); | 37 Debug.Assert(states != null); |
38 Debug.Assert(current >= 0 && current < states.Length); | 38 Debug.Assert(current >= 0 && current < states.Length); |
39 m_contextStack.Push(m_context); | 39 m_contextStack.Push(m_context); |
40 m_context. states = states; | 40 m_context.states = states; |
41 m_context.current = current; | 41 m_context.current = current; |
42 m_context.info = info; | 42 m_context.info = info; |
43 } | 43 } |
44 | 44 |
45 protected void Restore() { | 45 protected void Restore() { |
50 | 50 |
51 protected void Move(int input) { | 51 protected void Move(int input) { |
52 Debug.Assert(input > 0 && input < m_context.states[m_context.current].transitions.Length); | 52 Debug.Assert(input > 0 && input < m_context.states[m_context.current].transitions.Length); |
53 m_context.current = m_context.states[m_context.current].transitions[input]; | 53 m_context.current = m_context.states[m_context.current].transitions[input]; |
54 } | 54 } |
55 | |
56 protected bool CanMove(int input) { | |
57 Debug.Assert(input > 0 && input < m_context.states[m_context.current].transitions.Length); | |
58 return m_context.states[m_context.current].transitions[input] != UNREACHEBLE_STATE; | |
59 } | |
55 } | 60 } |
56 } | 61 } |