예제 #1
0
 public INonTerminal GetSymbolForOptional(EbnfFactorOptional optional)
 {
     return new NonTerminal(Guid.NewGuid().ToString());
 }
예제 #2
0
 public INonTerminal GetSymbolForOptional(EbnfFactorOptional optional)
 {
     return(new NonTerminal(Guid.NewGuid().ToString()));
 }
예제 #3
0
        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;
        }