sclass SimpleLeftToRightParser { S text; LS tok; ListAndIndex ptr; S currentToken; bool caseInsensitive; *(S text) {} *(LS tok) {} bool is(S t) { ret eqOrEqic(caseInsensitive, token, t); } void next { if (!ptr.atEnd()) { ptr(ptr.plus(2)); } void ptr(ListAndIndex ptr) { this.ptr = ptr; fetch(); } bool atEnd() { ret ptr.atEnd(); } void fetch { currentToken = ptr!; } void init { tok if null = javaTok(text); ptr(ListAndIndex(tok, 1)); } }