// e.g. cast req to Req; // (converts req to (Req) req for the rest of the block) svoid tok_castToStatements(LS tok) { int i; while ((i = jfind(tok, "cast to")) >= 0) { S id = tok.get(i+2); int iTypeStart = i+6; int semicolon = findEndOfStatement(tok, iTypeStart)-1; int endOfOuterBlock = findEndOfBracketPart(tok, semicolon)-1; S type = joinSubList(tok, iTypeStart, semicolon-1); tok_insertCasts_noReTok(tok, semicolon+2, endOfOuterBlock, id, type); clearTokens(tok, i, semicolon+1); reTok(tok, i, endOfOuterBlock); } }