CFGLib.CNFGrammar.RemoveProductionWithoutSimplifying C# (CSharp) Method

RemoveProductionWithoutSimplifying() protected method

protected RemoveProductionWithoutSimplifying ( Production production ) : void
production Production
return void
		protected override void RemoveProductionWithoutSimplifying(Production production) {
			if (production.Lhs == this.Start && production.Rhs.Count == 0) {
				if (_emptyProductions.Count > 0) {
					_emptyProductions.Clear();
				} else {
					throw new Exception("No production to remove");
				}
			} else if (production.IsCnfNonterminal) {
				var ntprod = production;
				_nonterminalProductions.Remove(ntprod);
			} else {
				// TODO: might not actually be a terminal production
				var tprod = production;
				_terminalProductions.Remove(tprod);
			}
			InvalidateCaches();
		}
		public override void AddProduction(Production production) {