예제 #1
0
        public virtual void TraceIn(string ruleName, int ruleIndex, object inputSymbol)
        {
            if (TraceDestination == null)
            {
                return;
            }

            TraceDestination.Write("enter " + ruleName + " " + inputSymbol);
            if (state.backtracking > 0)
            {
                TraceDestination.Write(" backtracking=" + state.backtracking);
            }
            TraceDestination.WriteLine();
        }
예제 #2
0
        public virtual void TraceOut(string ruleName, int ruleIndex, object inputSymbol)
        {
            if (TraceDestination == null)
            {
                return;
            }

            TraceDestination.Write("exit " + ruleName + " " + inputSymbol);
            if (state.backtracking > 0)
            {
                TraceDestination.Write(" backtracking=" + state.backtracking);
                if (state.failed)
                {
                    TraceDestination.Write(" failed");
                }
                else
                {
                    TraceDestination.Write(" succeeded");
                }
            }
            TraceDestination.WriteLine();
        }