Пример #1
0
 public INonTerminal GetSymbolForRepetition(EbnfFactorRepetition repetition)
 {
     return new NonTerminal(Guid.NewGuid().ToString());
 }
Пример #2
0
 public INonTerminal GetSymbolForRepetition(EbnfFactorRepetition repetition)
 {
     return(new NonTerminal(Guid.NewGuid().ToString()));
 }
Пример #3
0
        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;
        }