public void TestCreateDot()
        {
            ANTLRStringStream input = new ANTLRStringStream( "3 * x" );
            SimpleExpressionLexer lexer = new SimpleExpressionLexer( input );
            CommonTokenStream tokens = new CommonTokenStream( lexer );
            SimpleExpressionParser parser = new SimpleExpressionParser( tokens );
            var result = parser.expression();

            var tree = result.Tree;
            var adaptor = parser.TreeAdaptor;

            DotTreeGenerator gen = new DotTreeGenerator();
            string output = gen.ToDot( tree, adaptor );
            string newline = Environment.NewLine;
            string expected =
                @"digraph {" + newline
                + newline
                + @"	ordering=out;" + newline
                + @"	ranksep=.4;" + newline
                + @"	bgcolor=""lightgrey""; node [shape=box, fixedsize=false, fontsize=12, fontname=""Helvetica-bold"", fontcolor=""blue""" + newline
                + @"		width=.25, height=.25, color=""black"", fillcolor=""white"", style=""filled, solid, bold""];" + newline
                + @"	edge [arrowsize=.5, color=""black"", style=""bold""]" + newline
                + newline
                + @"  n0 [label=""""];" + newline
                + @"  n1 [label=""*""];" + newline
                + @"  n1 [label=""*""];" + newline
                + @"  n2 [label=""3""];" + newline
                + @"  n3 [label=""x""];" + newline
                + @"  n4 [label=""""];" + newline
                + newline
                + @"  n0 -> n1 // """" -> ""*""" + newline
                + @"  n1 -> n2 // ""*"" -> ""3""" + newline
                + @"  n1 -> n3 // ""*"" -> ""x""" + newline
                + @"  n0 -> n4 // """" -> """"" + newline
                + newline
                + @"}" + newline
                + @"";

            Assert.AreEqual( expected, output );
        }
 public void CanParseSuffixes(string source, string result) {
     var parser = new SimpleExpressionParser();
     parser.Operators = new[] {'+'};
     parser.Suffixes = new[] {'*'};
     Assert.AreEqual(result, parser.Parse(source).GetDescriptiveString());
 }