private void fetchWord() { String word = ""; while (Char.IsWhiteSpace(Statement[index])) { index++; } // index now points to non-whitespace char while (!Char.IsWhiteSpace(Statement[index])) { word += Statement[index]; index++; } // index now points to whitespace char // word now contains a whole word currentWordType = getWordType(word); currentWord = word; }
public ConditionParser(String statement) { currentWord = ""; currentWordType = ENUM_WORD_TYPE.UNKNOWN; Parse(statement); }