Antlr4.Analysis.AnalysisPipeline.Disjoint C# (CSharp) Method

Disjoint() public static method

public static Disjoint ( Antlr4.Runtime.Misc.IntervalSet altLook ) : bool
altLook Antlr4.Runtime.Misc.IntervalSet
return bool
        public static bool Disjoint(IntervalSet[] altLook)
        {
            bool collision = false;
            IntervalSet combined = new IntervalSet();
            if (altLook == null)
                return false;
            foreach (IntervalSet look in altLook)
            {
                if (look == null)
                    return false; // lookahead must've computation failed

                if (!look.And(combined).IsNil)
                {
                    collision = true;
                    break;
                }

                combined.AddAll(look);
            }
            return !collision;
        }
    }