diff 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
line wrap: on
line diff
--- a/Implab/Parsing/DFAutomaton.cs	Fri Feb 12 16:24:24 2016 +0300
+++ b/Implab/Parsing/DFAutomaton.cs	Mon Feb 15 04:22:15 2016 +0300
@@ -37,7 +37,7 @@
             Debug.Assert(states != null);
             Debug.Assert(current >= 0 && current < states.Length);
             m_contextStack.Push(m_context);
-            m_context. states = states;
+            m_context.states = states;
             m_context.current = current;
             m_context.info = info;
         }
@@ -52,5 +52,10 @@
             Debug.Assert(input > 0 && input < m_context.states[m_context.current].transitions.Length);
             m_context.current = m_context.states[m_context.current].transitions[input];
         }
+
+        protected bool CanMove(int input) {
+            Debug.Assert(input > 0 && input < m_context.states[m_context.current].transitions.Length);
+            return m_context.states[m_context.current].transitions[input] != UNREACHEBLE_STATE;
+        }
     }
 }