configs)
{
foreach (ATNConfig config in configs)
{
- if (!(config.GetState() is RuleStopState))
+ if (!(config.State is RuleStopState))
{
return false;
}
@@ -363,7 +362,7 @@ namespace Antlr4.Runtime.Atn
/// ATNConfig#context
/// values
/// but different
- /// ATNConfig.GetAlt()
+ /// ATNConfig.Alt()
/// value, e.g.
/// (s, i, ctx, _)
/// and
@@ -392,7 +391,7 @@ namespace Antlr4.Runtime.Atn
/// :
///
/// map[c] U= c.
- /// getAlt()
+ /// getAlt()
/// # map hash/equals uses s and x, not
/// alt and not pred
///
@@ -644,7 +643,7 @@ namespace Antlr4.Runtime.Atn
///
/// {1,2},{1,2}}}, etc...
///
- public static int ResolvesToJustOneViableAlt(ICollection altsets)
+ public static int ResolvesToJustOneViableAlt(IEnumerable altsets)
{
return GetSingleViableAlt(altsets);
}
@@ -668,7 +667,7 @@ namespace Antlr4.Runtime.Atn
/// > 1, otherwise
/// false
///
- public static bool AllSubsetsConflict(ICollection altsets)
+ public static bool AllSubsetsConflict(IEnumerable altsets)
{
return !HasNonConflictingAltSet(altsets);
}
@@ -692,7 +691,7 @@ namespace Antlr4.Runtime.Atn
/// 1, otherwise
/// false
///
- public static bool HasNonConflictingAltSet(ICollection altsets)
+ public static bool HasNonConflictingAltSet(IEnumerable altsets)
{
foreach (BitSet alts in altsets)
{
@@ -723,7 +722,7 @@ namespace Antlr4.Runtime.Atn
/// > 1, otherwise
/// false
///
- public static bool HasConflictingAltSet(ICollection altsets)
+ public static bool HasConflictingAltSet(IEnumerable altsets)
{
foreach (BitSet alts in altsets)
{
@@ -750,7 +749,7 @@ namespace Antlr4.Runtime.Atn
/// others, otherwise
/// false
///
- public static bool AllSubsetsEqual(ICollection altsets)
+ public static bool AllSubsetsEqual(IEnumerable altsets)
{
IEnumerator it = altsets.GetEnumerator();
BitSet first = it.Next();
@@ -773,7 +772,7 @@ namespace Antlr4.Runtime.Atn
/// .
///
/// a collection of alternative subsets
- public static int GetUniqueAlt(ICollection altsets)
+ public static int GetUniqueAlt(IEnumerable altsets)
{
BitSet all = GetAlts(altsets);
if (all.Cardinality() == 1)
@@ -800,7 +799,7 @@ namespace Antlr4.Runtime.Atn
/// the set of represented alternatives in
/// altsets
///
- public static BitSet GetAlts(ICollection altsets)
+ public static BitSet GetAlts(IEnumerable altsets)
{
BitSet all = new BitSet();
foreach (BitSet alts in altsets)
@@ -821,13 +820,14 @@ namespace Antlr4.Runtime.Atn
/// :
///
/// map[c] U= c.
- /// getAlt()
+ /// getAlt()
/// # map hash/equals uses s and x, not
/// alt and not pred
///
///
[NotNull]
- public static ICollection GetConflictingAltSubsets(ATNConfigSet configs)
+ public static ICollection GetConflictingAltSubsets(IEnumerable
+ configs)
{
PredictionMode.AltAndContextMap configToAlts = new PredictionMode.AltAndContextMap
();
@@ -839,7 +839,7 @@ namespace Antlr4.Runtime.Atn
alts = new BitSet();
configToAlts.Put(c, alts);
}
- alts.Set(c.GetAlt());
+ alts.Set(c.Alt);
}
return configToAlts.Values;
}
@@ -856,28 +856,28 @@ namespace Antlr4.Runtime.Atn
/// map[c.
/// state
/// ] U= c.
- /// getAlt()
+ /// getAlt()
///
///
[NotNull]
- public static IDictionary GetStateToAltMap(ATNConfigSet configs
- )
+ public static IDictionary GetStateToAltMap(IEnumerable configs)
{
IDictionary m = new Dictionary();
foreach (ATNConfig c in configs)
{
- BitSet alts = m.Get(c.GetState());
+ BitSet alts = m.Get(c.State);
if (alts == null)
{
alts = new BitSet();
- m.Put(c.GetState(), alts);
+ m.Put(c.State, alts);
}
- alts.Set(c.GetAlt());
+ alts.Set(c.Alt);
}
return m;
}
- public static bool HasStateAssociatedWithOneAlt(ATNConfigSet configs)
+ public static bool HasStateAssociatedWithOneAlt(IEnumerable configs)
{
IDictionary x = GetStateToAltMap(configs);
foreach (BitSet alts in x.Values)
@@ -890,7 +890,7 @@ namespace Antlr4.Runtime.Atn
return false;
}
- public static int GetSingleViableAlt(ICollection altsets)
+ public static int GetSingleViableAlt(IEnumerable altsets)
{
BitSet viableAlts = new BitSet();
foreach (BitSet alts in altsets)
diff --git a/Antlr4.Runtime/Dfa/DFASerializer.cs b/Antlr4.Runtime/Dfa/DFASerializer.cs
index 6a2c3da8f..ab05ba46e 100644
--- a/Antlr4.Runtime/Dfa/DFASerializer.cs
+++ b/Antlr4.Runtime/Dfa/DFASerializer.cs
@@ -209,7 +209,7 @@ namespace Antlr4.Runtime.Dfa
stateStr += "*";
foreach (ATNConfig config in s.configs)
{
- if (config.GetReachesIntoOuterContext())
+ if (config.ReachesIntoOuterContext)
{
stateStr += "*";
break;
diff --git a/Antlr4.Runtime/Misc/TestRig.cs b/Antlr4.Runtime/Misc/TestRig.cs
index 8460f7503..92d6e6954 100644
--- a/Antlr4.Runtime/Misc/TestRig.cs
+++ b/Antlr4.Runtime/Misc/TestRig.cs
@@ -283,7 +283,7 @@ namespace Antlr4.Runtime.Misc
if (diagnostics)
{
parser.AddErrorListener(new DiagnosticErrorListener());
- parser.Interpreter.SetPredictionMode(PredictionMode.LlExactAmbigDetection);
+ parser.Interpreter.PredictionMode = PredictionMode.LlExactAmbigDetection;
}
if (printTree || gui || psFile != null)
{
@@ -292,7 +292,7 @@ namespace Antlr4.Runtime.Misc
if (Sll)
{
// overrides diagnostics
- parser.Interpreter.SetPredictionMode(PredictionMode.Sll);
+ parser.Interpreter.PredictionMode = PredictionMode.Sll;
}
parser.SetInputStream(tokens);
parser.Trace = trace;
diff --git a/Antlr4.Runtime/ProxyErrorListener`1.cs b/Antlr4.Runtime/ProxyErrorListener`1.cs
index 3a1b57ccd..ec517d078 100644
--- a/Antlr4.Runtime/ProxyErrorListener`1.cs
+++ b/Antlr4.Runtime/ProxyErrorListener`1.cs
@@ -36,17 +36,19 @@ namespace Antlr4.Runtime
/// Sam Harwell
public class ProxyErrorListener : IAntlrErrorListener
{
- private readonly ICollection> delegates;
+ private readonly IEnumerable> delegates;
- public ProxyErrorListener(ICollection> delegates)
+ public ProxyErrorListener(IEnumerable> delegates)
{
this.delegates = delegates;
}
- protected internal virtual ICollection> GetDelegates(
- )
+ protected internal virtual IEnumerable> Delegates
{
- return delegates;
+ get
+ {
+ return delegates;
+ }
}
public virtual void SyntaxError(Recognizer recognizer, T offendingSymbol
diff --git a/Antlr4.Runtime/ProxyParserErrorListener.cs b/Antlr4.Runtime/ProxyParserErrorListener.cs
index ef48ed9e6..3dc3b80e8 100644
--- a/Antlr4.Runtime/ProxyParserErrorListener.cs
+++ b/Antlr4.Runtime/ProxyParserErrorListener.cs
@@ -46,7 +46,7 @@ namespace Antlr4.Runtime
public virtual void ReportAmbiguity(Parser recognizer, DFA dfa, int startIndex, int
stopIndex, BitSet ambigAlts, ATNConfigSet configs)
{
- foreach (IAntlrErrorListener listener in GetDelegates())
+ foreach (IAntlrErrorListener listener in Delegates)
{
if (!(listener is IParserErrorListener))
{
@@ -61,7 +61,7 @@ namespace Antlr4.Runtime
public virtual void ReportAttemptingFullContext(Parser recognizer, DFA dfa, int startIndex
, int stopIndex, SimulatorState initialState)
{
- foreach (IAntlrErrorListener listener in GetDelegates())
+ foreach (IAntlrErrorListener listener in Delegates)
{
if (!(listener is IParserErrorListener))
{
@@ -76,7 +76,7 @@ namespace Antlr4.Runtime
public virtual void ReportContextSensitivity(Parser recognizer, DFA dfa, int startIndex
, int stopIndex, SimulatorState acceptState)
{
- foreach (IAntlrErrorListener listener in GetDelegates())
+ foreach (IAntlrErrorListener listener in Delegates)
{
if (!(listener is IParserErrorListener))
{
diff --git a/reference/antlr4 b/reference/antlr4
index e4d1c14c8..7e785daa6 160000
--- a/reference/antlr4
+++ b/reference/antlr4
@@ -1 +1 @@
-Subproject commit e4d1c14c8df3f27105e3bbf935d49f500bc3552e
+Subproject commit 7e785daa65e15f9786218e5dd63ea5a3cecf67a8