Beispiel #1
0
        /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/

        /** 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);
        }
Beispiel #2
0
        /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/

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

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

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

	/** 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);
}
Beispiel #6
0
	/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/

	/** 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;
}