/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ /** Add a single terminal to the Set. * @param sym the terminal being added. * @return true if this changes the Set. */ public 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); }
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ /** Determine if the Set contains a particular terminal. * @param sym the terminal symbol we are looking for. */ public bool contains(terminal sym) { not_null(sym); return(_elements.Get(sym.index())); }
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ /** Remove a terminal if it is in the Set. * @param sym the terminal being removed. */ public void remove(terminal sym) { not_null(sym); _elements.Set(sym.index(), false); }
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ /** Determine if the Set contains a particular terminal. * @param sym the terminal symbol we are looking for. */ public bool contains(terminal sym) { not_null(sym); return _elements.Get(sym.index()); }
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ /** Remove a terminal if it is in the Set. * @param sym the terminal being removed. */ public void remove(terminal sym) { not_null(sym); _elements.Set(sym.index(),false); }
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/ /** Add a single terminal to the Set. * @param sym the terminal being added. * @return true if this changes the Set. */ public 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; }