public void TestGrammarWithConflicts3_CanParseFieldList()
        {
            var grammar = new ConflictResolutionTestGrammar3();
              var parser = new Parser(grammar);
              var sample = FieldListSample;
              var tree = parser.Parse(sample);
              Assert.IsNotNull(tree);
              Assert.IsFalse(tree.HasErrors());

              Assert.IsNotNull(tree.Root);
              var term = tree.Root.Term as NonTerminal;
              Assert.IsNotNull(term);
              Assert.AreEqual("StatementList", term.Name);

              Assert.AreEqual(2, tree.Root.ChildNodes.Count);
              var nodes = tree.Root.ChildNodes.Select(t => t.FirstChild).ToArray();
              Assert.AreEqual("fieldDef", nodes[0].Term.Name);
              Assert.AreEqual("fieldDef", nodes[1].Term.Name);
        }
 public void TestGrammarWithConflicts3_HasErrors()
 {
     var grammar = new ConflictResolutionTestGrammar3();
       var parser = new Parser(grammar);
       Assert.IsTrue(parser.Language.Errors.Count > 0);
 }
 public void TestGrammarWithConflicts3_CannotParseMixedList()
 {
     var grammar = new ConflictResolutionTestGrammar3();
       var parser = new Parser(grammar);
       var sample = MixedListSample;
       var tree = parser.Parse(sample);
       Assert.IsNotNull(tree);
       Assert.IsTrue(tree.HasErrors());
 }