public void FindTerminalDeclarationsTest()
        {
            //case 1: terminal defined once
            string text = "if='if'\r\n"+
                          "<expr>::=<expr>'+'<add>";

            var target = new GoldParsedDocument ();
            target.Parse (text);
            var declList = target.FindDefinitionsByType(DefinitionType.Terminal);
            Assert.NotNull (declList);
            var enumerator = declList.GetEnumerator ();

            //expecting 1 terminal definition
            // put into a sequence
            var actualList = new List<DefinitionNode> ();
            while (enumerator.MoveNext())
            {
                actualList.Add (enumerator.Current);
            }

            Assert.AreEqual (1, actualList.Count);
            Assert.AreEqual (DefinitionType.Terminal, actualList [0].Type);

            //case 2: terminal contains redefinition
            text = "if='if'\r\n"+
                    "<expr>::=<expr>'+'<add>\r\n"+
                    "if = 'IF'";
            target = new GoldParsedDocument ();
            target.Parse (text);
            enumerator = target.FindDefinitionsByType (DefinitionType.Terminal).GetEnumerator ();
            actualList.Clear ();
            while (enumerator.MoveNext())
            {
                actualList.Add (enumerator.Current);
            }

            Assert.AreEqual (2, actualList.Count);
        }
        public void TerminalLiteralsNotConfusedForTerminalsTest()
        {
            string text = "'if'='if'\r\n"+
                "<expr>::=<expr>'+'<add>";
            var target = new GoldParsedDocument ();
            target.Parse (text);
            var enumerator = target.FindDefinitionsByType (DefinitionType.Terminal).GetEnumerator ();

            //should be no results
            Assert.IsFalse (enumerator.MoveNext ());
        }