Antlr4.Runtime.Atn.ArrayPredictionContext.RemoveEmptyContext C# (CSharp) Method

RemoveEmptyContext() protected method

protected RemoveEmptyContext ( ) : PredictionContext
return PredictionContext
        protected internal override PredictionContext RemoveEmptyContext()
        {
            if (!HasEmpty)
            {
                return this;
            }
            if (returnStates.Length == 2)
            {
                return new SingletonPredictionContext(parents[0], returnStates[0]);
            }
            else
            {
                PredictionContext[] parents2 = Arrays.CopyOf(parents, parents.Length - 1);
                int[] returnStates2 = Arrays.CopyOf(returnStates, returnStates.Length - 1);
                return new Antlr4.Runtime.Atn.ArrayPredictionContext(parents2, returnStates2);
            }
        }