本文整理汇总了C#中IState.NextState方法的典型用法代码示例。如果您正苦于以下问题:C# IState.NextState方法的具体用法?C# IState.NextState怎么用?C# IState.NextState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IState
的用法示例。
在下文中一共展示了IState.NextState方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Scan
private void Scan(IState scan, int j, ITokenNode tokenNode)
{
int i = scan.Origin;
var currentSymbol = scan.PostDotSymbol;
var lexerRule = currentSymbol as ILexerRule;
var token = tokenNode.Token;
if (token.TokenType == lexerRule.TokenType)
{
var nextState = scan.NextState();
var parseNode = CreateParseNode(
nextState,
scan.ParseNode,
tokenNode,
j + 1);
nextState.ParseNode = parseNode;
if (_chart.Enqueue(j + 1, nextState))
LogScan(j + 1, nextState, token);
}
}
示例2: PredictProduction
private void PredictProduction(IState evidence, int j, IProduction production)
{
// TODO: Pre-Compute Leo Items. If item is 1 step from being complete, add a transition item
var predictedState = new State(production, 0, j);
if (_chart.Enqueue(j, predictedState))
Log("Predict", j, predictedState);
var stateIsNullable = predictedState.Production.IsEmpty;
if (stateIsNullable)
{
var aycockHorspoolState = evidence.NextState(j);
var predictedParseNode = CreateNullParseNode(
predictedState.Production.LeftHandSide, j);
aycockHorspoolState.ParseNode
= CreateParseNode(
aycockHorspoolState,
evidence.ParseNode,
predictedParseNode,
j);
if (_chart.Enqueue(j, aycockHorspoolState))
Log("Predict", j, aycockHorspoolState);
}
}