forked from jasder/antlr
Ignore GUI-related methods
This commit is contained in:
parent
4e7cd54954
commit
45ab2eb70a
|
@ -32,8 +32,6 @@ using System.Text;
|
||||||
using Antlr4.Runtime;
|
using Antlr4.Runtime;
|
||||||
using Antlr4.Runtime.Misc;
|
using Antlr4.Runtime.Misc;
|
||||||
using Antlr4.Runtime.Tree;
|
using Antlr4.Runtime.Tree;
|
||||||
using Antlr4.Runtime.Tree.Gui;
|
|
||||||
using Javax.Swing;
|
|
||||||
using Sharpen;
|
using Sharpen;
|
||||||
|
|
||||||
namespace Antlr4.Runtime
|
namespace Antlr4.Runtime
|
||||||
|
@ -195,21 +193,6 @@ namespace Antlr4.Runtime
|
||||||
return visitor.VisitChildren(this);
|
return visitor.VisitChildren(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Call this method to view a parse tree in a dialog box visually.</summary>
|
|
||||||
/// <remarks>Call this method to view a parse tree in a dialog box visually.</remarks>
|
|
||||||
public virtual IFuture<JDialog> Inspect(Parser parser)
|
|
||||||
{
|
|
||||||
IList<string> ruleNames = parser != null ? Arrays.AsList(parser.GetRuleNames()) :
|
|
||||||
null;
|
|
||||||
return Inspect(ruleNames);
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual IFuture<JDialog> Inspect(IList<string> ruleNames)
|
|
||||||
{
|
|
||||||
TreeViewer viewer = new TreeViewer(ruleNames, this);
|
|
||||||
return viewer.Open();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Save this tree in a postscript file</summary>
|
/// <summary>Save this tree in a postscript file</summary>
|
||||||
/// <exception cref="System.IO.IOException"></exception>
|
/// <exception cref="System.IO.IOException"></exception>
|
||||||
/// <exception cref="Javax.Print.PrintException"></exception>
|
/// <exception cref="Javax.Print.PrintException"></exception>
|
||||||
|
|
|
@ -28,12 +28,10 @@
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Antlr4.Runtime;
|
using Antlr4.Runtime;
|
||||||
using Antlr4.Runtime.Misc;
|
using Antlr4.Runtime.Misc;
|
||||||
using Antlr4.Runtime.Tree;
|
using Antlr4.Runtime.Tree;
|
||||||
using Antlr4.Runtime.Tree.Gui;
|
|
||||||
using Sharpen;
|
using Sharpen;
|
||||||
|
|
||||||
namespace Antlr4.Runtime.Tree
|
namespace Antlr4.Runtime.Tree
|
||||||
|
@ -42,36 +40,6 @@ namespace Antlr4.Runtime.Tree
|
||||||
/// <remarks>A set of utility routines useful for all kinds of ANTLR trees.</remarks>
|
/// <remarks>A set of utility routines useful for all kinds of ANTLR trees.</remarks>
|
||||||
public class Trees
|
public class Trees
|
||||||
{
|
{
|
||||||
public static string GetPS(ITree t, IList<string> ruleNames, string fontName, int
|
|
||||||
fontSize)
|
|
||||||
{
|
|
||||||
TreePostScriptGenerator psgen = new TreePostScriptGenerator(ruleNames, t, fontName
|
|
||||||
, fontSize);
|
|
||||||
return psgen.GetPS();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetPS(ITree t, IList<string> ruleNames)
|
|
||||||
{
|
|
||||||
return GetPS(t, ruleNames, "Helvetica", 11);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <exception cref="System.IO.IOException"></exception>
|
|
||||||
public static void WritePS(ITree t, IList<string> ruleNames, string fileName, string
|
|
||||||
fontName, int fontSize)
|
|
||||||
{
|
|
||||||
string ps = GetPS(t, ruleNames, fontName, fontSize);
|
|
||||||
FileWriter f = new FileWriter(fileName);
|
|
||||||
BufferedWriter bw = new BufferedWriter(f);
|
|
||||||
bw.Write(ps);
|
|
||||||
bw.Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <exception cref="System.IO.IOException"></exception>
|
|
||||||
public static void WritePS(ITree t, IList<string> ruleNames, string fileName)
|
|
||||||
{
|
|
||||||
WritePS(t, ruleNames, fileName, "Helvetica", 11);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Print out a whole tree in LISP form.</summary>
|
/// <summary>Print out a whole tree in LISP form.</summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Print out a whole tree in LISP form.
|
/// Print out a whole tree in LISP form.
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 878b34fecc519d3eb131fa5f83db6a6a70face61
|
Subproject commit 15c7bc6a2623747ddfb9e19d923d1119e9af538f
|
Loading…
Reference in New Issue