Expression expr() { Token temp = next; Expression x = rel(); while (true) { switch (t) { case TokenKind.LogicalAnd: move(); x = new LogicalAnd(x, rel(), temp.line, temp.col); continue; case TokenKind.LogicalOr: move(); x = new LogicalOr(x, rel(), temp.line, temp.col); continue; case TokenKind.LogicalXor: move(); x = new LogicalXor(x, rel(), temp.line, temp.col); continue; default: return(x); } } }
Expression expr() { Token temp = next; Expression x = rel(); while (true) { switch (t) { case TokenKind.LogicalAnd: move(); x = new LogicalAnd(x, rel(), temp.line, temp.col); continue; case TokenKind.LogicalOr: move(); x = new LogicalOr(x, rel(), temp.line, temp.col); continue; case TokenKind.LogicalXor: move(); x = new LogicalXor(x, rel(), temp.line, temp.col); continue; default: return x; } } }