public INonTerminal GetSymbolForOptional(EbnfFactorOptional optional) { return new NonTerminal(Guid.NewGuid().ToString()); }
public INonTerminal GetSymbolForOptional(EbnfFactorOptional optional) { return(new NonTerminal(Guid.NewGuid().ToString())); }
IEnumerable<ProductionModel> Optional(EbnfFactorOptional optional, ProductionModel currentProduction) { var name = optional.ToString(); var nonTerminal = new NonTerminal(name); var optionalProduction = new ProductionModel(nonTerminal); currentProduction.AddWithAnd(new NonTerminalModel(nonTerminal)); var expression = optional.Expression; foreach (var production in Expression(expression, optionalProduction)) yield return production; optionalProduction.Lambda(); yield return optionalProduction; }