//----< make copy of semi >--------------------------------------

        public ITokenCollection clone()
        {
            var theClone = new Semi();
            foreach (var token in toks)
                theClone.add(token);
            return theClone;
        }
    //----< make copy of semi >--------------------------------------

    public ITokenCollection clone()
    {
      Semi theClone = new Semi();
      foreach (string token in toks)
        theClone.add(token);
      return theClone;
    }
        //----< extract contiguous subset of tokens >--------------------

        public ITokenCollection getFunctionParams()
        {
            var subset = new Semi();
            int start, end;
            if (find("(", out start))
            {
                if (!find(")", out end))
                    return subset;
            }
            else
            {
                return subset;
            }

            for (var i = start + 1; i < end; ++i) subset.add(toks[i]);
            subset.add(";");
            return subset;
        }