Beispiel #1
0
        public override Nfa GenerateNfa(bool ignoreCase)
        {
            List <RegularExpression> units = new List <RegularExpression>();
            RSequence seq;
            int       i;

            for (i = 0; i < Min; i++)
            {
                units.Add(RegularExpression);
            }

            if (HasMax && Max == -1)             // Unlimited
            {
                RZeroOrMore zoo = new RZeroOrMore();
                zoo.RegularExpression = RegularExpression;
                units.Add(zoo);
            }

            while (i++ < Max)
            {
                RZeroOrOne zoo = new RZeroOrOne();
                zoo.RegularExpression = RegularExpression;
                units.Add(zoo);
            }
            seq = new RSequence(units);
            return(seq.GenerateNfa(ignoreCase));
        }
		public override Nfa GenerateNfa(bool ignoreCase) {
			List<RegularExpression> units = new List<RegularExpression>();
			RSequence seq;
			int i;

			for (i = 0; i < Min; i++) {
				units.Add(RegularExpression);
			}

			if (HasMax && Max == -1) // Unlimited
			{
				RZeroOrMore zoo = new RZeroOrMore();
				zoo.RegularExpression = RegularExpression;
				units.Add(zoo);
			}

			while (i++ < Max) {
				RZeroOrOne zoo = new RZeroOrOne();
				zoo.RegularExpression = RegularExpression;
				units.Add(zoo);
			}
			seq = new RSequence(units);
			return seq.GenerateNfa(ignoreCase);

		}