void EmitCharacter (char c, bool negate, bool ignore, bool reverse);
void EmitCategory (Category cat, bool negate, bool reverse);
+ void EmitNotCategory (Category cat, bool negate, bool reverse);
void EmitRange (char lo, char hi, bool negate, bool ignore, bool reverse);
void EmitSet (char lo, BitArray set, bool negate, bool ignore, bool reverse);
}
public int GroupCount {
- get { return pattern[0]; }
+ get { return pattern[1]; }
}
public IDictionary Mapping {
Emit (OpCode.True);
}
+ void EmitCount (int count)
+ {
+ uint ucount = (uint) count;
+ Emit ((ushort) (ucount & 0xFFFF)); // lo 16bits
+ Emit ((ushort) (ucount >> 16)); // hi
+ }
+
public void EmitCharacter (char c, bool negate, bool ignore, bool reverse) {
Emit (OpCode.Character, MakeFlags (negate, ignore, reverse, false));
Emit ((ushort)cat);
}
+ public void EmitNotCategory (Category cat, bool negate, bool reverse) {
+ Emit (OpCode.NotCategory, MakeFlags (negate, false, reverse, false));
+ Emit ((ushort)cat);
+ }
+
public void EmitRange (char lo, char hi, bool negate, bool ignore, bool reverse) {
Emit (OpCode.Range, MakeFlags (negate, ignore, reverse, false));
Emit ((ushort)lo);
BeginLink (until);
Emit (OpCode.Repeat, MakeFlags (false, false, false, lazy));
EmitLink (until);
- Emit ((ushort)min);
- Emit ((ushort)max);
+ EmitCount (min);
+ EmitCount (max);
}
public void EmitUntil (LinkRef repeat) {
BeginLink (tail);
Emit (OpCode.FastRepeat, MakeFlags (false, false, false, lazy));
EmitLink (tail);
- Emit ((ushort)min);
- Emit ((ushort)max);
+ EmitCount (min);
+ EmitCount (max);
}
public void EmitIn (LinkRef tail) {
public void EmitInfo (int count, int min, int max) {
Emit (OpCode.Info);
- Emit ((ushort)count);
- Emit ((ushort)min);
- Emit ((ushort)max);
+ EmitCount (count);
+ EmitCount (min);
+ EmitCount (max);
}
public LinkRef NewLink () {