diff --git a/runtime/CSharp/Antlr4.Runtime/Atn/ATNConfigSet.cs b/runtime/CSharp/Antlr4.Runtime/Atn/ATNConfigSet.cs index e4abf06c1..59f84a47d 100644 --- a/runtime/CSharp/Antlr4.Runtime/Atn/ATNConfigSet.cs +++ b/runtime/CSharp/Antlr4.Runtime/Atn/ATNConfigSet.cs @@ -430,15 +430,11 @@ namespace Antlr4.Runtime.Atn throw new NotSupportedException("Not supported yet."); } - public virtual bool ContainsAll<_T0>(ICollection<_T0> c) + public virtual bool ContainsAll(IEnumerable c) { - foreach (object o in c) + foreach (ATNConfig o in c) { - if (!(o is ATNConfig)) - { - return false; - } - if (!Contains((ATNConfig)o)) + if (!Contains(o)) { return false; } diff --git a/runtime/CSharp/Antlr4.Runtime/Atn/ATNSimulator.cs b/runtime/CSharp/Antlr4.Runtime/Atn/ATNSimulator.cs index 1d89a955a..f618fb168 100644 --- a/runtime/CSharp/Antlr4.Runtime/Atn/ATNSimulator.cs +++ b/runtime/CSharp/Antlr4.Runtime/Atn/ATNSimulator.cs @@ -49,17 +49,15 @@ namespace Antlr4.Runtime.Atn /// Must distinguish between missing edge and edge we know leads nowhere [NotNull] - public static readonly DFAState Error; + public static readonly DFAState Error = + new DFAState(new ATNConfigSet(), 0, 0) + { + stateNumber = int.MaxValue + }; [NotNull] public readonly ATN atn; - static ATNSimulator() - { - Error = new DFAState(new ATNConfigSet(), 0, 0); - Error.stateNumber = int.MaxValue; - } - public ATNSimulator(ATN atn) { this.atn = atn; diff --git a/runtime/CSharp/Antlr4.Runtime/Dfa/AbstractEdgeMap`1.cs b/runtime/CSharp/Antlr4.Runtime/Dfa/AbstractEdgeMap`1.cs index 77f4a8c5e..fbb5b8229 100644 --- a/runtime/CSharp/Antlr4.Runtime/Dfa/AbstractEdgeMap`1.cs +++ b/runtime/CSharp/Antlr4.Runtime/Dfa/AbstractEdgeMap`1.cs @@ -42,7 +42,7 @@ namespace Antlr4.Runtime.Dfa protected internal readonly int maxIndex; - public AbstractEdgeMap(int minIndex, int maxIndex) + protected AbstractEdgeMap(int minIndex, int maxIndex) { // the allowed range (with minIndex and maxIndex inclusive) should be less than 2^32 System.Diagnostics.Debug.Assert(maxIndex - minIndex + 1 >= 0); diff --git a/runtime/CSharp/Antlr4BuildTasks/Antlr4BuildTasks.csproj b/runtime/CSharp/Antlr4BuildTasks/Antlr4BuildTasks.csproj index 4f504439b..883892bb8 100644 --- a/runtime/CSharp/Antlr4BuildTasks/Antlr4BuildTasks.csproj +++ b/runtime/CSharp/Antlr4BuildTasks/Antlr4BuildTasks.csproj @@ -51,6 +51,7 @@ + @@ -62,6 +63,11 @@ Key.snk + + + CustomDictionary.xml + +