!7 p-exp { wordWrapConsole(); L tok = javaTokPlusBrackets(mL_raw("Logic Example")); L l = splitAtDoubleArrow(tok); if (l(l) != 2) ret; printStruct(new IfThen( parseExpression(first(l)), parseExpression(second(l)))); } static Exp parseExpression(S s) { L tok = javaTokPlusBrackets(s); L l = splitAtTokens(tok, ll("&", "", "&")); if (l(l) == 2) // TODO ret And(parseExpression(first(l)), parseExpression(second(l))); if (l(tok) == 5 && isIdentifier(tok.get(1)) && isRoundBracketed(tok.get(3))) ret Func(tok.get(1), parseExpression(deRoundBracket(tok.get(3)))); l = splitAtTokens(tok, ll("=")); if (l(l) == 2) ret Eq(parseExpression(first(l)), parseExpression(second(l))); ret Sentence(tok); } srecord IfThen(Exp in, Exp out) {} sclass Exp {} srecord Func(S name, Exp arg) extends Exp {} srecord And(Exp a, Exp b) extends Exp {} srecord Sentence(L tok) extends Exp {} srecord Eq(Exp left, Exp right) extends Exp {}