Warning: session_start(): open(/var/lib/php/sessions/sess_83k7juuqdnloubvs7o3422muha, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
abstract sclass Proposal {
int localScore() { ret 0; }
toString { ret "[" + localScore() + "] " + sfu(this); }
}
static noToString record EnclosedIn(S l, LS contents, S r) extends Proposal {
int localScore() {
ret checkMapValue(generalMapOfOpeningToClosingBrackets(), l, r);
}
}
static noToString record Infix(LS l, S op, LS r) extends Proposal {
}
svoid parse(LS tok) {
// drop first and last
if (l(tok) >= 3)
emit(new EnclosedIn(first(tok), dropFirstAndLast_noNewList(tok), last(tok)));
for (int i = 1; i < l(tok)-1; i++)
emit(new Infix(subList(tok, 0, i), tok.get(i), subList(tok, i+1)));
}
p-exp {
LS tok = javaTokC("[(a|b), (c|d), (e|f)]");
parse(tok);
}