!7 sclass LinkedToken { S t; LinkedToken prev, next; LinkedToken prevIdentical, nextIdentical; *() {} *(S *t) {} } sclass Tokenization { LinkedToken first, last; new Map firstByContent; new Map lastByContent; } p { L tokens = javaTok(text); new Tokenization tok; for i over tokens: { S t = tok.get(i); LinkedToken lt = new(t); lt.t = t; if (tok.first == null) tok.first = lt; else { lt.prev = tok.last; tok.last.next = lt; } tok.last = lt; LinkedToken prevIdentical = tok.lastByContent.get(t); if (prevIdentical == null) tok.firstByContent.put(t, lt); } tok = LinkedList }