private void consumeFirst() throws TokenStreamException {
    consume(); // get first token of input stream

    // Handle situation where hidden or discarded tokens
    // appear first in input stream
    CommonHiddenStreamToken p=null;

    // while hidden, copied, or discarded scarf tokens
    while ( hideMask.member(LA(1).getType()) ||
            discardMask.member(LA(1).getType()) ||
            copyMask.member(LA(1).getType()) ) {

      // if we've hit one of the tokens that needs to be copied, we copy it
      // and then break out of the loop, because the parser needs to see it
      // too
      //
      if (copyMask.member(LA(1).getType())) {

        // copy the token in the lookahead
        hiddenCopy = partialCloneToken(LA(1));

        // if there's an existing token before this, link that and the
        // copy together
        if (p != null) {
          p.setHiddenAfter(hiddenCopy);
          hiddenCopy.setHiddenBefore(p); // double-link
        }

        lastHiddenToken = hiddenCopy;
        if (firstHidden == null) {
          firstHidden = hiddenCopy;
        }

        // we don't want to consume this token, because it also needs to
        // be passed through to the parser, so break out of the while look
        // entirely
        //
        break;
      } else if (hideMask.member(LA(1).getType())) {
        if (p != null) {
          p.setHiddenAfter(LA(1));
          LA(1).setHiddenBefore(p); // double-link
        }
        p = LA(1);

        lastHiddenToken = p;
        if (firstHidden == null) {
          firstHidden = p; // record hidden token if first
        }
      }
      consume();
    }
  }