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
Esempio n. 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);
            }
        }
Esempio n. 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);
 }
Esempio n. 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);
 }
Esempio n. 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);
 }
Esempio n. 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]);
            }
        }
Esempio n. 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);
 }
Esempio n. 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);
 }
Esempio n. 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);
 }