private void InitIds()
        {
            var i = 1;

            foreach (var v in Cfg.Variables.Concat(Cfg.GetNonVariableSymbols()))
            {
                v.UnqiueId = i++;
            }
        }
        private void InitializeProductionsByGrammarSymbolsInRightHandSide()
        {
            foreach (var v in Cfg.Variables.Concat(Cfg.GetNonVariableSymbols()).ToList())
            {
                productionsByGrammarSymbolsInRightHandSide[v] = new List <Production>();
            }

            foreach (var prod in Cfg.GetProductions())
            {
                foreach (var v in prod.Rhs.Distinct().ToList())
                {
                    productionsByGrammarSymbolsInRightHandSide[v].Add(prod);
                }
            }
        }