Exemplo n.º 1
0
        public void RemoveNullablesTest()
        {
            var dict = new Dictionary <string, List <RHS> >();

            dict.Add("S", new List <RHS> {
                new RHS('a', new List <string> {
                    "M", "B"
                })
            });
            dict.Add("M", new List <RHS> {
                new RHS('a', new List <string> {
                    "M", "B"
                }), new RHS('_')
            });
            dict.Add("B", new List <RHS> {
                new RHS('b')
            });
            var cfg = new CFG("S", dict);

            Assert.AreEqual("S->aMB|aB\nM->aMB|aB\nB->b\n", cfg.RemoveNullables().ToString());
        }