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


C# IIntStream.Seek方法代码示例

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


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

示例1: AlreadyParsedRule

        public virtual bool AlreadyParsedRule(IIntStream input, int ruleIndex)
        {
            int ruleMemoization = this.GetRuleMemoization(ruleIndex, input.Index);
            switch (ruleMemoization)
            {
                case -1:
                    return false;

                case -2:
                    this.state.failed = true;
                    break;

                default:
                    input.Seek(ruleMemoization + 1);
                    break;
            }
            return true;
        }
开发者ID:brunolauze,项目名称:mysql-connector-net-6,代码行数:18,代码来源:BaseRecognizer.cs

示例2: AlreadyParsedRule

		/// <summary>
		/// Has this rule already parsed input at the current index in the
		/// input stream?  Return the stop token index or MEMO_RULE_UNKNOWN.
		/// If we attempted but failed to parse properly before, return
		/// MEMO_RULE_FAILED.
		/// 
		/// This method has a side-effect: if we have seen this input for
		/// this rule and successfully parsed before, then seek ahead to
		/// 1 past the stop token matched for this rule last time.
		/// </summary>
		public virtual bool AlreadyParsedRule(IIntStream input, int ruleIndex)
		{
			int stopIndex = GetRuleMemoization(ruleIndex, input.Index);
			if (stopIndex == MEMO_RULE_UNKNOWN)
			{
				return false;
			}
			if (stopIndex == MEMO_RULE_FAILED)
			{
				state.failed = true;
			}
			else
			{
				input.Seek(stopIndex + 1); // jump to one past stop token
			}
			return true;
		}
开发者ID:sebasjm,项目名称:antlr,代码行数:27,代码来源:BaseRecognizer.cs

示例3: AlreadyParsedRule

 /** <summary>
  *  Has this rule already parsed input at the current index in the
  *  input stream?  Return the stop token index or MEMO_RULE_UNKNOWN.
  *  If we attempted but failed to parse properly before, return
  *  MEMO_RULE_FAILED.
  *  </summary>
  *
  *  <remarks>
  *  This method has a side-effect: if we have seen this input for
  *  this rule and successfully parsed before, then seek ahead to
  *  1 past the stop token matched for this rule last time.
  *  </remarks>
  */
 public virtual bool AlreadyParsedRule( IIntStream input, int ruleIndex )
 {
     int stopIndex = GetRuleMemoization( ruleIndex, input.Index );
     if ( stopIndex == MemoRuleUnknown )
     {
         return false;
     }
     if ( stopIndex == MemoRuleFailed )
     {
         //System.out.println("rule "+ruleIndex+" will never succeed");
         state.failed = true;
     }
     else
     {
         //System.out.println("seen rule "+ruleIndex+" before; skipping ahead to @"+(stopIndex+1)+" failed="+state.failed);
         input.Seek( stopIndex + 1 ); // jump to one past stop token
     }
     return true;
 }
开发者ID:biddyweb,项目名称:azfone-ios,代码行数:32,代码来源:BaseRecognizer.cs


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