Example #1
0
		public RepetitionConstruction(RepetitionForm repetition)
		{
			Contract.Requires(repetition != null);

			Repetition = repetition;
			selectedLeavesPerParseElement = new TinyIndexedCollection<List<ReadOnlyCollection<LeafIndex>>, RepetitionFormIndex>();
			//Contract.Requires(Contract.ForAll(this, t => t.Repetition.MinimumRepetitionCount <= t.Count && t.Count <= t.Repetition.MaximumRepetitionCount));
		}
Example #2
0
			private RepetitionFormIndex(ParseFormIndex parseIndex, RepetitionForm repetitionForm, bool throwIfNotContained)
				: this()
			{
				//concat concatenates the stretches
				Index = repetitionForm.Concat().IndexOf(parseIndex);
				if (throwIfNotContained)
					Contract.Assert(Index != -1, "The specified parse element is not part of the specified repetition");
			}
Example #3
0
			/// <summary> May return an index with value -1. </summary>
			public static RepetitionFormIndex TryCreate(ParseFormIndex parseIndex, RepetitionForm repetitionForm)
			{
				return new RepetitionFormIndex(parseIndex, repetitionForm, false);
			}
Example #4
0
			public RepetitionFormIndex(ParseFormIndex parseIndex, RepetitionForm repetitionForm)
				: this(parseIndex, repetitionForm, true)
			{
			}