public function nextSequence($sequence, $ignore = array())
    {
        $i = $this->index+1;
        $len = count($this->tokens);
        $seqLen = count($sequence);
        $seq = 0;
        $seqStart = 0;
        while ($i < $len) {
            $tok = $this->tokens[$i][0];
            if ($tok === $sequence[$seq]) {
                if ($seq === 0) {
                    $seqStart = $i;
                }
                $seq++;
                $i++;
                if ($seq === $seqLen) {
                    return $seqStart;
                }
            } else {
                if (in_array($tok, $ignore)) {
                } else {
                    $seq = 0;
                }
                $i++;
            }
        }
        return $len;
    }