private PPToken scan() { PPToken t = new PPToken(); while (fChar != cEOF && Char.IsWhiteSpace((char) fChar)) { // Skip whitespaces nextCh(); } switch (fChar) { case '#': t.setKind(PPToken.eHash); nextCh(); break; case '!': t.setKind(PPToken.eNot); nextCh(); if (fChar == '=') { t.setKind(PPToken.eNE); nextCh(); } break; case '=': t.setKind(PPToken.eAssign); nextCh(); if (fChar == '=') { t.setKind(PPToken.eEQ); nextCh(); } break; case '&': nextCh(); if (fChar == '&') { nextCh(); t.setKind(PPToken.eAnd); } else { t.setKind(PPToken.eError); } break; case '|': nextCh(); if (fChar == '|') { nextCh(); t.setKind(PPToken.eOr); } else { t.setKind(PPToken.eError); } break; case '(': t.setKind(PPToken.eLPar); nextCh(); break; case ')': t.setKind(PPToken.eRPar); nextCh(); break; case cEOF: t.setKind(PPToken.eEOF); break; default: String val = readIdent(); if (val.Equals("true")) { t.setKind(PPToken.eTrue); } else if (val.Equals("false")) { t.setKind(PPToken.eFalse); } else { t.setKind(PPToken.eIdent); t.setValue(val); } break; } return t; }