Antlr4.Runtime.Misc.IntervalSet.Add C# (CSharp) Method

Add() public method

Add a single element to the set.
Add a single element to the set. An isolated element is stored as a range el..el.
public Add ( int el ) : void
el int
return void
        public virtual void Add(int el)
        {
            if (@readonly)
            {
                throw new InvalidOperationException("can't alter readonly IntervalSet");
            }
            Add(el, el);
        }

Same methods

IntervalSet::Add ( Interval addition ) : void
IntervalSet::Add ( int a, int b ) : void

Usage Example

 public void TestMixedRangesAndElements()
 {
     IntervalSet s = new IntervalSet();
     s.Add(1);
     s.Add('a', 'z');
     s.Add('0', '9');
     String expecting = "{1, 48..57, 97..122}";
     Assert.AreEqual(s.ToString(), expecting);
 }
All Usage Examples Of Antlr4.Runtime.Misc.IntervalSet::Add