MakeFlags() private static method

private static MakeFlags ( bool negate, bool ignore, bool reverse, bool lazy ) : OpFlags
negate bool
ignore bool
reverse bool
lazy bool
return OpFlags
Example #1
0
        public void EmitSet(char lo, BitArray set, bool negate, bool ignore, bool reverse)
        {
            this.Emit(OpCode.Set, PatternCompiler.MakeFlags(negate, ignore, reverse, false));
            this.Emit((ushort)lo);
            int num = set.Length + 15 >> 4;

            this.Emit((ushort)num);
            int num2 = 0;

            while (num-- != 0)
            {
                ushort num3 = 0;
                for (int i = 0; i < 16; i++)
                {
                    if (num2 >= set.Length)
                    {
                        break;
                    }
                    if (set[num2++])
                    {
                        num3 |= (ushort)(1 << i);
                    }
                }
                this.Emit(num3);
            }
        }
Example #2
0
 public void EmitAnchor(bool reverse, int offset, LinkRef tail)
 {
     this.BeginLink(tail);
     this.Emit(OpCode.Anchor, PatternCompiler.MakeFlags(false, false, reverse, false));
     this.EmitLink(tail);
     this.Emit((ushort)offset);
 }
Example #3
0
 public void EmitFastRepeat(int min, int max, bool lazy, LinkRef tail)
 {
     this.BeginLink(tail);
     this.Emit(OpCode.FastRepeat, PatternCompiler.MakeFlags(false, false, false, lazy));
     this.EmitLink(tail);
     this.EmitCount(min);
     this.EmitCount(max);
 }
Example #4
0
 public void EmitCharacter(char c, bool negate, bool ignore, bool reverse)
 {
     this.Emit(OpCode.Character, PatternCompiler.MakeFlags(negate, ignore, reverse, false));
     if (ignore)
     {
         c = char.ToLower(c);
     }
     this.Emit((ushort)c);
 }
Example #5
0
        public void EmitString(string str, bool ignore, bool reverse)
        {
            this.Emit(OpCode.String, PatternCompiler.MakeFlags(false, ignore, reverse, false));
            int length = str.Length;

            this.Emit((ushort)length);
            if (ignore)
            {
                str = str.ToLower();
            }
            for (int i = 0; i < length; i++)
            {
                this.Emit((ushort)str[i]);
            }
        }
Example #6
0
 public void EmitRange(char lo, char hi, bool negate, bool ignore, bool reverse)
 {
     this.Emit(OpCode.Range, PatternCompiler.MakeFlags(negate, ignore, reverse, false));
     this.Emit((ushort)lo);
     this.Emit((ushort)hi);
 }
Example #7
0
 public void EmitNotCategory(Category cat, bool negate, bool reverse)
 {
     this.Emit(OpCode.NotCategory, PatternCompiler.MakeFlags(negate, false, reverse, false));
     this.Emit((ushort)cat);
 }
Example #8
0
 public void EmitReference(int gid, bool ignore, bool reverse)
 {
     this.Emit(OpCode.Reference, PatternCompiler.MakeFlags(false, ignore, reverse, false));
     this.Emit((ushort)gid);
 }