当前位置: 首页>>代码示例>>C#>>正文


C# Tokenizer.GetPreviousCharacters方法代码示例

本文整理汇总了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));
        }
开发者ID:MaikelH,项目名称:BibtexLibrary,代码行数:11,代码来源:BibtexParser.cs

示例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));
        }
开发者ID:MaikelH,项目名称:BibtexLibrary,代码行数:17,代码来源:BibtexParser.cs

示例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));
        }
开发者ID:MaikelH,项目名称:BibtexLibrary,代码行数:11,代码来源:BibtexParser.cs

示例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));
        }
开发者ID:MaikelH,项目名称:BibtexLibrary,代码行数:11,代码来源:BibtexParser.cs


注:本文中的Tokenizer.GetPreviousCharacters方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。