// relational expressions are left associative
while (true) {
if (nextToken == Token.OPERATOR_LESSTHAN) {
readToken(Token.OPERATOR_LESSTHAN);
right = parseShiftExpression();
left = new BinaryOperatorExpression(left, right, Token.OPERATOR_LESSTHAN);
} else if (nextToken == Token.OPERATOR_GREATERTHAN) {
readToken(Token.OPERATOR_GREATERTHAN);
right = parseShiftExpression();
left = new BinaryOperatorExpression(left, right, Token.OPERATOR_GREATERTHAN);
} else if (nextToken == Token.OPERATOR_LESSTHANOREQUAL) {
readToken(Token.OPERATOR_LESSTHANOREQUAL);
right = parseShiftExpression();
left = new BinaryOperatorExpression(left, right, Token.OPERATOR_LESSTHANOREQUAL);
} else if (nextToken == Token.OPERATOR_GREATERTHANOREQUAL) {
readToken(Token.OPERATOR_GREATERTHANOREQUAL);
right = parseShiftExpression();
left = new BinaryOperatorExpression(left, right, Token.OPERATOR_GREATERTHANOREQUAL);
} else if (nextToken == Token.KEYWORD_INSTANCEOF) {
readToken(Token.KEYWORD_INSTANCEOF);
right = parseShiftExpression();
left = new BinaryOperatorExpression(left, right, Token.KEYWORD_INSTANCEOF);
} else if (inFlag && nextToken == Token.KEYWORD_IN) {
readToken(Token.KEYWORD_IN);
right = parseShiftExpression();
left = new BinaryOperatorExpression(left, right, Token.KEYWORD_IN);
} else {
return left;
}
}
}