예제 #1
0
        /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
        /// <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;
        }
예제 #2
0
        /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/

        /// <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);
        }
예제 #3
0
        /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/

        /// <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()));
        }
예제 #4
0
        /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/

        /// <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);
        }
예제 #5
0
 /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
 /// <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);
 }
예제 #6
0
 /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
 /// <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());
 }