Merge branch 'sharpen'

This commit is contained in:
Sam Harwell 2013-02-16 10:47:24 -06:00
commit 5bee542d79
6 changed files with 7 additions and 55 deletions

View File

@ -856,7 +856,7 @@ namespace Antlr4.Runtime.Atn
);
}
IList<ATNConfig> closureConfigs = new List<ATNConfig>(s0.configs);
IntegerList contextElements = null;
List<int> contextElements = null;
ATNConfigSet reach = new ATNConfigSet();
bool stepIntoGlobal;
do
@ -926,7 +926,7 @@ namespace Antlr4.Runtime.Atn
int nextContextElement = GetReturnState(remainingGlobalContext);
if (contextElements == null)
{
contextElements = new IntegerList();
contextElements = new List<int>();
}
if (remainingGlobalContext.IsEmpty())
{
@ -1928,7 +1928,7 @@ namespace Antlr4.Runtime.Atn
[NotNull]
protected internal virtual DFAState AddDFAEdge(DFA dfa, DFAState fromState, int t
, IntegerList contextTransitions, ATNConfigSet toConfigs, PredictionContextCache
, List<int> contextTransitions, ATNConfigSet toConfigs, PredictionContextCache
contextCache)
{
System.Diagnostics.Debug.Assert(dfa.IsContextSensitive() || contextTransitions ==

View File

@ -706,9 +706,9 @@ namespace Antlr4.Runtime.Misc
return n;
}
public virtual IntegerList ToIntegerList()
public virtual List<int> ToIntegerList()
{
IntegerList values = new IntegerList(Size());
List<int> values = new List<int>(Size());
int n = intervals.Count;
for (int i = 0; i < n; i++)
{

View File

@ -32,8 +32,6 @@ using System.Text;
using Antlr4.Runtime;
using Antlr4.Runtime.Misc;
using Antlr4.Runtime.Tree;
using Antlr4.Runtime.Tree.Gui;
using Javax.Swing;
using Sharpen;
namespace Antlr4.Runtime
@ -195,21 +193,6 @@ namespace Antlr4.Runtime
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>
/// <exception cref="System.IO.IOException"></exception>
/// <exception cref="Javax.Print.PrintException"></exception>

View File

@ -28,12 +28,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System.Collections.Generic;
using System.IO;
using System.Text;
using Antlr4.Runtime;
using Antlr4.Runtime.Misc;
using Antlr4.Runtime.Tree;
using Antlr4.Runtime.Tree.Gui;
using Sharpen;
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>
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>
/// <remarks>
/// Print out a whole tree in LISP form.

@ -1 +1 @@
Subproject commit 878b34fecc519d3eb131fa5f83db6a6a70face61
Subproject commit 15c7bc6a2623747ddfb9e19d923d1119e9af538f

View File

@ -186,6 +186,7 @@
-typeMapping org.antlr.v4.runtime.misc.Tuple System.Tuple
-typeMapping org.antlr.v4.runtime.misc.Tuple2<,> System.Tuple
-typeMapping org.antlr.v4.runtime.misc.Tuple3<,,> System.Tuple
-typeMapping org.antlr.v4.runtime.misc.IntegerList System.Collections.Generic.List<int>
-typeMapping org.antlr.v4.runtime.ANTLRErrorListener<> IAntlrErrorListener
-typeMapping org.antlr.v4.runtime.ANTLRErrorStrategy IAntlrErrorStrategy