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


C# BitSet.Remove方法代码示例

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


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

示例1: CombineFollows

 protected virtual BitSet CombineFollows(bool exact)
 {
     int num = this.state._fsp;
     BitSet set = new BitSet();
     for (int i = num; i >= 0; i--)
     {
         BitSet a = this.state.following[i];
         set.OrInPlace(a);
         if (exact)
         {
             if (!a.Member(1))
             {
                 return set;
             }
             if (i > 0)
             {
                 set.Remove(1);
             }
         }
     }
     return set;
 }
开发者ID:brunolauze,项目名称:mysql-connector-net-6,代码行数:22,代码来源:BaseRecognizer.cs

示例2: CombineFollows

		protected internal virtual BitSet CombineFollows(bool exact)
		{
			int top = state.followingStackPointer;
			BitSet followSet = new BitSet();
			for (int i = top; i >= 0; i--)
			{
				BitSet localFollowSet = (BitSet)state.following[i];
				followSet.OrInPlace(localFollowSet);
				if (exact) {
					// can we see end of rule?
					if (localFollowSet.Member(Token.EOR_TOKEN_TYPE)) {
						// Only leave EOR in set if at top (start rule); this lets
						// us know if have to include follow(start rule); i.e., EOF
						if (i > 0) {
							followSet.Remove(Token.EOR_TOKEN_TYPE);
						}
					}
					else { // can't see end of rule, quit
						break;
					}
				}
			}
			return followSet;
		}
开发者ID:sebasjm,项目名称:antlr,代码行数:24,代码来源:BaseRecognizer.cs

示例3: MismatchIsMissingToken

		public bool MismatchIsMissingToken(IIntStream input, BitSet follow) {
			if (follow == null) {
				// we have no information about the follow; we can only consume
				// a single token and hope for the best
				return false;
			}

			// compute what can follow this grammar element reference
			if (follow.Member(Token.EOR_TOKEN_TYPE)) {
				BitSet viableTokensFollowingThisRule = ComputeContextSensitiveRuleFOLLOW();
				follow = follow.Or(viableTokensFollowingThisRule);
				if (state.followingStackPointer >= 0) { // remove EOR if we're not the start symbol
					follow.Remove(Token.EOR_TOKEN_TYPE);
				}
			}

			// if current token is consistent with what could come after set
			// then we know we're missing a token; error recovery is free to
			// "insert" the missing token

			// BitSet cannot handle negative numbers like -1 (EOF) so I leave EOR
			// in follow set to indicate that the fall of the start symbol is
			// in the set (EOF can follow).
			if ( follow.Member(input.LA(1)) || follow.Member(Token.EOR_TOKEN_TYPE) ) {
				return true;
			}
			return false;
		}
开发者ID:sebasjm,项目名称:antlr,代码行数:28,代码来源:BaseRecognizer.cs

示例4: CombineFollows

 // what is exact? it seems to only add sets from above on stack
 // if EOR is in set i.  When it sees a set w/o EOR, it stops adding.
 // Why would we ever want them all?  Maybe no viable alt instead of
 // mismatched token?
 protected virtual BitSet CombineFollows(bool exact)
 {
     int top = state._fsp;
     BitSet followSet = new BitSet();
     for ( int i = top; i >= 0; i-- )
     {
         BitSet localFollowSet = (BitSet)state.following[i];
         /*
         System.out.println("local follow depth "+i+"="+
                            localFollowSet.toString(getTokenNames())+")");
          */
         followSet.OrInPlace( localFollowSet );
         if ( exact )
         {
             // can we see end of rule?
             if ( localFollowSet.Member( TokenTypes.EndOfRule ) )
             {
                 // Only leave EOR in set if at top (start rule); this lets
                 // us know if have to include follow(start rule); i.e., EOF
                 if ( i > 0 )
                 {
                     followSet.Remove( TokenTypes.EndOfRule );
                 }
             }
             else
             { // can't see end of rule, quit
                 break;
             }
         }
     }
     return followSet;
 }
开发者ID:biddyweb,项目名称:azfone-ios,代码行数:36,代码来源:BaseRecognizer.cs

示例5: MismatchIsMissingToken

        public virtual bool MismatchIsMissingToken( IIntStream input, BitSet follow )
        {
            if ( follow == null )
            {
                // we have no information about the follow; we can only consume
                // a single token and hope for the best
                return false;
            }
            // compute what can follow this grammar element reference
            if ( follow.Member( TokenTypes.EndOfRule ) )
            {
                BitSet viableTokensFollowingThisRule = ComputeContextSensitiveRuleFOLLOW();
                follow = follow.Or( viableTokensFollowingThisRule );
                if ( state._fsp >= 0 )
                { // remove EOR if we're not the start symbol
                    follow.Remove( TokenTypes.EndOfRule );
                }
            }
            // if current token is consistent with what could come after set
            // then we know we're missing a token; error recovery is free to
            // "insert" the missing token

            //System.out.println("viable tokens="+follow.toString(getTokenNames()));
            //System.out.println("LT(1)="+((TokenStream)input).LT(1));

            // BitSet cannot handle negative numbers like -1 (EOF) so I leave EOR
            // in follow set to indicate that the fall of the start symbol is
            // in the set (EOF can follow).
            if ( follow.Member( input.LA( 1 ) ) || follow.Member( TokenTypes.EndOfRule ) )
            {
                //System.out.println("LT(1)=="+((TokenStream)input).LT(1)+" is consistent with what follows; inserting...");
                return true;
            }
            return false;
        }
开发者ID:biddyweb,项目名称:azfone-ios,代码行数:35,代码来源:BaseRecognizer.cs

示例6: MismatchIsMissingToken

 public virtual bool MismatchIsMissingToken(IIntStream input, BitSet follow)
 {
     if (follow == null)
     {
         return false;
     }
     if (follow.Member(1))
     {
         BitSet a = this.ComputeContextSensitiveRuleFOLLOW();
         follow = follow.Or(a);
         if (this.state._fsp >= 0)
         {
             follow.Remove(1);
         }
     }
     if (!follow.Member(input.LA(1)) && !follow.Member(1))
     {
         return false;
     }
     return true;
 }
开发者ID:brunolauze,项目名称:mysql-connector-net-6,代码行数:21,代码来源:BaseRecognizer.cs


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