/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ /// <summary>Add a single terminal to the set. /// </summary> /// <param name="sym">the terminal being added. /// </param> /// <returns>true if this changes the set. /// /// </returns> public virtual bool add(terminal sym) { bool result; not_null(sym); /* see if we already have this */ result = _elements.Get(sym.index()); /* if not we add it */ if (!result) _elements.Set(sym.index(), true); return result; }
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ /// <summary>Add a single terminal to the set. /// </summary> /// <param name="sym">the terminal being added. /// </param> /// <returns>true if this changes the set. /// /// </returns> public virtual bool add(terminal sym) { bool result; not_null(sym); /* see if we already have this */ result = _elements.Get(sym.index()); /* if not we add it */ if (!result) { _elements.Set(sym.index(), true); } return(result); }
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ /// <summary>Determine if the set contains a particular terminal. /// </summary> /// <param name="sym">the terminal symbol we are looking for. /// /// </param> public virtual bool contains(terminal sym) { not_null(sym); return(_elements.Get(sym.index())); }
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ /// <summary>Remove a terminal if it is in the set. /// </summary> /// <param name="sym">the terminal being removed. /// /// </param> public virtual void remove(terminal sym) { not_null(sym); _elements.Set(sym.index(), false); }
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ /// <summary>Determine if the set contains a particular terminal. /// </summary> /// <param name="sym">the terminal symbol we are looking for. /// /// </param> public virtual bool contains(terminal sym) { not_null(sym); return _elements.Get(sym.index()); }