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


C# TokenStream.Read方法代码示例

本文整理汇总了C#中TokenStream.Read方法的典型用法代码示例。如果您正苦于以下问题:C# TokenStream.Read方法的具体用法?C# TokenStream.Read怎么用?C# TokenStream.Read使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TokenStream的用法示例。


在下文中一共展示了TokenStream.Read方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FindPosition

		private static void FindPosition(TokenStream tokenStream, int offset)
		{
			tokenStream.Position = 0;
			if (offset < 0)
				return;

			while (tokenStream.Position < tokenStream.Length)
			{
				IToken currentToken = tokenStream.Peek();

				if (currentToken.StartOffset <= offset && offset < currentToken.StartOffset + currentToken.Length)
					break;
				else
					tokenStream.Read();
			}
		}
开发者ID:chenzuo,项目名称:nquery,代码行数:16,代码来源:ActiproLink.cs

示例2: GetTokenOutliningAction

        public override void GetTokenOutliningAction(TokenStream tokenStream, ref string outliningKey, ref OutliningNodeAction tokenAction)
        {
            IToken token = tokenStream.Peek();
            switch ((token.get_Language().get_Key() + "_" + token.get_Key()))
            {
                case "CSS_PropertyStartToken":
                    outliningKey = "CSS_PropertyBlock";
                    tokenAction = 1;
                    break;

                case "CSS_PropertyEndToken":
                    outliningKey = "CSS_PropertyBlock";
                    tokenAction = 2;
                    break;

                case "CSS_CommentStartToken":
                    outliningKey = "CSS_Comment";
                    tokenAction = 1;
                    break;

                case "CSS_CommentEndToken":
                    outliningKey = "CSS_Comment";
                    tokenAction = 2;
                    break;

                case "JScript_OpenCurlyBraceToken":
                    outliningKey = "JScript_CodeBlock";
                    tokenAction = 1;
                    break;

                case "JScript_CloseCurlyBraceToken":
                    outliningKey = "JScript_CodeBlock";
                    tokenAction = 2;
                    break;

                case "JScript_MultiLineCommentStartToken":
                    outliningKey = "JScript_MultiLineComment";
                    tokenAction = 1;
                    break;

                case "JScript_MultiLineCommentEndToken":
                    outliningKey = "JScript_MultiLineComment";
                    tokenAction = 2;
                    break;

                default:
                    if (tokenAction != 0)
                    {
                        if (token.HasFlag(0x40))
                        {
                            if ((tokenStream.get_Position() > 0) && (tokenStream.ReadReverse().get_LexicalState().get_Key() == "ASPDirectiveResponseWriteState"))
                            {
                                outliningKey = null;
                                tokenAction = 0;
                            }
                        }
                        else if (token.HasFlag(0x80))
                        {
                            tokenStream.Read();
                            if (!tokenStream.get_IsDocumentEnd() && (tokenStream.Peek().get_LexicalState().get_Key() == "ASPDirectiveResponseWriteState"))
                            {
                                outliningKey = null;
                                tokenAction = 0;
                            }
                        }
                    }
                    break;
            }
        }
开发者ID:CuneytKukrer,项目名称:TestProject,代码行数:69,代码来源:HtmlDynamicSyntaxLanguage.cs


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