Qt::MatchFlags SearchOptions::getMatchFlags() const
{

    // *** match flags ***
    // MatchExactly = 0, Performs QVariant-based matching.
    // MatchContains = 1,
    // MatchStartsWith = 2,
    // MatchEndsWith = 3,
    // MatchRegExp = 4,
    // MatchWildcard = 5,
    // MatchFixedString = 8, Performs string-based matching.
    // MatchCaseSensitive = 16,
    // MatchWrap = 32,
    // MatchRecursive = 64 Searches the entire hierarchy, but I do not have heirarchical data.

  Qt::MatchFlags flags = Qt::MatchExactly;
  if (isMatchEntireString()) flags |= Qt::MatchFixedString;
  if (isContains()) flags |= Qt::MatchContains;
  if (isStartsWith()) flags |= Qt::MatchStartsWith;
  if (isEndsWith()) flags |= Qt::MatchEndsWith;
  //if (isMatchAsString()) flags |= Qt::MatchFixedString;
  if (isRegularExpression()) flags |= Qt::MatchRegExp;
  if (isWildCard()) flags |= Qt::MatchWildcard;
  if (isCaseSensitive()) flags |= Qt::MatchCaseSensitive;
  if (isWrap()) flags |= Qt::MatchWrap;
  return flags;
}
QString SearchOptions::serializeSettings() const
{
  QStringList list;
  if (isMatchEntireString()) list << "MatchEntireString";
  if (isContains()) list << "Contains";
  if (isStartsWith()) list << "StartsWith";
  if (isEndsWith()) list << "EndsWith";

  if (isMatchAsString()) list << "AsString";
  if (isRegularExpression()) list << "RegExp";
  if (isWildCard()) list << "Wildcard";

  list << (isCaseSensitive() ? "CaseSensitive" : "CaseInSensitive");
  list << (isWrap() ? "Wrap" : "NoWrap");
  list << (isBackwards() ? "Backward" : "Forward");
  list << (isAllColumns() ? "AllColumns" : "OneColumn");
  if (isReplace()) list << "Replace";
  if (isReplaceAll()) list << "ReplaceAll";
  return list.join(",");
}
int Java5Lex::getNextLexeme() {
  int  state           = 0;     // Current state
  int  lastAcceptState = 0;     // Most recently seen accept state
  int  prevState;               // State before lastAcceptState
  int  nextState;               // Next state
  unsigned int  lookahead;      // Lookahead character
  int  anchor;                  // Anchor mode for most recently seen accepting state

  unTerminateLexeme();
  initMore();
  markStart();

  for(;;) {
    // Check end of file. If there's an unprocessed accepting state,
    // lastAcceptState will be nonzero. In this case, ignore EOF for now so
    // that you can do the accepting action; otherwise, try to open another
    // file and return if you can't.

    for(;;) {
      if(((int)(lookahead = look(1))) != EOF) {
        assert(lookahead < 256);
        nextState = nextState(state, lookahead);
        break;
      } else if(lastAcceptState != 0) {   // still something to do
        nextState = -1;
        break;
      } else if(isWrap()) {               // another file?
        terminateLexeme();
        return 0;                         // EOI
      }
    }
    if(m_debug) {
      debugState(_T("--------"), state, lookahead);
    }

    if(nextState != -1) {
      if(advance() < 0) {                 // Buffer full
        const TCHAR *tooLongMessage = _T("Lexeme too long. Discarding extra characters.");
        error(getPos(), tooLongMessage);

        flush(true);

        if(m_debug) {
          debug(tooLongMessage);
          debugState(_T("--------"), state, look(1));
        }
      }

      if(anchor = lexAccept[nextState]) { // Is this an accept state
        prevState       = state;
        lastAcceptState = nextState;
        markEnd();                        // Mark input at current character
      }                                   // A subsequent gotoMark() returns us to this position.
      state = nextState;
    } else if(lastAcceptState == 0) {     // illegal input
      error(getPos(), _istprint(lookahead)?_T("Ignore bad input:'%c'"):_T("Ignore bad input:%#x"),lookahead);

      if(m_debug) {
        debug(_T("Ignore bad input:'%c'"), lookahead);
      }

      advance();
    } else {
      if(m_debug) {
        debugState(_T("accept--"), lastAcceptState, lookahead);
      }

      gotoMark();                         // Back up to previous accept state
      if(anchor & ANCHOR_END) {           // If end anchor is active
        pushback(1);                      // Push back the CR or LF
      }
      if(anchor & ANCHOR_START) {         // If start anchor is active
        moveStart();                      // Skip the leading newline
      }
      terminateLexeme();                  // Null-terminate the string

      switch(lastAcceptState) {
      case 1:
#line 124 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        ;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 2:
#line 87 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return NOT;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 3:
#line 108 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return MOD;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 4:
#line 105 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return AND;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 5:
#line 75 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return LPAR;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 6:
#line 76 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return RPAR;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 7:
#line 103 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return STAR;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 8:
#line 101 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return PLUS;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 9:
#line 82 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return COMMA;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 10:
#line 102 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return MINUS;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 11:
#line 83 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return DOT;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 12:
#line 104 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return DIV;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 13:
      case 58:
      case 61:
      case 64:
      case 66:
#line 39 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return INTEGERLITERAL;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 14:
#line 90 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return COLON;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 15:
#line 81 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return SEMICOLON;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 16:
#line 85 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return LT;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 17:
#line 84 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return ASSIGN;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 18:
#line 86 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return GT;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 19:
#line 89 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return QUESTION;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 20:
#line 92 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return AT;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 21:
#line 48 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return nameOrKeyWord(getText());
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 22:
#line 79 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return LB;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 23:
#line 80 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return RB;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 24:
#line 107 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return XOR;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 25:
#line 77 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return LC;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 26:
#line 106 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return OR;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 27:
#line 78 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return RC;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 28:
#line 88 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return COMPLEMENT;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 29:
#line 96 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return NEQ;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 30:
#line 43 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return STRINGLITERAL;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 31:
#line 119 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return MODASSIGN;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 32:
#line 97 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return ANDAND;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 33:
#line 116 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return ANDASSIGN;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 34:
#line 114 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return STARASSIGN;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 35:
#line 99 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return PLUSPLUS;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 36:
#line 112 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return PLUSASSIGN;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 37:
#line 100 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return MINUSMINUS;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 38:
#line 113 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return MINUSASSIGN;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 39:
      case 59:
      case 62:
#line 41 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return FLOATLITERAL;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 40:
#line 50 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        { int i;
        							  SourcePosition startpos = getPos();
        							  while(i = input()) {
        							    if(i < 0) {
        							      flushBuf();  /* Discard lexeme. */
        							    } else if(i == '*' && look(1) == '/') {
        							     input();
        							     break;       /* Recognized comment.*/
        							    }
        							  }
        							  if(i == 0) {
        							    error( startpos,_T("End of file in comment\n") );
                                      }
        							}
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 41:
#line 65 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        { int i;
        							  while(i = input()) {
        							    if(i < 0) {
        							      flushBuf();  /* Discard lexeme. */
        							    } else if(i == '\n') {
        							      break;
        							    }
                                      }
        							}
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 42:
#line 115 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return DIVASSIGN;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 43:
#line 109 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return SHL;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 44:
#line 94 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return LE;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 45:
#line 93 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return EQ;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 46:
#line 95 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return GE;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 47:
#line 110 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return SSHR;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 48:
#line 118 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return XORASSIGN;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 49:
#line 117 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return ORASSIGN;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 50:
#line 98 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return OROR;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 51:
#line 45 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return CHARACTERLITERAL;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 52:
#line 91 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return ELLIPSIS;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 53:
#line 120 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return SHLASSIGN;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 54:
#line 121 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return SSHRASSIGN;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 55:
#line 111 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return USHR;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;
      case 56:
#line 122 "C:\\mytools2015\\ParserGen\\java\\Java5.lex"
        return USHRASSIGN;
#line 94 "C:\\mytools2015\\parsergen\\lib\\lexgencpp.par"
        break;

      default:
        throwException(_T("%s:Unknown accept state:%d, text=<%s>"), __TFUNCTION__, lastAcceptState,getText());
        break;
      }

      unTerminateLexeme();
      lastAcceptState = 0;

      if(isMore()) {
        state = prevState;                // Back up
        initMore();
      } else {
        state = 0;
        markStart();
      }
    }
  }
}