System.Text.RegularExpressions.PatternCompiler.EmitSet C# (CSharp) Method

EmitSet() public method

public EmitSet ( char lo, BitArray set, bool negate, bool ignore, bool reverse ) : void
lo char
set System.Collections.BitArray
negate bool
ignore bool
reverse bool
return void
		public void EmitSet (char lo, BitArray set, bool negate, bool ignore, bool reverse) {
			Emit (OpCode.Set, MakeFlags (negate, ignore, reverse, false));
			Emit ((ushort)lo);

			int len = (set.Length + 0xf) >> 4;
			Emit ((ushort)len);

			int b = 0;
			while (len -- != 0) {
				ushort word = 0;
				for (int i = 0; i < 16; ++ i) {
					if (b >= set.Length)
						break;
				
					if (set[b ++])
						word |= (ushort)(1 << i);
				}

				Emit (word);
			}
		}