|
39 | 39 | using System; |
40 | 40 | using System.Collections.Generic; |
41 | 41 | using System.IO; |
| 42 | +using System.Linq; |
42 | 43 | using System.Text; |
43 | 44 | using System.Windows.Forms; |
44 | 45 |
|
|
47 | 48 | using CommandLine; |
48 | 49 | using CommandLine.Text; |
49 | 50 |
|
| 51 | +using Microsoft.Msagl.Drawing; |
| 52 | +using Microsoft.Msagl.GraphViewerGdi; |
| 53 | +using Microsoft.Msagl.Layout.Layered; |
| 54 | + |
| 55 | +using Org.Edgerunner.ANTLR4.Tools.Graphing; |
| 56 | +using Org.Edgerunner.ANTLR4.Tools.Testing.Grammar; |
50 | 57 | using Org.Edgerunner.ANTLR4.Tools.Testing.GrunWin; |
51 | 58 |
|
52 | 59 | namespace Org.Edgerunner.ANTLR4.Tools.Testing.GrunDotNet |
@@ -89,9 +96,6 @@ private static void Main(string[] args) |
89 | 96 | options |= Grammar.ParseOption.Tree; |
90 | 97 | } |
91 | 98 |
|
92 | | - if (!string.IsNullOrEmpty(o.PostScript)) |
93 | | - Console.WriteLine("Option --ps is not yet supported."); |
94 | | - |
95 | 99 | var workingDirectory = Environment.CurrentDirectory; |
96 | 100 | var scanner = new Grammar.Scanner(); |
97 | 101 |
|
@@ -132,6 +136,24 @@ private static void Main(string[] args) |
132 | 136 | if (showParseTree) |
133 | 137 | Console.WriteLine(analyzer.StringSourceTree); |
134 | 138 |
|
| 139 | + if (!string.IsNullOrEmpty(o.SvgFileName)) |
| 140 | + { |
| 141 | + Console.WriteLine("--svg option is not yet supported."); |
| 142 | + |
| 143 | + //var rules = scanner.GetParserRulesForGrammar(grammar); |
| 144 | + //var grapher = new ParseTreeGrapher(analyzer.ParseContext, rules.ToList()) |
| 145 | + //{ |
| 146 | + // BackgroundColor = Color.LightBlue, |
| 147 | + // BorderColor = Color.Black, |
| 148 | + // TextColor = Color.Black |
| 149 | + //}; |
| 150 | + //var graph = grapher.CreateGraph(); |
| 151 | + //graph.LayoutAlgorithmSettings = new SugiyamaLayoutSettings(); |
| 152 | + //GraphRenderer renderer = new GraphRenderer(graph); |
| 153 | + //renderer.CalculateLayout(); |
| 154 | + //SvgGraphWriter.Write(graph, o.SvgFileName, null, null, 4); |
| 155 | + } |
| 156 | + |
135 | 157 | if (loadGui) |
136 | 158 | LoadGui(data, grammar, o.RuleName); |
137 | 159 | }) |
|
0 commit comments