sclass AdaptiveIdentifierCompression { new SS shortenings; new SS expansions; S escapeWord = "xx"; S newCodeMaker = lowerCaseAlphabet(); ItIt it; void init { codeIterator if null = allWordsOfAlphabet(codeAlphabet); } S encode(S token) { if (!isIdentifier(token)) ret token; init(); S code = shortenings.get(token); if (code != null) ret code; /*new LS out; S expanded = expansion.get(code); if (expanded != null) { out.add(escapeWord); S originalCode = shortenings.get(expanded); shortenings.put(...); }*/ code = newCode(); shortenings.put(token, code); expansions.put(code, token); ret token; } S newCode() { S code; do { code = newCodeMaker!; } while (shortenings.containsKey(code)); } }