本文整理汇总了C#中Tokenizer.GetPreviousCharacters方法的典型用法代码示例。如果您正苦于以下问题:C# Tokenizer.GetPreviousCharacters方法的具体用法?C# Tokenizer.GetPreviousCharacters怎么用?C# Tokenizer.GetPreviousCharacters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tokenizer
的用法示例。
在下文中一共展示了Tokenizer.GetPreviousCharacters方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ClosingBrace
private void ClosingBrace(Tokenizer.Tokenizer tokenizer)
{
AbstractToken token = tokenizer.NextToken();
if (token.GetType() == typeof(ClosingBrace))
{
return;
}
throw new ParseException("Expected type ClosingBrace but found: " + token.GetType() + " after " + tokenizer.GetPreviousCharacters(25));
}
示例2: Comma
private void Comma(Tokenizer.Tokenizer tokenizer, Boolean optional = false)
{
AbstractToken token = tokenizer.Peek();
if (token.GetType() == typeof(Comma))
{
tokenizer.NextToken();
return;
}
if (optional)
{
return;
}
throw new ParseException("Expected type Comma but found: " + token.GetType() + " after " + tokenizer.GetPreviousCharacters(25));
}
示例3: ValueStop
private AbstractToken ValueStop(Tokenizer.Tokenizer tokenizer)
{
AbstractToken token = tokenizer.NextToken();
if (token.GetType() == typeof(ClosingBrace) || token.GetType() == typeof(ValueQuote))
{
return token;
}
throw new ParseException("Expected type ClosingBrace or ValueQuote but found: " + token.GetType() + " after " + tokenizer.GetPreviousCharacters(25));
}
示例4: Text
private String Text(Tokenizer.Tokenizer tokenizer)
{
AbstractToken token = tokenizer.NextToken();
if (token.GetType() == typeof(Comma) || token.GetType() == typeof(Text))
{
return token.GetValue();
}
throw new ParseException("Expected type Text but found: " + token.GetType() + " after " + tokenizer.GetPreviousCharacters(25));
}