private static INfa CharacterClass(RegexCharacterClass characterClass, bool negate)
        {
            switch (characterClass.NodeType)
            {
                case RegexNodeType.RegexCharacterClass:
                    return UnitRange(characterClass.CharacterRange, negate);

                case RegexNodeType.RegexCharacterClassAlteration:
                    var alteration = characterClass as RegexCharacterClassAlteration;
                    return Union(
                        UnitRange(alteration.CharacterRange, negate),
                        CharacterClass(alteration.CharacterClass, negate));
            }
            throw new InvalidOperationException("Unreachable code detected.");
        }
Esempio n. 2
0
 public RegexSet(RegexCharacterClass characterClass, bool negate)
 {
     Negate         = negate;
     CharacterClass = characterClass;
     this.hashCode  = ComputeHashCode();
 }
Esempio n. 3
0
 public RegexSet(bool negate, RegexCharacterClass characterClass)
 {
     Negate = negate;
     CharacterClass = characterClass;
     _hashCode = ComputeHashCode();
 }
Esempio n. 4
0
 public RegexCharacterClassAlteration(RegexCharacters characterRange, RegexCharacterClass characterClass)
     : base(characterRange)
 {
     CharacterClass = characterClass;
 }