本文整理汇总了C#中Production.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Production.ToString方法的具体用法?C# Production.ToString怎么用?C# Production.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Production
的用法示例。
在下文中一共展示了Production.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnProduction
/// <summary>
/// Called when [production] is visited.
/// </summary>
/// <param name="prod">The prod.</param>
public override void OnProduction(Production prod)
{
_sb.AppendLine(prod.ToString());
}
示例2: ExecuteReduce
private void ExecuteReduce(Production reduceProduction)
{
var newNode = CreateParseTreeNodeForReduce(reduceProduction);
//Prepare switching to the new state. First read the state from top of the stack
_currentState = Stack.Top.State;
//write to trace
if (_traceOn)
SetTraceDetails("Reduce on '" + reduceProduction.ToString() + "'", _currentState);
// Shift to new state (LALR) or push new node into input stack(NLALR, NLALRT)
if (Data.ParseMethod == ParseMethod.Lalr) {
//execute shift over non-terminal
var action = _currentState.Actions[reduceProduction.LValue];
Stack.Push(newNode, action.NewState);
_currentState = action.NewState;
} else {
//NLALR - push it back into input stack
InputStack.Push(newNode);
_currentInput = newNode;
}
}