public INonTerminal GetSymbolForRepetition(EbnfFactorRepetition repetition) { return new NonTerminal(Guid.NewGuid().ToString()); }
public INonTerminal GetSymbolForRepetition(EbnfFactorRepetition repetition) { return(new NonTerminal(Guid.NewGuid().ToString())); }
IEnumerable<ProductionModel> Repetition(EbnfFactorRepetition repetition, ProductionModel currentProduction) { var name = repetition.ToString(); var nonTerminal = new NonTerminal(name); var repetitionProduction = new ProductionModel(nonTerminal); currentProduction.AddWithAnd(new NonTerminalModel(nonTerminal)); var expression = repetition.Expression; foreach (var production in Expression(expression, repetitionProduction)) yield return production; repetitionProduction.AddWithAnd(new NonTerminalModel(nonTerminal)); repetitionProduction.Lambda(); yield return repetitionProduction; }