//    private static string BNF = @"<expr> ::= <val> <op> <val> | <val> | 1 | 2
    //
    //<op> ::= + | - | *
    //
    //<val> ::= N_m | N_s";


    public void Start(Options options) {
      CFGParser pars = new CFGParser();

      var grammar = pars.readGrammarBNF(BNF);

      long possibilities = CalcPossibilitiesOfDepth(grammar, 2);
      System.Console.WriteLine(possibilities);
    }
        private void CreateTreeFromGrammar()
        {
            if (String.IsNullOrWhiteSpace(GrammarBNF.Value))
            {
                GrammarParameter.Value  = CFGExpressionGrammar.Empty;
                GrammarParameter.Hidden = true;
                return;
            }

            CFGParser            parser  = new CFGParser();
            CFGExpressionGrammar grammar = parser.readGrammarBNF(GrammarBNF.Value);

            Grammar = grammar;
            GrammarParameter.Hidden = false;

            var operators = Parameters.OfType <IValueParameter>().Select(p => p.Value).OfType <IOperator>().Union(Operators).ToList();

            foreach (var op in operators.OfType <ISymbolicExpressionTreeGrammarBasedOperator>())
            {
                op.SymbolicExpressionTreeGrammarParameter.Value = GrammarParameter.Value;
            }
        }