if (ch == 'd') { appendCharToStr(&token.val, ch); nextCh(); if (ch == 'o') { appendCharToStr(&token.val, ch); nextCh(); if (!isLetter(ch) || isDecDigit(ch)) { return token.kind = DO; } } } if (ch == 'e') { appendCharToStr(&token.val, ch); nextCh(); if (ch == 'l') { appendCharToStr(&token.val, ch); nextCh(); if (ch == 's') { appendCharToStr(&token.val, ch); nextCh(); if (ch == 'e') { appendCharToStr(&token.val, ch); nextCh(); if (!isLetter(ch) || isDecDigit(ch)) { return token.kind = ELSE; } } } } } if (ch == 'f') { appendCharToStr(&token.val, ch); nextCh(); if (ch == 'o') { appendCharToStr(&token.val, ch); nextCh(); if (ch == 'r') { appendCharToStr(&token.val, ch); nextCh(); if (!isLetter(ch) || isDecDigit(ch)) { return token.kind = FOR; } } } } if (ch == 'i') { appendCharToStr(&token.val, ch); nextCh(); if (ch == 'f') { appendCharToStr(&token.val, ch); nextCh(); if (!isLetter(ch) || isDecDigit(ch)) { return token.kind = IF; } } } if (ch == 'w') { appendCharToStr(&token.val, ch); nextCh(); if (ch == 'h') { appendCharToStr(&token.val, ch); nextCh(); if (ch == 'i') { appendCharToStr(&token.val, ch); nextCh(); if (ch == 'l') { appendCharToStr(&token.val, ch); nextCh(); if (ch == 'e') { appendCharToStr(&token.val, ch); nextCh(); if (!isLetter(ch) || isDecDigit(ch)) { return token.kind = WHILE; } } } } } }