Ejemplo n.º 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;
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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()));
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
 }
Ejemplo n.º 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());
 }